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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
72,285,992 | I can't put a section with background above Google Maps iframe<p>I've got an issue, while trying to create an overlay above google maps iframe. The background-color isn't aplying in CSS. Are there any restrictions from Google and what's a proper solution to this?</p>
<p><div class="snippet" data-lang="js" data-hide="fa... | <p>Add <code>position: relative;</code> to <code>.ellenonmap</code>. Then you can adjust the style as you wish.</p> | I can't put a section with background above Google Maps iframe | html|css | 0 | 47 | 1 | 72,286,180 | 72,286,180 | 0 | true | 2022-05-18T08:50:06.347Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I can't put a section with background above Google Maps iframe<p>I've got an issue, while trying to create an overlay above google maps iframe. The backgroun... |
72,240,331 | How sklearn.metrics.r2_score works<p>I tried to implement formula from <a href="https://en.wikipedia.org/wiki/Coefficient_of_determination#Definitions" rel="nofollow noreferrer">Wikipedia</a> but results are different. Why is it so?</p>
<pre><code>y_true = np.array([1, 1, 0])
y_pred = np.array([1, 0, 1])
r2 = r2_score... | <p>Not sure what statistics package you use, but it seems that the different outcome originates there. Try to use <code>np.mean</code> instead. That gives the same R2 as sklearn:</p>
<pre class="lang-python prettyprint-override"><code>import numpy as np
y_true = np.array([1, 1, 0])
y_pred = np.array([1, 0, 1])
y_tru... | How sklearn.metrics.r2_score works | python|scikit-learn|statistics | 0 | 47 | 1 | 72,240,382 | 72,240,382 | 1 | true | 2022-05-14T12:44:57.727Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How sklearn.metrics.r2_score works<p>I tried to implement formula from <a href="https://en.wikipedia.org/wiki/Coefficient_of_determination#Definitions" rel="... |
72,243,751 | Setting a title and favicon for non-html files on a website<p>Is there a way to set a title and favicon for non-html files on a website? For example, a link like <a href="https://example.com/files/image-or-something.png" rel="noreferrer">https://example.com/files/image-or-something.png</a>. By default Chrome just sets ... | <p>From what I know, this isn't currently possible.</p>
<p>A <code>.png</code> file, <code>.txt</code>, and anything besides <code>.html</code> and <code>.htm</code> are <strong>not</strong> websites. They just store what they need to (for example, <code>.png</code> stores the image, and only the image). And the only t... | Setting a title and favicon for non-html files on a website | html|node.js|express | 5 | 47 | 2 | 72,244,052 | 72,244,052 | 1 | true | 2022-05-14T20:46:54.220Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Setting a title and favicon for non-html files on a website<p>Is there a way to set a title and favicon for non-html files on a website? For example, a link ... |
72,247,247 | setOnClickListener has not been written well, it gives an error<p>I'm trying to rewrite my code from <code>android:onClick9" to </code>setOnClickListener`
since that crashes, bu I'm getting an error. <strong>Code</strong></p>
<pre><code>@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCre... | <p>When you pass an anonymous class to method, you have to implements all of <strong>its</strong> abstract/interface inherited method.</p>
<p>In your code, you wrote new method called onClick9, and didn't override the abstract method onClick as needed, so it gives new an error.</p>
<p>You should rename your method or o... | setOnClickListener has not been written well, it gives an error | java|android-studio|onclicklistener | 0 | 47 | 1 | 72,247,448 | 72,247,448 | 1 | true | 2022-05-15T10:01:16.973Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
setOnClickListener has not been written well, it gives an error<p>I'm trying to rewrite my code from <code>android:onClick9" to </code>setOnClickListene... |
72,248,295 | Assigning pandasql output to new column in DataFrame<p>I'm using pandasql to get data from df1.
Can I assign the output of query to new column in <code>df2</code>? I tried <code>(df2['grade']=ps.sqldf(sqlcode,locals()))</code> but this didn't work, which was expected because query output isn't directly series. Is there... | <p>No need to assign the new column, you can directly get the desired output by tweaking your sql query a little bit:</p>
<pre class="lang-sql prettyprint-override"><code>select df2.*, df1.grade -- Notice the change
from df2
left join df1 -- Notice the change
on (df2.score between df1.min and df1.max) and (df1.class =... | Assigning pandasql output to new column in DataFrame | python|pandas|pandasql | 1 | 47 | 1 | 72,248,373 | 72,248,373 | 1 | true | 2022-05-15T12:33:31.187Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Assigning pandasql output to new column in DataFrame<p>I'm using pandasql to get data from df1.
Can I assign the output of query to new column in <code>df2</... |
72,250,197 | How can I change state of current map item in react component<p>I have three dropdowns rendered on each map iteration.
How can I change the state of each one of them independently?</p>
<p>Right now I can close current dropdown only when set state to new value by clicking on another dropdown</p>
<pre><code>const [opened... | <p>You can check with index, I would create object state instead of string. Here is the working version <a href="https://codesandbox.io/embed/wonderful-wind-jiwvdi?fontsize=14&hidenavigation=1&theme=dark" rel="nofollow noreferrer">https://codesandbox.io/embed/wonderful-wind-jiwvdi?fontsize=14&hidenavigation... | How can I change state of current map item in react component | reactjs | 1 | 47 | 2 | 72,250,487 | 72,250,487 | 1 | true | 2022-05-15T16:33:17.560Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I change state of current map item in react component<p>I have three dropdowns rendered on each map iteration.
How can I change the state of each one... |
72,252,208 | Does this class comply to Factory method pattern?<pre><code>public class ServiceFactory {
private static ServiceFactory instance;
private final DishService dishService = new DishService();
private final OrderService orderService = new OrderService();
private final UserService userService = new UserServ... | <p>Since you are essentially accessing the same instance of a set of <code>xxxxService</code> instead of "constructing" new ones, it does not comply with the factory pattern.</p>
<p>Naming it <code>SharedServices</code> makes more sense, given that you made it a singleton, and that it shares various instances... | Does this class comply to Factory method pattern? | java | 0 | 47 | 2 | 72,252,318 | 72,252,318 | 1 | true | 2022-05-15T21:10:23.010Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Does this class comply to Factory method pattern?<pre><code>public class ServiceFactory {
private static ServiceFactory instance;
private final DishS... |
72,253,250 | Unable to Pass in Table Name for Query psycopg2<p>I am trying to pass in the table name for my queries but it doesn't work when I use the code below.</p>
<pre><code>def retrieve_data_single(table_name, date):
conn = psycopg2.connect(host="localhost", port = 5432, database="db", user=&q... | <p>According to:</p>
<p><a href="https://stackoverflow.com/questions/13793399/passing-table-name-as-a-parameter-in-psycopg2">Passing table name as a parameter in psycopg2</a></p>
<p>You should be using this</p>
<p>template:</p>
<pre><code>from psycopg2 import sql
cur.execute(
sql.SQL("insert into {table} value... | Unable to Pass in Table Name for Query psycopg2 | python|sql|postgresql|psycopg2 | 0 | 47 | 1 | 72,253,286 | 72,253,286 | 1 | true | 2022-05-16T01:00:03.280Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unable to Pass in Table Name for Query psycopg2<p>I am trying to pass in the table name for my queries but it doesn't work when I use the code below.</p>
<pr... |
72,255,876 | Adding boolean field in JSONB<p>I'm trying to add a new bool field in my JSON object throught jsonb request but it doesn't work. How should I change the request?</p>
<pre><code>update source_settings
set settings = settings - 'isEnabled' ||
jsonb_build_object('isEnabled', settings->'isEna... | <p>If you want to add a <em>new</em> key then just append it using <code>||</code></p>
<pre><code>update source_settings
set settings = settings || jsonb_build_object('isEnabled', true)
where not (settings ? 'isEnabled');
</code></pre>
<p>The WHERE clause will ensure that only rows are changed where the key d... | Adding boolean field in JSONB | json|postgresql|jsonb | 0 | 47 | 1 | 72,256,468 | 72,256,468 | 1 | true | 2022-05-16T07:58:31.653Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Adding boolean field in JSONB<p>I'm trying to add a new bool field in my JSON object throught jsonb request but it doesn't work. How should I change the requ... |
72,257,697 | Execute several scripts at the same time in the background<p>I have a page where the user selects a Python script, and then this script executes.
My issue is that some scripts take a while to execute (up to 30m) so I'd like to run them in the background while the user can still navigate on the website.</p>
<p>I tried t... | <p>Have you identified whether your slow scripts belong to CPU-bound tasks or I/O bound tasks?</p>
<p>if they're I/O bound, you can use eventlet and gevent based on Strategy 1 in <a href="https://www.distributedpython.com/2018/08/21/celery-4-windows/" rel="nofollow noreferrer">the blog from distributedpython.com</a></p... | Execute several scripts at the same time in the background | python|django|celery | 1 | 47 | 1 | 72,258,294 | 72,258,294 | 1 | true | 2022-05-16T10:23:46.087Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Execute several scripts at the same time in the background<p>I have a page where the user selects a Python script, and then this script executes.
My issue is... |
72,264,728 | ORACLE SQL APEX using sequence numbers gives an missing expression error<p>I created sequence for manager first.</p>
<pre><code>CREATE SEQUENCE manager_seq
START WITH 200
MAXVALUE 299
CYCLE
CACHE 10;
</code></pre>
<p>Then I inserted some values using .NEXTVAL</p>
<pre><code>INSERT INTO manager
VALUES (manager_seq.NEXT... | <p>Column name can't be <code>number</code>, that's a reserved word - reserved for <strong>datatype</strong>. For example:</p>
<pre><code>SQL> create table manager (id number,
2 number number); --> this
number number)
*
ERROR at line 2... | ORACLE SQL APEX using sequence numbers gives an missing expression error | sql|oracle|oracle-apex | 0 | 47 | 2 | 72,264,751 | 72,264,751 | 1 | true | 2022-05-16T19:38:37.983Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ORACLE SQL APEX using sequence numbers gives an missing expression error<p>I created sequence for manager first.</p>
<pre><code>CREATE SEQUENCE manager_seq
S... |
72,267,923 | pvlib for BSRN datasets retrievable via PANGAEA<p>I signed up for a PANGAEA user account to access <a href="https://dataportals.pangaea.de/bsrn/" rel="nofollow noreferrer">https://dataportals.pangaea.de/bsrn/</a> using pvlib</p>
<pre><code>import pvlib
import pandas
df, meta = pvlib.iotools.get_bsrn(
station='CAB'... | <p>The error message states that there is a problem logging in, which means that the username and password combination you are using is incorrect. The pvlib function retrieves data from the FTP server and not Pangea, so the credentials may not be the same. The correct credentials can be obtained by contacting the BSRN:... | pvlib for BSRN datasets retrievable via PANGAEA | pvlib | 0 | 47 | 1 | 72,269,923 | 72,269,923 | 1 | true | 2022-05-17T03:36:15.563Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
pvlib for BSRN datasets retrievable via PANGAEA<p>I signed up for a PANGAEA user account to access <a href="https://dataportals.pangaea.de/bsrn/" rel="nofoll... |
72,264,166 | How to delete and insert rows based on a column with SQLAlchemy in Python?<p>My code reads some excel files and appends them to a list, also adding a column to extract the file name. Then it concatenates everything and sends it to a table.</p>
<pre><code>
all_df_list = []
for file in files_list:
#reads and appe... | <p>For what I understand, you want to delete the rows based on the filename before inserting the rows once again.
Maybe this will help you</p>
<pre><code>engine.execute("DELETE FROM %s WHERE filename = %s", (table, file))
</code></pre>
<p>if file is the full path , you should use<code>os.path.basename(file)</... | How to delete and insert rows based on a column with SQLAlchemy in Python? | python|sqlalchemy | 1 | 47 | 2 | 72,271,627 | 72,271,627 | 1 | true | 2022-05-16T18:47:36.687Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to delete and insert rows based on a column with SQLAlchemy in Python?<p>My code reads some excel files and appends them to a list, also adding a column ... |
72,271,349 | Laravel query showing different Result in DB::Table and DB::Select with inner join<p>I'm using 3 table
1.organizations
2.users
3.organization_user</p>
<p>So the organization_user is the pivot table for getting org. and user.</p>
<pre><code>DB::select("SELECT users.name 'User Name',organizations.name 'Org Name'
... | <p>you not set the right id for organization_users in the second statement :</p>
<pre><code>DB::table('organization_users')
->join('users','users.id','=','organization_users.user_id')
->join('organizations','organizations.id','=',
'organization_users.organization_id')
->select('users.name as Na... | Laravel query showing different Result in DB::Table and DB::Select with inner join | laravel|eloquent|laravel-query-builder|laravel-9 | 1 | 47 | 1 | 72,273,755 | 72,273,755 | 1 | true | 2022-05-17T09:18:07.093Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Laravel query showing different Result in DB::Table and DB::Select with inner join<p>I'm using 3 table
1.organizations
2.users
3.organization_user</p>
<p>So ... |
72,274,985 | Function inside C# for loop inside Razor Page to hide/unhide photos<p>I'm tryin to set a function inside a for loop within a c# cshtml file. The purpose of this function is to unhide photos on button click so users can see them.</p>
<pre><code> @if (Model.Photos.PhotosBase64 != null)
{
... | <p>For starters, JavaScript code goes in a <code><script></code> element.</p>
<p>Aside from that, the logic of what you're doing is a bit odd. Consider that you are outputting this code <em>in a loop</em>. Which means the page is going to have many different versions of a function called <code>showImage</code>,... | Function inside C# for loop inside Razor Page to hide/unhide photos | javascript|c#|razor | 0 | 47 | 2 | 72,275,469 | 72,275,469 | 1 | true | 2022-05-17T13:32:24.203Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Function inside C# for loop inside Razor Page to hide/unhide photos<p>I'm tryin to set a function inside a for loop within a c# cshtml file. The purpose of t... |
72,263,113 | Scroll to elements from two different lists in the same document that have the same id value<p>In the following case there are two lists, one being nested within the other.</p>
<pre class="lang-html prettyprint-override"><code><q-list>
<q-item
v-for="item in data"
:key="item.... | <p>You could bind a prefix to each ID to differentiate them:</p>
<pre class="lang-html prettyprint-override"><code><q-list>
<q-item
v-for="item in data"
:key="item.id_data"
:id="'data_' + item.id_data"
>
<q-item-sec... | Scroll to elements from two different lists in the same document that have the same id value | javascript|vue.js|quasar | 1 | 47 | 1 | 72,281,611 | 72,281,611 | 1 | true | 2022-05-16T17:14:22.147Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Scroll to elements from two different lists in the same document that have the same id value<p>In the following case there are two lists, one being nested wi... |
72,282,475 | HTML table content align center not working on one element<p>I have a table that aligns all cell content in the center of the cell. I have used a repo Dice because I needed a quick animated dice. Unfortunately, I do not understand the CSS well enough to know why the dice is not aligning in the center of the cell, like ... | <p>Add this to the top of your CSS file/section. This will strip out browser-added paddings and margins (<code>padding: 0</code> and <code>margin: 0</code>) from all your elements and ensure paddings and borders are part of the width and height of any element (<code>box-sizing: border-box</code>).</p>
<pre><code>* {
... | HTML table content align center not working on one element | html|css | 1 | 47 | 1 | 72,282,568 | 72,282,568 | 1 | true | 2022-05-18T02:04:10.997Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
HTML table content align center not working on one element<p>I have a table that aligns all cell content in the center of the cell. I have used a repo Dice b... |
72,281,594 | hvplot.networkx does not render edges python<p>I created a graph from a street network using NetworkX. I can easily use nx.draw</p>
<pre><code>plt.figure(figsize=(20, 18))
nx.draw(g, {n:[n[0], n[1]] for n in list(g.nodes)}, node_size=15)
plt.title('Major roads', size=15)
plt.show()
</code></pre>
<p>and it looks like</... | <p>One option to try is to specify <code>node_size=0</code>:</p>
<pre class="lang-py prettyprint-override"><code>hvnx.draw(g, pos={n:[n[0], n[1]] for n in list(g.nodes)}, node_size=0)
</code></pre> | hvplot.networkx does not render edges python | python|graph|networkx|hvplot | 1 | 47 | 1 | 72,286,474 | 72,286,474 | 1 | true | 2022-05-17T23:07:16.403Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
hvplot.networkx does not render edges python<p>I created a graph from a street network using NetworkX. I can easily use nx.draw</p>
<pre><code>plt.figure(fig... |
72,267,031 | Reset product quantities in shopping lists after order placed<p>I want to know if it is possible to automatically reset the product quantities in shopping lists after customer places the order?</p>
<p>Not the order, but the shopping list itself.</p>
<p>Eg. Change from 5 back to 1?</p> | <p>You can implement it as a part of the custom checkout workflow based on one of the default workflows. For more details the <a href="https://doc.oroinc.com/backend/entities-data-management/workflows/intro/#backend-workflows-intro" rel="nofollow noreferrer">documentation</a>.</p>
<p>For example, that change can be a w... | Reset product quantities in shopping lists after order placed | orocommerce | 0 | 47 | 1 | 72,287,146 | 72,287,146 | 1 | true | 2022-05-17T00:42:26.577Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reset product quantities in shopping lists after order placed<p>I want to know if it is possible to automatically reset the product quantities in shopping li... |
72,274,766 | How to reduce plot (image) size for `exams2pdf` output?<p>When I reduce the size of the image in the <a href="http://www.r-exams.org/assets/posts/2017-08-14-scatterplot//scatterplot.Rmd" rel="nofollow noreferrer"><code>scatterplot.Rmd</code></a> file and weave it into <code>exams2html</code>, the result is as expecte... | <p><strong>TL;DR</strong></p>
<p>With your settings you control the size of the graphics file that is created. But the default LaTeX template includes all graphics with 80% of the text width. Thus, no matter how large the actual graphics file is (.pdf, .png, ...) it is always embedded in LaTeX/PDF with 80% width.</p>
<... | How to reduce plot (image) size for `exams2pdf` output? | r|plot|latex|knitr|r-exams | 1 | 47 | 1 | 72,287,852 | 72,287,852 | 1 | true | 2022-05-17T13:17:37.560Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to reduce plot (image) size for `exams2pdf` output?<p>When I reduce the size of the image in the <a href="http://www.r-exams.org/assets/posts/2017-08-14-... |
72,289,127 | Simplest method to merge two objects using a Lens<p>I'm new to Ramda and trying to restrict myself to not resorting to vanilla JS methods for tasks like this while I adjust. I'm stuck on something that feels very simple. Ramda loses clarity for me as soon as I need to chain some things together like this.</p>
<p>I used... | <p>After you group, map the groups, and use <code>R.applySpec</code> with <code>R.pluck</code> to create an object with <code>ids</code>. Now you can use <code>R.mergeDeepWith</code> with <code>R.concat</code> combine the <code>ids</code> on both objects:</p>
<p><div class="snippet" data-lang="js" data-hide="false" dat... | Simplest method to merge two objects using a Lens | javascript|javascript-objects|ramda.js | 0 | 47 | 2 | 72,289,560 | 72,289,560 | 1 | true | 2022-05-18T12:24:32.337Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Simplest method to merge two objects using a Lens<p>I'm new to Ramda and trying to restrict myself to not resorting to vanilla JS methods for tasks like this... |
72,291,676 | Testing if a POST api endpoint is working with PHP<p>I have a ticketing system and I just enabled an API endpoint that points to a custom PHP file I created. Everytime I update a ticket it sends the data to this endpoint saying its updated. How do I test if it actually is sending any data? Supposedly its doing a POST ... | <p>Did you try checking the network tab in chrome dev tools. There you can look up under "doc" or "XHR" which post headers have been sent.</p> | Testing if a POST api endpoint is working with PHP | php|api|post|endpoint | -1 | 47 | 2 | 72,292,138 | 72,292,138 | 1 | true | 2022-05-18T15:06:38.043Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Testing if a POST api endpoint is working with PHP<p>I have a ticketing system and I just enabled an API endpoint that points to a custom PHP file I created.... |
72,281,943 | Run script before getting prompt in singularity shell<p>I have built a Docker container with a Docker file that ends with <code>WORKDIR /where/I/will/work</code> and when I spin up the container, I can get to work. Unfortunately, my remote system won't allow Docker containers, so I converted it to a singularity contai... | <p>From the documentation on <a href="https://sylabs.io/guides/3.1/user-guide/cli/singularity_shell.html" rel="nofollow noreferrer">singularity shell</a>, the way to get what I want is to do</p>
<pre><code>singularity shell --bind /different/src/dir:/a/dest/dir --pwd /where/I/want/to/be my_image.sif
</code></pre>
<p>Th... | Run script before getting prompt in singularity shell | docker|singularity-container | 0 | 47 | 1 | 72,292,986 | 72,292,986 | 1 | true | 2022-05-18T00:12:33.660Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Run script before getting prompt in singularity shell<p>I have built a Docker container with a Docker file that ends with <code>WORKDIR /where/I/will/work</c... |
72,294,504 | React.js changing Chart.js type by selected radio<p>Im trying to print Chart depends on what radio button is selected, but I dont understand why exactly I cant upload my Chart. It does print the deafultChecked Bar Chart, but when I try to select another radio button and submit form, I get an error. : <strong>Uncaught T... | <p>Maybe this method can solve you problem. But I dont know that it's good coding or not.</p>
<p>First of all you use <code>useEffect</code></p>
<pre><code> const [type, setType] = useState("bar");
useEffect(() => {
setType(type);
}, [type]);
const charTypeBar = () => {
setType("ba... | React.js changing Chart.js type by selected radio | reactjs | 0 | 47 | 1 | 72,294,942 | 72,294,942 | 1 | true | 2022-05-18T18:47:34.300Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React.js changing Chart.js type by selected radio<p>Im trying to print Chart depends on what radio button is selected, but I dont understand why exactly I ca... |
72,297,298 | how can I build bash hyperlink strings from json fields?<p>I am getting some JSON data from the NYTimes API. I can get things to this form:</p>
<pre><code>"results": [
{
"headline": "such and such",
"url": "http://such.and.such.com",
...
},
{
"headline&quo... | <p><code>\e</code> and <code>\a</code> are not valid in a JSON string; to encode the escape and bell control characters, you need to use <code>\u001b</code> and <code>\u0007</code> respectively. You probably also want use the <code>-r</code> option to <code>jq</code> to make it output raw strings (rather than JSON-enco... | how can I build bash hyperlink strings from json fields? | json|bash|jq | 1 | 47 | 2 | 72,297,683 | 72,297,683 | 1 | true | 2022-05-19T00:16:58.217Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how can I build bash hyperlink strings from json fields?<p>I am getting some JSON data from the NYTimes API. I can get things to this form:</p>
<pre><code>&... |
72,300,153 | how to exit the app if the device back button is pressed flutter<p>I want to display a dialog when the device back button is pressed....
if user press no then nothing will happens......
but if the user press yes then the application shall close.....
I have tried willpopscope but it is not working......</p>
<p>Can anyon... | <p>Dialog don't show because you put it in <code>main.dart</code>. split it into 2 other files will work.</p>
<p>Try this:</p>
<p><strong>main.dart</strong></p>
<pre><code>import 'dart:io';
import 'package:demo/home.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'dialog... | how to exit the app if the device back button is pressed flutter | android|ios|firebase|flutter|dart | 0 | 47 | 3 | 72,300,651 | 72,300,651 | 1 | true | 2022-05-19T07:13:38.470Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to exit the app if the device back button is pressed flutter<p>I want to display a dialog when the device back button is pressed....
if user press no the... |
72,305,545 | How do I create an array of chars in reverse order in Java?<p>I tried the following, but I always get an error message. ("Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 10")</p>
<pre><code>public class rechner2 {
static String a = "728934792... | <p>arrays end at the index of length-1. if you want to do it this way you'll need to have the line where you're creating the reverse array say:</p>
<pre class="lang-java prettyprint-override"><code>array[i] = a.charAt(a.length() - i - 1);
</code></pre>
<p>it's trying to get the character at <code>a[a.length]</code>
<br... | How do I create an array of chars in reverse order in Java? | java|arrays|reverse | 1 | 47 | 2 | 72,305,606 | 72,305,606 | 1 | true | 2022-05-19T13:34:47.473Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I create an array of chars in reverse order in Java?<p>I tried the following, but I always get an error message. ("Exception in thread "main... |
72,305,816 | How to store the same image twice with additional smaller variant of the original photo<p>I'm using <a href="http://fancybox.net/" rel="nofollow noreferrer">jQuery Fancybox Plugin</a> which works pretty good. The problem is that I don't like the fact that on page load the original image with its size is loaded. I need ... | <p>Yes, you need to store 2 images on your storage.</p>
<p>You need to define either width or height to main aspect ratio of the image. Check the below code</p>
<pre class="lang-php prettyprint-override"><code>// open an image file
$img = Image::make('public/foo.jpg');
// now you are able to resize the instance with m... | How to store the same image twice with additional smaller variant of the original photo | laravel|image|fancybox | 0 | 47 | 1 | 72,306,111 | 72,306,111 | 1 | true | 2022-05-19T13:51:54.367Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to store the same image twice with additional smaller variant of the original photo<p>I'm using <a href="http://fancybox.net/" rel="nofollow noreferrer">... |
72,309,340 | Why is my code not dividing inside of the function?<p>I want to create a hailstone sequence using recursive function. But the even number is not getting divided, I want to know where and what did I do wrong?</p>
<pre><code>#include <stdio.h>
int sequence(int n);
int main()
{
int n = 0;
printf("\nEn... | <p>The function does nothing in this else statement</p>
<pre><code>else if (n % 2 == 0)
{
n = n / 2;
}
</code></pre>
<p>Define the function at least like</p>
<pre><code>int sequence(int n)
{
printf("%d\t ", n);
if (n == 1)
{
return 0;
}
else
{
return sequence( n % ... | Why is my code not dividing inside of the function? | c|function|recursion|conditional-statements|function-definition | 0 | 47 | 1 | 72,309,402 | 72,309,402 | 1 | true | 2022-05-19T18:14:03.447Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is my code not dividing inside of the function?<p>I want to create a hailstone sequence using recursive function. But the even number is not getting divi... |
72,306,336 | Parsing characters into an std::map<char,int> using boost::qi<p>I am trying to parse a sequence of characters separated by a "," into an std::map<char,int> of pairs where the key is the character and the value just the a count of parsed characters.
For example, if the input is</p>
<pre><code> a,b,c
</c... | <p>You cannot use Phoenix place holders outside Phoenix deferred actors. E.g. the type of <code>std::make_pair(qi::_1, 0)</code> is <code>std::pair<boost::phoenix::actor<boost::phoenix::argument<0>>, int></code>.</p>
<p>Nothing interoperates with such a thing. Certainly not <a href="https://en.cpprefe... | Parsing characters into an std::map<char,int> using boost::qi | c++|parsing|boost-spirit|boost-spirit-qi | 1 | 47 | 1 | 72,310,735 | 72,310,735 | 1 | true | 2022-05-19T14:24:20.303Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Parsing characters into an std::map<char,int> using boost::qi<p>I am trying to parse a sequence of characters separated by a "," into an std::map&l... |
72,309,577 | I can't display an image in a panel<p>I'm trying to display an image in a <code>JPanel</code> in an application where I already did that in another panel. So the first thing I did it was to use the same code but it didn't work!</p>
<p>I got this message:</p>
<pre><code>javax.imageio.IIOException: Can't read input file!... | <p>I use code like this - just watch out I load the image from the classpath:</p>
<pre><code>public class App extends javax.swing.JFrame {
private final javax.swing.ImageIcon iiFound = new javax.swing.ImageIcon(getClass().getResource("/images/done_outline_FILL0_wght400_GRAD0_opsz48.png"));
...
JL... | I can't display an image in a panel | java|image|swing|jpanel|embedded-resource | 0 | 47 | 1 | 72,310,825 | 72,310,825 | 1 | true | 2022-05-19T18:38:17.370Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I can't display an image in a panel<p>I'm trying to display an image in a <code>JPanel</code> in an application where I already did that in another panel. So... |
72,305,368 | How to read a stars object with over 32768 bands?<p>I have a very large dataset consisting of one attribute, simulated daily from 1970 to 2100, defined on a rather fine geographic grid. It has been given to me as a netCDF file, which I would like to read and analyze in an R script. The data is too big to fully fit in m... | <p>Try setting <code>GDAL_MAX_BAND_COUNT</code> to 65536</p>
<p>Python:</p>
<pre class="lang-py prettyprint-override"><code>gdal.SetConfigOption('GDAL_MAX_BAND_COUNT',65536)
</code></pre>
<p>bash:</p>
<pre class="lang-sh prettyprint-override"><code>export GDAL_MAX_BAND_COUNT=65536
</code></pre> | How to read a stars object with over 32768 bands? | r|netcdf|gdal|large-data|r-stars | 2 | 47 | 1 | 72,311,463 | 72,311,463 | 1 | true | 2022-05-19T13:22:43.777Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to read a stars object with over 32768 bands?<p>I have a very large dataset consisting of one attribute, simulated daily from 1970 to 2100, defined on a ... |
72,315,034 | How to add additional caption in fancybox<p>Here's my setup for the fancybox:</p>
<pre><code>Fancybox.bind('[data-fancybox="media"]', {
mouseWheel: true,
modal: true,
Toolbar: {
display: [
{
id: &qu... | <p>You can either create new element where you would place your content (similarly to creating additional elements in your sample) or you could just add additional content to your caption (there are samples in docs on the homepage)</p> | How to add additional caption in fancybox | javascript|fancybox-3 | 0 | 47 | 1 | 72,315,330 | 72,315,330 | 1 | true | 2022-05-20T07:23:53.123Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to add additional caption in fancybox<p>Here's my setup for the fancybox:</p>
<pre><code>Fancybox.bind('[data-fancybox="media"]', {
... |
72,303,623 | Degrees of freedom warning with MPC in GEKKO<p>I am trying to predict how a controller behaves given a temperature range using GEKKO and MPC. I am new to control systems and have never worked with either MPC or GEKKO before.</p>
<p>I want to minimize the power of a fan in a ventilation system while keeping the temperat... | <p>For those in a similar position, solved my own problem with this code:</p>
<pre><code>m = GEKKO()
m.time = np.linspace(0,144,145)
# Upper temperature limit
temp_u = np.concatenate((18*np.ones(32),22*np.ones(81),18*np.ones(32)))
# Lower temperature limit
temp_l = np.concatenate((17.0*np.ones(42),21.0*np.ones(61),17... | Degrees of freedom warning with MPC in GEKKO | python|constraints|gekko|mpc | 2 | 47 | 1 | 72,316,997 | 72,316,997 | 1 | true | 2022-05-19T11:20:05.253Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Degrees of freedom warning with MPC in GEKKO<p>I am trying to predict how a controller behaves given a temperature range using GEKKO and MPC. I am new to con... |
72,322,556 | How to convert CTE to normal query?<p>How can I convert this to normal query?</p>
<pre><code>WITH cte AS (
SELECT agentID,
SUM(bonus > 0) OVER (PARTITION BY agentID
ORDER BY `year` * 12 + `month`
RANGE BETWEEN 2 PRECEDING AND CURRENT RO... | <p>Update Again:</p>
<p>It is now working for me, here is my final code:</p>
<pre><code><?php
$servername = "localhost";
$username = "root";
$password = "";
$db = "sample_db";
// Create connection
$conn = new mysqli($servername, $username, $password, $db);
// Check connectio... | How to convert CTE to normal query? | php|sql|mariadb|common-table-expression | 0 | 47 | 2 | 72,324,484 | 72,324,484 | 1 | true | 2022-05-20T17:12:48.270Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to convert CTE to normal query?<p>How can I convert this to normal query?</p>
<pre><code>WITH cte AS (
SELECT agentID,
SUM(bonus > 0) ... |
72,329,999 | How to show best correlation result in dataframe?<p>I'd like to show the highest correlation results for my target variable. However, it creates such matrices for me, and I would like these results to be shown from the largest to the smallest in the table. It's best to add some plot. How to do it ?
I would like the res... | <p>A really simple example:</p>
<pre><code>import pandas as pd
import numpy as np
df = pd.DataFrame(np.random.randint(-100, 100, (10000, 8)), columns=list("ABCDEFGH"))
df.corr()["H"].loc[df.columns != "H"].\
sort_values(ascending=False).plot(kind="bar")
</code></pre>
<p>Thi... | How to show best correlation result in dataframe? | python|pandas|dataframe | -2 | 47 | 1 | 72,330,498 | 72,330,498 | 1 | true | 2022-05-21T13:27:49.277Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to show best correlation result in dataframe?<p>I'd like to show the highest correlation results for my target variable. However, it creates such matrice... |
72,334,326 | Exception: The number of columns in the data does not match the number of columns in the range ImportJson API call issue<p>I have the following script which uses importjson to call data from API urls and then store them into a sheet.</p>
<pre><code>function test() {
let startcell = "Test!A1"
const paramet... | <p>From your showing script and your error message, I'm worried that in your script, the length of all columns in <code>data</code> might not be the same. If my understanding is correct, how about the following modification?</p>
<h3>From:</h3>
<pre><code>data = data.flat()
ss.getRange(startcell)
.offset(0, 0, data.... | Exception: The number of columns in the data does not match the number of columns in the range ImportJson API call issue | google-apps-script|google-sheets | 1 | 47 | 1 | 72,334,351 | 72,334,351 | 1 | true | 2022-05-22T02:03:29.710Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Exception: The number of columns in the data does not match the number of columns in the range ImportJson API call issue<p>I have the following script which ... |
72,340,793 | check if select statement is true in a function in pl/sql<p>so i have a table called cars designed like this: ID, Model, Category, Availability.
The categories are standard and luxury.
im trying to write a function that returns either a boolean or an int like this :</p>
<pre><code>function(id)
if category == luxury;
re... | <p>PL/SQL means "Oracle", not "MySQL". I suggest you fix tags.</p>
<p>So, if it really is Oracle, then one option might be this:</p>
<pre><code>create or replace function f_category
(par_id in cars.id%type)
return boolean
is
l_is_equal number;
begin
select case when category = 'Luxury' then 1
... | check if select statement is true in a function in pl/sql | mysql|sql|database|plsql | 0 | 47 | 1 | 72,340,847 | 72,340,847 | 1 | true | 2022-05-22T19:42:31.960Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
check if select statement is true in a function in pl/sql<p>so i have a table called cars designed like this: ID, Model, Category, Availability.
The categori... |
72,301,436 | How to get the tagname of a custom element from the outside (or even inside)?<p>My current approach:</p>
<p>Custom Element:</p>
<pre class="lang-js prettyprint-override"><code>@customElement("bb-flow-identification")
export class FlowIdentification extends LitElement { /*...*/ }
</code></pre>
<p>Other locatio... | <p>You can just rely on plain JavaScript semantics.</p>
<pre><code>export const ELEM_NAME = "bb-flow-identification";
@customElement(ELEM_NAME)
export class FlowIdentification extends LitElement {
static registeredName = ELEM_NAME;
}
</code></pre>
<p>Then you can use it as:</p>
<pre><code>// Usage
import ... | How to get the tagname of a custom element from the outside (or even inside)? | typescript|web-component|custom-element|lit-element|lit | 0 | 47 | 1 | 72,343,376 | 72,343,376 | 1 | true | 2022-05-19T08:50:34.300Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get the tagname of a custom element from the outside (or even inside)?<p>My current approach:</p>
<p>Custom Element:</p>
<pre class="lang-js prettypri... |
72,355,907 | JSON: Bad String<p>I'm trying to create a <a href="https://jsonblob.com/" rel="nofollow noreferrer"><code>JSONBlob</code></a> with this JSON:</p>
<pre><code>{
"res": "<!DOCTYPE html><html lang='en'> <head> <meta charset='UTF-8'/> <meta http-equiv='X-UA-Compatible' content='... | <p>Instead of the linter, if you paste the JSON into a JavaScript textarea, the error will become more obvious:</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>document.querySe... | JSON: Bad String | javascript|json|string|serialization | 0 | 47 | 1 | 72,355,997 | 72,355,997 | 1 | true | 2022-05-23T23:58:13.497Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
JSON: Bad String<p>I'm trying to create a <a href="https://jsonblob.com/" rel="nofollow noreferrer"><code>JSONBlob</code></a> with this JSON:</p>
<pre><code>... |
72,355,520 | How do I find an order that contains all the available products?<p>I have a <strong>products</strong> table that contains all the available products, as well as the <strong>order_has_product</strong> table which contains all the products that should be included in every order.</p>
<p>How do I find the <strong>order_id<... | <p>This is another way by using <code>GROUP_CONCAT</code>:</p>
<pre><code>SELECT order_id FROM order_has_product
GROUP BY order_id
HAVING GROUP_CONCAT(DISTINCT product_id)=(SELECT GROUP_CONCAT(product_id) FROM products)
ORDER BY product_id;
</code></pre>
<p>This query compares the concatenated product id's which will ... | How do I find an order that contains all the available products? | mysql|sql | 1 | 47 | 3 | 72,356,290 | 72,356,290 | 1 | true | 2022-05-23T22:46:02.567Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I find an order that contains all the available products?<p>I have a <strong>products</strong> table that contains all the available products, as well... |
72,356,276 | Appscript that creates a new worksheet when new data is entered in Google sheet<p>I have an app script code that Creates a new workbook when new data is entered in Google Sheet. The code is below.</p>
<pre><code>function myFunction() {
// The code below creates a new spreadsheet "New Sheet Name" and logs the... | <h3>Creating a new Spreadsheet</h3>
<pre><code>function myFunction() {
const ss = SpreadsheetApp.getActive();
const sh = ss.getActiveSheet();
const nss = SpreadsheetApp.create(sh.getRange(sh.getLastRow(), 1).getDisplayValue())
sh.getRange(sh.getLastRow(), 10).setValue(nss.getUrl());
}
</code></pre> | Appscript that creates a new worksheet when new data is entered in Google sheet | google-apps-script|google-sheets|google-drive-api | 1 | 47 | 2 | 72,356,371 | 72,356,371 | 1 | true | 2022-05-24T01:19:48.523Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Appscript that creates a new worksheet when new data is entered in Google sheet<p>I have an app script code that Creates a new workbook when new data is ente... |
72,360,401 | How to execute a piece of code for each element of the result of a dynamic query in PostgreSQL?<p>I have a dynamic query in my PostgreSQL function:</p>
<pre><code>execute format('select something from %', table_name)
</code></pre>
<p>I want to run some code for every record returned by the above statement.</p>
<p><stro... | <p>You can use a dynamic statement in a <code>FOR</code> loop:</p>
<pre><code>DECLARE
r record;
BEGIN
FOR r IN
EXECUTE format('select something from %I', table_name)
LOOP
/* "r" now contains a table row */
END LOOP;
END;
</code></pre> | How to execute a piece of code for each element of the result of a dynamic query in PostgreSQL? | postgresql | 0 | 47 | 1 | 72,360,466 | 72,360,466 | 1 | true | 2022-05-24T09:24:30.983Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to execute a piece of code for each element of the result of a dynamic query in PostgreSQL?<p>I have a dynamic query in my PostgreSQL function:</p>
<pre>... |
72,365,550 | Calling a Key in a dictionary using a variable?<p>I am trying to be able to return the budget number for a specific dictionary based on a user defined variable. I am not having any luck figuring this out on my own, any help is greatly appreciated.</p>
<pre><code>owners = ['rob','andre']
team_balance = {}
for name in o... | <p>You just need to leave out the curly braces like so:</p>
<pre><code>print(team_balance[x]['budget'])
</code></pre>
<p>If you add them, the result is a set, which you can check like that:</p>
<pre><code>isinstance({x}, set)
</code></pre>
<p>A set can't be used as a dictionary key, because it is unhashable (which pret... | Calling a Key in a dictionary using a variable? | python|list|dictionary|variables | 0 | 47 | 3 | 72,365,663 | 72,365,663 | 1 | true | 2022-05-24T15:26:12.043Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Calling a Key in a dictionary using a variable?<p>I am trying to be able to return the budget number for a specific dictionary based on a user defined variab... |
72,374,473 | Get the value of ngModel without performing any action [Ionic]<p>When a user clicks on a button on the same HTML page, I want to send the value of <code><ion-text></code> to a TypeScript file. However, it did not work.</p>
<pre><code> <ion-text [(ngModel)]='xy' ngDefaultControl >'variables from a global p... | <p>Sorry, I'm from Angular, but to work [ngModel] the ion-text component should to have a property "value",</p>
<p>I imagine you can use</p>
<pre><code> <ion-text #myText>{{global.x}}</ion-text>`
<ion-button (click)="callFun(myText)">Save</ion-button>
callFun(text:a... | Get the value of ngModel without performing any action [Ionic] | angular|ionic-framework | -1 | 47 | 1 | 72,375,128 | 72,375,128 | 1 | true | 2022-05-25T08:43:40.970Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get the value of ngModel without performing any action [Ionic]<p>When a user clicks on a button on the same HTML page, I want to send the value of <code><... |
72,371,140 | Pull a remote branch from Github<p>I'm using a Github repo master branch.</p>
<p>A fix exists in another branch which for some reason it hasn't been pushed to master:</p>
<p><a href="https://github.com/ftexchange/ftx/pull/13" rel="nofollow noreferrer">https://github.com/ftexchange/ftx/pull/13</a></p>
<p>I'd like to obt... | <p>The PR / fix is not yet merged, apparently because it has some problems, but you can still fetch the commit in question from GitHub in various ways. Having done so, the syntax for extracting that particular <em>version</em> of the <em>entire file</em> is not:</p>
<pre><code>git checkout arf-labs-ou:openssl-1.1
</co... | Pull a remote branch from Github | git|github | 0 | 47 | 2 | 72,375,806 | 72,375,806 | 1 | true | 2022-05-25T01:39:58.203Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pull a remote branch from Github<p>I'm using a Github repo master branch.</p>
<p>A fix exists in another branch which for some reason it hasn't been pushed t... |
72,376,168 | Converting date to Monday date of each week<p>I have a <code>df</code>:</p>
<pre><code>date
2021-06-28
2021-06-29
2021-06-30
2021-07-02
2021-07-04
2021-07-07
2021-08-06
2021-08-07
</code></pre>
<p>I am trying to convert this to week, I know I can use <code>df.date.dt.isocalendar().week</code> but this returns the week ... | <p>You can convert to 'W-SUN' <a href="https://pandas.pydata.org/docs/reference/api/pandas.Series.dt.to_period.html" rel="nofollow noreferrer">period</a> and get the first day:</p>
<pre><code>df['date'] = pd.to_datetime(df['date'])
df['Monday'] = df['date'].dt.to_period('W-SUN').dt.start_time
</code></pre>
<p><em>NB. ... | Converting date to Monday date of each week | python|pandas|date | 1 | 47 | 1 | 72,376,223 | 72,376,223 | 1 | true | 2022-05-25T10:44:42.353Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Converting date to Monday date of each week<p>I have a <code>df</code>:</p>
<pre><code>date
2021-06-28
2021-06-29
2021-06-30
2021-07-02
2021-07-04
2021-07-07... |
72,375,738 | What does the scikit-learn library do in this code?<p>I am interested in the field of machine learning, I tried to understand the following code but I could not. Can anyone explain to me simply?</p>
<pre><code>from sklearn.linear_model import LinearRegression
import matplotlib.pyplot as plt
from sklearn.model_selection... | <p>Follow the comments to understand the code</p>
<pre><code># importing various modules
# Imports Linear Regression model to fit the features in a linear combination to derive the target value.
from sklearn.linear_model import LinearRegression
#To plot/visualize the data importing matplotlib
import matplotlib.pyplot... | What does the scikit-learn library do in this code? | python|machine-learning|scikit-learn | 0 | 47 | 2 | 72,376,245 | 72,376,245 | 1 | true | 2022-05-25T10:14:52.057Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What does the scikit-learn library do in this code?<p>I am interested in the field of machine learning, I tried to understand the following code but I could ... |
72,367,697 | Highmaps js, on Hover display additional data<p>I'm working with the map of Paraguay. I added an input select to select different years and the maps changes according to my selection.</p>
<p>The thing is, my data always comes in this format:</p>
<pre><code>const departments = [
{agrupacion: 'Asunción', col2015: 0, co... | <p>First of all, you need to convert your data to a readable format for Highcharts.</p>
<p>API: <a href="https://api.highcharts.com/highmaps/series.map.data" rel="nofollow noreferrer">https://api.highcharts.com/highmaps/series.map.data</a></p>
<p>For example, create separate arrays for each year:</p>
<pre><code>let dat... | Highmaps js, on Hover display additional data | javascript|arrays|highcharts | 0 | 47 | 1 | 72,379,630 | 72,379,630 | 1 | true | 2022-05-24T18:19:54.887Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Highmaps js, on Hover display additional data<p>I'm working with the map of Paraguay. I added an input select to select different years and the maps changes ... |
72,369,848 | Using source with gdb command<p>I can write gdbscript and load it yo gdb with</p>
<pre><code>source my_script
</code></pre>
<p>In my_script I write some breakpoint etc.</p>
<p>How can I load that script in the command line that I run gdb?</p>
<pre><code>gdb -p `pidof my_process`
</code></pre> | <p>You can execute arbitrary commands like so:</p>
<pre><code>gdb -ex 'break main' -ex 'source foo' -ex 'set confirm off' -p $pid
</code></pre>
<p>If your commands are already in a file, do this:</p>
<pre><code>gdb -x my_script -p $PID`
</code></pre> | Using source with gdb command | linux|debugging|gdb | 1 | 47 | 1 | 72,381,737 | 72,381,737 | 1 | true | 2022-05-24T21:49:10.253Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using source with gdb command<p>I can write gdbscript and load it yo gdb with</p>
<pre><code>source my_script
</code></pre>
<p>In my_script I write some brea... |
72,385,212 | How to round number's fractional part to significant figures?<p>I'd like to automatically round numbers to <em>x</em> significant figures, but only their fractional part.</p>
<p>Desired output:</p>
<pre><code>123 >>> 123.00
123.123 >>> 123.12
1.12 >>> 1.12
0.1 >>> 0.10
0.1234 >>... | <p>I've figured out such a solution:</p>
<pre class="lang-py prettyprint-override"><code>def round_to_frac_sigfig(num, sigfigs):
sigfig_pos = int(floor(log10(abs(num))))
if sigfig_pos >= 0:
formatter = "{:.%df}" % sigfigs
return formatter.format(num)
else:
ndigits = -sig... | How to round number's fractional part to significant figures? | python | 0 | 47 | 1 | 72,385,252 | 72,385,252 | 1 | true | 2022-05-25T23:44:43.077Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to round number's fractional part to significant figures?<p>I'd like to automatically round numbers to <em>x</em> significant figures, but only their fra... |
72,377,036 | How to connect branch policies with work items in Azure Repos?<p>I have a couple of questions about branch policies in Azure Repos.</p>
<p>As you can see we have a branching strategy based on linked items in Azure DevOps.</p>
<p>My questions:</p>
<ol>
<li><p>Is it possible to allow users push their changes to <strong>M... | <blockquote>
<p>Is it possible to allow users push their changes to Main branch only if their branch is connected with some story?</p>
</blockquote>
<p>I am afraid there is no such setting or way to achieve this at this moment.</p>
<p>We could noly set the <strong>Check for linked work items</strong> in the branch poli... | How to connect branch policies with work items in Azure Repos? | azure|azure-devops|azure-pipelines|azure-repos | 0 | 47 | 1 | 72,385,974 | 72,385,974 | 1 | true | 2022-05-25T11:46:11.073Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to connect branch policies with work items in Azure Repos?<p>I have a couple of questions about branch policies in Azure Repos.</p>
<p>As you can see we ... |
72,389,064 | How to declare a struct, when struct name is stored in a char array?<p>I'm a beginner in C programming, and here is a struct definition</p>
<pre><code>struct items
{
char *colour;
char *type;
};
</code></pre>
<p>I want to declare the struct, with struct name being the value of its <code>colour</code> and <code>... | <p>What you're trying to achieve is called <em><a href="https://en.wikipedia.org/wiki/Metaprogramming" rel="nofollow noreferrer">Metaprogramming</a></em>, which involves code that modifies itself. The C programming language focuses on modifying and processing data rather than source code, values of variables that is. H... | How to declare a struct, when struct name is stored in a char array? | c|struct | -1 | 47 | 1 | 72,389,904 | 72,389,904 | 1 | true | 2022-05-26T08:40:24.047Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to declare a struct, when struct name is stored in a char array?<p>I'm a beginner in C programming, and here is a struct definition</p>
<pre><code>struct... |
72,390,972 | OnEdit only triggering when manually editing a cell<p>I'm now able to only have an email sent when a cell in one sheet has something added to it and not when that thing is deleted. However, it only triggers an email when I manually add a value and not when a value is added via the appsheet it's linked to. I know it's p... | <p>With AppSheet 'edits' you will have to use <code>onChange()</code>.</p>
<h2>Try:</h2>
<pre><code>function onChange(e) {
if (e.source.getActiveSheet().getName() === `Trigger`) {
if (e.source.getActiveRange().getRow() >= 1 && e.source.getActiveRange().getColumn() >= 1) {
if (e.source.getAct... | OnEdit only triggering when manually editing a cell | email|google-apps-script|google-sheets | 1 | 47 | 1 | 72,391,784 | 72,391,784 | 1 | true | 2022-05-26T11:18:26.247Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
OnEdit only triggering when manually editing a cell<p>I'm now able to only have an email sent when a cell in one sheet has something added to it and not when... |
72,391,925 | Why req.query.code return a empty string?<p>i'm trying to get the code from the url body with "req.query.code", but is empty and the url show perfectly the code, i don't know what happen, this is my server.js file:</p>
<pre><code>app.get('/validate', async (req, res, next) => {
if (!req.que... | <p>You have problem in your if condition in or operator in second condition you're checking for non-empty req.query.code because of which the if block is getting executed try this</p>
<pre><code> if (!req.query.code || req.query.code === "")
</code></pre> | Why req.query.code return a empty string? | javascript|node.js|api|url | 1 | 47 | 1 | 72,392,098 | 72,392,098 | 1 | true | 2022-05-26T12:36:54.253Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why req.query.code return a empty string?<p>i'm trying to get the code from the url body with "req.query.code", but is empty and the url show perfe... |
72,391,347 | Automating font color selection of specifc text in spreadsheets?<p>I have extracted data from a website and formatted it into a CSV, all with Python. My job requires me to check this data and to make it easier I'd like to have the string in column A be used as a conditional to format the font color of the equivalent te... | <p>You can do it using with "xlsxwriter" library.
You can format parts of a string with XlsxWriter using <a href="https://xlsxwriter.readthedocs.io/worksheet.html#worksheet-write-rich-string" rel="nofollow noreferrer">write_rich_string()</a>.</p>
<p>I am assuming you have already converted csv to dict. And yo... | Automating font color selection of specifc text in spreadsheets? | python|csv|google-sheets|formatting|spreadsheet | 1 | 47 | 1 | 72,392,260 | 72,392,260 | 1 | true | 2022-05-26T11:49:32.310Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Automating font color selection of specifc text in spreadsheets?<p>I have extracted data from a website and formatted it into a CSV, all with Python. My job ... |
72,790,653 | Tilelayer url gets rendered 6 times<p>I have a map layer with a custom picture. The problem is, that it gets rendered 6 times although the <code>Tilelayer</code> component only gets rendered once.</p>
<pre><code> <MapContainer
className='absolute h-[750px] w-[750px] left-[45%] top-[80px] bg-no-repe... | <p>That is the expected behaviour of a <a href="https://leafletjs.com/reference.html#tilelayer" rel="nofollow noreferrer">Tile Layer</a>, although it is supposed to be used with an URL <em>template</em>, where some parts of the URL are changed dynamically for proper zoom and x/y position, so that it actually loads diff... | Tilelayer url gets rendered 6 times | next.js|leaflet|react-leaflet | 1 | 47 | 1 | 72,795,093 | 72,795,093 | 1 | true | 2022-06-28T17:12:14.813Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Tilelayer url gets rendered 6 times<p>I have a map layer with a custom picture. The problem is, that it gets rendered 6 times although the <code>Tilelayer</c... |
72,796,892 | How to access function from child component to parent component in angular<p>Trying to access the remove function from child component(chips-autocomplete-example). But not able to access it in app.component. When i click the close (X) icon, i want to get the value of that. For example, if i click the Apple close icon, ... | <p>Not sure if I'm understand your problem correctly, but from child do parent (in the easiest way) you can use
<code>@Output() removed = new EventEmitter<string>();</code> and in remove function add <code>this.removed.emit(fruit)</code> in child and then in parent</p>
<pre><code><chips-autocomplete-example
... | How to access function from child component to parent component in angular | angular|typescript|angular-material|angular12 | 0 | 47 | 1 | 72,797,213 | 72,797,213 | 1 | true | 2022-06-29T06:46:30.310Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to access function from child component to parent component in angular<p>Trying to access the remove function from child component(chips-autocomplete-exa... |
72,798,383 | How to get an element from a text string in R<pre><code>> my_data <- "08,23,02.06.2022,5,7,THISPRODUCT,09.02.2022,yes,89,25"
> lengths(gregexpr(",", my_data))+1
[1] 10
</code></pre>
<p>I need to get each element individually. I tried with
print(gregexpr(",", my_data))[[1]][1]</p>
... | <pre class="lang-r prettyprint-override"><code>library(tidyverse)
strings <- "08,23,02.06.2022,5,7,THISPRODUCT,09.02.2022,yes,89,25" %>%
str_split(pattern = ",") %>%
unlist()
strings[1]
#> [1] "08"
</code></pre>
<p><sup>Created on 2022-06-29 by the <a href="https://repr... | How to get an element from a text string in R | r|string | 0 | 47 | 4 | 72,798,430 | 72,798,430 | 1 | true | 2022-06-29T08:43:39.123Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get an element from a text string in R<pre><code>> my_data <- "08,23,02.06.2022,5,7,THISPRODUCT,09.02.2022,yes,89,25"
> lengths(gre... |
72,786,310 | Occurring empty lines in the CSV file while converting PDF document to CSV<p>I am new to python. I have an issue while converting <code>PDf</code> file into <code>CSV</code> format. I have used <code>tabula</code> for converting my PDF file into <code>CSV</code>. but, while converting PDF into <code>CSV</code> I am fac... | <p>I solved this..
Here is the code</p>
<pre><code>for row in reader:
name = " "
if not row[0]:
name = row[1]
for row in reader:
full_name = name+ " " + row[1]
break
row[1] = full_name
</code></pre> | Occurring empty lines in the CSV file while converting PDF document to CSV | python|pandas|csv|export-to-csv|tabula-py | 0 | 47 | 1 | 72,800,927 | 72,800,927 | 1 | true | 2022-06-28T12:19:31.970Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Occurring empty lines in the CSV file while converting PDF document to CSV<p>I am new to python. I have an issue while converting <code>PDf</code> file into ... |
72,800,894 | Can't prevent page from refreshing<p>I got some very helpful suggestions from a post a couple days ago (thank you to all who responded) and a new issue has come up that I can't seem to solve.</p>
<p>I have a php file that is a registration form posting data to a MySQL database. The form posts correctly, and after post... | <p>Your <code>thankReg()</code> JavaScript function runs during the HTML form's <code>onsubmit</code> event. That means it runs in the browser <em>before</em> the form has been submitted to the server. A moment later of course, the form is submitted which causes a HTTP request to the server, so the browser clears the c... | Can't prevent page from refreshing | javascript|php|html | 1 | 47 | 2 | 72,801,130 | 72,801,130 | 1 | true | 2022-06-29T11:47:17.490Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can't prevent page from refreshing<p>I got some very helpful suggestions from a post a couple days ago (thank you to all who responded) and a new issue has c... |
72,801,308 | Code still executing after returning res.send<p>I have a function that will return a response <strong><code>res.send()</code></strong> but after that function is called, the following line of code is till executed.</p>
<pre><code>const db = require('../models');
exports.findAll = (req, res) => {
checkAuthorizat... | <p>"Returning from a function" and "returning a response to the user from a web server" are two very different things. The <code>checkAuthorization</code> function is sending a response, but then doesn't indicate to the calling function that it did that. So the calling function also tries to send ... | Code still executing after returning res.send | javascript|node.js|express | -2 | 47 | 1 | 72,801,427 | 72,801,427 | 1 | true | 2022-06-29T12:17:40.380Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Code still executing after returning res.send<p>I have a function that will return a response <strong><code>res.send()</code></strong> but after that functio... |
72,802,146 | Reverse the direction of the color in linear gradient legend<p>I have an continuous legend(both vertical and horizontal) and currently the color are flown from red to blue but I want it to be in reverse direction like from blue to red. I have shared by code snippet and also the Fiddle link</p>
<p>Fiddle Link : <a href=... | <p>You can change linerGradient to start from right. Right now you are filling from Left. <strong>You can do this by changing x1 and x2 in your gradient def.</strong></p>
<pre><code>linearGradient = defs
.append("linearGradient")
.attr("id", id)
.attr("x1", "100%") //Chang... | Reverse the direction of the color in linear gradient legend | javascript|reactjs|d3.js|legend|linear-gradients | 0 | 47 | 2 | 72,803,155 | 72,803,155 | 1 | true | 2022-06-29T13:20:35.643Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reverse the direction of the color in linear gradient legend<p>I have an continuous legend(both vertical and horizontal) and currently the color are flown fr... |
72,802,157 | Truck Type (infinite number of them) vs Orders<p>The goal of the docplex model below is to choose the trucks with total minimum cost to fulfill all orders. I treat the truck type as 1 truck in the following code, but in fact, a truck type can have infinite number of truck, in that case, how should I modified the constr... | <p>This is not an OPL model but a docplex python model.</p>
<p>To deal with trucks instead of truck types I would change</p>
<pre><code>Assignment = mdl.binary_var_matrix(orders, truck_types, name='Assignment')
</code></pre>
<p>into</p>
<pre><code>Assignment = mdl.binary_var_matrix(orders, trucks, name='Assignment')
</... | Truck Type (infinite number of them) vs Orders | cplex|integer-programming|docplex | 0 | 47 | 1 | 72,803,527 | 72,803,527 | 1 | true | 2022-06-29T13:21:09.603Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Truck Type (infinite number of them) vs Orders<p>The goal of the docplex model below is to choose the trucks with total minimum cost to fulfill all orders. I... |
72,788,229 | Is it possible to monitor hadoop, hbase and yarn using monit tool?<p>I want to monitor some services such that, those services needs to restart when they goes down and I found an amazing tool <code>monit</code>. It works fine for <code>Zookeeper</code> since I got a condition like <code>matching "QuorumPeerMain&qu... | <p>I got a way to start <code>NameNode</code>, <code>DataNode</code>, <code>SecondaryNameNode</code> independently using shell scripts i.e., <code>hadoop-daemon.sh</code> So in my monit conf <code>NameNode</code> looks like</p>
<p>Credits to @OneCricketeer for the comment, So that I can find a way to start these proces... | Is it possible to monitor hadoop, hbase and yarn using monit tool? | hadoop|hbase|hadoop-yarn|monit | 0 | 47 | 1 | 72,803,993 | 72,803,993 | 1 | true | 2022-06-28T14:23:39.137Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it possible to monitor hadoop, hbase and yarn using monit tool?<p>I want to monitor some services such that, those services needs to restart when they goe... |
72,804,181 | How do i apply a xticks rotation on all my subplots?<p>I am kind of stuck with this, I searched on google for an answer but I can not find it.</p>
<p>I would like to turn my <code>xticks</code> 45 degrees of my subplot. I know how to do it for a normal plot:</p>
<pre><code>plt.xticks(rotation = 45)
</code></pre>
<p>But... | <p>Try with <code>setp()</code> function to set a certain parameter, in this case <code>rotation</code>:</p>
<pre><code>ax = plt.gca()
plt.setp(ax.get_xticklabels(), rotation=45)
</code></pre> | How do i apply a xticks rotation on all my subplots? | python|matplotlib|subplot|xticks | 1 | 47 | 2 | 72,804,226 | 72,804,226 | 1 | true | 2022-06-29T15:36:04.093Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do i apply a xticks rotation on all my subplots?<p>I am kind of stuck with this, I searched on google for an answer but I can not find it.</p>
<p>I would... |
72,814,997 | mat-icon appears in grey color in Angular<p>I would like to show mat-icon in red color but it always appear in grey color. Is there a way to show mat-icon in red color? If somebody knows the please let me know. Thank you</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"... | <p>It can be done as follow:</p>
<pre><code>.mat-form-field .mat-icon {
color: red;
}
</code></pre> | mat-icon appears in grey color in Angular | javascript|angular|angular-material | 0 | 47 | 2 | 72,815,382 | 72,815,382 | 1 | true | 2022-06-30T11:29:44.787Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
mat-icon appears in grey color in Angular<p>I would like to show mat-icon in red color but it always appear in grey color. Is there a way to show mat-icon in... |
72,811,417 | Assigning MPI Processes to Solve Components of a Matrix<p><strong>Question:</strong></p>
<p>I have a C code function that solves the determinate of any n x n matrix using Cramer's rule. I drafted the code, and computed several solutions correctly without error. I would like to augment this code to utilize MPI and dedic... | <ol>
<li>Cramer's rule has factorial complexity, so computing the determinant is better done through computing an LU factorization and multiplying the pivots.</li>
<li>Your code recursively copies non-contiguous submatrices into contiguous storage fine. If you want to do that with MPI, you can either have the big matri... | Assigning MPI Processes to Solve Components of a Matrix | c|mpi | 1 | 47 | 1 | 72,816,661 | 72,816,661 | 1 | true | 2022-06-30T06:52:28.823Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Assigning MPI Processes to Solve Components of a Matrix<p><strong>Question:</strong></p>
<p>I have a C code function that solves the determinate of any n x n... |
72,821,819 | SQL query for EXCEPT or NOT IN<p>I'm new to SQL and I am trying to write a query on PostgreSQL to find the <strong>cust_ID</strong> and <strong>customer name</strong> of each customer at the bank who only has a loan at the bank, and no account.</p>
<p>The database schema is:</p>
<p><a href="https://i.stack.imgur.com/jc... | <p>You can use <code>EXISTS</code> and <code>NOT EXISTS</code> to apply the logic that you want:</p>
<pre><code>SELECT c.cust_id, c.customer_name
FROM customer c
WHERE EXISTS (SELECT * FROM borrower b WHERE b.cust_id = c.cust_id)
AND NOT EXISTS (SELECT * FROM depositor d WHERE d.cust_id = c.cust_id);
</code></pre>
<p... | SQL query for EXCEPT or NOT IN | sql|postgresql|exists|except|sql-in | 0 | 47 | 1 | 72,821,980 | 72,821,980 | 1 | true | 2022-06-30T20:44:41.323Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SQL query for EXCEPT or NOT IN<p>I'm new to SQL and I am trying to write a query on PostgreSQL to find the <strong>cust_ID</strong> and <strong>customer name... |
72,822,606 | How do I get rid of part of an object / Dictionary?<p>I'm web scraping a site for data using beautifulsoup4, and I'm not sure how to be specific to the data I want, without calling an unwanted object. I've failed to get rid of it.</p>
<pre><code>import requests
from bs4 import BeautifulSoup
headers = {'User-agent': 'M... | <p>if you just want the desired output to be printed, you don't need the dicitonary or any return. just print the title and remove the second print.</p>
<pre><code>import requests
from bs4 import BeautifulSoup
headers = {'User-agent': 'Mozilla/5.0 (Windows 10; Win64; x64; rv:101.0.1) Gecko/20100101 Firefox/101.0.1'}
u... | How do I get rid of part of an object / Dictionary? | python | -2 | 47 | 1 | 72,822,684 | 72,822,684 | 1 | true | 2022-06-30T22:21:16.137Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I get rid of part of an object / Dictionary?<p>I'm web scraping a site for data using beautifulsoup4, and I'm not sure how to be specific to the data ... |
72,823,845 | reconciling `static` folders in a React / Django / nginx project<p>I'm working on a rather large project with some colleagues who are making the Django half. I'm working on the React half (created with <code>create-react-app</code>, then ejected). Both projects live in the same repo, and are coordinated with nginx to l... | <p>Ok I think I found a solution to this. By creating a <code>.env</code> text file at the root of the React project and adding a <code>PUBLIC_URL</code> there, then ALSO adding that same string as both the <code>basename</code> in React router and the <code>homepage</code> in <code>package.json</code> I seem to have f... | reconciling `static` folders in a React / Django / nginx project | reactjs|django|nginx|create-react-app|nginx-location | 0 | 47 | 1 | 72,823,995 | 72,823,995 | 1 | true | 2022-07-01T02:32:47.720Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
reconciling `static` folders in a React / Django / nginx project<p>I'm working on a rather large project with some colleagues who are making the Django half.... |
72,815,755 | How to have a string hasher with preinitialized state just from std:: in Rust?<p>Is it possible to have a hasher which does not use random initial state without having to import any crates? I'm browsing the docs but I'm not finding a solution. It seems like the only option involves <code>RandomState</code></p>
<p>This ... | <p>Use <a href="https://doc.rust-lang.org/1.54.0/std/hash/struct.BuildHasherDefault.html" rel="nofollow noreferrer"><code>BuildHasherDefault</code></a>. It constructs a <a href="https://doc.rust-lang.org/1.54.0/std/hash/trait.Hasher.html" rel="nofollow noreferrer"><code>Hasher</code></a> using its <code>Default</code> ... | How to have a string hasher with preinitialized state just from std:: in Rust? | rust | 1 | 47 | 1 | 72,824,680 | 72,824,680 | 1 | true | 2022-06-30T12:22:16.157Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to have a string hasher with preinitialized state just from std:: in Rust?<p>Is it possible to have a hasher which does not use random initial state with... |
72,825,479 | PyTorch index in a batch<p>Given tensor <code>IN</code> of shape <code>(A, B, C, D)</code> and index tensor <code>IDX</code> of shape <code>[A, B, C]</code> with <code>torch.long</code> values in <code>[0, C)</code>, how can I get a tensor <code>OUT</code> of shape <code>(A, B, C, D)</code> such that:</p>
<pre><code>OU... | <p>This is the perfect use case for <a href="https://pytorch.org/docs/stable/generated/torch.gather.html" rel="nofollow noreferrer"><code>torch.gather</code></a>. Given two 4d tensors, <code>input</code> the input tensor and <code>index</code> the tensor containing the indices for <code>input</code>, calling <code>torc... | PyTorch index in a batch | python|pytorch | 1 | 47 | 1 | 72,825,793 | 72,825,793 | 1 | true | 2022-07-01T07:02:37.527Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PyTorch index in a batch<p>Given tensor <code>IN</code> of shape <code>(A, B, C, D)</code> and index tensor <code>IDX</code> of shape <code>[A, B, C]</code> ... |
72,825,452 | How can i put external file into my build docker image?<p>This is my docker file (excluding prod part) :</p>
<pre><code>FROM node:16 as development
WORKDIR /usr/src/app
RUN apt-get update \
&& apt-get install -y wget \
&& rm -rf /var/lib/apt/lists/*
RUN wget "https://cdn.sstatic.net/Img/un... | <p>I used wrong command COPY , as i understood COPY copies files from my local system to image ... and <code>RUN wget</code> downloaded file inside image to <code>WORKDIR</code> directory.
I don't need COPY! ))</p> | How can i put external file into my build docker image? | docker | 0 | 47 | 3 | 72,825,820 | 72,825,820 | 1 | true | 2022-07-01T06:59:30.800Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can i put external file into my build docker image?<p>This is my docker file (excluding prod part) :</p>
<pre><code>FROM node:16 as development
WORKDIR ... |
72,829,098 | Bind an alternate exchange to an exchange using spring-cloud-stream<p>I'm looking a way to declare an alternate exchange upon a exchange using spring-cloud-stream. We use 3.2.2 and this fonctionnality does not exist.</p>
<p>It would be used in case the producer send its first messages before the receiver creates its qu... | <p>I think this has nothing to do with Spring Cloud Stream.</p>
<p>According that RabbitMQ docs, we just can do on the client side:</p>
<pre><code>Map<String, Object> args = new HashMap<String, Object>();
args.put("alternate-exchange", "my-ae");
channel.exchangeDeclare("my-direct&qu... | Bind an alternate exchange to an exchange using spring-cloud-stream | rabbitmq|spring-cloud-stream | 0 | 47 | 1 | 72,831,510 | 72,831,510 | 1 | true | 2022-07-01T12:13:50.190Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Bind an alternate exchange to an exchange using spring-cloud-stream<p>I'm looking a way to declare an alternate exchange upon a exchange using spring-cloud-s... |
72,829,959 | Can Spring Kafka @KafkaListener with @SendTo (read and reply) work with deferred results?<p>I need something like this</p>
<pre><code> @SendTo
@KafkaListener(topics = "some")
public Future<String> getBatchInfo(String batchCode){
...}
</code></pre>
<p>Can spring kafka request-reply mechanism w... | <p>That's correct. There is no such a feature in Spring for Apache Kafka around that receive-n-reply pattern.</p>
<p>Feel free to raise a GH issue with much more details with the reason behind such a request.</p> | Can Spring Kafka @KafkaListener with @SendTo (read and reply) work with deferred results? | java|spring|spring-kafka | 0 | 47 | 1 | 72,831,740 | 72,831,740 | 1 | true | 2022-07-01T13:22:34.043Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can Spring Kafka @KafkaListener with @SendTo (read and reply) work with deferred results?<p>I need something like this</p>
<pre><code> @SendTo
@KafkaL... |
72,833,440 | React Router v6 always render "/"<p>I'm trying to implement router in react-create-app but it always render "/" and showing Home or SignIn page. How can I solve this?</p>
<pre><code>function AppRouter({ isLoggedIn, user }) {
return(
<Router>
<Routes>
<Route path="/profi... | <p>It seems you have a <em>slight</em> misunderstanding of how the <code>HashRouter</code> works with the UI.</p>
<pre><code>import { HashRouter as Router, Route, Routes } from "react-router-dom";
import Profile from "./Profile";
import SignUp from "./SignUp";
import Home from "./Home... | React Router v6 always render "/" | javascript|reactjs|react-router | 1 | 47 | 1 | 72,834,088 | 72,834,088 | 1 | true | 2022-07-01T18:40:35.137Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React Router v6 always render "/"<p>I'm trying to implement router in react-create-app but it always render "/" and showing Home or SignIn page. Ho... |
72,840,149 | Why my useEffect runs infinitely when promise gets rejected but only once when it gets fulfilled?<p>I am trying to fetch data from a mock backend created using JSON-server with the help of Axios. Now when the response status is 200 i.e., data fetched successfully the state of my success variable changes to true. The us... | <pre><code> useEffect(() => {
getPosts();
if (error.status) {
toast.error(error.message);
}
if (success) toast.success('Success!');
}, [success, error]);
</code></pre>
<p>Since error is in the dependency array, any time the error changes, this effect will run. So the error changes, which c... | Why my useEffect runs infinitely when promise gets rejected but only once when it gets fulfilled? | javascript|reactjs|use-effect | 0 | 47 | 3 | 72,840,181 | 72,840,181 | 1 | true | 2022-07-02T15:10:17.120Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why my useEffect runs infinitely when promise gets rejected but only once when it gets fulfilled?<p>I am trying to fetch data from a mock backend created usi... |
72,840,036 | How to match any url contains a certain string (such as .jsp) in Django?<p>I'd like to soft reject any path that contains a string, such as <code>.jsp</code> in the Django 3. Here is my url.py:</p>
<pre class="lang-py prettyprint-override"><code>from django.urls import re_path
from django.views.generic import Template... | <p>what about this regex <code>r"[^\.](.*)\.jsp(.*)"</code></p> | How to match any url contains a certain string (such as .jsp) in Django? | python|django|regex|security|url-mapping | 0 | 47 | 1 | 72,840,450 | 72,840,450 | 1 | true | 2022-07-02T14:54:31.353Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to match any url contains a certain string (such as .jsp) in Django?<p>I'd like to soft reject any path that contains a string, such as <code>.jsp</code>... |
72,840,343 | converting countries to continents when there is more than one country per row<p>I have a column with country where each row has more than one country listed. I want to convert each country to continent. In the past I have used country converter, but when I try to use it in this case, I get an error because there is mo... | <p>Assuming I understood you correctly, you want the result back in the DataFrame. Therefore, each row would have multiple continents matching to the corresponding country.</p>
<p>If so, you'll need to split each row, and then split the string so that each country can be processed separately, then join back row by row ... | converting countries to continents when there is more than one country per row | python|pycountry-convert | 0 | 47 | 2 | 72,841,422 | 72,841,422 | 1 | true | 2022-07-02T15:38:54.370Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
converting countries to continents when there is more than one country per row<p>I have a column with country where each row has more than one country listed... |
72,837,246 | parse No Key json list with moshi in Android<p>What I am trying to do is to get Json response from GitHub API call of user's repository list.</p>
<p>response example from Github is like below.</p>
<pre><code>[
{
"id": 78688034,
"node_id": "MDEwOlJlcG9zaXRvcnk3ODY4ODAzNA==",
&... | <p>Because the JSON you are getting is an array, you need to return an array (List) type instead of an object type. The error came from Moshi trying to parse an array (outer tokens <code>[]</code>) as an object (outer tokens <code>{}</code>).</p>
<p>Change this:</p>
<pre><code>@GET("/users/{username}/repos")
... | parse No Key json list with moshi in Android | android|json|kotlin|retrofit2|moshi | -2 | 47 | 1 | 72,843,439 | 72,843,439 | 1 | true | 2022-07-02T07:23:14.637Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
parse No Key json list with moshi in Android<p>What I am trying to do is to get Json response from GitHub API call of user's repository list.</p>
<p>response... |
72,847,758 | python pandas data frame create columns if list of string contained in one columns<p>given this df:</p>
<pre><code>data = {'Description': ['with milk and orange', 'champagne', 'BANANA', 'bananas and apple', 'fafsa Lemons', 'GIN LEMON'],
'Amount': ['10', '20', '10', '5', '9', '15']}
df = pd.DataFrame(data)
prin... | <p>Here is another way by using <code>str.findall()</code></p>
<pre><code>(df.assign(Fruit = df['Description'].str.lower()
.str.findall('|'.join(Fruits))
.str.join('-')))
Description Amount Fruit
0 with milk and orange 10 orange
1 champagne 20
2 ... | python pandas data frame create columns if list of string contained in one columns | python|pandas|string|search|match | 1 | 47 | 2 | 72,848,698 | 72,848,698 | 1 | true | 2022-07-03T15:30:16.677Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
python pandas data frame create columns if list of string contained in one columns<p>given this df:</p>
<pre><code>data = {'Description': ['with milk and or... |
72,848,688 | How to make a function that take all 11s in a list, turn them into 1 and sums the list? in Python<p>I'm new to python and programming in general, and I have the assignment to make a Black Jack game.</p>
<p>and I have this function that checks if the score(sum) is over 21 and has 11's in a list, it will turn the 11's in... | <p>It's easier IMO if you start by turning all your aces into 1s -- you will never want to count more than one ace as an 11 (two 11s will always produce a bust), so once they're represented as 1s all you need to do is decide is whether to add 10 to the score or do nothing at all. If you have multiple 11s to contend wi... | How to make a function that take all 11s in a list, turn them into 1 and sums the list? in Python | python|list|if-statement|sum|blackjack | -1 | 47 | 2 | 72,848,747 | 72,848,747 | 1 | true | 2022-07-03T17:46:20.443Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make a function that take all 11s in a list, turn them into 1 and sums the list? in Python<p>I'm new to python and programming in general, and I have ... |
72,850,550 | regex to match a pattern and then delete it from a text file<p>I am currently facing a problem. I am trying to write a regex code in order to match a pattern in a text file, and after finding it, remove it from the current text.</p>
<pre><code># Reading the file data and store it
with open('file.txt','r+') as f:
... | <p>The main trick here is to use the <code>re.MULTILINE</code> flag, which will span across lines. You should also use <code>re.sub</code> directly rather than <code>re.findall</code>.</p>
<p>The regex itself is simple once you understand it. You look for any characters until <code>DATA_TO_MATCH</code>, then chew up an... | regex to match a pattern and then delete it from a text file | python|regex | 0 | 47 | 1 | 72,850,607 | 72,850,607 | 1 | true | 2022-07-03T23:25:26.010Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
regex to match a pattern and then delete it from a text file<p>I am currently facing a problem. I am trying to write a regex code in order to match a pattern... |
72,853,173 | Dynamically create text inside a file using shell script<p>I am trying to dynamically create a upstream.nginx.conf file which only holds the content of upstream block in nginx which I will include in the main nginx.conf. I am trying to write a shell script to create this based on the environment variables provided in t... | <p>Assuming I have printenv with:</p>
<pre><code>$STABLESERVER1=sss1.int.com
$STABLESERVER2=sss2.int.com
</code></pre>
<p>I would do something like:</p>
<pre><code>#!/bin/sh
# ! replace this line with your command !
readonly SERVERS=$(cat ./printEnvResult | grep "STABLES*")
# ! replace this with output file... | Dynamically create text inside a file using shell script | linux|shell|nginx | 0 | 47 | 1 | 72,853,652 | 72,853,652 | 1 | true | 2022-07-04T07:31:25.010Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Dynamically create text inside a file using shell script<p>I am trying to dynamically create a upstream.nginx.conf file which only holds the content of upstr... |
72,853,958 | Convert a string to date in JavaScript<p>I have the following string and I want to convert it to Date</p>
<p><code>'20220722T141444Z'</code></p>
<p>In <strong>C#</strong> I converted it by telerik's <strong>DateParser</strong> library.</p>
<p>Is there a way to convert it in <strong>JavaScript</strong> as well?</p> | <p>There are many questions on parsing timestamps. In this case, you can just get the parts as two digit pairs then use that to call the <em>Date</em> constructor.</p>
<p>Since the timestamp has a trailing "Z", likely it should be parsed as UTC so:</p>
<p><div class="snippet" data-lang="js" data-hide="false" ... | Convert a string to date in JavaScript | javascript|date | -1 | 47 | 5 | 72,854,155 | 72,854,155 | 1 | true | 2022-07-04T08:44:37.723Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Convert a string to date in JavaScript<p>I have the following string and I want to convert it to Date</p>
<p><code>'20220722T141444Z'</code></p>
<p>In <stron... |
72,855,512 | Checking if table contains any element of a specific column in another table<p>I want to check if a table column contains any of the elements in another table. Here's the tables:</p>
<pre><code>list1 = ["Hey";"H";"Say"];
list2 = ["Ey";"H";"S"];
Table1 = table... | <p>Your problem is that <code>Table1(:, 1)</code> and <code>Table(i, 1)</code> returns table and not string arrays.</p>
<p>To be honest I don't know what the behavior of <code>strcmp</code> is in this case and I haven't found any documentation so far.</p>
<p>What you need to do is to transform your table into a string ... | Checking if table contains any element of a specific column in another table | matlab|indexing|strcmp | 1 | 47 | 1 | 72,856,500 | 72,856,500 | 1 | true | 2022-07-04T10:46:15.480Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Checking if table contains any element of a specific column in another table<p>I want to check if a table column contains any of the elements in another tabl... |
72,855,877 | Fetch Data From jquery (Ajax) to Controller in IEnumerable<---------><p>Hello Am Facing problem in Fetching Data and Transferring to Controller</p>
<p>Below is My JQuery Code Using Ajax</p>
<pre><code>$("#save").click(function () {
$.ajax({
type: 'POST',
url: '/PCM/PCMP... | <p>Send data without converting it to string.</p>
<pre><code>$("#save").click(function () {
$.ajax({
type: 'POST',
url: '/PCM/PCMPost',
dataType: "json",
data: { final:final },
success: function (data) {
alert("Succeded"... | Fetch Data From jquery (Ajax) to Controller in IEnumerable<---------> | jquery|ajax|controller|jqgrid | 0 | 47 | 1 | 72,857,065 | 72,857,065 | 1 | true | 2022-07-04T11:19:42.920Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Fetch Data From jquery (Ajax) to Controller in IEnumerable<---------><p>Hello Am Facing problem in Fetching Data and Transferring to Controller</p>
<p>Below ... |
72,860,852 | Loop through JSON in JSX<p>I have a tree like JSON structure and it can be <code>n</code> levels deep. Here is an example:</p>
<pre><code>"plot": {
"population": "All",
"gates": [
{
"name": "population1",
"plot": {
"p... | <p>The main issue with your <code>renderPlots</code> function is that if the given <code>plotObject</code> is non-null, the function just returns <code>plotObject.population</code> and never gets to the recursive step. There are some other issues with that function, but I'm going to offer a rewrite that will address th... | Loop through JSON in JSX | javascript|reactjs | 1 | 47 | 2 | 72,861,287 | 72,861,287 | 1 | true | 2022-07-04T18:38:44.137Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Loop through JSON in JSX<p>I have a tree like JSON structure and it can be <code>n</code> levels deep. Here is an example:</p>
<pre><code>"plot": {... |
72,874,122 | Reshaping output of MultiHeadAttention - Tensorflow<p>We know that MultiHeadAttention's Keras API offers an <code>output_shape</code> argument, where you can specify the size you need your output to be projected to. However, the batch size and the sequence dimension does not seem to be alterable.</p>
<p>For example:</p... | <p>The core issue with your reshaping attempt is that you are trying to flatten the batch dimension. All of the standard layers in Keras would keep it constant and reshape rest of the tensor.</p>
<p>For example, when you do <code>reshape = layers.Reshape((15,5))</code> you get,</p>
<blockquote>
<p>Input to reshape is a... | Reshaping output of MultiHeadAttention - Tensorflow | python|numpy|tensorflow|keras | 0 | 47 | 1 | 72,875,579 | 72,875,579 | 1 | true | 2022-07-05T18:38:39.907Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reshaping output of MultiHeadAttention - Tensorflow<p>We know that MultiHeadAttention's Keras API offers an <code>output_shape</code> argument, where you can... |
72,878,541 | Migrate Wiki under Gitlab to ADO Git Wiki Repo<p>I am migrating artifacts from GitLab to ADO Git Repo, not able to find much info to migrate the Wikis under GitLab project to ADO repo.</p>
<p>I found below approach to do it.</p> | <h4>Step 1 - Clone gitlab wiki</h4>
<p>First to clone the Gitlab project, wiki using <code>git clone https://<gitlab-repo-url>.wiki.git</code></p>
<ul>
<li>Note we need to include the <code>wiki.git</code> at the end of the url, by default the url will be <code>.git</code></li>
</ul>
<p>The above clone command wi... | Migrate Wiki under Gitlab to ADO Git Wiki Repo | azure-devops|gitlab|azure-devops-wiki | 1 | 47 | 1 | 72,878,542 | 72,878,542 | 1 | true | 2022-07-06T05:57:19.250Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Migrate Wiki under Gitlab to ADO Git Wiki Repo<p>I am migrating artifacts from GitLab to ADO Git Repo, not able to find much info to migrate the Wikis under ... |
72,878,719 | How to changing a style in node_modules in its own vue <style> tags<p>I want to make changes to the css file inside the multiselect package. But I don't want to change it from within node_modules, all I want is to write it between style tags of my page that I created with vue. I want to change the white-space property ... | <p>I think you need to remove the <code>scoped</code> from your <code><style scoped></code> style tag, as this will let the styles only apply for the current component (and the root node of the child). But you want to style an element the Multiselect component.</p>
<pre><code><style>
.multiselect {
--ms... | How to changing a style in node_modules in its own vue <style> tags | javascript|html|css|vue.js|node-modules | 0 | 47 | 2 | 72,879,243 | 72,879,243 | 1 | true | 2022-07-06T06:18:59.810Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to changing a style in node_modules in its own vue <style> tags<p>I want to make changes to the css file inside the multiselect package. But I don't want... |
72,871,843 | cvxpy print constraint equation post optimization<p>I probably have a very easy question, but I couldn't find an answer online.
I have an optimization problem with many constraints. Hence, when the solution is infeasible, I loop through each of the constraints to explore what could have gone wrong. One of the things I ... | <p>You would have to indicate the expression structure to CVXPY before you subtract the arrays. I did:</p>
<pre><code>import cvxpy as cvx
import numpy as np
x1 = cvx.Variable(5)
y1 = cvx.Variable(5)
ones_vector = np.ones((5))*1.0
zeros_vect = np.zeros((5))
cons1 = x1 >= (cvx.Constant(ones_vector)-cvx.Constant(zero... | cvxpy print constraint equation post optimization | python|cvxpy | 2 | 47 | 1 | 72,880,598 | 72,880,598 | 1 | true | 2022-07-05T15:18:41.173Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
cvxpy print constraint equation post optimization<p>I probably have a very easy question, but I couldn't find an answer online.
I have an optimization proble... |
72,879,757 | calculated column based on the date dolumn<p>I have a date column and I want to assign a new calculated column based on that column. I have a measure to assign the min date of the slicer (<strong>'Tarihler (Stok)'[Tarih]</strong>) which has a relation 1-many with the <strong>'Stok Giriş-Çıkış'[İşlem Tarihi]</strong> Bo... | <pre><code>stock Before =
VAR minDate = MIN('Tarihler (Stok)'[Tarih] )
RETURN
CALCULATE(
SUM('Stok Giriş-Çıkış'[Stok Kalan])
,ALL('Tarihler (Stok)'[Tarih])
,'Tarihler (Stok)'[Tarih]<minDate
)
</code></pre> | calculated column based on the date dolumn | powerbi|dax | 0 | 47 | 1 | 72,884,889 | 72,884,889 | 1 | true | 2022-07-06T07:52:55.610Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
calculated column based on the date dolumn<p>I have a date column and I want to assign a new calculated column based on that column. I have a measure to assi... |
72,884,334 | Azure Data Factory ForEach activity pricing<p>I'm having a hard time understanding how ADF will be charged in the following scenario</p>
<p>1 pipeline, 2 activities with 1 being a ForEach which will loop 1000+ times. Activity inside the ForEach is a stored procedure.</p>
<p><a href="https://i.stack.imgur.com/jJT3H.png"... | <p>You can see the result in ADF monitor - but it will be 1002 activities at $1/1000 (or whatever the current rate is).</p>
<p>It's much cheaper (if you mind the dollar) if you can pass the list into your proc; the lookup.output field is just json with your table list in it, which you could parse in the proc.
<a href="... | Azure Data Factory ForEach activity pricing | azure|azure-data-factory|azure-data-factory-2|azure-data-factory-pipeline | 0 | 47 | 1 | 72,885,765 | 72,885,765 | 1 | true | 2022-07-06T13:22:36.747Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Azure Data Factory ForEach activity pricing<p>I'm having a hard time understanding how ADF will be charged in the following scenario</p>
<p>1 pipeline, 2 act... |
72,888,308 | How to write into specific mipmap using Metal kernel?<p>When using GLSL, it's easy writing into specific mipmap level.</p>
<p>But I found out it seems missing in Metal shading language.</p>
<p>Well, I might be wrong. Maybe there are some workaround.</p> | <p>You have two options here:</p>
<ol>
<li><p>If you are using Metal 2.3 or higher, you can use <code>void write(Tv color, uint2 coord, uint lod = 0)</code> or <code>void write(Tv color, ushort2 coord, ushort lod = 0)</code> methods on <code>metal::texture2d</code>. The problem is, that even with Metal 2.3 <code>lod</c... | How to write into specific mipmap using Metal kernel? | ios|macos|metal|ipados | 0 | 47 | 1 | 72,890,058 | 72,890,058 | 1 | true | 2022-07-06T18:26:34.137Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to write into specific mipmap using Metal kernel?<p>When using GLSL, it's easy writing into specific mipmap level.</p>
<p>But I found out it seems missin... |
72,889,094 | Is web worker unavailable when cross-origin isolation is enabled<p>Here are my two files, test.js and test.php.</p>
<p>test.js:</p>
<pre><code>console.log("test.js is loaded")
</code></pre>
<p>test.php:</p>
<pre><code><?php
header('Content-Type: text/html; charset=UTF-8');
//header('Cross-Origin-Embedder-P... | <p>No, Web Workers are available, but your main worker script must be served with the same headers in its response, this is because the Worker does create a new realm, and you can't "downgrade" the <em>embedder policy</em>.</p>
<p>Specs link: <a href="https://html.spec.whatwg.org/multipage/origin.html#check-a... | Is web worker unavailable when cross-origin isolation is enabled | javascript|html|web-worker|sharedarraybuffer | 0 | 47 | 1 | 72,891,781 | 72,891,781 | 1 | true | 2022-07-06T19:45:52.753Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is web worker unavailable when cross-origin isolation is enabled<p>Here are my two files, test.js and test.php.</p>
<p>test.js:</p>
<pre><code>console.log(&q... |
72,891,140 | How can I display values from relationship on column array?<p>I have 2 tables (users and meetings).</p>
<p>I'm trying to displaying the name of the user on table index view</p>
<pre><code>users
|id| |name|
1 DEMO 1
2 DEMO 2
3 DEMO 3
meetings
|id| |user_id|
1 ["1", "2&q... | <p>While there is nothing wrong with your approach, one comes to understand that the path of least resistance (= least pain) is to follow "The Rails Way".</p>
<p>So instead of answering your question, let me suggest that the relationship between your models should be:</p>
<pre class="lang-rb prettyprint-overr... | How can I display values from relationship on column array? | ruby-on-rails|ruby|ruby-on-rails-3|ruby-on-rails-4 | 0 | 47 | 2 | 72,892,089 | 72,892,089 | 1 | true | 2022-07-07T00:34:53.600Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I display values from relationship on column array?<p>I have 2 tables (users and meetings).</p>
<p>I'm trying to displaying the name of the user on t... |
72,892,316 | An argument or block definition is required here<p>I am using <code>kubernetes_network_policy</code> resource. I am trying loop over the ports and getting this issue.</p>
<pre><code>╷
│ Error: Argument or block definition required
│
│ on main.tf line 16, in resource "kubernetes_network_policy" "example... | <p>You have to use <a href="https://www.terraform.io/language/expressions/dynamic-blocks" rel="nofollow noreferrer">dynamic blocks</a>:</p>
<pre><code>resource "kubernetes_network_policy" "example-policy" {
for_each = var.inputs
metadata {
name = each.value.name
namespace = each.val... | An argument or block definition is required here | terraform|terraform0.12+|terraform-provider-kubernetes | 1 | 47 | 1 | 72,892,379 | 72,892,379 | 1 | true | 2022-07-07T04:32:34.663Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
An argument or block definition is required here<p>I am using <code>kubernetes_network_policy</code> resource. I am trying loop over the ports and getting th... |
72,885,868 | VueJS: copy tag content to clipboard at click without creating function<p>How to copy the content of an html tag to clipboard without using own function?</p>
<pre><code><div @click="navigator.clipboard.writeText(this)">Hello {{ name }}!</div>
</code></pre> | <p>As per the <a href="https://vuejs.org/guide/scaling-up/ssr.html#access-to-platform-specific-apis" rel="nofollow noreferrer"><code>document</code></a>, Universal code cannot assume access to platform-specific APIs, so if your code directly uses browser-only globals like <code>window</code> or <code>document</code>, t... | VueJS: copy tag content to clipboard at click without creating function | vue.js | 0 | 47 | 2 | 72,893,091 | 72,893,091 | 1 | true | 2022-07-06T15:04:25.903Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
VueJS: copy tag content to clipboard at click without creating function<p>How to copy the content of an html tag to clipboard without using own function?</p>... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.