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,631,626 | 2 | null | 75,350,840 | 0 | null | Switch to pre-release version solved my problem.
| null | CC BY-SA 4.0 | null | 2023-03-03T20:31:14.253 | 2023-03-03T20:31:14.253 | null | null | 21,328,483 | null |
75,631,659 | 2 | null | 68,799,580 | 0 | null | All you have to do is reset the VS Code version. At least that fixed the problem for me after 6 hours of research and trying. I have set the current version to the previous month.
| null | CC BY-SA 4.0 | null | 2023-03-03T20:35:31.440 | 2023-03-03T20:35:31.440 | null | null | 21,328,506 | null |
75,631,676 | 2 | null | 75,631,592 | 0 | null | To have the same width, set the border-bottom on the parent div instead of the p tag like so :
```
.questions-info{
border-bottom: 1px solid rgb(180, 175, 175);
}
.press-info{
border-bottom: 1px solid rgb(180, 175, 175);
}
.phone-info{
border-bottom: 1px solid rgb(180, 175, 175);
}
```
| null | CC BY-SA 4.0 | null | 2023-03-03T20:38:51.823 | 2023-03-03T20:45:08.863 | 2023-03-03T20:45:08.863 | 21,056,235 | 21,056,235 | null |
75,631,679 | 2 | null | 75,631,592 | 0 | null | Stretch the flex children and align text to center for them and the wrapper element. Also use `inline-flex` on the inner container.
```
.contact-banner {
border-top-right-radius: 40px;
border-top-left-radius: 40px;
margin-top: 10%;
text-align: center;
}
.contacts-info {
display: flex;
justify-content: space-around;
margin-top: 2%;
align-items: center;
}
h1 {
display: flex;
justify-content: center;
font-family: var(--elewa-group-website-dmsans-regular);
font-size: 50px;
font-weight: 550;
}
p {
margin: 5% 0;
padding-bottom: 2%;
border-bottom: 1px solid rgb(180, 175, 175);
}
h2 {
font-family: var(--elewa-group-website-dmsans-regular);
font-size: 13px;
opacity: .4;
}
p {
font-family: var(--elewa-group-website-dmsans-regular);
font-size: 27px;
}
@media (max-width: 767px) {
.banner-main {
margin-top: 5%;
}
.contacts-info {
display: inline-flex;
flex-direction: column;
align-items: stretch;
text-align: center;
}
.questions-info,
.press-info,
.phone-info {
margin: 5% 0;
}
.press-info,
.phone-info {
padding-top: 2%;
}
h1 {
font-size: 35px;
}
h2 {
font-size: 18px;
width: 100%;
text-align: center;
}
p {
font-size: 20px;
margin: 5% 0;
padding-bottom: 2%;
border-bottom: 1px solid rgb(180, 175, 175);
box-sizing: border-box;
}
}
@media (max-width: 480px) {
.banner-main {
margin-top: 4%;
}
h1 {
font-size: 30px;
}
h2 {
font-size: 14px;
}
p {
font-size: 25px;
margin: 5% 0;
padding-bottom: 2%;
border-bottom: 1px solid rgb(180, 175, 175);
box-sizing: border-box;
}
}
```
```
<div class="contact-banner">
<h1>Contact</h1>
<div class="contacts-info">
<div class="questions-info">
<h2 class="subheader">Questions</h2>
<p>Info@elewagroup.com</p>
</div>
<div class="press-info">
<h2 class="subheader">Press</h2>
<p>Press@elewa.com</p>
</div>
<div class="phone-info">
<h2 class="subheader">Phone</h2>
<p>+254 78 92 27 755</p>
</div>
</div>
</div>
```
| null | CC BY-SA 4.0 | null | 2023-03-03T20:39:09.573 | 2023-03-03T20:44:31.773 | 2023-03-03T20:44:31.773 | 1,264,804 | 1,264,804 | null |
75,631,766 | 2 | null | 75,630,929 | 1 | null | You use the `style` property with a DOM Element and not with `textContent` property! Remove `textContent` from your code to make it work:
```
e.target.childNodes.nextElementSibling.style.color = "white";
```
| null | CC BY-SA 4.0 | null | 2023-03-03T20:51:01.250 | 2023-03-03T20:52:51.627 | 2023-03-03T20:52:51.627 | 20,576,394 | 20,576,394 | null |
75,631,872 | 2 | null | 58,426,933 | 0 | null | To overlay a label on the game screen, you can use the Graphics object and draw the label on top of it. Here is the code for that :
```
private Process gameProcess;
private String gameName = "igi.exe";
private void Form1_Load(object sender, EventArgs e)
{
gameProcess = Process.Start(gameName);
gameProcess.EnableRaisingEvents = true;
gameProcess.Exited += GameProcess_Exited;
gameProcess.WaitForInputIdle();
SetParent(gameProcess.MainWindowHandle, panel1.Handle);
MoveWindow(gameProcess.MainWindowHandle, 0, 0, panel1.Width, panel1.Height, true);
label1.Parent = panel1;
label1.BackColor = Color.Transparent;
label1.AutoSize = true;
label1.Location = new Point(panel1.Width / 2 - label1.Width / 2, panel1.Height / 2 - label1.Height / 2);
label1.BringToFront();
}
private void GameProcess_Exited(object sender, EventArgs e)
{
this.Invoke((MethodInvoker)delegate
{
label1.Text = "Game Over";
label1.Location = new Point(panel1.Width / 2 - label1.Width / 2, panel1.Height / 2 - label1.Height / 2);
label1.BringToFront();
});
}
[DllImport("user32.dll")]
static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
[DllImport("user32.dll")]
static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);
private void panel1_MouseMove(object sender, MouseEventArgs e)
{
label1.BringToFront();
}
private void panel1_Paint(object sender, PaintEventArgs e)
{
label1.Refresh();
e.Graphics.DrawString(label1.Text, label1.Font, new SolidBrush(label1.ForeColor), label1.Location);
}
```
Here's a brief explanation of the changes I made:
- Declare a Process variable to hold the game process.- Set the game process to enable raising events and add an event
handler for the process exited event.- Wait for the game process to become idle before setting the parent
and moving the window to the panel.- Set the label's parent to the panel, set its background color to
transparent, and position it in the center of the panel.- Add the panel's Paint event handler to draw the label on top of the
game screen using the Graphics object.- When the game process exits, change the label text to "Game Over" and
reposition it to the center of the panel.- Call the label's BringToFront method in the MouseMove event handler
to ensure it's always on top of the game screen.
| null | CC BY-SA 4.0 | null | 2023-03-03T21:06:35.263 | 2023-03-03T21:06:35.263 | null | null | 6,219,626 | null |
75,631,915 | 2 | null | 75,631,853 | 0 | null | As per the snapshot provided:

