instruction stringlengths 0 30k ⌀ |
|---|
{"Voters":[{"Id":18519921,"DisplayName":"wohlstad"},{"Id":12002570,"DisplayName":"user12002570"},{"Id":839601,"DisplayName":"gnat"}]} |
You could use the same techniques as shown in the answer to [In Swift, how can I matchedGeometryEffect for a clipped() image without it glitching?](https://stackoverflow.com/a/78159972/20386264) (it was my answer).
- Use placeholders in a `ZStack` to define the two positions.
- The small version needs to be scaled-... |
null |
This was the issue: the value of `searchResults` was not **updating**, therefore even though the `textField` was issuing characters to the `searchText variable`, **nothing** was happening.
The solution: force an update on the variable `searchResults`. This was accomplished by enclosing the code for `searchResults` i... |
|python|web-scraping|jupyter-notebook|jupyter| |
I have a class with two methods, `Add(obj)` and `Remove(obj)`.
How do I unit test the `Remove` method when, initially, the private collection that holds the added properties is private?
I've read that it is bad practice to access private fields for unit tests. If I first use the `Add` method to fill the collectio... |
How to test Remove method without first adding elements |
All of your 3 questions can be answered with a sound "yes" :)
There are (most probably) 2 versions because some people might not have Python installed on their machine. |
This was the issue: the value of `searchResults` was not **updating**, therefore even though the `textField` was issuing characters to the `searchText variable`, **nothing** was happening.
The solution: force an update on the variable `searchResults`. This was accomplished by enclosing the code for `searchResults` i... |
|javascript|angular|typescript|ngrx|state-management| |
null |
|python|pandas|web-scraping|beautifulsoup| |
|flutter|firebase|url| |
Try refactoring your function to avoid using global variables to store intermediate results (`resstr` and `resarr`). Using global variables like this can cause issues in the context of running multiple tests in sequence since they would retain their values from previous calls across tests, leading to incorrect results.... |
As title. I bought an online course I had no time to watch until now. In the course, it says something like this *was* not allowed in TypeScript:
```ts
type Name = { name: string }
type Age = { age: number }
type UnionBoth = Name | Age
const test = (union: UnionBoth): void => {
if ('name' in union && ... |
We used to not be able to access all property at once in a union in TypeScript? |
|typescript| |
Extend androidx.preference.EditTextPreference:
public class EditTextPreferenceExt extends EditTextPreference {
public EditTextPreferenceExt(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.MultiSe... |
{"OriginalQuestionIds":[4394309],"Voters":[{"Id":2802040,"DisplayName":"Paulie_D"},{"Id":8620333,"DisplayName":"Temani Afif","BindingReason":{"GoldTagBadge":"css"}}]} |
I would like to add a Cppcheck scan to my C++ project CI build with Travis CI.
In particular, I need to:
- fail the build if new errors are found
- show the errors in the build result
|
Add Cppcheck to the Travis CI build |
|c++|continuous-integration|travis-ci|cppcheck| |
null |
Does anyone on here know what I am referring to?
https://jsfiddle.net/xmdq14a2/1/
To reproduce, tap one of the buttons on a mobile device.
` <button class="linkButtonB btn-primaryC btnC">linkButton</button>
<button class="linkButtonB btn-primaryC btnC">linkButton</button>
<button class="linkButton... |
How can I eliminate or deactivate the white flash that appears when I press a button via a mobile device? |
I am trying to make a variable that changes as the loop goes on in R, so I used the paste() function in a loop, to make a variable that changes accordingly. Here is my code:
```
#dataframe
df1 <- structure(list(lex_1 = c("гей", "гей", "гей", "гей",
"гей", "гей"), lex_2 = c("лесбиянка", "бисексуал",
"-пропага... |
when clicked, JS is taking mw to wrong url in backend (django) |
|javascript|reactjs|django| |
I want to make a robust scraper to fetch data in specific website, and don't want to change the code with updating the site in during time,I'm looking for a way to tell to scraper to find some fields like title,description,title_url and etc... tags automatically.
how to make this scraper?
thanks.
I say this questi... |
how to create robust scraper for specific website without updating code after develop? |
|machine-learning|web-scraping|bert-language-model|scrape| |
null |
The first step would be to see what topics are being published/stored in the dataset. For example, if the dataset uses `/laser` for the lidar pointcloud topic, make sure that it matches with the topics required by the SLAM ROS package. The input topics to SLAM package can easily be found in the documentation of going i... |
|sql|sql-server| |
null |
**Use Live rebuild**
While you're developing your application, you want to run Tailwind in "watch" mode, so changes are automatically reflected in the generated CSS output. You can do this use this gem's [Puma](https://puma.io/) plugin to integrate "watch" with `rails server`. To use it, add this line to your `puma.... |
|ios|healthkit| |
I deployed my django rest framework application and react app separately on vercel.
So my urls for these are 'https://myproject.vercel.app/' and 'https://mybackendproject.vercel.app/'.
I use the sessionAuthentication and cookie for authentication. However, it seems that cookie is not set at frontend.
So I got the ... |
Cookie doesn't send different domain django and react |
There is no built-in way to do this. The picker doesn't hand you a video when the user merely taps on an item to selct it in the picker; in fact, it doesn't hand you _anything_ until the user is _finished_ with the picker (and even _then_ it doesn't hand you any videos — you have to fetch them yourself). If you want a ... |
In my case i'm adding icons like this
assets:
- assets/images/
- assets/icons/
but in my case i have not use any icon in the project and i have remove this line - assets/icons/ in pubspec.yaml after that i have pubget that and i have hot restart apply in my project and this error are resolved |
Finally, the solution was to add widgetVar to the panel tag (parent of panelGrid).
<p:panel widgetVar="widget_pnl">
<p:panelGrid id="statpanel" columns="3" layout="grid">
Then in update I could use
<p:ajax event="filter" listener="#{enrichmentView.doFilter}" update="@this @widgetVar(widget_pnl)... |
{"Voters":[{"Id":418599,"DisplayName":"Antonio Petricca"},{"Id":307138,"DisplayName":"Ocaso Protal"},{"Id":2756409,"DisplayName":"TylerH"}],"SiteSpecificCloseReasonIds":[18]} |
I am trying to analyse execution time of a query. I used the following statement to check CPU and elapsed time:
SET STATISTICS IO, TIME ON;
For a single query, I can understand the CPU and elapsed time. But when it comes to a complex query, say as follows (Pretty big and for the time being, not sharing any sa... |
Query Plan Estimation and Performance Improvement of A Query |
|sql|sql-server|database|sql-server-2019| |
class ItemGetter extends EventEmitter {
constructor() {
super();
this.on('item', item => this.handleItem(item));
}
handleItem(item) {
console.log('Receiving Data: ' + item);
}
getAllItems () => {
for (let i = 0; i < 15; i++) {
... |
Build of Keystone in Turborepo failed with error |
With v0.15: `one(my_set)` works on zero/one element list/set.
Otherwise `tolist(my_set)[0]` is v0.12 compatible.
For dirty tricks lovers with one element primitive string: `join("", my_set)`.
* https://developer.hashicorp.com/terraform/language/functions/one |
It works when using chrome.
I wanted edge as a back-up for printing html to pdf as it is pre-installed on Windows.
Process.ExitCode gives out 1002 and no error in BeginErrorReadLine. And no pdf is generated at output path unlike chrome.
```
if(File.Exists(@"C:\Program Files (x86)\Microsoft\Edge\Application\... |
If you are following the [Nextjs tutorial][1] you might come across this error.
Make sure your `actions.ts` file has the `'use server';` directive.
When it comes to creating the [authenticate action][2] you will notice the code example has no `use server` directive. But, it should, as described in [chapter 12... |
I'm using the google-maps Angular component here: https://github.com/angular/components/tree/main/src/google-maps
and I'm getting a deprecation message when running the \<map-marker> component in my Angular app that show the message at the bottom.
I installed the latest version of @angular/google-maps version: 15... |
How do I switch from using 'map-marker' to 'map-advanced-marker' with the @angular/google-maps component? |
|angular|google-maps|google-maps-markers|angular-components|angular-google-maps| |
For context I am creating a button wherein when player presses it, it gets the text in the text area and does its thing
```
/**
* Creates and displays the name input Confirm button
* @param nameInputActionListener The action to be done when confirm button is pressed
*/
public void createAndDisplay_nameInput... |
|java|android|android-sqlite| |
>I cannot make any payment from my country before account activation due to stripe policies.
Why don't you use your test API keys? You can make test payments and Checkout sessions without an activated Stripe account.
As for the formatting of the `line_items` array, you have two choices:
- Use an existing Price... |
In Flutter, you can use the `MediaQuery` class to get the current `orientation` of the device. However, this will only tell you if the device is in `portrait` or `landscape` mode, not the specific orientation (**up**, **down**, **left**, **right**).
Since you are checking if the `currentOrientation == Orientation.p... |
How to display name starting from 'z' by using BETWEEN cmd only? |
|mysql|oracle| |
null |
In a desktop application (written in Electron), I'm trying to implement a feature that will allow the user to open the application in full screen or return it to the reverse state (initially the application does not open in full screen).
I already have working functionality.
What I've done:
main.ts
ipcM... |
I'm new in Django and I'm building a site for booking.
I build the front-end in vue 3 and the back-end in django using channels.
I've implemented the websockets but now I'm trying to add a GET or POST entry point for the confirmation via link (like "url/api/confirm/confirm_code" or "url/api/confirm/confirm_code=c... |
If the boundary is always blue, this might work quite nicely:
im = cv2.imread("sudoku.png") # read im
b,g,r = cv2.split(im) # split to bgr
bThresh = cv2.threshold(b, 0, 1, cv2.THRESH_OTSU + cv2.THRESH_BINARY_INV)[1] # get the threshold
cnts, _ = cv2.findContours(bThresh, cv2.RETR_EXTERNAL, cv2.CHA... |
Recently I'm trying to learn Assembly but I got stuck from creating an EXE file from it. It keeps making errors although I've try to research about it a lot.
I've read a lot of tutorial on the Internet about "How to run a assembly files", "How to compile Assembly with NASM", "Using gcc to run Assembly files",... and... |
Unable to run get .exe file from assembly NASM |
|assembly|gcc|compilation|exe|nasm| |
null |
java.lang.IllegalArgumentException: Expected list containing Map, List, Boolean, Integer, Long, Double, String and Date
This error occurred when I used springsecurty to query the database for a certain user
What errors may be causing the problem? |
This error occurred when using springsecurity for database user verification: IllegalArgumentException |
|java|sql|spring|spring-boot|spring-security| |
null |
Hej i am new here and i am NOT a techsavy guy (coding) so please dont be to harsh with me ;-)
I am trying to add an extra field in the products backend but struggle a lot because i dont understand the coding. I got help from ChatGPT and it works 50%.
What i am trying to acomplish is to have a extra field similar... |
In the variable block for the default value, you have provided an incorrect structure. You have provided a map of a map with catalogs. To solve your issue you need to remove the top-level map, which is unnecessary for your use case.
After removing that map your variable will look like this:
variable "catalog" ... |
{"Voters":[{"Id":466862,"DisplayName":"Mark Rotteveel"},{"Id":17562044,"DisplayName":"Sunderam Dubey"},{"Id":19846219,"DisplayName":"pigrammer"}]} |
I'm getting a crash in the preview canvas only - runs fine in the simulator.
> Fatal error in ModelContainer.swift at line 144 - failed to find a currently active container for Book.
Running Xcode 15.3, and iOS 17.4.
**Main**
```
import SwiftUI
import SwiftData
@main
struct SwiftDataSandboxApp: App {... |
SwiftData crash in preview: "... failed to find currently active container for ..." |
```
class BiLSTMNERTagger(nn.Module):
def __init__(self, emb_dim, hid_dim, n_layers, token_vocab_size, tag_vocab_size):
super().__init__()
self.embedding = nn.Embedding(token_vocab_size, emb_dim, padding_idx=0)
self.rnn = nn.LSTM(emb_dim, hid_dim, num_layers=n_layers, batch_first=True... |
Matrix multiplication issue in a Bidirectional LSTM Model |
|vba|xero| |
|database|azure|publish| |
To be honest I ended up removing the habit just the way I learned Vim in the first place: I forced myself for a hour or two just moving around with <kbd>j</kbd>/<kbd>k</kbd> prepended by numbers.
---
The following is a more self-contained solution: one function and four mappings for <kbd>h</kbd>, <kbd>j</kbd>, <k... |
If your combination is static, you can use the following measure :
Students English Maths Count =
VAR EnglishStudents =
CALCULATETABLE (
DISTINCT ( TableTest[STUDENT] ),
TableTest[SUBJECT] = "English"
)
VAR MathsStudents =
CALCULATETABLE (
... |
Does anyone on here know what I am referring to?
https://jsfiddle.net/xmdq14a2/1/
To reproduce, tap one of the buttons on a mobile device.
<button class="linkButtonB btn-primaryC btnC">linkButton</button>
<button class="linkButtonB btn-primaryC btnC">linkButton</button>
<button class="linkButtonB bt... |
|powerbi|dax| |
accessibilitytools, wang's avi library and kprogresshud are very old libraries, originally hosted in jcenter but now not available anymore.
Working with old libraries is always difficult. My suggestion is to download the source code from github and try to integrate them into your project (if the license allows it). ... |
Does anyone on here know what I am referring to?
https://jsfiddle.net/xmdq14a2/1/
To reproduce, tap one of the buttons via a mobile device.
<button class="linkButtonB btn-primaryC btnC">linkButton</button>
<button class="linkButtonB btn-primaryC btnC">linkButton</button>
<button class="linkButtonB b... |
Currently, I am trying to establish a connection to a local SSAS (OLAP) server from Python. My ultimate goal is to be able to execute MDX queries. However, after many attempts with the following code, no matter how much I modify my connection string, I always receive this error message. I am not sure if the library its... |
Connecting to a local SSAS (OLAP) server from Python |
|python|ssas| |
|reactjs|middleware|redux-toolkit| |
I am having an issue. It just published my first project and now I am realising if you add an "/" to the end of the URL it does load in a very different way I cant even explain. When you add a "Trailingslash" some of the Buttons of the Website are not clickable and if I do this with ng serve the font is changing, I can... |
I'm developing a website using reactJS, I've received the figma files in 1920X1080 screen resolution.If i'm trying to develop those screens in a laptop with lesser screen resolution, the screens are overflowing from the viewport. How do I fix this.
I tried using grids in the CSS but it did'nt help. |
Date().getTimezoneOffset() does not give you the offset when compared to Europe/London. It gives you the offset compared to UTC.
Europe/London, at the time you asked the question, is not the same as UTC.
Kyiv may well be 2 hours away from London but it is 3 hours away from UTC hence 180 being the correct result. |
Use `document.querySelector` to retrieve an option, then use either `setAttribute` to set the selected state or set the selected state directly.
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
const getOptionById = id =>
document.querySelector(`#comboBox... |
I have a org.eclipse.ui.navigator.CommonViewer with various items in my project explorer view and there are different menu contributions for various tree nodes at different levels configured to be shown when I right click on the tree nodes and these menu contributions are defined in my plugin.xml file this way -
```
... |
SWT Popup Context Menu width issue |
After running the build process for my project, i noticed some of my CSS was not displayed the same as during development. There is a little difference between the way it appears in development and the way it appears in build.
This is how it appears in development: [![How it appears][1]][1]
This is how it appe... |
Distorted CSS after Build process |
|css|reactjs|build|vite|production| |