Id
int64 1.68k
75.6M
| PostTypeId
int64 1
2
| AcceptedAnswerId
int64 1.7k
75.6M
⌀ | ParentId
int64 1.68k
75.6M
⌀ | Score
int64 -60
3.16k
| ViewCount
int64 8
2.68M
⌀ | Body
stringlengths 1
41.1k
| Title
stringlengths 14
150
⌀ | ContentLicense
stringclasses 3
values | FavoriteCount
int64 0
1
⌀ | CreationDate
stringlengths 23
23
| LastActivityDate
stringlengths 23
23
| LastEditDate
stringlengths 23
23
⌀ | LastEditorUserId
int64 -1
21.3M
⌀ | OwnerUserId
int64 1
21.3M
⌀ | Tags
sequence |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
75,414,490 | 2 | null | 75,401,288 | 1 | null | You might what to consider using switch case logic here that way instead of 3 variables you have one and you can just pass the number.
```
import { Component } from '@angular/core';
export interface FaceSnap {
title?: string;
description?: string;
createDate?: Date;
snaps?: number;
imageUrl?: string;
location?: string;
}
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'help-dude';
snap?:FaceSnap;
ngOnInit(){
switch(this.snap?.snaps){
case(256):{
return {
title:"Senes",
description:"Mon meilleur Ami Ennemi",
createDate:new Date(),
snaps: 256,
imageUrl: "https://cdn.pixabay.com/photo/2015/05/31/16/03/teddy-bear-792273_1280.jpg",
location: "Berlin"
}
}
case(2254):{
return {
title: "Blueno",
description: "Le max",
createDate: new Date(),
snaps: 2254,
imageUrl: "https://cdn.pixabay.com/photo/2015/05/31/16/03/teddy-bear-792273_1280.jpg",
location: "München",
}
}
case(93):{
return {
title: "Linda",
description: "Best",
createDate: new Date(),
snaps: 93,
imageUrl: "https://cdn.pixabay.com/photo/2015/05/31/16/03/teddy-bear-792273_1280.jpg",
}
}
}
}
```
| null | CC BY-SA 4.0 | null | 2023-02-10T17:47:00.040 | 2023-02-10T17:47:00.040 | null | null | 21,188,593 | null |
75,414,593 | 2 | null | 19,233,415 | 0 | null | The problem with `type="number"` and `min="1"` is that it allows typing or pasting the `-` sign, the `e` sign and the `+` sign.
The problem with the `Math.abs(value)` is that it replaces the whole typed in number with `0`, which we don't want and is very frustrating.
The `e.keyCode` is very unreadable and deprecated.
The pure HTML method doesn't work in this case, you have to use JavaScript.
Remove the `type="number"` and do this:
```
function inputNumberAbs() {
var input = document.getElementsByTagName("input")[0];
var val = input.value;
val = val.replace(/^0+|[^\d.]/g, '');
input.value = val;
}
```
```
<input oninput="inputNumberAbs()">
```
## Regex explanation:
> `^0+` removes all 0s from beginning`|` OR operator`[^\d.]` remove everything that is `^`() a `\d`() or a
`.`()
This prevents the user to type or paste any of the not defined characters, like `e, -, +,` and all other characters that are not numbers.
If you don't need decimal numbers just remove `.` from regex.
| null | CC BY-SA 4.0 | null | 2023-02-10T17:57:07.233 | 2023-02-10T17:57:07.233 | null | null | 12,700,859 | null |
75,414,626 | 2 | null | 75,390,193 | 0 | null | In your `if` loops, you set
```
LINQ_SEARCH = LIST_HAVALEHA.Where(...);
```
, which means that `if` (i.e. whenever an `if` loop's condition is truthy), `LINQ_SEARCH` based on the single filtering of `LIST_HAVALEHA` that is performed in that `if` body.
As far as I can see, `LIST_HAVALEHA` itself never changes; as a result, the only filtering that is actually applied is the filtering that is applied to `LINQ_SEARCH` in the very last 'activated' `if` loop.
---
Depending on your desired output, I'd suggest one of two approaches to get around this:
1. If you want to display all havaleha items when no filters are applied, you can set LINQ_SEARCH equal to LIST_HAVALEHA prior to applying the filters, and then applying the filters to LINQ_SEARCH in your if loops:
```
IEnumerable<HAVALEHA_MODEL> LINQ_SEARCH = LIST_HAVALEHA;
if (!string.IsNullOrEmpty(CUST_N_FLD))
{
LINQ_SEARCH = LINQ_SEARCH.Where(...);
}
if (!string.IsNullOrEmpty(NUMBER_FLD))
{
LINQ_SEARCH = LINQ_SEARCH.Where(...);
}
MY_Data_Ggrid.ItemsSource = LINQ_SEARCH.ToList();
```
1. If you rather want to display no havaleha items when noe filters are applied, you could let LINQ_SEARCH be null to begin with, use LIST_HAVALEHA as a 'backup' when applying filters, and use an empty list as a backup when populating MY_Data_Ggrid.ItemsSource:
```
IEnumerable<HAVALEHA_MODEL> LINQ_SEARCH = null;
if (!string.IsNullOrEmpty(CUST_N_FLD))
{
LINQ_SEARCH = (LINQ_SEARCH ?? LIST_HAVALEHA).Where(...);
}
if (!string.IsNullOrEmpty(NUMBER_FLD))
{
LINQ_SEARCH = (LINQ_SEARCH ?? LIST_HAVALEHA).Where(...);
}
MY_Data_Ggrid.ItemsSource = LINQ_SEARCH?.ToList() ?? new List<HAVALEHA_MODEL>();
```
I find the second approach ...not so nice, but it is at least an option for that specific use case.
| null | CC BY-SA 4.0 | null | 2023-02-10T18:01:24.537 | 2023-02-10T18:01:24.537 | null | null | 17,213,526 | null |
75,415,075 | 2 | null | 75,409,334 | 0 | null | Call the `useTexture` hook at the top, then you can modify the `Texture`'s (when the component mounts) with a `useEffect` hook: (be sure to set the `needsUpdate` flag to `true` on the `Texture` after any changes)
```
export function Component() {
const color = useTexture("Gravel_001_BaseColor.jpg");
const roughness = useTexture("Gravel_001_Roughness.jpg");
const normal = useTexture("Gravel_001_Normal.jpg");
const ao = useTexture("Gravel_001_AmbientOcclusion.jpg");
useEffect(() => {
color.repeat = new Vector2(1, 1);
color.wrapS = RepeatWrapping;
color.wrapT = RepeatWrapping;
color.needsUpdate = true; // don't forget this!
}, [color])
return (
<mesh
geometry={nodes.BON_GRAVA.geometry}
material={materials.BON_GRAVA}
material-map={color}
material-metalness={0.0}
material-roughness={1.0}
material-roughnessMap={roughness}
material-normalMap={normal}
material-aoMap={ao}
/>
)
}
```
| null | CC BY-SA 4.0 | null | 2023-02-10T18:53:49.250 | 2023-02-13T18:02:49.037 | 2023-02-13T18:02:49.037 | 7,169,688 | 7,169,688 | null |
75,415,111 | 2 | null | 41,755,276 | 0 | null | In the publish profile in Visual Studio, if Target runtime is set to 'Portable' then all possible runtimes are generated. This is the default, so the output can be reduced by a more selective choice if applicable:
[](https://i.stack.imgur.com/bzpcs.png)
| null | CC BY-SA 4.0 | null | 2023-02-10T18:58:20.283 | 2023-02-10T18:58:20.283 | null | null | 9,284,854 | null |
75,415,258 | 2 | null | 75,414,665 | 1 | null | As noted in comments, your indentation has all code following the `while user not in rps:` loop of that loop. Rather you merely want to loop until you get valid input. This is just a matter of unindenting those lines one level.
```
play_again = True
while (play_again):
import random
import time
rps = ("rock", "paper", "scissors")
user = None #makes it so "user" can be called in while loop
computer = random.choice(rps) #Picks 1 random option from the options variable
while user not in rps: #if user enters something other than one of the options, prompts again
user = input("Enter a choice: rock, paper, or scissors? ==> ")
#print(user)
#print(computer)
if user == computer:
print("You Chose: " + user)
print("The Computer Chose: " + computer)
print("It's a tie!")
elif (user == "rock" and computer == "scissors") or (user == "paper" and computer == "rock") or (user == "scissors" and computer == "paper"):
print("You Chose: " + user)
print("The Computer Chose: " + computer)
print("You win!")
elif (user == "scissors" and computer == "rock") or (user == "rock" and computer == "paper") or (user == "paper" and computer == "scissors"):
print("You Chose: " + user)
print("The Computer Chose: " + computer)
print("You lost ;(")
print()
question = None
play_again_options = ("yes", "no")
while question not in play_again_options:
question = input("Do you want to play again? Type 'yes' or 'no' ==> ")
if (question == "yes"):
play_again = True
print()
elif (question == "no"):
play_again = False
```
Because you need to select input from a user in more than one place from a limited number of options, you may wish to create a function to handle this.
Something like the following, perhaps:
```
def get_input(prompt, valid_options, error_msg=None):
while True:
inp = input(f"{prompt} Type {', '.join(valid_options[:-1])} or {valid_options[-1]} ")
if inp in valid_options: return inp
if error_msg: print(error_msg)
```
Which we can call like so:
```
>>> get_input("Do you want to play again?", ('yes', 'no'))
Do you want to play again? Type yes or no jddbhf
Do you want to play again? Type yes or no dkssfd
Do you want to play again? Type yes or no no
'no'
```
| null | CC BY-SA 4.0 | null | 2023-02-10T19:16:23.430 | 2023-02-10T19:23:41.620 | 2023-02-10T19:23:41.620 | 15,261,315 | 15,261,315 | null |
75,415,294 | 2 | null | 17,777,545 | 1 | null | I came up with a good solution for this issue that works in many use cases.
Check my previous post for code and explanation: [https://stackoverflow.com/a/75414974/10391983](https://stackoverflow.com/a/75414974/10391983)
Here is the code:
```
using System;
using System.Runtime.InteropServices;
using Microsoft.Office.Interop.Excel;
namespace YourNameSpace
{
public class MicrosoftApplications
{
[DllImport("user32.dll")]
static extern int GetWindowThreadProcessId(int hWnd, out int lpdwProcessId);
public class Excel
{
public Excel()
{
Application = new Microsoft.Office.Interop.Excel.Application();
RegisterExitEvent();
}
public Microsoft.Office.Interop.Excel.Application Application;
private void RegisterExitEvent()
{
Application.WindowDeactivate -= XlApp_WindowDeactivate;
Application.WindowDeactivate += XlApp_WindowDeactivate;
}
private void XlApp_WindowDeactivate(Workbook Wb, Window Wn)
{
Kill();
}
public void Kill()
{
int pid = 0;
GetWindowThreadProcessId(Application.Hwnd, out pid);
if (pid > 0)
{
System.Diagnostics.Process p = System.Diagnostics.Process.GetProcessById(pid);
p.Kill();
}
Application = null;
GC.Collect();
GC.WaitForPendingFinalizers();
}
}
}
}
```
And you can call it by:
`YourNameSpace.MicrosoftApplications.Excel xlApp = new YourNameSpace.MicrosoftApplications.Excel();`
To exit, either the user closes the window or programmatically you can call `xlApp.Kill();`
| null | CC BY-SA 4.0 | null | 2023-02-10T19:21:13.137 | 2023-02-10T19:42:29.807 | 2023-02-10T19:42:29.807 | 10,391,983 | 10,391,983 | null |
75,415,312 | 2 | null | 75,414,665 | 0 | null | Note that you are not handling the case when user is not in rps:
```
if user == computer:
print("You Chose: " + user)
print("The Computer Chose: " + computer)
print("It's a tie!")
elif (user == "rock" and computer == "scissors") or (user == "paper" and computer == "rock") or (user == "scissors" and computer == "paper"):
print("You Chose: " + user)
print("The Computer Chose: " + computer)
print("You win!")
elif (user == "scissors" and computer == "rock") or (user == "rock" and computer == "paper") or (user == "paper" and computer == "scissors"):
print("You Chose: " + user)
print("The Computer Chose: " + computer)
print("You lost ;(")
```
You should add an "else" case that use the instruction "continue". This instruction let you skip all the code above of it and tells the external while loop to start a new iteration. Something like this:
```
if user == computer:
....
else:
continue
```
In your current code, your getting the question to continue playing because none of the conditions of your "if - elif" structure is satisfied but there is not any instruction that tells the program to skip the rest of the code, so you only need to add the missing case with that "continue" instruction.
| null | CC BY-SA 4.0 | null | 2023-02-10T19:23:44.737 | 2023-02-10T19:23:44.737 | null | null | 13,054,108 | null |
75,415,410 | 2 | null | 75,411,327 | 1 | null | iOS safari does not support the standard HTML5 fullscreen as you have seen.
There are workarounds which effectively stretch the view element so it is 100% of the available window space.
Videojs is an open source player that does this and may be a good example to use or to look at - the flag they use is 'preferFullWindow' : [https://videojs.com/guides/options/#preferfullwindow](https://videojs.com/guides/options/#preferfullwindow)
| null | CC BY-SA 4.0 | null | 2023-02-10T19:35:09.053 | 2023-02-10T19:35:09.053 | null | null | 334,402 | null |
75,415,409 | 2 | null | 75,411,047 | 0 | null | So [https://stackoverflow.com/users/113116/helen](https://stackoverflow.com/users/113116/helen) find the correct and beauty solution.
[Swashbuckle general response codes](https://stackoverflow.com/questions/51312178/swashbuckle-general-response-codes)
[Is a way to declare common response types to different actions?](https://stackoverflow.com/questions/66747192/is-a-way-to-declare-common-response-types-to-different-actions)
What i used for general response handling:
/in AddSwaggerGen
```
options.OperationFilter<GeneralExceptionOperationFilter>();
```
.
```
internal class GeneralExceptionOperationFilter : IOperationFilter
{
public void Apply(OpenApiOperation operation, OperationFilterContext context)
{
operation.Responses.Add("401", new OpenApiResponse() { Description = "Unauthorized" });
operation.Responses.Add("403", new OpenApiResponse() { Description = "Forbidden" });
//Example where we filter on specific HttpMethod and define the return model
var method = context.MethodInfo.GetCustomAttributes(true)
.OfType<HttpMethodAttribute>()
.Single();
if (method is HttpDeleteAttribute || method is HttpPostAttribute || method is HttpPatchAttribute || method is HttpPutAttribute)
{
operation.Responses.Add("409", new OpenApiResponse()
{
Description = "Conflict",
Content = new Dictionary<string, OpenApiMediaType>()
{
["application/json"] = new OpenApiMediaType
{
Schema = context.SchemaGenerator.GenerateSchema(typeof(string), context.SchemaRepository)
}
}
});
}
}
}
```
| null | CC BY-SA 4.0 | null | 2023-02-10T19:35:09.020 | 2023-02-10T19:35:09.020 | null | null | 20,994,494 | null |
75,415,535 | 2 | null | 75,415,483 | 0 | null | I think you can fix this with two changes:
- `color=`- `labels=`
```
ggplot() +
geom_line(data = df1, aes(x, y1, linetype = z1, color = "y1"), size = 1, show.legend = TRUE) +
geom_line(data = df2, aes(x, y2, linetype = z2, color = "y2"), size = 1, show.legend = TRUE) +
geom_line(data = df3, aes(x, y3, linetype = z3, color = "y3"), size = 1, show.legend = TRUE) +
scale_linetype_manual(values = c("m" = "solid", "n" = "dotted", "p" = "dashed"), guide = "legend", labs(title = "Line type legend")) +
scale_color_manual(values = c(y1="#f8766d", y2="#619cff", y3="#00ba38"), guide = "legend", labs(title = "color legend")) +
xlim(0,10) +
ylim(0,10)
```
[](https://i.stack.imgur.com/Tg35n.png)
---
Extra credit: you might consider pivoting and combining your data so that you can use one `geom`:
```
library(dplyr)
library(tidyr)
dflong <- lapply(
list(df1, df2, df3), pivot_longer,
-x, names_pattern = "(\\D+)(\\d+)", names_to = c(".value", "num")) %>%
bind_rows(.id = "id")
ggplot(dflong) +
geom_line(aes(x, y, linetype = z, color = num), na.rm = TRUE) +
scale_linetype_manual(values = c("m" = "solid", "n" = "dotted", "p" = "dashed"), guide = "legend", labs(title = "Line type legend")) +
scale_color_manual(values = c("1"="#f8766d", "2"="#619cff", "3"="#00ba38"), guide = "legend", labs(title = "color legend")) +
xlim(0,10) +
ylim(0,10)
```
[](https://i.stack.imgur.com/0XfIu.png)
Notes:
- We aren't using `id` here since in this case it appears to be redundant with `num=` from the pivoting. Not sure if it matters, I'll keep it for discussion at least.- The labels within `color legend` are now just 1, 2, and 3, as determined by the number portion of `y1`, `y2`, and `y3` in the original data; you can easily change those to whatever you need, perhaps something like```
dflong <- lapply(
list(df1, df2, df3), pivot_longer,
-x, names_pattern = "(\\D+)(\\d+)", names_to = c(".value", "num")) %>%
bind_rows(.id = "id") %>%
mutate(num = paste0("y", num))
```
- The impetus for shifting from multiple frames as in the first code block and this single-longer-frame mindset is that if you add groups (e.g., `df4` through `df13`), you need to add multiple calls to `geom_line` and perhaps whatever other geoms you might need; in this longer version, you include the frames in the `list(...)` that I iteratively pivot/row-bind, and then the plot mostly works. You will always have a little more work so long as you manually control `linetype=` and `color=`.
| null | CC BY-SA 4.0 | null | 2023-02-10T19:48:34.487 | 2023-02-10T20:02:06.797 | 2023-02-10T20:02:06.797 | 3,358,272 | 3,358,272 | null |
75,415,659 | 2 | null | 74,924,013 | 1 | null | Good luck with this one. I'm not sure it's possible, but maybe it is with some JavaScript.
Obsidian seems to render only part of a page at a time. I wrote a CSS snippet to add captions to images and videos and number them. If there were more than a couple of either, scrolling down the page would cause the numbering to start over from the beginning.
Here's what I wrote
```
.workspace-leaf-content {
counter-reset: figures;
counter-reset: videos;
}
.internal-embed.image-embed.is-loaded {
counter-increment: figures;
}
.internal-embed.media-embed.is-loaded {
counter-increment: videos;
}
.image-embed::after {
display: block;
font-variant: small-caps;
font-weight: bold;
font-size: 90%;
content: 'Fig. ' counter(figures) '. ' attr(alt);
}
.media-embed::after {
display: block;
font-variant: small-caps;
font-weight: bold;
font-size: 90%;
content: 'Vid. ' counter(videos) '. ' attr(alt);
}
.internal-embed+.footnote-ref,
.media-embed+.footnote-ref {
display: inline-block;
vertical-align: bottom;
}
.image-embed,
.media-embed {
margin-left: initial;
}
```
| null | CC BY-SA 4.0 | null | 2023-02-10T20:04:25.297 | 2023-02-10T20:04:25.297 | null | null | 165,347 | null |
75,415,984 | 2 | null | 75,413,216 | 0 | null | I'd use a motion design tool to recreate that. For example, I think you could create this animation with the free version of [Flow](https://createwithflow.com/), which can export Swift code or [Lottie](https://github.com/airbnb/lottie-ios) files.
| null | CC BY-SA 4.0 | null | 2023-02-10T20:50:04.027 | 2023-02-10T20:50:04.027 | null | null | 77,567 | null |
75,416,212 | 2 | null | 5,638,129 | 0 | null | The technique that actually worked for me was to set ColumnWidths property in section Data to a smaller number than the property Width in Position section. In the image below I set 30pt size on ColumnWidths which is smaller than number 40 in property Width. Please find an image showing both properties. I hope this helps.
[](https://i.stack.imgur.com/xZrJe.png)
| null | CC BY-SA 4.0 | null | 2023-02-10T21:19:53.510 | 2023-02-10T21:19:53.510 | null | null | 4,878,310 | null |
75,416,426 | 2 | null | 75,393,510 | 0 | null | The error indicates that AboutUsViewController has no member called 'presenter'. To solve it, add the member.
```
class AboutUsViewController: UIViewController {
var presenter: AboutUsPresenter
}
```
Another possibility is that the member exists, but its ACL is private.
```
class AboutUsViewController: UIViewController {
private var presenter: AboutUsPresenter
}
```
In that case, delete 'private' keyword.
| null | CC BY-SA 4.0 | null | 2023-02-10T21:49:43.770 | 2023-02-10T21:49:43.770 | null | null | 1,180,728 | null |
75,416,517 | 2 | null | 29,659,404 | 0 | null | I found this solution...
```
function one2() {
texte = "yum";
var out = new Promise(function(resolve, reject){
Utilities.sleep(5000);
resolve( hello_callback_func(texte) );
});
return out;
}
```
| null | CC BY-SA 4.0 | null | 2023-02-10T22:00:07.587 | 2023-02-10T22:00:07.587 | null | null | 21,158,138 | null |
75,416,673 | 2 | null | 38,700,790 | 0 | null | I had the same issue in Spring boot 3.0.7 and this worked for me:
Change your controller annotations to `@Controller` and `@RequestMapping`. The welcome method should use `@GetMapping` annotation.
```
@Controller
@RequestMapping
public class HomeController {
@GetMapping("/")
public String welcome() {
return "login";
}
}
```
| null | CC BY-SA 4.0 | null | 2023-02-10T22:24:32.187 | 2023-02-10T22:24:32.187 | null | null | 14,657,513 | null |
75,416,901 | 2 | null | 71,914,935 | 0 | null | Your Firebase API key is open to see anyone. It means your database can be hacked anytime. I think this can be an issue. Try to put your keys inside .env file. That will make your application more secure.
| null | CC BY-SA 4.0 | null | 2023-02-10T23:03:07.983 | 2023-02-14T09:19:48.707 | 2023-02-14T09:19:48.707 | 2,422,778 | 21,190,313 | null |
75,416,967 | 2 | null | 71,914,935 | 0 | null | The issue could result with any of the following reason:
- - - - - -
To detect issue, use google search console and fix the issue as per recommendation.
[source](https://kinsta.com/blog/deceptive-site-ahead/)
| null | CC BY-SA 4.0 | null | 2023-02-10T23:14:47.317 | 2023-02-10T23:14:47.317 | null | null | 2,138,752 | null |
75,416,995 | 2 | null | 75,416,854 | 1 | null | This is a perfect opportunity to use PySpark SQL joins.
Also I'm assuming you want to join pulocationid to locationid, the below example will also work with dislocationid
```
trips.join(lookup_table,trips.pulocationid == lookup_table.locationid,"inner").select(<columns you want to keep>)
```
More examples here: [https://www.google.com/amp/s/sparkbyexamples.com/pyspark/pyspark-join-explained-with-examples/%3famp=1](https://www.google.com/amp/s/sparkbyexamples.com/pyspark/pyspark-join-explained-with-examples/%3famp=1)
| null | CC BY-SA 4.0 | null | 2023-02-10T23:18:21.537 | 2023-02-10T23:18:21.537 | null | null | 12,682,116 | null |
75,417,017 | 2 | null | 75,416,645 | 0 | null | You can use `legend.spacing.y` in `theme` to get the gap between the keys in each legend. Push the legends apart using `legend.margin`
```
ggplot(df, aes(x = group2, y = mean, fill = group1,
pattern = group2, group = group1)) +
geom_bar_pattern(stat = "identity", position = position_dodge(0.95),
color = "black", pattern_fill = "black",
pattern_angle = 45, pattern_density = 0.1,
pattern_spacing = 0.025, pattern_key_scale_factor = 0.6) +
geom_errorbar(aes(ymin = mean - conf, ymax = mean + conf), width = 0.2,
linewidth = 1, position = position_dodge(0.95)) +
scale_fill_manual(values = c(A = "purple", B = "lightgreen", C = "lightblue"),
labels = c(A = "Very long\ntitle 1", B = "Very long\ntitle 2",
C = "Very long\ntitle 3")) +
scale_pattern_manual(values = c(num2 = "stripe", num1 = "none"),
labels = c(num2 = "Exp. 1a", num1 = "Exp. 1b")) +
labs(x = "", y = "Mean rating", fill = "Group 1", pattern = "Group 2") +
guides(pattern = guide_legend(override.aes = list(fill = "white"),
nrow = 2, byrow = TRUE,
title.position ="top", title.hjust = 0.1),
fill = guide_legend(override.aes = list(pattern = "none"),
direction = "vertical", byrow = TRUE, nrow = 3,
title.position="top", title.hjust = 0.1)) +
geom_hline(yintercept = 0) +
theme_classic() +
theme(axis.text.x = element_blank(),
axis.ticks.x = element_blank(),
axis.text = element_text(size = rel(1.7)),
axis.title = element_text(size = rel(1.3)),
legend.text = element_text(size = rel(1.5), hjust = 0, vjust = 0.5),
legend.margin = margin(0, 80, 0, 80),
legend.title = element_text(size = rel(1.3)),
legend.key.width = unit(10, "mm"),
legend.key.height = unit(10, "mm"), title = element_text(size = rel(1.5)),
legend.position = "top",
legend.spacing.y = unit(10, "mm"))
```
[](https://i.stack.imgur.com/extLD.png)
Note that `ggpattern` is now on CRAN
| null | CC BY-SA 4.0 | null | 2023-02-10T23:21:15.863 | 2023-02-10T23:26:35.507 | 2023-02-10T23:26:35.507 | 12,500,315 | 12,500,315 | null |
75,417,166 | 2 | null | 56,934,072 | 0 | null | Finish your code as it is, then Shift+Alt+F (or select from the menu by the right click) will auto-format everything. No need for anything else :-)
[](https://i.stack.imgur.com/FgH2B.png)
| null | CC BY-SA 4.0 | null | 2023-02-10T23:50:52.757 | 2023-02-10T23:50:52.757 | null | null | 14,172,078 | null |
75,417,431 | 2 | null | 3,623,703 | 0 | null | Regardless of what polygon library you are using, if it has the standard set of operations it should be able to do this - by using a zero-width polygon rather than a line. Subtract the zero width polygon from the input and you'll have the separate parts. If your package doesn't support true zero-width polygons then give it the smallest possible width and if necessary undo that slight offset from the results.
| null | CC BY-SA 4.0 | null | 2023-02-11T00:56:04.100 | 2023-02-11T00:56:04.100 | null | null | 210,830 | null |
75,417,539 | 2 | null | 75,416,502 | 0 | null | Looking your file structure and the code, I can say, you must define the full path of the `public` directory using
```
express.static(__dirname+'/public')
```
Or can be like
```
const path = require('path');
// .... your code ...
app.use(express.static( path.join(__dirname, 'public') ));
```
with this you are forcing to define where the public directory is on the ubuntu, and validate you are accessing your files
Hope you can solve with this
Update: checking carefully, I can see that your are trying to request using https, but your code is working on port 80 (http), so you said, on postman worked without https because of the port. If you want to have working your code with port 443 (https), you must have a certificate (with domain but not required), then try with `https://46.101.145.210/javascripts/cookieHandler.js` otherwhise try `http://46.101.145.210/javascripts/cookieHandler.js`.
| null | CC BY-SA 4.0 | null | 2023-02-11T01:22:39.997 | 2023-02-12T05:26:45.487 | 2023-02-12T05:26:45.487 | 5,613,440 | 5,613,440 | null |
75,417,927 | 2 | null | 75,417,851 | 0 | null | I have an idea what about making horizontal ListView with ScrollController and on arrow click you will use scrollController.animateTo and give the offset 1/3 screen width
| null | CC BY-SA 4.0 | null | 2023-02-11T03:27:36.830 | 2023-02-11T03:27:36.830 | null | null | 5,896,525 | null |
75,418,090 | 2 | null | 75,250,701 | 1 | null | I would say that the relations between the variables are not easy to capture (particularly due to the domain size of Developer). The parents of continuous "Duration" have a domain size of `4*4*4*12` ... And duration itself is not really continuous, but can take 102 different values ...
So a database of size 100 is really not enough for the tests/scores to be accurate during the learning algorithms.
[](https://i.stack.imgur.com/uoXIl.png)
Note that I multiplied Duration by 10 to keep integer values.
FYI an inference is the last BN
[](https://i.stack.imgur.com/N0RPl.png)
The code :
```
import numpy as np
import pandas as pd
import pyAgrum as gum
import pyAgrum.lib.notebook as gnb
gum.config["notebook","default_graph_size"]="3!" #change default size for BN
def createDB(N:int):
# code from Rafaela Medeiros
np.random.seed(42)
fib_list = [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
data = {"Requestor": np.random.randint(1,4,N),
"Size": np.random.randint(1,4,N),
"Risk": np.random.randint(1,4,N)}
df = pd.DataFrame(data)
df['Developer'] = np.random.choice(fib_list, df.shape[0])
df["Duration"] = (1*df["Requestor"] + 2*df["Size"] + 2*df["Risk"] + 5*df["Developer"])
return df
def learnForSize(N:int):
learner=gum.BNLearner(createDB(N))
learner.useMIIC() # choosing this algo to learn
bn=learner.learnBN()
return bn
sizes=[100,5000,55000]
gnb.flow.row(*[learnForSize(N) for N in sizes],
captions=[f"{size=}" for size in sizes])
```
| null | CC BY-SA 4.0 | null | 2023-02-11T04:27:34.217 | 2023-02-11T04:43:21.183 | 2023-02-11T04:43:21.183 | 7,104,128 | 7,104,128 | null |
75,418,220 | 2 | null | 75,407,504 | 0 | null | To detect if the coloring inside the sprite border is almost complete, you can use a combination of Unity's built-in collision detection and image processing techniques. Something like this:
- - - -
Repeat steps 2-4 in a loop while the player is painting the cube to continuously check if the coloring is complete.
Once the coloring is complete, you can trigger an event or perform some other action in your game.
```
using UnityEngine;
public class ColorDetection : MonoBehaviour
{
public SpriteRenderer spriteRenderer;
public Texture2D maskTexture;
public Color thresholdColor;
private void Update()
{
Color averageColor = GetAverageColor();
if (IsColorSimilar(averageColor, thresholdColor))
{
Debug.Log("Coloring is complete");
}
}
private Color GetAverageColor()
{
Texture2D texture = spriteRenderer.sprite.texture;
Rect spriteRect = spriteRenderer.sprite.rect;
Color[] maskPixels = maskTexture.GetPixels();
Color[] spritePixels = texture.GetPixels((int)spriteRect.x, (int)spriteRect.y, (int)spriteRect.width, (int)spriteRect.height);
int count = 0;
Color sum = Color.clear;
for (int i = 0; i < maskPixels.Length; i++)
{
if (maskPixels[i].a > 0)
{
count++;
sum += spritePixels[i];
}
}
return sum / count;
}
private bool IsColorSimilar(Color a, Color b)
{
float delta = 0.05f;
return Mathf.Abs(a.r - b.r) < delta && Mathf.Abs(a.g - b.g) < delta && Mathf.Abs(a.b - b.b) < delta;
}
}
```
| null | CC BY-SA 4.0 | null | 2023-02-11T05:13:12.413 | 2023-02-11T05:13:12.413 | null | null | 7,514,900 | null |
75,418,231 | 2 | null | 11,723,417 | 0 | null |
## Break a Child Block out of a Parent to 100% Width
Here is another way to of your viewport using `plain CSS`. This one will look perfect every time with no script required!
```
html body {position:relative;}
#parent1 {
min-width: 100vw;
position:absolute;
top:0;
right:-10px;/* match this to padding below */
padding: 0 0 0 10px;/* match this to right positioning above*/
margin:0;
background:transparent;
height:auto;
z-index:100;
}
#child1 {
position: relative;
width: 100%;
height: auto;
margin:0 auto;
z-index:101;
padding:1em;
margin:0;
background: green;
color:#fff;
}
<div id="parent1">
<div id="child1">text text text text text </div>
</div>
```
## How it Works
First give your `body` element a . This will not affect the body element functioning in any way, but allows your embedded child `div` with absolute positioning the ability to use the `body` as a point of reference. Assigning the `absolute positioning` on the parent relative to the `body` means you can break out of the content flow and fill the width starting from the `body`.
`min-width:100vw` is the secret sauce of this solution! It stretches your `div` container to fill the full `width`, which unfortunately includes the `scrollbar`. Because the min-width: 100vw is constantly recalculated as the browser or user-agent viewport grows or shrinks along `width`, plus includes any vertical scroll bar, as users change browser window sizes. Because of this problem in viewport recalculations in modern browsers, the viewable browser area will stretch a little extra under any vertical scrollbar that might appear and create an x-axis scrollbar, in addition. The CSS by aligning the parent container to a value which removes the x-axis scrollbar and forces the extra viewport to the right edge. Change negative value this to whatever you may need to align your bock element to the right screen area. If your body or parents don't have right margins or padding, you may set this to `right:0`.
The final width will likely scroll off the left side of the page after right positioning because of y-axis vertical scrollbars which are included in viewport width calculations. This is ok because we add `padding-left` to this parent block element equal to any right negative value, which pushes any child content from the left of the screen edge back into the viewport for the child div content so it doesn't flow off the page. Note that for this to work. Also make sure your parent div has a transparent background as it uses as a holder only.The child content text should now fit perfectly into the web page, filling 100% width! :) peace
| null | CC BY-SA 4.0 | null | 2023-02-11T05:16:29.830 | 2023-02-12T03:24:46.783 | 2023-02-12T03:24:46.783 | 5,555,938 | 5,555,938 | null |
75,418,308 | 2 | null | 9,943,644 | 0 | null | Have you check for Parameter Sniffing Issue? I saw you did not mention data type when adding parameter to a Sql Command. Please See [SQL Server - parameter sniffing](https://stackoverflow.com/questions/20699393/sql-server-parameter-sniffing)
| null | CC BY-SA 4.0 | null | 2023-02-11T05:40:38.433 | 2023-02-11T05:40:38.433 | null | null | 1,562,070 | null |
75,418,642 | 2 | null | 75,417,924 | 1 | null | When you type a command in the terminal it looks for the application using the operating systems PATH variable. The java installer (and most other programs for that matter) doesn't modify that variable, so you have to add it manually.
Find out where your java installation is, usually somewhere like C:\Program Files\Java\jdkXXX\bin
You can set the variable temporarily in your terminal like so:
`set path=C:\Program Files\Java\jdkXXX\bin`
and then verify if it works by typing `java -version`
If that all works, then you can modify your Windows PATH variable. There are lots of guides online for how to do that depending on your version of windows. Just make sure you append the jdk forlder instead of replacing the whole thing.
| null | CC BY-SA 4.0 | null | 2023-02-11T07:10:57.150 | 2023-02-11T07:10:57.150 | null | null | 102,483 | null |
75,418,932 | 2 | null | 75,417,600 | 1 | null | Make sure let is lowercase (let and not Let).
| null | CC BY-SA 4.0 | null | 2023-02-11T08:24:23.220 | 2023-02-11T08:24:23.220 | null | null | 18,345,037 | null |
75,419,563 | 2 | null | 75,419,046 | 1 | null | Use a QTableView instead. Widgets are meant for very basic use cases. It's important to invoke `setSortRole` on the model. Also, your `setData` arguments were in reverse order, correct is `data, role`.
```
from random import randint
from PyQt5 import QtCore
from PyQt5 import QtGui
from PyQt5 import QtWidgets
class MainApp(QtWidgets.QMainWindow):
def __init__(self):
super().__init__()
self.table_view = QtWidgets.QTableView()
self.table_view.setSortingEnabled(True)
self.model = QtGui.QStandardItemModel()
self.model.setSortRole(QtCore.Qt.UserRole)
self.table_view.setModel(self.model)
self.button = QtWidgets.QPushButton('Roll')
layout = QtWidgets.QWidget()
self.setCentralWidget(layout)
grid = QtWidgets.QGridLayout()
layout.setLayout(grid)
grid.addWidget(self.button)
grid.addWidget(self.table_view)
self.button.clicked.connect(
self.populate
)
def populate(self):
self.table_view.model().clear()
for _ in range(500):
r = randint(0, 1000)
item = QtGui.QStandardItem()
item.setData(f'M - {r}', QtCore.Qt.DisplayRole)
item.setData(r, QtCore.Qt.UserRole)
self.table_view.model().appendRow(item)
if __name__ == '__main__':
app = QtWidgets.QApplication([])
main_app = MainApp()
main_app.showMaximized()
app.exec()
```
| null | CC BY-SA 4.0 | null | 2023-02-11T10:34:47.073 | 2023-02-18T12:25:24.790 | 2023-02-18T12:25:24.790 | 6,301,394 | 6,301,394 | null |
75,419,847 | 2 | null | 75,419,311 | 1 | null | In the top module, you need to add a `wire` for the signal that you want to connect to both module instances. Then you need to add port connections for that signal to each instance. Here are the specific changes:
```
module seven_segment (
input CLK,
output [6:0] out
);
wire [3:0] count;
counter counter ( .CLK(CLK) , .count(count) );
bcd bcd ( .in(count), .out(out) );
endmodule
```
You can give the wire any name that you want. I chose to name it the same as the counter output (`count`), but as you can see, it is not a requirement to match the port name (`.in(count)`).
There are more examples in: [How to instantiate a module](https://stackoverflow.com/questions/20066850/verilog-how-to-instantiate-a-module)
| null | CC BY-SA 4.0 | null | 2023-02-11T11:26:42.213 | 2023-02-11T11:34:42.050 | 2023-02-11T11:34:42.050 | 197,758 | 197,758 | null |
75,419,900 | 2 | null | 75,419,757 | 0 | null | You could just set the `value` and `groupValue` to be the same.
```
value: "English",
groupValue: "English",
```
or
```
value: "english",
groupValue: "english",
```
| null | CC BY-SA 4.0 | null | 2023-02-11T11:34:08.750 | 2023-02-11T11:34:08.750 | null | null | 10,702,091 | null |
75,419,983 | 2 | null | 75,255,818 | 0 | null | If you are using Windows11 Try to update the CP210x USB UART Bridge Driver. It might help: [SI Labs Driver](https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers?tab=downloads)
| null | CC BY-SA 4.0 | null | 2023-02-11T11:47:13.287 | 2023-02-11T11:47:13.287 | null | null | 21,192,686 | null |
75,419,995 | 2 | null | 75,419,595 | 0 | null | The warnings are pretty straightforward.
`-webkit-appearance` is [a CSS extension for browsers with the webkit engine](https://developer.mozilla.org/en-US/docs/Web/CSS/WebKit_Extensions). You should also add `appearance` for compatibility with other browsers.
`vertical-align` has no effect when used in an element with `display: block`. `display: block` is the default for any HTML element, unless you change it. So if you want `vertical-align` you need to set `display` to [something else](https://www.w3schools.com/cssref/pr_class_display.php).
| null | CC BY-SA 4.0 | null | 2023-02-11T11:49:12.183 | 2023-02-11T11:49:12.183 | null | null | 16,646,078 | null |
75,420,113 | 2 | null | 75,417,338 | 1 | null | In the parent div, add `wire:ignore.self`.
For example:
```
<div wire:ignore.self><-- Parent div -->
//Your other dropdown code in here
</div>
```
This directive tells Livewire to ignore changes to a subset of HTML within your component.
| null | CC BY-SA 4.0 | null | 2023-02-11T12:09:04.593 | 2023-02-11T12:09:04.593 | null | null | 11,299,346 | null |
75,420,156 | 2 | null | 75,420,088 | 0 | null | Don't abuse math mode for whole words!
```
% !TeX TS-program = lualatex
\documentclass{standalone}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,russian]{babel}
\usepackage{tikz}
\usepackage{fontspec}
\setmainfont{Roboto Light}
\begin{document}
\begin{tikzpicture}
\node[circle,
draw=black,
label={label text текст надписи}]
(c) at (0,0){Текст ноды Node text};
\end{tikzpicture}
\end{document}
```
| null | CC BY-SA 4.0 | null | 2023-02-11T12:17:45.730 | 2023-02-11T12:17:45.730 | null | null | 2,777,074 | null |
75,420,155 | 2 | null | 15,657,893 | 0 | null | One tricky way to do it, is to set your CSS with, for example:
```
[lang=en-GB] [lang=fr-FR],
[lang=en-GB] [lang=ja-JP],
[lang=fr-FR] [lang=en-GB],
[lang=fr-FR] [lang=ja-JP],
[lang=ja-JP] [lang=en-GB],
[lang=ja-JP] [lang=fr-FR]
{
display: none !important;
}
```
And then mark your HTML with the `lang` attribute, such as:
```
<div lang="en-GB">
<p>This text is in English</p>
</div>
<div lang="ja-JP">
<p>This text in Japanese</p>
</div>
<div lang="fr-FR">
<p>This text in French</p>
</div>
```
You can have a simple javascript that detects the language selected and change the `HTML` root document `:root`.
Using jQuery, it would be like this:
```
$(document).on('change', 'select[name="lang"]', function(e)
{
$(':root').attr('lang', $(this).val() );
});
```
And automatically, the correct localised version only would be displayed and the other would not be visible.
| null | CC BY-SA 4.0 | null | 2023-02-11T12:17:35.110 | 2023-02-11T12:17:35.110 | null | null | 4,814,971 | null |
75,420,751 | 2 | null | 75,419,305 | 4 | null | Don't fear the math, it is really quite simple.
Start with the two points where the "crease" meets the card sides, because you can choose them freely.
```
P1 = 0, 178 // x is fixed
P2 = 141, 278 // y is fixed
```
Compute the angle of the "crease" from the vertical in degrees:
```
a = Math.atan2((P2.x - P1.x), (P2.y - P1.y))*180/Math.PI
= Math.atan2(141, 100)*180/Math.PI
= 54.655
```
Move the second card to the left side of the y-axis
```
transform ="translate(-200)"
```
...and rotate it by `-2a` around `P1`
```
transform ="rotate(-109.31 0 178) translate(-200)"
```
That's all.
```
function crease (y1, x2) {
document.querySelector('#clip path')
.setAttribute('d', `M0 ${y1}L0 0H200V278H${x2}z`);
const a = Math.atan2(x2, 278 - y1)*180/Math.PI;
document.querySelector('#below')
.setAttribute('transform', `rotate(${-2*a} 0 ${y1}) translate(-200)`);
}
crease(178, 141);
```
```
<svg viewBox="0 0 200 278" style="height:180px">
<defs>
<pattern id="back" width="200" height="278" patternUnits="userSpaceOnUse">
<image width="200" href="https://svg-cdn.github.io/cm-back-red.svg" />
</pattern>
<pattern id="front" width="200" height="278" patternUnits="userSpaceOnUse">
<image width="200" href="https://svg-cdn.github.io/cm-hearts-king.svg" />
</pattern>
<clipPath id="clip">
<path />
</clipPath>
</defs>
<g clip-path="url(#clip)">
<rect width="200" height="278" fill="url(#back)" />
<rect id="below" width="200" height="278" fill="url(#front)" />
</g>
</svg>
```
| null | CC BY-SA 4.0 | null | 2023-02-11T14:11:54.530 | 2023-02-11T14:11:54.530 | null | null | 4,996,779 | null |
75,420,770 | 2 | null | 4,300,291 | 0 | null | 1- In the Service class:
```
class MyService : Service() {
private lateinit var messenger: Messenger
private val handler = object : Handler() {
override fun handleMessage(msg: Message) {
when (msg.what) {
// Handle message from the Activity
// Perform any action based on the message
}
}
}
private val messengerCallback = Messenger(handler)
override fun onBind(intent: Intent): IBinder {
messenger = Messenger(messengerCallback)
return messenger.binder
}
```
}
2- In the Activity class:
```
class MyActivity : AppCompatActivity() {
private lateinit var messenger: Messenger
private val serviceConnection = object : ServiceConnection {
override fun onServiceConnected(className: ComponentName, service: IBinder) {
messenger = Messenger(service)
sendMessageToService("Hello from Activity")
}
override fun onServiceDisconnected(arg0: ComponentName) {}
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
bindService(Intent(this, MyService::class.java), serviceConnection, Context.BIND_AUTO_CREATE)
}
private fun sendMessageToService(message: String) {
val msg = Message.obtain(null, 0, 0, 0)
val bundle = Bundle()
bundle.putString("message", message)
msg.data = bundle
try {
messenger.send(msg)
} catch (e: RemoteException) {
e.printStackTrace()
}
}
```
}
| null | CC BY-SA 4.0 | null | 2023-02-11T14:15:31.217 | 2023-02-12T07:29:53.920 | 2023-02-12T07:29:53.920 | 6,046,829 | 6,046,829 | null |
75,420,795 | 2 | null | 75,416,502 | 0 | null | I solved it by adding a valid ssl certificate.
| null | CC BY-SA 4.0 | null | 2023-02-11T14:19:10.080 | 2023-02-11T14:19:10.080 | null | null | 14,449,629 | null |
75,420,881 | 2 | null | 75,419,305 | 3 | null | Here is an animated solution that uses the CSS [rotate3d](https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/rotate3d) transformation. I achieved it with quite some trial and error, and it is still not clear to me how exactly the `transform-origin` affects the animation.
I found that the animation changes when I move the `transform-origin: 81px bottom;` rule from `div.back` to `input:checked~div.back.corner`. Apparently, elements should have the same `transform-origin` before and after the animation for it to be smooth, even if the element before the animation is not transformed at all.
I have added a Javascript function that computes all the parameters from just the height and width and the x and y coordinates of the "crease".
```
var rules = document.styleSheets[0].rules;
function render(form) {
rules[1].styleMap.set("width", `${form.w.value}px`);
rules[1].styleMap.set("height", `${form.h.value}px`);
rules[2].styleMap.set("transform-origin", `${form.x.value}px bottom`);
rules[3].styleMap.set("clip-path", `path("M${form.w.value},${form.h.value} l${-form.x.value},0 l${form.x.value},${-form.y.value} l0,${form.y.value}z")`);
rules[3].styleMap.set("transform", `translateX(${form.x.value - form.w.value / 2}px) rotateY(180deg) translateX(${form.w.value / 2 - form.x.value}px)`);
rules[3].styleMap.set("transform-origin", `${form.w.value - form.x.value}px bottom`);
rules[4].styleMap.set("clip-path", `path("M0,0 l${form.w.value},0 l0,${form.h.value} l${form.x.value - form.w.value},0 l${-form.x.value},${-form.y.value} l0,${form.y.value-form.h.value}z")`);
rules[5].styleMap.set("clip-path", `path("M0,${form.h.value} l${form.x.value},0 l${-form.x.value},${-form.y.value} l0,${form.y.value}z")`);
rules[6].styleMap.set("transform", `rotate3d(${-form.x.value}, ${-form.y.value}, 0, -170deg)`);
rules[7].styleMap.set("transform", `translateX(${form.x.value - form.w.value / 2}px) rotateY(180deg) translateX(${form.w.value / 2 - form.x.value}px) rotate3d(${form.x.value}, ${-form.y.value}, 0, -170deg)`);
}
```
```
body {
position: relative;
}
div {
position: absolute;
width: 200px;
height: 278px;
transform-style: preserve-3d;
backface-visibility: hidden;
transition: 0.5s;
zoom: 0.5;
}
div.back {
background: url(https://svg-cdn.github.io/cm-back-red.svg);
transform-origin: 81px bottom;
}
div.front {
background: url(https://svg-cdn.github.io/cm-hearts-king.svg);
clip-path: path("M200,278 l-81,0 l81,-99 l0,99z");
transform: translateX(-19px) rotateY(180deg) translateX(19px);
transform-origin: 119px bottom;
}
div.nocorner {
clip-path: path("M0,0 l200,0 l0,278 l-119,0 l-81,-99 l0,-179z");
}
div.corner {
clip-path: path("M0,278 l81,0 l-81,-99 l0,99z");
}
input:checked~div.back.corner {
transform: rotate3d(-81, -99, 0, -170deg);
}
input:checked~div.front {
transform: translateX(-19px) rotateY(180deg) translateX(19px) rotate3d(81, -99, 0, -170deg);
}
```
```
<form onsubmit="render(this); return false;">
width <input name="w" size="3" value="200" />
height <input name="h" size="3" value="278" />
x axis <input name="x" size="3" value="81" />
y axis <input name="y" size="3" value="99" />
<input type="submit" value="Render" />
</form>
<input type="checkbox" /> Fold
<div class="back nocorner"></div>
<div class="back corner"></div>
<div class="front"></div>
```
If the folded card corner is (x, bottom - y), then the crease goes from ((x²+y²)/2x, bottom) to (0, bottom - (x²+y²)/2y).
| null | CC BY-SA 4.0 | null | 2023-02-11T14:33:13.740 | 2023-02-11T18:47:48.667 | 2023-02-11T18:47:48.667 | 16,462,950 | 16,462,950 | null |
75,420,935 | 2 | null | 29,320,302 | 0 | null | This Stack Overflow question has been asked for a very, very long time, but I would want to offer a very extensive answer to aid the community with this matter - or possibly the authors of the question, but given that it was asked seven years ago, I assume the authors have found a workaround.
You are working with longitudinal data, which is not what conventional machine learning algorithms are primarily centred on. As @greymatter stated, you may experiment with data transformation techniques to flatten your data, making it suitable for use with a conventional machine learning approach. The advantage of such an approach is that there are numerous machine learning techniques that can be used to your flattened data as a results of the data transformation procedure. However, this comes at the cost of losing the temporal context of your data, which could be disastrous if the time evolution of your data is crucial to consider (most of the time the case in healthcare-applied context).
In this instance, ML algorithm designers are recently increasingly focusing on algorithm adaptation. Algorithm adaption, modify an existing ML algorithm so that it can directly consider the temporal context of data without flattening it into a "static-based-format", hence, loosing the temporal context throughout the dataset. The advantage is that the time context is considered, but the disadvantage is that there are few viable algorithms. I am also incorporating, for the sake of simplicity, ML techniques specifically built for longitudinal data in that category, despite the fact that they are not adapted but rather designed from the bottom up to acquire time-indexed data.
In practice, there are numerous methods for flattening data, but [1] proposes three fundamental approaches for flattening its data in order to apply it to conventional ML algorithms. As illustrated in [1]'s first figure, the @greymatter strategy is included as methods for flattening your data in order to use traditional ML algorithms.
Therefore, for algorithm adaptation, below are a few proposals , where the authors mostly altered (tree-based) standard ML algorithms to consider the temporal context / time progression of subjects through time. Consequently, this still requires transforming the data to be computationally computable, and [1] presents a final solution that transforms the data while retaining the time indices, enabling customised algorithm designers to trace the evolution through Time while designing new adapted algorithms.
This response intended solely to direct you towards the implementation of such data or to new readers. Machine learning x Longitudinal data is a pretty new scientific subject, and there is still much work to be done. Whereas Statistics x Longitudinal data is much older but here we focussed on ML rather than statistics to be clear. Hence, feel free to comment if you want additional information added to the answer for yourself or further readers.
In the hopes that this is of help, here are the references:
- [1] Ribeiro, C. and Freitas, A.A., 2019. A mini-survey of supervised machine learning approaches for coping with ageing-related longitudinal datasets. In 3rd Workshop on AI for Aging, Rehabilitation and Independent Assisted Living (ARIAL), held as part of IJCAI-2019 (p. 5).
Vancouver- [2] Ribeiro, C. and Freitas, A., 2020, December. A new random forest method for longitudinal data classification using a lexicographic bi-objective approach. In 2020 IEEE Symposium Series on Computational Intelligence (SSCI) (pp. 806-813). IEEE.- [3] Ribeiro, C. and Freitas, A.A., 2021. A data-driven missing value imputation approach for longitudinal datasets. Artificial Intelligence Review, pp.1-31.
Vancouver- [4] Jie, B., Liu, M., Liu, J., Zhang, D. and Shen, D., 2016. Temporally constrained group sparse learning for longitudinal data analysis in Alzheimer's disease. IEEE Transactions on Biomedical Engineering, 64(1), pp.238-249.
Vancouver- [5] Du, W., Cheung, H., Johnson, C.A., Goldberg, I., Thambisetty, M. and Becker, K., 2015, November. A longitudinal support vector regression for prediction of ALS score. In 2015 IEEE International Conference on Bioinformatics and Biomedicine (BIBM) (pp. 1586-1590). IEEE.
Vancouver- [6] Adhikari, S., Lecci, F., Becker, J.T., Junker, B.W., Kuller, L.H., Lopez, O.L. and Tibshirani, R.J., 2019. High‐dimensional longitudinal classification with the multinomial fused lasso. Statistics in medicine, 38(12), pp.2184-2205.
Vancouver- [7] Huang, L., Jin, Y., Gao, Y., Thung, K.H., Shen, D. and Alzheimer's Disease Neuroimaging Initiative, 2016. Longitudinal clinical score prediction in Alzheimer's disease with soft-split sparse regression based random forest. Neurobiology of aging, 46, pp.180-191.
Vancouver- [8] Radovic, M., Ghalwash, M., Filipovic, N. and Obradovic, Z., 2017. Minimum redundancy maximum relevance feature selection approach for temporal gene expression data. BMC bioinformatics, 18(1), pp.1-14.
Vancouver- [9] Pomsuwan, T. and Freitas, A.A., 2017, November. Feature selection for the classification of longitudinal human ageing data. In 2017 IEEE International Conference on Data Mining Workshops (ICDMW) (pp. 739-746). IEEE. Vancouver- [10] Ovchinnik, S., Otero, F. and Freitas, A.A., 2022, April. Nested trees for longitudinal classification. In Proceedings of the 37th ACM/SIGAPP Symposium on Applied Computing (pp. 441-444).
Vancouver
| null | CC BY-SA 4.0 | null | 2023-02-11T14:43:57.447 | 2023-02-11T14:43:57.447 | null | null | 9,814,037 | null |
75,420,961 | 2 | null | 75,420,901 | 0 | null | To extract the texts e.g. `Sep-18`, `Nov-22` you have to induce [WebDriverWait](https://stackoverflow.com/a/59130336/7429447) for [visibility_of_all_elements_located()](https://stackoverflow.com/a/64770041/7429447) and you can use either of the following [locator strategies](https://stackoverflow.com/questions/48369043/official-locator-strategies-for-the-webdriver):
- Using and attribute:```
print([my_elem.text for my_elem in WebDriverWait(driver, 20).until(EC.visibility_of_all_elements_located((By.CSS_SELECTOR, "svg.highcharts-root g.highcharts-axis-labels.highcharts-xaxis-labels text")))])
```
- Using and `get_attribute("innerHTML")`:```
print([my_elem.get_attribute("innerHTML") for my_elem in WebDriverWait(driver, 20).until(EC.visibility_of_all_elements_located((By.XPATH, "//*[local-name()='svg' and @class='highcharts-root']//*[local-name()='g' and @class='highcharts-axis-labels highcharts-xaxis-labels']//*[local-name()='text']")))])
```
- : You have to add the following imports :```
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
```
---
## References
You can find a couple of relevant detailed discussions in:
- [Reading title tag in svg?](https://stackoverflow.com/a/63544849/7429447)- [Creating XPATH for svg tag](https://stackoverflow.com/a/49024531/7429447)
| null | CC BY-SA 4.0 | null | 2023-02-11T14:48:15.697 | 2023-02-11T14:56:27.577 | 2023-02-11T14:56:27.577 | 7,429,447 | 7,429,447 | null |
75,421,175 | 2 | null | 75,419,320 | 0 | null | The URL path `result.assets[0].uri` returned by `expo-image-picker` is a reference to image data but not contains actual image data.
As firebase expects to upload binary data, the app requires to fetch image binary data first.
```
const getBlobFroUri = async (uri) => {
const blob = await new Promise((resolve, reject) => {
const xhr = new XMLHttpRequest();
xhr.onload = function () {
resolve(xhr.response);
};
xhr.onerror = function (e) {
reject(new TypeError("Network request failed"));
};
xhr.responseType = "blob";
xhr.open("GET", uri, true);
xhr.send(null);
});
return blob;
};
const imageBlob = await getBlobFroUri(image)
const uploadTask = uploadBytesResumable(storageRef, imageblob, metadata);
```
I wrote an in-depth article on this subject - [https://dev.to/emmbyiringiro/upload-image-with-expo-and-firebase-cloud-storage-3481](https://dev.to/emmbyiringiro/upload-image-with-expo-and-firebase-cloud-storage-3481)
| null | CC BY-SA 4.0 | null | 2023-02-11T15:20:28.633 | 2023-02-11T15:20:28.633 | null | null | 12,431,576 | null |
75,421,215 | 2 | null | 75,417,338 | 1 | null | As you are using the raw HTML select and not a third party library, like Select2, my question is, why not bind the select value to the livewire component [like so](https://laravelplayground.com/#/snippets/a7f289c9-bba3-40d8-9269-496e3930bcc9)?
This would solve your problem and the component would be aware of the value from the get go.
| null | CC BY-SA 4.0 | null | 2023-02-11T15:27:59.130 | 2023-02-11T15:27:59.130 | null | null | 1,920,255 | null |
75,421,258 | 2 | null | 70,263,701 | 0 | null | I think the following post gives the most detailed equation for this behaviour. It relates the finger position to the bubble position and can be customised easily.
```
xb = min( xf, f * sqrt(W) * sqrt(xf) )
xb = x-displacement of bubble from its initial position
xf = x-displacement of finger from its initial position
W = screen width or maximum finger displacement possible
f = maximum bubble displacement fraction or xb(max)/xf(max)
```
Here is the complete post
[https://medium.com/@duolop/swipe-to-reply-animation-a-physics-based-approach-5ef646c396e4](https://medium.com/@duolop/swipe-to-reply-animation-a-physics-based-approach-5ef646c396e4)
| null | CC BY-SA 4.0 | null | 2023-02-11T15:34:27.097 | 2023-02-11T15:34:27.097 | null | null | 9,479,660 | null |
75,421,303 | 2 | null | 75,412,037 | 0 | null | Assuming you're writing an app not for macOS, then Kafka cannot be used with mobile applications, mostly because of network switching.
If that is your goal, you should look into alternatives like the Confluent REST Proxy, and use HTTP calls to its API instead.
| null | CC BY-SA 4.0 | null | 2023-02-11T15:42:36.983 | 2023-02-11T15:42:36.983 | null | null | 2,308,683 | null |
75,421,367 | 2 | null | 75,405,458 | 0 | null | You could try it like here:
```
Select
QT_PART_USAGE "QT_PART_USAGE",
--
CASE WHEN ADDORDELETE != 'QT' THEN QT_PART_USAGE
ELSE
CASE WHEN InStr(COMES_FROM, 'ADD', 1, 1) = 1 THEN SubStr(QT_PART_USAGE, 1, InStr(QT_PART_USAGE, ',', 1, 1) -1 )
WHEN InStr(COMES_FROM, 'ADD', 1, 1) > 1 THEN SubStr(QT_PART_USAGE, InStr(QT_PART_USAGE, ',', 1, 1) + 1 )
END
END "QT_PART_USAGE_CHANGED",
COMES_FROM "COMES_FROM",
ADDORDELETE "ADDORDELETE"
From
sample_data
```
I left your original QT_PART_USAGE colum intact and created a new, CHANGED one, so you can see them both. With your sample data:
```
WITH
sample_data AS
(
Select '1' "QT_PART_USAGE", 'ADD' "COMES_FROM", 'ADD' "ADDORDELETE" From Dual Union All
Select '1' "QT_PART_USAGE", 'ADD' "COMES_FROM", 'ADD' "ADDORDELETE" From Dual Union All
Select '1' "QT_PART_USAGE", 'ADD' "COMES_FROM", 'ADD' "ADDORDELETE" From Dual Union All
Select '.00025,1' "QT_PART_USAGE", 'DELETE,ADD' "COMES_FROM", 'QT' "ADDORDELETE" From Dual Union All
Select '2' "QT_PART_USAGE", 'DELETE' "COMES_FROM", 'DELETE' "ADDORDELETE" From Dual Union All
Select '2' "QT_PART_USAGE", 'ADD' "COMES_FROM", 'ADD' "ADDORDELETE" From Dual Union All
--
Select '3' "QT_PART_USAGE", 'ADD' "COMES_FROM", 'ADD' "ADDORDELETE" From Dual Union All
Select '1' "QT_PART_USAGE", 'DELETE' "COMES_FROM", 'DELETE' "ADDORDELETE" From Dual Union All
Select '7,9' "QT_PART_USAGE", 'ADD,DELETE' "COMES_FROM", 'QT' "ADDORDELETE" From Dual Union All
Select '1' "QT_PART_USAGE", 'ADD' "COMES_FROM", 'ADD' "ADDORDELETE" From Dual Union All
Select '1' "QT_PART_USAGE", 'ADD' "COMES_FROM", 'ADD' "ADDORDELETE" From Dual Union All
Select '2' "QT_PART_USAGE", 'ADD' "COMES_FROM", 'ADD' "ADDORDELETE" From Dual
)
```
... it should return this ...
```
QT_PART_USAGE QT_PART_USAGE_CHANGED COMES_FROM ADDORDELETE
------------- --------------------- ---------- -----------
1 ADD ADD
1 ADD ADD
1 ADD ADD
.00025,1 1 DELETE,ADD QT
2 DELETE DELETE
2 ADD ADD
3 ADD ADD
1 DELETE DELETE
7,9 7 ADD,DELETE QT
1 ADD ADD
1 ADD ADD
2 ADD ADD
```
: This will not work if there are three or more elements. Also, if there could be spaces within the string (QT_PART_USAGE) you should get ridd of them before getting substrings...
| null | CC BY-SA 4.0 | null | 2023-02-11T15:52:20.800 | 2023-02-11T16:01:28.957 | 2023-02-11T16:01:28.957 | 19,023,353 | 19,023,353 | null |
75,421,552 | 2 | null | 19,115,512 | 0 | null | You can try using this:
```
li {
list-style-position: outside;
}
```
| null | CC BY-SA 4.0 | null | 2023-02-11T16:17:31.267 | 2023-02-11T16:17:31.267 | null | null | 21,193,900 | null |
75,421,735 | 2 | null | 3,962,558 | 0 | null | Okay now for your DIV or any other element that have a scrolling I found this method on JavaScript :
```
let D = document.getElementById("D1"); // I gave "D1" as id to my div
// this one is to calculate the scroll end Pixels
let Calc = D.scrollHeight - D.clientHeight;
function ScrollingInD1() {
//this one is to calculate the scrolling percent while going through the <div> it can help for "Responsivity"
let percent = (D.scrollTop * 100) / Calc;
if (D.scrollTop == Calc) {
// do Stuffs
}
}
```
| null | CC BY-SA 4.0 | null | 2023-02-11T16:46:41.883 | 2023-02-11T16:46:41.883 | null | null | 21,184,250 | null |
75,421,781 | 2 | null | 75,421,509 | 0 | null | if you think the culprit here is keyboard, then you can force the keyboard to close in [onDisappear(action:_)](https://developer.apple.com/documentation/swiftui/menu/ondisappear(perform:)). The following code might help you close the keyboard.
```
#if canImport(UIKit)
extension View {
func hideKeyboard() {
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
}
}
#endif
```
| null | CC BY-SA 4.0 | null | 2023-02-11T16:52:18.530 | 2023-02-11T16:52:18.530 | null | null | 13,268,991 | null |
75,421,926 | 2 | null | 58,032,083 | 0 | null | Search and check this (for new versions)
[](https://i.stack.imgur.com/DL0QQ.png)
| null | CC BY-SA 4.0 | null | 2023-02-11T17:16:25.743 | 2023-02-11T17:16:25.743 | null | null | 14,508,246 | null |
75,421,935 | 2 | null | 75,419,037 | 0 | null | You can go to extensions, search for CSS and install the first extension. Once installed, you will get the predictions.
Eg: HTML CSS Support extension.
| null | CC BY-SA 4.0 | null | 2023-02-11T17:18:16.063 | 2023-02-11T17:18:16.063 | null | null | 12,946,676 | null |
75,422,042 | 2 | null | 75,418,520 | 0 | null | ```
from telethon import TelegramClient
api_id = 123456 # Your API ID
api_hash = 'your_api_hash' # Your API Hash
# Create a new TelegramClient instance and start the client
async with TelegramClient('session_file', api_id, api_hash) as client:
# Connect to the Telegram servers and log in
await client.start()
# After logging in, the session hash will be automatically generated and stored
# in the 'session_file' file, which you can use in future runs to log in with
# the same session:
session_hash = client.session.save()
print(str(session_hash))
```
| null | CC BY-SA 4.0 | null | 2023-02-11T17:36:11.500 | 2023-02-11T17:36:11.500 | null | null | 16,262,927 | null |
75,422,551 | 2 | null | 53,639,974 | 0 | null | I've faced same/similar problem with installing Python 3.9.12 in a clean Windows 8.1 64-bit (VirtualBoxed test environment).
I thought the issue could have been fixed in a newer version of Python, but the freshest 3.10.10 fails with same issue.
The original log isn't available any longer, but luckily it is quoted in [another answer](https://stackoverflow.com/a/53640223/536172), and the following line reveals the real problem:
```
Applied execute package: core_AllUsers, result: 0x80070643, restart: None
```
My log looks the same, and if you scroll the log up, you'll discover that `core_AllUsers` is a UCRT MSI-installer, which is downloaded from Python site (for 3.10.10 64-bit the link may look like [https://www.python.org/ftp/python/3.10.10/amd64/ucrt.msi](https://www.python.org/ftp/python/3.10.10/amd64/ucrt.msi)).
If you download it manually (Python installer is smart enough to do a cleanup even if it fails, so you won't find this MSI in a local cache) and run, it will probably crash. And if it is your case, I have a simple solution - just [KB2999226](https://support.microsoft.com/en-us/topic/update-for-universal-c-runtime-in-windows-c0514201-7fe6-95a3-b0a5-287930f3560c) for your OS, which you can download from Microsoft.
| null | CC BY-SA 4.0 | null | 2023-02-11T18:50:29.970 | 2023-02-11T18:50:29.970 | null | null | 536,172 | null |
75,422,673 | 2 | null | 75,419,046 | 2 | null | Sorting is always based on `Qt.DisplayRole`.
Trying to use the `EditRole` is pointless, as the [setData()](https://doc.qt.io/qt-5/qtablewidgetitem.html#setData) documentation points out:
> The default implementation treats `Qt::EditRole` and `Qt::DisplayRole` as referring to the same data.
The `Qt.UserRole` is a custom role that could be used for anything (and containing type) and by default is not used for anything in Qt. Setting a value with the `UserRole` doesn't change the sorting, because Qt knows nothing about its existence or how the value should be used.
Since you are using for the sorting, the result is that numbers are not sorted as you may think: for instance "120" is smaller than "13", because "12" comes before "13".
The only occurrence in which the `DisplayRole` properly sorts number values is when it is set with a number:
```
item.setData(Qt.DisplayRole, r)
```
Which will not work for you, as you want to show the "M - " prefix. Also, a common mistake is trying to use that in the constructor:
```
item = QTableWidgetItem(r)
```
And while the syntax is correct, its usage is wrong, as the [integer constructor](https://doc.qt.io/qt-5/qtablewidgetitem.html#QTableWidgetItem) of QTableWidgetItem is used for other purposes.
If you want to support custom sorting, you must create a QTableWidgetItem subclass and implement the [<](https://doc.qt.io/qt-5/qtablewidgetitem.html#operator-lt) operator, which, in Python, is the [__lt__()](https://docs.python.org/3/library/operator.html#operator.__lt__) magic method:
```
class SortUserRoleItem(QTableWidgetItem):
def __lt__(self, other):
return self.data(Qt.UserRole) < other.data(Qt.UserRole)
```
Then you have to create new items using that class. Note that:
- - [setItem()](https://doc.qt.io/qt-5/qtablewidget.html#setItem)- - [item prototype](https://doc.qt.io/qt-5/qtablewidget.html#setItemPrototype)
```
class Table(QTableWidget):
def __init__(self):
super().__init__()
self.setSortingEnabled(True)
self.setItemPrototype(SortUserRoleItem())
def populate(self):
self.setSortingEnabled(False)
self.setColumnCount(3)
self.setRowCount(200)
for row in range(200):
for column in range(3):
r = randint(0, 1000)
item = self.item(row, column)
if not item:
item = SortUserRoleItem()
self.setItem(row, column, item)
item.setData(Qt.DisplayRole, 'M - {}'.format(r))
item.setData(Qt.UserRole, r)
self.setSortingEnabled(True)
```
Note that, as an alternative, you could use a custom delegate, then just set the value of the item as an integer (as shown above) and override the [displayText()](https://doc.qt.io/qt-5/qstyleditemdelegate.html#displayText):
```
class PrefixDelegate(QStyledItemDelegate):
def displayText(self, text, locale):
if isinstance(text, int):
text = f'M - {text}'
return text
class Table(QTableWidget):
def __init__(self):
super().__init__()
self.setItemDelegate(PrefixDelegate(self))
# ...
def populate(self):
# ...
item = self.item(row, column)
if not item:
item = QTableWidgetItem()
self.setItem(row, column, item)
item.setData(Qt.DisplayRole, r)
```
| null | CC BY-SA 4.0 | null | 2023-02-11T19:08:20.160 | 2023-02-11T19:28:45.493 | 2023-02-11T19:28:45.493 | 2,001,654 | 2,001,654 | null |
75,422,690 | 2 | null | 75,422,642 | 2 | null | It is the combination of scale and width and height which do not fit:
Try a scale < 1 or adapt width / height:
```
ggsave(
"chart_test.png" ,
plot = chart,
scale = 0.9,
width = 20,
height = 10,
units = "cm",
dpi=320
)
```
[](https://i.stack.imgur.com/WU7oQ.png)
| null | CC BY-SA 4.0 | null | 2023-02-11T19:11:13.540 | 2023-02-11T19:11:13.540 | null | null | 13,321,647 | null |
75,422,818 | 2 | null | 75,417,790 | 0 | null | The canonical table design for this in SQL Server is:
```
create table Cat_Treat
(
treat_id int not null references Treat,
cat_id int not null references Cat,
constraint pk_Cat_Treat primary key (treat_it,cat_id),
index ix_Cat_Treat_cat_id (cat_id)
)
```
| null | CC BY-SA 4.0 | null | 2023-02-11T19:36:40.817 | 2023-02-11T19:36:40.817 | null | null | 7,297,700 | null |
75,423,116 | 2 | null | 75,422,960 | 1 | null | From the Menu: `Help/Edit Custom Properties...`It opens the `idea.properties` file, add to it this lines:
```
project.tree.structure.show.url=false
ide.tree.horizontal.default.autoscrolling=false
```
It applies the changes to all of the projects.
| null | CC BY-SA 4.0 | null | 2023-02-11T20:30:33.420 | 2023-02-12T08:36:30.677 | 2023-02-12T08:36:30.677 | 1,233,251 | 16,278,890 | null |
75,423,288 | 2 | null | 75,417,790 | 0 | null | I think you draw the edges on that diagram pointing in the wrong directions.
The M:N relationship can be defined as:
```
create table cat_treat (
treat_id int not null references treat (treat_id),
cat_id int not null references cat (cat_id),
primary key (treat_id, cat_id)
);
```
| null | CC BY-SA 4.0 | null | 2023-02-11T21:05:27.640 | 2023-02-11T21:05:27.640 | null | null | 6,436,191 | null |
75,423,954 | 2 | null | 75,423,698 | 2 | null | The `reset` method won't work because the form is not in control over the values in the inputs, React is.
I would recommend that you change some things up. Move your list into a state and add the `checked` property to each list item object. This will keep your data grouped.
The `total` value is always calculated based on the checked items in the `list`. Since we've now grouped added `checked` property to each object, we can calculate the total by looping over the `list`. Use `useMemo` for the `total`. The reason for this is that you want to calculate `total` after every time that `list` has been updated. With `useMemo` you can store each calculation and reuse the stored total whenever the same `list` state occurs.
```
import { useState, useMemo } from 'react';
// EmailJS
import EmailJS from '@emailjs/browser';
const App = () => {
const [list, setList] = useState([
{
name: 'A',
price: 50,
checked: false
},
{
name: 'B',
price: 50,
checked: false
},
]);
const total = useMemo(() => {
const initialValue = 0;
return list.reduce((acc, cur) => {
if (cur.checked === true) {
acc += cur.price;
}
return acc;
}, initialValue);
}, [list]);
const resetForm = () => {
setList(prevState =>
prevState.map(listItem => ({
...listItem,
checked: false
}))
);
};
const sendEmail = (e) => {
e.preventDefault();
EmailJS.sendForm(
'YOUR_SERVICE_ID', // Please put your service ID if you have Email JS.
'YOUR_TEMPLATE_ID', // Please put your template ID if you have Email JS.
e.target,
'YOUR_PUBLIC_KEY' // Please put your key if you have Email JS.
).then(
(result) => {
console.log(result.text);
},
(error) => {
console.log(error.text);
}
);
resetForm();
};
const toggle = (toggleIndex) => {
setList(prevState =>
prevState.map((listItem, index) => {
if (toggleIndex !== index) {
return listItem;
}
return ({
...listItem,
checked: !listItem.checked
});
})
);
};
const getTotalPrice = (price) => {
return `$${price.toFixed(2)} `;
};
// JSX
return (
<>
<div className='flex mx-36'>
<div className='flex-1'>
<form onSubmit={sendEmail} required>
<fieldset className='border border-solid rounded border-gray-300 p-3'>
<legend className='p-1'>Choice</legend>
<ul>
{list.map(({ name, price, checked }, index) => {
return (
<li key={index} className='flex justify-between'>
<div className='p-1'>
<input
type='checkbox'
checked={checked}
onChange={() => toggle(index)}
id={`linked-${index}`}
name='services'
value={name}
/>
<label htmlFor={`linked-${index}`} className='p-1'>
{name}
</label>
</div>
<div>{getTotalPrice(price)}</div>
</li>
);
})}
</ul>
</fieldset>
<fieldset className='flex justify-between p-8'>
<label htmlFor='total'>Price</label>
<input
type='text'
name='total'
value={getTotalPrice(total)}
className='w-16 border-none outline-none'
readOnly
/>
</fieldset>
{/* Send button */}
<button
className='table mx-auto border border-gray-300 rounded mt-4 px-6 py-1'
type='submit'
>
Send
</button>
</form>
</div>
</div>
</>
);
};
export default App;
```
| null | CC BY-SA 4.0 | null | 2023-02-11T23:23:40.600 | 2023-02-15T08:44:19.020 | 2023-02-15T08:44:19.020 | 11,619,647 | 11,619,647 | null |
75,424,065 | 2 | null | 75,422,834 | 0 | null | You will either have to the push key (`-NN...`) value of the node you want to update already, determine it with a query, or loop over all child nodes and update them all.
## Update a specific child with a known push key
```
myRef.child(uid).child("-NNsQO7O9lh0ShefShV")
.updateChildren(map);
```
## Update children matching a specific query
Say that you know you want to update the node with `name` `"test12"`, you can use a query for that:
```
myRef.child(uid).orderByChild("name").equalToValue("test12").addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
for (DataSnapshot nodeSnapshot: dataSnapshot.getChildren()) {
nodeSnapshot.getRef().updateChildren(map);
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
throw databaseError.toException();
}
})
```
## Update all children
This is a simpler version of the above, by removing the query condition:
```
myRef.child(uid).addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
for (DataSnapshot nodeSnapshot: dataSnapshot.getChildren()) {
nodeSnapshot.getRef().updateChildren(map);
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
throw databaseError.toException();
}
})
```
| null | CC BY-SA 4.0 | null | 2023-02-11T23:50:19.943 | 2023-02-11T23:50:19.943 | null | null | 209,103 | null |
75,424,375 | 2 | null | 75,423,489 | 0 | null | Try this one. You can customize this to your range slider.
[https://angular-slider.github.io/ngx-slider/](https://angular-slider.github.io/ngx-slider/)
| null | CC BY-SA 4.0 | null | 2023-02-12T01:25:26.010 | 2023-02-12T01:25:26.010 | null | null | 9,423,643 | null |
75,424,508 | 2 | null | 64,987,255 | 2 | null | if you are on mac the put this in :
```
flutter config --android-studio-dir "/Applications/Android Studio.app/Contents"
```
| null | CC BY-SA 4.0 | null | 2023-02-12T02:06:59.567 | 2023-02-12T02:06:59.567 | null | null | 5,175,944 | null |
75,424,532 | 2 | null | 68,879,534 | 0 | null | Short way to do this. W/out using `==1` and `==2`.
snippet:
```
description_label = Label(frame1)
description_label.grid(row=4, column=0, columnspan=4)
def select_description(event):
choice = list_profiles.get(ANCHOR)
if choice:
description_label.config(text=...)
else:
description_label.config(text=...)
```
| null | CC BY-SA 4.0 | null | 2023-02-12T02:16:16.250 | 2023-02-12T02:16:16.250 | null | null | 4,136,999 | null |
75,424,600 | 2 | null | 75,343,721 | 0 | null | I had the exact same issue but the culprit was...
'com.google.android.gms:play-services-ads:21.5.0'
I went back to
'com.google.android.gms:play-services-ads:21.2.0'
and everything was fine.
| null | CC BY-SA 4.0 | null | 2023-02-12T02:37:49.867 | 2023-02-12T02:37:49.867 | null | null | 21,193,310 | null |
75,424,830 | 2 | null | 50,549,553 | 0 | null | > 4 clients, 4 servers, R = 300 mbps, Rs = 100 mbps, Rc = 60 mbps
> Rs = The rate of the link between the server and the router
> Rc = The rate of the link between the router and the client
1. Computing Throughput: min{Rs, Rc}
2.
3. Utilizations for the server links: min{Rs, Rc} / Rs Utilizations for the client links: min{Rs, Rc} / Rc Utilizations for the shared link: (min{Rs, Rc} * number of (clients/servers)) / R
Assuming that the middle link is : `min{Rs, Rc}`
| null | CC BY-SA 4.0 | null | 2023-02-12T04:02:19.257 | 2023-02-12T04:02:19.257 | null | null | 20,940,360 | null |
75,424,875 | 2 | null | 18,249,758 | 0 | null | Listen for the `input` event on the `<input>` element and then compare the `<input>` element's value to all of the `<option>` values to isolate selection of an option (vs keying in values to the input).
```
const input = document.getElementById("ice-cream-choice");
const list = document.getElementById("ice-cream-flavors");
input.addEventListener("input", function(e){
if(isOptionValue(list,input.value)){
console.log("List input fired: " + input.value);
}
});
function isOptionValue(datalist,val){
let result = false;
if(datalist instanceof Element || datalist instanceof HTMLDocument){
let options = datalist.querySelectorAll("option");
options.forEach(function(option){
if (option.value === val){
result = true;
}
})
}
return result;
}
```
```
<input list="ice-cream-flavors" id="ice-cream-choice" name="ice-cream-choice">
<datalist id="ice-cream-flavors">
<option value="Chocolate">
<option value="Coconut">
<option value="Mint">
<option value="Strawberry">
<option value="Vanilla">
</datalist>
```
| null | CC BY-SA 4.0 | null | 2023-02-12T04:22:01.877 | 2023-02-12T04:22:01.877 | null | null | 4,797,603 | null |
75,425,149 | 2 | null | 64,763,022 | 0 | null | Safari rounds font sizes to the nearest 1px... [https://bugs.webkit.org/show_bug.cgi?id=46987](https://bugs.webkit.org/show_bug.cgi?id=46987)
| null | CC BY-SA 4.0 | null | 2023-02-12T05:49:50.280 | 2023-02-12T05:49:50.280 | null | null | 664,456 | null |
75,425,176 | 2 | null | 75,424,763 | 0 | null | You need to either remove the column from select list like:
```
SELECT p.id, count(po.color_id) color_count
FROM products p
INNER JOIN sub_categories sc
ON sc.id = p.sub_category_i`enter code here`d
INNER JOIN categories c
ON sc.category_id = c.id
LEFT JOIN products_options po
ON po.product_id = p.id
INNER JOIN genders g
ON po.gender_id = g.id
WHERE c.id = 1
GROUP BY p.id
ORDER BY p.id ASC;
```
or add in group by clause the select columns like:
```
SELECT p.id, p.name, sc.name sub_category, c.name category, count(po.color_id) color_count, g.type
FROM products p
INNER JOIN sub_categories sc
ON sc.id = p.sub_category_id
INNER JOIN categories c
ON sc.category_id = c.id
LEFT JOIN products_options po
ON po.product_id = p.id
INNER JOIN genders g
ON po.gender_id = g.id
WHERE c.id = 1
GROUP BY p.id,p.name, sc.name sub_category, c.name category, g.type
ORDER BY p.id ASC;
```
| null | CC BY-SA 4.0 | null | 2023-02-12T05:57:18.823 | 2023-02-14T22:40:46.897 | 2023-02-14T22:40:46.897 | 14,015,737 | 21,196,180 | null |
75,425,219 | 2 | null | 75,424,285 | 1 | null | As mentioned by [Blue](https://stackoverflow.com/users/4875631/blue) in [a comment](https://stackoverflow.com/questions/75424285/how-to-delete-empty-code-templates-in-visual-studio-2019/75425219#comment133082686_75424285)
> Click on the associated controls in the designer view, and click the lightning bolt to view events. Delete them from there and you should be free to delete the leftover code.
It is a bad idea to edit event code signatures outside the designer.
Make sure you open the designer often or have frequent version control to avoid file corruption.
| null | CC BY-SA 4.0 | null | 2023-02-12T06:09:03.680 | 2023-02-15T21:41:07.013 | 2023-02-15T21:41:07.013 | 4,108,803 | 2,824,791 | null |
75,425,697 | 2 | null | 75,423,631 | 1 | null | Just apply the `weight` modifier:
```
Column(
) {
Row(Modifier.fillMaxWidth()){
Text("Text1",Modifier.weight(1f).border(1.dp, Black))
Text("Text2",Modifier.weight(1f).border(1.dp, Black))
Text("Text3",Modifier.weight(1f).border(1.dp, Black))
}
Row(Modifier.fillMaxWidth()){
Box(Modifier.fillMaxWidth().height(20.dp).background(Yellow))
}
Row(Modifier.fillMaxWidth()){
Text("Text1",Modifier.weight(1f).border(1.dp, Black))
Text("Text2",Modifier.weight(1f).border(1.dp, Black))
Text("Text3",Modifier.weight(1f).border(1.dp, Black))
}
}
```
[](https://i.stack.imgur.com/N0FYi.png)
| null | CC BY-SA 4.0 | null | 2023-02-12T08:18:56.857 | 2023-02-12T08:18:56.857 | null | null | 2,016,562 | null |
75,425,791 | 2 | null | 75,420,218 | 0 | null | Check your gradle files. I would suggest you to create new project and copy content in gradle to existing project and add required dependencies. Error is usually caused by incompatible version of java. Download latest Android studio and set jdk to java 17.
[Check this link](https://developer.android.com/studio/build)
| null | CC BY-SA 4.0 | null | 2023-02-12T08:41:47.423 | 2023-02-12T09:18:59.093 | 2023-02-12T09:18:59.093 | 5,229,463 | 5,229,463 | null |
75,425,845 | 2 | null | 74,763,436 | 0 | null | Select your query in History tab, Results tab will display next to it.
| null | CC BY-SA 4.0 | null | 2023-02-12T08:54:29.063 | 2023-02-12T08:54:29.063 | null | null | 21,196,764 | null |
75,425,926 | 2 | null | 5,286,663 | 0 | null | Yes, you absolutely can. This is the code me and my sister wrote for our website for people to input questions and extra information, and it also has a wrapping text box. There may be some things you'll have to change to make it right for what you are using it for.
```
<div class="product-form__input">
<label class="form__label" for="custom-questions">
Your Question(s) & Additional Info.
</label>
<textarea class="field__textarea" required style="border:3px double #121212;" id="custom-questions" form="{{product_form_id}}" name="properties[Your Question(s) & Additional Info.]" rows="3" cols="41">
</textarea>
</div>
```
| null | CC BY-SA 4.0 | null | 2023-02-12T09:12:51.213 | 2023-02-15T15:11:02.350 | 2023-02-15T15:11:02.350 | 933,575 | 21,196,862 | null |
75,425,989 | 2 | null | 71,479,940 | 1 | null | use media query for this:
```
@media print {
span.cm-em.cm-highlight {
background-color: var(--highlight-red);
color: #222;
}
body>.app-container div.markdown-preview-view em>mark {
background-color: var(--highlight-red);
color: #222;
}
}
```
| null | CC BY-SA 4.0 | null | 2023-02-12T09:24:02.700 | 2023-02-12T09:24:02.700 | null | null | 13,922,407 | null |
75,426,124 | 2 | null | 75,418,364 | 0 | null | I managed to fix it:
```
author:: [[{{author}}]]\
full-title:: "{{full_title}}"\
category:: #{{category}}\
{% if url %}url:: {{url}}{% endif -%}\
{% if document_note %}document_note:: {{document_note}}{% endif -%}
{% if document_tags %}tags:: {% for tag in document_tags %}#[[{{tag}}]] {% endfor %} {% endif %}\
{% if image_url %}{% endif %}
```
Changes include adding - before the % in the endif
| null | CC BY-SA 4.0 | null | 2023-02-12T09:49:10.313 | 2023-02-12T09:49:10.313 | null | null | 21,191,361 | null |
75,426,539 | 2 | null | 75,419,305 | 2 | null | This is not perfect, but maybe you can work more in this direction. I really did some experimentation here.
The front card is a marker, making it follow the angle of the line that it is placed on. The line is then positions according to the mouse. The mask that cuts off the cards in the bottom is made with a line that has a wide (large) stroke and fixed in the bottom left corner.
```
let SVG = document.getElementById("SVG");
let LINE1 = document.getElementById("LINE1");
let LINE2 = document.getElementById("LINE2");
const toSVGPoint = (x, y) => (new DOMPoint(x, y)).matrixTransform(SVG.getScreenCTM().inverse());
SVG.addEventListener('mousemove', e => {
let p = toSVGPoint(e.clientX, e.clientY);
LINE1.setAttribute('x2', p.x);
LINE1.setAttribute('y2', p.y);
LINE1.setAttribute('x1', 0-p.x);
LINE1.setAttribute('y1', 278-p.x);
LINE2.setAttribute('x2', p.x);
LINE2.setAttribute('y2', p.y);
});
```
```
<svg id="SVG" viewBox="0 0 300 278" style="height:180px">
<defs>
<pattern id="back" width="200" height="278" patternUnits="userSpaceOnUse" >
<image width="200" href="https://svg-cdn.github.io/cm-back-red.svg" />
</pattern>
<mask id="mask1">
<rect width="100%" height="100%" fill="white"/>
<line id="LINE2" x1="0" y1="278" x2="0" y2="278"
stroke="black" stroke-width="500"
stroke-dasharray="50 50" pathLength="100" />
</mask>
<marker id="card" viewBox="-278 0 278 200" refX="0" refY="0"
markerWidth="278" markerHeight="200"
markerUnits="userSpaceOnUse" orient="auto">
<image transform="rotate(90)" width="200"
href="https://svg-cdn.github.io/cm-hearts-king.svg" />
</marker>
</defs>
<g mask="url(#mask1)">
<rect class="back" width="200" height="278" fill="url(#back)" />
<line id="LINE1" x1="0" y1="278" x2="0" y2="0" stroke="none" marker-end="url(#card)" />
</g>
</svg>
```
| null | CC BY-SA 4.0 | null | 2023-02-12T11:08:32.327 | 2023-02-12T11:31:41.887 | 2023-02-12T11:31:41.887 | 2,520,800 | 322,084 | null |
75,426,856 | 2 | null | 75,426,710 | 0 | null | Can you try this :
```
SELECT U.first_name, UR.authority_id as AUTHORITY_REL_AUTH_ID, AM.authority
FROM authority_master AM
LEFT JOIN users_authority_relation UR ON AM.authority_id=UR.authority_id AND UR.user_id = 1
LEFT JOIN userdetails U ON U.user_id = 1
```
[Demo here](http://sqlfiddle.com/#!9/e22eb6/67)
| null | CC BY-SA 4.0 | null | 2023-02-12T12:06:50.847 | 2023-02-12T13:52:49.383 | 2023-02-12T13:52:49.383 | 4,286,884 | 4,286,884 | null |
75,426,892 | 2 | null | 75,352,643 | 1 | null | I did some research for you and I found this, it should be what you are looking for.
CREDIT: [https://sangkrit.net/how-to-hide-mediawiki-sidebar-from-visitors/](https://sangkrit.net/how-to-hide-mediawiki-sidebar-from-visitors/)
You can suppress the display of the sidebar from anonymous and un-logged-in users on your MediaWiki website. This can be done by creating a new PHP file in extensions folder then including the code in LocalSettings.php file.
Login to your MediaWiki website’s file manager or FTP, navigate to /extensions directory located in your site’s root and create a new folder /HideSidebar.
Open the folder, create a new PHP file with name HideSidebar.php and paste the following code:
```
<?php
if ( !defined( 'MEDIAWIKI' ) ) {
echo "Not a valid entry point";
exit( 1 );
}
$wgExtensionCredits['other'][] = array(
'path' => __FILE__,
'name' => 'HideSidebar',
'version' => '1.0.1',
'author' => 'Jlerner',
'url' => 'https://www.mediawiki.org/wiki/Extension:HideSidebar',
'description' => 'Allows to hide the sidebar from anonymous users',
);
$wgHooks['SkinBuildSidebar'][] = 'efHideSidebar';
function efHideSidebar($skin, &$bar) {
global $wgUser;
// Hide sidebar for anonymous users
if (!$wgUser->isLoggedIn()) {
$url = Title::makeTitle(NS_SPECIAL, 'UserLogin')->getLocalUrl();
$bar = array(
'navigation' => array(
array('text' => 'Login',
'href' => $url,
'id' => 'n-login',
'active' => '')
)
);
}
return true;
}
```
Now open LocalSettings.php file and add this line of code:
```
require_once "$IP/extensions/HideSidebar/HideSidebar.php";
```
Save changes and you are done.
| null | CC BY-SA 4.0 | null | 2023-02-12T12:11:43.937 | 2023-02-12T12:11:43.937 | null | null | 12,471,543 | null |
75,427,092 | 2 | null | 75,416,543 | 0 | null | I checked the URL. The reason [Menu] and [Search Box] not working (in mobile view) is JS error you saw in console. If you fix that, they will be fixed too.
I can see that your home page is OK currently:
[http://test6.harfrooz.com](http://test6.harfrooz.com)
You can see that the grid is not loading anymore in article view but in your demo it is loading yet and I guess that's the reason (perhaps it occurred after disabling some menus?).
So you should disable grid in article view somehow! For first try check the template manager and see how many styles are there? specific themes usually selected through menu manager.
| null | CC BY-SA 4.0 | null | 2023-02-12T12:49:36.510 | 2023-02-13T15:40:02.507 | 2023-02-13T15:40:02.507 | 20,661,326 | 5,655,747 | null |
75,427,065 | 2 | null | 75,318,448 | 0 | null | Simply adapt my answer from your previous question [https://stackoverflow.com/a/75270151/14460824](https://stackoverflow.com/a/75270151/14460824) and select all needed information from detail pages.
Instead of extending the `list` with lists append `dicts`.
#### Example
Be aware, this example breaks after first iteration for demo purposes, simply remove `break` from loop to get all results, also adapt handling of check if elements ar available.
```
import requests, re
import pandas as pd
from bs4 import BeautifulSoup
data = []
soup = BeautifulSoup(
requests.get('https://www.booking.com/searchresults.html?label=gen173nr-1FCAEoggI46AdIM1gEaGyIAQGYATG4ARfIAQzYAQHoAQH4AQKIAgGoAgO4AuS4sJ4GwAIB0gIkYWJlYmZiMWItNWJjMi00M2Y2LTk3MGUtMzI2ZGZmMmIyNzMz2AIF4AIB&aid=304142&dest_id=-2092174&dest_type=city&group_adults=2&req_adults=2&no_rooms=1&group_children=0&req_children=0&nflt=ht_id%3D204&rows=15',
headers={'user-agent':'some agent bond'}
).text)
num_results = int(re.search(r'\d+',soup.select_one('div:has(+[data-testid="pagination"])').text).group(0))
for i in range(0,int(num_results/25)):
soup = BeautifulSoup(
requests.get(f'https://www.booking.com/searchresults.html?label=gen173nr-1FCAEoggI46AdIM1gEaGyIAQGYATG4ARfIAQzYAQHoAQH4AQKIAgGoAgO4AuS4sJ4GwAIB0gIkYWJlYmZiMWItNWJjMi00M2Y2LTk3MGUtMzI2ZGZmMmIyNzMz2AIF4AIB&aid=304142&dest_id=-2092174&dest_type=city&group_adults=2&req_adults=2&no_rooms=1&group_children=0&req_children=0&nflt=ht_id%3D204&rows=15&offset={int(i*25)}',
headers={'user-agent':'some agent'}
).text
)
for e in soup.select('[data-testid="property-card"]'):
data.append({
'title': e.select_one('[data-testid="title"]').text,
'score': e.select_one('[data-testid="review-score"]').contents[0].text if e.select_one('[data-testid="review-score"]') else None,
'ratings': e.select_one('[data-testid="review-score"]').text.split()[-2],
'address':e.select_one('[data-testid="address"]').text,
'distance':e.select_one('[data-testid="distance"]').text
})
break
pd.DataFrame(data)
```
#### Output
| | title | score | ratings | address | distance |
| | ----- | ----- | ------- | ------- | -------- |
| 0 | Hotel Ariana Residency | 7 | 179 | Western Suburbs, Mumbai | 17.7 km from centre |
| 1 | MAXX VALUE - HOTEL KOHINOOR CONTINENTAL | 7.4 | 12 | Western Suburbs, Mumbai | 16.7 km from centre |
| 2 | West End Hotel Opp Bombay Hospital | 7.1 | 168 | South Mumbai, Mumbai | 3.3 km from centre |
| 3 | The Leela Mumbai | 8.6 | 2,536 | Western Suburbs, Mumbai | 16.6 km from centre |
| 4 | Marriott Executive Apartment - Lakeside Chalet, Mumbai | 7.8 | 265 | Powai, Mumbai | 20.1 km from centre |
| ... | | | | | |
| 20 | Taj Santacruz | 8.8 | 2,980 | Mumbai | 14.2 km from centre |
| 21 | Hotel Suncity Residency | 6.9 | 56 | Western Suburbs, Mumbai | 17.3 km from centre |
| 22 | Niranta Transit Hotel Terminal 2 Arrivals/Landside | 7.6 | 2,380 | Andheri, Mumbai | 15.5 km from centre |
| 23 | JW Marriott Mumbai Juhu | 8.4 | 1,318 | Juhu, Mumbai | 14.8 km from centre |
| 24 | Hotel Bawa Continental | 7.9 | 754 | Juhu, Mumbai | 14.7 km from centre |
| null | CC BY-SA 4.0 | null | 2023-02-12T12:43:24.437 | 2023-02-12T12:48:33.227 | 2023-02-12T12:48:33.227 | 14,460,824 | 14,460,824 | null |
75,427,120 | 2 | null | 75,426,835 | 0 | null | I would try defining the tabitems in xaml.
The tabcontrol is an itemscontrol. I would usually bind the itemssource to a collection of viewmodels and template those out into ui. You only get whichever one of those items is selected instantiated if you bind the items like that. Defining tabitems in xaml seems to mean they're all instantiated. It's noticeably slower.
You can add other tabs afterwards in code if you wanted. But I'd check what happens with some defined in xaml first.
Another thing you could try is hidden webview2 controls in the main view. Navigate to these fixed url immediately the window renders.
Move them out the window and into your tabitem on selecting that tab, set isvisible true. Then you're just incurring rendering.
Btw
The webview2 is a wrapper around a chromium edge browser. It displays some odd behaviour like it can overflow parent containers.
| null | CC BY-SA 4.0 | null | 2023-02-12T12:54:58.493 | 2023-02-13T08:57:43.887 | 2023-02-13T08:57:43.887 | 426,185 | 426,185 | null |
75,427,111 | 2 | null | 75,352,643 | 0 | null | Based on [Adam's answer](https://stackoverflow.com/a/75426892/2817442) and [Robert's comment](https://sangkrit.net/how-to-hide-mediawiki-sidebar-from-visitors/#comment-361956) on the [site](https://sangkrit.net/how-to-hide-mediawiki-sidebar-from-visitors/) referenced:
This can be done by creating a new PHP file in extensions folder then including the code in LocalSettings.php file.
Login to your MediaWiki website’s file manager or FTP, navigate to /extensions directory located in your site’s root and create a new folder /HideSidebar.
Open the folder, create a new PHP file with name HideSidebar.php and paste the following () code:
```
<?php
if ( !defined( 'MEDIAWIKI' ) ) {
echo "Not a valid entry point";
exit( 1 );
}
$wgExtensionCredits['other'][] = array(
'path' => __FILE__,
'name' => 'HideSidebar',
'version' => '1.0.1',
'author' => 'Jlerner',
'url' => 'https://www.mediawiki.org/wiki/Extension:HideSidebar',
'description' => 'Allows to hide the sidebar from anonymous users',
);
$wgHooks['SkinBuildSidebar'][] = 'efHideSidebar';
function efHideSidebar($skin, &$bar) {
$user = RequestContext::getMain()->getUser();
// Hide sidebar for anonymous users
if ($user->getId() == 0) {
$url = Title::makeTitle(NS_SPECIAL, 'UserLogin')->getLocalUrl();
$bar = array(
'navigation' => array(
array('text' => 'Login',
'href' => $url,
'id' => 'n-login',
'active' => '')
)
);
}
return true;
}
```
Now open LocalSettings.php file and add this line of code:
```
require_once "$IP/extensions/HideSidebar/HideSidebar.php";
```
Save changes and you are done.
| null | CC BY-SA 4.0 | null | 2023-02-12T12:52:41.127 | 2023-02-12T12:52:41.127 | null | null | 2,817,442 | null |
75,427,159 | 2 | null | 75,426,710 | 0 | null | It isn't pretty, but you need the hole thing
:
```
SELECT COALESCE(U.first_name,U2.first_name)
,UR.authority_id as AUTHORITY_REL_AUTH_ID,
AM.authority
FROM ( userdetails U
INNER JOIN users_authority_relation UR
ON U.user_id=UR.user_id ANd u.user_id = 1)
RIGHT JOIN (userdetails U2 CROSS JOIN authority_master AM )
ON AM.authority_id=UR.authority_id
WHERE U2.user_id = 1
```
[Results](http://sqlfiddle.com/#!9/e22eb6/49/0):
```
| COALESCE(U.first_name,U2.first_name) | AUTHORITY_REL_AUTH_ID | authority |
|--------------------------------------|-----------------------|---------------|
| admin | 1 | ADMIN_USER |
| admin | 2 | STANDARD_USER |
| admin | (null) | NEW_CANDIDATE |
| admin | 4 | HR_PERMISSION |
```
| null | CC BY-SA 4.0 | null | 2023-02-12T13:01:39.057 | 2023-02-12T13:01:39.057 | null | null | 5,193,536 | null |
75,428,660 | 2 | null | 75,427,884 | 0 | null | after the first occurrence of `Set sht = ThisWorkbook.Sheets.Add(After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count))`, `sht` will NOT be `Nothing` even if `Set sht = ThisWorkbook.Sheets(cell.Value)` should fail
so be sure to set `sht` to `Nothing` at each iteration
while `... .Copy sht.Range("A1")` will always be pasting from cell A1 of the target sheet, hence you have to update the target cell like with `sht.Cells(Rows.Count, 1).End(xlUp).Offset(1)`
So that you could use the following:
```
For Each cell In rng
If Len(cell.Value) > 0 And Not IsNumeric(cell.Value) Then
Set sht = Nothing ' set sht to Nothing and erase the result of the preceeding loop
On Error Resume Next
Set sht = ThisWorkbook.Sheets(cell.Value)
On Error GoTo 0
If sht Is Nothing Then
Set sht = ThisWorkbook.Sheets.Add(After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count))
sht.Name = cell.Value
End If
ws.Range("A" & cell.Row & ":H" & cell.Row).Copy sht.Cells(Rows.Count, 1).End(xlUp).Offset(1) 'paste starting from column A first empty cell after last not empty one
End If
Next cell
```
| null | CC BY-SA 4.0 | null | 2023-02-12T17:00:46.527 | 2023-02-12T17:00:46.527 | null | null | 3,598,756 | null |
75,428,670 | 2 | null | 30,421,875 | 0 | null |
1. Navigate to https://github.com/settings/tokens
2. Under personal access tokens Select Tokens classic
3. Click on Generate new token.
4. Select the required options.
5. Then click on generate token
Copy this token and paste it in the authentication prompt where its asking for user name and password.
For user name put your github user name and under password use the newly generated Classic token and commit the code..
Hope this helps !!!! :)
| null | CC BY-SA 4.0 | null | 2023-02-12T17:01:44.240 | 2023-02-12T17:01:44.240 | null | null | 19,812,477 | null |
75,428,682 | 2 | null | 75,428,385 | 0 | null | From `@PropertySource` documantation:
> Annotation providing a convenient and declarative mechanism for adding a PropertySource to Spring's Environment. To be used in conjunction with @Configuration classes.
You don't have `@Configuration` anotation under class declaration.
Your second example has @ConfigurationProperties annotation and this is from documentation:
> Annotation for externalized configuration. Add this to a class definition or a @Bean method in a @Configuration class if you want to bind and validate some external Properties (e.g. from a .properties file).
In a nutshell: `@PropertySource` need `@Configuration` but `@ConfigurationProperties` not.
Last not first visible detail: PropertySource cannot read yaml files :-)
| null | CC BY-SA 4.0 | null | 2023-02-12T17:03:00.403 | 2023-03-04T22:06:40.383 | 2023-03-04T22:06:40.383 | 11,158,542 | 11,158,542 | null |
75,428,701 | 2 | null | 73,267,007 | 0 | null | It is recommended to use `definePageMeta`.
[https://nuxt.com/docs/api/utils/define-page-meta](https://nuxt.com/docs/api/utils/define-page-meta)
Use `NuxtLayout`:
```
// ~/app.vue
<template>
<div>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</div>
</template>
```
File in `layouts` foldernamed `default` will be loaded if no layout is specified.
```
// ~/layouts/default.vue
<template>
<h1>Default Layout</h1>
<slot />
</template>
```
Create more layouts with any name...
```
// ~/layouts/custom.vue
<template>
<h1>My Custom Layout</h1>
<slot />
</template>
```
Use `definePageMeta` in a content page to specify a `layout` name that matches the file name of a layout in the `layouts` directory.
```
// ~/pages/index.vue
<script setup>
definePageMeta({
layout: 'custom'
})
</script>
<template>
<div>
Content page using specific layout
</div>
</template>
```
[https://nuxt.com/docs/guide/directory-structure/layouts](https://nuxt.com/docs/guide/directory-structure/layouts)
| null | CC BY-SA 4.0 | null | 2023-02-12T17:05:56.093 | 2023-02-12T17:05:56.093 | null | null | 1,356,141 | null |
75,429,252 | 2 | null | 75,428,828 | 0 | null | The maximum radius of an arc between two lines in 3D depends on the distance between the lines and the angle between them. The radius of the arc is given by: code example :
r = (d / 2) / sin(theta / 2)
Where d is the distance between the lines, and theta is the angle between the lines. The radius r is the maximum possible radius of the arc that can be formed between the lines, such that the arc lies in the plane that is perpendicular to the direction vectors of both lines and bisects the angle between the lines.
| null | CC BY-SA 4.0 | null | 2023-02-12T18:31:19.933 | 2023-02-12T18:31:19.933 | null | null | 20,768,574 | null |
75,429,384 | 2 | null | 75,428,784 | 0 | null | 1rst message: the one in red, which you are looking for
2nd message: the one that responds to the 1rst one
- First, you get the 2nd message. This is a `discord.Message`, and
has the `reference` attribute.- Then, from the `reference`, which is a
`discord.MessageReference`, you get the `message_id` (and the
`channel_id` if you don't already have it)- Finally, you get the 1rst message by searching the `message_id`
in the channel (that you get with `channel_id` if you don't
already have it)
| null | CC BY-SA 4.0 | null | 2023-02-12T18:51:52.040 | 2023-02-12T18:51:52.040 | null | null | 15,810,170 | null |
75,429,471 | 2 | null | 75,426,505 | 0 | null | I got the solution!
The problem was that the client needs the intent GuildPresence.
GatewayIntentBits.GuildPresences
| null | CC BY-SA 4.0 | null | 2023-02-12T19:05:51.607 | 2023-02-12T19:25:55.083 | 2023-02-12T19:25:55.083 | 21,197,186 | 21,197,186 | null |
75,429,690 | 2 | null | 75,429,632 | 1 | null | Modify the following settings in your settings.json file:
```
"workbench.colorCustomizations": {
// TODO replace "#ff0000" with the hex code of the colours you want
"editorGutter.background": "#ff0000",
"editorGutter.addedBackground": "#ff0000",
"editorGutter.modifiedBackground": "#ff0000",
"editorGutter.deletedBackground": "#ff0000",
}
```
If you want the settings to only apply to a specific colour theme, do it like so:
```
"workbench.colorCustomizations": {
"[Theme Name Goes Here]": {
"editorGutter.background": "#ff0000",
...
},
}
```
You can also be interested in the `gitDecoration.addedResourceForeground` and other similarly named color customization points.
There are also the following customization points if you are interested:
```
"minimapGutter.addedBackground": "#ff0000",
"minimapGutter.modifiedBackground": "#ff0000",
"minimapGutter.deletedBackground": "#ff0000"
```
| null | CC BY-SA 4.0 | null | 2023-02-12T19:39:37.627 | 2023-02-12T19:39:37.627 | null | null | 11,107,541 | null |
75,429,769 | 2 | null | 75,429,696 | 2 | null | Just from a quick look at it, it looks like your jdbc connector address isn't complete. You are missing a db there, something like
`jdbc:mysql://localhost:3306/ReallyNiceDb`
In MySQL, you will need to create a database, in this case, called `ReallyNiceDb`. Then, to this database, you will need to allow your user to interact with that database.
More info can be found here:
[https://dev.mysql.com/doc/refman/8.0/en/creating-database.html](https://dev.mysql.com/doc/refman/8.0/en/creating-database.html)
| null | CC BY-SA 4.0 | null | 2023-02-12T19:51:19.390 | 2023-02-12T19:53:34.443 | 2023-02-12T19:53:34.443 | 12,816,955 | 12,816,955 | null |
75,429,900 | 2 | null | 75,429,842 | 0 | null | You can do:
```
SELECT [Sales_Line_Item].[Sales Date],
SUM([Sales_Line_Item].[Quantity]*[Sales_Line_Item].[Unit Price]) AS [Total Sales]
FROM Sales_Line_Item
WHERE [Sales Date] = #9/1/2020#
GROUP BY [Sales Date]
```
| null | CC BY-SA 4.0 | null | 2023-02-12T20:11:59.400 | 2023-02-12T20:11:59.400 | null | null | 5,389,127 | null |
75,429,934 | 2 | null | 75,428,547 | 0 | null | try add contentPadding EdgeInsets.zero inside InputDecoration
```
return SizedBox(height: 42.5, child: DropdownButtonFormField(
value: _selectedVal,
items: _items
.map((x) => DropdownMenuItem(
value: x,
child: Text(x),
))
.toList(),
onChanged: (val) {
setState(() {
_selectedVal = val as String;
});
},
decoration: const InputDecoration(
contentPadding: EdgeInsets.zero <====== Here
filled: true,
fillColor: Colors.white,
hintText: 'hintText',
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey),
borderRadius: BorderRadius.all(Radius.circular(10))),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey),
borderRadius: BorderRadius.all(Radius.circular(10)),
),
),
));
```
| null | CC BY-SA 4.0 | null | 2023-02-12T20:19:53.803 | 2023-02-12T20:19:53.803 | null | null | 11,703,061 | null |
75,430,035 | 2 | null | 74,096,061 | 0 | null | Uninstalling dlib then installing it again at version 19.20.0 fixed it for me.
```
pip install dlib==19.20.0
```
| null | CC BY-SA 4.0 | null | 2023-02-12T20:39:21.397 | 2023-02-12T20:39:21.397 | null | null | 14,989,409 | null |
75,430,090 | 2 | null | 75,429,136 | 1 | null | Commonly with microcontrollers, the content of the `.data` section needs to be initialized by the start-up code from a section in non-volatile memory of the same size. Apparently your start-up code does not fulfill this requirement to run a C application.
In contrast to your belief, `txt` is an separate non-constant variable, because it is a modifiable pointer to the constant text. Your C code specifies to initialize this global variable with the address of the unnamed string. But no code does this.
You can make the global pointer variable constant, if you change your code to:
```
const char * const txt = "Hello, world!\n";
```
Now `txt` is located in `.rodata`.
You can avoid the global pointer variable at all, if you change your code to:
```
const char txt[] = "Hello, world!\n";
```
Now `txt` names the array of characters, which is located in `.rodata`.
---
In your first version of your program, `txt` was a dynamic variable on the stack. The code initialized it with the address of the unnamed string after entering the function `_start()`.
| null | CC BY-SA 4.0 | null | 2023-02-12T20:48:21.627 | 2023-02-12T21:28:58.353 | 2023-02-12T21:28:58.353 | 11,294,831 | 11,294,831 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.