instruction
stringlengths
0
30k
The most efficient approach is to sort both lists by time then concurrent run through both lists. Complexity is 2 sorts plus O(n), where "n = min(runEvents.Count, heartBeats.Count)". But, most probable, both lists are already time-ordered, thus only O(n) remains.
How can I reshape a 3D NumPy array into a 2D array, while utilizing the data along axis 2 to upscale?e.g. 3D array with shape 2*2*4: ``` array_3d = [[[ 1 2 3 4] [ 5 6 7 8]] [[ 9 10 11 12] [13 14 15 16]]] reshape to 2D array with shape 4*4: reshaped_array = [[ 1 2 5 6] [ 3 4 7...
Reshape a 3D NumPy array to a 2D array, using the data along axis 2 to upscale
|numpy|numpy-ndarray|
null
I have a project to monitorize some parameters with ESP32 (Arduino IDE sketch) and I save result into a gsheets. Every new day gerenate new sheet to save dates. After new sheet creation, I want to insert into sheet a line chart with 3 series using requests addChart. With one serie is ok, but is more explicit evolution ...
**html**: ```html <div class="text-stroke" data-text="Your text">Your text</div> ``` **css**: ```css .text-stroke { position: relative; color: white; &:after { content: attr(data-text); position: absolute; left: 0; top: 0; -webkit-text-stroke: 2p...
null
|azure|azure-powershell|azure-analysis-services|
null
I have this carousel that needs a simple operation: appear infinite. The problem is that the animation cuts off and leaves a blank space at the end of the last element. I leave the code below and hope someone can help me. <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-css ...
null
If you have an infinite `Stream` like a `NetworkStream`, replacing string tokens on-the-fly would make a lot of sense. But because you are processing a finite stream of which you need the *complete* content, such a filtering doesn't make sense because of the performance impact. My argument is that you would have to ...
I'm running Arch on WSL2 and using ZSH as my shell with Windows Terminal as my terminal emulator. Is there any way to make it so that when you select any text, and type something, the selected text gets replaced like all modern text editors and Windows Powershell? Currently, when I select something and type, the text g...
def set_dict_keys(): my_dict = {1: 'VDD', 2: 'VDD', 7: 'VDD', 0: 0, 3: 0, 4: 0, 6: 9, 13: 9, 'GND': 'GND', 15: 'GND', 12: 12} print(my_dict) output = {} mappings = {} current_value = 1 for key, value in my_dict.items(): if value not in ['VDD', 'GND']: if value not ...
I want to tune a model using a custom class probability metric "pg", which stands for partial gini coefficient. I use it on data that exists of numerical predictors and a binary factor as class label (after preprocessing with the recipe). This is the tuning code: ``` xgb_folds <- train %>% vfold_cv(v=5) xgb_m...
How to do transaction on concurrency situation in nestjs, prisma
|mysql|concurrency|parallel-processing|nestjs|prisma|
null
Try doing: pip install -U datasets >This error stems from a breaking change in fsspec. It has been fixed in the latest datasets release (2.14.6). Updating the installation with pip install -U datasets should fix the issue. git link : https://github.com/huggingface/datasets/issues/6352 ************ ...
JS, the problem of not detecting the overlap status of the cards
```py interval_ranges = [df['A'].iloc[0]] + df['B'].tolist() ( df2.assign(interval=pd.cut(df2['Point'], interval_ranges)) .merge( df.assign(interval=pd.cut(df['B'], interval_ranges)) ) .assign(Returned_Data=lambda x: x['A'] + x['B']) ) Point interval A B Returned_Data 0 ...
I own a vps. There we have three minecraft servers and one discord bot. we also have a local mongoDB running on the vps. I have connected to it using node.js mongoose library. I am talking about the discord bot in this case. When I create documents in the mongodb, it works, and the code reads everything. Suddenly, afte...
It may be related to how you handle the initial render after refreshing. useEffect(() => { const getProduct = async () => { if (params?.slug) { try { const { data } = await axios.get( `/api/pp/product/get-product/${params.slug}` );...
I use VSCode Server as a Home Assistant integration, but I think, as it is based on VSCode Web, there should be no difference. I have just installed it, and right from the beginning, the context menu looks transparent. I can't imagine this would be helpful for someone. Is this a weird setting or extension, like in this...
How to fix transparent VSCode context menu in Home Assistant?
|visual-studio-code|home-assistant|vs-code-settings|
null
I create a file using `nano file.txt` . I typed in `Hello` hit enter and then typed `mate`. How do I replace the linefeed character in this file with `\\n` so that I can substitute this value later when I build valid json data. Right now this is my bash script ``` #!/bin/bash expected_output=$(<file.txt) ...
export const GET = async () => { console.log('Request Made on Get Posts...'); try { await connect(); const posts = await Post.find().sort({ createdAt: -1 }).limit(20); if (posts.length === 0) { return Response.status(404).json({ error: "Posts not found" }); ...
here is my code **this code not work on safari.** ``` function ScrollToActiveTab(item, id, useraction) { if (item !== null && item !== undefined && useraction) { dispatch(addCurrentMenu(item)); } requestAnimationFrame(() => { // Ensure this runs after any pending layout chang...
|python|pandas|
Yep figured it out I actually refiened the schema. Now I have a Master collection and API rule @reauest.auth.id = user.id to view and list the records. Here user is the assigned user to a record. When user creates a record it automatically assigns it.
after running commands ./gradlew clean ./gradlew assembleRelease it gives error Task :@react-native-camera-roll_camera-roll:compileReleaseJavaWithJavac Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: C:\Users\aksha\Desktop\Ak...
You can use the following script to Remotely and Locally modify the Security Policy, with my script you can run against multiple machines, users, and user rights: [Link to my Get / Set User Rights Blog Post][1]. You can copy and paste the script to the Powershell ISE, just **edit line 437** *(near bottom of script)...
I have the following code snippet. ``` template<typename T> void test3(const T& x) { std::cout << std::is_const_v<T> << std::endl; std::cout << std::is_reference_v<decltype(x)> << std::endl; std::cout << std::is_const_v<decltype(x)> << std::endl; std::cout << std::endl; } int main() { ...
C++ - constness of template type deduction
|c++|templates|type-deduction|
null
I have the following code snippet. ``` template<typename T> void test3(const T& x) { std::cout << std::is_const_v<T> << std::endl; std::cout << std::is_reference_v<decltype(x)> << std::endl; std::cout << std::is_const_v<decltype(x)> << std::endl; std::cout << std::endl; } int main() { ...
`GestureDetector` requires a child Widget to execute, the Gesture behaviour will execute on the child widget.
``` <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> <title...
``` Flutter (Channel beta, 3.21.0-1.0.pre.2, on Microsoft Windows [Version 10.0.19045.4170], locale en-US) • Flutter version 3.21.0-1.0.pre.2 on channel beta at C:\Users\wzalz\flutter_windows_3.19.3-stable\flutter ! Warning: `dart` on your path resolves to C:\Program Files\Dart\dart-sdk\bin\dart.exe, whic...
I want to use this scene in my HTML, but I need to change some of the scene settings - like background, disable zoom etc. How do I duplicate published scene to my draft? https://my.spline.design/interactivespherescopy-d9d1c8bb2f660546855bd1b02c7063f8/ I tried to apply this scene as it is but I can't change bac...
In query resolver can i extract the raw query or list of fields/sub-objects which are getting returned in response? I need to apply some logic based on the attributes being returned in response.
In graphql java kickstart how to extract raw query being fired
|java|graphql|graphql-java|graphql-java-tools|
I setup the Rails project on VScode but it does not produce the expected outcome. It just profile 6 single files and does not have any folders. I followed all the step in: https://guides.rubyonrails.org/getting_started.html and also install extension for Ruby and Rails on VScode but cannot set the expected Rails set...
Rails project setup problems on VScode
|ruby-on-rails|ruby|
null
In my case I am having html content inside foreignObject tag, and my html text was not scaling in all the browsers of iPhone. I fixed this text scaling issue by prefixing all the html tags by xlink as shown in the sample code below. <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/x...
I am using Emulator. Each and every time when I run app for test, its shows "System not responding". How can I resolve this error that requires clicking "Wait" around 100 times before being able to work on the emulator? Clearing ram and cache.
I have a handful of data objects floating around my code which have a large number of fields of the same type: ``` struct AsStruct{ mass: i32, height: i32, energy: i32, age: i32, radioactivity: i32, } ``` (actual examples would have more fields - like 20+). Sometimes but not always,...
react-native-camera-roll_camera-roll:copyReleaseJniLibsProjectAndLocalJars FAILED
|reactjs|react-native|camera-roll|
null
How can I reshape a 3D NumPy array into a 2D array, while utilizing the data along axis 2 to upscale? e.g. 3D array with shape [2,2,4]: ``` array_3d = [[[ 1 2 3 4] [ 5 6 7 8]] [[ 9 10 11 12] [13 14 15 16]]] ``` reshape to 2D array with shape [4, 4]: ``` reshaped_array = [[ 1 2 5 6] ...
I'm working on an NX project where I've organized different repositories for components, alongside incorporating a third-party Tailwind component library. Currently, I'm facing issues with duplicate classNames being generated in the CSS bundle. Despite following the instructions outlined here, the problem persists. Can...
NX is not able to purge tailwind third-party library's classNames
|tailwind-css|monorepo|nrwl-nx|nx-monorepo|
I have installed Firebase version 8.6.5 using `npm install firebase`. But I wish to downgrade Firebase to version 7.16.1 due to some code compatibility.
How can I downgrade Firebase version?
i think, the codesample in c given below should output: 10,15,10. But it gives output: 15,15,15. my question is how this result comes? #include <stdio.h> int main() { int a=10; printf("%d %d %d",a,a=a+5,a); return 0; }
how printf() function behaves in printf("%d %d %d",a,a=a+5,a);?
|c|printf|
``` id column1 1 ['A'] 2 ['A', 'B', 'C'] 3 [null] ``` I'd like to select row 3, but trying ```SELECT * FROM table WHERE CONTAINS(column1, null)``` returns empty result. I'm lost as to why that's not selecting row 3. Help?
How to select array with null values in sql?
|sql|
I've found the problem, I think! In validationSchemaCalcolo I set: '**':{ trim:true, escape:true }, ... and so each float becomes a string.
I met the same issue: It was because of gradle version, ```compile``` command is expired and was replaced by ```api/implementation```, and In gradle 7.0+, it was removed. I still want to use ```compile```, so I downgrade gradle version to gradle 4.10. In file ```gradle-wrapper.properties```, use ```distributi...
Text selection replacement in ZSH
|zsh|windows-subsystem-for-linux|
null
**Description:** I recently completed my first JavaScript project, a Pomodoro clock, without relying on tutorials. I'd like feedback on my code to improve my skills further. Here's a detailed overview of how I implemented it: ``` <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="...
I have create my first project using JavaScript, It's a Pomodoro Clock, I am learning JavaScript, is it a good code or not
|javascript|
null
It is most likely caused by your `hash_password` method, check its return type and make sure it returns a User instance. Also no need to use a custom made hashing method as the built in method `set_password` provides the same functionality. Example of how it would look like using `set_password`: user.set_pass...
We want to exclude specific property of an javascript object. **Sample Input:** > const foo={ > "bar":"sangram", > "baz":"sagar", > "mux":"sachin", > "fch":"swapnil" > > } we want to omit a 'bar' property of this object foo. **Sample Output:** > const ...
I am quite definitely not an expert either, but I have had the same issue. I resolved the issue by using a slightly older version of tf using: !pip install -U "tensorflow-text==2.15.*" and !pip install -U "tf-models-official==2.15.*" For reference, I am running scripts on Google Colab (I know this sometimes has i...
[example:](https://i.stack.imgur.com/GvSoN.png) I need calendar in flutter like above image. the monthly calendar starts from previous month 25th to current month 24th. for example: April month calendar: Mar25-Apr24th. develop this calendar using syncfusion flutter calendar or tablecalendar
in flutter calendar, i need monthly calendar to be start from previous month 25th to current month 24th. example: mar month calendar: 25th feb - 24mar
|ios|flutter|mobile|frontend|
null
IN MbedTls with RSA in a C-programm encryption/decryption works when using separate buffers (for plainText, cipherText, and decryptedText, i.e. the content of plainText and decryptedText is the same), but not when using just one buffer to perform in-place encryption/decryption as i get gibberish/not correctly encrypted...
Easy translation between struct and map format?
|rust|
Creating this question since https://repost.aws/knowledge-center/sagemaker-lifecycle-script-timeout didnt work for me. It was a version issue. So I want the on-stop and custom conda environment in my sage maker. I tried to add sage maker conda environment and auto-stop sage maker after one hour but I saw errors i...
custom environment in sage maker
|amazon-sagemaker|
null
{"OriginalQuestionIds":[686439],"Voters":[{"Id":7328782,"DisplayName":"Cris Luengo","BindingReason":{"GoldTagBadge":"matlab"}}]}
Check value of ${RR_LIB_FILES}. Errors say that this line `target_link_libraries(myrrlib PUBLIC ${RR_LIB_FILES})` links against two libcrypto.a libraries. This is ofcourse illegal. Print it out and check for duplicates. I suspect that with switch from SHARED to STATIC for myrrlib also dependencies are built and/or...
When I'm going to update the SEO as admin from the frontend it shows me the error > Attempt to read property "id" on null [![enter image description here][1]][1] This is my controller code public function updateSEO(Request $request) { // first, get the language info from db ...
i have string: const text = 'A Jack# Jack#aNyWord Jack, Jack'; i want search word "Jack" only, but if Jack contain # character, its say true mean match. i try like: const text = 'A Jack# Jack#aNyWord Jack, Jack'; const regexpWords = /Jack(?=,|#)/g; console.log(text.match(regexpWords)); resu...
How to except coma in search word in RegExp javascript
|javascript|regex|
|azure|microsoft-graph-api|botframework|microsoft-teams|
null