the desired element is clearly with an an [<iframe>](https://stackoverflow.com/a/53276478/7429447).
---
## Solution
To send a within the desired element you have to:
- Induce [WebDriverWait](https://stackoverflow.com/a/59130336/7429447) for the desired .- Induce [WebDriverWait](https://stackoverflow.com/a/52607451/7429447) for the desired .- You can use either of the following [locator strategies](https://stackoverflow.com/questions/48369043/official-locator-strategies-for-the-webdriver):```
WebDriverWait(driver, 20).until(EC.frame_to_be_available_and_switch_to_it((By.CSS_SELECTOR,"iframe_css_selector")))
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.ID, "product-description"))).send_keys("fddfdfdfdf")
```
| null | CC BY-SA 4.0 | null | 2023-03-03T21:12:23.157 | 2023-03-03T21:16:29.030 | 2023-03-03T21:16:29.030 | 7,429,447 | 7,429,447 | null |
75,631,955 | 2 | null | 18,039,646 | 0 | null | `gridlines.count:0` is mentioned in the [docs](https://developers.google.com/chart/interactive/docs/gallery/linechart)
> You can specify a value of 1 to only draw one gridline, or 0 to draw no gridlines.
| null | CC BY-SA 4.0 | null | 2023-03-03T21:17:43.843 | 2023-03-03T21:17:43.843 | null | null | 14,467 | null |
75,632,013 | 2 | null | 65,904,404 | 0 | null | This is what I edit for MacOS ventura , Eclipse/STS and it worked.I use Spring Tool Suite.
Go to Eclipse/STS -->Preferences/Settings --> Java -->Installed JRE's
If you see this as the first path among installed JRE's remove it.This does not include jdk.
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home.
Eclipse will automatically take the next installed JDK library which is the jdk 1.8.0_361. Pls make sure you have added a jdk library of your choice in the first place into installed jre's.
As a pre-requisite to this, make sure that your JAVA_HOME and M2_HOME are all set correctly and that mvn -version returns the right jdk version before modifying anything in eclipse.
| null | CC BY-SA 4.0 | null | 2023-03-03T21:26:15.737 | 2023-03-03T21:26:15.737 | null | null | 14,095,109 | null |
75,632,053 | 2 | null | 75,629,413 | 0 | null |
## Resize 'Slave' Tables
```
Option Explicit
Sub ResizeSlaveTables()
' Define constants.
Const MASTER_NAME As String = "TableQuery"
Const SLAVE_NAMES As String = "Table2,Table3"
' Reference the worksheet (by code name). Great!
Dim ws As Worksheet: Set ws = Sheet1
' Split the slave table names into an array.
Dim Slaves() As String: Slaves = Split(SLAVE_NAMES, ",")
' Reference the master table.
Dim mlo As ListObject: Set mlo = ws.ListObjects(MASTER_NAME)
' Calculate its number of rows.
Dim mrCount As Long: mrCount = mlo.Range.Rows.Count
Dim Slave, srCount As Long, WasResized As Boolean
' Loop through the slave table names.
For Each Slave In Slaves
' Reference the range of the slave table.
With ws.ListObjects(Slave).Range
' Calculate its number of rows.
srCount = .Rows.Count
' Act per requirement.
If mrCount <> srCount Then ' the sizes are different
.ListObject.Resize .Resize(mrCount) ' resize the slave
If mrCount < srCount Then ' slave size was greater
' Clear 'remains' below the new size of the slave.
.Resize(srCount - mrCount).Offset(mrCount).Clear
'Else ' master size was greater; do nothing
End If
WasResized = True ' for the message box
'Else ' the sizes are the same; do nothing
End If
End With
Next Slave
If WasResized Then ' at least one was resized
MsgBox "Slave tables resized.", vbInformation
Else ' none were resized
MsgBox "The slave tables were of the correct size.", vbExclamation
End If
End Sub
```
| null | CC BY-SA 4.0 | null | 2023-03-03T21:31:51.583 | 2023-03-03T21:40:49.137 | 2023-03-03T21:40:49.137 | 9,814,069 | 9,814,069 | null |
75,632,369 | 2 | null | 75,632,342 | 0 | null | One of many ways to do achieve your objective:
1. Make an array of checkboxes on your current form that are checked.
2. Go through the array to build the folder name based on the Text.
3. Delete the entire folder, then replace it with an empty one.
You may want to familiarize yourself with `System.Linq` extension methods like `Where` and `Any` if you haven't already.
The [] button should only be enabled if something is checked.
[](https://i.stack.imgur.com/6hTZe.png)
---
Making an array of the checkboxes will be handy. It can be used every time you `Clear`. At the same time, the [] button shouldn't be enabled unless one or more of the checkboxes are marked.
```
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
// Make an array of the checkboxes to use throughout the app.
_checkboxes = Controls.OfType<CheckBox>().ToArray();
// This provides a way to make sure the Clear button is
// only enabled when one or more checkboxes is marked.
foreach (CheckBox checkBox in _checkboxes)
{
checkBox.CheckedChanged += onAnyCheckboxChanged;
}
// Attach the 'Click' handler to the button if you
// haven't already done this in the form Designer.
buttonClear.Enabled = false;
buttonClear.Click += onClickClear;
}
const string basePath = @"D:\java\";
CheckBox[] _checkboxes;
.
.
.
}
```
---
`Clear`
Here we respond to changes in the checkbox state.
```
private void onAnyCheckboxChanged(object sender, EventArgs e)
{
buttonClear.Enabled = _checkboxes.Any(_=>_.Checked);
}
```
---
Build a subfolder path using the `Text` of the checkboxes. If the checkbox is selected, delete the entire folder, replacing it with a new, empty one.
```
private void onClickClear(object sender, EventArgs e)
{
// Get the checkboxes that are selected.
CheckBox[] selectedCheckBoxes =
_checkboxes.Where(_ => _.Checked).ToArray();
foreach (CheckBox checkBox in selectedCheckBoxes)
{
// Build the folder path
string folderPath = Path.Combine(basePath, checkBox.Text);
// Can't delete if it doesn't exist.
if (Directory.Exists(folderPath))
{
// Delete the directory and all its files and subfolders.
Directory.Delete(path: folderPath, recursive: true);
}
// Replace deleted folder with new, empty one.
Directory.CreateDirectory(path: folderPath);
}
}
```
| null | CC BY-SA 4.0 | null | 2023-03-03T22:28:03.670 | 2023-03-04T15:18:52.777 | 2023-03-04T15:18:52.777 | 5,438,626 | 5,438,626 | null |
75,632,696 | 2 | null | 74,973,618 | 0 | null | github is sunsetting atom... Atom package management will stop working
| null | CC BY-SA 4.0 | null | 2023-03-03T23:33:16.667 | 2023-03-03T23:33:16.667 | null | null | 18,104,924 | null |
75,632,720 | 2 | null | 51,489,985 | 0 | null | For me the solution was different.
I spent 2 days trying to figure out how to install SQL Server 2022 in my laptop (Samsung book 2)
Aparently the ssd of my system doesn't have the proper configuration for the sector size.
[I finally found this post](https://wiki.autocountsoft.com/wiki/Troubleshooting:_Windows_11_SQL_Server_Installation_Error-Wait_on_the_Database_Engine_recovery_handle_failed._Check_the_SQL_Server_error_log_for_potential_causes#:%7E:text=Check%20the%20SQL%20Server%20error%20log%20for%20potential,5%29%20The%20installation%20should%20success%20now.%20M%C3%A1s%20elementos)
The short solution is to add a key to windows registry so that Sql server gets the expected size. You have to run this command with elevated privileges:
REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device" /v "ForcedPhysicalSectorSizeInBytes" /t REG_MULTI_SZ /d "* 4095" /f
Restart windows and when I tried to install again it doesn't get stuck in sqlengineconfigaction_install_confignonrc_cpu64 anymore.
| null | CC BY-SA 4.0 | null | 2023-03-03T23:37:28.750 | 2023-03-03T23:37:28.750 | null | null | 12,798,097 | null |
75,632,838 | 2 | null | 75,632,342 | 0 | null | I understand, you have this structure
```
D
|-java
|-Document
|-Person
|-Picture
```
And you said . So, I assume you need to keep folders
In this case
```
public void EmptyFolder(string root, IEnumerable<string> subfolders)
{
foreach(string folder in subfolders)
{
string dirPath = Path.Combine(root, folder);
foreach (string subdir in Directory.EnumerateDirectories(dirPath))
Directory.Delete(subdir, true);
foreach (string file in Directory.EnumerateFiles(dirPath))
File.Delete(file);
}
}
// (assuming check box text is the name of folder. Or you can use tag property to set real folder name there)
private IEnumerable<string> Getfolders()
{
foreach(control c in this.Controls) // "this" being a form or control, or use specificControl.Controls
{
if (c is Checkbox check && check.Checked)
yield return check.Text;
}
}
// USAGE
EmptyFolder(@"D:\java\", Getfolders());
```
NOTE: written from memory and not tested
| null | CC BY-SA 4.0 | null | 2023-03-04T00:08:33.443 | 2023-03-04T00:08:33.443 | null | null | 1,704,458 | null |
75,632,890 | 2 | null | 75,580,908 | 0 | null | There are a number of ways to do this, here's one based on the component's `addRow()` and `removeRow(index)` [functions](https://github.com/formio/formio.js/blob/bb279a306d025ee061af0a36b5ee2be9424a3ccf/src/components/datagrid/DataGrid.js#L435):
Run a function that reconciles the number of rows based on the value of another component. In the component's Calculated Value field, you could add something like
```
let current = instance.rows.length;
let expected = data.numberOfRows || 1;
if (current > expected) {
for (let i = 0; i <= current - expected; i++) {
instance.removeRow(current - i);
}
} else if (current < expected) {
for (let i = 0; i < expected - current; i++) {
instance.addRow();
}
}
```
or tie the above to an event triggered by a button. [Here's a JSFiddle](https://jsfiddle.net/brendanbond/b7jpy3kw/13/) of a simple working example.
| null | CC BY-SA 4.0 | null | 2023-03-04T00:25:15.720 | 2023-03-04T00:25:15.720 | null | null | 4,756,341 | null |
75,633,387 | 2 | null | 42,250,467 | 0 | null | Seems like it is not yet implemented. See [this](https://github.com/SpartnerNL/Laravel-Excel/issues/2693).
So, for now [here](https://stackoverflow.com/questions/69202868/how-to-get-number-and-put-header-on-laravel-excel-export)'s a simple workaround for that.
| null | CC BY-SA 4.0 | null | 2023-03-04T02:59:34.623 | 2023-03-04T03:29:28.690 | 2023-03-04T03:29:28.690 | 5,057,757 | 5,057,757 | null |
75,633,605 | 2 | null | 69,160,914 | 0 | null | model.predict_on_batch will solve your problem.
| null | CC BY-SA 4.0 | null | 2023-03-04T04:15:53.857 | 2023-03-04T04:15:53.857 | null | null | 21,329,714 | null |
75,633,988 | 2 | null | 58,450,539 | 0 | null | [](https://i.stack.imgur.com/Il9tH.png)
You might have ufw enabled during command execution blocking SSH login.
1. Go to your VM instance and click it
2. Edit mode
3. Find for Management section
4. Look for Automation section
5. Inside the text box, type "ufw allow 22"
6. Save
7. Stop VM instance
8. Start VM instance
9. Here you go...! Access your SSH login!
| null | CC BY-SA 4.0 | null | 2023-03-04T06:10:41.727 | 2023-03-04T06:10:41.727 | null | null | 21,233,086 | null |
75,634,282 | 2 | null | 75,054,678 | 0 | null | You can easily change the style by creating a CSS file. The corresponding classes are provided in the npm documentation. another way is, you can inspect elements and change the styles of the corresponding element using your CSS.
add after every styles
[enter image description here](https://i.stack.imgur.com/oxG0N.png)
| null | CC BY-SA 4.0 | null | 2023-03-04T07:32:05.620 | 2023-03-04T07:32:05.620 | null | null | 17,645,447 | null |
75,634,566 | 2 | null | 63,979,186 | 0 | null | step 1 : close anaconda and vscode
step 2 : open command prompt (cmd) and uninstall jupyter lab
```
pip uninstall jupyterlab
```
step 3: now open jupyter lab type
```
jupyter-lab
```
Now open vs code jupyter notebook start working
| null | CC BY-SA 4.0 | null | 2023-03-04T08:45:00.743 | 2023-03-04T08:45:00.743 | null | null | 20,851,992 | null |
75,634,798 | 2 | null | 75,634,137 | 0 | null | When I run your code, there is no error. Make sure you have a clean environment and make sure your columns have the same types like this:
```
library(circlize)
circos.initializeWithIdeogram()
circos.genomicLink(fusion1, fusion2, col = "red", border = NA)
```

```
circos.clear()
```
[reprex v2.0.2](https://reprex.tidyverse.org)
| null | CC BY-SA 4.0 | null | 2023-03-04T09:36:49.223 | 2023-03-04T09:36:49.223 | null | null | 14,282,714 | null |
75,634,854 | 2 | null | 75,634,638 | 0 | null |
## How to Right Align IconButton
You can use `Expanded` to take up extra space in between.
```
const Padding(
padding: EdgeInsets.only(left: 10),
child: Text(
'samet',
textAlign: TextAlign.center,
style: TextStyle(fontSize: 16),
),
),
Expanded(child: Container()),
IconButton(
// padding: const EdgeInsets.only(left: 250),
onPressed: () {},
icon: const Icon(Icons.more_horiz),
iconSize: 30,
alignment: Alignment.centerRight,
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
),
],
```
| null | CC BY-SA 4.0 | null | 2023-03-04T09:50:05.043 | 2023-03-04T09:50:05.043 | null | null | 8,414,124 | null |
75,634,890 | 2 | null | 75,634,785 | 1 | null | Add `mainAxisSize: MainAxisSize.min,` in your `Column`
```
return InkWell(
onTap: press,
child: Container(
...
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min // add this line
children: [...]
)
)
);
```
Output:

| null | CC BY-SA 4.0 | null | 2023-03-04T09:56:06.887 | 2023-03-04T09:56:06.887 | null | null | 13,431,819 | null |
75,634,904 | 2 | null | 75,627,774 | 0 | null | ```
=INDEX(Dates,MATCH(MIN(ABS(Criteria-DateTimes)),ABS(Criteria-DateTimes),0))
```
| null | CC BY-SA 4.0 | null | 2023-03-04T09:57:44.997 | 2023-03-04T09:57:44.997 | null | null | 1,759,099 | null |
75,634,956 | 2 | null | 75,634,638 | 0 | null | Just wrap the `IconButton` inside the `Expanded`, and
to change the `color` of the `IconButton` use the `color` prop of `IconButton`.
Output:
[](https://i.stack.imgur.com/nGtrY.png)
Code:
```
Scaffold(
body: Row(
children: [
Padding(
padding: const EdgeInsets.only(left: 10, bottom: 10, top: 10),
child: ClipRRect(
borderRadius: BorderRadius.circular(100),
child: Image.asset(
'assets/images/avatars/boy.png',
height: 30,
width: 30,
fit: BoxFit.cover,
),
),
),
const Padding(
padding: EdgeInsets.only(left: 10),
child: Text(
'samet',
textAlign: TextAlign.center,
style: TextStyle(fontSize: 16),
),
),
Expanded(
child: IconButton(
// padding: const EdgeInsets.only(left: 250),
onPressed: () {},
icon: const Icon(Icons.more_horiz),
iconSize: 30,
alignment: Alignment.centerRight,
color: Colors.red,
),
),
],
),
),
```
| null | CC BY-SA 4.0 | null | 2023-03-04T10:10:25.940 | 2023-03-04T10:10:25.940 | null | null | 13,431,819 | null |
75,634,971 | 2 | null | 75,626,399 | 0 | null | It seems what happens currently is `https://cozy-stay.vercel.app/api` path requests go to the frontend server and not to your backend server as you expect:
```
Request URL: https://cozy-stay.vercel.app/api/all-places
Request Method: GET
Status Code: 404
Remote Address: 76.76.21.9:443
Referrer Policy: strict-origin-when-cross-origin
```
### Fix 01
You can use two vercel apps for the front-end and the backend:
- -
### Fix 02
You can run a load balancer to send all `/api` prefixed requests to the backend and others to the frontend. IDK this supported in vercel platform.
| null | CC BY-SA 4.0 | null | 2023-03-04T10:12:41.637 | 2023-03-04T10:12:41.637 | null | null | 8,510,405 | null |
75,634,996 | 2 | null | 75,634,303 | 0 | null |
## Unpivot (Excel Formula)
```
=LET(Data,A2:G6,
dRows,ROWS(Data)-1,dCols,(COLUMNS(Data)-1)/2,Cells,dRows*dCols,
rSeq,MOD(SEQUENCE(Cells,,0),dRows)+1,vSeq,ROUNDUP(SEQUENCE(Cells)/dRows,0),
rd,INDEX(DROP(TAKE(Data,,1),1),rSeq),hd,INDEX(TOCOL(DROP(TAKE(Data,1),,dCols+1)),vSeq),
vData,DROP(DROP(Data,1),,1),rev,TOCOL(TAKE(vData,,dCols)),pro,TOCOL(TAKE(vData,,-dCols)),
HSTACK(rd,hd,rev,pro))
```
| null | CC BY-SA 4.0 | null | 2023-03-04T10:16:47.453 | 2023-03-04T10:16:47.453 | null | null | 9,814,069 | null |
75,635,055 | 2 | null | 74,479,122 | 0 | null | Faced same problem as you did and that's how I solved it. Sorry for a late response, hoping it may help you and others.
Parent Adapter:
```
holder.parent_rec.setLayoutManager(new LinearLayoutManager(holder.itemView.getContext()));
holder.parent_rec.setHasFixedSize(true);
//Add one line of code here:
recyclerView.setTag(position);
holder.parent_rec.setAdapter(childItemAdapter);
```
Child Adapter:
```
private List<ChildItem> ChildItemList;
//Add this here:
int parentRecycleViewPosition;
.....your code here
ChildViewHolder obj=new ChildViewHolder(view);
//Add this here:
parentRecycleViewPosition = (int) parent.getTag();
.....your code here
```
I guess in your onBindViewHolder will be OnClickListener and in your OnClickListener use parentRecycleViewPosition as you wanted.
```
//Example(maybe not working one)
currentcard.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(view.getContext(), "ok you are a child of Parent postion " + parentRecycleViewPosition, Toast.LENGTH_SHORT).show();
}
});
```
Please! If you have anything to add - DO IT! Thank you!
| null | CC BY-SA 4.0 | null | 2023-03-04T10:28:18.417 | 2023-03-04T10:28:18.417 | null | null | 15,674,074 | null |
75,635,492 | 2 | null | 62,785,140 | 0 | null | A much faster method to get the DFT `X` of a sample sequence `xn` of length `N` is to use [the concise matrix form of the DFT](https://en.wikipedia.org/wiki/DFT_matrix). It is easily implemented with a numpy array and the `matmul` product function:
```
# Custom matrix
import numpy as np
k = np.arange(N)
M = np.exp(-2j * np.pi * k[:, None] * k / N)
X = np.matmul(xn, M)
```
The python `for` loops are replaced by [faster C loops internal to numpy](https://www.pythonlikeyoumeanit.com/Module3_IntroducingNumpy/VectorizedOperations.html) and possibly vectorization features of the CPU.
There is a scipy function, named `dft` which returns the same array, so you can save one line of code:
```
# Built-in matrix
import scipy.linalg as sl
M = sl.dft(N)
X = np.matmul(xn, M)
```
The next piece of code shows the perfect matching these methods and FFT:
[](https://i.stack.imgur.com/QnT00.png)
```
import numpy as np
import matplotlib.pyplot as plt
def show_peak_frequencies(ax, ff):
lims = ax.get_xlim()
tax = ax.twiny()
ticks = np.hstack([-ff, ff])
tax.set_xticks(ticks)
tax.set_xlim(lims)
tax.grid()
mag = lambda X: abs(sf.fftshift(X))
omega = lambda f: 2*np.pi * f
# Sampling parameters
N = 70
fs = 10
Ts = 1 / fs
max_t = (N-1) * Ts
# Signal components
ff = np.array([1, 2.5, 3.5]) # frequencies Hz
w1, w2, w3 = omega(ff)
# Continuous signal
t = np.linspace(0, max_t, 200)
x = lambda t: 2 * np.cos(w1*t) + np.cos(w2*t) + 0.5 * np.cos(w3*t)
xt = x(t)
# Actual samples
n = np.arange(N)
xn = x(n*Ts)
fig, axes = plt.subplots(ncols=2, squeeze=True, figsize=(9, 3), layout='constrained')
ax = axes[0]
ax.plot(t, xt, c='gray')
ax.stem(n*Ts, xn)
ax.set_title(f'Signal sampled at {1/Ts:0.2f}Hz')
ax.set_xlabel('t (s)')
# Built-in fft
import scipy.fft as sf
X1 = sf.fft(xn)
f = sf.fftfreq(N, Ts)
f = sf.fftshift(f)
# Built-in matrix
import scipy.linalg as sl
M2 = sl.dft(N)
X2 = np.matmul(xn, M2)
# Custom matrix
k = np.arange(N)
M3 = np.exp(-2j * np.pi * k[:, None] * k / N)
X3 = np.matmul(xn, M3)
ax = axes[1]
ax.plot(f, mag(X1), label='FFT', c='lime', lw=7, alpha=0.5)
ax.plot(f, mag(X2), label='scipy matrix', c='navy', lw=4, ls='--')
ax.plot(f, mag(X3), label='custom matrix', c='magenta')
show_peak_frequencies(ax, ff)
ax.set_xlabel('f (Hz)')
ax.legend()
```
| null | CC BY-SA 4.0 | null | 2023-03-04T11:51:56.600 | 2023-03-04T12:53:34.453 | 2023-03-04T12:53:34.453 | 774,575 | 774,575 | null |
75,635,517 | 2 | null | 75,602,046 | 0 | null | The way you're building the arguments looks correct to me, so perhaps the problem is the way you're using them. Make sure you're building and submitting your payload like this:
```
payload = EntryFunction.natural(
f"0x{contract_address}::message",
"set_message",
[],
[TransactionArgument(message, Serializer.str)],
)
signed_transaction = self.create_single_signer_bcs_transaction(
sender, TransactionPayload(payload)
)
return self.submit_bcs_transaction(signed_transaction)
```
You can find more examples of how to use the Python SDK here: [https://github.com/aptos-labs/aptos-core/tree/main/ecosystem/python/sdk/examples](https://github.com/aptos-labs/aptos-core/tree/main/ecosystem/python/sdk/examples).
| null | CC BY-SA 4.0 | null | 2023-03-04T12:00:00.643 | 2023-03-04T12:00:00.643 | null | null | 3,846,032 | null |
75,635,539 | 2 | null | 75,635,494 | 1 | null | You can map a dictionary over the 2 first letters of `sku` column:
```
coeffs = {'BA': 1.3, 'BE': 1.10}
df['NewColumn'] = df['bottlePrice'] * df['sku'].str[:2].map(coeffs).fillna(1)
print(df)
# Output
sku bottlePrice NewColumn
0 BA003 923.940 1201.1220
1 BA009 1306.260 1698.1380
2 BA013 1094.214 1422.4782
3 BE101 977.040 1074.7440
4 BE102 1350.864 1485.9504
5 BE103 2918.730 3210.6030
```
| null | CC BY-SA 4.0 | null | 2023-03-04T12:03:14.227 | 2023-03-04T12:03:14.227 | null | null | 15,239,951 | null |
75,636,028 | 2 | null | 38,188,449 | 0 | null | You can set the initial folder with the argument
```
tk.filedialog(initialdir="{some folder}")
```
But to restrict the useres selection path you could go an write your one costume
file selector with os and mirroring the files with a tkinter canvas.
I hope this helps somewhat
| null | CC BY-SA 4.0 | null | 2023-03-04T13:42:37.240 | 2023-03-04T13:42:37.240 | null | null | 13,490,787 | null |
75,636,119 | 2 | null | 75,633,751 | 0 | null | You have to figure out the postion of the words:
```
import pytesseract
from pytesseract import Output
import cv2
pytesseract.pytesseract.tesseract_cmd=r'C:\Program Files\Tesseract-OCR\tesseract.exe'
img = cv2.imread('Text.png')
d = pytesseract.image_to_data(img, output_type=Output.DICT)
#print(d.keys())
overlay = img.copy()
output = img.copy()
n_boxes = len(d['text'])
for i in range(18,25):
if int(d['conf'][i]) > 60:
(x, y, w, h) = (d['left'][i], d['top'][i], d['width'][i], d['height'][i])
# print((x, y, w, h))
img = cv2.rectangle(overlay, (x, y), (x + w, y + h), (0, 255, 0), -1)
alpha = 0.1
image_new = cv2.addWeighted(overlay, alpha, output, 1 - alpha, 0, output)
cv2.imshow('img', image_new)
cv2.waitKey(0)
cv2.destroyAllWindows()
```
Output:
[](https://i.stack.imgur.com/1esmb.png)
| null | CC BY-SA 4.0 | null | 2023-03-04T13:58:34.977 | 2023-03-04T13:58:34.977 | null | null | 12,621,346 | null |
75,636,771 | 2 | null | 32,022,580 | -1 | null | in `my.ini` check option `skip-networking` under `[mysqld]`. It should be off.
```
[mysqld]
skip-networking = OFF
```
| null | CC BY-SA 4.0 | null | 2023-03-04T15:47:23.877 | 2023-03-04T15:47:23.877 | null | null | 21,332,246 | null |
75,636,806 | 2 | null | 75,628,795 | 0 | null | I managed to fix this relatively easy after lots of experimentation.
Firstly, I made sure to reduce any noise in the data where possible, giving cleaner looking curves without sacrificing (too much) the sharpness of the peaks of interest. In my case, I increased the blur on the original image that the polar plot was made from.
Secondly, I took @BenVoigt's advice and switched to using a second derivative equation for calculating the "sharpness" of points along the curve. This gave more accurate readings across all points on the graph.
Then, I switched from using a mean average to a median average, this left the steeper, more curved parts of the graph with a distinctly greater median making the selection process much more accurate.
To help with testing, I also decreased the scale of the Y axis to make it easier to see what was happening, example below:
[](https://i.stack.imgur.com/smkAH.png)
| null | CC BY-SA 4.0 | null | 2023-03-04T15:53:35.390 | 2023-03-04T15:53:35.390 | null | null | 5,232,304 | null |
75,636,858 | 2 | null | 75,636,368 | -1 | null | maybe [this](https://stackoverflow.com/questions/59121072/is-there-a-way-of-making-the-active-tab-border-highlighted-on-top-instead-of-at)?
as you can see, the actual active pane is red, while the "active-but-unfocused" panes are blue.
```
"workbench.colorCustomizations":
{
"tab.activeBackground": "#ff0000",
"tab.unfocusedActiveBackground": "#012bff"
}
```
[](https://i.stack.imgur.com/TWrJW.png)
or this for a specific theme (Default Dark+)
```
"workbench.colorCustomizations":
{
"[Default Dark+]":
{
"tab.activeBackground": "#ff0000",
"tab.unfocusedActiveBackground": "#012bff"
}
}
```
| null | CC BY-SA 4.0 | null | 2023-03-04T16:00:56.937 | 2023-03-04T16:00:56.937 | null | null | 4,935,162 | null |
75,636,886 | 2 | null | 75,635,857 | 2 | null | When you make a CORS request (even a simple request like `$.get`) from a site on the public internet to a site in a "more private" address space like 127.0.0.1, a preflight request with `Access-Control-Request-Private-Network: true` is sent first, see [this blog](https://developer.chrome.com/blog/private-network-access-preflight/).
| null | CC BY-SA 4.0 | null | 2023-03-04T16:06:22.867 | 2023-03-04T16:06:22.867 | null | null | 16,462,950 | null |
75,637,054 | 2 | null | 54,750,737 | 0 | null | For Firestore just do document.toObject(Pojo.class)
wolah !
| null | CC BY-SA 4.0 | null | 2023-03-04T16:34:19.297 | 2023-03-04T16:34:19.297 | null | null | 13,797,899 | null |
75,637,117 | 2 | null | 70,730,338 | 0 | null | I'm using the exact same version and had the same issue. I tried changing the configuration, but it didn't work.
Eventually, I found this works for me -- right-click the Delphi exe, choose "Run as Administrator."
If the panels are still missing, try: run as administrator - open project - compile all - build all - debug.
Also, don't forget to set the project's Build Configurations to debug instead of release.
| null | CC BY-SA 4.0 | null | 2023-03-04T16:44:08.193 | 2023-03-04T16:44:08.193 | null | null | 21,332,443 | null |
75,637,119 | 2 | null | 75,633,619 | 0 | null | It's hard to say without seeing the whole page but one issue I see with your current locator is that you will return both SPANs in the posted HTML instead of just the first that contains "+2.5". You can further focus your CSS selector to just get the first span adding `:first-of-type`.
```
driver.find_elements(By.CSS_SELECTOR, '.book-cell__odds > span:first-of-type')
```
If that still doesn't get you what you want, you'll probably have to provide a link to the page.
More info on [:first-of-type](https://developer.mozilla.org/en-US/docs/Web/CSS/:first-of-type).
| null | CC BY-SA 4.0 | null | 2023-03-04T16:44:46.313 | 2023-03-04T16:44:46.313 | null | null | 2,386,774 | null |
75,637,157 | 2 | null | 38,188,449 | 0 | null |
```
import os
import tkinter as tk
from tkinter import ttk
class Filexplorer:
def __init__(self, root, dir):
self.root = root
self.root.title("RifloSnake")
self.tree = ttk.Treeview(self.root)
self.tree.pack(side="left", fill="y")
self.root.bind("<Return>", self.open)
self.tree.bind("<Double-Button-1>", self.open)
self.root.bind("<BackSpace>", self.back)
self.path = None
self.original_path = dir
self.open_folder(dir)
def open_folder(self, folder_path):
self.path = folder_path
self.tree.delete(*self.tree.get_children())
parent = self.tree.insert("", 0, text=self.path, open=True)
for item in os.listdir(self.path):
if os.path.isdir(os.path.join(self.path, item)):
self.tree.insert(parent, "end", text=item, open=False)
else:
self.tree.insert(parent, "end", text=item)
def open(self, event):
item = self.tree.focus()
if self.tree.item(item)["text"] == "..":
self.open_folder(os.path.abspath(os.path.join(self.path, os.pardir)))
elif os.path.isdir(os.path.join(self.path, self.tree.item(item)["text"])):
self.open_folder(os.path.join(self.path, self.tree.item(item)["text"]))
else:
os.startfile(os.path.join(self.path, self.tree.item(item)["text"]))
def back(self, event):
if self.path != self.original_path and self.path != self.original_path + '\\':
self.open_folder(os.path.abspath(os.path.join(self.path, os.pardir)))
```
```
root = tk.Tk()
app = Filexplorer(root, "specified-directory")
root.mainloop()
```
You can open the files by double-clicking or selecting it and pressing Enter, and go back upwards pressing Backspace.
| null | CC BY-SA 4.0 | null | 2023-03-04T16:50:44.860 | 2023-03-04T17:14:34.690 | 2023-03-04T17:14:34.690 | 20,959,773 | 20,959,773 | null |
75,637,329 | 2 | null | 54,844,447 | 0 | null | The same issue here but within an Objective-C project within an NSViewController.
I could resolve it with this call:
```
- (void)viewDidAppear
{
[super viewDidAppear];
[self.view.window makeFirstResponder: self];
}
```
| null | CC BY-SA 4.0 | null | 2023-03-04T17:20:37.713 | 2023-03-04T17:20:37.713 | null | null | 4,263,207 | null |
75,637,423 | 2 | null | 75,636,368 | 1 | null | At the time of this writing, changing the background colours of editors is not supported.
This was previously brought up as a feature-request, but it didn't receive enough community support, so that feature-request was closed: [Support color customizations for currently "active" editor or "focused" editor group #87083](https://github.com/microsoft/vscode/issues/87083). I'm prett sure it's okay to open a new, same feature-request. If you do, you can try to garner support for it by giving it visibility on other sites like reddit's r/vscode. If you do create a feature-request, please comment to add a link to it here for posterity.
There was a similar feature-request that got resolved instead by adding the ability to customize the colour of the tab handle for the focused editor using `tab.activeBackground` and `tab.unfocusedActiveBackground`: [Make the currently active editor more distinguishable from others #24586](https://github.com/Microsoft/vscode/issues/24586).
For your reference / learning purposes, I found that first GitHub issue ticket I linked as the first search result when googling "`github vscode issues color customizations editor focus background`".
| null | CC BY-SA 4.0 | null | 2023-03-04T17:35:36.707 | 2023-03-04T17:35:36.707 | null | null | 11,107,541 | null |
75,637,628 | 2 | null | 27,723,580 | 0 | null | Use "RUN command" (Ctrl+Shift+P on Windows)
[](https://i.stack.imgur.com/H5UUJ.png)
Then Use commands: `Use horizontal panel layout`
[](https://i.stack.imgur.com/Ykijd.png)
Command to change layout verticaly: `Use vertical panel layout`, or `Use automatic panel layout` to return default setting.
| null | CC BY-SA 4.0 | null | 2023-03-04T18:07:31.850 | 2023-03-04T18:07:31.850 | null | null | 6,021,496 | null |
75,637,889 | 2 | null | 75,627,774 | 0 | null | Here you cannot use an approximate search via `XMATCH/MATCH` for example, because the nearest could be in both directions, greater/lower than, so we need to go finding the minimum of the absolute differences. It cannot be used `MAXIFS`, because it is a [RACON function](https://exceljet.net/articles/excels-racon-functions) and at the time we invoke an operation in the range, such as `ABS`, it is not a range anymore.
Here is an array version (), it generates the entire result, (if this assumption is not valid, check below).
```
=LET(lk, A2:B4, in, A9:C13,lkA, INDEX(lk,,1), lkB,INDEX(lk,,2),inA,INDEX(in,,1),
inB, INDEX(in,,2), out, CHOOSECOLS(in,2,3), dates, MAP(lkA, lkB, LAMBDA(id,d,
LET(f, FILTER(inB, inA=id), XLOOKUP(MIN(ABS(d-f)), ABS(d-f), f)))),
CHOOSEROWS(out, XMATCH(dates, inB)))
```
Since the date to find can be an exact match, we cannot use, the following:
```
FILTER(out, (inA=id) * (ABS(d-inB) = MIN((inA=id) * ABS(d-inB)))
```
because there is not way to distinguish when the minimum difference is zero because it is an exact match from the case the minimum value was found for a the subset that is not equal to `id`. That is why we go with `XLOOKUP`. Here is the output:
[](https://i.stack.imgur.com/PGxAS.png)
Basically what is does is on each `MAP` iteration, it filters first to find the subset of dates for a given `id` (and name it `f`). Now we find the date with the minimum differences with respect to `d` for that specific subset. The result of `MAP` is named `dates`. Finally we just need to identify the rows that match the dates found. We use `CHOOSEROWS` for that, but you can also use `INDEX` as follows: `INDEX(out, XMATCH(d, inB),{1,2})` it is a matter of personal preferences.
For the case that there is no data for a given lookup . For example the row `5` ( is `D`) from the lookup data in the previous screenshot (notice in the range ends at row `4`), the `formula 1` produces an error. In order to prevent it, for a more general case you can use the following ():
```
=LET(lk,A2:B5,in,A9:C13,lkA,INDEX(lk,,1),lkB, INDEX(lk,,2),inA,INDEX(in,,1),
inB, INDEX(in,,2), out, CHOOSECOLS(in,2,3), dates, MAP(lkA, lkB, LAMBDA(id,d,
LET(f,FILTER(inB,inA=id,""),IF(@f="", "",XLOOKUP(MIN(ABS(d-f)),ABS(d-f),f))))),
IF(dates="", {"ID not Found",""}, INDEX(out, XMATCH(dates, inB),{1,2})))
```
Here we check for an empty set of `FILTER` using the third input argument of this function, so in case of error it returns the empty string. The condition: `IF(@f="", "",...)` treats this situation specially returning an empty set too. Then to return the output we use an `IF` condition to treat this case as `"ID not found"`. The rest is about the same. Note: Here we need to use `INDEX`, because `CHOOSEROWS` produces an error.
Here is the output:
[](https://i.stack.imgur.com/COS4y.png)
| null | CC BY-SA 4.0 | null | 2023-03-04T18:47:13.733 | 2023-03-04T18:47:13.733 | null | null | 6,237,093 | null |
75,638,160 | 2 | null | 17,237,812 | 0 | null | When the Bootstrap tables is rendered first, you should use the [event](https://datatables.net/reference/event/draw), and then execute columns.adjust():
```
table.on( 'draw', function () {
table.columns.adjust();
} );
```
The draw event is executed when the jquery datatable is already rendered.
`columns.adjust()` adjusts the size of the columns.
| null | CC BY-SA 4.0 | null | 2023-03-04T19:26:20.260 | 2023-03-04T19:26:20.260 | null | null | 9,292,207 | null |
75,638,599 | 2 | null | 75,634,124 | 0 | null | One option is to iterate setting row sums to 1 then setting column sums to 1. This fails if there is any column or row summing to zero. If only one item is set in any row it forces a lot of zeros and may not converge instead alternating between two states. See the last example.
```
import numpy as np
def normalise( arr, loops = 30 ):
""" arr is the original array
loops is to count how many times to iterate before giving up.
"""
calc = arr.copy()
col_sum = calc.sum( axis = 0 ) # Sum each column
for i in range( loops ):
calc = calc / col_sum # Normalise each column to sum to 1.
row_sum = calc.sum( axis = 1 ) # Sum each row
calc = calc / row_sum[ :, None ] # Normalise each row.sum() to 1.
col_sum = calc.sum( axis = 0 ) # Sum each column
if np.all( np.isclose( col_sum, 1., atol = 1e-10, rtol = 1e-10 )):
break # Exit loop if each column sums close to 1.
return calc
```
The `isclose` tolerances can be chosen for however close to 1. is acceptable.
```
matrix = np.array( [[0, 1, 0 ,1, 0],
[1, 0, 0, 1, 0],
[0, 0, 0, 1, 1],
[1, 1, 1, 0, 1],
[0, 0, 1, 1, 0]] )
normalise( matrix )
# array([[0. , 0.75, 0. , 0.25, 0. ],
# [0.75, 0. , 0. , 0.25, 0. ],
# [0. , 0. , 0. , 0.25, 0.75],
# [0.25, 0.25, 0.25, 0. , 0.25],
# [0. , 0. , 0.75, 0.25, 0. ]])
```
This shows a problem:
```
mat1 = np.array( [[0, 1, 0 ,1, 0], # = 2
[1, 0, 0, 1, 0], # = 2
[0, 0, 0, 1, 0], # = 1 !!
[1, 1, 1, 0, 1], # = 4
[0, 0, 0, 1, 0]] ) # = 1 !!
# Sums to 2 2 1 4 1
normalise( mat1 )
# array([[ 0., 1., 0., ~0.0, 0. ], = 1.
# [ 1., 0., 0., ~0.0, 0. ], = 1.
# [ 0., 0., 0., 1.0, 0. ], = 1.
# [~0.0, ~0.0, 0.5, 0.0, 0.5], = 1.
# [ 0., 0., 0., 1.0, 0. ]]) = 1.
# Sums 1. 1. 0.5 2.0 0.5
```
Next 50% iteration
```
# array([[ 0., 1., 0., ~0.0, 0. ], = 1.
# [ 1., 0., 0., ~0.0, 0. ], = 1.
# [ 0., 0., 0., 0.5, 0. ], = 0.5
# [~0.0, ~0.0, 1., 0.0, 1. ], = 2.
# [ 0., 0., 0., 0.5, 0. ]]) = 0.5.
# Sums 1. 1. 1. 1. 1.
```
Each iteration alternates between these two states
| null | CC BY-SA 4.0 | null | 2023-03-04T20:54:46.027 | 2023-03-04T20:54:46.027 | null | null | 7,153,928 | null |
75,638,768 | 2 | null | 75,638,745 | 1 | null | I would post a reply, as this is not actually an answer, but I don't have enough rep...
If you have the possibility of editing the HTML, I would suggest doing something like this:
```
<div class="wrapper">
<div class="my-icon" data-category="1" style="width: 50%;"></div> <!--image-->
<div style="width: 50%:">abc</div>
</div>
```
use classes instead of inline css ofcourse.
Otherwise [here](https://developer.mozilla.org/en-US/docs/Web/CSS/background-position) is an example of setting offset with percentages and statements (left, right). So something along the lines of `background-position: 50% center;`
| null | CC BY-SA 4.0 | null | 2023-03-04T21:27:22.560 | 2023-03-04T21:41:55.963 | 2023-03-04T21:41:55.963 | 13,044,377 | 13,044,377 | null |
75,638,822 | 2 | null | 75,638,709 | 2 | null | `result` is a value of type `bytes`, which represents a series of integer values between 0 and 255, inclusive.
When you display the each byte is show in one of two forms:
1. If the byte corresponds to a printable ASCII character, it is shown as that character.
2. Otherwise, it is shown as a hexadecimal integer prefixed with \x.
Iterating over a `bytes` value yields a sequence of `int` objects:
```
>>> list(result)
[104, 65, 223, 1, 60, 66, 223, 1, 185, 9, 186, 9]
```
(Note that `ord('h') == 104`, `ord('A') == 65`, `\xdf == 223`, etc.)
As mentioned in the comments, the `struct` package can be used to extract "usable" objects from a raw `bytes` value. For example, one could treat these 12 bytes as 3 unsigned 4-byte words in big-endian byte order:
```
>>> import struct
>>> struct.unpack(">III", result)
(1749147393, 1011015425, 3104422409)
```
or 6 unsigned 2-byte words in little-endian byte order:
```
>>> struct.unpack("<HHHHHH", result)
(16744, 479, 16956, 479, 2489, 2490)
```
| null | CC BY-SA 4.0 | null | 2023-03-04T21:37:33.090 | 2023-03-04T21:37:33.090 | null | null | 1,126,841 | null |
75,638,924 | 2 | null | 75,638,745 | 1 | null | Your HTML and CSS seems incomplete. I assume your icons are wrapped in a parent element, so I wrapped your icons in a `.my-element` div.
Using background-image to position elements and their backgrounds relative to a parent is very tricky. I would suggest using CSS Grid to position icons. Here's an example using `display: grid`
```
.my-element {
position: relative;
display: grid;
grid-template-columns: 1fr 1fr;
width: 200px;
height: 80px;
border: 3px solid black;
text-align: right;
padding: 0px 20px 0px 0px;
font-size: 38px;
}
.my-icon {
color: white;
font-size: 18px;
}
.my-icon[data-category="1"] {
grid-area: 1/1;
background-image: url(https://picsum.photos/450/332);
border: 2px solid green;
margin: 10px;
}
.my-icon[data-category="2"] {
grid-area: 1/1;
background-image: url(https://picsum.photos/40/40);
height: 40px;
width: 40px;
border: 2px solid red;
margin: auto;
}
```
```
<div class="my-element">
abc
<div class="my-icon" data-category="1">def</div>
<div class="my-icon" data-category="2">ghi</div>
</div>
```
| null | CC BY-SA 4.0 | null | 2023-03-04T21:57:07.217 | 2023-03-04T21:57:07.217 | null | null | 14,148,586 | null |
75,639,010 | 2 | null | 48,489,285 | 0 | null | I had the same problem,and I discovered was sending a json body from postman while a text option was selected instead of a json.[](https://i.stack.imgur.com/KV8Pw.png)
| null | CC BY-SA 4.0 | null | 2023-03-04T22:16:36.597 | 2023-03-04T22:16:36.597 | null | null | 8,966,606 | null |
75,639,175 | 2 | null | 75,497,515 | 0 | null | I used the following to redirect certain pages:
```
[
{
"Condition": {
"KeyPrefixEquals": "category/data-science"
},
"Redirect": {
"HostName": "john.soban.ski",
"Protocol": "https",
"ReplaceKeyWith": "cat/data-science.html"
}
},
{
"Condition": {
"KeyPrefixEquals": "category/coins"
},
"Redirect": {
"HostName": "john.soban.ski",
"Protocol": "https",
"ReplaceKeyWith": "cat/coins.html"
}
},
{
"Condition": {
"KeyPrefixEquals": "category/ietf"
},
"Redirect": {
"HostName": "john.soban.ski",
"Protocol": "https",
"ReplaceKeyWith": "cat/ietf.html"
}
},
{
"Condition": {
"KeyPrefixEquals": "category/howto"
},
"Redirect": {
"HostName": "john.soban.ski",
"Protocol": "https",
"ReplaceKeyWith": "cat/howto.html"
}
}
]
```
| null | CC BY-SA 4.0 | null | 2023-03-04T22:54:04.270 | 2023-03-04T22:54:04.270 | null | null | 8,570,881 | null |
75,639,188 | 2 | null | 75,630,244 | 0 | null | Best references for ranking: [https://www.graphviz.org/pdf/dotguide.pdf](https://www.graphviz.org/pdf/dotguide.pdf) (esp. p. 7 & 15) and [https://www.graphviz.org/docs/attrs/rank/](https://www.graphviz.org/docs/attrs/rank/)
All-in-all not a Graphviz strength. I do not use Diagrammer, but the Graphviz code below will probably translate pretty easily.
```
digraph N{
splines=false // straight line edges
rankdir=TB // same as default
nodesep=1.2
ranksep=.2
node [shape=rect]
// set these nodes one per rank
mm1 -> mm2 [style=invis]
mm2 -> mm3 [style=invis]
xxxx -> mm1:w
xxxx -> mm2:w
xxxx -> mm3:w
mm1:e -> yyyy
mm2:e -> yyyy
mm3:e -> yyyy
{
rank=source // these nodes on the top. use rank=sink if you want these nodes on bottom
// bogus node is needed to keep left-right symmetry, not sure why
bogus [style=invis shape=plain]
xxxx -> yyyy
xxxx -> bogus [style=invis]
bogus -> yyyy [style=invis]
}
}
```
Giving:
[](https://i.stack.imgur.com/WG5PE.png)
| null | CC BY-SA 4.0 | null | 2023-03-04T22:57:44.190 | 2023-03-04T22:57:44.190 | null | null | 12,317,235 | null |
75,639,264 | 2 | null | 75,633,619 | 0 | null | Given the HTML:

The value is within the first desendant `<span>` of it's parent `<div>`
---
## Solution
To print the text ideally you need to induce [WebDriverWait](https://stackoverflow.com/a/59130336/7429447) for the [visibility_of_element_located()](https://stackoverflow.com/a/50474905/7429447) and you can use either of the following [locator strategies](https://stackoverflow.com/a/48056120/7429447):
- Using , `first-child` and attribute:```
print(WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.CSS_SELECTOR, "div.book-cell__odds > span:first-child"))).text)
```
- Using , `first-of-type` and `get_attribute("innerHTML")`:```
print(WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.CSS_SELECTOR, "div.book-cell__odds > span:first-of-type"))).get_attribute("innerHTML"))
```
- : 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
```
> You can find a relevant discussion in [How to retrieve the text of a WebElement using Selenium - Python](https://stackoverflow.com/a/55241232/7429447)
| null | CC BY-SA 4.0 | null | 2023-03-04T23:15:58.343 | 2023-03-04T23:15:58.343 | null | null | 7,429,447 | null |
75,639,375 | 2 | null | 74,121,080 | 0 | null | the value cannot be null , just add the question mark
[https://api.flutter.dev/flutter/dart-io/Stdin/readLineSync.html](https://api.flutter.dev/flutter/dart-io/Stdin/readLineSync.html)
modify this line and normally is done
String? name = stdin.readLineSync()!;
| null | CC BY-SA 4.0 | null | 2023-03-04T23:44:13.750 | 2023-03-04T23:44:13.750 | null | null | 21,333,815 | null |
75,639,408 | 2 | null | 44,633,378 | 0 | null | Go to in Pycharm / your IDE environment and change the package versions or install them in these versions.
opencv-contrib-python == 4.4.0.46
opencv-python == 4.1.2.30
Check Screenshot for clarity.
[](https://i.stack.imgur.com/4sTtA.png)
| null | CC BY-SA 4.0 | null | 2023-03-04T23:51:24.840 | 2023-03-04T23:51:24.840 | null | null | 13,139,873 | null |
75,639,768 | 2 | null | 75,639,708 | 1 | null | If a solution using interests you at all, this does what you outline I think:
```
library(dplyr)
f <- function(.data,...){
.data %>%
mutate(v_sample = sample(x = v,size = n(),replace = TRUE),
y_sample = (v_sample / x^2) - (1/x),
rand_cor = cor(y_sample,x,use = 'complete.obs'))
}
rep_f <- function(.data,n = 9,...){
replicate(n = n,expr = f(.data),simplify = FALSE)
}
df %>%
group_by(sp) %>%
group_map(.f = ~rep_f(.x,n = 9)) %>%
bind_rows()
```
Note that the way you've set up the data, `cor()` throws lots of warnings due to constant data so you get a sd of zero.
| null | CC BY-SA 4.0 | null | 2023-03-05T01:46:58.763 | 2023-03-05T01:57:36.673 | 2023-03-05T01:57:36.673 | 324,364 | 324,364 | null |
75,639,769 | 2 | null | 75,639,708 | 1 | null | We can `split` the data, then run your UDF on each `sp`, and wrap the results by `rbindlist`. Maybe there's an approach using group `by` but I couldn't figure it out.
```
rbindlist(
lapply(split(df, df$sp), function(dat)
rbindlist(
lapply(1:9, function(i) dat[, .(f(x, v), x, v, sp)][, i:=i])
)
)
)
```
```
#> v.sample y.sample rand.cor X V SP i
#> 1: 1 0.000000e+00 NA 1 1 A 1
#> 2: 1 0.000000e+00 NA 1 1 A 1
#> 3: 1 0.000000e+00 NA 1 1 A 1
#> 4: 1 0.000000e+00 NA 1 1 A 1
#> 5: 1 0.000000e+00 NA 1 1 A 1
#> ---
#> 176: 44 -1.824000e-03 -0.311902 500 60 D 9
#> 177: 80 -1.147952e-03 -0.311902 782 80 D 9
#> 178: 123 -2.027175e-03 -0.311902 234 123 D 9
#> 179: 123 -6.503642e-05 -0.311902 124 44 D 9
#> 180: 55 -1.595100e-03 -0.311902 566 55 D 9
```
| null | CC BY-SA 4.0 | null | 2023-03-05T01:46:59.403 | 2023-03-05T01:46:59.403 | null | null | 6,461,462 | null |
75,639,891 | 2 | null | 75,571,970 | 0 | null | You need to make sure that you are installing your modules on the same python installation as you are running your code.
If you are running your code with python file.py, then try doing python -m pip install discord
If you are running your python via python3, or py3, or otherwise (if you haven't try these alternatives), and then use that instead. You are likely using a pip that is not on the installation that you are executing your code base in.
You might be using a py launcher that's getting you in trouble too.
Try `py -3.11 -m pip install []` for the installs to see if that helps.
| null | CC BY-SA 4.0 | null | 2023-03-05T02:30:01.963 | 2023-03-05T02:30:01.963 | null | null | 6,636,350 | null |
75,639,916 | 2 | null | 75,639,846 | 1 | null | To add color to the histograms in ggplot and facet_wrap, you can use the fill argument in the geom_histogram function to specify the color for each histogram. Here's an example code:
```
ObesityDataSet_raw_and_data_sinthetic %>%
ggplot(aes(x=Height, fill=Gender)) +
geom_histogram(bins = 14, alpha=0.5, position = "identity")+
facet_wrap(~Gender)
```
| null | CC BY-SA 4.0 | null | 2023-03-05T02:40:25.087 | 2023-03-05T02:40:25.087 | null | null | 21,331,901 | null |
75,640,036 | 2 | null | 75,639,846 | 0 | null | In order to manually specify the colours of the histogram add the last line to Ilia Tetin's code:
```
ObesityDataSet_raw_and_data_sinthetic %>%
ggplot(aes(x=Height, fill=Gender)) +
geom_histogram(bins = 14, alpha=0.5, position = "identity")+
facet_wrap(~Gender) +
scale_fill_manual(values=c("blue", "red"))
```
| null | CC BY-SA 4.0 | null | 2023-03-05T03:29:28.130 | 2023-03-05T03:29:28.130 | null | null | 19,496,867 | null |
75,640,061 | 2 | null | 75,640,024 | 0 | null | There are several issues with your code.
Once you start the processing in a thread, you should wait for it to complete. You can do this by calling the `join()` method on the thread.
But, this will cause the main thread to wait for the result before processing the next user-inputted string.
Next, you aren't handling multiple inputs from the user. This again depends on how you want to handle the threads.
1. If you want to create one thread for each input and okay to wait till the processing is done, you can print the result (map contents) after the thread has completed its work.
2. If you don't want to be blocked by the thread, then you have to start the threads, store the reference to them in a list and then wait for their completion at the end. You also have to create one map instance for each thread and store them as well so that you can print all of them at the end. (As a more advanced approach) You can also use an ExecutorService to submit multiple tasks and wait for their completion. If you are interested, you can search about this.
To keep it simple, assuming you want to create a thread for processing and will wait for it to complete before moving to process the next input, you can change your code as,
```
for (int i = 0; i < n; i++) {
String s = sc.next();
HashMap<Character, Integer> map = new LinkedHashMap<>();
Occurrence o = new Occurrence(s, map);
o.start();
o.join();
for (Map.Entry<Character, Integer> entry : map.entrySet()) {
System.out.println(entry.getKey() + "" + entry.getValue());
}
}
```
You can notice several modifications:
1. I've used a LinkedHashMap to maintain the insertion order (as per your requirement). Also, creating one new map for each input processing.
2. Calling o.join() to wait for the thread to complete.
3. Moved the for loop to print the map contents inside the first for loop. When you have a char + int, it will convert the character to an integer and perform numeric addition. To avoid it, I've concatenated the character with an empty string. Or you can call .toString() on the Character instance as well.
4. Renamed the occurence class as Occurrence to follow Java's naming convention.
Finally, don't close the `Scanner` backed up by `System.in`.
| null | CC BY-SA 4.0 | null | 2023-03-05T03:42:08.950 | 2023-03-05T03:42:08.950 | null | null | 4,405,757 | null |
75,640,338 | 2 | null | 75,631,157 | 0 | null | Excel can have all kinds of weird formatting that throws things off during the import process. You should save your Excel file as a CSV file, and import the CSV.
```
bulk insert yourtable from 'C:\file.csv'
with ( FIELDTERMINATOR =',', FIRSTROW = 2 )
```
Or, if you are open to a VBA solution to move data from your Excel file to your SQL Server database, run the code below.
```
Sub testexportsql()
Dim Cn As ADODB.Connection
Dim ServerName As String
Dim DatabaseName As String
Dim TableName As String
Dim UserID As String
Dim Password As String
Dim rs As ADODB.Recordset
Dim RowCounter As Long
Dim NoOfFields As Integer
Dim StartRow As Long
Dim EndRow As Long
Dim ColCounter As Integer
Set rs = New ADODB.Recordset
ServerName = "server_name" ' Enter your server name here
DatabaseName = "db_name" ' Enter your database name here
TableName = "table_name" ' Enter your Table name here
UserID = "" ' Enter your user ID here
' (Leave ID and Password blank if using windows Authentification")
Password = "" ' Enter your password here
NoOfFields = 10 ' Enter number of fields to update (eg. columns in your worksheet)
StartRow = 2 ' Enter row in sheet to start reading records
EndRow = 100 ' Enter row of last record in sheet
' CHANGES
Dim shtSheetToWork As Worksheet
Set shtSheetToWork = ActiveWorkbook.Worksheets("sheet_name")
'********
Set Cn = New ADODB.Connection
Cn.Open "Driver={SQL Server};Server=" & ServerName & ";Database=" & DatabaseName & _
";Uid=" & UserID & ";Pwd=" & Password & ";"
rs.Open TableName, Cn, adOpenKeyset, adLockOptimistic
'EndRow = shtSheetToWork.Cells(Rows.Count, 1).End(xlUp).Row
For RowCounter = StartRow To EndRow
rs.AddNew
For ColCounter = 1 To NoOfFields
rs(ColCounter - 1) = shtSheetToWork.Cells(RowCounter, ColCounter)
Next ColCounter
Debug.Print RowCounter
Next RowCounter
rs.UpdateBatch
' Tidy up
rs.Close
Set rs = Nothing
Cn.Close
Set Cn = Nothing
End Sub
```
Or, simply run the code below in SQL Server.
```
Export data from Excel to existing SQL Server table (edited)
Insert into SQLServerTable Select * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\testing.xls;HDR=YES',
'SELECT * FROM [SheetName$]')
```
| null | CC BY-SA 4.0 | null | 2023-03-05T05:13:49.063 | 2023-03-05T05:13:49.063 | null | null | 5,212,614 | null |
75,640,388 | 2 | null | 75,552,648 | 0 | null | I figured out a work-around.
I created a second README file, and then added to my setup.cfg of the python project the second, PYPI friendly, README.
Then I added an additional test to my pipeline which ensured that there is no diff between those files after the logo section by ensuring that this diff is empty:
`diff <(tail -n +8 README.md) <(tail -n +3 README_PYPI.md)`
| null | CC BY-SA 4.0 | null | 2023-03-05T05:32:54.587 | 2023-03-05T05:32:54.587 | null | null | 2,320,469 | null |
Subsets and Splits