question_id int64 37.6M 73.2M | input_text stringlengths 88 52.4k | output_text stringlengths 37 35.6k | title stringlengths 15 150 | tags stringlengths 1 107 | q_score int64 -19 397 | view_count int64 3 879k | answer_count int64 1 21 | accepted_answer_id int64 37.6M 73.8M | answer_id int64 37.6M 73.8M | a_score int64 -5 1.29k | is_accepted bool 1
class | creation_date stringlengths 20 24 | input_text_instruct stringlengths 251 52.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
53,607,355 | Intellij: Before commit: run git hooks<p>I want to be enable "run git hooks" before commit, I know its possible since i enabled it once (in one project, depicted below)</p>
<p>but i cant remember / figure out how to do this in another project</p>
<p>can you please help?</p>
<p>thanks</p>
<p><a href="https://i... | <p>Back then i couldn't find it, but later on i did, so just wanted to share it with you guys.</p>
<p>The following package will do it for you <a href="https://www.npmjs.com/package/pre-commit" rel="nofollow noreferrer">pre-commit</a></p>
<p><strong>Its amazingly simple, just install it:</strong></p>
<pre><code>npm ins... | Intellij: Before commit: run git hooks | intellij-idea | 15 | 11,827 | 3 | 63,383,562 | 63,383,562 | 4 | true | 2018-12-04T07:01:31.847Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Intellij: Before commit: run git hooks<p>I want to be enable "run git hooks" before commit, I know its possible since i enabled it once (in one pro... |
53,683,164 | Keras occupies an indefinitely increasing amount of memory for each epoch<p>I'm running a genetic hyperparameter search algorithm and it quickly saturates all available memory.</p>
<p>After a few tests it looks like the amount of memory required by keras increases both between different epochs and when training differ... | <p>Since the <strong>memory leak</strong> still seems to be present in <strong>TensorFlow 2.4.1</strong> when using the built-in functions like <strong>model.fit()</strong> here is my take on it.</p>
<hr />
<p><strong>Issues</strong></p>
<ul>
<li>Loads of RAM usage even though I am running NVIDIA GeForce RTX 2080 TI GP... | Keras occupies an indefinitely increasing amount of memory for each epoch | python-3.x|tensorflow|keras | 12 | 5,948 | 4 | 67,138,072 | 67,138,072 | 9 | true | 2018-12-08T13:48:18.837Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Keras occupies an indefinitely increasing amount of memory for each epoch<p>I'm running a genetic hyperparameter search algorithm and it quickly saturates al... |
53,797,428 | Git push over ssh fails on windows with 'the remote end hung up unexpectedly' error<p>I'm hoping someone can help me, as I've been fighting with this for days, and am stumped. I've set up the standard git client (from git-scm.com) on a brand new laptop running Windows 10, and am working on a repository hosted on Github... | <blockquote>
<p>This, I've managed to solve by explicitly setting the global sshCommand config value as per Adam Ralph's suggestion. </p>
</blockquote>
<p>Yes, but no: try first to use Git in a CMD session where you have put a simplified PATH, one in which the Git bundled openSSH will comes first and with be used (O... | Git push over ssh fails on windows with 'the remote end hung up unexpectedly' error | git|github|ssh | 10 | 1,061 | 3 | 60,658,711 | 60,658,711 | 3 | true | 2018-12-15T21:30:39.663Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Git push over ssh fails on windows with 'the remote end hung up unexpectedly' error<p>I'm hoping someone can help me, as I've been fighting with this for day... |
53,769,102 | How do I add a C# solution file in JetBrains Rider?<p>In Rider, if I open a folder that has a single .csproj file in it, how do I add a solution? Is there a way to do it inside Rider, like there is in Visual Studio, without resorting to the command line and closing/re-opening?</p> | <p>Looks like you can do this with Rider 2019.1 now.</p>
<p>Go to File -> New -> gives the option to add a new solution.</p> | How do I add a C# solution file in JetBrains Rider? | c#|jetbrains-ide|rider | 7 | 10,778 | 2 | 55,925,686 | 55,925,686 | 5 | true | 2018-12-13T19:49:36.137Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I add a C# solution file in JetBrains Rider?<p>In Rider, if I open a folder that has a single .csproj file in it, how do I add a solution? Is there a ... |
53,404,857 | How to place a default file name in the file dialog asksaveasfile python<p>I would like to place a value in the file dialog by default when the user is saving a file. Anyone can advise the syntax of it ?</p>
<pre><code>saveFilePath = fileDialog.asksaveasfile(mode='w', title="Save the file", defaultextension=".txt")
</... | <pre><code>initialfile
</code></pre>
<p>as proposed by Bryan Oakley worked.</p> | How to place a default file name in the file dialog asksaveasfile python | python|tkinter | 7 | 11,018 | 3 | 56,084,552 | 56,084,552 | 10 | true | 2018-11-21T03:28:46.983Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to place a default file name in the file dialog asksaveasfile python<p>I would like to place a value in the file dialog by default when the user is savin... |
53,368,586 | What is Flutter's kernel_blob.bin?<p>Every time I do flutter build, I get a file change in</p>
<p><code>ios/Flutter/flutter_assets/kernel_blob.bin</code></p>
<p>After committing and rebuilding then I get a lot of conflicts because of this file.</p>
<p>What is this file? Should I .gitignore this?</p> | <p>The short answer is that this file is a <a href="https://github.com/dart-lang/sdk/blob/master/pkg/kernel/binary.md" rel="noreferrer">Dart kernel bytecode</a> representation of your app's code generated by a compiler in Flutter's toolchain. When your Dart code changes, you should expect the built <code>kernel_blob.bi... | What is Flutter's kernel_blob.bin? | flutter | 8 | 3,659 | 1 | 56,162,402 | 56,162,402 | 18 | true | 2018-11-19T05:02:22.707Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is Flutter's kernel_blob.bin?<p>Every time I do flutter build, I get a file change in</p>
<p><code>ios/Flutter/flutter_assets/kernel_blob.bin</code></p... |
53,797,906 | broadcasting laravel event and multiple channels<p>I am new in laravel so I googled a lot for different approaches how to create websocket with redis, socket.io in laravel framework.
And finally my websocket works as I expected. However I still have unanswered questions related with websockets.
Could you please help me... | <p>It's very easy! just return arrays of Channels in broadcastOn method
I just did this:
Example:</p>
<pre><code>public function broadcastOn()
{
return [
new PrivateChannel('App.Message.' . $this->message->to_user_id),
new PrivateChannel('App.Message.'. $this->message->to_user_id .'.F... | broadcasting laravel event and multiple channels | laravel|redis|socket.io | 13 | 5,407 | 1 | 55,398,957 | 55,398,957 | 29 | true | 2018-12-15T22:48:18.543Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
broadcasting laravel event and multiple channels<p>I am new in laravel so I googled a lot for different approaches how to create websocket with redis, socket... |
38,057,526 | Export AWS configuration as CloudFormation template<p>I´m using AWS CLI and CloudFormation, and I could not find any reference in the documentation.</p>
<p>Does anybody know if it´s possible to create a CloudFormation template from a current configuration.</p>
<p>Let´s say that I want to get a CloudFormation template f... | <p>Based on our experience we found 3 possible ways to translate existing manually deployed (from Web Console UI) AWS infra to Cloudformation (CF).</p>
<ol>
<li><p>Using a new CloudFormation native introduced feature (since Nov 2019) that allows you to <a href="https://aws.amazon.com/blogs/aws/new-import-existing-resou... | Export AWS configuration as CloudFormation template | amazon-web-services|amazon-cloudformation | 34 | 25,611 | 4 | 55,764,927 | 55,764,927 | 27 | true | 2016-06-27T15:12:51.820Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Export AWS configuration as CloudFormation template<p>I´m using AWS CLI and CloudFormation, and I could not find any reference in the documentation.</p>
<p>D... |
53,627,762 | error TS2304: Cannot find name 'InputEvent'<p>As described in <a href="https://stackoverflow.com/questions/49714315/does-typescript-have-type-definitions-for-inputevent">Does TypeScript have type definitions for InputEvent?</a>, I tried to use <a href="https://www.npmjs.com/package/@types/dom-inputevent" rel="noreferre... | <p>I had the same problem trying to use @types/dom-inputevent in unit tests for an Angular 6 app. In my case, the cause was that I had an explicit 'types' entry in my tsconfig.spec.js, as outlined below.</p>
<p><strong>tsconfig.json</strong> (irrelevant parts omitted)</p>
<pre><code>{
"compilerOptions": {
"typ... | error TS2304: Cannot find name 'InputEvent' | angular|typescript|typescript-typings | 14 | 6,203 | 1 | 55,221,421 | 55,221,421 | 7 | true | 2018-12-05T08:08:58.807Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
error TS2304: Cannot find name 'InputEvent'<p>As described in <a href="https://stackoverflow.com/questions/49714315/does-typescript-have-type-definitions-for... |
37,872,212 | Vue-i18n with HTML in named params<p>Suppose I have this message object:</p>
<p><code>{greetings: '{blah} is welcome'}
</code></p>
<p>How can I inject HTML into that <code>{blah}</code>param?</p>
<p>I tried this, but it doesn't work:</p>
<p><code>{{ $t('greetings', {blah: '<foo>' + some_string + '</foo>... | <p>Be cautious of the [previously] accepted answer, as untrusted input will lead to XSS vulnerabilities. The correct way to do this is with <a href="https://kazupon.github.io/vue-i18n/guide/interpolation.html" rel="noreferrer">component interpolation</a>. It works a little bit like slots.</p>
<p>Here's a practical exam... | Vue-i18n with HTML in named params | vue.js | 17 | 14,898 | 5 | 54,749,964 | 54,749,964 | 23 | true | 2016-06-17T02:32:52.273Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Vue-i18n with HTML in named params<p>Suppose I have this message object:</p>
<p><code>{greetings: '{blah} is welcome'}
</code></p>
<p>How can I inject HTML... |
53,623,472 | How do I display a single image in PyTorch?<p>How do I display a PyTorch <code>Tensor</code> of shape <code>(3, 224, 224)</code> representing a 224x224 RGB image?
Using <code>plt.imshow(image)</code> gives the error:</p>
<blockquote>
<p>TypeError: Invalid dimensions for image data</p>
</blockquote> | <p>Given a <code>Tensor</code> representing the image, use <a href="https://pytorch.org/docs/stable/generated/torch.permute.html#torch.permute" rel="noreferrer"><code>.permute()</code></a> to put the channels as the last dimension:</p>
<pre><code>plt.imshow( tensor_image.permute(1, 2, 0) )
</code></pre>
<p>Note: <a h... | How do I display a single image in PyTorch? | python|matplotlib|pytorch | 60 | 115,503 | 8 | 55,196,345 | 55,196,345 | 115 | true | 2018-12-05T00:33:01.400Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I display a single image in PyTorch?<p>How do I display a PyTorch <code>Tensor</code> of shape <code>(3, 224, 224)</code> representing a 224x224 RGB i... |
53,460,002 | How to use dotnet restore properly in Dockerfile<p>When adding docker support to a ASP.NET Core project VS (15.9.2) will add a default Dockerfile that does restore, build and publish. But instead of just copying all files into the Docker build container it first copies just the proj-files, does the restore and then co... | <p>When Docker builds an image, it maintains a <a href="https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#leverage-build-cache" rel="noreferrer">build cache</a>:</p>
<blockquote>
<p>When building an image, Docker steps through the instructions in your Dockerfile, executing each in the order s... | How to use dotnet restore properly in Dockerfile | asp.net-core|dockerfile | 11 | 5,174 | 1 | 54,832,279 | 54,832,279 | 15 | true | 2018-11-24T16:11:27.610Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use dotnet restore properly in Dockerfile<p>When adding docker support to a ASP.NET Core project VS (15.9.2) will add a default Dockerfile that does r... |
53,456,839 | how can export material-ui table to CSV?<p>someone of you can explain me how to export a material-ui-table to CSV file ?</p>
<pre><code> <Paper>
<Table>
<TableHead>
<TableRow>
<TableCell>A</TableCell>
<TableCell >B</TableCell>
... | <p>On Material-UI's <a href="https://material-ui.com/components/tables/#complementary-projects" rel="nofollow noreferrer">tables page 'Complementary projects' section</a> they recommend on using <a href="https://github.com/mbrn/material-table" rel="nofollow noreferrer">material-table</a>.</p>
<p>One of material-table'... | how can export material-ui table to CSV? | reactjs|csv|export|material-ui | 7 | 11,780 | 4 | 57,835,460 | 57,835,460 | 3 | true | 2018-11-24T09:26:26.887Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how can export material-ui table to CSV?<p>someone of you can explain me how to export a material-ui-table to CSV file ?</p>
<pre><code> <Paper>
... |
53,776,957 | Webpack 4: Conditionally enabling PostCSS plugins<p>I've integrated PostCSS into Webpack, using a separate <code>postcss.config.js</code> file.</p>
<p>I want to enable <code>cssnano</code> when doing production builds, and disable it for development builds. How can I do this?</p>
<p>Here is my <strong>webpack.config.... | <p>In your <strong><code>postcss.config.js</code></strong> you can do <a href="https://github.com/michael-ciniawsky/postcss-load-config#array" rel="nofollow noreferrer">checking for the environment property</a>:</p>
<pre class="lang-js prettyprint-override"><code>module.exports = ({ env }) => ({
plugins: [
re... | Webpack 4: Conditionally enabling PostCSS plugins | javascript|node.js|webpack|webpack-4|postcss | 7 | 4,134 | 2 | 57,960,799 | 57,960,799 | 3 | true | 2018-12-14T09:35:38.283Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Webpack 4: Conditionally enabling PostCSS plugins<p>I've integrated PostCSS into Webpack, using a separate <code>postcss.config.js</code> file.</p>
<p>I wan... |
44,110,633 | Device not configured after sshfs attempt<p>After using sshfs on my Mac I am no longer able to see my user directory.</p>
<p>When I open a terminal window I see the following:</p>
<pre><code>Last login: Mon May 22 10:54:30 on ttys003
mkdir: /Users/<username>/.bash_sessions: Device not configured
-bash: /Users/&... | <p>I used to use <code>sshfs</code> and got this error; the only way to fix it I found without rebooting was:</p>
<pre><code>sudo diskutil umount force /path/to/mount
</code></pre>
<p>I've recently been trying <a href="https://github.com/spion/adbfs-rootless" rel="noreferrer">https://github.com/spion/adbfs-rootless<... | Device not configured after sshfs attempt | macos-sierra|user-profile|tunnel|ssh-tunnel | 8 | 7,698 | 2 | 57,612,218 | 57,612,218 | 20 | true | 2017-05-22T10:31:30.337Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Device not configured after sshfs attempt<p>After using sshfs on my Mac I am no longer able to see my user directory.</p>
<p>When I open a terminal window I... |
37,749,378 | Integrate OpenCV webcam into a Kivy user interface<p>My current program is in Python and uses OpenCV. I rely on webcam captures and I am processing every captured frame:</p>
<pre><code>import cv2
# use the webcam
cap = cv2.VideoCapture(0)
while True:
# read a frame from the webcam
ret, img = cap.read()
# ... | <p>Found this example here: <a href="https://groups.google.com/forum/#!topic/kivy-users/N18DmblNWb0" rel="noreferrer">https://groups.google.com/forum/#!topic/kivy-users/N18DmblNWb0</a></p>
<p>It converts the opencv captures to kivy textures, so you can do every kind of cv transformations before displaying it to your k... | Integrate OpenCV webcam into a Kivy user interface | python|user-interface|opencv|kivy | 8 | 22,592 | 2 | 54,119,556 | 54,119,556 | 19 | true | 2016-06-10T13:20:18.470Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Integrate OpenCV webcam into a Kivy user interface<p>My current program is in Python and uses OpenCV. I rely on webcam captures and I am processing every cap... |
53,664,279 | Converting .tflite to .pb<p><strong>Problem</strong>: How can i convert a <code>.tflite</code> (serialised flat buffer) to <code>.pb</code> (frozen model)? The <a href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/g3doc/convert/cmdline_examples.md" rel="noreferrer">documentation</a> only talks a... | <p>I found the answer <a href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/g3doc/convert/python_api.md#tensorflow-lite-python-interpreter-" rel="noreferrer">here</a></p>
<p>We can use Interpreter to analysis the model and the same code looks like following:</p>
<pre><code>import numpy as np
i... | Converting .tflite to .pb | tensorflow|tensorboard|tensorflow-lite | 7 | 11,560 | 3 | 54,264,023 | 54,264,023 | 10 | true | 2018-12-07T06:19:04.743Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Converting .tflite to .pb<p><strong>Problem</strong>: How can i convert a <code>.tflite</code> (serialised flat buffer) to <code>.pb</code> (frozen model)? T... |
53,500,219 | spring-security-oauth2 vs spring-cloud-starter-oauth2<p>I am working on building an oAuth2 application using spring boot. However, there are various sample projects in Github using <code>spring-security-oauth2</code> and <code>spring-cloud-starter-oauth2</code>.<br>
Do we have specific scenarios where we can use a spec... | <p>To resolve complex dependency management, Spring Boot starters were introduced. Starter POMs are a set of dependency descriptors (combines multiple commonly used dependencies into one POM) which otherwise you could also manually include in your application individually. Starters are available for web, test, data jpa... | spring-security-oauth2 vs spring-cloud-starter-oauth2 | spring-boot|oauth-2.0|spring-cloud|spring-security-oauth2 | 13 | 9,506 | 2 | 54,112,743 | 54,112,743 | 18 | true | 2018-11-27T12:54:36.687Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
spring-security-oauth2 vs spring-cloud-starter-oauth2<p>I am working on building an oAuth2 application using spring boot. However, there are various sample p... |
53,461,316 | pyrebase install on windows Python 3.7 fails<p>I just installed python 3.7 64 bits on windows 10 for all u
sers and modified the PATH
I updated the pip to 18.1
I installed pygame, with</p>
<p><code>py -3 -m pip install pygame</code></p>
<p>it works fine</p>
<p>I wanted to install pyrebase with</p>
<p><code>py -3 -m... | <p>To install <a href="https://github.com/thisbejim/Pyrebase" rel="noreferrer">https://github.com/thisbejim/Pyrebase</a></p>
<p>I needed to download the .zip file (or Git) than manually install it after modifying the <code>setup.py</code> by specifying the latest <code>'pycryptodome==3.7.3'</code>
then copy the pyre... | pyrebase install on windows Python 3.7 fails | python-3.x|pyrebase | 11 | 25,159 | 12 | 54,480,973 | 54,480,973 | 18 | true | 2018-11-24T18:46:08.003Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
pyrebase install on windows Python 3.7 fails<p>I just installed python 3.7 64 bits on windows 10 for all u
sers and modified the PATH
I updated the pip to 18... |
44,190,607 | How do you find the cluster & service CIDR of a Kubernetes cluster?<p>How do you find the cluster/service CIDR for a Kubernetes cluster, once it is already running?</p>
<p>I know for Minikube, it is 10.0.0.1/24.</p>
<p>For GKE, you can find out via</p>
<pre><code>gcloud container clusters describe XXXXXXX --zone=XXX... | <p>Get Services IPs range</p>
<pre><code>kubectl cluster-info dump | grep -m 1 service-cluster-ip-range
</code></pre>
<p>You will see something like e.g. --service-cluster-ip-range=xxx.yy.0.0/13 </p>
<p>Get Pods IPs range </p>
<pre><code>kubectl cluster-info dump | grep -m 1 cluster-cidr
</code></pre>
<p>You will ... | How do you find the cluster & service CIDR of a Kubernetes cluster? | kubernetes|kubectl | 37 | 35,643 | 8 | 54,183,373 | 54,183,373 | 54 | true | 2017-05-25T22:13:05.413Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do you find the cluster & service CIDR of a Kubernetes cluster?<p>How do you find the cluster/service CIDR for a Kubernetes cluster, once it is already r... |
53,538,141 | What is the proper number of stripes for Guava Striped?<p>I want to provide locking access to a resource using Guava Striped Lock. E.g.</p>
<pre><code>Striped<Lock> keyLocks = Striped.lazyWeakLock(10)
Lock lock = keyLocks.get("resourceId")
// use lock...
</code></pre>
<p>I cannot find any guide how to choose th... | <p>There's no a general rule of thumb, it depends on a trade-off between concurrency level and memory consumption. The <code>Striped</code> JavaDoc partially explains it:</p>
<blockquote>
<p>A striped <code>Lock/Semaphore/ReadWriteLock</code>. This offers the underlying
lock striping similar to that of <code>Concu... | What is the proper number of stripes for Guava Striped? | java|concurrency|locking|guava | 9 | 2,055 | 1 | 54,190,063 | 54,190,063 | 0 | true | 2018-11-29T11:35:55.420Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the proper number of stripes for Guava Striped?<p>I want to provide locking access to a resource using Guava Striped Lock. E.g.</p>
<pre><code>Strip... |
53,541,154 | ObjectInputStream readObject causes RoundingMode.ordinal NullPointerException<p><strong>EDIT</strong>: it seems to be a problem related to Android Pie (api 28). Seems to work on previous versions (tested on 27, 26, 25). </p>
<hr>
<p>I'm working at this Android code for a very long time, and I noticed that lately when... | <p>We found that this was caused by a custom <code>DataFormatter</code> object (within a containing, serialized object) that relies on a <code>java.text.DecimalFormat</code>. When we went to deserialize the object (sometimes but not always, but apparently dependent on how many times the containing object had been pass... | ObjectInputStream readObject causes RoundingMode.ordinal NullPointerException | java|android | 7 | 837 | 1 | 54,155,356 | 54,155,356 | 9 | true | 2018-11-29T14:23:30.023Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ObjectInputStream readObject causes RoundingMode.ordinal NullPointerException<p><strong>EDIT</strong>: it seems to be a problem related to Android Pie (api 2... |
53,568,659 | ActivityMainBindingImpl cannot be found<p>This is from the google site:
A binding class is generated for each layout file. By default, the name of the class is based on the name of the layout file, converting it to Pascal case and adding the Binding suffix to it. The above layout filename is activity_main.xml so the co... | <p>The likely cause is an error in the data binding stage.</p>
<p>The data binding compiler takes layout files and generates classes to support data binding (as you note: <code>ActivityMainBinding</code>, <code>ActivityMainBindingImpl</code>; the general pattern, dear readers, is <code>{<i>layout</i>}Binding</code> a... | ActivityMainBindingImpl cannot be found | android|android-databinding|kotlin-android-extensions | 19 | 15,934 | 3 | 54,228,405 | 54,228,405 | 26 | true | 2018-12-01T07:17:21.337Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ActivityMainBindingImpl cannot be found<p>This is from the google site:
A binding class is generated for each layout file. By default, the name of the class ... |
53,415,353 | React + Redux-Observable + Typescript - Compilation, Argument Not Assignable Error<p>I am creating an app using React and Redux-Observable. I am new to this and I am trying to create an epic to execute the user login.</p>
<p>My epic is below:</p>
<pre><code>export const loginUserEpic = (action$: ActionsObservable<... | <p>The <code>ofType</code> operator offered by <code>redux-observable</code> is not the best way to discriminate union types. A much better way is to use the <code>isOfType</code> function provided by <a href="https://github.com/piotrwitek/typesafe-actions" rel="noreferrer"><code>typesafe-actions</code></a>.</p>
<pre>... | React + Redux-Observable + Typescript - Compilation, Argument Not Assignable Error | reactjs|typescript|rxjs|redux-observable | 11 | 7,730 | 3 | 54,279,344 | 54,279,344 | 12 | true | 2018-11-21T15:28:37.387Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React + Redux-Observable + Typescript - Compilation, Argument Not Assignable Error<p>I am creating an app using React and Redux-Observable. I am new to this ... |
53,766,100 | How to properly handle unauthenticated users and requests in AWS Amplify/AppSync React apps?<p>I am having a very hard time to figure out how to handle unauthenticated users in a React app which uses AWS Amplify and AWS AppSync. Seems like most docs suggest to wrap the whole app with <code>withAuthenticator</code> HOC ... | <ol>
<li><p>Make sure to update your authentication settings to enable both authenticated and unauthenticated access by running <code>amplify update auth</code> and configuring the settings manually.</p>
</li>
<li><p>In an API request, you can now specify the auth mode:</p>
</li>
</ol>
<pre class="lang-js prettyprint-o... | How to properly handle unauthenticated users and requests in AWS Amplify/AppSync React apps? | reactjs|amazon-web-services|aws-appsync|aws-amplify | 9 | 9,499 | 3 | 54,489,132 | 54,489,132 | 13 | true | 2018-12-13T16:22:35.953Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to properly handle unauthenticated users and requests in AWS Amplify/AppSync React apps?<p>I am having a very hard time to figure out how to handle unaut... |
53,483,599 | React Navigation pass params to nested stackNavigator<p>In react navigation 3.0 they added the feature to pass default params to screen. The problem is that I want to pass those params to a nested stackNavigator but I can't figure out how to do so.
These are my navigators:
MainDrawer.js:</p>
<pre><code> const MyDra... | <p>To access props of the parent you can use <code>this.props.navigation.dangerouslyGetParent().getParam('type');</code>
now you can access any prop of the parent.</p>
<p><strong>EDIT:</strong></p>
<p>Not sure if this will work with react-navigation v5 but give it a try</p> | React Navigation pass params to nested stackNavigator | react-native|react-navigation|expo|stack-navigator | 8 | 10,268 | 2 | 54,201,900 | 54,201,900 | 15 | true | 2018-11-26T14:47:13.217Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React Navigation pass params to nested stackNavigator<p>In react navigation 3.0 they added the feature to pass default params to screen. The problem is that ... |
53,790,994 | Bulk update via raw query in TypeORM<p>How can I do bulk update via raw query in TypeORM?<br>
For example we have model <em>User</em> with property <em>name</em><br>
How can I change names of few users in one transaction? <br></p>
<p>typeorm version: <strong>0.2.7</strong><br>
database: <strong>postgress</strong></p> | <p>To bulk update, you can use update with set method, it is always recommended to not use raw queries when you can use orm functions.</p>
<pre class="lang-js prettyprint-override"><code>
import {getConnection, In} from "typeorm";
const userIds = [1,2,3];
await getConnection()
.createQueryBuilder()
.update(User)
... | Bulk update via raw query in TypeORM | node.js|typeorm|bulkupdate | 10 | 22,848 | 5 | 62,125,466 | 62,125,466 | 24 | true | 2018-12-15T09:04:12.357Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Bulk update via raw query in TypeORM<p>How can I do bulk update via raw query in TypeORM?<br>
For example we have model <em>User</em> with property <em>name<... |
44,028,912 | Incorporate Keycloak login into SPA<p>We're currently evaluating Keycloak as our SSO solution and while it works for our servlet-based applications there's a question regarding our (React-based) SPAs.</p>
<p>What our designers want: as an example let's say we have an email client spa. The user is in the process of wri... | <p>For someone who comes back to this question,</p>
<p>I think it's better to stick to the best practice for oAuth2/OpenId Connect for SPAs which is currently "Authorization Code Flow" with PKCE.</p>
<p><a href="https://oauth.net/2/pkce/" rel="nofollow noreferrer">https://oauth.net/2/pkce/</a></p>
<p><a href=... | Incorporate Keycloak login into SPA | reactjs|single-sign-on|single-page-application|keycloak | 10 | 6,981 | 2 | 59,862,626 | 59,862,626 | 2 | true | 2017-05-17T15:20:28.443Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Incorporate Keycloak login into SPA<p>We're currently evaluating Keycloak as our SSO solution and while it works for our servlet-based applications there's a... |
53,355,638 | Django Custom User --- Edit new CustomUser fields in admin<p>I am trying to expand on the tutorial by William Vincent, posted below:</p>
<p><a href="https://wsvincent.com/django-custom-user-model-tutorial/" rel="noreferrer">https://wsvincent.com/django-custom-user-model-tutorial/</a></p>
<p>I am trying to add new fie... | <p>The 'fieldsets +' approach is much better than having to write out all the default fields again.</p>
<pre><code>fieldsets = UserAdmin.fieldsets + (
(None, {'fields': ('some_extra_data',)}),
)
</code></pre> | Django Custom User --- Edit new CustomUser fields in admin | python|django|admin | 12 | 7,445 | 3 | 58,981,051 | 58,981,051 | 13 | true | 2018-11-17T21:13:00.430Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Django Custom User --- Edit new CustomUser fields in admin<p>I am trying to expand on the tutorial by William Vincent, posted below:</p>
<p><a href="https:/... |
53,598,308 | Webp and <picture><source will not work for me on chrome<p>I'm facing a problem, I just can't seem to find out what the problem is, I have:</p>
<pre><code><picture>
<source type="image/webp" srcset="/images/meh_logo.webp">
<img src="/images/meh_logo.png" type="image/png">
</picture>
</c... | <p>The WEBP is a tree. The PNG is a rose. You used the code below...</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code><picture>
<source type="image/webp" srcset=... | Webp and <picture><source will not work for me on chrome | html|webp | 7 | 4,097 | 2 | 59,138,725 | 59,138,725 | 1 | true | 2018-12-03T16:54:14.353Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Webp and <picture><source will not work for me on chrome<p>I'm facing a problem, I just can't seem to find out what the problem is, I have:</p>
<pre><code>&... |
71,215,099 | Trying to make a a script that spawns that spawns a prefab object<p>I have been trying to make a script that would drop prefabs at a random time in a random place in the y position so if anyone would be able to help me with this or tweak my code it would be greatly apprenticed</p>
<pre><code> using System.Collection... | <p>Hmm, wow there is a lot of explaining here. Welcome to Unity... er, welcome to programming!</p>
<ul>
<li><p>You need to have Update be capitalized for it to be recognized as the Unity update loop.</p>
</li>
<li><p>Also, you want to subtract Time.deltaTime from time between.. not from 1.</p>
</li>
<li><p>Also, you wa... | Trying to make a a script that spawns that spawns a prefab object | c#|unity3d|visual-studio-code|game-development | -3 | 39 | 1 | 71,215,511 | 71,215,511 | 0 | true | 2022-02-22T01:59:07.600Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Trying to make a a script that spawns that spawns a prefab object<p>I have been trying to make a script that would drop prefabs at a random time in a random ... |
71,277,763 | MySQL : How to I, join this table?<p>I have table like this, and i want to output the result like output table, can anyone tell me how to do it, in MySQL</p>
<p><a href="https://i.stack.imgur.com/lXxO5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lXxO5.png" alt="enter image description here" /></a... | <p>You can use left join like so :</p>
<pre><code>SELECT tb_session.SESSION AS SESSION, tb_class.CLASS AS CLASS from tb_schedul LEFT JOIN tb_session ON tb_schedule.ID_SESSION = tb_session.ID LEFT JOIN tb_schedul.ID_CLASS = tb_class.ID
</code></pre> | MySQL : How to I, join this table? | mysql|sql|join | -3 | 37 | 2 | 71,277,827 | 71,277,827 | 0 | true | 2022-02-26T15:11:01.987Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
MySQL : How to I, join this table?<p>I have table like this, and i want to output the result like output table, can anyone tell me how to do it, in MySQL</p>... |
71,198,478 | Counting all combinations of values in multiple columns<p>The following is an example of items rated by 1,2 or 3 stars.
I am trying to count all combinations of item ratings (stars) per month.</p>
<p>In the following example, item 10 was rated in month 1 and has two ratings equal 1, one rating equal 2 and one rating eq... | <p>This seems like a nice problem for <a href="https://pandas.pydata.org/docs/reference/api/pandas.get_dummies.html" rel="nofollow noreferrer"><code>pd.get_dummies</code></a>:</p>
<pre><code>new_df = (
pd.concat([df, pd.get_dummies(df['star'])], axis=1)
.groupby(['month', 'item'], as_index=False)
[df['star'... | Counting all combinations of values in multiple columns | python|pandas | 9 | 783 | 4 | 71,209,097 | 71,209,097 | 1 | true | 2022-02-20T20:29:18.897Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Counting all combinations of values in multiple columns<p>The following is an example of items rated by 1,2 or 3 stars.
I am trying to count all combinations... |
71,362,790 | how to send smtp email in fresh laravel 9 project<p>I just wanted to send mails through my gmail account
I have newly created fresh laravel 9 project guide me to send mails in easy steps</p>
<p>i was able to do in laravel 8 but in 9 it dosen't work like that</p>
<p>Thank you all</p> | <p>First you should set your mail configuration in your <code>.env</code></p>
<pre><code>MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
MAIL_USERNAME=mygoogle@gmail.com
MAIL_PASSWORD=rrnnucvnqlbsl
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=mygoogle@gmail.com
MAIL_FROM_NAME="${APP_NAME}"
</code></pre>
<p>T... | how to send smtp email in fresh laravel 9 project | php|laravel|laravel-9 | -3 | 780 | 1 | 71,363,323 | 71,363,323 | 1 | true | 2022-03-05T13:58:04.600Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to send smtp email in fresh laravel 9 project<p>I just wanted to send mails through my gmail account
I have newly created fresh laravel 9 project guide m... |
71,387,469 | Database structure and query building<p>Please advise how to accomplish this task.</p>
<p>There is an entity - the user.
He can create a group in which there will be other users with certain rights.</p>
<p>Here I'm interested in how to correctly cost requests to get groups for the user and guest.</p>
<p>I assume that t... | <p>From a database standpoint, I see tables:</p>
<p><strong>User table</strong></p>
<pre><code>Userid (PK)
UserName
UserPhoto
</code></pre>
<p><strong>Group table</strong></p>
<pre><code>Groupid (PK)
GroupName
</code></pre>
<p><strong>Rights table</strong></p>
<pre><code>Rightid (PK)
RightName
</code></pre>
<p><strong>... | Database structure and query building | database|database-design|backend | -3 | 35 | 1 | 71,390,734 | 71,390,734 | 1 | true | 2022-03-07T21:27:45.530Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Database structure and query building<p>Please advise how to accomplish this task.</p>
<p>There is an entity - the user.
He can create a group in which there... |
71,376,574 | How can we insert a character to a string in c++?<p>INPUT STRING</p>
<pre><code>ABCE
</code></pre>
<p>INPUT CHAR</p>
<pre><code>D
</code></pre>
<p>OUTPUT STRING</p>
<pre><code>ABCDE
</code></pre>
<p>It should run for all sizes , and it should be a standard procedure ie run for all the cases.
Can anyone Help me with thi... | <p>You should try the <code>std::string::insert(..)</code>. Check out the <a href="https://www.cplusplus.com/reference/string/string/insert/" rel="nofollow noreferrer">documentation</a></p>
<pre><code>#include <iostream>
#include <string>
int main() {
std::string str("ABCE");
std::cout &l... | How can we insert a character to a string in c++? | c++|string|append | -3 | 41 | 1 | 71,376,644 | 71,376,644 | 1 | true | 2022-03-07T04:55:33.653Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can we insert a character to a string in c++?<p>INPUT STRING</p>
<pre><code>ABCE
</code></pre>
<p>INPUT CHAR</p>
<pre><code>D
</code></pre>
<p>OUTPUT STR... |
71,409,951 | How do I change sections in HTML without getting '#' in the Link?<h1>Hi</h1>
<p>So, while making a website I noticed that when I am redirecting between sections in HTML using 'a' tag I am getting the link as <em>'www.example.com#section'</em>.'</p>
<p>This is the code:</p>
<pre><code><a href="#section">... | <p>This is just how URLs work.</p>
<ul>
<li><code>https://</code> determines how to ask for the resource</li>
<li><code>www.example.com</code> determines what server to ask for it from</li>
<li><code>/some/path/?query=optional</code> determines what to ask the server for</li>
<li><code>#fragment</code> is handled clien... | How do I change sections in HTML without getting '#' in the Link? | html | -5 | 33 | 1 | 71,410,003 | 71,410,003 | 1 | true | 2022-03-09T13:15:02.533Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I change sections in HTML without getting '#' in the Link?<h1>Hi</h1>
<p>So, while making a website I noticed that when I am redirecting between secti... |
71,111,733 | How i convert USD to ETH using json?<p>I used this API but it displays BTC. I want to convert USD to ETH</p>
<pre><code><?php
$url = "https://blockchain.info/tobtc?currency=USD&value=2000";
$stats = json_decode(file_get_contents($url), true);
echo "$stats BTC";
?>
</code></pre> | <p>with this api you cant convert to ETH because this api is only meant to convert a currency to Bitcoin</p>
<p>if you look at the documantation of the api you call<br>
<a href="https://www.blockchain.com/api/exchange_rates_api" rel="nofollow noreferrer">https://www.blockchain.com/api/exchange_rates_api</a></p>
<p>it s... | How i convert USD to ETH using json? | php|json | -3 | 257 | 1 | 71,111,956 | 71,111,956 | 2 | true | 2022-02-14T12:12:55.297Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How i convert USD to ETH using json?<p>I used this API but it displays BTC. I want to convert USD to ETH</p>
<pre><code><?php
$url = "https://blockch... |
71,148,744 | Remove elements in elements of alist Python<p>I have a list that looks like that:</p>
<pre><code>[{'ip': 'x.x.x.x',
'error': True,
'reason': 'Reserved IP Address',
'reserved': True,
'version': 'IPv4'},
{'ip': 'x.x.x.x',
'error': True,
'reason': 'Reserved IP Address',
'reserved': True,
'version': 'IPv4'... | <p>Try with list comprehension:</p>
<pre><code>>>> [d for d in mylist if not d.get("error") and d.get("reason")!="Reserved IP Address"]
</code></pre> | Remove elements in elements of alist Python | python|json|list | -3 | 40 | 2 | 71,148,783 | 71,148,783 | 2 | true | 2022-02-16T20:17:58.023Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Remove elements in elements of alist Python<p>I have a list that looks like that:</p>
<pre><code>[{'ip': 'x.x.x.x',
'error': True,
'reason': 'Reserved IP... |
71,205,392 | how do i write a code in python that compares two strings A and B<p>How can I compare two strings <code>A</code> and <code>B</code>, such that it will print <code>'true'</code> if ALL the letters in <code>A</code> are in <code>B</code> but print <code>'false'</code> if not. Note the two strings may not be of equal leng... | <p>You can convert your string to <a href="https://docs.python.org/3/tutorial/datastructures.html#sets" rel="nofollow noreferrer">set()</a>:</p>
<pre><code>A = "fedca"
B = "abcdefg"
if set(A) <= set(B):
print("All the letters of A are contained in B")
</code></pre> | how do i write a code in python that compares two strings A and B | python | -4 | 37 | 1 | 71,205,468 | 71,205,468 | 2 | true | 2022-02-21T11:16:32.070Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how do i write a code in python that compares two strings A and B<p>How can I compare two strings <code>A</code> and <code>B</code>, such that it will print ... |
71,319,628 | Is there any way for a toggle to operate on a member of a binding?<p>So let's say I have a data type like this:</p>
<pre><code>struct Foo {
var isOn: Bool
}
</code></pre>
<p>And I want to have a toggle which operates on the <code>isOn</code> member - something like this:</p>
<pre><code>struct MyView: View {
@Bi... | <p>You didn't use the argument label. Fix that to make it compile and it will work fine.</p>
<pre class="lang-swift prettyprint-override"><code>Toggle("is on?", isOn: $model.isOn)
</code></pre>
<pre class="lang-swift prettyprint-override"><code>struct ContentView: View {
@State var model = Foo(isOn: false)
... | Is there any way for a toggle to operate on a member of a binding? | swiftui|combine | -4 | 41 | 1 | 71,319,837 | 71,319,837 | 2 | true | 2022-03-02T08:35:33.070Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there any way for a toggle to operate on a member of a binding?<p>So let's say I have a data type like this:</p>
<pre><code>struct Foo {
var isOn: Bool... |
71,221,388 | Numpy comparing vectors of length m and n resulting in boolean matrix of size m,n<p>I am wondering if there is a more efficient way to run the comparison (or really many other functions) using numpy.</p>
<pre><code>a = np.array([1,2,5,7])
b = np.array([0,4,6])
np.repeat(a, len(b)).reshape(-1, len(b)) > b
> arra... | <p>You can use <strong>broadcasting</strong> to make this operation more efficient. Indeed, <code>repeat</code> creates a new temporary array. Here is the resulting code:</p>
<pre class="lang-py prettyprint-override"><code>a.reshape(-1, 1) > b
</code></pre> | Numpy comparing vectors of length m and n resulting in boolean matrix of size m,n | python|numpy | -3 | 34 | 1 | 71,221,569 | 71,221,569 | 3 | true | 2022-02-22T12:32:56.750Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Numpy comparing vectors of length m and n resulting in boolean matrix of size m,n<p>I am wondering if there is a more efficient way to run the comparison (or... |
71,344,469 | Get php session data<p>I set a php session like such:</p>
<pre><code>session_start();
$_SESSION['user_auth'] = [
"email" => $resultObj->email,
"displayName" => $resultObj->displayName,
"token" => $resultObj->token
];
</code></pre>
<p>I can't find anything in m... | <p>It's a 2d array so you can access it as you'd normally do for array types.</p>
<p>Like</p>
<pre class="lang-php prettyprint-override"><code>echo $_SESSION['user_auth']["email"];
echo $_SESSION['user_auth']["displayName"];
echo $_SESSION['user_auth']["token"];
</code></pre> | Get php session data | php | -3 | 29 | 1 | 71,344,546 | 71,344,546 | 3 | true | 2022-03-03T22:17:55.393Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get php session data<p>I set a php session like such:</p>
<pre><code>session_start();
$_SESSION['user_auth'] = [
"email" => $resultObj->e... |
71,230,014 | modify variable from previous object spread<p>Say we have this:</p>
<pre><code>interface Seed {
val: number
}
</code></pre>
<p>and we can accept an argument:</p>
<pre><code>const incrementSeedVal = (v: Seed) : Seed => {
return {...v, ...{val: v.val + 1}}
}
</code></pre>
<p>I am looking for a way to make this ev... | <p><s>Two</s> <em>Three</em> alternatives:</p>
<pre class="lang-js prettyprint-override"><code>const incrementSeedVal = (v: Seed): Seed => {
return {
...v,
val: v.val + 1
}
}
</code></pre>
<p>or</p>
<pre class="lang-js prettyprint-override"><code>const incrementSeedVal = ({ val, ...rest }: Seed): Seed =&... | modify variable from previous object spread | javascript|node.js | -3 | 37 | 1 | 71,230,056 | 71,230,056 | 3 | true | 2022-02-23T00:34:31.200Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
modify variable from previous object spread<p>Say we have this:</p>
<pre><code>interface Seed {
val: number
}
</code></pre>
<p>and we can accept an argume... |
71,284,214 | @RequestMapping annotation not allowed on @FeignClient interfaces<p>I'm having trouble with this! As I've been reading, it happens because it's no longer accepted. But how can I solved it?
This is the code I've been trying to map.</p>
<pre><code>@FeignClient(name = "product-service")
@RequestMapping("api... | <p>You can use the <code>path</code> attribute of <code>@FeignClient</code> to define the path prefix to be added to all the APIs. The documentation is <a href="https://www.javadoc.io/doc/org.springframework.cloud/spring-cloud-openfeign-core/latest/org/springframework/cloud/openfeign/FeignClient.html" rel="noreferrer">... | @RequestMapping annotation not allowed on @FeignClient interfaces | spring-boot|spring-cloud-feign|request-mapping | 7 | 3,358 | 1 | 71,284,549 | 71,284,549 | 6 | true | 2022-02-27T11:05:57.367Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
@RequestMapping annotation not allowed on @FeignClient interfaces<p>I'm having trouble with this! As I've been reading, it happens because it's no longer acc... |
71,292,714 | Why does the type signature of linear array change compared to normal array?<p>I'm going through an example in <a href="https://homepages.inf.ed.ac.uk/wadler/papers/lineartaste/lineartaste-revised.pdf" rel="noreferrer">A Taste of Linear Logic</a>.</p>
<p>It first introduces the standard array with the usual operations ... | <p>In practical terms, this is about garbage collection.</p>
<p>Linear logic avoids making copies as well as leaving unused values lying around. So when you create an array with <code>new</code>, you also need to make sure it's eventually cleaned up again.</p>
<p>How can you make sure it is cleaned up? Well, in this ex... | Why does the type signature of linear array change compared to normal array? | arrays|haskell|linear-types | 7 | 260 | 1 | 71,292,979 | 71,292,979 | 7 | true | 2022-02-28T09:13:49.643Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does the type signature of linear array change compared to normal array?<p>I'm going through an example in <a href="https://homepages.inf.ed.ac.uk/wadler... |
71,324,714 | Breakpoints not working with Flutter in Android Studio<p>I can set breakpoints, but when I run in Debug mode the breakpoint's icon change with this:</p>
<p><a href="https://i.stack.imgur.com/SU9wF.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/SU9wF.jpg" alt="enter image description here" /></a></p>
<p>I thi... | <p>Upgrade to the latest version of the flutter plugin <strong>65.1.3 solved my problem.</strong></p>
<p><a href="https://plugins.jetbrains.com/plugin/9212-flutter/versions" rel="noreferrer">https://plugins.jetbrains.com/plugin/9212-flutter/versions</a></p> | Breakpoints not working with Flutter in Android Studio | flutter|android-studio|breakpoints | 13 | 3,372 | 5 | 71,347,418 | 71,347,418 | 10 | true | 2022-03-02T14:52:04.823Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Breakpoints not working with Flutter in Android Studio<p>I can set breakpoints, but when I run in Debug mode the breakpoint's icon change with this:</p>
<p><... |
71,338,792 | java.lang.NoClassDefFoundError: Failed resolution of: Ljava/lang/Math8 when upgrading Gradle and Android Gradle Plugin<p>I'm working on an Android app with a Gradle version of <code>7.1.1</code> and an Android Gradle Plugin version of <code>7.0.0</code>. When I upgrade to Gradle version <code>7.2</code> and Android Gra... | <p>Desugaring effects "a subset of <code>java.time</code>" so upgrading to the latest version of <code>desugar_jdk_libs</code> should fix the issue. At the time of posting, the latest version is <code>1.1.5</code>.</p>
<p><strong>References</strong></p>
<ul>
<li><a href="https://developer.android.com/studio/w... | java.lang.NoClassDefFoundError: Failed resolution of: Ljava/lang/Math8 when upgrading Gradle and Android Gradle Plugin | java|kotlin|gradle|android-gradle-plugin|jdk-desugaring | 12 | 1,038 | 1 | 71,340,133 | 71,340,133 | 12 | true | 2022-03-03T14:26:27.247Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
java.lang.NoClassDefFoundError: Failed resolution of: Ljava/lang/Math8 when upgrading Gradle and Android Gradle Plugin<p>I'm working on an Android app with a... |
71,185,474 | Component not re-rendering after change in an array state in React<p>The component is not rerendering after the deletion of an element in the state but the state does change.
In the component, you can add an element in the array (which is a state) through form, see all the elements in the array, and delete it from the ... | <p>React won't update the DOM every time you give the same <code>state</code> to a <code>setState</code>. For primitive values like <code>Number</code>, <code>String</code>, and <code>Boolean</code>, it's obvious to know wether we are giving a different value or not.</p>
<p>For referenced values like <code>Object</code... | Component not re-rendering after change in an array state in React | javascript|reactjs | 9 | 3,860 | 1 | 71,185,523 | 71,185,523 | 17 | true | 2022-02-19T13:32:15.600Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Component not re-rendering after change in an array state in React<p>The component is not rerendering after the deletion of an element in the state but the s... |
71,332,602 | Upgrading to Ruby 3.1 causes Psych::DisallowedClass exception when using YAML.load_file<p>When upgrading to ruby 3.1, I am seeing the following sort error message when using <code>YAML.load_file some_file_name</code></p>
<pre><code> Psych::DisallowedClass:
Tried to load unspecified class: Matrix
</code></pre>
<p>Oth... | <p><code>Symbol</code> is also not allowed per default. Therefore just add <code>Symbol</code> to the <code>permitted_classes</code> too:</p>
<pre><code>hash = YAML.load_file(
some_file_name,
permitted_classes: [Matrix, OpenStruct, Symbol]
)
</code></pre>
<p>See the list of default <a href="https://ruby-doc.org/st... | Upgrading to Ruby 3.1 causes Psych::DisallowedClass exception when using YAML.load_file | ruby|yaml|activesupport | 17 | 5,916 | 3 | 71,332,921 | 71,332,921 | 18 | true | 2022-03-03T05:44:50.510Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Upgrading to Ruby 3.1 causes Psych::DisallowedClass exception when using YAML.load_file<p>When upgrading to ruby 3.1, I am seeing the following sort error me... |
71,199,096 | dplyr::case_when() inexplicably returns names(message) <- `*vtmp*` error<p>A really simple evaluation in <code>dplyr::case_when()</code> returns a bizarre error message in dplyr_1.0.8 under R version 4.1.2. I've isolated the behavior in this code, where I'm trying to adjust the value of the <code>durationI</code> varia... | <p>You get the problem because you are trying to mix a logical and a numeric vector.</p>
<p>In your <code>case_when</code> statement:</p>
<pre class="lang-r prettyprint-override"><code>case_when(
is.na(tmode) ~ NA,
durationI > 180 ~ 180,
TRUE ~ durationI
)
</code></pre>
<p>Your first case evaluates to <code>NA... | dplyr::case_when() inexplicably returns names(message) <- `*vtmp*` error | r|dplyr | 13 | 5,141 | 1 | 71,199,178 | 71,199,178 | 27 | true | 2022-02-20T21:46:58.790Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
dplyr::case_when() inexplicably returns names(message) <- `*vtmp*` error<p>A really simple evaluation in <code>dplyr::case_when()</code> returns a bizarre er... |
71,347,054 | flutter build Runtime JAR files in the classpath should have the same version. These files were found in the classpath<p>flutter build Runtime JAR files in the classpath should have the same version. These files were found in the classpath</p>
<p>How can I solve this problem</p>
<pre><code>w: Runtime JAR files in the ... | <p>In <code>app/build.gradle</code> change jdk7 to Java jdk8</p>
<p>before</p>
<pre><code>dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
</code></pre>
<p>after</p>
<pre><code>dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_versio... | flutter build Runtime JAR files in the classpath should have the same version. These files were found in the classpath | android|flutter|dart | 21 | 8,225 | 1 | 71,362,765 | 71,362,765 | 63 | true | 2022-03-04T05:40:29.267Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
flutter build Runtime JAR files in the classpath should have the same version. These files were found in the classpath<p>flutter build Runtime JAR files in ... |
71,315,544 | java - how do I print out the words in increasing magnitudes, e.g 1st = Our, 2nd = Our greatest, 3rd = our greatest glory<p>String s2 = "Our greatest glory is not in never falling, but in rising every time we fall.";</p>
<p>String[] split1 = s2.split(" ");</p>
<p>for (String s3 : split1) {
System.ou... | <p>This is the implementatio:</p>
<pre class="lang-java prettyprint-override"><code>String s2 = "Our greatest glory is not in never falling, but in rising every time we fall.";
String[] split1 = s2.split(" ");
for (int i = 0; i < split1.length; i++) {
for (int j = 0; j < i + 1; j++) {
... | java - how do I print out the words in increasing magnitudes, e.g 1st = Our, 2nd = Our greatest, 3rd = our greatest glory | java | -3 | 30 | 1 | 71,315,657 | 71,315,657 | -1 | true | 2022-03-01T22:56:33.673Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
java - how do I print out the words in increasing magnitudes, e.g 1st = Our, 2nd = Our greatest, 3rd = our greatest glory<p>String s2 = "Our greatest gl... |
72,109,199 | Unable to animate a horizontal line vertically up and down<p><strong>Problem faced:</strong> Unable to create a horizontal line that moves up and down (vertically) for a scanner-like feature.</p>
<p><strong>What I've tried:</strong> I've searched online for horizontal line animation code and saw this code which causes ... | <p>Codepen has tons of examples.</p>
<p>For instance this one: <a href="https://codepen.io/dicson/pen/eGZOYq" rel="nofollow noreferrer">https://codepen.io/dicson/pen/eGZOYq</a></p>
<p>Or this one: <a href="https://codepen.io/branovaclav/pen/bpobbg" rel="nofollow noreferrer">https://codepen.io/branovaclav/pen/bpobbg</a>... | Unable to animate a horizontal line vertically up and down | css|reactjs | -3 | 263 | 1 | 72,109,243 | 72,109,243 | 0 | true | 2022-05-04T07:16:01.017Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unable to animate a horizontal line vertically up and down<p><strong>Problem faced:</strong> Unable to create a horizontal line that moves up and down (verti... |
72,141,876 | vscode bracket pairs changed colors with v1.67<p>I was trying out Swagger for Go. But somehow in Visual Studio Code it changed the colors.</p>
<p><a href="https://i.stack.imgur.com/B2wAT.png" rel="noreferrer"><img src="https://i.stack.imgur.com/B2wAT.png" alt="Weird looking code colors" /></a></p>
<p>Before I installed... | <p>The issue is not related to GO or any framework</p>
<p>Seems like you have mistakenly installed the vs-code extension "bracket-pair-colorizer-2"</p>
<p>Uninstall or disable the extension and the bracket colorization will be gone.</p>
<p>But, personally, i prefer using the bracket colorization as it helps t... | vscode bracket pairs changed colors with v1.67 | visual-studio-code | 27 | 3,687 | 3 | 72,141,981 | 72,141,981 | 0 | true | 2022-05-06T13:00:13.593Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
vscode bracket pairs changed colors with v1.67<p>I was trying out Swagger for Go. But somehow in Visual Studio Code it changed the colors.</p>
<p><a href="ht... |
72,146,971 | My code doesn't print what I want it to print<p>If the number is 1 want it to print <code>1 is a number</code> but instead it prints <code><function num> is a number</code>. How do I fix this?</p>
<pre><code>def num():
int(input("number: "))
try:
num()
except ValueError:
print(f"{num} is not ... | <h2>Functions as Value</h2>
<p>In python functions are also values, so name <code>num</code> is bound to the function that you defined in the def statement. That's why when you <code>print(num)</code> you get <code><function num></code>. Assigning the return value of your function call to <code>num()</code> will ... | My code doesn't print what I want it to print | python | -4 | 46 | 3 | 72,147,204 | 72,147,204 | 0 | true | 2022-05-06T20:20:56.790Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
My code doesn't print what I want it to print<p>If the number is 1 want it to print <code>1 is a number</code> but instead it prints <code><function num&g... |
72,153,002 | Does c#'s ref copy and how to prevent it?<p>In c++ passing a const reference is often used to save time copying. I know that c# has a <code>ref</code> keyword, but the accepted answer in <a href="https://stackoverflow.com/questions/1385224/how-do-i-pass-a-const-reference-in-c">How do I pass a const reference in C#?</a>... | <p>The <code>ref</code> keyword is used to pass an argument by reference, not value. The <code>ref</code> keyword makes the formal parameter alias for the argument, which must be a variable. In other words, any operation on the parameter is made on the argument.</p>
<p>For example:</p>
<pre><code>void Method(ref int re... | Does c#'s ref copy and how to prevent it? | c#|ref | -5 | 98 | 1 | 72,153,049 | 72,153,049 | 0 | true | 2022-05-07T13:31:00.813Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Does c#'s ref copy and how to prevent it?<p>In c++ passing a const reference is often used to save time copying. I know that c# has a <code>ref</code> keywor... |
72,156,642 | The bot gives an error when using the "with" operator<p>i've come across this error. Found on the Internet based on discord.py code to create YouTube alerts on the server. When starting the bot, the system encounters a syntax error and points to the "with" operator. Previously, this operator has already been ... | <p>The actual error is on the line <em>before</em> the <code>with</code> statement:</p>
<pre><code> data[str [youtube_channel]['latest_video_url'] == latest_video_url
</code></pre>
<p>This has unbalanced brackets, and generally doesn't make any sense. Fix that error and the <code>with</code> statement will work ... | The bot gives an error when using the "with" operator | python | -3 | 37 | 1 | 72,156,690 | 72,156,690 | 0 | true | 2022-05-07T22:01:02.360Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
The bot gives an error when using the "with" operator<p>i've come across this error. Found on the Internet based on discord.py code to create YouTube alerts ... |
72,156,725 | how can I uniques my object where has the same id and add the amount + 1?<p>I have an array with objects like this:</p>
<pre><code>Array [
Object {
"amount": 1,
"color": "blue",
"id": "1",
"size": "S",
},
Object {
"amou... | <p>This one should work. I split it on two parts, so it is easier to understand.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>const src = [
{
"amount": 1,
"color":... | how can I uniques my object where has the same id and add the amount + 1? | javascript | -3 | 59 | 2 | 72,156,885 | 72,156,885 | 0 | true | 2022-05-07T22:16:56.660Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how can I uniques my object where has the same id and add the amount + 1?<p>I have an array with objects like this:</p>
<pre><code>Array [
Object {
&qu... |
72,164,751 | Python: Read the file and output the three biggest numbers<p>The file numbers.txt contains random integer numbers. There is exactly one number per line. Read the file and output the three biggest numbers in the following form:</p>
<pre><code>2345
223
89
</code></pre>
<p>Hint:</p>
<p>Read the file line by line, delete t... | <p>print(*sorted((int(n.strip()) for n in open("numbers.txt")), reverse=True)[:3], sep="\n")</p>
<p>This solution worked..!</p> | Python: Read the file and output the three biggest numbers | python|python-3.x|python-2.7 | -5 | 184 | 1 | 72,164,808 | 72,164,808 | 0 | true | 2022-05-08T20:11:16.817Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python: Read the file and output the three biggest numbers<p>The file numbers.txt contains random integer numbers. There is exactly one number per line. Read... |
72,156,603 | Python, How to find the min and max of a variable used in programme , without using if statment.?<p>Let's say 'price' variable is used to record stock price during the day.
I need to know the min,max price during this period, without using comparison logic using if.
Is there a function for that in Python?
Thanks</p> | <p>This worked for me:
Create empty List pr
append new price every minute to list
When done , find min,max of List</p>
<p>pr=[] 'create empty list
pr.append(price) 'add price every minute or so
min(pr),max(pr) 'get min,max of the list</p>
<p>This works, is there a shorter way?
Better to use L... | Python, How to find the min and max of a variable used in programme , without using if statment.? | python | -4 | 40 | 2 | 72,164,966 | 72,164,966 | 0 | true | 2022-05-07T21:54:04.080Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python, How to find the min and max of a variable used in programme , without using if statment.?<p>Let's say 'price' variable is used to record stock price ... |
72,164,953 | How can I Check in PHP if an assosiative array's Index is in Sequence or Not, and Raise an Exception if the IndexedArray is Not in sequence?<pre><code><?php
/*
1) Print all the elements from an Associative Array. Use key as Integer.
2) Raise an Exception if the IndexedArray is Not in sequence.
*/
$arr = [1=>&... | <p>One approach would be to compare a sorted vs unsorted list of array keys if you'r expecting an integer values</p>
<pre><code>$arr = [1=>"Red",8=>"Blue",3=>"Black",6=>"Orange",5=>"Green"];
//$arr = [1=>"Red",3=>"Black",5=>&q... | How can I Check in PHP if an assosiative array's Index is in Sequence or Not, and Raise an Exception if the IndexedArray is Not in sequence? | php|arrays | -3 | 34 | 1 | 72,165,251 | 72,165,251 | 0 | true | 2022-05-08T20:43:48.653Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I Check in PHP if an assosiative array's Index is in Sequence or Not, and Raise an Exception if the IndexedArray is Not in sequence?<pre><code><?p... |
72,165,219 | Why is this my output using index? what is index?<pre><code>for index in range(0, 10, 2):
print(index)
</code></pre>
<p>Why is the output 2,4,6,8?
How is it specified to only print evens? Is this what index does? My understanding was that index means position.</p> | <p>As was explained in the comments, the word <code>index</code> is just a variable name here. Yes, normally index refers to the position of an element in an iterable, however, that is not related to anything occurring in the code snippet in question.</p>
<p>Only the evens are printed as a result of the built-in <code>... | Why is this my output using index? what is index? | python|indexing | -3 | 36 | 1 | 72,165,270 | 72,165,270 | 0 | true | 2022-05-08T21:28:34.620Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is this my output using index? what is index?<pre><code>for index in range(0, 10, 2):
print(index)
</code></pre>
<p>Why is the output 2,4,6,8?
How is... |
72,167,229 | Is mandatory for websites to have copyright?<p>I'm developing my first children's website in python. I would like to know if it is mandatory for a website to have copyright?</p> | <p>Nope. It isn’t.</p>
<p>Copyright is an inherent right. Any artwork, content or creative work which is original in nature, has inherent copyright vested in the work - which means, the copyright exists in every work which is originally created.</p>
<p>Filing a Copyright application, however, gives you the advantage of... | Is mandatory for websites to have copyright? | python|copyright-display | -4 | 40 | 1 | 72,167,262 | 72,167,262 | 0 | true | 2022-05-09T05:10:58.340Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is mandatory for websites to have copyright?<p>I'm developing my first children's website in python. I would like to know if it is mandatory for a website to... |
72,168,927 | how to wait for user to click then console log variable<p>So right now I am having some trouble with the async/await functions and my goal is to update a variable when the user clicks a button. After this is done then I console log the updated variable. For example in my code I create a global variable called result an... | <p>your code is not triggering event by clicking, and you should pass argument result in resolve</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>let onlyBtn = document.getEleme... | how to wait for user to click then console log variable | javascript|asynchronous|async-await|onclick | -4 | 103 | 3 | 72,169,113 | 72,169,113 | 0 | true | 2022-05-09T08:20:47.817Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to wait for user to click then console log variable<p>So right now I am having some trouble with the async/await functions and my goal is to update a var... |
72,171,188 | RegEx to match text outside of square and curved brackets<p>I have a log file that I need to search for. The text outside of the brackets is always the same, so to be as precise as I can, I would like to ignore the text inside both square and curved brackets.</p>
<p>So the log is;</p>
<pre><code>[09/May/2022:11:04:05 +... | <p>We can use the following pattern which divides the text into 4 groups and only uses group 2 and 4.</p>
<pre><code>(\[.*\])(.*)(\(\w*\))(.*)
</code></pre>
<p>to get group 2 and 4 we use <code>\2\4</code> or <code>$2$4</code> depending on the flavour of regex.<br />
See <a href="https://regex101.com/r/v6izps/1" rel="n... | RegEx to match text outside of square and curved brackets | regex|logging | -3 | 27 | 1 | 72,171,822 | 72,171,822 | 0 | true | 2022-05-09T11:24:03.137Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
RegEx to match text outside of square and curved brackets<p>I have a log file that I need to search for. The text outside of the brackets is always the same,... |
72,176,389 | filter json array based on multiple arguments including lists<p>So I am trying to filter a json array with these two lists. what I want is if any of the element from these lists are in json array I want them in the output.
this is my json array.</p>
<pre><code>[{
"sector_code": "0828", "... | <p>You can try this on. Study about method <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter" rel="nofollow noreferrer">filter</a> in javascript to know what the code below does.</p>
<pre class="lang-js prettyprint-override"><code> const array = [{ sector_code: ...,... | filter json array based on multiple arguments including lists | javascript|json | -3 | 46 | 1 | 72,176,646 | 72,176,646 | 0 | true | 2022-05-09T18:03:05.843Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
filter json array based on multiple arguments including lists<p>So I am trying to filter a json array with these two lists. what I want is if any of the elem... |
72,178,788 | Is there a way to do the sum of the n integers function that would have O(n^2)?<p>I want to write this simple function in a way that makes the big O notation of it O(n^2), how can I make that possible ?</p>
<pre><code>int getSum(int n){
int sum = (n*(n+1))/2;
return sum;
</code></pre>
<p>any ideas?</p> | <p>I'm not really sure why you want this, but you could do it with two nested loops:</p>
<pre><code>int getSum(int n) {
int sum = 0;
for(int i = 1; i <= n; i++) {
int x = 0;
while(x++ < i) {
sum++;
}
}
return sum;
}
</code></pre>
<p>This runs <code>1+2+3+...+n</... | Is there a way to do the sum of the n integers function that would have O(n^2)? | big-o | -6 | 55 | 1 | 72,178,855 | 72,178,855 | 0 | true | 2022-05-09T22:21:22.323Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there a way to do the sum of the n integers function that would have O(n^2)?<p>I want to write this simple function in a way that makes the big O notation... |
72,180,183 | recursion c# how it works?<p>I wanted to get the summary of all array elements by using recursion
Here is the code.</p>
<pre><code> static int SummaryOfArray(int[]myArray, int i = 0, int result = 0)
{
result += myArray[i];
i++;
if (i >= myArray.Length)
{
re... | <pre><code> static int SummaryOfArray(int[] myArray, int i = 0, int result = 0)
{
if(myArray.Length == i) return result;
else return SummaryOfArray(myArray,i+1,result+myArray[i] );
}
</code></pre>
<p>Try it.</p> | recursion c# how it works? | c#|recursion | -4 | 60 | 1 | 72,181,271 | 72,181,271 | 0 | true | 2022-05-10T02:44:47.403Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
recursion c# how it works?<p>I wanted to get the summary of all array elements by using recursion
Here is the code.</p>
<pre><code> static int SummaryOfArr... |
72,190,179 | Decode all values in a categorical column of pandas data-frame by a specific rule<p><a href="https://i.stack.imgur.com/Gwwqy.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Gwwqy.jpg" alt="decode categorical data" /></a></p>
<p>Only B and D values are to be decoded as 0; rest of the values would be d... | <p>IIUC, you can use:</p>
<pre><code>df['pulse'] = (~df['fault_code'].isin(['B', 'D'])).astype(int)
</code></pre>
<p>or taking advantage of boolean -> int equivalence:</p>
<pre><code>df['pulse'] = df['fault_code'].isin(['B', 'D']).rsub(1)
</code></pre>
<p>output:</p>
<p><em>no output as no text data was provided</em... | Decode all values in a categorical column of pandas data-frame by a specific rule | python|pandas | -3 | 46 | 1 | 72,190,638 | 72,190,638 | 0 | true | 2022-05-10T16:47:58.310Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Decode all values in a categorical column of pandas data-frame by a specific rule<p><a href="https://i.stack.imgur.com/Gwwqy.jpg" rel="nofollow noreferrer"><... |
72,201,143 | C# Comparing if two lists have the same order of items (alphabetical)<p>I'm facing a huge problem with comparing two lists. I just made copy of my first list and I tried to sort it. The problem is, I want to compare my original list and sorted one to see if they have same alphabetical order. I hope I provided enough in... | <p>You can use <a href="https://docs.microsoft.com/en-us/dotnet/api/system.linq.enumerable.sequenceequal?view=net-6.0" rel="nofollow noreferrer">SequenceEqual</a> to compare to IEnumerables. In your case you can do something like this once all sorting has been done:</p>
<pre><code>var isEqual = novaListaTekstova.Sequen... | C# Comparing if two lists have the same order of items (alphabetical) | c#|list|sorting | -3 | 46 | 1 | 72,201,243 | 72,201,243 | 0 | true | 2022-05-11T12:33:31.160Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C# Comparing if two lists have the same order of items (alphabetical)<p>I'm facing a huge problem with comparing two lists. I just made copy of my first list... |
72,202,407 | C# Join with OrderBy<p>Here's an example of my code thus far.</p>
<pre><code>@string.Join(", ", @piece.PieceThemes.Select(t => t.Theme.Title).ToArray())
</code></pre>
<p>I would like to order the array in descending order. I found that .OrderByDescending() exists, but I'm having trouble understanding how ... | <p>you provide a lamda function to specify the property to sort by</p>
<p><code>@string.Join(", ", @piece.PieceThemes.Select(t => t.Theme.Title).OrderByDescending(x=> x).ToArray())</code></p>
<p>in this case <code>x</code> is a string and you can just sort by it.</p> | C# Join with OrderBy | c# | -3 | 33 | 1 | 72,202,481 | 72,202,481 | 0 | true | 2022-05-11T13:59:33.630Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C# Join with OrderBy<p>Here's an example of my code thus far.</p>
<pre><code>@string.Join(", ", @piece.PieceThemes.Select(t => t.Theme.Title).To... |
72,207,234 | TypeError: Cannot read properties of undefined (reading 'map') in React ... but the array is not empty<p>I'm encountering this error - TypeError: Cannot read properties of undefined (reading 'map') on the AboutComponent.js. The array is coming from this exported leader.js file. The array is not empty but for some reaso... | <p>In your main component js file do this:</p>
<p>Instead of <code><Route path='/aboutus' component={About} /></code></p>
<p>replace it with</p>
<pre><code><Route exact path='/aboutus' component={() => <About leaders={this.state.leaders} />} />
</code></pre>
<p>Your current code doesn't pass any pr... | TypeError: Cannot read properties of undefined (reading 'map') in React ... but the array is not empty | reactjs | -3 | 81 | 1 | 72,207,686 | 72,207,686 | 0 | true | 2022-05-11T20:25:38.533Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
TypeError: Cannot read properties of undefined (reading 'map') in React ... but the array is not empty<p>I'm encountering this error - TypeError: Cannot read... |
72,208,574 | trying to make a budget calculator but I'm lost<p>I have an assignment with the following request:</p>
<p>The program asks the student the max budget they have for the month. Then the program asks the student for the expenses he/she had on the first day of the month (On the screen it would say: What were your expenses ... | <p>There are many ways to do it. You can try this:</p>
<pre><code>max = 240
day = 1
while True:
daySpent = input("What were your expenses on day #{} : ".format(day))
max -= int(daySpent)
day += 1
if max <= 0:
print("exceed the budget limit")
break
... | trying to make a budget calculator but I'm lost | python | -4 | 74 | 2 | 72,208,697 | 72,208,697 | 0 | true | 2022-05-11T23:21:38.353Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
trying to make a budget calculator but I'm lost<p>I have an assignment with the following request:</p>
<p>The program asks the student the max budget they ha... |
72,211,837 | Fit - Transform<p>We wrote such code at a place where I was trained in machine learning.</p>
<p>My question is:
Why do we transform X_test without fitting while fitting X_train at the bottom of the code?</p>
<pre><code>hit = pd.read_csv("./xxx/xxx.csv")
df = hit.copy()
df = df.dropna()
y = df["Salary&quo... | <p>Because your X_train is reference for your training, if you fit on your test data it leaks information on how you transform your train data.</p>
<p>I like to think that I should never use in any way the test data except at the end of the model training for evaluation, so the test data shouldn't be involved in any fi... | Fit - Transform | python|machine-learning|scikit-learn | -3 | 45 | 1 | 72,211,929 | 72,211,929 | 0 | true | 2022-05-12T07:48:08.083Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Fit - Transform<p>We wrote such code at a place where I was trained in machine learning.</p>
<p>My question is:
Why do we transform X_test without fitting wh... |
72,213,887 | How can I get the first 8 characters of a string on VBA?<p>I would like to know how i can put in a variable the first 8 (or whatever the number) characters of a string in a range on Excel macro.</p>
<p>I have this code but I don't find how to get a certain number of characters on those ranges.</p>
<pre><code>sourceBook... | <p>Use the Left function e.g.</p>
<pre><code>Public Function func(s As String, n As Integer) As String
'returns the first n characters of a string
func = Left$(s, n)
End Function
</code></pre> | How can I get the first 8 characters of a string on VBA? | excel|vba | -4 | 272 | 1 | 72,214,137 | 72,214,137 | 0 | true | 2022-05-12T10:23:28.903Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I get the first 8 characters of a string on VBA?<p>I would like to know how i can put in a variable the first 8 (or whatever the number) characters o... |
72,214,377 | Alternative for c# .Last<p>Currently I am using .Last to find the last number in a database and then assign the incoming information a number that is plus one higher the last number.</p>
<pre><code>var newId = (_logs.Last().RecordID + 1);
</code></pre>
<p>I was wondering if there's a different way of looking for the h... | <p>If you can't use a identity Id column.
You can get the last id, by just request it from the database</p>
<pre><code>var lastId = context.Table
.OrderByDescending(x => x.Id)
.Select(x => x.Id)
.FirstOrDefault();
</code></pre> | Alternative for c# .Last | c# | -4 | 87 | 2 | 72,215,601 | 72,215,601 | 0 | true | 2022-05-12T11:01:18.493Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Alternative for c# .Last<p>Currently I am using .Last to find the last number in a database and then assign the incoming information a number that is plus on... |
72,181,219 | Error with if statement when checked variable is not defined<p>I have some variables A and B and I want to check them for a value and if both are False, the function shall render True:</p>
<pre><code>if ( A == 1 and B == 2 ) == False :
do magic
</code></pre>
<p>I breaks down if either A or B is not defined and when I t... | <p>Thanks heaps to @iBug</p>
<p>My solution is to check if there is anything in the list and then check if there is the desired element in the list:</p>
<pre><code>'Yes' if fruit == 'Apple' else 'No'
client.futures_get_open_orders()[0]['side'] == 'BUY' if `client.futures_get_open_orders() == True else False`
</code></... | Error with if statement when checked variable is not defined | python|if-statement | -3 | 43 | 1 | 72,222,478 | 72,222,478 | 0 | true | 2022-05-10T05:39:54.600Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Error with if statement when checked variable is not defined<p>I have some variables A and B and I want to check them for a value and if both are False, the ... |
72,222,574 | Leading space with STR function<p>I need to get a comma separated list with quotes and I'm almost at that point but I get a list with commas but a leading space at the start but in between the first quote and the string.</p>
<pre><code>select stuff((select distinct ','+''''+str(bid)+'''' from dbo.Companies
where IdComp... | <p>This is <a href="https://docs.microsoft.com/en-us/sql/t-sql/functions/str-transact-sql?view=sql-server-ver15" rel="nofollow noreferrer">documented</a> on the <code>STR()</code> function</p>
<blockquote>
<p><em>length</em></p>
<p>Is the total length. This includes decimal point, sign, digits, and spaces. <strong>The ... | Leading space with STR function | sql-server|tsql | -3 | 49 | 1 | 72,223,255 | 72,223,255 | 0 | true | 2022-05-12T22:12:12.157Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Leading space with STR function<p>I need to get a comma separated list with quotes and I'm almost at that point but I get a list with commas but a leading sp... |
72,198,328 | Single action script for discord bot with python discord.py<p>I understand that usually the discord bots are in a listening (blocking) loop, but how can I create a function that connects, send a message or perform any action and disconnect in a non blocking flow?</p>
<p>I'm using discord.py and I'm looking for somethin... | <p>Thank you for your help and support. With the SleepyStew answer I could find the path to solve it and went this way:</p>
<pre><code>import discord
import asyncio
def discord_single_task():
# Define Coroutine
async def coroutine_to_run():
TOKEN = "Secret"
# Instantiate the Client ... | Single action script for discord bot with python discord.py | python|discord|discord.py | -3 | 104 | 2 | 72,227,944 | 72,227,944 | 0 | true | 2022-05-11T09:08:05.953Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Single action script for discord bot with python discord.py<p>I understand that usually the discord bots are in a listening (blocking) loop, but how can I cr... |
72,228,684 | Update column "total price" in orders table using other columns (pizza_price*pizza_amount) in different tables?<p>This is relational diagram of database I created:</p>
<p><a href="https://i.stack.imgur.com/ocEpj.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ocEpj.jpg" alt="enter image description h... | <pre><code>UPDATE order o ,pizza p
SET o.total_price = p.pizza_price * o.pizza_amount
where o.pizza_id = p.pizza_Id;
</code></pre>
<p>This query will update information from two different tables, and it will take less time if there are too many records.</p> | Update column "total price" in orders table using other columns (pizza_price*pizza_amount) in different tables? | mysql|sql|database|foreign-keys | -3 | 58 | 2 | 72,229,362 | 72,229,362 | 0 | true | 2022-05-13T11:15:58.950Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Update column "total price" in orders table using other columns (pizza_price*pizza_amount) in different tables?<p>This is relational diagram of database I cr... |
72,229,238 | Although I write the necessary codes, I can't get results<p><em>Laptop text and price should appear on the blue button.
Although I write the necessary codes, I can't get results</em></p>
<pre><code> <div class="card" style="width: 18rem;" >
<img src="https://picsum.photos/400" ... | <p>Things you should check:</p>
<ul>
<li>Do the <code><h5></code> <code><p></code> tags exist in the inspector (browser development tools)?</li>
<li>Are you sure the css doesn't hide the elements for some reason? e.g. Change the line <code>{{product.name}} {{product.price | currency:'USD':true:"1.2-2&q... | Although I write the necessary codes, I can't get results | javascript|angular|typescript|intellij-idea | -3 | 38 | 1 | 72,230,442 | 72,230,442 | 0 | true | 2022-05-13T11:59:01.293Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Although I write the necessary codes, I can't get results<p><em>Laptop text and price should appear on the blue button.
Although I write the necessary codes,... |
72,232,209 | Does a Bitcoin block stores the corresponding dollar value of a transaction?<p>I am asking this question so that I want to easily know how many transactions occurred at a particular Bitcoin price. For example, at the price of $20T per BTC, how many are they?</p>
<p>There could be other ways finding this correlation, bu... | <p>It does not.</p>
<p>Each block contains a list of transactions and other metadata such as block number, timestamp when it was mined, etc... But the fiat monetary value is not part of the block, nor a part of a transaction.</p>
<p>You'll also need to define a source of truth for the price. While a specific block was ... | Does a Bitcoin block stores the corresponding dollar value of a transaction? | blockchain|ethereum|bitcoin|economics | -3 | 37 | 1 | 72,232,357 | 72,232,357 | 0 | true | 2022-05-13T15:43:35.273Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Does a Bitcoin block stores the corresponding dollar value of a transaction?<p>I am asking this question so that I want to easily know how many transactions ... |
72,234,731 | In SQL, how do I filter a parent with its child records if either satisfies a condition<p>I have the following table as example. I want to retrieve only the records where the ScheduleDate is smaller than 2022-01-03 (Jan 3, 2022) for either the parent and child records but I want the whole family only (parents and child... | <p>I must say that your problem definition is a bit ambiguous. In writhing this solution I had to make the assumption that you expect to see a family where there are no children who have a <em>ScheduleDate</em> greater than <em>2022-01-03</em>. If that is not the solution you looking for please clarify your problem def... | In SQL, how do I filter a parent with its child records if either satisfies a condition | sql|sql-server | -3 | 61 | 1 | 72,235,878 | 72,235,878 | 0 | true | 2022-05-13T19:47:19.307Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
In SQL, how do I filter a parent with its child records if either satisfies a condition<p>I have the following table as example. I want to retrieve only the ... |
72,235,484 | I want to convert a string containing letters to a double in matlab<pre><code>East_Seed_1="MIA";
East_Seed_8="ATL";
for i=1:7
s=rand;
if s<MIA_prob_vs_ATL
s=1;
</code></pre>
<p>I want to create an algorithm that, given probabilities of each team against another and the 8 seeds w... | <p>If you want the output to give the alphabetical order of the letters, 1 to 26, you can do this:</p>
<pre><code>str = "ABCXYZ";
mat = char(str);
ds = double(mat) - 64
</code></pre>
<p>which gives</p>
<pre><code>ds = 1 2 3 24 25 26
</code></pre> | I want to convert a string containing letters to a double in matlab | string|matlab | -3 | 53 | 2 | 72,235,937 | 72,235,937 | 0 | true | 2022-05-13T21:13:47.223Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I want to convert a string containing letters to a double in matlab<pre><code>East_Seed_1="MIA";
East_Seed_8="ATL";
for i=1:7
s=rand... |
72,160,081 | Append Data in 'Flatlist' without refreshing complete 'Flatlist' in react native<p><code>FlatList</code> comes with the option to fetch the next set of data from API when <code>listview</code> reaches the end and we can also use the <code>scrollTo</code> Function to retain the last scroll position of <code>Flatlist</co... | <p>Pagination example:-</p>
<pre><code>class FidsListview extends Component {
constructor(props) {
super(props);
this.state = {
isLoading: false,
studentData: [],
currentPage: 0,
lastPage: 0,
};
this.getChildrenApi = this.getChildrenApi.bind(this);
}
componentDidMount() {... | Append Data in 'Flatlist' without refreshing complete 'Flatlist' in react native | react-native|react-native-flatlist | 7 | 895 | 4 | 72,299,219 | 72,299,219 | 0 | true | 2022-05-08T10:25:15.663Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Append Data in 'Flatlist' without refreshing complete 'Flatlist' in react native<p><code>FlatList</code> comes with the option to fetch the next set of data ... |
72,231,131 | Java Google Directions API<p>I am developing a Java Web application tha reads an Excel with adresses. (students adresses)</p>
<p>I need to get the distance from one address to each one different adress in the spreadsheet (how far from the school adress each students live)</p>
<p>I'm using Dom4J library and the tests wi... | <p>Thank you for the reply. The problem was that when you fill the command on the browser it makes the proper treatments, but when you encapsulate in your code you need to treat all.
For example: these characters "ç", ":", "ã" in the origin or destination.</p> | Java Google Directions API | java|google-directions-api|dom4j | -3 | 43 | 2 | 72,330,154 | 72,330,154 | 0 | true | 2022-05-13T14:22:52.830Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Java Google Directions API<p>I am developing a Java Web application tha reads an Excel with adresses. (students adresses)</p>
<p>I need to get the distance f... |
72,180,116 | Vb.Net The Difference Between SQlConnection Strings<p>Hello guys i have simple Question about what is the difference between these SQlConnection Strings</p>
<p>1.</p>
<pre><code>Dim Con As New SqlConnection("Server = Z\SQL; Database = Project; id = zzz; pwd = zzz integrated Security = true")
</code></pre>
<ol... | <p>the 1 and 2 Code are the same, and if you don't want to access your SQL by Windows Aunthetication then set the Integrated Security to False and then add UID (Sql Login Id) & PWD (Password) into the string.</p>
<p>thanks anyone.</p> | Vb.Net The Difference Between SQlConnection Strings | vb.net|visual-studio | -4 | 56 | 1 | 72,391,533 | 72,391,533 | 0 | true | 2022-05-10T02:30:54.557Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Vb.Net The Difference Between SQlConnection Strings<p>Hello guys i have simple Question about what is the difference between these SQlConnection Strings</p>
... |
72,159,667 | eslint for loop 'i' is not defined<p>I am pretty new to eslint and I am updating my code to fit my eslint file.</p>
<pre class="lang-js prettyprint-override"><code>module.exports = {
env: {
browser: true,
commonjs: true,
node: true,
es2021: true,
},
extends: 'eslint:recommended',
parserOptions: ... | <p>You have to declare the variable first. Follow the code below.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code> for (let i = 0; dbl.length > i; i++) {
arr.push(d... | eslint for loop 'i' is not defined | javascript|node.js|eslint | -3 | 63 | 2 | 72,159,678 | 72,159,678 | 0 | true | 2022-05-08T09:27:52.453Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
eslint for loop 'i' is not defined<p>I am pretty new to eslint and I am updating my code to fit my eslint file.</p>
<pre class="lang-js prettyprint-override"... |
72,223,332 | Convert text to associative array in bash script<p>Hi I am new to bash scripting. I have a text as shown below</p>
<p><code>input = {'A': '1' 'B': '2' 'C': 'Associative_Array'}</code></p>
<p>I want to convert the above text into an associative array as shown below using bash scripting.</p>
<p><code>result = ([A]=1 [B]=... | <p>Converting the variable to an array and comparing them element by element</p>
<pre><code>input="{'A': '1' 'B': '2' 'C': 'Associative_Array' 'D': 'off'}"
input2="{'B': '4' 'A': '5' 'C': 'Associative_Array'}"
b=$(echo "$input" | sed -nre "s/'([A-Z])': *'([a-zA-Z0-9_]+)'/['\1']='\2'/g... | Convert text to associative array in bash script | arrays|bash|shell|script | -3 | 109 | 2 | 72,223,756 | 72,223,756 | 0 | true | 2022-05-13T00:28:50.550Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Convert text to associative array in bash script<p>Hi I am new to bash scripting. I have a text as shown below</p>
<p><code>input = {'A': '1' 'B': '2' 'C': '... |
72,202,608 | How to get data using async await?<p>How to get the data correctly</p>
<pre><code>import { NextApiHandler } from "next";
import data from "../../../lib/data.json";
const cars: NextApiHandler = (_req, res) => {
res.status(200).json(data);
};
export default cars;
</code></pre>
<p>I tried to use... | <p>You can try this way to get data</p>
<pre class="lang-js prettyprint-override"><code>import React, { useEffect, useState } from 'react';
import Item from '../Item/Item';
const Items = () => {
const [items, setItems] = useState([]);
useEffect( ()=>{
fetch('http://localhost:5000/items')
... | How to get data using async await? | javascript|reactjs|json|async-await|next.js | -3 | 174 | 1 | 72,202,749 | 72,202,749 | 0 | true | 2022-05-11T14:12:39.063Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get data using async await?<p>How to get the data correctly</p>
<pre><code>import { NextApiHandler } from "next";
import data from "../... |
72,159,256 | New to Python(3), may I ask for some help on my homework?<p>My homework asks to create a variable that contains a string.</p>
<p>The string is to contain a few phrases, line breaks, and other variables that contain strings and an integer.</p>
<p>So far I am running into a few errors, namely the "unexpected charact... | <p>alright, first you have to define some variables like:</p>
<pre class="lang-py prettyprint-override"><code>First_Name = "abc"
Last_Name = "def"
Student_Id = 1234
</code></pre>
<p>And then you have to print the formatted string, There few way can do it.<br />
<code>1. <a href="https://www.geeksfor... | New to Python(3), may I ask for some help on my homework? | python|python-3.x|stringescapeutils | -3 | 60 | 2 | 72,159,350 | 72,159,350 | 0 | true | 2022-05-08T08:25:45.880Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
New to Python(3), may I ask for some help on my homework?<p>My homework asks to create a variable that contains a string.</p>
<p>The string is to contain a f... |
72,234,479 | Does anyone know why is my program crashing?<p>I am trying to dynamically allocate words straight out of a txt file for further use, but after entering the file name, the program crashes and returns a negative value (CodeBlocks). Here is the code:</p>
<pre><code>#include <stdio.h>
#include <stdlib.h>
#inclu... | <p>In the function <code>textInput</code>, you haven't initialized <code>text</code> before calling <code>realloc(text, ...)</code>.
Add the initialization <code>text = NULL</code> before calling <code>realloc</code>. E.g.</p>
<pre><code>char **text = NULL;
</code></pre>
<p>You already have a line like that in <code>m... | Does anyone know why is my program crashing? | c | -3 | 89 | 1 | 72,234,557 | 72,234,557 | 0 | true | 2022-05-13T19:17:02.717Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Does anyone know why is my program crashing?<p>I am trying to dynamically allocate words straight out of a txt file for further use, but after entering the f... |
72,222,164 | efficient way of equations from table<p>I have the following table shown in the figure with the first few entries shown below:</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>n</th>
<th>m</th>
<th>equation</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>1</td>
<td>0</td>
</tr>
<tr>
<td>1</t... | <p>Dictionaries to the rescue!</p>
<p>Note that each of the harmonic suppression equations are linear: there is a coefficient, the variable (<code>dP</code>), and a constant -- all equations follow the form <code>y = mx + b</code>.</p>
<p>Therefore, we can implement one generic <code>suppression()</code> function which... | efficient way of equations from table | python | -3 | 32 | 1 | 72,222,412 | 72,222,412 | 0 | true | 2022-05-12T21:18:51.510Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
efficient way of equations from table<p>I have the following table shown in the figure with the first few entries shown below:</p>
<div class="s-table-contai... |
72,145,986 | Join by specific length of character<p>I want to join items in a list of lists based on these conditions:</p>
<ul>
<li>Item 1 is exactly 6 characters of length, and</li>
<li>Item 2 is exactly 4 characters of length.</li>
</ul>
<p>Input</p>
<pre><code>list_of_lists = [
['912000', '0068', '6050457605142768217'],
... | <p>You can just concatenate in a list comprehension, and use the <code>len</code> of the desired elements to filter out as you do so</p>
<pre><code>>>> [[i+j] for i, j, *_ in list_of_lists if len(i)==6 and len(j)==4]
[['9120000068'], ['9568118334'], ['9567183693'], ['9567230486']]
</code></pre> | Join by specific length of character | python | -4 | 46 | 1 | 72,146,027 | 72,146,027 | 0 | true | 2022-05-06T18:34:05.943Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Join by specific length of character<p>I want to join items in a list of lists based on these conditions:</p>
<ul>
<li>Item 1 is exactly 6 characters of leng... |
72,147,668 | How to get numbers to cycle around specific range in JavaScript?<p>I have this which isn't working, for cycling like <code>1 2 3 4 5 6 7 8 9 1 2 3 4 ...</code>, cycling between 1 and 9.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre c... | <p>Apparently I misunderstood some parts of the question at first. After having read even further comments it seems to me that</p>
<ul>
<li>the numbers to step through can be any previously defined sequence, like, from 1 to 9, from 5 to 13 or from 79 to 5337</li>
<li>the total number of steps for going (repeatedly) thr... | How to get numbers to cycle around specific range in JavaScript? | javascript|math | -3 | 98 | 2 | 72,147,780 | 72,147,780 | 0 | true | 2022-05-06T21:46:08.340Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get numbers to cycle around specific range in JavaScript?<p>I have this which isn't working, for cycling like <code>1 2 3 4 5 6 7 8 9 1 2 3 4 ...</cod... |
72,220,570 | Occurrence of a number in a range of other numbers<p>There is an array with numbers:</p>
<pre><code>$array1 = [200, 400, 600, 800, 1500];
</code></pre>
<p>And there is a second array :</p>
<pre><code>$array2 = [50, 150, 250, 600, 900, 2000];
</code></pre>
<p>How to create ranges from $array1 like this:</p>
<pre><code>$... | <p>My PHP is too rusty to give that a go unfortunately. Here's a JS version though:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>const array1 = [200, 400, 600, 800, 1500];
c... | Occurrence of a number in a range of other numbers | php | -3 | 49 | 1 | 72,220,975 | 72,220,975 | 0 | true | 2022-05-12T18:35:11.767Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Occurrence of a number in a range of other numbers<p>There is an array with numbers:</p>
<pre><code>$array1 = [200, 400, 600, 800, 1500];
</code></pre>
<p>An... |
72,149,346 | SQL Consecutive value meet certain threshold<p>I have a table like below.</p>
<p>Table A</p>
<pre><code>|id |value1|
-- ------
|123| 89|
|123| 8|
|123| 90|
|123| 6 |
|123| 100|
|123| 45|
|123| 46|
|123| 77|
|123| 1|
|123| 55|
|123| 8|
|123| 65|
</code></pre>
<p>The goal is to fi... | <p>Would you try this? I've wrote it in BigQuery but you can understand the logic in it.</p>
<pre class="lang-sql prettyprint-override"><code>WITH data AS (
SELECT 123 AS id, [89, 8, 90, 6, 100, 45, 46, 77, 1, 55, 8, 65] values
),
consecutives AS (
SELECT id, value,
IF (value <= 60 AND (
LE... | SQL Consecutive value meet certain threshold | sql | -3 | 36 | 1 | 72,149,587 | 72,149,587 | 0 | true | 2022-05-07T03:46:29.810Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SQL Consecutive value meet certain threshold<p>I have a table like below.</p>
<p>Table A</p>
<pre><code>|id |value1|
-- ------
|123| 89|
|123| 8|
|1... |
72,234,443 | I need a function to delete certain characters from a char array in c++ without using any index<p>for example:
if the user enters :
<strong>( 23+22+43)</strong></p>
<p>I want the function to do exactly the following :</p>
<pre><code>for(int i =0; i <strlen(x);i ++)
{
if (x[i]=='+')
{
deletfunc(x[i]);
... | <p>Usually when working with a C style string and the instructor says, "No indexes!" they want you to use a pointer.</p>
<p>Here is one way you could use a pointer</p>
<pre><code>char * p = x; // point p at start of array x
while (*p) // loop until p points to the null terminator - the end of the string
{
... | I need a function to delete certain characters from a char array in c++ without using any index | c++|arrays|string|c++11|char | -3 | 34 | 1 | 72,234,632 | 72,234,632 | 0 | true | 2022-05-13T19:13:09.030Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I need a function to delete certain characters from a char array in c++ without using any index<p>for example:
if the user enters :
<strong>( 23+22+43)</stro... |
72,140,553 | Parsing JSON data in a good way<p>I have some <code>JSON</code> structured outputs that I would like to parse and get some values from it. But my attempts are not good and viable in deeper nested <code>JSON</code>. What is a good way to get keys and values from the <code>JSON</code> example below?</p>
<p>Let's say I wa... | <p>The following code snippet will give you the output you want, but next time you are encouraged to try for yourself first and reach us for help about the code you tried.</p>
<pre class="lang-py prettyprint-override"><code>import json
d = json.loads('''
{
"vrfs": {
"default": {
"i... | Parsing JSON data in a good way | python|json | -3 | 41 | 1 | 72,141,087 | 72,141,087 | 0 | true | 2022-05-06T11:11:17.740Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Parsing JSON data in a good way<p>I have some <code>JSON</code> structured outputs that I would like to parse and get some values from it. But my attempts ar... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.