instruction stringlengths 0 30k ⌀ |
|---|
Array related question, cant find the pattern |
|arrays| |
null |
So first of all what we're talking about here is not strictly the CQRS pattern, but designing of the domains. Where does the "user" end, and where does the "student" (who's also a "user") start. Encapsulation of logic, stuff like that. Domain-driven development says "hello" :)
First things first.
> Right now what... |
Selenium error: java.awt.AWTException: headless environment |
|java|selenium-webdriver|selenium-chromedriver|devtools| |
null |
|active-directory|windows-server|papercut| |
You could try this approach using a helper `struct FontModel` to
hold the font results and make it easier to use in the `ForEach` loop.
struct ContentView: View {
var body: some View {
AddFontStyleItems(DrawModel(curFont: "Helvetica"))
}
}
// for testing
... |
while in a specific page i need to know the name of the page, which was set by named routes. i could know with normal 'context', but i couldn't do using global context.
my code:
```
// ModalRoute.of(context)?.settings.name with global context, trying!
import 'package:flutter/material.dart';
void main(){runAp... |
This is an android project and I need to load a website in a webview.
And one more request here is the website needs to be loaded in a iframe.
This is done by the following step:
1. create a webview
2. I have a sample html file
3. I load my sample html file
4. I call `wewbview.loadHTMLString(sampleHtmlString,... |
I am fetching birt report using RE API using birt engine in struts2, working fine but pagination
navbar is not showing on reports. please give suggestion with example in java.
I have .rptdesign File which is runnable file. i don't have IReportDocument type file. due to which "org.eclipse.birt.report.engine.api.Eng... |
how to get using RE API for birt report in struts2, trying to render birt report with pagination(paginated html) with navbar |
|javascript|java|pagination|struts2|birt| |
null |
I have a left section menu with a list that has pagination implemented. Now I am unsure as to how to handle a situation when the list updates and a new item is added to the top of the current list or multiple new items are added to the top of the list, how do I handle this scenario so that I am still on the selected it... |
Handling selected item in a list with pagination on autoupdating the list in a react app ui |
|javascript|reactjs|user-interface|user-experience| |
null |
I have trained my model with
```python
import tensorflow as tf
import os
from keras.models import Model
from keras.layers import Input, Conv2D, MaxPooling2D, UpSampling2D, Conv2DTranspose
from keras.layers import concatenate, BatchNormalization, Dropout, Lambda
from tensorflow.keras import backend as K
os.env... |
Can't load Keras model with Custom objects trained on Kaggle TPU |
If necessary add to `housing_labels['median_house_value']` all missing indices starting with `0` and maximal index and set to `0` first and then use advanced numpy indexing `b[idx]` with `np.median`:
maximal = housing_labels.index.max()
b = housing_labels['median_house_value'].reindex(range(maximal+1), fill... |
how to check google sing in token is expired or not |
hope you are well. My code is not working properly and I have no idea what is wrong or how to fix it.
I only know that when I add the numbers for a square or rectangle it shows that my shape is a parallelogram.
I have tried my code and the output is showing incorrectly.
I have also looked at you tube videos but... |
Hello StackOverflow community,
I'm encountering issues while attempting to generate PDFs using Playwright within a Docker container for my AdonisJS application. Despite successful local development, I faced challenges with Dockerizing the project and encountered issues with TailwindCSS styles not rendering correctly... |
Since you're discarding things after 11pm, we can do this:
```r
library(dplyr)
library(tidyr) # unnest
doseq <- function(z) {
z <- as.integer(z)
if (length(z) > 1) {
if (z[2] < z[1]) z[2] <- 23
z <- (1+z[1]):z[2]
}
z
}
df1 |>
mutate(time = lapply(strsplit(time, "-"), doseq)) |>
unnes... |
null |
If you try to implement a `ListStyle`, you can let Xcode add stubs for protocol conformance. You will then see, that the required functions all start with `_`. This is a clue, that you're not really supposed to be implementing your own `ListStyle`.
However, you might be able to achieve what you're after by creating ... |
You could try:
lapply(
my_list,
\(x) if ('col3' %in% names(x)) transform(x, col3 = replace(col3, is.na(col3) & tolower(col1) %in% c('v2', 'v3'), 'VAL')) else x
)
Output:
[[1]]
col1 col2 col3 col4
1 v1 wood cup <NA>
2 v2 <NA> VAL pear
3 v3 wate... |
Alert! I am feeling so embarassed asking such an entry level question here!!!!
Hey guys, I have been working on a project that involves timeseries total electron content data. My goal is to apply statistical analysis and find anomalies in TEC due to earthquake.
I am following [this research paper for sliding IQR... |
You can build two masks, one to identify the Role change, and one to identify the difference of index above threshold:
```
m1 = df.Role!= df.Role.shift()
m2 = df['Index'].diff().gt(5)
out = df.groupby((m1|m2).cumsum()).agg(
Role = ('Role', 'first'),
Name = ('Name', ' '.join),
... |
Exclude blank cells from weighted average in pivot table |
Im developping a web app using reactjs and nextjs. When i run it in dev mode, my ram is used up 100%. Im having a 12gb ram and almost 6gb is used up by node js runtime. My colleague has a 24gb ram and when he run it, node js uses almost 15gb ram. When a modification is done to the code, the node js runtime uses up 100%... |
My React Nextjs web app is using up 100% of my ram and crashing when i try to do changes. Does anyone know how to fix this or what may be the cause? |
|reactjs|node.js|memory-leaks|out-of-memory| |
null |
I have been working on a classifier for a few days on Azure Auto ML and when I tried disabling some variables that I do not need, I encountered the below error.
I have never encountered this type of error before. Even after creating a new dataset with just the variables I am interested in, the error persists. I need ... |
Correcting the Database URL worked for me. |
I want to set axisItems to a PlotItem useing pyqtgraph, I encountered an error while running my code.
Here is my code:
```
import numpy as np
import pyqtgraph as pg
app = pg.mkQApp("app")
x = np.linspace(0, 10, 1000)
y = np.sin(x)
plot_item = pg.PlotItem()
plot_item.setAxisItems(axisItems={'bottom'... |
This works well, though the blur was a bit abrupt with a larger blur and a 1s Swiper speed. In my case, I also used a transition to match the speed:
.swiper-slide {
filter: blur(40px);
transition: 1s filter linear;
}
.swiper-slide-active {
filter: blur(0);
} |
check your babel.config.js has the runtime set to automatic
"plugins": [
["@babel/plugin-transform-react-jsx", {
"runtime": "automatic"
}] |
import tensorflow as tf
from keras.preprocessing.sequence import Tokenizer
from keras.utils import pad_sequences
# Set parameters
vocab_size = 5000
embedding_dim = 64
max_length = 100
trunc_type='post'
padding_type='post'
oov_tok = "<OOV>"
training_size = len(proc... |
|python-3.x|regex|string|list-comprehension|python-3.12| |
`If you've previously installed create-react-app globally via npm install -g create-react-app, we recommend you uninstall the package using npm uninstall -g create-react-app or yarn global remove create-react-app to ensure that npx always uses the latest version` As mentioned in their docs.
Doc Link :- https://creat... |
My drawables are on the folder drawable-xxhdpi and the background size is 1080 x 1920.
For the screens with this resolution, all is OK.
But when I test on a samsung A34 for example with the resolution 1080 X 2340, I have a black strip under my screen game and I don't know how to scale my background and the position... |
I have an Angular HTML document for a `product catalog` page.
products.componet.ts:
```js
showCategories = true;
showProductsInCategoriesSwitcher = true;
showProductsAll = false;
showProductsInCategories = false;
fetchingProducts = false;
showProductsByCategory(categoryId: string) {
this.showCategori... |
null |
You could use `labeller` per below to suppress the `layout_order`.
(It is better if you can supply a small amount of sample data with the question.)
``` r
library(tidyverse)
df <- tibble(
Time = 1:8,
nPVI = 21:28,
Group = rep(letters[1:4], 2),
Participant = 1:8,
layout_order = 1:8
)
df$la... |
I can't add constructor in my event listener.Laravel 11 there is no EventService provider also. I need an example for this
```
public function handle(NewUserEvent $event): void
{
Mail::send('3_Emails.1_CommonMailTemplate', $mailData, function ($message) use ($Name, $Email) {
$message->to... |
null |
Check your network tab in your browser to ensure your scripts are downloaded |
Alert! I am feeling so embarassed asking such an entry level question here!!!!
Hey guys, I have been working on a project that involves timeseries total electron content data. My goal is to apply statistical analysis and find anomalies in TEC due to earthquake.
I am following [this research paper for sliding IQR... |
I write code for the ESP32 microcontroller.
I set up a class named "dmhWebServer".
This is the call to initiate my classes:
An object of the dmhFS class is created and I give it to the constructor of the dmhWebServer class by reference. For my error see the last code block that I posted. The other code block could ... |
This problem is often called 'assigning agents to tasks'. There are several algorithms that can solve this. I use the Ford-Fulkerson Maximum Flow Algorithm ( theory.stanford.edu/~tim/w16/l/l1.pdf )
The trick is, as always, adapting the algorithm to your particular constraints so that the max flow algorithm operates ... |
I've got a React component that I have made aware of its own width using ResizeObserver. Inside this component I'm rendering two divs, each one is "flex: 1" so they take equal width. When the component is small enough and certain state conditions are met, I set "display: none" on the first div, allowing the second to t... |
Width aware React component rendering twice |
|javascript|html|css|reactjs| |
I am using Linux (Ubuntu 22.04) and wanted to run `gitlab-runner` with the following YAMK file locally:
```yaml
image: ubuntu:latest
test:
script:
- echo "Hello Gitlab-Runner"
```
When I execute `gitlab-runner exec docker test`, I get the following error:
```
Running with gitlab-runner 11.2.0 (11... |
I have a problem with `drop_na()` function. I wanted to clean the dataset and erase the "NA" values, but when I entered the code, all datas are disseapperad. I do not understand why it happens. note:Im beginner level.
[You can see clearly what my codes are in this picture](https://i.stack.imgur.com/ORaUW.png... |
null |
--Remove Duplciates[SKR]
--Option A:
select *
--delete t
from(
select rowNumber=row_number() over (partition by SomeKey order by SomeKey), SomeKey from YourTable m
)t where rowNumber > 1
--Option B:
with cte as (
select rowNumber=row_number() over (partition by SomeKey order by SomeKey), SomeK... |
null |
null |
null |
null |
null |
The part of the code giving me the error is borrowed from research on how to find a specific value, match it to a value on another worksheet and delete that row of data. The code has multi tasks to complete:
1. Copy the row on sheet22 and paste it to the next empty row on
sheet13
2. Find a match to Sheet22 c... |
You can use it mock library for testing file upload;
```
from unittest.mock import MagicMock
from django.core.files import File
mock_image = MagicMock(file=File)
mock_image.name="sample.png"
# Another test operations...
def test_file_upload(self):
# file_content is a bytest object
request = cli... |
null |
try to use
pipwin install gdal
and then rasterio, etc. This worked for me! |
I am learning vhdl and fpga, I have a digilent board Nexys 4. I am trying to send via UART a string. I have been sucessful in sending a character every time a button is clicked on the board.
Now I want to send the whole string after every button click, but I don't get any output from the terminal (I use putty). What... |
Whenever you have a [mapped type](https://www.typescriptlang.org/docs/handbook/2/mapped-types.html) of the form `{[K in keyof T]: ⋯}`, with `in keyof` in there directly, it will be a *homomorphic mapped type* as described in https://stackoverflow.com/q/59790508/2887218. That means [`readonly`](https://www.typescriptlan... |
Here is my code:
```
import csv
def addr():
with open('csvfile.csv','a',newline='') as f:
w=csv.writer(f,delimiter=',')
tid=int(input('Teacher ID: '))
nm=input('Enter Name: ')
mo=int(input('Mobile Number: '))
w.writerow(tid,nm,mo)
def countr():
with open('csvfi... |
I try to have a button to add ppl to the enlistment of a game. i have a function in another cog that updates the enlistment. so once someone press the button i want it to run that function it adds the person to a mySQL database and then the enlistment cog runs it and displays it on an message in the discord.
```
... |
Call a function in a cog using a discord button |
|python|discord.py|discord-buttons| |
null |
import random
def create_matrix(n, m, d):
total_elements = n * m
total_ones = int(total_elements * d)
matrix = [[0] * m for _ in range(n)]
ones_indices = random.sample(range(total_elements), total_ones)
for idx in ones_indices:
row = i... |
It worked fine after switching from work account to personal account on the oculus.
it seems [work][1] account was having issues with the spatial anchors.
[1]: https://work.meta.com/ |
This is my code for the rest api in spring boot and jpa that has a function of performance report for employees but something is not working here, i dont know what.
Controller:
```
@GetMapping("/my-report")
public ResponseEntity<?> getReport(String name, String date){
SimpleDateFormat dateFormat = new Simp... |
|csv|input|file-writing|csvwriter| |
null |
|python|csvwriter| |
Microsoft Visual studio sign in -
When sign in steps at the end of the process it shows this error "Your browser is not supported or up-to-date. Try updating it, or else download and install the latest version of Microsoft Edge." I reinstall it and change the default browser too. but no any changes
I reinstalled ... |
couldn't sign in visual studio code |
|visual-studio-code|microsoft-edge| |
null |
import tensorflow as tf
from keras.preprocessing.sequence import Tokenizer
from keras.utils import pad_sequences
# Set parameters
vocab_size = 5000
embedding_dim = 64
max_length = 100
trunc_type='post'
padding_type='post'
oov_tok = "<OOV>"
training_size = len(proc... |
Strange Error encountered when running a model on Azure Auto ML |
|azure|machine-learning|azure-machine-learning-service|automl|azure-auto-ml| |
null |
You just need to handle the [IFRAMES](https://www.selenium.dev/documentation/webdriver/interactions/frames/#:~:text=Iframes%20allow%20the%20insertion%20of,and%20are%20still%20commonly%20used.&text=However%2C%20if%20there%20are%20no,in%20the%20top%20level%20document.)
Check the working code below:
````
from seleniu... |
Please be gentle... I don't do much C++ and am trying to tidy up some code.... I'm trying to compile the code below in Arduino Studio, and it keeps throwing a `no matching function for call to 'devPort::devPort()'`
on the following line
` Sensor(String type, float adjustment, devPort port) {`
I've tried m... |
Declaring classes in C++ constructor for another class reports "No matching function" |
|c++|arduino| |
null |
{"OriginalQuestionIds":[588004],"Voters":[{"Id":6870253,"DisplayName":"chtz"},{"Id":898348,"DisplayName":"Jabberwocky","BindingReason":{"GoldTagBadge":"c"}}]} |
How to create jasper report in spring boot rest api with jpa |
|spring-boot|spring-data-jpa|jasper-reports| |
null |