instruction stringlengths 0 30k ⌀ |
|---|
I am experiencing the following problem. When I setup an ADC with DMA for 5 channels, I get lower readings than the expected ones.
We have PCBs of the same batch in 3 countries, but only the ones tested in China are failing. At all times the ADC readings read lower than the expected values for all the ADC channels, ... |
STM32 ADC DMA low raw/Voltage readings |
|stm32|dma|adc| |
null |
I want to create a very simple, low load application, and first time decide to use Quarkus framework.
May be it sounds strange, but I want to use Sqlite for database, and authentication by an ip address. App will run in secured LAN, users are only trusted peoples, others are blocked in firewall.
In database I hav... |
BlockingOperationNotAllowedException in HttpAuthenticationMechanism |
|quarkus| |
This represents an array of pointers to `char`, in other words, strings. The way you recognize this is that the array syntax `[]` is demoted to a pointer, so this is the same as `**char`, a pointer to pointers of `char`s. |
I think best would be just to set the `left` and `top` using `%` units.
I did the same for the `width` as well.
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
window.addEventListener("load", function() {
document.getElementById('map1').onclick = funct... |
I have two columns, column 1 has product, column 2 has sales. I want to sort the table by sales descending. Total sales value/4 will give me quarter value.
I want to then create a group based on this quarter value.
Name the group - Q1, Q2, Q3, Q4 and omit any rows with zero sales.
Q1 then would be my highest s... |
SQL - Split data into quantiles based on sum |
|postgresql| |
|langchain|chatgpt-api|llama-index|gpt-index| |
null |
Pair combinations of array column values in PySpark |
I am trying to execute pig latin script to find TF-IDF value for book dataset
My input file bookdataset.txt contains the following lines<br>
Document 1: "The quick brown fox jumps over the lazy dog."<br>
Document 2: "A quick brown dog jumps over the lazy fox."<br>
Document 3: "The lazy cat sleeps all day."<br>
Doc... |
Apache PIG ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: <line 20, column 44> mismatched input '.' expecting SEMI_COLON |
|apache-pig| |
I need your help, I've checked all the documentation but I can't find the solution. I have a simple HTML navigation. In CSS, I have a fade in and out animation. The fade in works perfectly, but the fade out does not work. I've tried a million things, it just won't work.
```
<header class="mobile">
<div ... |
You should add those assets into `pubspec.yaml` file like bellow
flutter:
assets:
- images/example.png
- assets/example.mp3
- after adding those assets run `flutter clean` command and then run
`flutter pub get` |
When you define an alias, you can use either single-quotes, as if it's a string literal, or you can use back-ticks, as if it's an identifier. But when you refer to the alias later in the query, you must treat it as an identifier.
order by 'FullName' desc;
This orders by the constant string value `'FullName'... |
Another approach worth considering would be writing a template function for all possible maps:
template<typename K, typename V> V getValueAtIndex(map<K, V> &mapRef, int index) {
for (const auto& entry : mapRef) {
if (index == 0) {
return entry.second;
}
... |
I read a little bit everywhere that the "in" operator have a time complexity of O(n), yet I used it in a code and idk why but it's acting as if it have the time complexity O(1)
So I was solving a problem on leetcode and ended up having this algorithm
```
class Solution(object):
def twoSum(self, nums, target... |
null |
No need for long process: simplly go to your congig/admin.php, set this to yes. if not there, add it,
/*
|--------------------------------------------------------------------------
| Access via `https`
|--------------------------------------------------------------------------
|
| If you... |
I have declared a vector of a class I created like this:
typedef Eigen::Vector<Trade, Dynamic> VectorT;
And I am trying to sum a rolling window of trade.amount
Before switching from std::vector to Eigen::Vector I did this
for (size_t i = 30; i < trades.size(); ++i) {
double cum_buy_qty = 0;... |
How to sum attributes of a Eigen vector of class |
|c++|eigen| |
Thank you for reaching out
My name is Conar and I'm with DocuSign Developer Support.
The DocuSign sender cannot control notifications for the recipient. This is by design. The recipient can opt-out of notifications on their end.
Please confirm if this case can be closed.
Best regards,
Conar | DocuSign Develo... |
Use optString, optBoolean and so on:
``` java
for (int i = 0; i < data.length(); i++) {
JSONObject jsonObject = data.getJSONObject(i);
jsonObject.optString("employer_name", "default_value");
}
```
check [documentation][1] of JSONObject.
For your other question, ther... |
Finally, I solved the issue, as Paypal is very concerned about its webhooks security, I can't run my webhook locally with Postman, the solution was to download and set up **ngrok** and change my webhook URL to the URL **ngrok** generated for me and add "/paypal/subscriptions/webhook" at the end of the URL something lik... |
The predefined variable [Build.CronSchedule.DisplayName][1] can be used for condition decision. An example is also given in the link.
For the given case:
schedules:
- cron: '0 16 * * *'
displayName: 'schedule 1'
branches:
include:
- master
always: True
- cron: '0 4... |
Will the following work? And if so, will it provide a significant performance improvement.
My AppUser object includes:
public class AppUser
{
public int Id { get; private set; }
// lots of other properties
public List<Tag>? Tags { get; set; }
}
The total number of tags is prese... |
It seems simplest to me that you just use `preg_replace()` to add an email domain to any string that doesn't have it, then join the results with a comma and a space.
Code: ([Demo][1])
$recipients = [
"kumar",
"ram@test.com",
"ravi",
"rob@example.com"
];
echo... |
null |
The `ksh` language is pretty neat and I'm glad somebody is taking an interest in the underused features. (Language?! Quite so, it is a fully functional and fairly powerful language that runs slow as... but that's another story.)
I'll give you this example and I'll fill in an explanation about what I am doing after.... |
I would like to write an Update query. I need to update target_table field in tblnames1 based on tblenames2.
**tblNames1**:
|filename | Description | target table
|----|-----|-------------------------------------------
| /app/data/shared/mbs/test.yaml | select * from test.fn_hierarchy_prod_group(1); |... |
CSS navigation fade in / fade out on click animation does not work |
|javascript|html|css| |
Lists are horribly inefficient as well as objects : they store FP number as objects and lists contains pointers to these objects. It prevent all optimizations and cause a very bad memory access pattern. Not to mention objects are reference counted and protected by the Global Interpreter Lock (GIL). Any code involving C... |
not really, you don't have move here. In fact, you are constructing a new std::string object when doing `+"FOO"`, which means you are doing memory allocation. Which means it can throw. |
I'm encountering an issue with passing the "size" parameter from my JavaScript function to my Django backend. Here's the relevant code snippet from my Django view:
```python
def get_product(request, slug):
try:
product = Product.objects.get(slug=slug)
if request.GET.get('size'):
... |
For me it was because I had [_date] in my php code. The code worked well until recently. Changed it to [date] and it started working again. |
I write fastapi sqlmodel sqlalchemy project. I got type error in PyCharm:
```
expected type 'Literal["*"] | QueryableAttribute', got 'list[Account] | None' instead
```
error was caused by this code:
```
from sqlalchemy.orm import selectinload
class CRUDCounterPartyCommon(
CRUDBase[CounterParty, Counterp... |
def function1(dd:pd.DataFrame):
col1=dd.test_result.ne("fail").cumsum()
ss1=dd.assign(col1=col1).loc[dd.test_result.eq("fail")].col1.value_counts(ascending=False)
ends_with_pass = 'yes' if ss1.size and (col1.eq(ss1.index[0])&col1.shift(-1).eq(ss1.index[0]+1)).any() else 'no'
retu... |
Permutation/Combination problems are always a tough nut to crack.
Given a Rock paper scissors game of N turns played by 2 people (round win : 1 point, round draw : 0)
Player 1 sequence has been provided. **Player 2 needs to win without playing same move twice in a row.
Find Number of ways to win** (with Mod 10... |
Let's stick to the statement:
> The `Index_ID` is not unique over the complete dataset, it is only unique per year and month.
This means that `Previous_Index_ID` points to an `Index_ID` at some fixed past period. Based on the data provided, I assume that `Previous_Index_ID` is the `Index_ID` for the previous cale... |
I am trying to Get a response from the OpenAi assistants API using a Django project.
I implement a model class inside models.py as such:
from django.db import models
from typing_extensions import override
from openai import AssistantEventHandler
from django.http import HttpResponse
# Cre... |
For my Windows 11 PC Windows doesn't get a snapshot and notices updates to the directory, but maybe not reliably.
#include <Windows.h>
#include <iostream>
using namespace std;
int main()
{
constexpr wchar_t const *FILENAME = L"file.bin";
DeleteFileW( FILENAME );
... |
You can adjust your code with `saveData` method to manage the process of staging the data into Snowflake creating a INSERT INTO statement and executing the operation asynchronously. Setting the `PreparedStatement` parameters can be more efficient.
```
public Mono<Void> saveData(List<Map<String, Object>> dataMapList... |
As the error message _implies_, `head` etc. shouldn't be indented, they should be on the same level as `doctype html` (which makes sense, since the `doctype` tag doesn't hold the rest of the document).
```
doctype html
head
meta(charset='UTF-8')
title This Is Pugjs Page
body
.container This Is Container
... |
You should not violate the rules stated by the React documentation, because React (when used as intended) makes certain guarantees on how it will behave.
React doesn't make guarantees on how it would behave if used differently.
The internal implementation of React may change fundamentally without notice. React w... |
My Android app uses Fragments and includes Google signin authorization via Firebase. After signing in and starting a Fragment transaction, the following appears, overlaying the Fragment underneath it:
[![enter image description here][1]][1]
It's as if the gray screen was a Dialog window. When I touch the screen, ... |
I know existence of a `throw` inside of a `promise`, change the state of that specific promise to `rejected` and the result will be the `error` message, but when I type this `throw` inside of a `setTimeout` located inside of a `promise`, that `throw` doesn't modify the state and result of that `promise`, at first I tho... |
why throw inside of an setTimeout, located inside a promise, doesn't change state and result of the output promise? |
|javascript|promise|settimeout|throw| |
Have Prettier formating corretly but only when `Ctrl+shift+p` and selecting `"Format Document With..."` -> `"Prettier - Coder formatter"`.
When selecting `"Format Document"` **does nothing**...
There is a third option "Format Document (Forced)" this works and formats the file but seems to indicate some kind of pr... |
I have to handle xml documents that are big enough (up to 1GB) and parse them with python. I am using the [`iterparse()`][1] function (SAX style parsing).
My concern is the following, imagine you have an xml like this
<?xml version="1.0" encoding="UTF-8" ?>
<families>
<family>
<name>Simps... |
null |
I'm trying to visualize the data coming through the API with Sigma.JS, but I can't always get results. When I tried to visualize the dynamic incoming data without mock data by writing a simple API with Flask, it worked, but this data is slightly different from the real json data of the project, I can't integrate the ne... |
Sigma.JS custom rendering |
|javascript|json|flask|visualization|sigma.js| |
null |
I have this code that tries to retrieve all data from a sheet , including metadata:
$response = $this->spreadsheet_service->spreadsheets->get($this->spreadsheet_id, ['ranges' => $sheet_name ]);
$sheetData = $response->getSheets();
foreach ($sheetData as $sheet) {
echo "sheet:";
... |
You can save `d[a]` to a constant, check that, and reuse it:
```
const entry = d[a];
if (entry.prop) {
entry.prop++; // OK
}
```
[Playground link][1]
That works even though `a` is not constant because `entry` is, so TypeScript's flow analysis can see that `entry.prop` has been narrowed.
[1]: http... |
In my production Next.js application using Clerk for authentication, I am unable to access my authenticated session, even though the user is successfully created in Clerk and even successfully synced to my database using a webhook.
It works in localhost but in my server-side logs, I see this error
> ⨯ node_modul... |
Clerk auth session not working in production |
|next.js|middleware|clerk| |
I am the admin of my company's website i got some problem. I have carousel on which category page, on my computer the rendering is perfect but on others computers all the images are displayed as you can see : [On my computer](https://i.stack.imgur.com/WrhSe.png)[Others computer](https://i.stack.imgur.com/8Wt3q.jpg)
... |
How to solve rendering problem on my wordpress website |
|wordpress| |
null |
The observation is not enabled on Spring Kafka components by default.
See `KafkaTemplate.setObservationEnabled(true)`.
More in docs: https://docs.spring.io/spring-kafka/reference/3.1-SNAPSHOT/kafka/micrometer.html#observation |
Both your implementations use a stack. The first uses the callstack, while the other uses an explicit stack. There are several differences that impact performance:
1. The call stack is managed implicitly, using compiled code (CPython), which gives an advantage over a stack that must be managed with Python code (`app... |
How to return HTTP Get request response from models class in Django project |
|python|django|openai-api|openai-assistants-api| |
I was thinking of making a new project and I want to create a website where we can draw some image in Paint and using that image we can generate some lottie animation.
so, for that I wanted to know the JSON for lottie animation is generated .
what is the login behind the lottie animation
and how can I give some Sl... |
How to create a lottie animation |
|android|web|lottie|image-generation|dynamic-image-generation| |
null |
I am making a java script in which I need to occasionally change the headers of a specific request, however the token I am passing vs what i need it to be is not changing. (from what I can see) (sorry for the terrible explanation, I don't even know what I'm doing to be honest.)
Example:
`var abc23token = token1`
sho... |
Variable inside a Variable, not updating |
|javascript|node.js| |
null |
I am recently trying to self-study OS and playing with the xv6 OS for teaching. The version I am using is the x86 one from [GitHub](https://github.com/mit-pdos/xv6-public).
What I've been doing is try to use 2-level paging when initiating the system. For that purpose, I created a page table and a page directory in... |
How to call a C language function from x86 assembly code? |
|c|assembly|x86|qemu|xv6| |
null |
I want to send events and messages of different object types using Kafka topics. So I have producer configuration class in which I create the beans of the class `KafkaTemplate` and `ProducerFactory`:
@Bean
public KafkaTemplate<String, BeltMessage> kafkaBeltMessageTemplate(final ProducerFactory<String, BeltM... |
Customizing Dawn Theme and in multicolumn I have added bullet text but am not able to change icons before the text. Font Awesome Icons are not visible. I have added CDN of font awesome.
I am looking for a similar format as icons text (Need one column)only.
I have added this code but not showing any icons.
... |
Shopify Dawn Theme - Add Icons in place of Bullet points in multicolumn layout |
|shopify|shopify-app|shopify-api|shopify-template|shopify-storefront-api| |
I imported tensorflow as:
```import tensorflow as tf ```
and got this error:
```
Traceback (most recent call last):
File "C:\Users\USER\Downloads\import_tensorflow.py", line 1, in <module>
import tensorflow as tf
File "C:\Users\USER\AppData\Local\Programs\Python\Python312\Lib\site-packages\tensorflow... |
How to solve Syntax error when importing tensorflow 1.8.0? |
|python|tensorflow|pip|module|python-import| |
In the C++ standard, `max_size()` is defined as
> *Returns*: `distance(begin(), end())` for the largest possible container.
\- [[container.reqmts] `max_size`](https://eel.is/c++draft/container.reqmts#lib:max_size,containers)
Initially, this looks good, and there is no *Preconditions* paragraph. However, `std::... |
<!-- begin snippet: js hide: true console: false babel: null -->
<!-- language: lang-js -->
"use strict";
window.addEventListener('load', onLoaded, false);
// called when the window has finished loading
// - attaches a click handler to all buttons.
// buttons are selected with ... |
|razor|dependency-injection|blazor|inversion-of-control| |
Using Pycharm Community Edition 2023.3.2 with Micropython 1.4.3-2023.3 installed and enabled in Pycharm. I want to utilize the 2 core multithreading on a Raspberry Pi Pico W using the experimental "_thread" library. When I try to use a method from the module, Pycharm says there is no reference to the method, even thoug... |
Micropython: _thread module imported but not showing methods |