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,053,195 | 2 | null | 75,051,251 | 1 | null | You can use [Content classes](https://bookdown.org/yihui/rmarkdown/xaringan-format.html#content-classes) to assign classes to any elements on a slide, too. The syntax is `.className[content]`.
So to change the spacing around the indented text (i.e. text in `p` tag within `blockquote` tag), you can wrap it with a content class and define css property for this class and we can use this class `space` for other indented text too.
```
---
output:
xaringan::moon_reader:
nature:
countIncrementalSlides: false
ratio: "16:9"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```
```{css, echo=FALSE}
.space blockquote {
margin: 2em 1em;
padding-top: 0.5px;
padding-bottom: 0.5px;
}
.space blockquote p {
line-height: 2em;
}
```
## R Markdown
- Renewable and Non-Renewable Energy
.space[
> [Renewable energy](https://www.nrcan.gc.ca/our-natural-resources/energy-sources-distribution/renewable-energy/about-renewable-energy/7295) is energy derived from natural processes that are replenished at a rate that is equal to or faster than the rate at which they are consumed, e.g. energy generated from solar, wind, geothermal, hydropower and ocean resources.
]
- *Clean* vs *Dirty* Energy
.space[
> Clean fuel refers to these categories of fuels: kerosene, Liquefied Petroleum Gas (LPG), electricity. In contrast, dirty fuels refer to fuels that are in their solid-state that emit a lot of toxic substances and smoke.
]
```
---
[](https://i.stack.imgur.com/ifUwM.png)
---
And to assign a class for a whole slide, there's a [class](https://bookdown.org/yihui/rmarkdown/xaringan-format.html#slides-and-properties) slide property.
| null | CC BY-SA 4.0 | null | 2023-01-09T04:29:21.700 | 2023-01-09T04:36:26.143 | 2023-01-09T04:36:26.143 | 10,858,321 | 10,858,321 | null |
75,053,367 | 2 | null | 75,048,327 | 1 | null | So you start with a string in your head. It's a sequence of Unicode characters. There's no inherent byte encoding to the characters. The same string could be encoded into bytes in a variety of ways. Big5 is one. UTF-8 is another.
When you say that Traditional Chinese uses Big5, that's not entirely true. It may be commonly encoded in Big5, but it could be in UTF-8 instead, and UTF-8 has this cool property that it can encode all Unicode character sequences. That's why it's become the standard encoding for situations where you don't want to optimize for one character set.
So your challenge is make sure to carefully control the characters and encodings so that you're sending UTF-8 sequences to DynamoDB. The standard SDKs would do this correctly as long as you're creating the strings as basic strings in them.
You also have to make sure you're not confusing yourself when you look at the data. If you look at UTF-8 bytes but in a way where you're interpreting them as Big5 then it's going to look like gibberish, or vice versa.
You don't say how they're loading the data. If they're starting with a file, could be that. You'd want to read the file in a language saying it's Big5, then you'll have the string version, and then you can send the string version and rely on the SDK to correctly translate to UTF-8 on the wire.
I remember when I first learned this stuff it was all kind of confusing. The thing to remember is a capital A exists as an idea (and is a defined character in Unicode) and there's a whole lot of mechanisms you could use to put that letter into ones and zeros on disk. Each of those ways is an encoding. ASCII is popular but EBCDIC was another contender from the past, and UTF-16 is yet another contender now. Traditional Chinese is a character set (a set of characters) and you can encode each those characters a bunch of ways too. It's just a question of how you map characters to bits and bytes and back again.
| null | CC BY-SA 4.0 | null | 2023-01-09T05:04:07.563 | 2023-01-09T05:04:07.563 | null | null | 538,697 | null |
75,053,522 | 2 | null | 75,053,017 | 0 | null | First of All just make sure you have set the External Tools in Unity Preferences to Visual Studio Code and you have install the Visual Studio Code Package in Unity Package Manager.
I hope you have an UI Managing Script or even not that's not a Problem. In OnClick() make sure you have referenced the GameObject and Selected the SetActive(),
and Click + icon and add another field in that Reference[Drag and Drop] the current button to and Select SetActive() that checkbox present shows the state to be changed into. Please Make Sure you are setting it Correctly.
[](https://i.stack.imgur.com/ruLRb.png)
I hope this helps.
| null | CC BY-SA 4.0 | null | 2023-01-09T05:38:07.997 | 2023-01-09T05:38:07.997 | null | null | 15,905,472 | null |
75,053,535 | 2 | null | 74,191,324 | 0 | null | After wasting 2 hours and ruining my mood solution was simply upgrading your android studio version, most probably you are using an older version like Arctic fox or something like that, upgrade to dolphin or something higher. Hope it help, and yes in dolphin version it will give error of 30.0.3 but don't worry it gives you an attached link to install 30.0.0 SDK in console itself, so chill and keep developing.
| null | CC BY-SA 4.0 | null | 2023-01-09T05:39:57.553 | 2023-01-09T05:40:39.060 | 2023-01-09T05:40:39.060 | 19,871,542 | 19,871,542 | null |
75,053,632 | 2 | null | 75,027,241 | 0 | null | Google Keep API is an enterprise-only API used to create and manage the Keep notes within your domain, including resolving issues identified by CASB software.
In addition, [the official documentation](https://developers.google.com/keep/api/guides/java#create_a_service_account) shows that you need to create a service account and authorize it. A service account is a special kind of account used by an application, rather than a person. You can use a service account to access data or perform actions by the robot account, or to access data on behalf of Google Workspace or Cloud Identity users.
So, it may only work with Google Workspace domain accounts.
We recommend you use the service account method, but if you don't want to create a service account, you can refer to [Gabriel Carballo's answer](https://stackoverflow.com/a/70357411/18789859) to use the admin-approved method (tip: I have not verified this method, just as a suggestion).
| null | CC BY-SA 4.0 | null | 2023-01-09T05:56:13.637 | 2023-01-09T06:01:58.497 | 2023-01-09T06:01:58.497 | 18,789,859 | 18,789,859 | null |
75,053,745 | 2 | null | 75,027,100 | 0 | null | Here is one solution.
In your `page1.py`, comment out `"position": "fixed"` and re-adjust sidebar and maindiv width.
[](https://i.stack.imgur.com/oGiE7.png)
```
# ...
# ...
# ...
SIDEBAR_STYLE = {
# "position": "fixed", # comment this out
"top": 42,
"left": 0,
"bottom": 0,
"background-color": "#f8f9fa",
"overflowY": "auto",
}
# ...
# ...
# ...
# Create the Dash app layout
layout = html.Div([
dbc.Row([
dbc.Col(sidebar, width=3), # adjust width
dbc.Col(maindiv, width=9) # adjust width
])
])
```
| null | CC BY-SA 4.0 | null | 2023-01-09T06:16:24.627 | 2023-01-09T06:16:24.627 | null | null | 9,723,036 | null |
75,053,774 | 2 | null | 75,053,683 | 0 | null | This is a typical error. I will explain the cause of your error. When you give a value to the variable like
```
String? s1;
//You need to give s1 a value which is not null;
String s2 = s1!; //WITH <<s1!>> YOU ARE HERE SAYING A COMPILER THAT YOU ARE SURE s1
//IS not null. BUT IF s1 IS NULL, THEN IT SHOWS ERROR.
```
SO THE SOLUTION IS TO TRACK AND MAKE SURE THAT YOU ARE GIVING A VALUE TO THAT VARIABLE BEFORE PUTTING <<!>>.
You provided insufficient code to debug. So that is the general solution.
| null | CC BY-SA 4.0 | null | 2023-01-09T06:21:54.830 | 2023-01-09T06:21:54.830 | null | null | 11,066,298 | null |
75,053,900 | 2 | null | 75,052,782 | 0 | null | ```
trailing: SizedBox(
width: 300,
height: 300,
child: Padding(
```
/// replace with this
```
title: SizedBox(
width: MediaQuery.of(context).size.width,
child: Padding(
```
| null | CC BY-SA 4.0 | null | 2023-01-09T06:42:25.450 | 2023-01-09T06:42:25.450 | null | null | 19,664,738 | null |
75,053,961 | 2 | null | 73,105,901 | 0 | null | Your format is incorrect should make like this:
[](https://i.stack.imgur.com/IF1p8.png)
As in picture you only can add email address in one column with multiple rows
| null | CC BY-SA 4.0 | null | 2023-01-09T06:52:03.323 | 2023-01-09T06:52:03.323 | null | null | 20,385,519 | null |
75,053,977 | 2 | null | 75,053,943 | 1 | null | You need to used `getElementById` instead of `getElementByName` as your field have `id` called `provinceExist`:
Also, you need to add `ContentLoaded` event for change text or you need to create function to call on event happen. I have taken Content loaded event as an example.
```
window.addEventListener("DOMContentLoaded", () => {
document.getElementById("provinceExist").options[0].text = "Water";
});
```
Here example select box:
```
<select name="address[province]" id="provinceExist">
<option>Test</option>
<option>Test1</option>
<option>Test2</option>
</select>
```
| null | CC BY-SA 4.0 | null | 2023-01-09T06:54:06.910 | 2023-01-09T07:59:09.647 | 2023-01-09T07:59:09.647 | 1,355,344 | 1,355,344 | null |
75,054,012 | 2 | null | 75,053,943 | 0 | null | You can try using the text property of the Option object:
```
document.getElementsByName('provinceExist').options[0] = new Option('Water', '');
```
You can also use the `innerHTML` property to set the text for the empty option tag, like this:
```
document.getElementsByName('provinceExist').options[0].innerHTML = 'Water';
```
`getElementsByName` returns a collection of elements, so you need to access the first element in the collection to be able to set the `innerHTML` or text property.
| null | CC BY-SA 4.0 | null | 2023-01-09T06:58:53.023 | 2023-01-09T06:58:53.023 | null | null | 3,641,900 | null |
75,054,015 | 2 | null | 75,053,943 | 0 | null | ```
document.getElementsByName('address[province]').options[0].innerHTML = "Water";
```
instead of
```
document.getElementsByName('provinceExist').options[0].innerHTML = "Water";
```
or if you want to use the id you could use
```
document.getElementsById('provinceExist').options[0].innerHTML = "Water";
```
there's also another neatway instead of having to go through all this
```
<select>
<option hidden disabled selected value> -- select an option -- </option>
<option>Option 1</option>
<option>Option 2</option>
<option>Option 3</option>
</select>
```
this will show up `-- select an option --` and once you select something this option won't no longer exist and you won't be able to select it back/view it again
| null | CC BY-SA 4.0 | null | 2023-01-09T06:59:25.823 | 2023-01-09T06:59:25.823 | null | null | 2,828,694 | null |
75,054,034 | 2 | null | 74,297,584 | 0 | null | `int` is [Built-in type](https://dart.dev/guides/language/language-tour#numbers) (not a usual class)
In documentation `identityHashCode` has a note:
> This hash code is compatible with [identical], which just means that
it's guaranteed to be stable over time.
For compiler all `int` values are constants. `identical` for the same constants shows true. So `hashCode` of `int` was made by own value (which also `int`).
```
print(identical(1, 1)); // true
```
According to [this comment](https://github.com/dart-lang/sdk/issues/563#issuecomment-108304500) `int` (and `double`) has own condition for comparing in `identical` function.
> By the same numeric value
Here's some code for example representation:
```
void main() {
int a = 1; // '1' is a constant
int b = 1;
int c = 2; // '2' is a constant
print(identical(a, b)); // true
print(identical(a, c)); // false
print(identical(1, 1)); // true
print(identical(1, 2)); // false <= 1 and 2 are constants
print(identical(a, 1)); // true
print(identical(c, 1)); // false
print(identical(c, 2)); // true
print(identityHashCode(a)); // 1
print(identityHashCode(b)); // 1
print(identityHashCode(c)); // 2
print(identityHashCode(1)); // 1
print(identityHashCode(2)); // 2
}
```
| null | CC BY-SA 4.0 | null | 2023-01-09T07:01:56.943 | 2023-01-09T07:01:56.943 | null | null | 12,139,227 | null |
75,054,078 | 2 | null | 14,053,556 | 0 | null | ```
@media print {
@page {
size: landscape;
}
div.landscape-parent {
width: 585mm;
height: 450mm;
}
div.landscape {
width: 585mm;
height: 450mm;
transform: rotate(270deg) translate(-585mm, 0);
transform-origin: 0 0;
align-content: end;
}
div.content {
padding: 10mm 10mm 10mm 10mm;
}
```
| null | CC BY-SA 4.0 | null | 2023-01-09T07:08:43.797 | 2023-01-09T07:08:43.797 | null | null | 20,962,778 | null |
75,054,113 | 2 | null | 75,050,824 | 0 | null | ```
.both-grids {
padding-left: 100px;
}
.show-grid-container, .movie-grid-container {
display: inline-grid;
grid-template-rows: 40px 200px 200px 200px 200px;
row-gap: 40px;
}
.movie-grid-container {
padding-left: 80px;
}
.show-grid-container >div, .movie-grid-container >div {
background-color: black;
padding-right: 80px;
padding-left: 80px;
color:white;
}
```
```
<div class="both-grids">
<div class="show-grid-container">
<div class="grid-item">show 1</div>
<div class="grid-item">show 2</div>
<div class="grid-item">show 3</div>
<div class="grid-item">show 4</div>
<div class="grid-item">show 5</div>
</div>
<div class="movie-grid-container">
<div class="grid-item">movie 1</div>
<div class="grid-item">movie 2</div>
<div class="grid-item">movie 3</div>
<div class="grid-item">movie 4</div>
<div class="grid-item">movie 5</div>
</div>
</div>
```
Use this in css
.show-grid-container >div, .movie-grid-container >div {}
instead of
yours -> .show-grid-container, .movie-grid-container > div {}
| null | CC BY-SA 4.0 | null | 2023-01-09T07:12:30.087 | 2023-01-09T07:12:30.087 | null | null | 8,437,235 | null |
75,054,245 | 2 | null | 65,031,149 | 0 | null | I don't know why but my same problem got solved by removing below line from gradle.properties(project properties)
```
android.useAndroidX=true
```
| null | CC BY-SA 4.0 | null | 2023-01-09T07:30:28.850 | 2023-01-09T07:30:28.850 | null | null | 14,670,277 | null |
75,054,282 | 2 | null | 74,847,075 | 0 | null |
1. Need to check certificates (client-server). (java/jre/lib/security/cacerts)
2. Need to use appropriate socket class, for example:
import com.sun.mail.util.MailSSLSocketFactory
MailSSLSocketFactory sf = new MailSSLSocketFactory()
| null | CC BY-SA 4.0 | null | 2023-01-09T07:35:43.660 | 2023-01-09T07:35:43.660 | null | null | 20,653,199 | null |
75,054,402 | 2 | null | 51,527,868 | 0 | null | The only solution that worked for me to display gif images on the notebook can be found [here](https://stackoverflow.com/a/61114271/13618407)
For external gif, you can use Jupyter's display
```
from IPython.display import Image
Image(url='https://upload.wikimedia.org/wikipedia/commons/e/e3/Animhorse.gif')
```
But for a local file, you need to read the bytes and display it.
```
!wget https://upload.wikimedia.org/wikipedia/commons/e/e3/Animhorse.gif
Image(open('Animhorse.gif','rb').read())
```
This answer from @korakot helped me a lot as I have tried every solution posted here but didn't work on my Kaggle notebook.
| null | CC BY-SA 4.0 | null | 2023-01-09T07:51:39.643 | 2023-01-09T07:51:39.643 | null | null | 13,618,407 | null |
75,054,411 | 2 | null | 22,051,573 | 0 | null | This is an old question but here is something that works, the main trick here is never set a fixed height and width on the image i only use percentage.
```
.example {
background-color: #e7e7e7;
padding: 25px;
}
.image-box {
height: 50px;
width: 50px;
border-radius: 8px;
background-color: rgb(241, 255, 255);
color: rgb(241, 245, 249);
overflow: hidden;
display: block;
position: relative;
}
.image {
display: block;
max-width: 100%;
height: 100%;
object-fit: cover;
}
```
```
<div class="example">
<span class="image-box">
<img class="image" src="/broken.jpeg" alt>
</span>
</div>
```
| null | CC BY-SA 4.0 | null | 2023-01-09T07:52:59.690 | 2023-01-09T08:10:35.073 | 2023-01-09T08:10:35.073 | 14,729,438 | 14,729,438 | null |
75,055,158 | 2 | null | 62,147,493 | 0 | null | Invalidate caches and restart to android studio helped me
| null | CC BY-SA 4.0 | null | 2023-01-09T09:16:21.547 | 2023-01-09T09:16:21.547 | null | null | 891,814 | null |
75,055,491 | 2 | null | 74,955,988 | 0 | null | Using Qt 5.15.2, here is what it work on my machine:
```
QComboBox *comboBox = new QComboBox(this);
comboBox->setStyleSheet("QComboBox {"
"combobox-popup: 0;"
"border-radius: 8px;"
"margin: 10px;"
"background-color: gray;"
"min-height: 32px;"
"}");
comboBox->view()->setStyleSheet("QListView{"
"border-radius: 8px;"
"background-color: gray;"
"margin: 10px;"
"}");
comboBox->move(100, 100);
comboBox->addItem("1");
comboBox->addItem("2");
comboBox->view()->window()->setWindowFlags(Qt::Popup | Qt::FramelessWindowHint
| Qt::NoDropShadowWindowHint);
comboBox->view()->window()->setAttribute(Qt::WA_TranslucentBackground);
}
```
| null | CC BY-SA 4.0 | null | 2023-01-09T09:47:47.440 | 2023-01-09T09:47:47.440 | null | null | 10,682,900 | null |
75,055,560 | 2 | null | 75,054,451 | 1 | null | I cannot see dependency injection for `IHttpContextAccessor` in the `program.cs` file.
Try adding the below code:
```
builder.Services.AddDbContext<AppDbContext>(o => o.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnectioin")));
//DI for IHttpContextAccessor
builder.Services.AddHttpContextAccessor();
//Or builder.Services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
```
[Here](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/http-context?view=aspnetcore-7.0#access-httpcontext-from-custom-components) is the reference.
| null | CC BY-SA 4.0 | null | 2023-01-09T09:53:20.660 | 2023-01-09T09:53:20.660 | null | null | 11,514,907 | null |
75,056,037 | 2 | null | 67,570,615 | 0 | null | This workaround worked for me in Xcode 14.2
```
private extension Bundle {
private static let packageName = "PACKAGE_NAME"
private static let moduleName = "MODULE_NAME"
#if targetEnvironment(simulator)
static var swiftUIPreviewsCompatibleModule: Bundle {
final class CurrentBundleFinder {}
let isPreview = ProcessInfo.processInfo.environment["XCODE_RUNNING_FOR_PREVIEWS"] == "1"
guard isPreview else {
return Bundle.module
}
// This is a workaround for SwiftUI previews
// previews crash when accessing other package view using assets from Bundle.module
let bundleName = "\(packageName)_\(moduleName).bundle"
func bundle(stepsBack: Int) -> Bundle? {
var bundleURL = Bundle(for: CurrentBundleFinder.self).bundleURL
for _ in 1...stepsBack { bundleURL.deleteLastPathComponent() }
bundleURL.appendPathComponent(moduleName)
bundleURL.appendPathComponent("Products")
bundleURL.appendPathComponent("Debug-iphonesimulator")
bundleURL.appendPathComponent("PackageFrameworks")
let directories: [String]
do {
directories = try FileManager.default.contentsOfDirectory(atPath: bundleURL.path)
} catch {
return nil
}
guard let matchingDir = directories.first(where: { $0.hasSuffix(".framework") }) else {
return nil
}
bundleURL.appendPathComponent(matchingDir)
bundleURL.appendPathComponent(bundleName)
return Bundle(url: bundleURL)
}
// Steps back 5 is a workaround for crashes
// when another module is importing this module
return bundle(stepsBack: 5) ?? .module
}
#else
static var swiftUIPreviewsCompatibleModule: Bundle { .module }
#endif
}
```
| null | CC BY-SA 4.0 | null | 2023-01-09T10:36:54.850 | 2023-01-09T10:36:54.850 | null | null | 20,960,721 | null |
75,056,130 | 2 | null | 19,623,267 | 0 | null | this works for me:
```
pip install pycryptodomex
```
then
```
from Cryptodome.Cipher import AES
```
| null | CC BY-SA 4.0 | null | 2023-01-09T10:45:07.983 | 2023-01-09T10:45:07.983 | null | null | 16,333,822 | null |
75,056,243 | 2 | null | 75,055,264 | 0 | null | Assuming that `dates` is defined as `jsonb` and `user_id` is defined as `int[]` you can do something like this:
```
select u.user_id,
d.dates,
t."type",
t.time_start,
t.time_end
from the_table t
cross join unnest(t.user_id) as u(user_id)
cross join jsonb_array_elements_text(t.dates) as d(dates)
order by u.user_id, d.date
```
If `dates` is not a `jsonb` column, you need to cast it: `jsonb_array_elements_text(t.dates::jsonb)`
[Online example](https://dbfiddle.uk/kRhOUhv8)
| null | CC BY-SA 4.0 | null | 2023-01-09T10:54:29.823 | 2023-01-09T10:54:29.823 | null | null | 330,315 | null |
75,056,379 | 2 | null | 74,947,425 | 0 | null | I think this may have to do with the origin point, as that's by default set to top-left. Seeing you're comparing x and y positions with collissions, you rather want it to be at the center.
| null | CC BY-SA 4.0 | null | 2023-01-09T11:06:30.700 | 2023-01-09T11:06:30.700 | null | null | 2,735,344 | null |
75,056,419 | 2 | null | 75,056,137 | 0 | null | Replace your `Row` widget
> From
```
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Image.asset("assets/images/g.png", width: Dimensions.width20 + 5),
SmallText(text: LanguageStringKeys.instance.continueWithGoogle.tr)
],
),
```
> To
```
Row(
children: [
Icon(Icons.chevron_right_outlined, color: Colors.red),
Expanded(
child: Text(
"asdfasdfasdfadsfadsf",
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.red, fontSize: 12, fontFamily: 'ROCK'),
),
),
],
),
```
| null | CC BY-SA 4.0 | null | 2023-01-09T11:10:20.657 | 2023-01-09T11:47:41.383 | 2023-01-09T11:47:41.383 | 5,197,712 | 5,197,712 | null |
75,056,463 | 2 | null | 75,056,137 | 0 | null | Try below code:
```
ElevatedButton(
onPressed: () {},
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Image.network(
'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTffY2_D5YjjG8Mn3NnOFrXG2Piu72Ff5rbyHiyZXFvkWWtE3pLojAwOXpxAbC7PZa0JpU&usqp=CAU',
height: 40,
), //use your google image here
Text(
'Sign in with Google',
style: TextStyle(
color: Colors.black,
),
),
SizedBox()
],
),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.white, fixedSize: const Size(250, 50)),
),
```
Result-> [](https://i.stack.imgur.com/7zq5N.png)
| null | CC BY-SA 4.0 | null | 2023-01-09T11:14:16.327 | 2023-01-09T11:48:49.080 | 2023-01-09T11:48:49.080 | 13,997,210 | 13,997,210 | null |
75,056,630 | 2 | null | 75,056,137 | 0 | null | try this way...
```
Container(
height: Dimensions.height40,
decoration:
BoxDecoration(borderRadius: BorderRadius.circular(Dimensions.radius10), color: Colors.white),
child: Padding(
padding: EdgeInsets.symmetric(horizontal: Dimensions.width45),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 20),
child: Image.asset("assets/images/g.png", width: Dimensions.width20 + 5),
),
SmallText(text: LanguageStringKeys.instance.continueWithGoogle.tr)
// if text overflowing
// Expanded(child: Text('text', maxLines: 2)),
],
),
),
),
```
| null | CC BY-SA 4.0 | null | 2023-01-09T11:28:55.043 | 2023-01-09T11:28:55.043 | null | null | 19,664,738 | null |
75,056,794 | 2 | null | 47,560,399 | 1 | null | Maybe useful to some: This is the same example as the one from eyllanesc, but with some fixes so that it works on PySide6.
```
import sys
import time
from PySide6.QtWidgets import *
from PySide6.QtGui import *
from PySide6.QtCore import *
class ProcessRunnable(QRunnable):
def __init__(self, target, args):
QRunnable.__init__(self)
self.t = target
self.args = args
def run(self):
self.t(*self.args)
def start(self):
QThreadPool.globalInstance().start(self)
def run(user_input, log):
text = ""
if user_input == "":
text = "Please enter a value\n"
else:
text = "Test"
# Sleep for 5 seconds
time.sleep(5)
QMetaObject.invokeMethod(log, "append", Qt.QueuedConnection, Q_ARG(str, text))
class LogginOutput(QTextEdit):
def __init__(self, parent=None):
super(LogginOutput, self).__init__(parent)
self.setReadOnly(True)
self.setLineWrapMode(self.LineWrapMode.NoWrap)
self.insertPlainText("")
@Slot(str)
def append(self, text):
self.moveCursor(QTextCursor.End)
current = self.toPlainText()
if current == "":
self.insertPlainText(text)
else:
self.insertPlainText("\n" + text)
sb = self.verticalScrollBar()
sb.setValue(sb.maximum())
class App(QWidget):
def __init__(self):
super().__init__()
self.init_ui()
def init_ui(self):
label = QLabel("Amount")
amount_input = QLineEdit()
submit = QPushButton("Submit", self)
box = LogginOutput(self)
submit.clicked.connect(lambda: self.changeLabel(box, amount_input))
grid = QGridLayout()
grid.addWidget(label, 0, 0)
grid.addWidget(amount_input, 1, 0)
grid.addWidget(submit, 1, 1)
grid.addWidget(box, 2, 0, 5, 2)
self.setLayout(grid)
self.resize(350, 250)
self.setWindowTitle("GetMeStuff Bot v0.1")
self.show()
def center(self):
qr = self.frameGeometry()
cp = QGuiApplication.primaryScreen().availableGeometry().center()
qr.moveCenter(cp)
self.move(qr.topLeft())
def changeLabel(self, box, user_input):
self.p = ProcessRunnable(target=run, args=(user_input.displayText(), box))
self.p.start()
user_input.clear()
if __name__ == "__main__":
app = QApplication(sys.argv)
widget = App()
sys.exit(app.exec_())
```
| null | CC BY-SA 4.0 | null | 2023-01-09T11:44:07.383 | 2023-01-09T11:44:07.383 | null | null | 5,195,209 | null |
75,056,851 | 2 | null | 13,256,720 | 0 | null | For multiline text, a label won't do. My solution is to set the Enter event on the textbox and redirect the focus elsewhere. E.g.
```
private void textBox1_Enter(object sender, EventArgs e)
{
this.anotherControl.Focus(); // Preferably a readonly control in case the user starts typing
}
```
| null | CC BY-SA 4.0 | null | 2023-01-09T11:49:47.287 | 2023-01-09T11:55:17.947 | 2023-01-09T11:55:17.947 | 4,887,971 | 4,887,971 | null |
75,056,964 | 2 | null | 75,054,048 | 0 | null | If you're using WordPress, You can use plugins like `Yoast SEO` to generate website maps.
Or there are also many online ,such as [https://ml-sitemaps.com](https://ml-sitemaps.com) , [https://web-site-map.com](https://web-site-map.com) and so on.
| null | CC BY-SA 4.0 | null | 2023-01-09T11:59:50.587 | 2023-01-09T11:59:50.587 | null | null | 20,920,028 | null |
75,057,078 | 2 | null | 75,056,594 | 2 | null | One way to have evenly spaced xticks is to use a linear vector `(0,1,2,3,etc...)` the same length as your data. You plot your `y` data versus this `xa` () vector, then just modify the `xticklabels` to display the proper power of 2 corresponding to each point.
So for your code:
```
max_xa = numel(M)-1 ; % number of "x" points (-1 because we'll start at 0)
xa = 0:max_xa ; % generate the x-apparent vector
figure
% Plot your "sl" values versus "xa"
semilogy(xa, s1, 'ko-', 'LineWidth', 1); grid on ;
axis ([0 max_xa 0 600]) % adust limits
xticklabels(M); % adjust X tick labels
```
will generate the following figure:
[](https://i.stack.imgur.com/BvfKL.png)
Note: We started the X apparent vector at `0` instead of `1` because otherwise Matlab would automatically insert a xtick at the value `0` and our `xticklabels` would all be offset by one position.
| null | CC BY-SA 4.0 | null | 2023-01-09T12:09:34.900 | 2023-01-09T12:09:34.900 | null | null | 3,460,361 | null |
75,057,092 | 2 | null | 75,047,593 | 1 | null | It looks like you only have the one `geometry` type column named `geom`. If you want to replace the lines in there, run an `update`:
```
update table your_table set geom=st_buffer(geom,3);
```
If you want to keep the original shapes and add their buffer shapes separately, add a [generated column](https://www.postgresql.org/docs/current/ddl-generated-columns.html):
```
alter table your_table add column geom_buffer_3 geometry
generated always as (ST_Buffer(geom,3)) stored;
```
It always generate the buffer shape automatically whenever you insert new data into that table, or update the existing rows.
Keep in mind the unit of distance depends on the column SRID - if you're using metric you'll get anomalies from systems in imperial/nautical/degrees. If your data is in degrees like in [SRID 4326](https://epsg.io/4326), `ST_Buffer(geom,3)` will be a buffer 3 geographic degrees big, which is 333 kilometers on the equator.
| null | CC BY-SA 4.0 | null | 2023-01-09T12:10:26.077 | 2023-01-09T12:54:36.673 | 2023-01-09T12:54:36.673 | 5,298,879 | 5,298,879 | null |
75,058,210 | 2 | null | 74,267,936 | 0 | null | Add the line below to your package.json in the dependencies:
```
"axios": "0.27.2"
```
then run the following:
```
npm install
npm start
```
Happy coding!
| null | CC BY-SA 4.0 | null | 2023-01-09T13:48:08.577 | 2023-01-09T13:48:08.577 | null | null | 14,724,664 | null |
75,058,242 | 2 | null | 75,055,740 | 0 | null | Also add .remove() method there and give unique key to the dismissible widget.
| null | CC BY-SA 4.0 | null | 2023-01-09T13:51:31.000 | 2023-01-09T13:51:31.000 | null | null | 15,445,465 | null |
75,058,508 | 2 | null | 75,041,729 | 1 | null | If you want to test... ;-)
```
function setup() {
createCanvas(500, 500);
const cx = width / 2;
const cy = height / 2;
const r = 250; // taille du triangle
const radius = 180; // externe
noFill();
strokeWeight(3);
stroke(0, 0, 0);
drawTriangle(cx, cy, r);
strokeWeight(1);
stroke(0, 0, 255);
circle(cx, cy, r * 2);
strokeWeight(2);
stroke(8, 115, 0);
circle(cx, cy, radius * 2);
noStroke();
fill(215, 0, 0);
// dx = sqrt(Math.pow(r / 2, 2) - Math.pow(r / 2, 2 / 4));
dx = sqrt(radius * radius - (r * r) / 4);
p4x = dx;
p4y = r / 2;
circle(cx + p4x, cy + p4y, 20);
text("p4", cx + p4x, cy + p4y + 30);
p5x = -dx;
p5y = r / 2;
circle(cx + p5x, cy + p5y, 20);
text("p5", cx + p5x - 10, cy + p5y + 30);
p6x = p4x * (-1 / 2) - p4y * (sqrt(3) / 2);
p6y = p4x * (sqrt(3) / 2) + p4y * (-1 / 2);
circle(cx + p6x, cy + p6y, 20);
text("p6", cx + p6x - 30, cy + p6y);
p2x = p6x * (-1 / 2) - p6y * (sqrt(3) / 2);
p2y = p6x * (sqrt(3) / 2) + p6y * (-1 / 2);
circle(cx + p2x, cy + p2y, 20);
text("p2", cx + p2x + 10, cy + p2y - 10);
p1x = p5x * (-1 / 2) - p5y * (sqrt(3) / 2);
p1y = p5x * (sqrt(3) / 2) + p5y * (-1 / 2);
circle(cx + p1x, cy + p1y, 20);
text("p1", cx + p1x - 20, cy + p1y - 10);
p3x = p1x * (-1 / 2) - p1y * (sqrt(3) / 2);
p3y = p1x * (sqrt(3) / 2) + p1y * (-1 / 2);
circle(cx + p3x, cy + p3y, 20);
text("p3", cx + p3x + 20, cy + p3y - 10);
noFill();
stroke(0, 255, 255);
triangle(cx + p2x, cx + p2y, cx + p4x, cx + p4y, cx + p6x, cx + p6y);
stroke(255, 0, 255);
// prettier-ignore
triangle(
cx + p1x, cx + p1y,
cx + p3x, cx + p3y,
cx + p5x, cx + p5y,
)
}
function drawTriangle(cx, cy, radius) {
noFill();
trianglePoints = [];
for (var i = 0; i < 3; i++) {
var x = cx + radius * cos((i * TWO_PI) / 3.0 - HALF_PI);
var y = cy + radius * sin((i * TWO_PI) / 3.0 - HALF_PI);
trianglePoints[i] = {
x,
y,
};
}
triangle(
trianglePoints[0].x,
trianglePoints[0].y,
trianglePoints[1].x,
trianglePoints[1].y,
trianglePoints[2].x,
trianglePoints[2].y
);
}
```
```
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.5.0/p5.min.js"></script>
```
| null | CC BY-SA 4.0 | null | 2023-01-09T14:11:46.760 | 2023-01-12T13:55:24.610 | 2023-01-12T13:55:24.610 | 1,256,770 | 1,256,770 | null |
75,058,641 | 2 | null | 75,017,773 | 0 | null | You might want to consider using PyMuPDF with Stories it allows for more flexibility of layout from a data input. For an example of something very similar to what you are trying to achieve see: [https://pymupdf.readthedocs.io/en/latest/recipes-stories.html#how-to-display-a-list-from-json-data](https://pymupdf.readthedocs.io/en/latest/recipes-stories.html#how-to-display-a-list-from-json-data)
| null | CC BY-SA 4.0 | null | 2023-01-09T14:22:51.377 | 2023-01-09T14:22:51.377 | null | null | 454,088 | null |
75,058,837 | 2 | null | 71,806,578 | 0 | null | Your file should look like this if you want your app to be fullscreen with (completely) hidden titlebar:
```
using Microsoft.Maui.LifecycleEvents;
#if WINDOWS
using Microsoft.UI;
using Microsoft.UI.Windowing;
using Windows.Graphics;
#endif
namespace MauiApp1;
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
#if WINDOWS
builder.ConfigureLifecycleEvents(events =>
{
events.AddWindows(lifeCycleBuilder =>
{
lifeCycleBuilder.OnWindowCreated(w =>
{
w.ExtendsContentIntoTitleBar = false;
IntPtr wHandle = WinRT.Interop.WindowNative.GetWindowHandle(w);
WindowId windowId = Win32Interop.GetWindowIdFromWindow(wHandle);
AppWindow mauiWindow = AppWindow.GetFromWindowId(windowId);
mauiWindow.SetPresenter(AppWindowPresenterKind.FullScreen); // TO SET THE APP INTO FULL SCREEN
//OR USE THIS LINE FOR YOUR CUSTOM POSITION
// mauiWindow.MoveAndResize(YOUR DESIRED HOTIZONTAL POSITION, YOUR DESIRED VERTICAL POSITION, YOUR DESIRED WINDOW WIDTH, YOUR DESIRED WINDOW HEIGHT) ;
});
});
});
#endif
#region == THIS IS GENERATED DEFAULT (UNRELATED) CODE ==
builder
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});
#endregion
return builder.Build();
}
}
```
| null | CC BY-SA 4.0 | null | 2023-01-09T14:37:34.127 | 2023-01-09T14:37:34.127 | null | null | 3,030,612 | null |
75,058,896 | 2 | null | 75,044,955 | 0 | null | I think you have the wrong syntax. The second line should end with a comma, according to the [Microsoft Learn Page for Collect](https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-clear-collect-clearcollect).
So it should be:
```
Collect(colMaterialesSeleccionados,{
InvtID: Thisitem.InvtID,
Descr: Thisitem.Descr
})
```
| null | CC BY-SA 4.0 | null | 2023-01-09T14:42:14.153 | 2023-01-09T14:42:14.153 | null | null | 553,231 | null |
75,058,976 | 2 | null | 73,336,628 | 1 | null | When we load `tidyverse` a messege says "Use the conflicted package to force all conflicts to become errors".
Therefore all you have to do is:
```
library(conflicted)
library(tidyverse)
conflict_prefer("filter", "dplyr")
conflict_prefer("lag", "dplyr")
```
But if you prefer, you can just write your code using the format, for exemple: `dplyr::filter()` and `dplyr::lag()`
| null | CC BY-SA 4.0 | null | 2023-01-09T14:48:49.987 | 2023-01-09T14:48:49.987 | null | null | 3,587,230 | null |
75,059,152 | 2 | null | 75,058,257 | 0 | null |
You could use `ggplot_build` to get the layers of your plot where the fifth layer is from your violin. Than you can change the y values of the violin to NA like this:
```
library(introdataviz)
library(ggpubr)
set.seed(42)
first <- sample(c(rep(0,100), rnorm(50,15,2)))
second <- sample(c(rep(0,100), rnorm(50,10,1)))
df <- data.frame(first, second)
# Plot
p<- ggpaired(df,cond1 = "first", cond2 = "second",line.color = "gray")+
stat_compare_means(paired = TRUE)+
introdataviz::geom_split_violin( trim = TRUE,alpha = .4) + ylim(0,22)
q <- ggplot_build(p)
# Violin layer remove zeros
q$data[[5]] <- q$data[[5]][q$data[[5]]$y != 0, ]
q <- ggplot_gtable(q)
plot(q)
```

[reprex v2.0.2](https://reprex.tidyverse.org)
---
You could replace the zeros with NA's using the following code:
```
library(introdataviz)
library(ggpubr)
#> Loading required package: ggplot2
set.seed(42)
first <- sample(c(rep(0,100), rnorm(50,15,2)))
second <- sample(c(rep(0,100), rnorm(50,10,1)))
df <- data.frame(first, second)
df[df <= 0] <- NA
ggpaired(df,cond1 = "first", cond2 = "second",line.color = "gray")+
stat_compare_means(paired = TRUE)+
introdataviz::geom_split_violin( trim = TRUE,alpha = .4) + ylim(0,22)
```

[reprex v2.0.2](https://reprex.tidyverse.org)
| null | CC BY-SA 4.0 | null | 2023-01-09T15:02:55.620 | 2023-01-09T19:18:31.263 | 2023-01-09T19:18:31.263 | 14,282,714 | 14,282,714 | null |
75,059,235 | 2 | null | 75,030,774 | 2 | null | This will not work; the framework can't infer the generic type T.
You would need to use a Kafka deserializer to create the `Cat` object instead of relying on the framework's inferred type.
Since there is no type information, the converter is converting to a `Map`.
There are several solutions, including:
- use a `JsonDeserializer` with a type function: [https://docs.spring.io/spring-kafka/docs/current/reference/html/#serdes-type-methods](https://docs.spring.io/spring-kafka/docs/current/reference/html/#serdes-type-methods)- use a custom message converter that overrides the inferred type:
```
@SpringBootApplication
public class So75030774Application {
public static void main(String[] args) {
SpringApplication.run(So75030774Application.class, args);
}
@Bean
NewTopic topic() {
return TopicBuilder.name("so75030774").partitions(1).replicas(1).build();
}
@Bean
ApplicationRunner runner(KafkaTemplate<String, String> template) {
return args -> {
template.send("so75030774", "{\"bar\":\"baz\"}");
};
}
@Bean
MessagingMessageConverter converter() {
return new JsonMessageConverter() {
@Override
protected Object extractAndConvertValue(ConsumerRecord<?, ?> record, Type type) {
return super.extractAndConvertValue(record, Foo.class);
}
};
}
}
abstract class AbsListener<T> {
@KafkaListener(id = "so75030774", topics = "so75030774")
void listen(Message<T> in) {
process(in);
}
public abstract void process(Message<T> msg);
}
@Component
class ConcreteListener extends AbsListener<Foo> {
@Override
public void process(Message<Foo> msg) {
System.out.println(msg.getPayload().getClass());
System.out.println(msg);
}
}
```
| null | CC BY-SA 4.0 | null | 2023-01-09T15:08:49.210 | 2023-01-10T15:40:06.687 | 2023-01-10T15:40:06.687 | 1,240,763 | 1,240,763 | null |
75,059,255 | 2 | null | 75,058,511 | 0 | null | Looks fine to me, except you used `useState` instead of `useInput` on line
```
const [colorProps, resetColor] = useState("#000000");
```
You can check out my [sandbox](https://codesandbox.io/s/serene-resonance-re291w?file=/src/App.js)
| null | CC BY-SA 4.0 | null | 2023-01-09T15:10:48.973 | 2023-01-09T15:10:48.973 | null | null | 4,873,616 | null |
75,059,271 | 2 | null | 74,752,850 | 0 | null | You can do this with two features of Sublime: [Snippets](https://www.sublimetext.com/docs/completions.html#snippets) and [Key Bindings](https://www.sublimetext.com/docs/key_bindings.html). Use the Tools > Developer > New Snippet… command to create a snippet. Enter your template text in the snippet, like so:
```
<snippet>
<content><![CDATA[
# ----- ${1:NAME} -----
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.python</scope>
</snippet>
```
Save the snippet in your [User package](https://www.sublimetext.com/docs/packages.html#special-packages). Then, create a key binding to trigger the snippet:
```
{
"keys": ["ctrl+alt+t"],
"command": "insert_snippet",
"args": {
"name": "Packages/User/comment-section.sublime-snippet"
}
}
```
Note that, using this approach, you will need multiple snippets depending on the scope. (E.g. JS files need slash comments.) One solution here is to set a scope (with `"selector"`) on the key bindings.
For more details and variations (file snippets vs inline, for example), see this discussion on the [Sublime Forum](https://forum.sublimetext.com/t/how-to-bind-snippets-to-key-combo/1330).
| null | CC BY-SA 4.0 | null | 2023-01-09T15:11:57.097 | 2023-01-09T15:11:57.097 | null | null | 1,749,551 | null |
75,059,322 | 2 | null | 24,668,163 | 0 | null | Set price to free, save, then in "Availability" section you can check "remove from sale" and hit save.
[](https://i.stack.imgur.com/5fOvP.png)
| null | CC BY-SA 4.0 | null | 2023-01-09T15:16:07.243 | 2023-01-09T15:16:07.243 | null | null | 3,595,696 | null |
75,059,563 | 2 | null | 75,048,061 | 0 | null | Your current user doesn't have permissions to update Transfer acceleration settings. From your error I can see that you need permission.
If this is your only user and this is a personal account follow this steps:
1. Go to your user in IAM(/iam/home#/users/{username})
2. Click add permissions button
3. Go to Attach existing policies directly
4. Search for AmazonS3FullAccess
5. Click Review
6. Click Add permissions
7. Check if you are able to edit Transfer acceleration
You can remove other permissions that you have already set for S3.
---
Otherwise follow these steps:
1. Go to your user in IAM(/iam/home#/users/{username})
2. Click add permissions button
3. Go to Attach existing policies directly
4. Click Create policy button
5. Get the settings to be like this:
6. Skip tags
7. Choose a name for the policy
8. Create policy
9. Attach the policy
This is better because it's more specific and you don't give any unnecessary permissions.
---
Let's see if these options help you to solve the problem.
| null | CC BY-SA 4.0 | null | 2023-01-09T15:35:15.017 | 2023-01-09T15:35:15.017 | null | null | 2,671,045 | null |
75,059,603 | 2 | null | 37,965,867 | 0 | null | Just apply some more CSS to overwrite current CSS.
```
pandoc "--variable=include-before:<style>body > table > colgroup > col { width: unset!important }</style>"
```
This will insert one more line directly after html body-tag inside the output document, which selects all body > table > colgroup > col elements and overwrite their width setting.
| null | CC BY-SA 4.0 | null | 2023-01-09T15:37:58.673 | 2023-01-09T15:39:15.130 | 2023-01-09T15:39:15.130 | 20,966,519 | 20,966,519 | null |
75,059,952 | 2 | null | 46,990,569 | 0 | null | Here is a solution in PHP that is quite simple.
```
function solution($inputArray) {
$largest = null;
$pos = null;
for($i = 0; $i < count($inputArray) -1; $i++){
$pos = ($inputArray[$i] * $inputArray[$i+1]);
if($largest < $pos){
$largest = $pos;
}
}
return $largest ?? 0;
```
}
| null | CC BY-SA 4.0 | null | 2023-01-09T16:04:22.107 | 2023-01-09T16:04:22.107 | null | null | 6,614,524 | null |
75,060,375 | 2 | null | 75,059,923 | 1 | null | I have made an adjustment to the data, to put all the dates near December, so the plot looks better for this small portion of dataset. See below;
All you need to do is changing `ticktext` using `layout`:
```
library(plotly)
plot_ly(df1, x = ~week_number, y = ~starts,
type = 'scatter', color=~as.character(year), mode = 'lines') %>%
layout(xaxis = list(tickvals = ~week_number, ticktext = ~month))
```

### Update:
In order to only get one tick mark for each month, we need the actual dates, not just week numbers. You can convert a date formatted as `YYYY-UU-uu` to the conventional date format. However, here since you want all years to appear on top of each other, we should create an arbitrary date with the same year for all the rows, so the plot won't get extended to multiple years.
After mutating those dates, we can use `layout` to set the `dtick` to `M1` and format the labels as `%b` to only show the month names and dhow them once. `ticklabelmode = 'period'` makes sure to have a tick for every month. I added a `hovertemplate` to show the week number. I also removed the title from the axes and added a graph title to make the final plot look more like what you've shown in your question.
```
library(plotly)
library(dplyr)
df2 %>%
mutate(pseudo_Date = as.Date(paste(2000, week_number, 1, sep="-"), "%Y-%U-%u")) %>%
plot_ly(., x = ~pseudo_Date, y = ~starts,
type = 'scatter', color=~as.character(year), mode = 'lines',
hovertemplate = "Week Number: %{x|%U | } %{x}") %>%
layout(xaxis = list(title = "",
dtick = "M1", tickformat = '%b', ticklabelmode = "period"),
yaxis = list(title = ""),
title = 'Chart 2. Total starts by week')
```

#### Data:
```
df1 <- read.table(text = "year month week_number starts
2021 Dec 50 101
2021 Dec 51 104
2021 Dec 52 110
2022 Nov 48 111
2022 Dec 49 115
2022 Dec 50 144
2022 Dec 51 156", header = T, stringsAsFactor = F)
df2 <- read.table(text = "year month week_number starts
2020 Nov 46 100
2020 Nov 47 120
2020 Nov 48 111
2020 Dec 49 115
2020 Dec 50 144
2020 Dec 51 156
2021 Dec 50 101
2021 Dec 51 104
2021 Dec 52 110
2022 Jan 1 108
2022 Jan 2 108
2022 Jan 3 125
2022 Jan 4 160", header = T, stringsAsFactor = F)
```
| null | CC BY-SA 4.0 | null | 2023-01-09T16:40:54.957 | 2023-01-14T02:16:51.630 | 2023-01-14T02:16:51.630 | 6,461,462 | 6,461,462 | null |
75,060,507 | 2 | null | 75,051,103 | 1 | null | Like in @AspectOfTheNoob answer you can create interface, implement it in your items classes, and use it in constrain of T in LookPortName method .
```
public interface IPortInfo {
string id { get; }
string portfolio { get; }
string portName { get; }
}
public class SomeItemPortInfo : IPortInfo {
public string id { get; set; }
public string portfolio { get; set; }
public string portName { get; set; }
}
public bool LookPortName<T>(List<T> list, string id, ref string port, ref string name)
where T : IPortInfo {
```
You can also build base class and add constrain or use it directly as type of argument.
```
public abstract class BasePortInfo {
public virtual string id { get; set; }
public virtual string portfolio { get; set; }
public virtual string portName { get; set; }
}
public class SomeItemPortInfo : BasePortInfo {
}
```
If you need, you can declare this method as extension of List
```
public static class PortInfoListExtensions {
public static bool TryGetPortInfo<T>(this List<T> list, string id, out string port, out string name) where T : BasePortInfo {
port = null; name = null;
try {
int index = list.FindIndex(i => i.id == id);
if(index < 0)
return false;
//Get portfolio abbreviation.
port = list[index].portfolio.Trim();
//Get portfolio complete name.
name = list[index].portName.Trim();
return true;
} catch {
return false;
//Other code
}
}
}
```
And call it, for example like here:
```
if(listOfPortInfo?.TryGetPortInfo(id, out string port, out string name) ?? false) {
//if list contains id, do something with port and name....
}
```
You can also test type of argument and use reflection, if you can't add inteface or change class definitions.
| null | CC BY-SA 4.0 | null | 2023-01-09T16:51:37.210 | 2023-01-09T16:51:37.210 | null | null | 6,089,766 | null |
75,060,535 | 2 | null | 74,894,214 | 0 | null | We are doing the same task. Write me to get in touch on TEAMS (Ester). However, it seems that the problem regards `data_widened`. I used
```
data_pivot <- unstack(data, values ~ time, keep.names = TRUE)
row.names(data_pivot ) <- unique(data$country)
```
And then go ahead with
```
data_matrix <- as.matrix(data_pivot)
# Compute distance matrix
distance_matrix <- dist(data_matrix , method = "minkowski", p = 1.5)
```
| null | CC BY-SA 4.0 | null | 2023-01-09T16:54:09.097 | 2023-01-09T16:54:33.783 | 2023-01-09T16:54:33.783 | 20,582,136 | 20,582,136 | null |
75,060,563 | 2 | null | 14,607,068 | 0 | null | All of the other answers appear to be using private APIs which is obviously not a good thing to do. Additionally, they don't appear to work anymore (at least not on iOS 16).
I found that using `UIDragPreviewParameters` allowed me to get rid of the horrible background colour and reshape the shadow to fit one of the subviews in my table view cell.
```
-(UIDragPreviewParameters *)tableView:(UITableView *)tableView dragPreviewParametersForRowAtIndexPath:(nonnull NSIndexPath *)indexPath {
return [self createParametersForTableView:tableView atIndexPath:indexPath];
}
-(UIDragPreviewParameters *)tableView:(UITableView *)tableView dropPreviewParametersForRowAtIndexPath:(NSIndexPath *)indexPath {
return [self createParametersForTableView:tableView atIndexPath:indexPath];
}
-(UIDragPreviewParameters *)createParametersForTableView:(UITableView *)tableView atIndexPath:(NSIndexPath *)indexPath {
// Get the selected table view cell.
CustomCell *cell = [tableView cellForRowAtIndexPath:indexPath];
// Create the dragged cell preview parameters.
UIDragPreviewParameters *parameters = [[UIDragPreviewParameters alloc] init];
[parameters setBackgroundColor:[UIColor clearColor]];
[parameters setVisiblePath:[UIBezierPath bezierPathWithRoundedRect:cell.customSubView.frame cornerRadius:22.2]];
[parameters setShadowPath:[UIBezierPath bezierPathWithRoundedRect:cell.customSubView.frame cornerRadius:22.2]];
return parameters;
}
```
If you use this method, you will need to implement two delegates: `UITableViewDragDelegate` and `UITableViewDropDelegate`.
```
[yourTableView setDragDelegate:self];
[yourTableView setDropDelegate:self];
```
The drag delegate method will allow you to control the preview background when dragging the cell. When dropping the cell, you need to use the drop delegate method to avoid the preview background going back to the default white background.
| null | CC BY-SA 4.0 | null | 2023-01-09T16:57:18.267 | 2023-01-09T16:57:18.267 | null | null | 1,598,906 | null |
75,060,716 | 2 | null | 74,499,671 | 0 | null | If you configured a virtual environment, you have to select it again with (Ctrl+Shift+P) after your reboot your machine.
| null | CC BY-SA 4.0 | null | 2023-01-09T17:09:06.800 | 2023-01-09T17:09:06.800 | null | null | 920,057 | null |
75,060,958 | 2 | null | 75,035,125 | 0 | null | I rebooted my machine and now the path is compiling appropriately.
| null | CC BY-SA 4.0 | null | 2023-01-09T17:30:44.660 | 2023-01-09T17:30:44.660 | null | null | 1,760,251 | null |
75,061,637 | 2 | null | 72,851,548 | -1 | null | You need to update the Actions permissions on the repo as shared [here](https://github.com/ad-m/github-push-action/issues/96#issuecomment-889984928)
| null | CC BY-SA 4.0 | null | 2023-01-09T18:39:23.793 | 2023-01-09T18:39:23.793 | null | null | 13,609,630 | null |
75,061,755 | 2 | null | 16,575,622 | 0 | null | Not sure what you're really aiming for, But if you want a specific line to wrap try this.
To prevent all the `<li>` tags from wrapping you can use the float property like so:
```
ul.nice-menu, ul.nice-menu ul {
list-style: none;
padding: 0;
margin: 0;
position: relative;
float: left;
}
```
and then there's right …
| null | CC BY-SA 4.0 | null | 2023-01-09T18:52:35.053 | 2023-01-10T09:36:09.610 | 2023-01-10T09:36:09.610 | 7,451,109 | 20,503,609 | null |
75,061,979 | 2 | null | 75,060,244 | 1 | null | You can check the individual cases as follows. Here `L` is layer, `P` is position, `(x, y)` are the axial coordinates; coordinates are in agreement with your images.
From `(L, P)` to `(x, y)`:
```
if L == 0:
return (0,0)
otherwise:
k = floor(P/L) mod 6
j = P mod L
k x y z
-------------------
0 j L-j -L
1 L -j j-L
2 L-j -L j
3 -j j-L L
4 -L j L-j
5 j-L L -j
```
From `(x, y)` to `(L, P)`:
```
z = -x-y
L = max(abs(x), abs(y), abs(z))
x y z P
------------------------
>=0 >=0 x
<0 <0 L - y
>=0 >=0 2L + z
<0 <0 3L - x
>=0 >=0 4L + y
<0 <0 5L - z
```
Disclaimer: I didn't test this.
You may also be able to fold some of the cases by exploiting the symmetry, but coding these directly may be easier, albeit a bit more verbose.
You already coded the functions to go between `(L, P)` and spiral.
| null | CC BY-SA 4.0 | null | 2023-01-09T19:16:40.053 | 2023-01-09T21:12:25.463 | 2023-01-09T21:12:25.463 | 277,176 | 277,176 | null |
75,062,111 | 2 | null | 75,061,951 | 0 | null | To execute a command in the command line via jupyter use `!`
`!pip install termcolor`
| null | CC BY-SA 4.0 | null | 2023-01-09T19:30:55.867 | 2023-01-10T17:56:30.980 | 2023-01-10T17:56:30.980 | 1,934,851 | 1,934,851 | null |
75,062,141 | 2 | null | 75,061,292 | 1 | null | I hope you understand what you mean correctly:
[Image](https://i.stack.imgur.com/QbGjw.png)
```
<div class="dropdown-wrap">
<button id="sort-me" name="sort-me" class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Sort by
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item <?= $sort == '0' ? 'bi-check-lg' : '' ?>" value="0" sort="sort-price-up">Sort by price (ascending)</a>
<a class="dropdown-item <?= $sort == '0' ? 'bi-check-lg' : '' ?>" value="1" sort="sort-price-down">Sort by price (descending)</a>
</div>
</div>
```
You can use bootstrap icon and the rest is up to you where and how to use it.
| null | CC BY-SA 4.0 | null | 2023-01-09T19:34:46.170 | 2023-01-09T19:35:50.020 | 2023-01-09T19:35:50.020 | 19,014,817 | 19,014,817 | null |
75,062,223 | 2 | null | 20,540,826 | 1 | null | Here's an extension that worked perfectly for me: [https://marketplace.visualstudio.com/items?itemName=JustinClareburtMSFT.HotSettings](https://marketplace.visualstudio.com/items?itemName=JustinClareburtMSFT.HotSettings)
It has custom options to hide/show:
- - - -
| null | CC BY-SA 4.0 | null | 2023-01-09T19:45:16.727 | 2023-01-09T19:45:16.727 | null | null | 4,678,727 | null |
75,062,402 | 2 | null | 25,862,509 | 0 | null | Lots of helpful answers already given.
One problem for me was the presence of invalid (cyrillic) characters in the computer name.
And there is also a way to validate the connection between two servers (or between a server and a computer) using a small tool from Microsoft called [DTCPing](http://go.microsoft.com/fwlink/?LinkId=72166).
| null | CC BY-SA 4.0 | null | 2023-01-09T20:06:30.200 | 2023-01-09T20:22:44.773 | 2023-01-09T20:22:44.773 | 9,545,873 | 9,545,873 | null |
75,062,453 | 2 | null | 75,062,291 | 0 | null | Issue was that real_answer and inputted answer were different data types, this should fix it by making them both floats.
```
import random
# set variables
score = 100 # score of user
operator = ["+", "-", "*", "/"] #operators
number_1 = random.randint(1, 9) # this variable will be a random number between 1 and 9
number_2 = random.randint(0, 10) # this variable will be a random number between 0 and 10
# this function prints the dashes
def dash():
print("-" * 50)
while score >= 0 and score <= 200:
dash()
print("You currently hold: ", score, " points")
print("Get more than 200 points you win, under 0 you lose")
sign = random.choice(operator) # chooses random operator
# make a variable called real answer equal to the answer of the equation
if sign == "+":
real_answer = number_1 + number_2
elif sign == "-":
real_answer = number_1 - number_2
elif sign == "*":
real_answer = number_1 * number_2
elif sign == "/":
real_answer = number_1 / number_2
print(str(number_1) + str(sign) + str(number_2), "?")
dash()
print("Press x to close program")
answer = input("Enter your guess of number: ")
if answer == "x":
print("Program has been terminated properly")
break
elif float(answer) == real_answer:
score = score + 9
continue
elif float(answer) != real_answer:
score = score - 10
continue
if score < 0:
print("Unlucky, You lost")
elif score > 200:
print("CONGRATULATIONS YOU WON")
```
| null | CC BY-SA 4.0 | null | 2023-01-09T20:12:43.803 | 2023-01-09T20:12:43.803 | null | null | 14,934,213 | null |
75,062,485 | 2 | null | 75,003,733 | 0 | null | You can use result-type
However, then you need to use the syntax to be able to set multiple options on the simple, something like:
```
- set-header:
name: test
simple:
expression: "${body}"
result-type: "long"
```
| null | CC BY-SA 4.0 | null | 2023-01-09T20:16:10.297 | 2023-01-09T20:16:10.297 | null | null | 406,429 | null |
75,062,505 | 2 | null | 75,062,291 | 0 | null | The error here is that the variable `real_answer` is not an integer, but instead a tuple. For example, 1+7 gives (1, '+', 7), instead of 8.
Their are two main fixes to this:
The first fix is to create a dictionary which can contain the functions for each symbol. It would look something like this:
```
signs = {
'+': (lambda a, b: a + b),
'-': (lambda a, b: a - b),
'*': (lambda a, b: a * b),
'/': (lambda a, b: a // b)
}
```
Now, to call this function, you can do `real_answer = signs[sign](number_1,number_2)`. Essentially, this calls the function from the dictionary depending on what the sign is. If the sign is `/` the code recognises that divide means `lambda a, b: a // b` and calls this function with `number_1` and `number_2`
The other, but slightly more messy verisio is to use `eval`. What eval does is runs a string as code. For example, you could do:
```
real_answer = eval(f"{number_1}{sign}{number_2)")
```
While this does work, eval is generally not the best method.
The last thing to point out is that you don't cast your answer variables to an integer. When comparing numbers in your if statements, you want to use `int(answer)` to make sure you're using the integer version of your answer.
The full code should look something like this:
```
import random
# set variables
score = 100 # score of user
operator = ["+", "-", "*", "/"] #operators
number_1 = random.randint(1, 9) # this variable will be a random number between 1 and 9
number_2 = random.randint(0, 10) # this variable will be a random number between 0 and 10
signs = {
'+': (lambda a, b: a + b),
'-': (lambda a, b: a - b),
'*': (lambda a, b: a * b),
'/': (lambda a, b: a // b)
}
# this function prints the dashes
def dash():
print("-" * 50)
while score >= 0 and score <= 200:
dash()
print("You currently hold: ", score, " points")
print("Get more than 200 points you win, under 0 you lose")
sign = random.choice(operator) # chooses random operator
real_answer = signs[sign](number_1,number_2)
print(str(number_1) + str(sign) + str(number_2), "?")
dash()
print("Press x to close program")
answer = input("Enter your guess of number: ")
if answer == "x":
print("Program has been terminated properly")
break
elif int(answer) == real_answer:
score = score + 9
continue
elif int(answer) != real_answer:
score = score - 10
continue
if score < 0:
print("Unlucky, You lost")
elif score > 200:
print("CONGRATULATIONS YOU WON")
```
| null | CC BY-SA 4.0 | null | 2023-01-09T20:18:21.780 | 2023-01-09T20:18:21.780 | null | null | 13,739,174 | null |
75,062,799 | 2 | null | 75,061,479 | 1 | null | I don't think `.anchor` is a very useful selector, it's used for formatting and may change or appear on multiple elements. Also, that element is just the label for the list. You would want to select the list header using`.dropdown-check-list`.
```
export class SignupPage {
select_cuisine='.dropdown-check-list'
selectcuisine(){
cy.get(this.select_cuisine) // dropdown list
.find('li:contains("Coffee & Tea")') // list item required
.find('[type="checkbox"]') // find the checkbox
.check()
}
}
```
| null | CC BY-SA 4.0 | null | 2023-01-09T20:52:02.383 | 2023-01-10T20:46:22.943 | 2023-01-10T20:46:22.943 | 16,791,505 | 16,791,505 | null |
75,063,446 | 2 | null | 75,043,654 | 1 | null | Here's a solution using bitwise operations and then converting integers to hex representation:
```
massive = [[63, 62, 61, 60, 59, 58, 57, 56, 48, 40, 32, 24, 16, 8, 0, 1, 2, 3, 4, 5, 6, 7, 15, 23, 31, 39, 47, 55],
[63, 56, 0, 7],
[63, 56, 0, 7],
[35, 36, 27, 56, 28, 0, 7, 63],
[63, 56, 0, 7, 36, 35, 27, 28],
[63, 7, 56, 0],
[7, 0, 56, 63],
[7, 6, 5, 4, 3, 2, 1, 0, 8, 16, 32, 24, 40, 48, 56, 57, 58, 59, 60, 61, 62, 63, 55, 39, 47, 31, 23, 15]]
rows, cols = (8, 8)
arr = [[0 for i in range(cols)] for j in range(rows)]
# Since lower-bit layers go first in massive, we have to traverse massive in reverse order
for layer in reversed(massive):
# Shift each bitmask by one bit
for x in range(rows):
for y in range(cols):
arr[x][y] <<= 1
# Write current layer to the last bit of arr[x][y]
for val in layer:
x, y = val % cols, val // cols
arr[x][y] |= 1
for row in arr:
print(', '.join('0x{0:0{1}X}'.format(x, 2) for x in row))
```
will output
```
0xFF, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0xFF
0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81
0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81
0x81, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x81
0x81, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x81
0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81
0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81
0xFF, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0xFF
```
PS: I suggest you use 4 spaces per indentation level instead of 2 (see [PEP8 indentation guidline](https://peps.python.org/pep-0008/#indentation)).
| null | CC BY-SA 4.0 | null | 2023-01-09T22:07:30.627 | 2023-01-12T00:12:59.627 | 2023-01-12T00:12:59.627 | 552,563 | 552,563 | null |
75,063,508 | 2 | null | 75,043,654 | 0 | null | Pure python solution
```
massive = [[63, 62, 61, 60, 59, 58, 57, 56, 48, 40, 32, 24, 16, 8, 0, 1, 2, 3, 4, 5, 6, 7, 15, 23, 31, 39, 47, 55],
[63, 56, 0, 7],
[63, 56, 0, 7],
[35, 36, 27, 56, 28, 0, 7, 63],
[63, 56, 0, 7, 36, 35, 27, 28],
[63, 7, 56, 0],
[7, 0, 56, 63],
[7, 6, 5, 4, 3, 2, 1, 0, 8, 16, 32, 24, 40, 48, 56, 57, 58, 59, 60, 61, 62, 63, 55, 39, 47, 31, 23, 15]]
cube = [[[0] * 8 for _ in range(8)] for _ in range(8)]
for i, row in enumerate(massive):
for cell in row:
cell_y = cell % 8
cell_x = cell // 8
cube[i][cell_x][cell_y] = 1
result = [[''] * 8 for _ in range(8)]
for x in range(8):
for y in range(8):
binary = ''
for z in range(8):
binary += str(cube[x][y][z])
result[x][y] = hex(int(binary, 2))
for row in result:
print(row)
```
output
```
['0xff', '0x81', '0x81', '0x81', '0x81', '0x81', '0x81', '0xff']
['0x81', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x81']
['0x81', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x81']
['0x81', '0x0', '0x0', '0x18', '0x18', '0x0', '0x0', '0x81']
['0x81', '0x0', '0x0', '0x18', '0x18', '0x0', '0x0', '0x81']
['0x81', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x81']
['0x81', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x81']
['0xff', '0x81', '0x81', '0x81', '0x81', '0x81', '0x81', '0xff']
```
| null | CC BY-SA 4.0 | null | 2023-01-09T22:13:13.883 | 2023-01-09T22:13:13.883 | null | null | 5,589,820 | null |
75,063,811 | 2 | null | 75,063,019 | 0 | null | try:
```
=SUM(FILTER(transactions!D:D, transactions!A:A=B3, transactions!D:D>0))
```
or:
```
=BYROW(B3:B11, LAMBDA(x, SUM(
FILTER(transactions!D:D, transactions!A:A=x, transactions!D:D>0))))
```
| null | CC BY-SA 4.0 | null | 2023-01-09T23:01:48.237 | 2023-01-09T23:01:48.237 | null | null | 5,632,629 | null |
75,063,863 | 2 | null | 75,051,251 | 1 | null | Thank you.
The answers to my (poorly posed) question(s) was/were:
1. The ">" in R-Markdown triggers the blockquote class, so you can change appearance/ properties for that using CSS.
2. Use CSS to create a new / incremental style with similar properties.
In my case, I was looking to create a small area for citations under blockquotes, so I've accomplished that with:
```
```{css, echo=FALSE}
blockquote {
border-left: .2px solid #275d38;
margin: -5px 80px -5px 20px;
padding-top: -0.5px;
padding-bottom: -0.5px;
line-height: 1.35em;
}
.cite {
margin: -20px 80px -25px 80px;
padding-top: -0.5px;
padding-bottom: -0.5px;
line-height: 1.25em;
font-size: 20px;
}
```
```
which both changes the blockquote parameters and creates a new style for the citation under the quote, so it looks like this:
[](https://i.stack.imgur.com/Vm7xp.png)
Thanks to all for the answers and comments.
| null | CC BY-SA 4.0 | null | 2023-01-09T23:10:52.077 | 2023-01-09T23:10:52.077 | null | null | 8,145,187 | null |
75,063,885 | 2 | null | 28,935,839 | -1 | null |
1. From opened Eclipse; go to Window>Perspective>Reset Perspective
2. Back to Window>Show View
3. Click on Console.
I found this convenient.
| null | CC BY-SA 4.0 | null | 2023-01-09T23:14:52.677 | 2023-01-09T23:14:52.677 | null | null | 20,576,952 | null |
75,063,905 | 2 | null | 75,053,198 | 0 | null | Here's a minimal example of how to create a full page layout with a container that should scroll on overflow using Bootstrap V5.3.
Read the docs if you like to learn how it works.
- [Read about flex-grow-1](https://getbootstrap.com/docs/5.2/utilities/flex/#grow-and-shrink)[start here](https://www.w3schools.com/css/css3_flexbox.asp)- [Learn how overflow works.](https://www.w3schools.com/css/css_overflow.asp)
```
nav {
height: 100vh;
max-height: 100vh;
background: lightgreen;
}
main {
background: lightyellow;
}
```
```
<html>
<head>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN" crossorigin="anonymous"></script>
</head>
<body>
<div class="container-fluid px-0">
<div class="row gx-0">
<nav class="col-4 p-2 d-flex flex-column gap-1">
<div class="">
<h5>
Sidebar header
</h5>
</div>
<div class="">
Some content
</div>
<div class="">
Some other content
</div>
<div class="flex-grow-1 overflow-auto">
sidebar scroll
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> end sidebar scroll
</div>
<div class="">
Sidebar footer
</div>
</nav>
<main class="col">
main body
</main>
</div>
</div>
</body>
</html>
```
`<main>``overflow:scroll``100vh`.
Add in CSS:
```
main {
height: 100vh;
max-height: 100vh;
}
```
and in HTML:
```
<main class="col overflow-auto">
```
`<main>``<nav>`
You could wrap the content inside `col-4` in an absolute positioned container that fills `col-4` and therefore let it grow beyond `100vh` `height` while keeping the overflow scroll if `<main>` is smaller, for example:
```
nav {
min-height: 100vh;
background: lightgreen;
}
nav #overflow-container {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
main {
background: lightyellow;
}
```
```
<html>
<head>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN" crossorigin="anonymous"></script>
</head>
<body>
<div class="container-fluid px-0">
<div class="row gx-0">
<nav class="col-4 position-relative">
<div class="p-2 d-flex flex-column gap-1" id="overflow-container">
<div class="">
<h5>
Sidebar header
</h5>
</div>
<div class="">
Some content
</div>
<div class="">
Some other content
</div>
<div class="flex-grow-1 overflow-auto">
sidebar scroll
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> end sidebar scroll
</div>
<div class="">
Sidebar footer
</div>
</div>
</nav>
<main class="col">
main body
</main>
</div>
</div>
</body>
</html>
```
`<nav>``<main>`
In the HTML make `.row` a `flex-column` by default and a flex row on the medium breakpoint with `flex-md-row`. Then change `col-4` to `col-md-4`.
In the CSS add a media query, using Bootstrap's medium breakpoint width.
Note: Snippet below is based on the example above with an absolute positioned container, but the same logic can also be applied to the other examples.
```
nav {
min-height: 100vh;
background: lightgreen;
}
main {
background: lightyellow;
}
@media (min-width: 768px) {
nav #overflow-container {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
}
```
```
<html>
<head>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN" crossorigin="anonymous"></script>
</head>
<body>
<div class="container-fluid px-0">
<div class="row gx-0 flex-column flex-md-row">
<nav class="col-md-4 position-relative">
<div class="p-2 d-flex flex-column gap-1" id="overflow-container">
<div class="">
<h5>
Sidebar header
</h5>
</div>
<div class="">
Some content
</div>
<div class="">
Some other content
</div>
<div class="flex-grow-1 overflow-auto">
sidebar scroll
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> end sidebar scroll
</div>
<div class="">
Sidebar footer
</div>
</div>
</nav>
<main class="col">
main body
</main>
</div>
</div>
</body>
</html>
```
| null | CC BY-SA 4.0 | null | 2023-01-09T23:17:38.247 | 2023-01-10T12:49:02.170 | 2023-01-10T12:49:02.170 | 1,437,029 | 1,437,029 | null |
75,064,068 | 2 | null | 74,976,506 | 0 | null | This error is : Certificate fingerprint verification: Incorrect signing certificate fingerprint.
1. Verify that the certificate fingerprint is correctly configured when you apply for related services. Android: Open the APK file of an app, extract the META-INF directory from the file, obtain the CERT.RSA file in the directory, and run the keytool -printcert -file META-INF/CERT.RSA command to record the signing certificate information. HarmonyOS: Decompress the HAP package at multiple levels to obtain the *.EC file in the META-INF directory. Then, run the following keytool command of the JDK to view the EC file: keytool -printcert -file {File name}
2. Sign in to AppGallery Connect, click My projects, and select a required project. On the displayed page, select the app, go to Project settings > General information, and check whether the value in SHA-256 certificate fingerprint is the same as that in step 1.
As for how to generate certificate fingerprint, you can refer to:
1. https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/signing-fingerprint-0000001059050363
2. https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides-V1/generate-signature-0000001093910810-V1
| null | CC BY-SA 4.0 | null | 2023-01-09T23:46:21.667 | 2023-01-09T23:46:21.667 | null | null | 14,357,441 | null |
75,064,170 | 2 | null | 2,985,074 | 0 | null | This is what I did to fix it on my machine (Windows 10 Pro x64) in January 2023.
1 & 2) Configured TortoiseGit (in its settings... Network >> SSH >> SSH client) and Git (the GIT_SSH environment variable) to both use
C:\Program Files\PuTTY\plink.exe
quotation marks.
3 & 4) Set up both Pageant and ssh-add agent to auto-start (I used the ssh agent script from
[https://docs.github.com/en/authentication/connecting-to-github-with-ssh/working-with-ssh-key-passphrases](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/working-with-ssh-key-passphrases)
and use my private key.
| null | CC BY-SA 4.0 | null | 2023-01-10T00:07:41.393 | 2023-01-10T00:07:41.393 | null | null | 3,158,465 | null |
75,064,463 | 2 | null | 22,087,193 | 0 | null | The following is a C++implementation of point-to-line projection calculation
```
#include <iostream>
#include <cmath>
using namespace std;
int main() {
// the point
double x0 = 1.0, y0 = 1.0;
// the line equation
double A = 1.0, B = 1.0, C = 0.0;
// calc point to line distance
double dist = fabs(A * x0 + B * y0 + C) / sqrt(A * A + B * B);
// calc project point coord
double x1 = x0 - dist * A / sqrt(A * A + B * B);
double y1 = y0 - dist * B / sqrt(A * A + B * B);
// result
cout << "project point:(" << x1 << ", " << y1 << ")" << endl;
return 0;
}
```
| null | CC BY-SA 4.0 | null | 2023-01-10T01:07:18.570 | 2023-01-10T01:07:18.570 | null | null | 10,779,545 | null |
75,064,513 | 2 | null | 75,053,360 | 0 | null | Yes, after pasting the ssh keys and giving a name, I clicked on the Add button(the one on lower right corner) but still didn't added as I can't see any list ssh keys or any message or warning saying as successfully added.
[SshKeyImagenAdd](https://i.stack.imgur.com/V8fLB.png)
[SshKeyImagenAdd](https://i.stack.imgur.com/rzSQx.png)
| null | CC BY-SA 4.0 | null | 2023-01-10T01:18:21.810 | 2023-01-10T01:42:40.437 | 2023-01-10T01:42:40.437 | 10,994,052 | 10,994,052 | null |
75,064,790 | 2 | null | 75,064,599 | -1 | null | Your model is [overfitting](https://machinelearningmastery.com/overfitting-and-underfitting-with-machine-learning-algorithms/). This is why your accuracy increases and then begins decreasing. You need to implement [Early Stopping](https://www.tensorflow.org/api_docs/python/tf/keras/callbacks/EarlyStopping) to stop at the Epoch with the best results. You should also implement [dropout layers](https://machinelearningmastery.com/dropout-for-regularizing-deep-neural-networks/).
| null | CC BY-SA 4.0 | null | 2023-01-10T02:14:10.810 | 2023-01-10T02:14:10.810 | null | null | 19,961,760 | null |
75,064,836 | 2 | null | 75,062,670 | 0 | null | Changing to and make sure adding the
`using Microsoft.AspNetCore.Identity.EntityFrameworkCore;`
Here is the sample code I wrote:
```
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
namespace WebAppldentity.Data
{
public class ApplicationDbContext : IdentityDbContext
{
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
: base(options)
{
}
}
}
```
| null | CC BY-SA 4.0 | null | 2023-01-10T02:20:28.180 | 2023-01-10T02:20:28.180 | null | null | 19,151,266 | null |
75,065,546 | 2 | null | 75,061,341 | 0 | null | From the error what I could understand is from the API you're getting a JSON object - not a JSON array. And in the code, you're trying to deserialize `apiResponse` which is an `Author` object to `List<Author>`.
Either make changes in the API to return `List<Author>` or deserialize to `Author` instead of `List<Author>`
| null | CC BY-SA 4.0 | null | 2023-01-10T04:43:44.640 | 2023-01-10T04:43:44.640 | null | null | 38,024 | null |
75,065,612 | 2 | null | 75,061,341 | 0 | null | It would be better if you shared the replica of JSON too,
From the error, we can probably say that the list you are getting is in a single object... You should try something like this...
```
public class Author
{
...
...
...
}
public class AuthorObject
{
public List<Author> Authors { get; set; }
}
```
and then you should try something like below,
```
AuthorObject obj = JsonConvert.DeserializeObject<AuthorObject>(apiResponse);
```
It will solve the error.
| null | CC BY-SA 4.0 | null | 2023-01-10T04:55:42.370 | 2023-01-10T04:55:42.370 | null | null | 9,680,746 | null |
75,065,613 | 2 | null | 75,065,054 | 1 | null | You did not implement it properly. You resumed camera onInit() method, before even controller was initialised. So, hot reloading was making it work. Next, why are you popping navigation everytime you scan an item? Is this your logic, to remove the current screen and go back to previous screen once the item has been successfully scanned? Anyway modify the below code to your logic. I have modified your code below and it works now:
```
class QRScanScreen extends StatefulWidget {
const QRScanScreen({Key? key}) : super(key: key);
@override
State<QRScanScreen> createState() => _QRScanScreenState();
}
class _QRScanScreenState extends State<QRScanScreen> {
final GlobalKey qrKey = GlobalKey(debugLabel: 'QR');
Barcode? result;
QRViewController? controller;
@override
void initState() {
super.initState();
// controller?.resumeCamera();
}
void resumeCamera() {
if (Platform.isAndroid) {
controller?.pauseCamera();
}
controller?.resumeCamera();
}
@override
void dispose() {
controller?.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
var scanArea = (MediaQuery.of(context).size.width < 400 ||
MediaQuery.of(context).size.height < 400)
? 150.0
: 300.0;
return Scaffold(
appBar: AppBar(
),
body: QRView(
key: qrKey,
onQRViewCreated: (controller) {
setState(() {
this.controller = controller;
});
resumeCamera();
controller.scannedDataStream.listen((scanData) {
setState((){
result = scanData;
});
// Navigator.pop(context);
});
},
overlay: QrScannerOverlayShape(
borderColor: Colors.red,
borderRadius: 10,
borderLength: 30,
borderWidth: 10,
cutOutSize: scanArea,
),
onPermissionSet: (ctrl, p) => _onPermissionSet(context, ctrl, p),
),
);
}
void _onPermissionSet(BuildContext context, QRViewController ctrl, bool p) {
if (!p) {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('no Permission')),
);
}
}
}
```
| null | CC BY-SA 4.0 | null | 2023-01-10T04:55:48.777 | 2023-01-10T04:55:48.777 | null | null | 6,067,774 | null |
75,065,655 | 2 | null | 69,054,553 | 0 | null | Just remove this property and have fun.
:
I'm having the same issue with React and Typescript.
The problem is that the property `allowTransparency` is typed in `@types/react`, but it's no longer supported in React - [it was removed in 2017](https://github.com/facebook/react/pull/10823).
`@types/react` is an independent project [https://github.com/DefinitelyTyped/DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped) and someone has already tried to merge a [PR removing this property](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/48605) but it was not merged.
[nhunzaker](https://github.com/nhunzaker), the guy who removed this property from React with [this PR](https://github.com/facebook/react/pull/10823) said:
> "allowtransparency is an Internet Explorer-only attribute that controls
the background transparency of an iFrame. When set to true, it
respects the background color of the iFrame. When set to false, it
sets the background color to that of the document."
Nobody is really using Internet Explorer these days, so I'm just removing it.
If you still need to support IE, you can try using @ts-ignore.
I hope it helps, good luck!
[](https://i.stack.imgur.com/5stlE.png)
| null | CC BY-SA 4.0 | null | 2023-01-10T05:00:50.563 | 2023-01-10T05:00:50.563 | null | null | 5,631,990 | null |
75,065,765 | 2 | null | 75,065,573 | 0 | null | You could adjust your `merge fn` so that it only pushes the district if it's not already in the district array.
```
const mergeData = data.reduce((a, b) => {
const similar = a.find((e) => e.state_name == b.state_name);
return (
similar
? !similar.district.includes(b.district) &&
similar.district.push(b.district)
: a.push({
...b,
district: [b.district],
}),
a
);
}, []);
```
Output :
```
[
{
district: ["Banglore", "Mysore", "Manglore"],
gender: "Boys",
state_name: "Karnataka",
},
{
district: ["Hyderabad"],
gender: "Boys",
state_name: "Telangana",
},
{
district: ["North", "South"],
gender: "Girls",
state_name: "Goa",
},
{
district: ["Chittor", "Vizag"],
gender: "Boys",
state_name: "Andhra Pradesh",
},
];
```
Fiddle : [https://jsfiddle.net/RyanZee/bnh6u7mx/4/](https://jsfiddle.net/RyanZee/bnh6u7mx/4/)
As for the gender being displayed, you're not returning it in your map:
```
{
mergeData.map((c, index) => (
<tr key={index}>
<td>{c.state_name}</td>
{c.district.map((d, i) => (
<tr key={i}>
<tr>
<td>{d}</td>
</tr>
</tr>
))}
<td>{c.gender}</td>
</tr>
));
}
```
| null | CC BY-SA 4.0 | null | 2023-01-10T05:19:53.713 | 2023-01-10T05:25:49.787 | 2023-01-10T05:25:49.787 | 15,474,532 | 15,474,532 | null |
75,065,844 | 2 | null | 69,054,553 | 0 | null | A transparent iframe can be made by setting its background to transparent.
```
body {
background-color : transparent;
}
```
And, the `allowtransparency` attribute of iframe is to be set as `true`.
```
<iframe src = "URL" allowtransparency = "true"></iframe>
```
Ex:
```
<!DOCTYPE html>
<html>
<body>
<div style="background: blue; padding: 30px;">
//..
<iframe src=".." allowtransparency="true">
//..
</iframe>
</div>
</body>
</html>
```
| null | CC BY-SA 4.0 | null | 2023-01-10T05:31:10.753 | 2023-01-10T05:31:10.753 | null | null | 8,750,617 | null |
75,065,899 | 2 | null | 48,283,946 | 0 | null | SELECT @row_no := IF(@prev_val = lpsm.lit_no, @row_no + 1, 1) AS row_num,@prev_val := get_pad_value(lpsm.lit_no,26) LAWSUIT_NO,lpsm.cust_rm_no
FROM lit_person_sue_map lpsm,(SELECT @row_no := 0) x,(SELECT @prev_val := '') y
ORDER BY lpsm.lit_no ASC;
This will return sequence number group by lit_no;
| null | CC BY-SA 4.0 | null | 2023-01-10T05:41:00.617 | 2023-01-10T05:42:09.503 | 2023-01-10T05:42:09.503 | 6,099,344 | 6,099,344 | null |
75,065,915 | 2 | null | 75,064,904 | 0 | null | Found the problem, because the trigger is used.
A unique primary key violation occurred when inserting the statement into the new table
| null | CC BY-SA 4.0 | null | 2023-01-10T05:43:26.447 | 2023-01-10T05:43:26.447 | null | null | 20,962,353 | null |
75,066,024 | 2 | null | 53,992,317 | 0 | null | Like this
```
{:width="100%"}
```
| null | CC BY-SA 4.0 | null | 2023-01-10T05:59:36.620 | 2023-01-10T05:59:36.620 | null | null | 1,878,141 | null |
75,066,129 | 2 | null | 61,761,567 | 0 | null | Try Disable in the IOS Simulator
by clicking ctrl + cmd +Z on Mac
It works for me.
| null | CC BY-SA 4.0 | null | 2023-01-10T06:13:45.460 | 2023-01-10T06:13:45.460 | null | null | 10,686,620 | null |
75,066,533 | 2 | null | 75,066,434 | 0 | null | I think you need something like this
```
var arr = [1,2,3,4,5]
print(arr.map {"\($0) "}.reduce("",+) )
```
Output :
```
1 2 3 4 5
```
| null | CC BY-SA 4.0 | null | 2023-01-10T07:06:17.427 | 2023-01-10T07:06:17.427 | null | null | 9,110,909 | null |
75,066,744 | 2 | null | 10,838,109 | 0 | null | If other solutions did not work and you are using any plugin adding sources in your pom.xml check it. I used build-helper-maven-plugin to add classes generated from openapi specification with incorrect configuration:
```
<source>${project.build.directory}/generated-sources/openapi/src</source>
```
instead of correct:
```
<source>${project.build.directory}/generated-sources/openapi/src/main/java/</source>
```
So after correcting:
```
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.build.directory}/generated-sources/openapi/src</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
```
| null | CC BY-SA 4.0 | null | 2023-01-10T07:29:33.560 | 2023-01-10T07:29:33.560 | null | null | 1,651,107 | null |
75,067,608 | 2 | null | 74,903,161 | 0 | null | Check this approach, together with html template and autotable . Created in [StackBlitz](https://stackblitz.com/edit/js-xsapyb)
| null | CC BY-SA 4.0 | null | 2023-01-10T09:00:12.560 | 2023-01-10T09:00:12.560 | null | null | 1,565,060 | null |
75,067,877 | 2 | null | 12,191,462 | 1 | null | Note that ELF binaries don't necessarily need to be machine/arch specific per se.
The interesting piece is the "interpreter" header field: it holds a path name to a loader program that's executed instead of the actual binary. This one then is responsible for loading the actual program, loading and linking libraries, etc. This is the way how eg. ld.so comes in.
Theoretically one could create an ELF binary that holds java bytecode (or a complete jar). This just needs some appropriate "interpreter" program which starts up a JVM and loads the code from the binary into it.
Not sure whether this actually has been done before, but certainly possible.
The same can be done w/ quite any non-native code.
It also could serve for direct multiarch support via some VM like qemu:
Let the target platform (libc+linker scripts) put the arch name into the interpreter program name (eg. /lib/ld.so.x86_64, /lib/ld.so.armhf, ...).
Then, on a particular arch (eg. x86_64), the one with native arch name will point to the original ld.so, while the others point to some special one that calls up something like qemu-system-XXX.
| null | CC BY-SA 4.0 | null | 2023-01-10T09:26:08.820 | 2023-01-10T09:26:08.820 | null | null | 2,052,006 | null |
75,068,064 | 2 | null | 15,940,940 | 0 | null | You can use built in function
=Globals!ExecutionTime
and make the value = [&ExecutionTime] (or whatever you want to call it)
You can also add the user Id of the person generating the report using the built in function
=User!UserID
| null | CC BY-SA 4.0 | null | 2023-01-10T09:42:26.160 | 2023-01-10T09:42:26.160 | null | null | 20,972,754 | null |
75,068,110 | 2 | null | 75,067,635 | 0 | null | ```
for iteration,batch in enumerate(train_dataloader):
if step % ACCUMULATION:
t.update(1) # add one update here as well.
continue
...
t.update(1)
```
Half of the time you do not update the tqdm counter or set its value too high during initialization. So it can't go higher than 50%.
| null | CC BY-SA 4.0 | null | 2023-01-10T09:47:37.190 | 2023-01-10T09:55:07.600 | 2023-01-10T09:55:07.600 | 12,439,683 | 12,439,683 | null |
75,068,160 | 2 | null | 13,598,148 | 0 | null | you can archive it by using [flexbox](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout) for example
```
body {
position: relative;
height: 100vh;
}
.vertical {
position: absolute;
left: 50%;
top: 0;
bottom: 0;
transform: translateX(-10px);
width: 20px;
display: flex;
flex-direction: column;
align-items: center;
font-size: 18px;
color: #999;
}
.vertical .line {
width: 1px;
flex: 1;
background: #999;
}
```
```
<div class="vertical">
<div class="line"></div>
<div class="text">OR</div>
<div class="line"></div>
</div>
```
| null | CC BY-SA 4.0 | null | 2023-01-10T09:50:53.020 | 2023-01-10T09:50:53.020 | null | null | 3,090,685 | null |
75,068,566 | 2 | null | 65,908,408 | 1 | null |
Do not try to open the SQL file from this tool bar:
[](https://i.stack.imgur.com/Bswfe.png)
Go to Server > Data Import:
[](https://i.stack.imgur.com/86h6c.png)
- - -
[](https://i.stack.imgur.com/7Fmm0.png)
| null | CC BY-SA 4.0 | null | 2023-01-10T10:23:39.960 | 2023-01-10T10:23:39.960 | null | null | 13,640,979 | null |
75,068,600 | 2 | null | 66,800,485 | 0 | null | I fixed this problem by running gdb in a cygwin window rather than a Windows command window. I get the cygwin window by running (i.e., double-clicking on) mintty.exe, which on my machine is at
```
C:\cygwin64\bin\mintty.exe
```
| null | CC BY-SA 4.0 | null | 2023-01-10T10:26:19.967 | 2023-01-12T10:22:44.740 | 2023-01-12T10:22:44.740 | 10,871,073 | 13,375,507 | null |
75,068,677 | 2 | null | 75,060,942 | 0 | null | First, extending the String prototype is bad practice and you should try to avoid doing that at all costs.
The error is genuine and correct. You can execute the program because it is valid JavaScript code and ts-node does transpilation, but you will not be able to compile your program to JS.
Try compiling with your code with `tsc index.ts` and you will get the same errors, which you will need to fix:
```
index.ts:1:18 - error TS2339: Property 'test' does not exist on type 'String'.
1 String.prototype.test = () => 'hola!'
~~~~
index.ts:3:22 - error TS2339: Property 'test' does not exist on type '"prueba"'.
3 console.log('prueba'.test())
```
| null | CC BY-SA 4.0 | null | 2023-01-10T10:32:45.837 | 2023-01-10T10:32:45.837 | null | null | 567,897 | null |
75,068,757 | 2 | null | 71,619,177 | 0 | null | If you want to compare date, use TalendDate.compareDate() .
The TalendDate.compareDate function in Talend is used to compare two dates and returns an integer value indicating their relative order. The function takes two arguments, both of which should be in the format of java.util.Date objects. The function will return 0 if the two dates are equal, a positive integer if the first date is after the second date, and a negative integer if the first date is before the second date.
Here is an example of how to use the TalendDate.compareDate function in a Talend Job:
```
// Define two date variables
java.util.Date date1 = TalendDate.parseDate("yyyy-MM-dd", "2022-01-01");
java.util.Date date2 = TalendDate.parseDate("yyyy-MM-dd", "2022-12-31");
// Compare the two dates
int comparison = TalendDate.compareDate(date1, date2);
// Check the result of the comparison
if (comparison < 0) {
System.out.println(date1 + " is before " + date2);
} else if (comparison == 0) {
System.out.println(date1 + " is equal to " + date2);
} else {
System.out.println(date1 + " is after " + date2);
}
```
| null | CC BY-SA 4.0 | null | 2023-01-10T10:40:02.880 | 2023-01-10T10:40:02.880 | null | null | 6,583,204 | null |
75,068,806 | 2 | null | 75,066,332 | 0 | null | You've omitted some of your code. The `propertiesStuff` function you posted uses `setProperty`, but your error pertains to a call of `setProperties`.
[As per the docs](https://developers.google.com/apps-script/reference/properties/properties#setpropertiesproperties,-deleteallothers) `setProperties` takes two parameters: the first is an of `key: value` pairs, and the second is an optional boolean marking whether the other properties should be deleted or not.
If you're using `setProperties` then it should look something like this:
```
PropertiesService.getScriptProperties().setProperties({
"A2": SpreadsheetApp.getActive().getActiveSheet().getRange("A2").getValue()
})
```
If you want to use `setProperty` then your line is correct, but you're running a different function which is throwing the error.
| null | CC BY-SA 4.0 | null | 2023-01-10T10:45:00.077 | 2023-01-10T10:45:00.077 | null | null | 11,551,468 | null |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.