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,945,077
Firestore with service account<p>I'm building a react native app (expo managed) and want to authenticate users using a phone number. To do so I need to convert the token I receive from Magic to a <a href="https://firebase.google.com/docs/auth/admin/create-custom-tokens" rel="nofollow noreferrer">JWT</a>. I'm unsure how...
<p>The <code>auth</code> Cloud Function takes in the DID token and converts it into a Firebase user access token. Pass the Firebase user access token into the <code>firebase.auth().signInWithCustomToken</code> method to authenticate user natively with Firebase.</p> <p>Magic doesn't replace Firebase Auth, and can actual...
Firestore with service account
react-native|google-cloud-firestore|expo|gcloud
0
59
1
72,946,217
72,946,217
1
true
2022-07-11T22:00:16.963Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Firestore with service account<p>I'm building a react native app (expo managed) and want to authenticate users using a phone number. To do so I need to conve...
72,945,667
Is it possible to have a WKWebView open a web page which only occupies half the screen?<p>I am building an iOS app where part of the app is to be displayed as a Web View using WKWebView. Instead of opening the web page in a full screen, I want the WKWebView to cover only half the screen (like a floating native UI eleme...
<p>Yes, it is possible to cover only have the screen with a WKWebView.</p> <p>Check <a href="https://stackoverflow.com/questions/56700752/swiftui-half-modal">this Post</a> for SwiftUI possibilities.</p> <p>And here is a quick UIKit example:</p> <pre><code>import UIKit import WebKit class ViewController: UIViewControll...
Is it possible to have a WKWebView open a web page which only occupies half the screen?
ios|swift|mobile|swiftui|webkit
0
59
1
72,948,247
72,948,247
1
true
2022-07-11T23:43:13.950Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to have a WKWebView open a web page which only occupies half the screen?<p>I am building an iOS app where part of the app is to be displayed a...
72,948,418
Trying to create a universal map printer and this snippet won't compile (Issue with ADL?)<p>Here is the full program.</p> <p>I'm using <em>clang 13 with -std=c++20 -stdlib=libc++</em>.</p> <p>The error message, not included here because it's extremely long, basically says that the compiler does not even consider the <c...
<p>You have provided <code>operator&lt;&lt;</code> for a wrong type there. You gave for the <code>std::unordered_map</code> not for the <code>my_namespace::A</code>. Hence, the compiler can not find a <code>operator&lt;&lt;</code> for <code>my_namespace::A</code>.</p> <p>You need instead</p> <pre><code>namespace my_nam...
Trying to create a universal map printer and this snippet won't compile (Issue with ADL?)
c++|class|templates|operator-overloading|argument-dependent-lookup
-3
59
2
72,948,510
72,948,510
1
true
2022-07-12T07:17:57.167Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Trying to create a universal map printer and this snippet won't compile (Issue with ADL?)<p>Here is the full program.</p> <p>I'm using <em>clang 13 with -std...
72,945,477
Mapping a texture in OpenGL<p>I am trying to map a texture to a simple quad for the first time, but all it won't render. I am using freeglut for the implementation, and the stb_image.h header to load the texture. The code:</p> <pre><code>#include &lt;GL/glut.h&gt; #include &lt;stb_image.h&gt; #include &lt;iostream&g...
<p>Several things:</p> <ul> <li>The aforementioned &quot;don't use prohibited functions within a <code>glBegin()</code>/<code>glEnd()</code> pair&quot; issue; as of posting this hasn't been fixed in the question code.</li> <li><code>GL_LINEAR_MIPMAP_LINEAR</code> is being used without providing any mipmaps. Drop to <c...
Mapping a texture in OpenGL
c++|opengl|glut|texture-mapping|freeglut
2
59
2
72,952,886
72,952,886
1
true
2022-07-11T23:03:47.780Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mapping a texture in OpenGL<p>I am trying to map a texture to a simple quad for the first time, but all it won't render. I am using freeglut for the implemen...
72,953,823
Is there a Snowflake equivalent for T-SQL INSERT INTO [Tablename] EXEC [StoredProcedure]?<p>Using T-SQL in SQL Server I can insert the results of a stored procedure into a table using this syntax:</p> <pre><code>INSERT INTO &lt;TableName&gt; EXEC &lt;StoredProcedureName&gt; GO </code></pre> <p>Presently there is alrea...
<p>It is possible to use <a href="https://docs.snowflake.com/en/sql-reference/functions/result_scan.html" rel="nofollow noreferrer">RESULT_SCAN</a> to operate on stored procedure output:</p> <pre><code>CALL &lt;stored_procedure&gt;; INSERT INTO &lt;table_name&gt;(....) SELECT * FROM TABLE(RESULT_SCAN(LAST_QUERY_ID()))...
Is there a Snowflake equivalent for T-SQL INSERT INTO [Tablename] EXEC [StoredProcedure]?
snowflake-cloud-data-platform
1
59
1
72,953,886
72,953,886
1
true
2022-07-12T14:16:45.043Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a Snowflake equivalent for T-SQL INSERT INTO [Tablename] EXEC [StoredProcedure]?<p>Using T-SQL in SQL Server I can insert the results of a stored pr...
72,924,551
GEKKO python, how to run a calculation until I get a desired value of a variable<p>Does anyone know how to run a dynamic simulation in GEKKO Python (IMODE 7) until a certain variable takes on the desired value? For example, I have a differential equation and I need to do the calculation until the pressure is 1 bar. I u...
<p>There are two ways to accomplish this.</p> <p>The first method is with step-by-step simulation with <code>IMODE=4</code>. There is no need to recreate the model each cycle. A solve command time shifts the final conditions to the initial conditions automatically because <code>m.options.TIME_SHIFT=1</code>. The pressu...
GEKKO python, how to run a calculation until I get a desired value of a variable
python|gekko
2
59
1
72,958,828
72,958,828
1
true
2022-07-09T20:50:25.117Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: GEKKO python, how to run a calculation until I get a desired value of a variable<p>Does anyone know how to run a dynamic simulation in GEKKO Python (IMODE 7)...
72,958,663
How does (--t) expression works in this code<p>I am trying to understand how the math unfolds through this code, <a href="https://github.com/danro/jquery-easing/blob/master/jquery.easing.js" rel="nofollow noreferrer">easingDoc</a></p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-bab...
<p>Probably the following 2 expressions could look tricky, here are the alternatives:</p> <pre><code> c = -1 * c; // -c t = t - 1; // --t </code></pre> <p>And an example for <code>-c/2 * ((--t)*(t-2) - 1) + b;</code> <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div ...
How does (--t) expression works in this code
javascript
-2
59
1
72,958,888
72,958,888
1
true
2022-07-12T21:38:31.977Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How does (--t) expression works in this code<p>I am trying to understand how the math unfolds through this code, <a href="https://github.com/danro/jquery-eas...
72,960,813
Best practice for waiting on nested thens<p>I have a scenario where I have three tables in a PostgreSQL database, <code>users</code>, <code>orgs</code>, and <code>users_orgs</code>, which links the first two. I use Express and <code>pg</code> to handle the DB calls. Now, if I want to, say, attach a list of <code>org</...
<p>You can wait for all the promises to finish by using <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all" rel="nofollow noreferrer"><code>Promise.all</code></a>. This function accepts an array of promises and returns a <code>Promise</code> by itself, which will resol...
Best practice for waiting on nested thens
javascript|postgresql|express
0
59
3
72,961,240
72,961,240
1
true
2022-07-13T04:04:20.467Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Best practice for waiting on nested thens<p>I have a scenario where I have three tables in a PostgreSQL database, <code>users</code>, <code>orgs</code>, and ...
72,965,696
Ruby - Append data to existing JSON<p>According to this <a href="https://stackoverflow.com/a/36012062/8461199">answer</a>, its possible to append data to JSON.</p> <p>But when I try <code>test.push</code> I get the error <code>NoMethodError: undefined method </code>push' `.</p> <pre><code>NETWORK_SG = Azure::Armrest::N...
<p>You can use <a href="https://ruby-doc.org/core-3.1.2/Array.html#method-i-push" rel="nofollow noreferrer"><code>Array#push</code></a> like this:</p> <pre><code>test = { :provisioningState=&gt;&quot;Succeeded&quot;, :resourceGuid=&gt;&quot;test&quot;, :securityRules=&gt;[ {:name=&gt;&quot;SSH&quot;, :id=...
Ruby - Append data to existing JSON
ruby-on-rails|ruby|ruby-on-rails-3|ruby-on-rails-4
-1
59
1
72,967,000
72,967,000
1
true
2022-07-13T11:43:29.770Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ruby - Append data to existing JSON<p>According to this <a href="https://stackoverflow.com/a/36012062/8461199">answer</a>, its possible to append data to JSO...
72,967,423
Argument not assignable when mocking method with Jest<p>I tried t mock a method as follows:</p> <pre><code>const mock = jest.spyOn(ReissueButton, 'consentGiven').mockResolvedValue(true); </code></pre> <p>It gives me these errors:</p> <blockquote> <p>Argument of type '&quot;consentGiven&quot;' is not assignable to param...
<p>That error is probably because you are trying to spy on a non-static method of a class without creating a new instance. You can either spy on the class prototype or make the method static:</p> <p>Option 1</p> <pre class="lang-js prettyprint-override"><code>const mock = jest.spyOn(ReissueButton.prototype, 'consentGiv...
Argument not assignable when mocking method with Jest
javascript|typescript|jestjs
-1
59
1
72,967,756
72,967,756
1
true
2022-07-13T13:46:55.403Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Argument not assignable when mocking method with Jest<p>I tried t mock a method as follows:</p> <pre><code>const mock = jest.spyOn(ReissueButton, 'consentGiv...
72,967,564
Timestamp '"2013-08-19 09:50:37.000"' is not recognized<p>In snowflake I am trying to do the following command:</p> <pre><code>copy into trips from @citibike_trips file_format=CSV; </code></pre> <p>Before this command, I have already created a table:</p> <pre><code>CREATE TABLE &quot;CITIBIKE&quot;.&quot;PUBLIC&quot;.&...
<p>Look at the error message very closely, especially the highlighted parts:</p> <blockquote> <p>Timestamp '<code>&quot;</code>2013-08-19 09:50:37.000<code>&quot;</code>' is not recognized</p> </blockquote> <p>Your timestamp format <code>YYYY-MM-DD HH24:MI:SS.FF3</code> is correct, but the string includes double quotes...
Timestamp '"2013-08-19 09:50:37.000"' is not recognized
sql|snowflake-cloud-data-platform|data-warehouse
0
59
1
72,969,362
72,969,362
1
true
2022-07-13T13:57:36.390Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Timestamp '"2013-08-19 09:50:37.000"' is not recognized<p>In snowflake I am trying to do the following command:</p> <pre><code>copy into trips from @citibike...
72,971,953
How do I disambiguate relationship names in a salesforce subquery<p>I am attempting to do a nested query on an object that has two related lists that happen to have the same relationship name. The query is always picking the related list associated with the standard object, but I want to query the list associated with...
<p>The custom relationship should be named <code>Quotes__r</code>, you sure you have a problem?</p> <p>What do you see when you run a describe (see my answer <a href="https://salesforce.stackexchange.com/a/23507/799">https://salesforce.stackexchange.com/a/23507/799</a>, pick the &quot;go down&quot; piece) or open the o...
How do I disambiguate relationship names in a salesforce subquery
salesforce|soql
0
59
1
72,972,334
72,972,334
1
true
2022-07-13T19:58:07.313Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I disambiguate relationship names in a salesforce subquery<p>I am attempting to do a nested query on an object that has two related lists that happen ...
72,786,884
Why does Microsoft edge show "Status: Failed" when using the client-server function integration in Google Apps Script while Chrome works every time?<h2>My code</h2> <p>I have a test spread sheet and I have an Apps Script project linked to it.</p> <p>Here is the code for Code.gs</p> <pre class="lang-js prettyprint-overr...
<p>I figured it out. If I sign out of all accounts, it works.</p>
Why does Microsoft edge show "Status: Failed" when using the client-server function integration in Google Apps Script while Chrome works every time?
google-chrome|google-apps-script|google-sheets|microsoft-edge|chromium
1
59
1
72,974,671
72,974,671
1
true
2022-06-28T12:59:18.790Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does Microsoft edge show "Status: Failed" when using the client-server function integration in Google Apps Script while Chrome works every time?<h2>My co...
72,971,786
Iterating two components in URLs<p>I'm trying to get an dataframe for each collection with information of every token in the collection.</p> <p>So what I tried to do is to put one collection's address and having it fixed through the every token_id iteration and get the list of 'traits' information and rebuild the list ...
<p>There should be a nested loop here. <code>zip()</code> is useful when iterating two iterables together, which is not appropriate here. As a nested loop is used, there should be a nested list to collect the data and the final output should also use a loop to produce 2 dfs.</p> <pre class="lang-py prettyprint-override...
Iterating two components in URLs
python|pandas|function|for-loop
0
59
1
72,975,313
72,975,313
1
true
2022-07-13T19:42:28.807Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Iterating two components in URLs<p>I'm trying to get an dataframe for each collection with information of every token in the collection.</p> <p>So what I tri...
72,980,254
Should Kafka Messages contain Changes of Entites or Full Entities<p>Assume, I have the following <code>JSON</code>:</p> <pre><code>{ id: 12, name: 'bob', address: { street: 'main', code:1234 } } </code></pre> <p>When the street name changes to 'new street' , should I publish the complete document</p> <pre><...
<p>Kafka is typically used for sending readable messages, although you can send binary formats. Sending very large data is not recommended due to performance issues on both the broker as well as the clients.</p> <p>Enforcing a limit on the size of the message ensures that you will not end up storing large files which l...
Should Kafka Messages contain Changes of Entites or Full Entities
apache-kafka
0
59
2
72,980,923
72,980,923
1
true
2022-07-14T12:08:59.160Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Should Kafka Messages contain Changes of Entites or Full Entities<p>Assume, I have the following <code>JSON</code>:</p> <pre><code>{ id: 12, name: 'bob', ...
72,982,246
Displaying saved cards from stripe on to the frontend<p>I am currently integrating the Stripe payment gateway into my website. Meanwhile, I'm saving my customer and payment method id upon successful payment into the database for future use or for displaying the saved card on my website.</p> <p>what can I do on my clien...
<p>Stripe doesn't have built in functionality to do this so a typical pattern is to list the customer's payment methods[1] with a server side call and pass that info to the client side to be rendered with your own custom code.</p> <p>[1] <a href="https://stripe.com/docs/api/payment_methods/customer_list" rel="nofollow ...
Displaying saved cards from stripe on to the frontend
node.js|reactjs|stripe-payments
2
59
1
72,983,102
72,983,102
1
true
2022-07-14T14:32:07.983Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Displaying saved cards from stripe on to the frontend<p>I am currently integrating the Stripe payment gateway into my website. Meanwhile, I'm saving my custo...
72,977,920
MotionLayout rotate image and resetting rotation android<p>I'm rotating an imageview using MotionLayout.</p> <p>First click, image rotate clockwise, that's what i want.</p> <p>But second click, image rotate counterclockwise. I tried some way to reset state of image but it doesn't work. Can i have a advise???</p> <pre><...
<p>I think I figured out what you wanted. You want a button that goes from rotate the view and essentially stays in start state</p> <p>There are several ways to do this.</p> <p>Probably the simplest from your your current XML is to add</p> <pre><code>motion:autoTransition=&quot;jumpToStart&quot; </code></pre> <p>to you...
MotionLayout rotate image and resetting rotation android
android|android-animation|android-constraintlayout|android-motionlayout
0
59
1
72,984,977
72,984,977
1
true
2022-07-14T09:02:48.900Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MotionLayout rotate image and resetting rotation android<p>I'm rotating an imageview using MotionLayout.</p> <p>First click, image rotate clockwise, that's w...
72,988,030
Mapkit - How to get bounds coordinate in mapkit?<p>I am trying to show a map within the bounds of two coordinates. To show this, I have written this code.</p> <pre><code> private func showMapWithinBounds() { let point1 = MKMapPoint(viewModel.boundsStart.location.coordinate) let point2 = MKMapPoint(viewModel....
<p>Assuming that top left and bottom right corners are point1 and point2 respectively:</p> <p><strong>Method 1</strong></p> <p>Use MKMapView's <em>convert</em> method to convert a CGPoint on the view to a CLLocationCoordinate2D. If your mapView has a non-zero frame, it will be:</p> <pre><code>let point1 = mapView.frame...
Mapkit - How to get bounds coordinate in mapkit?
ios|swift|mapkit|apple-maps
0
59
1
72,988,626
72,988,626
1
true
2022-07-15T00:58:14.093Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mapkit - How to get bounds coordinate in mapkit?<p>I am trying to show a map within the bounds of two coordinates. To show this, I have written this code.</p...
72,989,209
Problem in Changing the Background color of label on Button Click in MVVM WPF<p>While declaring the variable and in constructor I can work on the background color of label using MVVM WPF But on other event like Button Event It's not changing the color.</p> <p><strong>XAML Code</strong></p> <pre><code>&lt;Label Content=...
<p>It's not really clear what <code>BrushMessageArea2</code> is doing there, as it's neither in the binding or any of the provided methods.</p> <p>However, assuming that <code>BrushMessageArea1</code> follows the same format as <code>BrushMessageArea2</code> (with backing field), then you can update the <code>Brush</co...
Problem in Changing the Background color of label on Button Click in MVVM WPF
c#|wpf|mvvm
-1
59
1
72,989,359
72,989,359
1
true
2022-07-15T04:56:58.277Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Problem in Changing the Background color of label on Button Click in MVVM WPF<p>While declaring the variable and in constructor I can work on the background ...
72,989,335
sed: can't read, invalid sigil<p>At my work we have remote Windows desktop for Ubuntu users (me). The connection was fine until today I arrived at work. When I tried to run <code>./agenda.sh</code> command in terminal, I got this error:</p> <pre><code>sed: can't read /cert:tofu: No such file or directory sed: can't rea...
<p>Someone has edited this command, perhaps in an attempt to set the password from a value stored in a file:</p> <pre><code>xfreerdp /size:&quot;1800x950&quot; /u:&quot;user&quot; /d:company /p:grep pass ~/.mad | sed &quot;s/.*=//&quot; /cert:tofu /v:HOST_CONN </code></pre> <p>I would guess it is supposed to be more li...
sed: can't read, invalid sigil
bash|sed
1
59
1
72,989,780
72,989,780
1
true
2022-07-15T05:18:31.770Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: sed: can't read, invalid sigil<p>At my work we have remote Windows desktop for Ubuntu users (me). The connection was fine until today I arrived at work. When...
72,975,618
Flexible search is asking for session country while called from REST api<p>I have a code which executes a flexible search. When i am calling that code locally to search data it gives expected output but when I try to call it using REST API (Through controller) it gives error as <em>could not translate value expression ...
<p>Although others answers on the post are correct I just want to add my answer which helped to solve the issue.</p> <p>The issue was with search restriction.</p> <p>I just set current user as admin to bypass the restrictions. i.e.</p> <pre><code>userService.setCurrentUser(userService.getAdminUser()); </code></pre> <p>...
Flexible search is asking for session country while called from REST api
java|sap-commerce-cloud|flexible-search
0
59
3
72,990,116
72,990,116
1
true
2022-07-14T05:29:36.387Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flexible search is asking for session country while called from REST api<p>I have a code which executes a flexible search. When i am calling that code locall...
72,992,520
How can I use a for-loop to use a paste0 function on multiple variables in a dataframe?<p>My df looks like this:</p> <pre><code>N = 1000 a &lt;- rnorm(N) b &lt;- rnorm(N) c &lt;- rnorm(N) df &lt;- data.frame(a, b, c) </code></pre> <p>For each of these variables, I would like to perform the following function:</p> <pr...
<p>Do you have to use a loop? <code>dplyr</code>'s <code>across</code> lets you iterate a function over many columns:</p> <pre class="lang-r prettyprint-override"><code>library(dplyr) df |&gt; mutate(across(everything(), ~ifelse(.x &lt; 10, paste0(&quot;0&quot;, .x), ...
How can I use a for-loop to use a paste0 function on multiple variables in a dataframe?
r|dplyr
0
59
4
72,992,640
72,992,640
1
true
2022-07-15T10:22:08.310Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I use a for-loop to use a paste0 function on multiple variables in a dataframe?<p>My df looks like this:</p> <pre><code>N = 1000 a &lt;- rnorm(N) b ...
72,914,721
What is the best way to render a picture every 20ms on a website<p>I have a socket-io server that sends to my frontend an image (base64 encoded) every 20ms. The problem I have right now is that the frontend can't keep up such a high speed.</p> <p>At the moment I use an image and I change it's src attribute :</p> <pre c...
<p>@Dai comment is the answer! I went for Web RTC to transfer the video stream from the client to the server and back to the client.</p>
What is the best way to render a picture every 20ms on a website
javascript|node.js|frontend
0
59
1
72,997,277
72,997,277
1
true
2022-07-08T17:02:39.323Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the best way to render a picture every 20ms on a website<p>I have a socket-io server that sends to my frontend an image (base64 encoded) every 20ms. ...
72,997,810
How to get context in non composable function (Viewmodel) - Jetpack Compose<p>Hello developers in a composable function i can get context like this : LocalContext.current but how can i get it from a viewmodel class ???This is my viewmodel:</p> <pre><code>class LoginViewModel( private val _global: GlobalServices = G...
<p>You should either have a context parameter for your ViewModel</p> <pre><code>class LoginViewModel( private val context: Context, private val _global: GlobalServices = GlobalServices(), private val _login:LoginModel= LoginModel(), private val _loginService: LoginService =LoginService(), private va...
How to get context in non composable function (Viewmodel) - Jetpack Compose
android-jetpack-compose
0
59
1
72,997,985
72,997,985
1
true
2022-07-15T17:36:32.977Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get context in non composable function (Viewmodel) - Jetpack Compose<p>Hello developers in a composable function i can get context like this : LocalCo...
73,001,292
DateTime or TimeSpan Data mask?<p>I am looking for a completely customized <code>DateTime</code> property data mask for the <code>TimeSpan</code> part of the <code>DateTime</code>. Or if it makes things easier I can make the property itself a <code>TimeSpan</code></p> <ol> <li>I need to display in 24 hour time without ...
<p>As others mentioned, you'll need to create some conversion methods yourself. This code might help.</p> <pre><code>// Display current time Console.WriteLine(DateTime.Now.ToString(&quot;HHmm&quot;).TrimStart('0')); // Read some input var str = Console.ReadLine(); // Validate input (if required) int time; if (!int.Tr...
DateTime or TimeSpan Data mask?
c#|winforms|datetime|time|format
0
59
1
73,002,419
73,002,419
1
true
2022-07-16T03:20:48.093Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: DateTime or TimeSpan Data mask?<p>I am looking for a completely customized <code>DateTime</code> property data mask for the <code>TimeSpan</code> part of the...
73,003,394
Why does Spring Boot Controller give JSON but empty structure [{},{}]<p>I have a spring boot application with the following controller</p> <pre><code>package com.training.casapp.controller; import com.training.casapp.entity.Student; import com.training.casapp.repository.StudentRepository; import org.springframework.be...
<p>Jackson serializer by default does not serialize private fields without accessor methods.</p> <p>Either:</p> <ul> <li>make fields available (make it public or add getters)</li> <li>configure <code>ObjectMapper</code> used by jackson to also serialize private fields (for details you can reference this link: <a href="...
Why does Spring Boot Controller give JSON but empty structure [{},{}]
java|json|spring|spring-boot|cassandra
0
59
2
73,003,504
73,003,504
1
true
2022-07-16T10:20:58.487Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does Spring Boot Controller give JSON but empty structure [{},{}]<p>I have a spring boot application with the following controller</p> <pre><code>package...
73,006,375
Why does docker bother of context if we do not copy all<p>In various sites of Docker official web, it warns about the folder that is sent to <code>docker daemon</code> (they call as context) to build new image with <code>docker build</code>. For example, from <a href="https://docs.docker.com/develop/develop-images/dock...
<blockquote> <p>Let say that my build context is a 1GB folder, but in <code>Dockerfile</code>...</p> </blockquote> <p>The Dockerfile is normally transferred as part of the build context. Perhaps the easiest place to see this is in the <a href="https://docs.docker.com/engine/api/v1.41/#tag/Image/operation/ImageBuild" r...
Why does docker bother of context if we do not copy all
docker|docker-build
-1
59
2
73,008,581
73,008,581
1
true
2022-07-16T17:35:43.730Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does docker bother of context if we do not copy all<p>In various sites of Docker official web, it warns about the folder that is sent to <code>docker dae...
73,005,294
Move and resize textarea<p>I'm trying to create a way to move the box, but also manage to change its size, but the two events are interfering (when I try to change the box's size, it activates the move event), when I click the box it becomes resizable, however it is impossible to resize as the move event overlaps. I ho...
<p>Here's one way to do it.</p> <p>You can just check if the mouse pointer is in range of resize by checking if the mouse pointer is at bottom right corner.</p> <p>With this solution you can implement resizing in all direction if you want.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true"...
Move and resize textarea
javascript|html|css
0
59
1
73,013,585
73,013,585
1
true
2022-07-16T15:07:08.653Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Move and resize textarea<p>I'm trying to create a way to move the box, but also manage to change its size, but the two events are interfering (when I try to ...
73,013,484
NoMethodError - undefined method `strftime` for nil:NilClass<p>I am trying to use the gem 'strftime' in my Ruby project. Here is how I am using it in my code:</p> <p>TaskController: class TasksController &lt; ApplicationController</p> <pre><code> get '/tasks' do Task.all.to_json(methods: [:date_format, :cat...
<p>Most probably your <code>due_by</code> is <code>nil</code>, no value is set on the particular record you are showing.</p> <p>You must have a handling for this case or make sure <code>due_by</code> is always present by having a presence validation (or have a db validation on top).</p> <p>One solution to handle <code>...
NoMethodError - undefined method `strftime` for nil:NilClass
ruby|rubygems|strftime
0
59
1
73,015,299
73,015,299
1
true
2022-07-17T16:24:42.090Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NoMethodError - undefined method `strftime` for nil:NilClass<p>I am trying to use the gem 'strftime' in my Ruby project. Here is how I am using it in my code...
73,015,525
How to pivot a table using SQL - Unrecognized value<p>I'm trying to pivot a table using SQL. My table looks like this:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>ID</th> <th>import</th> <th>status</th> </tr> </thead> <tbody> <tr> <td>cust1</td> <td>100</td> <td>Authorized</td> </tr> <t...
<p>You need to provide pivot columns as string literals. Consider below query.</p> <pre class="lang-sql prettyprint-override"><code>SELECT * FROM ( SELECT ID, import, status FROM mytable ) PIVOT (SUM(import) FOR status in ('Authorized', 'Rejected')); </code></pre> <p><a href="https://i.stack.imgur.com/2DZNEm.png" rel...
How to pivot a table using SQL - Unrecognized value
sql|google-bigquery|pivot
1
59
1
73,015,844
73,015,844
1
true
2022-07-17T21:34:21.997Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to pivot a table using SQL - Unrecognized value<p>I'm trying to pivot a table using SQL. My table looks like this:</p> <div class="s-table-container"> <t...
73,013,013
DataGridView selected row to check a checkbox<p>I am currently trying to check a checkbox dependent of the SQL data after selecting the row in a datagridview.</p> <p>I have gotten this to display text with TexBoxes, but cannot get it to check a check box.</p> <p>Yes = True No = False</p> <p>Any recommendations, would b...
<p>There are several things I will assume and apply a certain logic that may not necessarily be what you want. However, it should be trivial to alter the code to meet your needs.</p> <p>It appears the columns in the grids <code>DataSource</code> are “text/string” columns containing a “Yes/No” values or possibly no valu...
DataGridView selected row to check a checkbox
c#|sql|checkbox|datagridview
-3
59
2
73,016,526
73,016,526
1
true
2022-07-17T15:25:41.380Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: DataGridView selected row to check a checkbox<p>I am currently trying to check a checkbox dependent of the SQL data after selecting the row in a datagridview...
73,020,618
How should I use control.invoke correctly to exclude a CS0120?<p>I wrote simple application where C# (winforms) call Python ML script (so I cannot use IronPython etc.) All worked fine and I used &quot;invoke&quot; correctly (I had only one process and not used class):</p> <pre><code>public static void appendTextData(st...
<p>Add a <code>SynchronizationContext</code> to your Form</p> <pre><code>private static SynchronizationContext Context; </code></pre> <p>And initialize in the constructor:</p> <pre><code>Context = SynchronizationContext.Current; </code></pre> <p>This allow you run code in your gui thread easily:</p> <pre><code>Context....
How should I use control.invoke correctly to exclude a CS0120?
python|c#|winforms
0
59
1
73,025,626
73,025,626
1
true
2022-07-18T10:11:42.900Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How should I use control.invoke correctly to exclude a CS0120?<p>I wrote simple application where C# (winforms) call Python ML script (so I cannot use IronPy...
73,028,437
How to redact data from array?<p>If I have a weather data, which is an array, like this one below.</p> <pre><code>const weather = [ {date:'2022-07-18', min_temp:15, max_temp:26, type:'clouds'}, {date:'2022-07-18', min_temp:13, max_temp:27, type:'sun'}, {date:'2022-07-18', min_temp:23, max_temp:31, type:'clouds'}, {date...
<p>The idea is first to group by date. This is done using the first reduce. While we do, we store the frequency of each type. and the min/max temp. Then we take the values of this object as the required array. Only a little housekeeping removing the <code>freq</code> helper object. And setting the <code>type</code> to ...
How to redact data from array?
javascript|arrays
0
59
2
73,028,672
73,028,672
1
true
2022-07-18T20:45:33.417Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to redact data from array?<p>If I have a weather data, which is an array, like this one below.</p> <pre><code>const weather = [ {date:'2022-07-18', min_t...
72,952,903
JWT differences between jose4j and jjwt dependencies in Spring<p>can anyone spot the difference between using jose4j from bitbucket or jjwt from jsonwebtoken to provide authentication in my app. I've been requested to implement the security and I have no idea which one to choose.</p> <p>There's a lot of info about jjwt...
<p>They are just different implementations of the same thing. Currently JWT does not support JWE, but JOSE4j does. So I think you can choose according to your needs.</p>
JWT differences between jose4j and jjwt dependencies in Spring
java|spring|spring-boot|jwt
1
59
1
73,046,516
73,046,516
1
true
2022-07-12T13:12:26.593Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JWT differences between jose4j and jjwt dependencies in Spring<p>can anyone spot the difference between using jose4j from bitbucket or jjwt from jsonwebtoken...
72,983,103
Send a ServerSentEvent from another Method<p>I'm trying to implement a Server Sent Event Controller for updating my Web Browser Client with the newest Data to display.</p> <p>This is my current Controller which sends the list of my data every 5 seconds. I want to send a SSE everytime I save my data in another service. ...
<p>Example code for controller:</p> <pre><code>package sk.qpp; import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.codec.ServerSentEvent; import org.springframework.stereotype.Controller; import org.springframework.web...
Send a ServerSentEvent from another Method
spring-boot|kotlin|spring-webflux|project-reactor
1
59
2
73,082,778
73,082,778
1
true
2022-07-14T15:32:11.523Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Send a ServerSentEvent from another Method<p>I'm trying to implement a Server Sent Event Controller for updating my Web Browser Client with the newest Data t...
73,004,732
How can I bind an App registration to a specific Power BI instance?<p>I have two app registrations for two different projects in Azure Active Directory. I also created two Power BI Embedded instances. I only have access to a single subscription in this account. Is there a way to assign a single instance for each app?</...
<p>In the PBI embedded capacity resources in azure, you can add/remove users/SPNs(apps) as <code>PBI capacity Administrator</code>.</p> <p>PBI capacity Admin gives you the ability to assign that PBI capacity to a workspace. <br><em>e.g, If you are given the capacity admin, then you can assign that capacity to any works...
How can I bind an App registration to a specific Power BI instance?
azure|powerbi|powerbi-embedded
0
59
1
73,096,304
73,096,304
1
true
2022-07-16T13:48:27.597Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I bind an App registration to a specific Power BI instance?<p>I have two app registrations for two different projects in Azure Active Directory. I al...
72,853,660
Feeding 2D tensor into RRN/LSTM layer<p>I have the following dataset:</p> <pre><code>for x, y in ds_train.take(1): print(i, j) </code></pre> <p>Output:</p> <pre><code>tf.Tensor( [[-0.5 0.8660254 -0.67931056 -0.7338509 0. 0. 0. 0. 0. 0. 1. 0. 0. ...
<p>Maybe try changing your <code>input_shape</code>, which currently only considers the features dimension:</p> <pre><code>tf.keras.layers.SimpleRNN(40, input_shape=(36, 24)) </code></pre> <p>And don't forget to set a batch size on your dataset:</p> <pre><code>ds_train = ds_train.batch(your_batch_size) </code></pre> <p...
Feeding 2D tensor into RRN/LSTM layer
python|tensorflow|keras|time-series|tensorflow-datasets
2
59
1
72,853,675
72,853,675
1
true
2022-07-04T08:18:01.170Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Feeding 2D tensor into RRN/LSTM layer<p>I have the following dataset:</p> <pre><code>for x, y in ds_train.take(1): print(i, j) </code></pre> <p>Output:</...
72,926,985
Pass array from C++ to C#<p>I need to pass an array from C++ to C#</p> <p>The C++ header is the following</p> <pre><code>extern &quot;C&quot; GMSH_API void GMSH_Model_OCC_Fragments(int* arrayPtr); </code></pre> <p>The C++ cpp is the following</p> <pre><code>void GMSH_Model_OCC_Fragments(int* arrayPtr) { int array[]...
<p>When you call C++ from C# you have to play by the rules of C++, so you cannot assign an array by</p> <pre><code>arrayPtr = array; </code></pre> <p>You can however fill an array given by C#</p> <p>C++ Function</p> <pre><code>void someFunction(char* dest, size_t length){ char* someData = &quot;helloWorld&quot;; ...
Pass array from C++ to C#
c#|c++
0
59
1
72,927,090
72,927,090
1
true
2022-07-10T07:58:49.643Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pass array from C++ to C#<p>I need to pass an array from C++ to C#</p> <p>The C++ header is the following</p> <pre><code>extern &quot;C&quot; GMSH_API void G...
72,976,234
MatDialogRef on close sending data to parent undefined Angular 13 with angular material 13<p><strong>Parent component</strong></p> <pre><code>constructor(private dialog: MatDialog) {} openCreateMetric() { this.dialog.open(MetricCreateComponent, { width: '50%', disableClose: true, autoFocus: 'di...
<p>You should look into using <code>afterClosed</code> instead of <a href="https://material.angular.io/components/dialog/api#MatDialog" rel="nofollow noreferrer"><code>afterAllClosed</code></a>. The latter is of type <code>Observable&lt;void&gt;</code>.</p> <pre><code>const dialogRef = this.dialog.open(MetricCreateComp...
MatDialogRef on close sending data to parent undefined Angular 13 with angular material 13
angular|angular-material
0
59
1
72,976,340
72,976,340
1
true
2022-07-14T06:41:36.983Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MatDialogRef on close sending data to parent undefined Angular 13 with angular material 13<p><strong>Parent component</strong></p> <pre><code>constructor(pri...
73,015,080
Nodejs setInterval and run first immediatly not after interval<p>I try to implement a loop in my noejs app that will always wait between the tasks. For this I found the setInterval function and I thought it is the solution for me. But as I found out, the first Interval, means the very first action also wait until the i...
<p>For modern JavaScript <code>await</code> and <code>async</code> should be used instead of <code>then</code> and <code>catch</code>.</p> <p>This will make many things easier, and the code becomes more readable. You e.g. can use a regular <code>for</code> loop to iterate over an array while executing asynchronous task...
Nodejs setInterval and run first immediatly not after interval
javascript|node.js|setinterval
1
59
2
73,015,267
73,015,267
1
true
2022-07-17T20:18:27.453Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Nodejs setInterval and run first immediatly not after interval<p>I try to implement a loop in my noejs app that will always wait between the tasks. For this ...
72,811,462
JHipster: run production profile on localhost<p>I am new to JHipster and I found it is easy to generate a application without sweat. I tried to generate a simple monolithic application and ran on dev mode and it worked like charm. However, when I want to run production mode using &quot;./mvnw -Pprod&quot; it shows erro...
<p>You chose to use JHipster registry to serve configuration and to scale up, so when you run your app in production mode you must start jhipster-registry application and also make sure you have copied the application properties to the registry repository (either git or a directory).</p> <p>Same thing for all dependenc...
JHipster: run production profile on localhost
java|maven|jhipster
1
59
2
72,812,897
72,812,897
1
true
2022-06-30T06:56:30.093Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JHipster: run production profile on localhost<p>I am new to JHipster and I found it is easy to generate a application without sweat. I tried to generate a si...
72,998,449
How to find variables in Julia using Linear Regression for Interpolation method?<p>There is an unknown function <a href="https://i.stack.imgur.com/qjjUG.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qjjUG.gif" alt="enter image description here" /></a>, and there are unknown coefficients k, l. Task ...
<p>You're almost there, but I think you have a misconception mathematically in your code. You are right that taking the log of f(x) makes this essentially a linear fit (of form y = mx + b) but you haven't told the code that, i.e. your LinearRegression function should read:</p> <pre><code>function LinearRegression(X) ...
How to find variables in Julia using Linear Regression for Interpolation method?
function|julia|linear-regression|mathematical-expressions
2
59
2
72,999,645
72,999,645
1
true
2022-07-15T18:46:43.453Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to find variables in Julia using Linear Regression for Interpolation method?<p>There is an unknown function <a href="https://i.stack.imgur.com/qjjUG.gif"...
72,966,249
Mouse coordinates in a canvas to 30 degree isometric coordinates on a grid<p>I have an isometric grid I'm drawing on a canvas. It uses a 30 degree angle offset and I use some script to draw a basic grid. For this grid I am projecting a flat grid with 40x40 tile sizes.</p> <pre class="lang-js prettyprint-override"><code...
<p>I am not myself very well versed in algebra so there may be an even simpler solution but anyway...</p> <p>What your function needs to do is to invert the transformation that occurred in the previous step in order to find back the original <code>x</code> and <code>y</code> values.</p> <pre class="lang-js prettyprint-...
Mouse coordinates in a canvas to 30 degree isometric coordinates on a grid
javascript|canvas|game-development|isometric
3
59
1
72,975,344
72,975,344
1
true
2022-07-13T12:25:10.243Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mouse coordinates in a canvas to 30 degree isometric coordinates on a grid<p>I have an isometric grid I'm drawing on a canvas. It uses a 30 degree angle offs...
72,776,810
Unusual Dataframe groupby<p>I´m trying to separate the original df in groups by date. For this I have created the loop where I get the last date of previous year as the first date. But I need also to have it as the last date of current year. But for some reason I can´t see why the last group is being merged.</p> <pre><...
<p>You can duplicate the overlapped row to assign it to 2 groups:</p> <pre><code>dup = d.dt.year.ne(d.shift().dt.year).shift(-1, fill_value=False).add(1) df1 = df.reindex(df.index.repeat(dup)) gid = df1.index.duplicated(keep='first').cumsum() + 1 out = dict(list(df1.assign(group=gid).groupby(gid, as_index=False))) </c...
Unusual Dataframe groupby
python|pandas|group-by
1
59
1
72,777,525
72,777,525
1
true
2022-06-27T18:27:25.680Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unusual Dataframe groupby<p>I´m trying to separate the original df in groups by date. For this I have created the loop where I get the last date of previous ...
72,819,948
Why is my loop stopping after if statement?<p>I'm very new to coding so please be kind. for an assignment, I need to create Python code that calculates GPA score. In this part, it has to take an input list and convert the letters to their equivalent scores, and print the total score.</p> <p>It only seems to read the fi...
<p>A Python for loop requires a &quot;local variable&quot; acting as each of the elements from a list. This takes me to the second point: If you're just going over a list with the for loop, then you're not required to store the length of that list in a variable and use <code>range(length)</code>. In fact, you should'v...
Why is my loop stopping after if statement?
python|string|list
-1
59
4
72,820,106
72,820,106
1
true
2022-06-30T17:39:43.923Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is my loop stopping after if statement?<p>I'm very new to coding so please be kind. for an assignment, I need to create Python code that calculates GPA s...
72,862,643
Inheritance for dynamically generated classes<p>Contiuing from this post: <a href="https://stackoverflow.com/questions/10555844/dynamically-creating-a-class-from-file">Dynamically creating a class from file</a>, <code>type(name, bases, dict)</code> can be used to dynamically create a class with name <code>name</code>, ...
<p>City’s <strong>init</strong> method gets override by Building’s <strong>init</strong> method try</p> <pre><code>hasattr(s, ‘number’) </code></pre> <p>and it should return True.</p> <p>Define your class as</p> <pre><code>class City: name = 0 class Building: number = 100 </code></pre> <p>This way attributes ...
Inheritance for dynamically generated classes
python|class|inheritance|attributes|base
0
59
2
72,866,212
72,866,212
1
true
2022-07-04T22:58:28.650Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Inheritance for dynamically generated classes<p>Contiuing from this post: <a href="https://stackoverflow.com/questions/10555844/dynamically-creating-a-class-...
73,001,008
How can I implement update and delete in django view?<p>I am creating a movie review website. In it, I want to be able to allow a User to make one comment on one movie and then Update or Delete that comment. But I am only able to implement POST right now. How do I change the view, html or model?</p> <h1>Question to ask...
<p>Looks like you want to do multiple actions in one view. <s>One form for each action and a template field to differentiate actions would be a solution.</s> In this specific case, 'create' action and 'update' action can be automatically determined if we take advantage of <code>unique_together</code>.</p> <pre><code>fr...
How can I implement update and delete in django view?
python|django|django-models|django-views|django-templates
0
59
1
73,009,336
73,009,336
1
true
2022-07-16T01:45:55.053Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I implement update and delete in django view?<p>I am creating a movie review website. In it, I want to be able to allow a User to make one comment on...
72,984,889
Proving enumerate(...) to range(len(...)) equality<p>I'm trying to prove the equality of the following Python constructs in Coq: <code>for i, _ in enumerate(l, s)</code> and <code>for i in range(s, len(l) + s)</code></p> <p>I've made recursive definitions of both <code>enumerate</code> and <code>range</code> functions,...
<p>You can start your proof of <code>abc</code> by just an induction on <code>l</code> (not an induction on <code>length l</code>).</p> <p>Arithmetic equalities which appear in the proof are solved with <code>lia</code>.</p> <pre><code> Require Import Lia. Theorem abc : forall (T : Type) (l : list T) (s : nat), ...
Proving enumerate(...) to range(len(...)) equality
coq|coq-tactic
0
59
1
72,989,154
72,989,154
1
true
2022-07-14T18:03:30.677Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Proving enumerate(...) to range(len(...)) equality<p>I'm trying to prove the equality of the following Python constructs in Coq: <code>for i, _ in enumerate(...
72,958,865
ANTLR4 Logical Expressions<p>I'm new to ANTLR and trying to support logical expressions. My problem is that the grammar is considering even a single '&amp;' to be a logical AND (same goes for | and OR), which should not be the case.</p> <p>Here's my grammar file (TagQuery.g4):</p> <pre><code> query : (expression)+ ...
<p>As @kaby76 points out, you're getting a token recognition error, this comes from the Lexer. You'll also need to attach your <code>ErrorListener</code> to the Lexer.</p> <pre><code>lexer.addErrorListener(errorListener); </code></pre> <p>Also, you really want your ErrorListener to collect all of the errors it encount...
ANTLR4 Logical Expressions
java|expression|antlr|antlr4|grammar
0
59
1
72,959,408
72,959,408
1
true
2022-07-12T22:05:18.280Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ANTLR4 Logical Expressions<p>I'm new to ANTLR and trying to support logical expressions. My problem is that the grammar is considering even a single '&amp;' ...
72,934,949
linq, best sales in age group<p>Before that, I asked a similar question, but as it turned out, I set the task incorrectly and eventually got the wrong result.</p> <p>I have multiple db tables: book-order-item-order-users</p> <p>I need to get a list of the best-selling books in a given age category. Everything works cor...
<p>Try the following query:</p> <pre class="lang-cs prettyprint-override"><code>var query = from b in _context.Book from oi in b.OrderItem where EF.Functions.DateDiffYear(oi.Order.ApplicationUser.DateofBirth, DateTime.Now) &gt;= 17 &amp;&amp; EF.Functions.DateDiffYear(oi.Order.ApplicationUser.Date...
linq, best sales in age group
c#|.net|entity-framework|linq
0
59
1
72,935,523
72,935,523
1
true
2022-07-11T07:17:42.307Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: linq, best sales in age group<p>Before that, I asked a similar question, but as it turned out, I set the task incorrectly and eventually got the wrong result...
73,030,543
Google Apps Script - How to change the code to create Google Sheets file in active Google Drive Shared folder rather than root (My Drive) folder?<p>I have some code below that takes all the tabs (excluding 2 of them) in a Google Sheets file and creates independent Google Sheets files for each of them. Right now, they a...
<p>In your situation, when your script is modified, how about the following modification?</p> <h3>Modified script:</h3> <p>In this modification, Drive API is used. So, <a href="https://developers.google.com/apps-script/guides/services/advanced#enable_advanced_services" rel="nofollow noreferrer">please enable Drive API ...
Google Apps Script - How to change the code to create Google Sheets file in active Google Drive Shared folder rather than root (My Drive) folder?
google-apps-script|google-apps
2
59
1
73,030,625
73,030,625
1
true
2022-07-19T02:42:10.327Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Google Apps Script - How to change the code to create Google Sheets file in active Google Drive Shared folder rather than root (My Drive) folder?<p>I have so...
72,943,572
How do I fetch OneToMany mappedBy when creating the child entity before the parent?<p>I have a model like this:</p> <pre><code>class Message { @Id private UUID id; // ... @OneToMany(mappedBy = &quot;messageId&quot;) private List&lt;Value&gt; values; } class Value { private UUID messageId; } ...
<p><strong>Solution 1: explicitly initialize child entities during parent entity creation</strong> <br>Main idea of that solution is to create an additional method for loading <code>Value</code> entities by <code>messageId</code> in <code>ValueRepository</code> and use it explicitly to initialize values collection duri...
How do I fetch OneToMany mappedBy when creating the child entity before the parent?
java|jpa
1
59
1
72,945,283
72,945,283
1
true
2022-07-11T19:15:16.290Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I fetch OneToMany mappedBy when creating the child entity before the parent?<p>I have a model like this:</p> <pre><code>class Message { @Id p...
72,887,299
QtQuick/QML Create Expandable SubMenu from PyQt5<p>I want to create ListView which includes nested ListModel for expanding and collapsing submenu. (The topic that I use while I creating nested expandable listview in <a href="https://stackoverflow.com/questions/33406472/qml-nested-list-view-with-highlight">here</a>.)</p...
<p><strong>You didn't emitted any signals while changing the collapsed state</strong>. Therefore there was no way for properties that relay on that role to know that they need to synchronize with it.</p> <p>Change:</p> <pre class="lang-py prettyprint-override"><code>@pyqtSlot(int, str) def collapseEditInputsMenu(self, ...
QtQuick/QML Create Expandable SubMenu from PyQt5
qt|pyqt5|qml
3
59
1
72,895,896
72,895,896
1
true
2022-07-06T16:54:53.757Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: QtQuick/QML Create Expandable SubMenu from PyQt5<p>I want to create ListView which includes nested ListModel for expanding and collapsing submenu. (The topic...
72,988,730
How is this design achieved in Flutter?<p>How to achieve this design in Flutter?</p> <p>This is like a custom animated <code>TabView</code>.<a href="https://i.stack.imgur.com/3UGS1.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3UGS1.gif" alt="CustomTabView" /></a></p>
<p>you can use &quot;<a href="https://pub.dev/packages/container_tab_indicator" rel="nofollow noreferrer">container_tab_indicator</a>&quot; package install it with <code>flutter pub add container_tab_indicator</code></p> <p>then use it like this:</p> <pre><code>import 'package:container_tab_indicator/container_tab_indi...
How is this design achieved in Flutter?
flutter|dart|animation|tabview
0
59
2
72,988,829
72,988,829
1
true
2022-07-15T03:22:18.980Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How is this design achieved in Flutter?<p>How to achieve this design in Flutter?</p> <p>This is like a custom animated <code>TabView</code>.<a href="https://...
72,784,116
I am getting an error when converting a varchar column into a date column<p>I am using SQL Server.</p> <p>I have a table with a column called [DateReceived]. Now the column is a 'varchar' column. The date format is: '18/05/2022'. When I try to convert it to a 'date' column using:</p> <pre><code>ALTER TABLE Corresponden...
<p>You cannot simply convert a text date column to a bona fide date in this way. What you could do would be to create a new column and populate it using <code>TRY_CONVERT</code>:</p> <pre class="lang-sql prettyprint-override"><code>ALTER TABLE Correspondence ADD DateReceivedNew Date; </code></pre> <p>Then, populate it...
I am getting an error when converting a varchar column into a date column
sql|sql-server
1
59
2
72,784,159
72,784,159
1
true
2022-06-28T09:39:43.570Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I am getting an error when converting a varchar column into a date column<p>I am using SQL Server.</p> <p>I have a table with a column called [DateReceived]....
72,866,055
How to quickly create a grid of histograms<pre><code>fig, axes = plt.subplots(4,3, figsize=(17,17)) axes = axes.flatten() labels = ['d','f'] l1 = sns.histplot(ax=axes[0],hue=dff_2k['source'],x='a', data=dff_2k) l2 = sns.histplot(ax=axes[1],hue=dff_2k['source'],x='b', data=dff_2k) l3 = sns.histplot(ax=axes[2],hue=dff_2...
<p><a href="https://seaborn.pydata.org/generated/seaborn.displot.html" rel="nofollow noreferrer"><code>sns.displot</code></a> can create this kind of plot in one go. As <code>displot</code> creates its own figure and subplots also that step should be omitted. Most seaborn functions work best for data in <a href="https:...
How to quickly create a grid of histograms
python|matplotlib|seaborn
0
59
1
72,867,079
72,867,079
1
true
2022-07-05T08:11:13.023Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to quickly create a grid of histograms<pre><code>fig, axes = plt.subplots(4,3, figsize=(17,17)) axes = axes.flatten() labels = ['d','f'] l1 = sns.histpl...
72,768,667
Check if the value exists in any other columns with Tidyverse<p>Sample data</p> <pre><code>df &lt;- diag(1:8) %&gt;% as_tibble() %&gt;% mutate(A = c(10, 5, 11, 4, 6, 9, 65, 8)) # A tibble: 8 x 9 V1 V2 V3 V4 V5 V6 V7 V8 A &lt;int&gt; &lt;int&gt; &lt;int&gt; &lt;int&gt; &lt;int&gt;...
<p>You may try</p> <pre><code>library(dplyr) df %&gt;% mutate(result = rowSums(across(everything() &amp; - &quot;A&quot;, ~A %in% .x)) &gt; 0) V1 V2 V3 V4 V5 V6 V7 V8 A result &lt;int&gt; &lt;int&gt; &lt;int&gt; &lt;int&gt; &lt;int&gt; &lt;int&gt; &lt;int&gt; &lt;int&gt; &lt;dbl&gt; &...
Check if the value exists in any other columns with Tidyverse
r|dplyr|tidyverse|data-manipulation
3
59
2
72,768,777
72,768,777
1
true
2022-06-27T07:52:38.743Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Check if the value exists in any other columns with Tidyverse<p>Sample data</p> <pre><code>df &lt;- diag(1:8) %&gt;% as_tibble() %&gt;% mutate(A = c(1...
72,859,627
How Javascript breaks up a piece of text into individual words? and add span tags to each word?<p>I wrote a piece of JavaScript code and want to implement two functions:</p> <p>1: <em>Break a piece of text into separate word arrays.</em> So far, I have used <code>regex</code> to search for spaces and punctuation. It do...
<p><a href="https://stackoverflow.com/q/4377480/5041759"><code>\s</code></a> will do the job. You can change:</p> <pre><code>var word_array = text.split(/[ \t\n\r.?,&quot;';:!()[\]{}&lt;&gt;\/]/) ^^ </code></pre> <p>to:</p> <pre><code>var word_array = text.split(/[\s\t\n\r.?,&quot;';:!()[\...
How Javascript breaks up a piece of text into individual words? and add span tags to each word?
javascript|regex|typescript
2
59
1
72,860,535
72,860,535
1
true
2022-07-04T16:19:16.567Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How Javascript breaks up a piece of text into individual words? and add span tags to each word?<p>I wrote a piece of JavaScript code and want to implement tw...
72,905,385
Does a Google Datastore query plus transaction run slower than just a query?<p>Are Google Datastore queries slower when put into a transaction? Assuming the query is exactly the same, would the run time of a transaction + query be slower than the query not in a transaction?</p> <p>Does the setup of the transaction add ...
<p>Here's some data from running a single document get 100 times sequentially.</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>type</th> <th>avg</th> <th>p99</th> </tr> </thead> <tbody> <tr> <td>transactional</td> <td>46ms</td> <td>86ms</td> </tr> <tr> <td>nontransactional</td> <td>16ms</td...
Does a Google Datastore query plus transaction run slower than just a query?
google-cloud-platform|google-cloud-firestore|google-cloud-datastore|objectify
-4
59
1
72,907,174
72,907,174
1
true
2022-07-08T00:01:50.543Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does a Google Datastore query plus transaction run slower than just a query?<p>Are Google Datastore queries slower when put into a transaction? Assuming the ...
72,846,638
output centered text using F-strings with dictionaries<p>I want to output values from my dict using f string but if I use that code<code>print(f&quot;{*excel_values['object']}&quot;)</code>, I have error <code>SyntaxError: can't use starred expression here</code>. How can i fix this problem? UPD: I have to use f string...
<p>Try using the format method</p> <pre><code>print('{:^55s}'.format(*excel_values['object'])) </code></pre> <p>By this way, you could center the text without using f-string</p> <p><em>Edit</em><br /> The previous answer only printed the first index of your list, if you want to print more than one index, you just have ...
output centered text using F-strings with dictionaries
python|python-3.x|string|dictionary|f-string
0
59
2
72,846,975
72,846,975
1
true
2022-07-03T12:48:39.963Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: output centered text using F-strings with dictionaries<p>I want to output values from my dict using f string but if I use that code<code>print(f&quot;{*excel...
72,772,201
Convert Array of [[Double]] to String (similar to Print() output)<p><code>let intervals = [[1,1],[2,2],[3,3]]</code></p> <p>I would like to store this intervals variables into <code>CloudKit</code> as String in the same form as a <code>print</code> output eg:</p> <pre><code>print(interval) </code></pre> <p>output = [[1...
<p>You can try</p> <pre><code>let intervals = [[1,1],[2,2],[3,3]] let res = &quot;[\(intervals.map { &quot;[\($0.first!),\($0.last!)]&quot; }.joined(separator: &quot;,&quot;))]&quot; print(res) </code></pre> <p><strong>OR</strong></p> <pre><code>let res = String(data: try! JSONEncoder().encode(intervals), encoding: ...
Convert Array of [[Double]] to String (similar to Print() output)
ios|swift|cloudkit
-5
59
1
72,772,278
72,772,278
1
true
2022-06-27T12:34:47.073Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert Array of [[Double]] to String (similar to Print() output)<p><code>let intervals = [[1,1],[2,2],[3,3]]</code></p> <p>I would like to store this interv...
72,823,865
How can I display only the newly added object in the array?<p>Help!, I've been racking my brain for hours but I still can't figure out what's wrong here.</p> <p>Here's what I wanted to happen, every time I add a new book, it should display on the page, it does display. However, when I add in a new Book, the first Book ...
<ol> <li>Each time you call addBookToLibrary, you add the books in the bookslibrary array to the dom . So it iterates over the previously added elements</li> <li>If you want to loop, you need clear content of <code>bookGrid</code></li> <li>You just need to create a dom creation element when submitting the form same as ...
How can I display only the newly added object in the array?
javascript|arrays|function|for-loop
1
59
2
72,824,134
72,824,134
1
true
2022-07-01T02:37:53.987Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I display only the newly added object in the array?<p>Help!, I've been racking my brain for hours but I still can't figure out what's wrong here.</p>...
72,878,753
Auto selecting dependent select field options in React<p>I am using React v18.</p> <p>I tried to populate react-select options from api, it didn't work as expected. Anyway, its fine with normal select as of now.</p> <p>I have a row of select boxes as shown below. <a href="https://i.stack.imgur.com/Ntoww.png" rel="nofol...
<pre><code>import React, { useState } from &quot;react&quot;; import Select from &quot;react-select&quot;; const options = [ { value: &quot;chocolate&quot;, label: &quot;Chocolate&quot; }, { value: &quot;strawberry&quot;, label: &quot;Strawberry&quot; }, { value: &quot;vanilla&quot;, label: &quot;Vanilla&quot; }...
Auto selecting dependent select field options in React
reactjs|api|select|react-hooks|react-select
0
59
2
72,879,148
72,879,148
1
true
2022-07-06T06:23:07.520Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Auto selecting dependent select field options in React<p>I am using React v18.</p> <p>I tried to populate react-select options from api, it didn't work as ex...
72,799,623
Xticks different interval<p>How do i set xticks to 'a different interval'</p> <p>For instance:</p> <pre><code>plt.plot(1/(np.arange(0.1,3,0.1))) </code></pre> <p>returns:</p> <p><a href="https://i.stack.imgur.com/YckXV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YckXV.png" alt="enter image descri...
<p>You want to learn about <code>plt.xlim</code> and adjacent functions. This causes the X axis to have limits (minimum, maximum) that <em>you</em> specify. Otherwise Matplotlib decides for you based on the values you try to plot.</p> <pre class="lang-py prettyprint-override"><code>y = 1 / np.arange(0.1,3,0.1) plt.plot...
Xticks different interval
python|numpy|matplotlib
4
59
2
72,802,102
72,802,102
1
true
2022-06-29T10:13:03.407Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Xticks different interval<p>How do i set xticks to 'a different interval'</p> <p>For instance:</p> <pre><code>plt.plot(1/(np.arange(0.1,3,0.1))) </code></pre...
72,839,371
find and mask RGB-color in cv2 image<p>I have the following image:</p> <p><a href="https://i.stack.imgur.com/FrhSa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FrhSa.png" alt="enter image description here" /></a></p> <p>I want to filter out a single color (RGB-style)</p> <pre><code>r, g, b = 119, ...
<p>Logic bug.</p> <p>you say:</p> <ul> <li><code>idx = np.where(np.all(img == [b, g, r], axis=-1))</code></li> <li><code>idx = np.where(np.all(img != [b, g, r], axis=-1))</code></li> </ul> <p>... which is incorrectly inverted. Correct boolean logic (ok first order logic but you get the idea):</p> <p><code>not (all (equ...
find and mask RGB-color in cv2 image
python|numpy|opencv
1
59
2
72,840,368
72,840,368
1
true
2022-07-02T13:22:02.997Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: find and mask RGB-color in cv2 image<p>I have the following image:</p> <p><a href="https://i.stack.imgur.com/FrhSa.png" rel="nofollow noreferrer"><img src="h...
72,815,764
Inconsistency in numbers between json Marshall and Unmarshall in Golang<pre><code>package main import ( &quot;encoding/json&quot; &quot;fmt&quot; ) func t() { a := int64(1&lt;&lt;63 - 1) fmt.Println(a) m := map[string]interface{}{ &quot;balance&quot;: a, } data, _ := json.Marshal(...
<p>When unmarshaling into a map of type <code>map[string]any</code>, the <a href="https://pkg.go.dev/encoding/json" rel="nofollow noreferrer"><code>encoding/json</code></a> package will choose <code>float64</code> type to unmarshal numbers.</p> <p>The number <code>9223372036854775807</code> cannot be represented precis...
Inconsistency in numbers between json Marshall and Unmarshall in Golang
json|go|marshalling|unmarshalling
0
59
1
72,815,921
72,815,921
1
true
2022-06-30T12:22:54.853Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Inconsistency in numbers between json Marshall and Unmarshall in Golang<pre><code>package main import ( &quot;encoding/json&quot; &quot;fmt&quot; ) ...
72,888,852
Extract Year, Month, Day from Unix TimeStamp column in Rust DataFusion DataFrame?<p>I have created a DataFusion DataFrame:</p> <pre><code>| asin | vote | verified | unixReviewTime | reviewText | +------------+------+----------+----------------+-----------------+ | 0486427706 | 3 | true | 1381017600 ...
<pre><code>use datafusion::prelude::*; use datafusion::error::Result; use datafusion::arrow::datatypes::{DataType, TimeUnit}; #[tokio::main] async fn main() -&gt; Result&lt;()&gt; { let mut ctx = SessionContext::new(); let df = ctx .read_json(&quot;/tmp/data.json&quot;, NdJsonReadOptions::default()) ...
Extract Year, Month, Day from Unix TimeStamp column in Rust DataFusion DataFrame?
rust|apache-arrow-datafusion
0
59
1
72,941,102
72,941,102
1
true
2022-07-06T19:21:04.410Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extract Year, Month, Day from Unix TimeStamp column in Rust DataFusion DataFrame?<p>I have created a DataFusion DataFrame:</p> <pre><code>| asin | vote...
72,805,436
Replacing html content using sed and regex<p>I am trying to replace the content of some HTML content using sed in a bash script. For some reason I'm not getting the proper result as it's not replacing anything mainly the regex part</p> <p>HTML i want to replace</p> <pre><code>&lt;h3 class=&quot;indicate-hover css-5fzt5...
<p>Using <code>sed</code></p> <pre><code>$ sed 's/.*-[[:alnum:]]\+&quot;&gt;/head /' input_file </code></pre> <p><strong>Output</strong></p> <pre><code>head For the Most Complex Heroines Animation head The Psychology Behind Sibling </code></pre>
Replacing html content using sed and regex
linux|bash|web-scraping|sed
3
59
2
72,805,471
72,805,471
1
true
2022-06-29T17:16:11.343Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Replacing html content using sed and regex<p>I am trying to replace the content of some HTML content using sed in a bash script. For some reason I'm not gett...
72,891,894
Added rows like "ABCD -> DEFG -> GHIJ" by apped_row<pre><code>import gspread import random gc = gspread.service_account(filename='영업인만들기\gspread-******-**********.json') sh = gc.open(&quot;관리자_종합_DB&quot;) worksheet = sh.worksheet(&quot;영업인&quot;) Name = input('영업인 이름 : ') Email = input('영업인 이메일 : ') alist = wo...
<p>The <a href="https://github.com/burnash/gspread/issues/603" rel="nofollow noreferrer">issue</a> is that <code>append_row</code> tries to find a logical table to append to. And when you have empty cells in your previous row it could move this logical table to the right. The <a href="https://docs.gspread.org/en/v3.7.0...
Added rows like "ABCD -> DEFG -> GHIJ" by apped_row
python|gspread
1
59
1
72,892,209
72,892,209
1
true
2022-07-07T03:10:31.163Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Added rows like "ABCD -> DEFG -> GHIJ" by apped_row<pre><code>import gspread import random gc = gspread.service_account(filename='영업인만들기\gspread-******-****...
72,874,774
How do I loop through an Angular HTTP Response?<p>I'm a beginner in Angular trying to learn the ins and outs. I'm uploading a file and making a call to an API which validates the file. In the response is a list of JSON validation errors that come back based on some values of the file.</p> <p>I'm attempting to loop thro...
<p>Let's define your response type so the typescript compiler can show you any mistakes:</p> <pre class="lang-js prettyprint-override"><code>type ErrorResponse = { subcategory_errors: ErrorList[], validation_errors: ErrorList[] } type ErrorList = { sheet: string, errors: string[] } </code></pre> <p>We can assi...
How do I loop through an Angular HTTP Response?
arrays|angular|typescript|httpresponse|angular-pipe
0
59
2
72,875,171
72,875,171
1
true
2022-07-05T19:46:56.890Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I loop through an Angular HTTP Response?<p>I'm a beginner in Angular trying to learn the ins and outs. I'm uploading a file and making a call to an AP...
72,873,939
How to take input in java where array length is not defined?<p>My input is in this format:</p> <pre><code>1 2 3 4 5 6 Alice </code></pre> <p>The array length is not known. I coded it this way:</p> <pre><code>import java.util.*; public class Main { public static void main(String[] args) { List&lt;Integer&gt;...
<p>You should use <code>hasNextInt</code> to check for integer input. Once no more integers, then just use <code>next()</code> to read the player.</p> <pre><code>List&lt;Integer&gt; arr = new ArrayList&lt;&gt;(); Scanner sc = new Scanner(System.in); while(sc.hasNextInt()){ arr.add(sc.nextInt()); } String player = ...
How to take input in java where array length is not defined?
java|arraylist|java.util.scanner|inputmismatchexception
0
59
2
72,874,301
72,874,301
1
true
2022-07-05T18:22:50.537Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to take input in java where array length is not defined?<p>My input is in this format:</p> <pre><code>1 2 3 4 5 6 Alice </code></pre> <p>The array length...
73,013,368
How do you convert a Vec<String> to a &[&str] of a fixed character?<p>I'm new to Rust and I can't seem to figure out how to convert a Vec into an equivalent length &amp;[&amp;str] with a fixed character. For example, I want to convert something like [&quot;hello&quot;, &quot;world&quot;] to something of the form &amp;...
<p>You cannot do it since <code>[&amp;str]</code> has no definite size. Try explicitly collecting into a <code>Vec&lt;&amp;str&gt;</code> and then call <code>as_slice</code> on it:</p> <pre><code>let x = vec![&quot;hello&quot;, &quot;world&quot;]; let mapped = x .iter() .map(|s| &quot;@&quot;) .collect::&lt;Ve...
How do you convert a Vec<String> to a &[&str] of a fixed character?
rust
1
59
1
73,013,501
73,013,501
1
true
2022-07-17T16:10:05.057Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do you convert a Vec<String> to a &[&str] of a fixed character?<p>I'm new to Rust and I can't seem to figure out how to convert a Vec into an equivalent ...
72,846,781
SQL SERVER LIKE statement only works when inserting one Unicode character (doesn't work with multiple chars)<p>I have some SQL query, like this:</p> <pre><code>SELECT ... FROM ... WHERE FIELD LIKE N'%ב%' </code></pre> <p>which works fine. but if I insert more characters, it doesn't return anything even it should (the f...
<p>As an absolute <em>last-resort</em> option: if you need to insert Unicode text in a Unicode-unsafe end-to-end scenario (i.e. where <em>something</em> in-between your keyboard and the target database is mangling correct Unicode encoding, or using some other encoding) then you should always be able to fall-back to usi...
SQL SERVER LIKE statement only works when inserting one Unicode character (doesn't work with multiple chars)
sql-server
0
59
2
72,847,199
72,847,199
1
true
2022-07-03T13:10:54.853Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL SERVER LIKE statement only works when inserting one Unicode character (doesn't work with multiple chars)<p>I have some SQL query, like this:</p> <pre><co...
72,834,705
How to capture Custom Events from sibling in JS? Is it even possible?<p>I understand the idea behind capturing and bubbling of events in Js. The event is either being passed to the parents of the dispatching Element or it is passed to the other direction - the child elements of the dispatching Element.</p> <p>Unfortuna...
<blockquote> <p>Is it even possible to receive events from siblings?</p> </blockquote> <p>No, it isn't.</p> <p>But, if you know it, you <em>can</em> indicate the <strong>receiver's</strong> relationship to <code>e.target</code>, like this:</p> <pre><code>let receiver = e.target.parentNode.previousElementSibling; recei...
How to capture Custom Events from sibling in JS? Is it even possible?
javascript|html|dom|custom-element|custom-events
1
59
1
72,834,828
72,834,828
1
true
2022-07-01T21:18:05.277Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to capture Custom Events from sibling in JS? Is it even possible?<p>I understand the idea behind capturing and bubbling of events in Js. The event is eit...
72,894,048
Aggregating values per day using a formula<p>I have a pandas dataframe below</p> <pre><code>import pandas as pd data = { 'id': [1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3], 'datetime': ['2021-03-15', '2021-03-15', '2021-03-17', '2021-03-17', '2021-03-12', '2021-03-12', '2021-12-14', '2021-04-07', '2021-07-09', '2021-04-25', '202...
<p>The mathematical formula for your use case would be</p> <pre><code>10*np.log(1/np.sum(df['t'])*np.sum((df['t']*(np.power(10, df['leq']/10))))) </code></pre> <p>We want the daily average for each id on each day, which means for id <code>1</code> you have <code>2</code> unique days <code>2021-03-15</code> and <code>20...
Aggregating values per day using a formula
python|pandas|dataframe
0
59
1
72,894,160
72,894,160
1
true
2022-07-07T07:45:34.443Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Aggregating values per day using a formula<p>I have a pandas dataframe below</p> <pre><code>import pandas as pd data = { 'id': [1, 1, 1, 1, 2, 2, 2, 3, 3, 3...
72,384,757
Why moveViewToX() won't move my display to the last value in my bar chart? - Swift<p>I'm new to Swift and I'm trying to create bar chart. I manage to create a chart but for some reason moveViewToX() does not work as expected - it does not scroll to the last x values. Here is my relevant function to create a chart:</p> ...
<p>After some time I figured this out. Last step //Set visibility needs delay of 0.1s:</p> <pre><code>barChartView.setVisibleXRangeMaximum(7) let when = DispatchTime.now() + 0.1 DispatchQueue.main.asyncAfter(deadline: when) { self.barChartView.moveViewToX(Double(self.count)) } </code></pre> <p>Hopefully this will ...
Why moveViewToX() won't move my display to the last value in my bar chart? - Swift
swift|charts
1
59
1
72,396,036
72,396,036
1
true
2022-05-25T22:26:24.863Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why moveViewToX() won't move my display to the last value in my bar chart? - Swift<p>I'm new to Swift and I'm trying to create bar chart. I manage to create ...
72,385,548
IHP - Unable to retrieve special characters from request body<p>I'm trying to send the request using ajax:</p> <pre class="lang-js prettyprint-override"><code> const formBody = document.getElementById('body'); // my form data const XHR = new XMLHttpRequest(); const params = &quot;body=&quot; + formBody; ...
<p>You have to encode the formBody using <code>encodeURIComponent()</code> to encode special characters as follows:</p> <pre><code>const params = &quot;body=&quot; + encodeURIComponent(formBody); </code></pre> <p>Your IHP action should be able to handle special characters then.</p>
IHP - Unable to retrieve special characters from request body
haskell|ihp
1
59
1
72,412,624
72,412,624
1
true
2022-05-26T00:52:27.320Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: IHP - Unable to retrieve special characters from request body<p>I'm trying to send the request using ajax:</p> <pre class="lang-js prettyprint-override"><cod...
72,356,735
Struct of array global scope<p>I need a struct of array[lenght] to be seen by all my methods(global).</p> <p>The problem I have is that the struct needs to be initialized with a specific length inside a specific function. To be more precise the initialization of struct with the length of size has to happen when importa...
<p>If using <code>std::vector</code> is not allowed, then you can use dynamic memory allocation either manually using <code>new</code> and <code>delete</code> or better would be to use <a href="https://en.cppreference.com/w/cpp/memory/unique_ptr" rel="nofollow noreferrer"><strong>smart pointers</strong></a>. But since ...
Struct of array global scope
c++|struct|scope|hashmap
0
59
1
72,356,814
72,356,814
1
true
2022-05-24T02:55:50.350Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Struct of array global scope<p>I need a struct of array[lenght] to be seen by all my methods(global).</p> <p>The problem I have is that the struct needs to b...
72,325,576
Unexpected HTTP GET Response from Github API<p>I'm currently trying to add a simple assisted-update feature to an application I'm working on, but have hit a roadblock with the Github API when making HTTP GET requests.<br /> I don't really have much experience with the HTTP protocol, so I apologize if the reason behind ...
<p>I decided to go ahead with embedding the executable anyway since I couldn't get this to work, and somehow that fixed it.<br /> It was broken when running the program directly through Visual Studio's debugger, and now that it's being called <em>outside</em> of the debugger it works fine without any changes.</p> <p>Th...
Unexpected HTTP GET Response from Github API
c#|http|get|dotnet-httpclient|http-get
1
59
2
72,326,858
72,326,858
1
true
2022-05-20T23:23:38.470Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unexpected HTTP GET Response from Github API<p>I'm currently trying to add a simple assisted-update feature to an application I'm working on, but have hit a ...
72,351,165
How can we query array field with size less than some specific value in mongodb using springboot?<p>My objective is to query the array fields who have size less than 5.</p> <p>I tried the below solution</p> <pre><code>MongoDatabase database = mongoClient.getDatabase(&quot;Friends&quot;); MongoCollection&lt;Docu...
<p>You are not using annotations.</p> <pre><code>{$expr:{$lt:[{$size:&quot;$MainArray&quot;}, 5]}} </code></pre> <p>You need to use <code>$expr</code> to use operators in simple find.</p> <p>Equivalent in <code>BasicDBObject</code> is</p> <pre><code>new BasicDBObject(&quot;$expr&quot;, new BasicDBObject(&quot;$...
How can we query array field with size less than some specific value in mongodb using springboot?
mongodb|mongodb-query|spring-data|aggregation-framework|spring-data-mongodb
1
59
1
72,351,414
72,351,414
1
true
2022-05-23T15:31:00.030Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can we query array field with size less than some specific value in mongodb using springboot?<p>My objective is to query the array fields who have size l...
72,243,642
Reading filename using regexp in Bash<p>I am writing a bash script that calls an external program which generates a zip file of the form ########.zip which the '#'s# can be any decimal digit. There is no way to predict what the digits will be.</p> <p>So far I have been able to get by using the regexp [0-9][0-9]*zip fo...
<p>What you're asking for is not a regex but a &quot;glob expression&quot;. In particular, if you want to match any number of digits, this can be done with a bash feature called extended globbing, or &quot;extglobs&quot;. Read more at <a href="https://wiki.bash-hackers.org/syntax/pattern#extended_pattern_language" rel=...
Reading filename using regexp in Bash
bash|7zip
0
59
2
72,243,665
72,243,665
1
true
2022-05-14T20:27:59.013Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reading filename using regexp in Bash<p>I am writing a bash script that calls an external program which generates a zip file of the form ########.zip which t...
72,346,865
JavaScript - Iterate over shared drives to get file by input string (Google Apps Script)<p>I have 4 shared drives with unique files named 00000001.xml, 00000002.xml ... (like IDs). Every drive has ~350k files.</p> <p>So, my question is, if I input e.g. 08475398 as an ID, what would be the faster way to iterate over dri...
<p>I believe your goal is as follows.</p> <ul> <li><p>You have 4 shared drives.</p> </li> <li><p>You have the files of the filenames like <code>00000001.xml, 00000002.xml,,,</code>. <code>00000001</code> and <code>00000002</code> are the IDs.</p> </li> <li><p>You want to search the files using the ID.</p> <blockquote> ...
JavaScript - Iterate over shared drives to get file by input string (Google Apps Script)
javascript|google-apps-script
-1
59
1
72,347,801
72,347,801
1
true
2022-05-23T10:17:08.833Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JavaScript - Iterate over shared drives to get file by input string (Google Apps Script)<p>I have 4 shared drives with unique files named 00000001.xml, 00000...
72,280,177
Average over time series data with custom time slice window<p>I am working with some tennis ranking data in R, that gives the evolution of tennis rankings over time of all the players on the ATP tour.</p> <p>An example of the data I am using can be found here, giving the rankings data from 2000's: <a href="https://gith...
<p>Your data are reasonably large, and data.table can help quite a bit with speed. Here is an approach that is very fast, and it uses a flexible function <code>f(s,e,p,u)</code>, which allows you to pass in any start (<code>s</code>) or end (<code>e</code>) date, an integer period (e.g. 2 for 2 years), and time unit (<...
Average over time series data with custom time slice window
r|dataframe|object-slicing
1
59
3
72,281,103
72,281,103
1
true
2022-05-17T20:18:09.280Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Average over time series data with custom time slice window<p>I am working with some tennis ranking data in R, that gives the evolution of tennis rankings ov...
72,401,545
How can I populate the key value pairs of a new dictionary from an existing dictionary?<p>I have a dictionary like below. The first value (outside brackets) is the key. The first value in the braces is the value. <br> Next in the square brackets are the metadata about the values. <br><br>So for the key <code>185589766<...
<p>Try this out:</p> <pre><code>new_dict = {} for key in some_dict: new_dict[key] = {} for subkey in some_dict[key]: prop_prob = # Your calculation here new_entry = [((some_dict[key][subkey][i])[0], prop_prob) for i in range(len(some_dict[key][subkey]))] new_dict[key][...
How can I populate the key value pairs of a new dictionary from an existing dictionary?
python|dictionary
2
59
1
72,401,782
72,401,782
1
true
2022-05-27T06:53:48.880Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I populate the key value pairs of a new dictionary from an existing dictionary?<p>I have a dictionary like below. The first value (outside brackets) ...
72,355,896
How to tell if one goroutine succeeded or all goroutines are done?<p>I am trying to use DFS to check a graph for cycles by checking each node in the graph for a cycle.</p> <p>I would like to run a goroutine for each node and terminate when the first cycle is detected or when there are no cycles.</p> <p>Terminating when...
<p>You are correct in that <code>WaitGroup</code> is probably what you want. However, you're not using it correctly. First, you need to call <code>wg.Add(1)</code> outside of the go routine that is calling <code>wg.Done()</code>. Second, calling <code>wg.Wait()</code> blocks until all the go routines in the wait group ...
How to tell if one goroutine succeeded or all goroutines are done?
go|depth-first-search|goroutine
1
59
1
72,355,929
72,355,929
1
true
2022-05-23T23:55:21.730Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to tell if one goroutine succeeded or all goroutines are done?<p>I am trying to use DFS to check a graph for cycles by checking each node in the graph fo...
72,275,561
Highcharts JS remove tips & squared legends for linear chart<p>TL;DR - want my highcharts chart to look the same as Shopify's</p> <p>I'm trying to achieve two things that I have found no answer for in the docs, literally tried everything</p> <ol> <li>I want to remove the gridlines tips that are being rendered for each ...
<p>I'm not 100% satisfied with my solution, but I honestly found no other approach.</p> <p>1.) Try the property tickInterval. With that you should be able to reduce the space between the axis ticks. (Example also in the jsfiddle). <a href="https://api.highcharts.com/highcharts/yAxis.tickPixelInterval" rel="nofollow nor...
Highcharts JS remove tips & squared legends for linear chart
javascript|highcharts|shopify
1
59
1
72,278,886
72,278,886
1
true
2022-05-17T14:10:01.663Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Highcharts JS remove tips & squared legends for linear chart<p>TL;DR - want my highcharts chart to look the same as Shopify's</p> <p>I'm trying to achieve tw...
72,304,242
Constructing DataFrame from Dict with numeric keys in Julia<p>I would like to construct a <code>DataFrames.jl</code> data frame from a Julia <code>Dict</code> with integer numeric columns. I feel like this should be as simple as:</p> <pre><code>using DataFrames mydict = Dict(1 =&gt; 1, 2 =&gt; 2) mydf = DataFrame(mydi...
<p>Here are two examples how to do it:</p> <pre><code>julia&gt; DataFrame(Symbol.(keys(mydict)) .=&gt; values(mydict)) 1×2 DataFrame Row │ 2 1 │ Int64 Int64 ─────┼────────────── 1 │ 2 1 julia&gt; DataFrame(Symbol(k) =&gt; v for (k, v) in pairs(mydict)) 2×2 DataFrame Row │ first second │...
Constructing DataFrame from Dict with numeric keys in Julia
julia|dataframes.jl
2
59
1
72,305,919
72,305,919
1
true
2022-05-19T12:05:55.323Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Constructing DataFrame from Dict with numeric keys in Julia<p>I would like to construct a <code>DataFrames.jl</code> data frame from a Julia <code>Dict</code...
72,339,783
How to do if something happened make number - 1<p>I am trying to do when i destroy all boxes something happen. My code is;</p> <pre><code>using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class destroy : MonoBehaviour { private string BALL_TAG = ...
<p>I don't understand your code completely. So, I need to make some assumptions. I think the Script is attached to the box and every box has this Script. I also think, that your player Shoots Ball. Those Balls have a collider with an ball tag.</p> <p>There are multiple problems with your code.</p> <p>The first one is,...
How to do if something happened make number - 1
c#|visual-studio|unity3d|if-statement|c#-2.0
-1
59
1
72,340,828
72,340,828
1
true
2022-05-22T17:19:22.220Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to do if something happened make number - 1<p>I am trying to do when i destroy all boxes something happen. My code is;</p> <pre><code>using System.Collec...
72,324,200
Check if Swift program is outputting to terminal<p><strong>How can I check from my Swift script whether or not I am outputting to a terminal?</strong></p> <p>In a bash or zsh script, for example, this can be accomplished with the <code>-t 1</code> conditional expression to check if file descriptor 1 (stdout) is open an...
<p>The <a href="https://pubs.opengroup.org/onlinepubs/009695299/functions/isatty.html" rel="nofollow noreferrer"><code>isatty</code></a> function returns <code>1</code> if the given file descriptor is associated with a terminal. Like many C library functions, <code>isatty</code> can be called from Swift via the Darwin ...
Check if Swift program is outputting to terminal
swift|interactive-shell
2
59
1
72,324,498
72,324,498
1
true
2022-05-20T19:54:32.190Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Check if Swift program is outputting to terminal<p><strong>How can I check from my Swift script whether or not I am outputting to a terminal?</strong></p> <p...
72,249,557
adding smoothed curves to plot using loess()<p>I have for example monthly data from this package:</p> <pre><code>install.packages(&quot;fma&quot;) library(fma) plot(boston) </code></pre> <p>Now I want to try and add to this plot two smoothed curves in different color by using local polynomial regression fitting. I th...
<p>A loess regression requires both x and y variables, but a <code>ts</code> object only has a y variable, with the time variable being implicit, so we need to extract the time variable as a numeric variable and regress on it.</p> <p>You can do this automatically using <code>geom_smooth</code> in <code>ggplot</code>, w...
adding smoothed curves to plot using loess()
r
0
59
1
72,249,668
72,249,668
1
true
2022-05-15T15:14:43.657Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: adding smoothed curves to plot using loess()<p>I have for example monthly data from this package:</p> <pre><code>install.packages(&quot;fma&quot;) library(fm...
72,358,805
How to copy/paste tables from Excel to a Word document<p>I want to copy/paste tables from an Excel sheet toward a .docx. I have a word #tableauxvdd which I want to replace by my tables.</p> <p>So I wrote this code</p> <pre><code> With word_fichier.Range With .Find .ClearFormatting ...
<p>Whenever you write code to automate Word you need to think through what steps you would take if you were performing the task in the UI.</p> <p>In a Word document, tables are always separated by a paragraph, so your code needs to do the same.</p> <p>For example:</p> <pre><code>If .Find.Found = True Then For i = 1...
How to copy/paste tables from Excel to a Word document
excel|vba|ms-word
1
59
1
72,361,138
72,361,138
1
true
2022-05-24T07:27:47.397Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to copy/paste tables from Excel to a Word document<p>I want to copy/paste tables from an Excel sheet toward a .docx. I have a word #tableauxvdd which I w...
72,249,074
Matching patterns in spaCy returns a empty result<p>I was hoping to find some patterns with this simple code. But the result is empty. I'm forgetting something?</p> <pre><code>for tk in doc[:30]: print (tk.text, ':', tk.pos_) </code></pre> <p>Método : NOUN de : ADP avaliaçãoSimulação : NOUN computacional : ADJ con...
<p>The following rule will match a token that equals &quot;ADP&quot; when made lowercase. This will not match anything because &quot;ADP&quot; is not lowercase.</p> <pre><code>{'LOWER': 'ADP'}, </code></pre> <p>I am not sure what this is supposed to match, maybe you want to match a lowercase word with POS = ADP? In tha...
Matching patterns in spaCy returns a empty result
python-3.x|spacy|pos-tagger
2
59
1
72,253,835
72,253,835
1
true
2022-05-15T14:16:49.893Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Matching patterns in spaCy returns a empty result<p>I was hoping to find some patterns with this simple code. But the result is empty. I'm forgetting somethi...
72,312,837
Finding first iteration of a string in a datatable in R<p>I am pretty new to R so I was trying to figure out how can I do this better. I have a data table that consist of two columns, (Day and Sleepstatus). How can I find the first iteration of Sleeping and Awake based on the column day and mutate another column to ind...
<p>This is one potential solution:</p> <pre class="lang-r prettyprint-override"><code>library(data.table) dt &lt;- data.table::data.table( Day = c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L), SleepStatus = c(&quot;Sleeping&quot;,&quot;Sleeping&quot;,&quot;Sleeping&quot;, &quot;Awake&quot;,&quot;Sleep...
Finding first iteration of a string in a datatable in R
r|datatable
2
59
2
72,313,269
72,313,269
1
true
2022-05-20T02:07:32.943Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Finding first iteration of a string in a datatable in R<p>I am pretty new to R so I was trying to figure out how can I do this better. I have a data table th...
72,359,167
ORACLE TO_CHAR SPECIFY OUTPUT DATA TYPE<p>I have column with data such as '123456789012' I want to divide each of each 3 chars from the data with a '/' in between so that the output will be like: &quot;123/456/789/012&quot;</p> <p>I tried &quot;SELECT TO_CHAR(DATA, '999/999/999/999') FROM TABLE 1&quot; but it does not ...
<p>Here is one option with varchar2 datatype:</p> <pre><code>with test as ( select '123456789012' a from dual ) select listagg(substr(a,(level-1)*3+1,3),'/') within group (order by rownum) num from test connect by level &lt;=length(a) </code></pre> <p>or</p> <pre><code>with test as ( ...
ORACLE TO_CHAR SPECIFY OUTPUT DATA TYPE
sql|oracle|sqldatatypes|to-char
0
59
2
72,362,321
72,362,321
1
true
2022-05-24T07:55:24.337Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ORACLE TO_CHAR SPECIFY OUTPUT DATA TYPE<p>I have column with data such as '123456789012' I want to divide each of each 3 chars from the data with a '/' in be...
72,377,950
The empty spaces are ignored by the "InnerText" property<p>I want that when i press on any keyboard key the string which is stored in the &quot;array&quot; variable (as an array) be written in the &quot;p&quot; element but the problem is that when I put an empty space in the &quot;string&quot; variable(by tab key or sp...
<p>Rather than reading from element.innerText, store the &quot;text so far&quot; in another string variable, and set the innerText to the value of that variable.</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 la...
The empty spaces are ignored by the "InnerText" property
javascript|html|jquery|css
-1
59
1
72,378,100
72,378,100
1
true
2022-05-25T12:47:30.813Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: The empty spaces are ignored by the "InnerText" property<p>I want that when i press on any keyboard key the string which is stored in the &quot;array&quot; v...
72,395,237
numpy array not changing value on assignment<p>I have the following python program:</p> <pre class="lang-py prettyprint-override"><code>import numpy as np x = np.array([[1,2],[3,5],[4,6]]) some_list = [1,2] x[some_list][:,1]=100 </code></pre> <p>The numpy array &quot;x&quot; still remains unchanged after the above exec...
<p>You need to combine the different pairs of <code>[]</code>:</p> <pre class="lang-py prettyprint-override"><code>x[some_list, 1] = 100 </code></pre> <p>Output:</p> <pre><code>&gt;&gt;&gt; x array([[ 1, 2], [ 3, 100], [ 4, 100]]) </code></pre>
numpy array not changing value on assignment
python|numpy|slice
0
59
1
72,395,280
72,395,280
1
true
2022-05-26T16:43:10.727Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: numpy array not changing value on assignment<p>I have the following python program:</p> <pre class="lang-py prettyprint-override"><code>import numpy as np x ...
72,289,410
Adding "sequential" information to python list using dictionaries<h2>The problem</h2> <p>I would like to create a dictionary of dicts out of a flat list I have in order to add a &quot;sequentiality&quot; piece of information, but I am having some trouble finding a solution.</p> <p>The list is something like</p> <pre><c...
<p>One way would be:</p> <pre><code>a = ['Q=123', 'W=456', 'E=789', 'Q=753', 'W=159', 'E=888'] indices = [i for i, v in enumerate(a) if v[0:2] == 'Q='] dictionary = {f'Step_{idx+1}': {k: v for k, v in (el.split('=') for el in a[s:e])} for idx, (s, e) in enumerate(zip(indices, indices[1:] + [len(a)]))} ...
Adding "sequential" information to python list using dictionaries
python|list|dictionary
3
59
4
72,289,579
72,289,579
1
true
2022-05-18T12:42:09.857Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Adding "sequential" information to python list using dictionaries<h2>The problem</h2> <p>I would like to create a dictionary of dicts out of a flat list I ha...
72,370,807
How to set a black background color to an alert?<p>I am currently developing an iOS application. I have customized my alerts to match the colors of my app. Here is the code:</p> <pre><code>func createPopUp(title: String, message: String, preferredStyle: UIAlertController.Style) -&gt; UIAlertController { let alert =...
<p>Hello fiend please replace <code>alertContentView.backgroundColor = UIColor.black</code> with <code>alert.view.subviews.first?.subviews.first?.subviews.first?.backgroundColor = .black</code></p> <p>It will solve your problem.</p>
How to set a black background color to an alert?
ios|swift|xcode|user-interface
0
59
1
72,372,945
72,372,945
1
true
2022-05-25T00:28:16.373Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to set a black background color to an alert?<p>I am currently developing an iOS application. I have customized my alerts to match the colors of my app. H...
72,242,934
Add Multiple prefixes in order in Excel<p>I don't know a lot in Excel but I want to add Multiple prefixes in Excel and let them loop until the number of cells ends.</p> <p>I used this Formula, but it picks them randomly:</p> <pre><code>(=CHOOSE(RANDBETWEEN(1, 3),&quot;DR. &quot;,&quot;SM. &quot;,&quot;FG. &quot;)&amp;&...
<p>You may <em><strong>try</strong></em> this, using <code>CHOOSE()</code> &amp; <code>MOD()</code></p> <p><a href="https://i.stack.imgur.com/Czuhw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Czuhw.png" alt="FORMULA_SOLUTION" /></a></p> <p>• Formula used in cell <code>B1</code></p> <pre><code>=CH...
Add Multiple prefixes in order in Excel
excel|excel-formula|prefix
0
59
1
72,243,031
72,243,031
1
true
2022-05-14T18:27:40.877Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add Multiple prefixes in order in Excel<p>I don't know a lot in Excel but I want to add Multiple prefixes in Excel and let them loop until the number of cell...
72,352,692
Gatsbyjs - Define Location of Static Pages as Something Other than the 'pages' folder<p>As the title states, I'm unsure if it is possible to customize the folder Gatsby looks into to generate static pages. Apparently, this seems to be fixed without the ability to change from the <code>pages/</code> folder. Ideally, thi...
<p>You can use the <a href="https://www.gatsbyjs.com/plugins/gatsby-plugin-page-creator/" rel="nofollow noreferrer"><code>gatsby-plugin-page-creator</code></a> (official plugin from Gatsby staff) to customize the source of the <code>/pages</code> folder. Simply use it as:</p> <pre><code>{ resolve: `gatsby-plugin-page...
Gatsbyjs - Define Location of Static Pages as Something Other than the 'pages' folder
javascript|reactjs|gatsby
1
59
1
72,353,026
72,353,026
1
true
2022-05-23T17:37:00.580Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Gatsbyjs - Define Location of Static Pages as Something Other than the 'pages' folder<p>As the title states, I'm unsure if it is possible to customize the fo...