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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
37,978,528 | Typescript Type 'string' is not assignable to type<p>Here's what I have in fruit.ts</p>
<pre><code>export type Fruit = "Orange" | "Apple" | "Banana"
</code></pre>
<p>Now I'm importing fruit.ts in another typescript file. Here's what I have</p>
<pre><code>myString:string = "Banana";
myFruit:Fruit = myString;
</code>... | <h3>Update</h3>
<p>As mentioned in @Simon_Weaver's answer, since TypeScript version 3.4 it's possible to assert it to <code>const</code>:</p>
<pre><code>let fruit = "Banana" as const;
</code></pre>
<h3>Old answer</h3>
<p>You'll need to <a href="http://www.typescriptlang.org/docs/handbook/basic-types.html#type... | Typescript Type 'string' is not assignable to type | javascript|typescript | 377 | 558,593 | 12 | 37,978,675 | 37,978,675 | 530 | true | 2016-06-22T21:25:26.580Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Typescript Type 'string' is not assignable to type<p>Here's what I have in fruit.ts</p>
<pre><code>export type Fruit = "Orange" | "Apple" | "Banana"
</code>... |
37,889,187 | what is support command in git flow<p>I know what are bugfix, hotfix and feature branches.<br>
But the thing that I can't grasp is support command as <code>git flow support start <version> <branch></code> </p>
<p>could someone explain this command with a simple scenario?</p> | <p>Here's the quoted definition from <a href="https://gitversion.net/docs/git-branching-strategies/gitflow-examples" rel="noreferrer">https://gitversion.net/docs/git-branching-strategies/gitflow-examples</a></p>
<blockquote>
<p>Support branches are not really covered in GitFlow, but are essential if you need to maintai... | what is support command in git flow | git|git-flow | 18 | 9,255 | 1 | 37,889,317 | 37,889,317 | 22 | true | 2016-06-17T19:38:21.440Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
what is support command in git flow<p>I know what are bugfix, hotfix and feature branches.<br>
But the thing that I can't grasp is support command as <code>g... |
38,055,632 | Left-align a pandas rolling object<p>Using pandas 0.18.1, I'd like to take the rolling average of a one-column dataframe. Since version 0.18.0, this is done with rolling() objects. The default for these rolling objects is to be right-justified. There is a boolean argument you can pass, center=True, to align the rolling... | <p>I think you can use <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.shift.html" rel="noreferrer"><code>shift</code></a>:</p>
<pre><code>a = df.rolling(window=3).mean().shift(-2)
print (a)
A
0 3.666667
1 5.666667
2 11.333333
3 18.333333
4 NaN
5 NaN
</code><... | Left-align a pandas rolling object | python|pandas | 28 | 11,819 | 2 | 38,056,328 | 38,056,328 | 33 | true | 2016-06-27T13:46:10.890Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Left-align a pandas rolling object<p>Using pandas 0.18.1, I'd like to take the rolling average of a one-column dataframe. Since version 0.18.0, this is done ... |
38,011,702 | How to clone multiple children with React.cloneElement?<p>I try to clone React elements like this, to pass the parent props to them (the props are not assigned in this example):</p>
<pre><code>React.createElement('div',
{
style: this.props.style
},
React.cloneElement(this.props.children, null)
)
</... | <p><code>children</code> props is an opaque structure, it can be <code>undefined</code>, an array, or a single react element. You should use the <a href="https://facebook.github.io/react/docs/top-level-api.html#react.children" rel="noreferrer"><code>React.Children</code> utilities</a> to map over the <code>children</co... | How to clone multiple children with React.cloneElement? | javascript|reactjs | 15 | 25,132 | 1 | 38,011,851 | 38,011,851 | 42 | true | 2016-06-24T10:54:02.440Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to clone multiple children with React.cloneElement?<p>I try to clone React elements like this, to pass the parent props to them (the props are not assign... |
37,904,739 | Html.fromHtml deprecated in Android N<p>I am using <code>Html.fromHtml</code> to view html in a <code>TextView</code>.</p>
<pre><code>Spanned result = Html.fromHtml(mNews.getTitle());
...
...
mNewsTitle.setText(result);
</code></pre>
<p>But <code>Html.fromHtml</code> is now deprecated in Android N+</p>
<p>What/How d... | <p><strong>update</strong>:
as <a href="https://stackoverflow.com/questions/37904739/html-fromhtml-deprecated-in-android-n/37905107#52130841">@Andy mentioned below</a> Google has created <code>HtmlCompat</code> which can be used instead of the method below. Add this dependency <code>implementation 'androidx.core:core:... | Html.fromHtml deprecated in Android N | android|deprecated|android-7.0-nougat | 384 | 199,426 | 15 | 37,905,107 | 37,905,107 | 771 | true | 2016-06-19T07:00:12.687Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Html.fromHtml deprecated in Android N<p>I am using <code>Html.fromHtml</code> to view html in a <code>TextView</code>.</p>
<pre><code>Spanned result = Html.... |
37,886,919 | Streaming data to a specific BigQuery Time Partition<p>I would like to know if there is any way to stream data to a specific time partition of a BigQuery table. The documentation says that you must use table decorators:</p>
<blockquote>
<p><strong>Loading data using partition decorators</strong></p>
<p>Partitio... | <p>Sorry for the inconvenience. We are considering providing support for this in the near future. Please stay tuned for more updates.</p>
<p>Possible workarounds that might work in many cases:</p>
<ol>
<li><p>If you have most of the data available(which is sometimes the case when restating data for an old partition),... | Streaming data to a specific BigQuery Time Partition | google-bigquery | 9 | 2,366 | 2 | 37,892,316 | 37,892,316 | 5 | true | 2016-06-17T17:10:38.487Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Streaming data to a specific BigQuery Time Partition<p>I would like to know if there is any way to stream data to a specific time partition of a BigQuery tab... |
38,036,528 | How does Apache spark handle python multithread issues?<p>According to <a href="https://stackoverflow.com/a/19614263">python's GIL</a> we cannot use threading in CPU bound processes so my question is how does Apache Spark utilize python in multi-core environment? </p> | <p>Multi-threading python issues are separated from Apache Spark internals. Parallelism on Spark is dealt with inside the JVM. </p>
<p><a href="https://i.stack.imgur.com/VvEvd.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/VvEvd.jpg" alt="enter image description here"></a></p>
<p>And the reason is that in ... | How does Apache spark handle python multithread issues? | python|multithreading|apache-spark | 14 | 3,363 | 1 | 38,038,346 | 38,038,346 | 11 | true | 2016-06-26T08:17:22.933Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How does Apache spark handle python multithread issues?<p>According to <a href="https://stackoverflow.com/a/19614263">python's GIL</a> we cannot use threadin... |
37,818,401 | Importing html files with es6 template string loader<p>I want to import my templates into my js with <a href="https://www.npmjs.com/package/es6-template-string-loader" rel="noreferrer">es6 template string loader</a>. The only difference in my case is that I don't want to include css, only html. My code is as follows:</... | <p>I recently needed to do the same thing, and this is how I did it.</p>
<p><strong>1.</strong> I used the npm module <a href="https://www.npmjs.com/package/html-loader" rel="noreferrer"><code>html-loader</code></a>, instead of <code>es6-template-string-loader</code></p>
<p><strong>2.</strong> Add to <code>webpack.co... | Importing html files with es6 template string loader | javascript|webpack | 35 | 53,038 | 6 | 38,356,193 | 38,356,193 | 39 | true | 2016-06-14T17:20:11.757Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Importing html files with es6 template string loader<p>I want to import my templates into my js with <a href="https://www.npmjs.com/package/es6-template-stri... |
37,911,321 | Why does prediction needs batch size in Keras?<p>In Keras, to predict class of a datatest, the <code>predict_classes()</code> is used.</p>
<p>For example:</p>
<pre><code>classes = model.predict_classes(X_test, batch_size=32)
</code></pre>
<p>My question is, I know the usage of <code>batch_size</code> in training, bu... | <p>Keras can predict multiple values at the same time, like if you input a vector of 100 elements, Keras can compute one prediction for each element, giving 100 outputs. This computation can also be done in batches, defined by the batch_size.</p>
<p>This is just in case you cannot fit all the data in the CPU/GPU RAM a... | Why does prediction needs batch size in Keras? | neural-network|classification|keras | 53 | 31,774 | 2 | 37,912,576 | 37,912,576 | 45 | true | 2016-06-19T20:04:24.617Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does prediction needs batch size in Keras?<p>In Keras, to predict class of a datatest, the <code>predict_classes()</code> is used.</p>
<p>For example:</... |
37,977,428 | How to use new NavigationStart @angular-router 3.0.0-alpha.*<p>I see these new events in the new Angular 2 Router.</p>
<p>Theres NavigationStart, NavigationEnd, NavigationFailed (or something like that)</p>
<p>Does anyone know how to use these yet? I've messed around with a few things but haven't been able to get the... | <p>The <code>Router</code> provides an <code>events</code> observable that can be subscribed to</p>
<pre><code>constructor(router:Router) {
router.events.subscribe(event => {
if(event instanceof NavigationStart) {
}
// NavigationEnd
// NavigationCancel
// NavigationError
// RoutesRecognize... | How to use new NavigationStart @angular-router 3.0.0-alpha.* | typescript|angular | 27 | 33,600 | 3 | 37,983,781 | 37,983,781 | 55 | true | 2016-06-22T20:14:22.797Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use new NavigationStart @angular-router 3.0.0-alpha.*<p>I see these new events in the new Angular 2 Router.</p>
<p>Theres NavigationStart, Navigation... |
37,853,903 | Can I send files via email using MailKit?<p>As the title, is MailKit supported to send file?<br/>
If yes, how can I do it?</p> | <p>Yes. This is explained in the documentation as well as the <a href="https://github.com/jstedfast/MailKit/blob/master/FAQ.md#CreateAttachments" rel="noreferrer">FAQ</a>.</p>
<p>From the FAQ:</p>
<h3>How do I create a message with attachments?</h3>
<p>To construct a message with attachments, the first thing you'll nee... | Can I send files via email using MailKit? | c#|email-attachments|mailkit|mimekit | 72 | 53,581 | 3 | 37,860,224 | 37,860,224 | 117 | true | 2016-06-16T08:32:32.633Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can I send files via email using MailKit?<p>As the title, is MailKit supported to send file?<br/>
If yes, how can I do it?</p> |
38,025,112 | How do I set collection view's cell size via the auto layout<p>Hi I'm trying to resize the cell via the <code>auto layout</code>.</p>
<p>I want display the cell by the 3 by 3.</p>
<p>First Cell's margin left=0</p>
<p>Last Cell's margin right=0</p>
<p>And all of the cell's space has 1pt. Like an <code>instagram</cod... | <p>I don't believe you can set the size by only using the Storyboard because you can't set constraints to recurring items like collection view cells that are created on the fly at runtime.</p>
<p>You can easily compute the size from the information you are given. In <code>collectionView(_:layout:sizeForItemAt:)</code>... | How do I set collection view's cell size via the auto layout | swift|uicollectionview|uicollectionviewcell|ios-autolayout | 19 | 51,274 | 5 | 38,028,456 | 38,028,456 | 29 | true | 2016-06-25T04:56:40.727Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I set collection view's cell size via the auto layout<p>Hi I'm trying to resize the cell via the <code>auto layout</code>.</p>
<p>I want display the ... |
38,019,140 | React and blur event<p>I have a simple issue with React and event handling. My component looks like this (basically a table):</p>
<pre class="lang-jsx prettyprint-override"><code>const MyList = ({ items, onBlur }) =>
<table onBlur={onBlur}}>
<thead>
<tr>
<th>ID</th>
... | <p>The problem is that a table doesn't actually have a concept of focus since it's not an input itself.</p>
<p>When the onBlur fires on the contained inputs we will check the <code>relatedTarget</code> of the <code>onBlur</code> event which should be set to the element that has RECEIVED focus (or <code>null</code>). W... | React and blur event | javascript|html|reactjs|dom-events | 36 | 64,794 | 5 | 38,019,906 | 38,019,906 | 37 | true | 2016-06-24T17:35:29.980Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React and blur event<p>I have a simple issue with React and event handling. My component looks like this (basically a table):</p>
<pre class="lang-jsx prett... |
37,828,996 | How to fix Xcode "DTAssetProviderService could not start.." error?<p>I have upgraded macOS Sierra Developer Preview, but my <strong>Xcode 7.3.1</strong> gives below error while try to run my project on simulator. In addition Generic to archieve gives another error like:</p>
<blockquote>
<p>In addition for archive: a... | <p>If you want the slow solution, you can reinstall Xcode 7.3.1 by downloading it from <a href="https://developer.apple.com/download/more/" rel="nofollow noreferrer">https://developer.apple.com/download/more/</a>.</p>
<p>It worked for me and now my Simulator is able to start again without getting the error.</p>
<p>Th... | How to fix Xcode "DTAssetProviderService could not start.." error? | ios|xcode|ios-simulator | 14 | 4,662 | 5 | 37,863,689 | 37,863,689 | 11 | true | 2016-06-15T07:38:09.573Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to fix Xcode "DTAssetProviderService could not start.." error?<p>I have upgraded macOS Sierra Developer Preview, but my <strong>Xcode 7.3.1</strong> give... |
38,044,451 | Entity Framework Core Eager Loading Then Include on a collection<p>I have three Models that I want to include when performing a query. </p>
<p>Here is the scenario. </p>
<pre class="lang-cs prettyprint-override"><code>public class Sale
{
public int Id { get; set; }
public List<SaleNote> SaleNotes { ge... | <p>It doesn't matter that <code>SaleNotes</code> is collection navigation property. It should work the same for references and collections:</p>
<pre><code>_dbContext.Sale.Include(s => s.SaleNotes).ThenInclude(sn=>sn.User);
</code></pre>
<p>But as far I know, EF7 also supports the old multi-level Include syntax ... | Entity Framework Core Eager Loading Then Include on a collection | c#|entity-framework|entity-framework-core | 43 | 32,066 | 2 | 38,044,626 | 38,044,626 | 59 | true | 2016-06-27T00:37:30.977Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Entity Framework Core Eager Loading Then Include on a collection<p>I have three Models that I want to include when performing a query. </p>
<p>Here is the s... |
37,961,942 | Updating complication with Swift 3 and background task<p>For watchOS 3, Apple suggests updating the complication with <code>WKRefreshBackgroundTask</code> instead of using <code>getNextRequestedUpdateDate</code>.</p>
<p>How can I determine the time between two updates using the new approach?</p>
<p>I would only hack ... | <p>I generally covered this <a href="https://stackoverflow.com/a/37867082/4151918">in a different answer</a>, but I'll address your specific question here.</p>
<p>You're right that you shouldn't hack the complication controller to do any (asynchronous) fetching. The data source should <em>only</em> be responsible for ... | Updating complication with Swift 3 and background task | swift|swift3|apple-watch-complication|watchos-3|wkrefreshbackgroundtask | 9 | 4,097 | 1 | 37,972,842 | 37,972,842 | 10 | true | 2016-06-22T07:59:31.267Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Updating complication with Swift 3 and background task<p>For watchOS 3, Apple suggests updating the complication with <code>WKRefreshBackgroundTask</code> in... |
37,895,379 | How to get/set/remove element attribute in Angular 2 using "the angular way"?<p>I've been reading some articles about Angular 2 pitfalls and what to avoid, one of those things revolves around not accessing the DOM directly. </p>
<p>I noticed that the <code>Renderer</code> is quite useful since it contains some methods... | <p>Angular2 doesn't provide any support to get anything from the DOM except <code>ElementRef</code> and events.<br>
The Angular2 way is to maintain the state in the model and update the DOM to reflect that state.</p>
<p>If you need to read from the DOM you can use direct DOM access or provide a custom <code>Renderer</... | How to get/set/remove element attribute in Angular 2 using "the angular way"? | angular | 14 | 41,787 | 7 | 38,037,240 | 38,037,240 | 10 | true | 2016-06-18T09:24:37.960Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get/set/remove element attribute in Angular 2 using "the angular way"?<p>I've been reading some articles about Angular 2 pitfalls and what to avoid, o... |
37,965,647 | @HostBinding and @HostListener: what do they do and what are they for?<p>In my meanderings around the world wide interweb, and now especially the <a href="https://angular.io/guide/styleguide" rel="noreferrer">angular.io style docs</a>, I find many references to <code>@HostBinding</code> and <code>@HostListener</code>. ... | <p>Have you checked these official docs?</p>
<p><a href="https://angular.io/docs/ts/latest/api/core/index/HostListener-interface.html" rel="nofollow noreferrer">HostListener</a> - Declares a host listener. Angular will invoke the decorated method when the host element emits the specified event.</p>
<p><strong><code>@Ho... | @HostBinding and @HostListener: what do they do and what are they for? | angular|angular-services | 242 | 225,800 | 9 | 37,973,376 | 37,973,376 | 173 | true | 2016-06-22T10:41:51.673Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
@HostBinding and @HostListener: what do they do and what are they for?<p>In my meanderings around the world wide interweb, and now especially the <a href="ht... |
37,850,134 | What is the certificate enrollment process?<p>I am looking for a procedure of enrolling a certificate.</p>
<p>I have searched a lot but didn't find a good answer. Till now I get that firstly I have to generate a Key store (For creating a public key and a private key) then private key should be kept private and public k... | <p>The general procedure to issue certificates in a Public Key Infrastructure is more or less the following:</p>
<ol>
<li><p>the client generates a key pair, private and public</p>
</li>
<li><p>the client generates a CSR (Certificate Signing Request) including attributes like Common Name and the Public Key. Signs it wi... | What is the certificate enrollment process? | java|android|certificate|pkcs#12|csr | 8 | 10,263 | 2 | 37,898,553 | 37,898,553 | 22 | true | 2016-06-16T04:53:01.797Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the certificate enrollment process?<p>I am looking for a procedure of enrolling a certificate.</p>
<p>I have searched a lot but didn't find a good an... |
38,034,966 | How is TabItem used when placed in the layout XML?<p>The <a href="https://developer.android.com/reference/android/support/design/widget/TabLayout.html" rel="noreferrer"><code>TabLayout</code> documentation</a> gives an example of nesting <code>TabItem</code> directly inside <code>TabLayout</code> like so:</p>
<pre><co... | <p>This appears to be a relatively recent addition to the design library, apparently added in version 23.2.0, though it's not mentioned in <a href="https://developer.android.com/topic/libraries/support-library/revisions.html" rel="noreferrer">the revision history</a>. It's functionality is pretty basic, and the only at... | How is TabItem used when placed in the layout XML? | android|android-layout|android-tabs|android-tablayout | 35 | 37,917 | 3 | 38,035,415 | 38,035,415 | 41 | true | 2016-06-26T03:29:37.550Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How is TabItem used when placed in the layout XML?<p>The <a href="https://developer.android.com/reference/android/support/design/widget/TabLayout.html" rel="... |
37,910,008 | Check if value exists in firebase DB<p>Is there a method in firebase, which can check if value exist in DB? Firebase has method <a href="https://firebase.google.com/docs/reference/js/firebase.database.DataSnapshot#exists" rel="noreferrer">.exists()</a>, but according to docs it checks only the keys.</p>
<p>I have the ... | <p>The <code>exists()</code> method is part of the <code>snapshot</code> object which is returned by firebase queries. So <strong>keep in mind that you won't be able to avoid retrieving the data to verify if it exists or not</strong>.</p>
<pre><code>ref.child("users").orderByChild("ID").equalTo(&quo... | Check if value exists in firebase DB | javascript|firebase|firebase-realtime-database | 59 | 91,725 | 4 | 37,910,159 | 37,910,159 | 89 | true | 2016-06-19T17:38:03.487Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Check if value exists in firebase DB<p>Is there a method in firebase, which can check if value exist in DB? Firebase has method <a href="https://firebase.goo... |
37,979,489 | How to watch and reload ts-node when TypeScript files change<p>I'm trying to run a dev server with TypeScript and an Angular application without transpiling ts files every time.</p>
<p>What I found is that I <em>can</em> run <code>.ts</code> files with <code>ts-node</code> but I want also to watch <code>.ts</code> file... | <p>You can now simply <code>npm install --save-dev ts-node nodemon</code> and then run <code>nodemon</code> with a <code>.ts</code> file and it will Just Work:</p>
<pre><code>nodemon app.ts
</code></pre>
<hr />
<p>Previous versions:</p>
<p>I was struggling with the same thing for my development environment until I noti... | How to watch and reload ts-node when TypeScript files change | typescript|development-environment|nodemon | 387 | 310,579 | 18 | 37,979,548 | 37,979,548 | 815 | true | 2016-06-22T22:50:36.530Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to watch and reload ts-node when TypeScript files change<p>I'm trying to run a dev server with TypeScript and an Angular application without transpiling ... |
38,037,760 | How to set <iframe src="..."> without causing `unsafe value` exception?<p>I am working on a tutorial involving the setting of an <code>iframe</code> <code>src</code> attribute: </p>
<pre><code><iframe width="100%" height="300" src="{{video.url}}"></iframe>
</code></pre>
<p>This throws an exception:</p>
<... | <p><strong>Update v8</strong></p>
<p>Below answers work but <a href="https://netbasal.com/angular-2-security-the-domsanitizer-service-2202c83bd90" rel="noreferrer">exposes your application to XSS security risks!</a>.
Instead of using <code>this.domSanitizer.bypassSecurityTrustResourceUrl(url)</code>, it is recommended ... | How to set <iframe src="..."> without causing `unsafe value` exception? | angular | 201 | 270,659 | 9 | 38,037,914 | 38,037,914 | 424 | true | 2016-06-26T10:54:09.057Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to set <iframe src="..."> without causing `unsafe value` exception?<p>I am working on a tutorial involving the setting of an <code>iframe</code> <code>sr... |
38,031,137 | How to program a delay in Swift 3<p>In earlier versions of Swift, one could create a delay with the following code:</p>
<pre><code>let time = dispatch_time(dispatch_time_t(DISPATCH_TIME_NOW), 4 * Int64(NSEC_PER_SEC))
dispatch_after(time, dispatch_get_main_queue()) {
//put your code which should be executed with a ... | <p>After a lot of research, I finally figured this one out.</p>
<pre><code>DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) { // Change `2.0` to the desired number of seconds.
// Code you want to be delayed
}
</code></pre>
<p>This creates the desired "wait" effect in Swift 3 and Swift 4.</p>
<p>Inspired by a... | How to program a delay in Swift 3 | ios|swift|xcode|swift3|dispatch-after | 397 | 342,322 | 7 | 38,031,138 | 38,031,138 | 1,138 | true | 2016-06-25T17:30:44.493Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to program a delay in Swift 3<p>In earlier versions of Swift, one could create a delay with the following code:</p>
<pre><code>let time = dispatch_time(... |
72,185,687 | How do I save file urls on javascript?<p>I'm creating a webapp on which I load and display images.</p>
<p>I want to have a feature on which the user can save the images they loaded so they can reload them on future sessions without having to manually set up everything again.</p>
<p>For doing this I have thought of stor... | <p>Found the answer!</p>
<p>I found out there is a way to do this on tauri with the dialog module you can find here: <a href="https://tauri.studio/api/js/modules/dialog" rel="nofollow noreferrer">https://tauri.studio/api/js/modules/dialog</a> more info here:<a href="https://github.com/tauri-apps/wry/issues/87" rel="nof... | How do I save file urls on javascript? | javascript|html|angular|tauri | -2 | 176 | 4 | 73,581,410 | 73,581,410 | 0 | true | 2022-05-10T11:41:37.500Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I save file urls on javascript?<p>I'm creating a webapp on which I load and display images.</p>
<p>I want to have a feature on which the user can save... |
53,531,125 | Asterisk Broadcasting<p>Goodmorning,</p>
<p>I need your help with something.
A quick question to learn more about Asterisk.</p>
<p>I love studying new things.</p>
<p>I would like to send a broadcasting message too let's say 100+ registered users with Asterisk from one user account. </p>
<p>Would this be possible w... | <p>To give an update on this topic, as Arheops says it is impossible.
It is possible!</p>
<p>I have made it work with the Asterisk AMI. </p>
<p>You call an extension and from the dialplan you kick a PHP script that executes an Asterisk AMI action. This way you can get all the currently active user in a conversation. ... | Asterisk Broadcasting | asterisk | -2 | 576 | 2 | 54,318,883 | 54,318,883 | 0 | true | 2018-11-29T02:48:39.497Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Asterisk Broadcasting<p>Goodmorning,</p>
<p>I need your help with something.
A quick question to learn more about Asterisk.</p>
<p>I love studying new thi... |
71,119,534 | wget convert a file depending on the ending during download<p>I am using windows latest wget. I would like to automatically convert a webm video file into a mp4 video file. I don't want to mess with VLC and without that I'm not sure where to start</p> | <blockquote>
<p>I would like to automatically convert a video file into a readable
video format for my raspberry pi (.webm to .mp4)</p>
</blockquote>
<p><code>wget</code> can not do that, from <a href="https://www.gnu.org/manual/blurbs.html" rel="nofollow noreferrer">GNU Package blurbs</a></p>
<blockquote>
<p>GNU Wget ... | wget convert a file depending on the ending during download | wget | -2 | 36 | 1 | 71,124,376 | 71,124,376 | 0 | true | 2022-02-14T23:40:45.427Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
wget convert a file depending on the ending during download<p>I am using windows latest wget. I would like to automatically convert a webm video file into a ... |
71,175,859 | API JSON output Format<p>I have this code</p>
<pre><code><?php
$id = $_POST['id'];
$nume = $_POST['nume'];
$rrp = $_POST['rrp'];
$pret = $_POST['pret'];
$stoc = $_POST['stoc'];
$url = $_POST['url'];
$url1 = $_POST['url1'];
$url2 = $_POST['url2'];
$url3 = $_POST['url3'];
$username = "xx@xx.eu";
$password =... | <p>If you've got a string in <code>$stoc</code> and you need to convert it to an integer before you encode it as JSON, then you can use <a href="https://www.php.net/manual/en/function.intval.php" rel="nofollow noreferrer">intval</a>.</p>
<pre><code>"value" => intval($stoc)
</code></pre>
<p>Demo: <a href="h... | API JSON output Format | php|arrays|json | -2 | 25 | 1 | 71,176,140 | 71,176,140 | 0 | true | 2022-02-18T15:21:33.837Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
API JSON output Format<p>I have this code</p>
<pre><code><?php
$id = $_POST['id'];
$nume = $_POST['nume'];
$rrp = $_POST['rrp'];
$pret = $_POST['pret'];
$... |
71,176,437 | How to split Python GET request by parameter into different bitcoin offers<p>I'd like to use the BISQ API to extract BTC buy offers, and list them separately in a new line. However, the return I'm getting has too many levels for me to extract using key-value pairs (although I'm very new to Python so am probably missing... | <p>Not sure <strong>exactly</strong> what you need but this should get you started:</p>
<pre><code>import requests
(r := requests.get('https://bisq.markets/api/offers?market=BTC_USD')).raise_for_status()
for buy in r.json()['btc_usd']['buys']:
print(f"Offer id {buy['offer_id']} -> Price {buy['price']}"... | How to split Python GET request by parameter into different bitcoin offers | python|python-requests|bitcoin | -2 | 37 | 2 | 71,176,742 | 71,176,742 | 0 | true | 2022-02-18T16:01:21.887Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to split Python GET request by parameter into different bitcoin offers<p>I'd like to use the BISQ API to extract BTC buy offers, and list them separately... |
71,200,522 | Oracle:ORA-00933: SQL command not properly ended<pre><code>SELECT CName AS Cuisine, COUNT(*) AS Total
FROM REST_CUISINE
GROUP BY CName
ORDER BY total DESC
LIMIT 3;
</code></pre> | <p>Oracle does not have <code>limit</code> clause.
use:</p>
<pre><code>SELECT
cname AS cuisine,
COUNT(*) AS total
FROM
rest_cuisine
GROUP BY
cname
ORDER BY
total DESC
FETCH NEXT 3 ROWS ONLY;
</code></pre> | Oracle:ORA-00933: SQL command not properly ended | sql|oracle | -2 | 28 | 1 | 71,200,624 | 71,200,624 | 0 | true | 2022-02-21T02:14:37.660Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Oracle:ORA-00933: SQL command not properly ended<pre><code>SELECT CName AS Cuisine, COUNT(*) AS Total
FROM REST_CUISINE
GROUP BY CName
ORDER BY total DESC
... |
71,201,821 | geom_boxplot, it won't let me plot my values, says they are not numeric<p>I am learning r, and I am practicing with the <code>rivers</code> built in dataset.</p>
<p>I want to make a boxplot of the river length <code>x</code>, but it is not working.</p>
<p>ex of data, full length is 141</p>
<pre><code>x
735
320
325
392
... | <p>The "x" in this data for river length is a numeric vector. You should turn it into a data frame first with <code>data.frame()</code> Also you can change the column name from "x" to avoid any issues with the <code>ggplot</code> mapping.</p>
<pre><code>library(tidyverse)
river <- data.frame(rive... | geom_boxplot, it won't let me plot my values, says they are not numeric | r | -2 | 33 | 1 | 71,201,877 | 71,201,877 | 0 | true | 2022-02-21T06:01:44.530Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
geom_boxplot, it won't let me plot my values, says they are not numeric<p>I am learning r, and I am practicing with the <code>rivers</code> built in dataset.... |
71,220,872 | What will happen with existing ec2 machine<p>I have few ec2 machines running created from aws console manually. They are not under terrafrom.
If i want to use terrafrom now to create new VPC and ec2 machine does it will delete my old machines ?</p> | <p>No, Terraform will not delete old machines in aws (created by aws console). That is because whenever you run terraform script to create something, it will create state file which acts as reference copy for terraform. In your case if you create any resources (like ec2 VMs) in AWS, you will end up having both machines... | What will happen with existing ec2 machine | terraform | -2 | 21 | 1 | 71,222,187 | 71,222,187 | 0 | true | 2022-02-22T11:56:54.983Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What will happen with existing ec2 machine<p>I have few ec2 machines running created from aws console manually. They are not under terrafrom.
If i want to us... |
71,233,559 | i have a problem with null-checking in dart - flutter app<p><strong>the problem is that I have two cars when I fetch the data with getting request the existing cars that work give me the information that I need but when I access the car that has null information the flutter gives me an error this is my code</strong></... | <pre><code>factory Vehicle.fromJson(Map<String, dynamic> json) => Vehicle(
id: json["id"],
name: json["name"],
status: json["status"],
position: json["position"] == null
? new Position(
fixTime: '',
... | i have a problem with null-checking in dart - flutter app | json|flutter|dart | -2 | 25 | 1 | 71,234,084 | 71,234,084 | 0 | true | 2022-02-23T08:30:28.183Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
i have a problem with null-checking in dart - flutter app<p><strong>the problem is that I have two cars when I fetch the data with getting request the existi... |
71,256,399 | How to find the permutation distribution for a list of matrices for calculating Shanon entropy of an Image<p>Where H(X)=−∑xp(x)logp(x) is the Shanon entropy.In accordance to the paper "History of art paintings through the lens of entropy and complexity"</p> | <p>I recently worked on Exploratory work with painting datasets, Hope this satisfies your problem. According to the reference paper length of distribution cannot exceed 24.</p>
<pre><code>def permutataion_distribution(matrix_list):
'''
Returns the distribution of matrix permutaions.
Input:
matrix_list: the output ... | How to find the permutation distribution for a list of matrices for calculating Shanon entropy of an Image | python|machine-learning | -2 | 36 | 1 | 71,256,602 | 71,256,602 | 0 | true | 2022-02-24T18:09:18.677Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to find the permutation distribution for a list of matrices for calculating Shanon entropy of an Image<p>Where H(X)=−∑xp(x)logp(x) is the Shanon entropy.... |
71,264,838 | Do we have anything like GTMetrix for Mobile Apps?<p>I have a flutter app for android and iOS (dealsfidners). People say it takes some time to load during a mobile internet connection without wifi. For websites, I used to do a performance baseline with GTMetrix and improve something and verify if my performance improv... | <p>flutter has its own profiler:</p>
<pre><code>https://docs.flutter.dev/development/tools/devtools/network
https://docs.flutter.dev/development/tools/devtools/performance
https://docs.flutter.dev/development/tools/devtools/cpu-profiler
</code></pre> | Do we have anything like GTMetrix for Mobile Apps? | android|ios|flutter|flutter-test|gtmetrix | -2 | 37 | 1 | 71,265,919 | 71,265,919 | 0 | true | 2022-02-25T10:59:59.457Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Do we have anything like GTMetrix for Mobile Apps?<p>I have a flutter app for android and iOS (dealsfidners). People say it takes some time to load during a ... |
71,242,589 | Is Azure SQL Elastic Pool the Right Choice for Having Separate SQl DB in DEV and PROD Environment<p><strong>When hosting a Web app using a SQL DB in Azure, we need a separate SQL DB in DEV & PROD environments. Will using Elastic Pool be the better choice than Single database with 1 instance?</strong></p>
<p>It loo... | <blockquote>
<p>Does using Elastic Pool add more complexity for Web App development?</p>
</blockquote>
<p>No, Elastic Pool doesn't add complexity infect it allows you to easily manage multiple databases which share same configuration and requires unpredictable usage demand.</p>
<blockquote>
<p>Will using Elastic Pool b... | Is Azure SQL Elastic Pool the Right Choice for Having Separate SQl DB in DEV and PROD Environment | azure|azure-sql-database|azure-elasticpool | -2 | 267 | 1 | 71,305,519 | 71,305,519 | 0 | true | 2022-02-23T18:53:29.813Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is Azure SQL Elastic Pool the Right Choice for Having Separate SQl DB in DEV and PROD Environment<p><strong>When hosting a Web app using a SQL DB in Azure, w... |
71,321,809 | Replacing entries in column in specific cases with content of a different column in the same row in R<p>I have a dataframe (dataM1) with multiple columns and over 16k of rows. Two of the columns are age and education. Education is measured by the age until one went to school.One of the entries in education is "st... | <p>Use the package <code>dplyr</code>:</p>
<p>If the <code>education</code> column is "still studying", replace it with <code>age</code>, otherwise, keep the values in <code>education</code>.</p>
<pre><code>library(dplyr)
# your data
df <- data.frame(age = c(25, 30, 12, 15, 21),
educatio... | Replacing entries in column in specific cases with content of a different column in the same row in R | r | -2 | 23 | 1 | 71,322,196 | 71,322,196 | 0 | true | 2022-03-02T11:21:19.817Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Replacing entries in column in specific cases with content of a different column in the same row in R<p>I have a dataframe (dataM1) with multiple columns and... |
71,357,282 | PostgreSQL - Find the difference between the minimum and 2nd from minimum times (timezonez) for each user<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>Time</th>
<th>user_id</th>
</tr>
</thead>
<tbody>
<tr>
<td>12:00</td>
<td>123</td>
</tr>
<tr>
<td>14:21</td>
<td>459</td>
</tr>
<tr>
<td>13:45... | <p>You can use <code>row_number()</code> to get the rows with the two smallest times, then calculate <code>max(time) - min(time)</code> to get the difference between the two, with <code>group by user_id</code>. No need for a join:</p>
<pre><code>select user_id,
max(time) - min(time) as diff
from (select *, row_number()... | PostgreSQL - Find the difference between the minimum and 2nd from minimum times (timezonez) for each user | sql|postgresql | -2 | 32 | 2 | 71,357,414 | 71,357,414 | 0 | true | 2022-03-04T21:15:23.360Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PostgreSQL - Find the difference between the minimum and 2nd from minimum times (timezonez) for each user<div class="s-table-container">
<table class="s-tabl... |
71,358,621 | Add "\n" to certain elements of a string vector based on a condition<p>Say we have a string vector named <code>vec</code>. Is there a way to add <code>"\n"</code> before the <strong>first whole word (i.e., terms of at least two characters)</strong> of the elements of <code>vec</code> that exceed 10 characters... | <p>You can try a regular expression replace like this</p>
<pre><code>gsub("^(.{9}.*?) (?=\\w{2,})(.*)", "\\1 \n\\2",vec, perl = TRUE)
# [1] "Van Beuningen \net al b" "bbbb & zz"
# [3] "AA, BB, & \nCC"
</code></pre>
<p>That will make sure you have... | Add "\n" to certain elements of a string vector based on a condition | r|regex|string|function|character | -2 | 40 | 1 | 71,358,848 | 71,358,848 | 0 | true | 2022-03-05T00:48:46.203Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Add "\n" to certain elements of a string vector based on a condition<p>Say we have a string vector named <code>vec</code>. Is there a way to add <code>"... |
71,385,658 | Use Python need to remove the هههههههه that exceed 3 ه<p>How to remove the extra 'ه' in the word?
Maximum 3 'ه' in the word</p>
<blockquote>
<p>شنو هل الغابة اوي عايشين بيها كلنا نختلف ههههههههههههه اي اي الايلينز تجين</p>
</blockquote> | <p>It's a bit tricky because of the right-to-left orientation but this seems to work for me:</p>
<pre><code>import re
text = "شنو هل الغابة اوي عايشين بيها كلنا نختلف ههههههههههههه اي اي الايلينز تجين"
text = re.sub("ه{3,}", "ههه", text)
print(text)
> "شنو هل الغابة اوي عايشين بيه... | Use Python need to remove the هههههههه that exceed 3 ه | python|nlp|arabic|preprocessor | -2 | 39 | 1 | 71,387,058 | 71,387,058 | 0 | true | 2022-03-07T18:26:21.373Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Use Python need to remove the هههههههه that exceed 3 ه<p>How to remove the extra 'ه' in the word?
Maximum 3 'ه' in the word</p>
<blockquote>
<p>شنو هل الغابة... |
71,388,744 | Why can't we route data with mac addresses?<p>I am studying for my CCNA, and I was wondering why we can't route packets between networks with MAC addresses. I have looked at other questions, and I can't seem to find the answer to this.</p> | <p>Because that would mean that every node in the network would have to know every mac address everywhere</p>
<p>think of it like this. IP routing is like routing by postal address</p>
<pre><code>123 main st,
Big City
Ohio
USA
</code></pre>
<p>This is structured. Post office in California (where I mail this letter) doe... | Why can't we route data with mac addresses? | networking|routes|mac-address | -2 | 35 | 1 | 71,388,798 | 71,388,798 | 0 | true | 2022-03-08T00:35:40.067Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why can't we route data with mac addresses?<p>I am studying for my CCNA, and I was wondering why we can't route packets between networks with MAC addresses. ... |
71,389,477 | JSON-Simple. Modify and use complex object<p>I am using the JSON-simple library to parse the Json format. How can I use or modify something to a JSONArray? For e.g. consider the following json</p>
<pre><code>"Place": [
{
"name": "owner 1"
},
{
"name": &quo... | <p>Simply create a pojo class in the same format.</p>
<pre><code>Classs Pojo{
private List<Place> place;
private List<Branch> branch;
// other fields
}
</code></pre>
<p>and use writeValueAsString() from your object mapper to convet it to json.</p> | JSON-Simple. Modify and use complex object | java|object|json-simple | -2 | 29 | 1 | 71,389,549 | 71,389,549 | 0 | true | 2022-03-08T02:47:45.437Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
JSON-Simple. Modify and use complex object<p>I am using the JSON-simple library to parse the Json format. How can I use or modify something to a JSONArray? F... |
71,151,320 | app works in androidStudio but not on phone<p>i have app which gets data from api.</p>
<p>While taking datas from api it waits on loadingScreen.</p>
<p>it works well in androidStudio but when i installed my phone i cant pass loadingScreen</p>
<p>is there any way to that i can pass this screen</p>
<p>texttexttextexttext... | <p>Hi guys i solved the problem you need to add these two lines</p>
<pre><code><uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</code></pre>
<p>to your AndroidManifest.xml file
it must be in <code>&... | app works in androidStudio but not on phone | flutter | -2 | 30 | 3 | 71,190,013 | 71,190,013 | 0 | true | 2022-02-17T01:19:38.577Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
app works in androidStudio but not on phone<p>i have app which gets data from api.</p>
<p>While taking datas from api it waits on loadingScreen.</p>
<p>it wo... |
71,174,956 | how to call a closure with argument in a function<pre><code>func Test(clo: @escaping (String)->Void)
{
clo($0)
}
</code></pre>
<p>it return an error that says :</p>
<blockquote>
<p>anonymous closure argument not contained in a closure</p>
</blockquote>
<p>I want to be able to do:</p>
<pre><code>Test{ n in
var na... | <p>That is not how closures work in Swift. And the code you wrote doesn't even make sense. Why do you assign <code>n</code> to <code>name</code> then change the value of <code>name</code> just to print it ?</p>
<p>The function with the closure will call the closure with a given value. You can think of closures as lambd... | how to call a closure with argument in a function | ios|swift | -2 | 35 | 1 | 71,175,322 | 71,175,322 | 0 | true | 2022-02-18T14:17:48.777Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to call a closure with argument in a function<pre><code>func Test(clo: @escaping (String)->Void)
{
clo($0)
}
</code></pre>
<p>it return an error th... |
71,334,098 | How can use button open web browser<p>How can I successfully create an index address link on the main list screen?</p>
<p><a href="https://github.com/BM-LSM/my_land" rel="nofollow noreferrer">github source</a></p> | <p>You should be able to use the <code>url_launcher</code> package in some <code>onPressed</code>or <code>onTap</code> property:
<a href="https://pub.dev/packages/url_launcher" rel="nofollow noreferrer">https://pub.dev/packages/url_launcher</a></p>
<pre class="lang-dart prettyprint-override"><code>import 'package:url_l... | How can use button open web browser | flutter|dart | -2 | 26 | 1 | 71,334,236 | 71,334,236 | 0 | true | 2022-03-03T08:29:10.697Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can use button open web browser<p>How can I successfully create an index address link on the main list screen?</p>
<p><a href="https://github.com/BM-LSM/... |
71,154,409 | Is this valid syntax in React?<p>I am working on a React project and in there I have to initialize a socket once the component's been mounted. For that I am using this syntax and I want to know whether or not it is valid.</p>
<pre class="lang-js prettyprint-override"><code>function Component() {
const socket = useM... | <p>You need to add a dependency array to your <code>useMemo</code>, otherwise it'll be triggered at each render. After that, yes it's a valid syntax :)</p>
<pre><code>const socket = useMemo(() => {
return io('http://localhost:3001')
}, [])
</code></pre> | Is this valid syntax in React? | reactjs|react-hooks|react-usememo | -2 | 43 | 1 | 71,154,462 | 71,154,462 | 1 | true | 2022-02-17T08:06:30.233Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is this valid syntax in React?<p>I am working on a React project and in there I have to initialize a socket once the component's been mounted. For that I am ... |
71,166,112 | Fastest, best (fastest) way to modify data in in a pytorch loss function?<p>I want to experiment with creating a modified Loss function for 4 channel image data.</p>
<p>What is the best way to split torch.Size([64, 4, 128, 128])</p>
<p>to</p>
<p>torch.Size([64, 3, 128, 128])
torch.Size([64, 1, 128, 128])</p> | <p>You can either slice the second axis and extract two tensors:</p>
<pre><code>>>> a, b = x[:, :3], x[:, 3:]
>>> a.shape, b.shape
(64, 3, 128, 128), (64, 1, 128, 128)
</code></pre>
<p>Alternatively you can apply <a href="https://pytorch.org/docs/stable/generated/torch.split.html" rel="nofollow norefe... | Fastest, best (fastest) way to modify data in in a pytorch loss function? | pytorch | -2 | 22 | 2 | 71,166,670 | 71,166,670 | 1 | true | 2022-02-17T22:22:26.077Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Fastest, best (fastest) way to modify data in in a pytorch loss function?<p>I want to experiment with creating a modified Loss function for 4 channel image d... |
71,194,291 | TypeError: Object(..) is not a function React-Router v6<p>I'm new to React, so when I try to use React-Router <code><BrowserRouter></code> I get this error
whenever I delete it, the app works just fine
I'm using React-router v6
here is the error
<a href="https://i.stack.imgur.com/e44Gr.png" rel="nofollow noreferr... | <p>After many searching, I figured out that the problem was with my React version 16.6
as react router v6 depends heavily on React Hooks which was introduced starting from React v16.8, so I had to either upgrade my react version or downgrade my React router to v5, which I did and worked just fine.
<a href="https://i.st... | TypeError: Object(..) is not a function React-Router v6 | reactjs|react-router | -2 | 257 | 3 | 71,194,648 | 71,194,648 | 1 | true | 2022-02-20T12:12:18.283Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
TypeError: Object(..) is not a function React-Router v6<p>I'm new to React, so when I try to use React-Router <code><BrowserRouter></code> I get this e... |
71,201,247 | Regex add string after 11th instance of /<p>I have a collection of web addresses with the following structure:</p>
<p><code>https://www.example.com/img/public/vendor1/us/en/product-assets/vendor/product/green/device_230x400_a.gif</code></p>
<p>When constructing this data structure, I realized that I needed to add <code... | <p>You may use the following find and replace, in regex mode:</p>
<pre class="lang-regex prettyprint-override"><code>Find: ^(https?://(?:[^/]+/){9})(.*)$
Replace: $1image/$2
</code></pre>
<p>This regex says to:</p>
<pre class="lang-regex prettyprint-override"><code>^
( capture in $1
https?: ... | Regex add string after 11th instance of / | regex | -2 | 27 | 2 | 71,201,267 | 71,201,267 | 1 | true | 2022-02-21T04:29:24.613Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Regex add string after 11th instance of /<p>I have a collection of web addresses with the following structure:</p>
<p><code>https://www.example.com/img/publi... |
71,209,425 | How does it work for me to call an object in a function that doesnt have it as a parameter in python/pytorch?<p>Im learning neural network in PyTorch and i came across with that:</p>
<pre><code>#Loss function
criterion = nn.MSELoss()
#Optimizer
from torch import optim
optimizer = optim.Adam(MLP.parameters(), lr=ar... | <p>This is not a Pytorch thing, these are called <a href="https://www.w3schools.com/python/python_variables_global.asp" rel="nofollow noreferrer">global</a> (as opposed to local) variables. I would advise to get more familiar with the Python language and programming in general, if you want to get a grip on Pytorch.</p> | How does it work for me to call an object in a function that doesnt have it as a parameter in python/pytorch? | python|neural-network|pytorch | -2 | 20 | 1 | 71,209,563 | 71,209,563 | 1 | true | 2022-02-21T16:02:09.307Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How does it work for me to call an object in a function that doesnt have it as a parameter in python/pytorch?<p>Im learning neural network in PyTorch and i c... |
71,212,885 | Get value by comparing value with values from another column<p>I have a table in the following format</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>ID</th>
<th>Attribute</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>A</td>
</tr>
<tr>
<td>2</td>
<td>AA</td>
</tr>
<tr>
<td>3</td>
<td>A</t... | <p>I think the following provides your desired output, selecting only the IDs that exist with distinct counts of both qualifying attribute groups:</p>
<pre><code>select *
from t
where id in (
select id
from t
group by id
having Count(distinct case when attribute like 'A%' then 1 end) > 0
and ... | Get value by comparing value with values from another column | mysql | -2 | 32 | 1 | 71,213,240 | 71,213,240 | 1 | true | 2022-02-21T20:51:55.453Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get value by comparing value with values from another column<p>I have a table in the following format</p>
<div class="s-table-container">
<table class="s-tab... |
71,236,443 | The best way to achieve the requirement column in Excel<p>What is the best way to achieve the requirement from the sample data as per the screenshot attached? I want to merge the RED highlighted font in one row & delete the additional Row. Example - Data in row 4, 6 & 8 can move to the previous column & the... | <h2>Delete Entire Rows With Condition</h2>
<ul>
<li>Loops through the rows from the bottom to the top.</li>
<li>If there is at least one blank cell, returns the value of each cell adjacent to the top of each non-blank cell, concatenated with the value of the non-blank cell, in the adjacent cell. Then it combines the fi... | The best way to achieve the requirement column in Excel | excel|vba|excel-formula|excel-2010 | -2 | 35 | 1 | 71,237,808 | 71,237,808 | 1 | true | 2022-02-23T11:52:15.157Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
The best way to achieve the requirement column in Excel<p>What is the best way to achieve the requirement from the sample data as per the screenshot attached... |
71,256,098 | How do I replace a special character<p>I'm trying to replace a special character "½" with ".5"</p>
<p><strong>cell.InnerText="o208½-105u208½-109o208-110u209-110";</strong></p>
<pre><code> string tempStr=cell.InnerText;
if (cell.InnerTex... | <p>String is an immutable type. Compiler creates a new string after replacing. So try just this</p>
<pre><code>var innerText = "o208½-105u208½-109o208-110u209-110";
innerText= innerText.Replace("½", ".5");
</code></pre>
<p>result</p>
<pre><code>before - o208½-105u208½-109o208-110u20... | How do I replace a special character | c#|string|character-encoding | -2 | 31 | 1 | 71,256,162 | 71,256,162 | 1 | true | 2022-02-24T17:42:38.563Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I replace a special character<p>I'm trying to replace a special character "½" with ".5"</p>
<p><strong>cell.InnerText="o208Â... |
71,289,021 | How to resize and delete an image on Mac?<p>I am following a guide to convert a .app file to .iso file on my Mac. I had to create an image and i typed the following line on my terminal</p>
<pre><code>hdiutil create -o /tmp/Mojave -size 8500m -volname Mojave -layout SPUD -fs HFS+J
</code></pre>
<p>Since there was no eno... | <p>Try this</p>
<pre><code>1. In Finder, open up your Macintosh HD folder
2. Press CMD+Shift+Dot //this will show your hidden files
</code></pre>
<p>Then navigate to /tmp/Mojave and delete the files you just created earlier.</p>
<pre><code>Repeat step 2 to hide them again!
</code></pre> | How to resize and delete an image on Mac? | macos|shell | -2 | 35 | 1 | 71,289,106 | 71,289,106 | 1 | true | 2022-02-27T22:38:55.787Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to resize and delete an image on Mac?<p>I am following a guide to convert a .app file to .iso file on my Mac. I had to create an image and i typed the fo... |
71,256,918 | Why solving the cryto puzzle is key in blockchain<p>Can somebody explain in detail as:</p>
<pre><code>why solving a crypto puzzle by blockchain nodes is key in blockchain systems?
What factor can make a node solve the puzzle earlier than others.
How is it important for security in blockchain system?
</code></pre> | <p>These are some good questions that address the fundamental nature of many contemporary blockchains.</p>
<p>The "puzzle" being solved is the random guessing of a number that creates a resulting hash in line with the blockchain's protocol. Digging deeper into this, hashing algorithms are a one-way function w... | Why solving the cryto puzzle is key in blockchain | blockchain | -2 | 43 | 1 | 71,291,428 | 71,291,428 | 1 | true | 2022-02-24T18:56:39.630Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why solving the cryto puzzle is key in blockchain<p>Can somebody explain in detail as:</p>
<pre><code>why solving a crypto puzzle by blockchain nodes is key ... |
71,327,182 | Add List<Model> to List inside List<Model><p>I have three models in my project, <code>LibraryModel</code>, <code>LibraryContentsModel</code>, and <code>BooksModel</code>.</p>
<p><code>LibraryModel</code>: a model for local JSON file.</p>
<p><code>BooksModel</code>: a model for SQLite database.</p>
<p><code>LibraryConte... | <p>Why don't use just</p>
<pre><code>LibraryContentsModel(
...
bookList: booklist, // already fetched
),
</code></pre> | Add List<Model> to List inside List<Model> | arrays|list|flutter|dictionary|dart | -2 | 44 | 1 | 71,342,313 | 71,342,313 | 1 | true | 2022-03-02T17:58:33.987Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Add List<Model> to List inside List<Model><p>I have three models in my project, <code>LibraryModel</code>, <code>LibraryContentsModel</code>, and <code>Books... |
71,342,816 | I am making a mod for a game, but i cant figure out where to put the different fields. can someone explain or give me and example?<p>I want to put this in my behaviour class, so when an object collides with another it will invoke an event.</p>
<p>documentation for the modding.</p>
<p><a href="https://i.stack.imgur.com/... | <p>Add a Collider2D and use OnCollisionEnter, which is automatically called when the collision is detected.</p>
<pre><code>public class RamstickBehavior : MonoBehaviour
{
Collider2D myCollider; // or just add in the editor and/or make this public and drag a collider from the editor
void Start()
{
m... | I am making a mod for a game, but i cant figure out where to put the different fields. can someone explain or give me and example? | c# | -2 | 30 | 1 | 71,343,345 | 71,343,345 | 1 | true | 2022-03-03T19:35:07.390Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I am making a mod for a game, but i cant figure out where to put the different fields. can someone explain or give me and example?<p>I want to put this in my... |
71,373,831 | confused about how parameter of slice ( [ ]int ) work?<p>I read this <a href="https://medium.com/@gotzmann/so-you-think-you-know-go-c5164b0d0511" rel="nofollow noreferrer">article</a> that made some samples, and I failed to guess the output of some of them...</p>
<p>The first one (<a href="https://play.golang.org/p/WGP... | <p>A slice is a view over an array. When you append new values to a slice that does not have enough capacity, a new array is allocated with larger capacity and the contents of the old array are copied to the new array.</p>
<p>So in the second case, the slice is appended in the function, so at that point a new array is ... | confused about how parameter of slice ( [ ]int ) work? | go | -2 | 41 | 1 | 71,373,950 | 71,373,950 | 1 | true | 2022-03-06T20:06:54.133Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
confused about how parameter of slice ( [ ]int ) work?<p>I read this <a href="https://medium.com/@gotzmann/so-you-think-you-know-go-c5164b0d0511" rel="nofoll... |
71,384,087 | Take substring from dictionary value<p>I have a dictionary containing variables and their values.</p>
<p>This is my dictionary, for example:</p>
<pre><code>{27: 'choice = input("Enter choice(1/2/3/4): ")',
31: 'num1 = float(input("Enter first number: "))',
32: 'num2 = float(input("Enter secon... | <p>Use a list comprehension. Assuming <code>d</code> the input dictionary.</p>
<pre><code>lst = [x.split()[0] for x in d.values()]
</code></pre>
<p>output: <code>['choice', 'num1', 'num2', 'next_calculation']</code></p>
<p><em>NB. do not name your variable <code>list</code>, this is a python builtin</em></p>
<p>If you ... | Take substring from dictionary value | python|list|dictionary|substring | -2 | 43 | 1 | 71,384,103 | 71,384,103 | 1 | true | 2022-03-07T16:18:27.223Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Take substring from dictionary value<p>I have a dictionary containing variables and their values.</p>
<p>This is my dictionary, for example:</p>
<pre><code>{... |
71,396,853 | Parse a json file with multiple json objects<p>I have a json file called test.json</p>
<pre><code>[
{
"uuid": "4c85cb89-88bb-4019-81ee-1215363c9e9a",
"ulid": "01FX3473AG0WJHEQ29A62HGQA9"
},
{
"uuid": "1d5af2a4-9ed4-4f96-996c-6d15... | <p>You can read the file to a list of dictionaries:</p>
<pre><code>import json
my_list = json.load(open("test.json"))
>>> my_list
[{'uuid': '4c85cb89-88bb-4019-81ee-1215363c9e9a',
'ulid': '01FX3473AG0WJHEQ29A62HGQA9'},
{'uuid': '1d5af2a4-9ed4-4f96-996c-6d1580a691b4',
'ulid': '01FX34BBRC5P3C1ECM... | Parse a json file with multiple json objects | python|json | -2 | 274 | 1 | 71,396,920 | 71,396,920 | 1 | true | 2022-03-08T14:43:30.923Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Parse a json file with multiple json objects<p>I have a json file called test.json</p>
<pre><code>[
{
"uuid": "4c85cb89-88bb-4019-... |
71,408,230 | Word by word fade in animation javascript/jquery<p>I'm looking for a way to show this animation BUT with different duration between each word and breaking the line(You can see it in YouTube video)</p>
<pre><code>https://youtu.be/KwELYWNpMyE
</code></pre>
<p>I've also took some further steps but no success.</p>
<pre><co... | <p>Implement the text to time function, as you wish.
It is a simple code, but you can improve it.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var $el = $(".example:first"),... | Word by word fade in animation javascript/jquery | javascript|jquery|css | -2 | 39 | 1 | 71,409,797 | 71,409,797 | 1 | true | 2022-03-09T10:58:04.117Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Word by word fade in animation javascript/jquery<p>I'm looking for a way to show this animation BUT with different duration between each word and breaking th... |
71,349,158 | Subscript 'subscript(_:)' requires that 'String.Index' conform to 'RangeExpression'<p>I have a simple function:</p>
<pre><code>private func formatted(phoneNumber: String, mask: String) -> String {
var output = ""
var index = phoneNumber.startIndex
for character in mask where index < phoneNum... | <p>Notice that the string subscript returns a <code>Character</code>, but <a href="https://developer.apple.com/documentation/swift/string/2965662" rel="nofollow noreferrer"><code>+=</code></a> can only be used to add a sequence of characters to a string:</p>
<pre><code>static func += <Other>(lhs: inout String, rh... | Subscript 'subscript(_:)' requires that 'String.Index' conform to 'RangeExpression' | ios|swift | -2 | 264 | 1 | 71,349,279 | 71,349,279 | 1 | true | 2022-03-04T09:21:05.510Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Subscript 'subscript(_:)' requires that 'String.Index' conform to 'RangeExpression'<p>I have a simple function:</p>
<pre><code>private func formatted(phoneNu... |
71,324,151 | How to assign random values from list to new column that doesn't exist in another column of the same row but not assign to same name<pre><code>df = pd.DataFrame(data={
'job_id': ['0001', '0001', '0001', '0002', '0002', '0002', '0003', '0003', '0004', '0004', '0005', '0005', '0005', '0005', '0006'],
'user_id': [... | <p>IIUC, you could use a <code>set</code> difference combined with <code>random.choice</code>:</p>
<pre><code>import random
users = set(df['user_id'])
df['validator_id'] = (df.groupby('user_id')['user_id']
.transform(lambda x: random.choice(list(users.difference(x))))
)
</c... | How to assign random values from list to new column that doesn't exist in another column of the same row but not assign to same name | python|pandas|numpy | -2 | 34 | 1 | 71,324,346 | 71,324,346 | 1 | true | 2022-03-02T14:13:27.890Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to assign random values from list to new column that doesn't exist in another column of the same row but not assign to same name<pre><code>df = pd.DataFr... |
71,363,739 | How to get the list of students with second lowest grade?<p>I am trying to solve a problem in coding websites.
I came up with below problem.</p>
<p>Problem:
Given the names and grades for each student in a class of students, store them in a nested list and print the name(s) of any student(s) having the second lowest g... | <p>Seems like you're over-complicating it by re-implementing <code>min()</code> as a loop <em>and</em> trying to have it keep track of both the minimum and the second-minimum in a single pass (which seems like it should be vulnerable to getting fooled by local minima -- if you were to step through your code with inputs... | How to get the list of students with second lowest grade? | python | -2 | 530 | 2 | 71,363,868 | 71,363,868 | 1 | true | 2022-03-05T16:03:56.940Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get the list of students with second lowest grade?<p>I am trying to solve a problem in coding websites.
I came up with below problem.</p>
<p>Problem:
... |
71,117,557 | How to modify result returned from json.loads()?<p>This is the code:</p>
<pre><code>import requests
import json
url = ('https://api.coingecko.com/api/v3/coins/bitcoin/market_chart/range?vs_currency=usd&from=1609459201&to=1638313199')
get = requests.get(url).text
get = json.loads(get)
print(get)
</code></pre>
<... | <p>Since you emphasize that you want to <em>"<strong>remove</strong> the first number of each box"</em>:</p>
<pre><code>for box in get['prices']:
del box[0]
</code></pre> | How to modify result returned from json.loads()? | python|json | -2 | 42 | 3 | 71,117,782 | 71,117,782 | 2 | true | 2022-02-14T19:55:12.700Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to modify result returned from json.loads()?<p>This is the code:</p>
<pre><code>import requests
import json
url = ('https://api.coingecko.com/api/v3/coi... |
71,171,951 | golang cannot assign interface {} for struct<p>Hello Expert I'm using this libraray to store K/V in cache</p>
<p><code>"github.com/bluele/gcache"</code></p>
<p>The value which I store is this Data Structure</p>
<pre class="lang-golang prettyprint-override"><code>type LatestBlockhashCacheResult struct {
Bl... | <p>You are trying to assign <code>interface{}</code> to a typed variable.
In order to do this you need first try to cast the <code>interface{}</code> value to a specific type</p>
<pre><code>val, err := gc.Get(rf.LastValidBlockHeight)
if err != nil {
// handle
}
c, ok := val.(LatestBlockhashCacheResult)
if !ok {
... | golang cannot assign interface {} for struct | go | -2 | 297 | 1 | 71,172,006 | 71,172,006 | 2 | true | 2022-02-18T10:27:57.170Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
golang cannot assign interface {} for struct<p>Hello Expert I'm using this libraray to store K/V in cache</p>
<p><code>"github.com/bluele/gcache"</... |
71,112,924 | Extraction of substrings from a string on the basis of multiple conditions in R<p>I have a string <code>str</code> from which multiple substrings are to be extracted.</p>
<pre><code>str <- "Nucleotide transport and metabolism,Secondary metabolites biosynthesis, transport, and catabolism / Chromatin structure an... | <p>You can use <code>str_split</code> from the <code>stringr</code> package.</p>
<pre><code>library(stringr)
str_split(str, ",(?=[:upper:])|\\s\\/\\s") %>% unlist() %>% gsub(",$", "", .)
[1] "Nucleotide transport and metabolism"
[2] "Seconda... | Extraction of substrings from a string on the basis of multiple conditions in R | r|string | -2 | 33 | 1 | 71,113,001 | 71,113,001 | 2 | true | 2022-02-14T13:48:30.410Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Extraction of substrings from a string on the basis of multiple conditions in R<p>I have a string <code>str</code> from which multiple substrings are to be e... |
71,417,819 | Ploting categorical variable to get numbers at the top of the bars in R<p>Here is a small sample of my data just to demonstrate the the plot of interest</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html... | <p>Given the lack of detail and specificity in the question, it's not possible for me to be sure of what you're looking for. Perhaps it is something like this.</p>
<pre class="lang-r prettyprint-override"><code>library(tidyverse)
df<-read.table (text=" P U W
A F F
M M F
N F F
A F F
M M ... | Ploting categorical variable to get numbers at the top of the bars in R | r|ggplot2 | -2 | 37 | 1 | 71,418,678 | 71,418,678 | 2 | true | 2022-03-10T01:26:14.813Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Ploting categorical variable to get numbers at the top of the bars in R<p>Here is a small sample of my data just to demonstrate the the plot of interest</p>
... |
71,290,431 | Error in printing the real price and currency "AttributeError: 'NoneType' object has no attribute 'text'"<p>I want to print the real price of bitcoins using python, but when extracting the name of the currency and its amount, I get an error of <code>AttributeError: 'NoneType' object has no attribute 'text'</code></p>
<... | <p>Have you downloaded that page and looked at it yourself? It doesn't return HTML at all. It returns JSON. You don't need BeautifulSoup.</p>
<pre><code>url = "https://api.coinbase.com/v2/prices/ETH-CAD/buy"
data = requests.get(url)
ans = json.loads(data.text)
</code></pre> | Error in printing the real price and currency "AttributeError: 'NoneType' object has no attribute 'text'" | python|beautifulsoup | -2 | 28 | 1 | 71,290,470 | 71,290,470 | 2 | true | 2022-02-28T04:00:34.940Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Error in printing the real price and currency "AttributeError: 'NoneType' object has no attribute 'text'"<p>I want to print the real price of bitcoins using ... |
71,228,852 | Not able to get a semicolon separated string after looping through a list in c#<p>I am new to C# and .Net core. I wish to get a string from a setter _modelDetails, but I am facing an issue. Below is its detailed description. Any help is greatly appreciated!</p>
<p>I have a json as below:</p>
<pre><code> "VehicleD... | <p>well you say only process the first transaction</p>
<pre><code> foreach (var transaction in model.Transaction)
{
transactionName = transaction.DisplayName;
break; <<<<=======
}
</code></pre>
<p>proba... | Not able to get a semicolon separated string after looping through a list in c# | c#|string|list | -2 | 38 | 2 | 71,228,894 | 71,228,894 | -1 | true | 2022-02-22T22:01:31.580Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Not able to get a semicolon separated string after looping through a list in c#<p>I am new to C# and .Net core. I wish to get a string from a setter _modelD... |
72,046,142 | Symmetric Matrix Python<p>I want to create a symmetric matrix with random numbers in python.</p>
<p>Example for symmetrical matrix:</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th></th>
<th>A</th>
<th>B</th>
<th>C</th>
<th>D</th>
</tr>
</thead>
<tbody>
<tr>
<td>A</td>
<td>0</td>
<td>1</td>
... | <pre><code>import numpy as np
n = 6
a = np.random.randint(0, 100, (n, n))
m = np.tril(a, -1) + np.tril(a, -1).T
m
# array([[ 0, 84, 90, 38, 74, 95],
# [84, 0, 28, 55, 83, 52],
# [90, 28, 0, 82, 42, 46],
# [38, 55, 82, 0, 1, 70],
# [74, 83, 42, 1, 0, 64],
# [95, 52, 46, 70, 64,... | Symmetric Matrix Python | python | -2 | 32 | 1 | 72,046,540 | 72,046,540 | 0 | true | 2022-04-28T15:08:51.903Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Symmetric Matrix Python<p>I want to create a symmetric matrix with random numbers in python.</p>
<p>Example for symmetrical matrix:</p>
<div class="s-table-c... |
72,086,945 | How to auto add images into the superior line if they fit<p>I know that this may sound a little stupid. I have some images on my website and I want them to go to the line they fit. (I have 3 images on top but in a phone there would be only one but on bigger monitors 4, and I don't want to use JavaScript)</p>
<p><div cl... | <p>It's not a stupid question, what you mean Is responsiveness? So basically on a phone the images are displayed beneath each other, but on a laptop next to each other... and on a bigger monitor even more spread next each other?</p>
<p>If so.</p>
<p><a href="https://tutorial" rel="nofollow noreferrer">https://developer... | How to auto add images into the superior line if they fit | html|css|image | -2 | 30 | 1 | 72,087,113 | 72,087,113 | 0 | true | 2022-05-02T12:47:03.693Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to auto add images into the superior line if they fit<p>I know that this may sound a little stupid. I have some images on my website and I want them to g... |
72,140,764 | how to get the browser time in React<p>Is there possibility to get the browser time in react. Is there any library that can help with this. The web page should display the time of the browsers( like chrome, explorer firefox etc.)</p>
<p>Thank and Regards,
Alexander</p> | <pre><code>var today = new Date();
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
console.log(time)
</code></pre> | how to get the browser time in React | reactjs|typescript|web-deployment-project | -2 | 41 | 1 | 72,140,836 | 72,140,836 | 0 | true | 2022-05-06T11:28:14.460Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to get the browser time in React<p>Is there possibility to get the browser time in react. Is there any library that can help with this. The web page shou... |
72,144,104 | Nextjs build is faild<p><a href="https://i.stack.imgur.com/brWrx.png" rel="nofollow noreferrer">pls help me</a></p>
<p>when running npm run build .I got an error: <code>./pages/include/WithTransition.js 4:9 Error: Component definition is missing display name react/display-name</code></p> | <p>Go to WithTransition.js</p>
<p>Make sure you defined the displayName before exporting</p>
<pre><code>WithTransition.displayName = 'WithTransition';
export default WithTransition;
</code></pre> | Nextjs build is faild | next.js | -2 | 30 | 1 | 72,144,184 | 72,144,184 | 0 | true | 2022-05-06T15:38:48.640Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Nextjs build is faild<p><a href="https://i.stack.imgur.com/brWrx.png" rel="nofollow noreferrer">pls help me</a></p>
<p>when running npm run build .I got an e... |
72,144,674 | Extra learners in mlr3<p>I cannot use models in mlr3 other than random forest, part, knn, svm, gbm etc. I am using mlr3extralearners package but still it seems there are a lot of models supported. How to use nnet, mlp etc in mlr3. I have a regression problem.</p>
<p>Second point is, is there a difference between regr.r... | <p>Filter this <a href="https://mlr3extralearners.mlr-org.com/articles/learners/list_learners.html" rel="nofollow noreferrer">list</a> by class "regr" to see which <code>learners</code> are avaiable for a regression problem.</p>
<p>To initialise a <code>learner</code>, e.g. <code>"regr.kknn"</code> ... | Extra learners in mlr3 | r|mlr3|nnet | -2 | 95 | 1 | 72,145,240 | 72,145,240 | 0 | true | 2022-05-06T16:27:26.160Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Extra learners in mlr3<p>I cannot use models in mlr3 other than random forest, part, knn, svm, gbm etc. I am using mlr3extralearners package but still it see... |
72,148,230 | Adventureworks exercises SQL Server<blockquote>
<p>Using the SalesOrderHeader and SalesTerritory tables, write a query to calculate the number of transactions and
total monthly amount per territory for each of the states based on the Status field. Status values are:
1 = In process ; 2 = Approved ; 3 = Backordered ; 4... | <p>Your logic is flawed there is no correlation between the sub queries and the branch/date in the main query so they total everything. Using conditional aggregation
demonstrates the difference</p>
<pre><code>SELECT
FORMAT(A.ShipDate, 'yyyy-MM') as mes,
B.Name,
(SELECT count(Status) FROM [sales].[SalesOrde... | Adventureworks exercises SQL Server | sql|sql-server | -2 | 536 | 1 | 72,150,885 | 72,150,885 | 0 | true | 2022-05-06T23:13:13.170Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Adventureworks exercises SQL Server<blockquote>
<p>Using the SalesOrderHeader and SalesTerritory tables, write a query to calculate the number of transaction... |
72,154,653 | How to catch error in loop Python correctly?<p>I read the file lines:</p>
<pre><code>lines = file.readlines()
for index, line in enumerate(lines):
result = parse(line)
</code></pre>
<p>Inside <code>parse</code> method I have:</p>
<pre><code>def parse(line):
l = line.split(",")
if not l[0]:
ra... | <p>Do this to trap the exception in the calling code:</p>
<pre><code>lines = file.readlines()
for index, line in enumerate(lines):
try:
result = parse(line)
mydict[index] = result
except Exception:
print(f"Line {index} is blank or has a leading comma: {line}")
</code><... | How to catch error in loop Python correctly? | python | -2 | 37 | 2 | 72,154,729 | 72,154,729 | 0 | true | 2022-05-07T16:56:08.637Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to catch error in loop Python correctly?<p>I read the file lines:</p>
<pre><code>lines = file.readlines()
for index, line in enumerate(lines):
result ... |
72,148,175 | C# variables of class are zeroed after P/Invoke call<p>I'm writing some vulkan code and ran into a problem which I can't get my head around. I've the following code:</p>
<p>NativeMethods.cs:</p>
<pre class="lang-cs prettyprint-override"><code>[DllImport("libvulkan.1.dylib", EntryPoint = "vkGetPhysicalDev... | <p>Thanks to the comment I found the issue. It was indeed what I would call a stackinbalance because the passed structure had a different memory layout than what was expected by vulkan.</p>
<p>Vulkan uses VkBool32 to express a boolean which is a uint32. I kindof thought since a normal bool is also 4 bytes I can just us... | C# variables of class are zeroed after P/Invoke call | c#|.net|pinvoke|vulkan | -2 | 74 | 1 | 72,154,738 | 72,154,738 | 0 | true | 2022-05-06T23:02:46.023Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C# variables of class are zeroed after P/Invoke call<p>I'm writing some vulkan code and ran into a problem which I can't get my head around. I've the followi... |
72,154,895 | how can i get my case statement to return both prefer action and prefer comedy in my custom preference column if a person has both marked as 1<pre><code>SELECT FirstName, LastName,
CASE
WHEN [Action] = '1' THEN 'Prefer Action'
WHEN Comedy = '1' THEN 'Prefer Comedy'
WHEN Drama = '1' THEN 'Prefer Drama'
WHEN Horror... | <p>You can use below Union statement,</p>
<pre><code>SELECT FirstName, LastName,
CASE
WHEN [Action] = '1' THEN 'Prefer Action'
WHEN Drama = '1' THEN 'Prefer Drama'
WHEN Horror = '1' THEN 'Prefer Horror'
WHEN Romance = '1' THEN 'Prefer Romance'
ELSE ' '
END AS 'Customer Preference'
FROM RentalMDB.dbo.Customers
UNION A... | how can i get my case statement to return both prefer action and prefer comedy in my custom preference column if a person has both marked as 1 | mysql|sql|case | -2 | 24 | 1 | 72,154,926 | 72,154,926 | 0 | true | 2022-05-07T17:25:19.943Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how can i get my case statement to return both prefer action and prefer comedy in my custom preference column if a person has both marked as 1<pre><code>SELE... |
72,155,568 | Circular main in makefile<p>when i run "make" with the Makefile I wrote, it says "Circular main <- main dependency dropped." how to solve it?</p>
<pre><code>main: main main.cpp pair.cpp
g++ -o main main.cpp pair.cpp
generate:
g++ -shared -fPIC -o libpair.so pair.cpp
clean:
rm main.exe... | <pre><code>main: main main.cpp pair.cpp
g++ -o main main.cpp pair.cpp
</code></pre>
<p>There are too many <code>main</code>s in your makefile, make sure that you know the first <code>main</code> is the target name, and the second one is an executable that generated by "something else".</p>
<pre><code>tar_... | Circular main in makefile | c++|makefile | -2 | 27 | 1 | 72,155,624 | 72,155,624 | 0 | true | 2022-05-07T18:54:58.740Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Circular main in makefile<p>when i run "make" with the Makefile I wrote, it says "Circular main <- main dependency dropped." how to so... |
72,142,768 | What do the brackets in 'turtle.pen()' do? What are they supposed to contain?<p>So recently I was planning to write a code using turtle graphics and I had a question. What do the brackets in <code>t = turtle.Pen()</code> mean? What are they supposed to contain? Please answer in a simplified manner as I am still a begin... | <p>The brackets in <code>turtle.Pen()</code> don't need to contain anything but there are three optional arguments:</p>
<pre><code>shape='classic', undobuffersize=1000, visible=True
</code></pre>
<p>There are several other <code>shape</code> choices (like <code>"turtle"</code>) and <code>visible</code> can be... | What do the brackets in 'turtle.pen()' do? What are they supposed to contain? | python|turtle-graphics | -2 | 43 | 2 | 72,157,830 | 72,157,830 | 0 | true | 2022-05-06T14:03:06.423Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What do the brackets in 'turtle.pen()' do? What are they supposed to contain?<p>So recently I was planning to write a code using turtle graphics and I had a ... |
72,160,065 | How do I manually remove a column from PhpMyAdmin<p>So I wanna remove a column that is useless in my phpMyAdmin table manually, how do I do that?</p> | <p>When you are on your table you can see the tabs on top of your phpmyadmin view, the second tab should be structure, there you can delete/edit or insert new or old columns.<a href="https://i.stack.imgur.com/I7Qjo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/I7Qjo.png" alt="enter image descriptio... | How do I manually remove a column from PhpMyAdmin | php|phpmyadmin | -2 | 26 | 1 | 72,160,079 | 72,160,079 | 0 | true | 2022-05-08T10:23:11.810Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I manually remove a column from PhpMyAdmin<p>So I wanna remove a column that is useless in my phpMyAdmin table manually, how do I do that?</p> |
72,141,992 | Google Autocomplete Places API sessiontoken parameter<p>I am lost with the session token parameter in the webservice api.</p>
<p>Is it: sessionToken or sessiontoken?</p>
<p>I can't find the truth. If I see documentation it's sessionToken but in the postman api it's sessiontoken.</p>
<p><a href="https://i.stack.imgur.co... | <p>Web service api is sessiontoken
javasacript is sessionToken</p>
<p>Thanks,</p> | Google Autocomplete Places API sessiontoken parameter | google-maps-api-3|googleplacesautocomplete | -2 | 50 | 1 | 72,161,350 | 72,161,350 | 0 | true | 2022-05-06T13:08:42.757Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Google Autocomplete Places API sessiontoken parameter<p>I am lost with the session token parameter in the webservice api.</p>
<p>Is it: sessionToken or sessi... |
72,163,958 | boolean variable always equals false<p>When opening the menu in my application it shows an extra option depending on the state of the game (paused or not started) however the controlling variable for what the button should do always returns as false.
I have attempted splitting the if statements into separate statements... | <p>You are declaring a boolean condition that must be true, remove the <code>!menuToggle</code> from both the <code>if</code> and <code>else if</code> and it becomes more clear. Often, when I get into these situations I spend time cleaning up my code first and that often helps me sort out the issue. Here is an example ... | boolean variable always equals false | java|android-studio|boolean | -2 | 89 | 1 | 72,164,297 | 72,164,297 | 0 | true | 2022-05-08T18:21:19.830Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
boolean variable always equals false<p>When opening the menu in my application it shows an extra option depending on the state of the game (paused or not sta... |
72,164,960 | Adjacency List Creation from a Blog Post<p>I need to make an adjacency list to show the relationship between two users from a Topic thread. My dataset consists of two columns: User ID and Topic ID. The Topic ID is like a blog post so many users can post on it. The dataset looks like the below:</p>
<div class="s-table-c... | <p>We'll get by with a little help from our friends <code>collections.defaultdict</code> and <code>itertools.combinations</code>:</p>
<pre><code>from collections import defaultdict
from itertools import combinations
by_post_id = defaultdict(set)
data = [
(1, 55),
(2, 55),
(1, 55),
(6, 55),
(1, 42)... | Adjacency List Creation from a Blog Post | python|social-networking | -2 | 16 | 1 | 72,164,987 | 72,164,987 | 0 | true | 2022-05-08T20:44:57.787Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Adjacency List Creation from a Blog Post<p>I need to make an adjacency list to show the relationship between two users from a Topic thread. My dataset consis... |
72,147,758 | TrueNAS shell gives ~~ at an interval and eventually causes a crash<p>After an update of my TrueNAS I started getting some strange double beeps.
I thought it might be thermal warning, so I cleaned my NAS PC, put a monitor and keyboard on and booted it up.</p>
<p>I started to see some strange token series popping up, se... | <p>Something went wrong with the patching process (I guess)</p>
<p>How I fixed it:</p>
<p>In the GUI I went to System -> Boot</p>
<p>I reverted to the previous patch.
Rebooted the system.</p>
<p>Issue still occurred.</p>
<p>Then I went to Dashboard -> check for updates.</p>
<p>It then went on and installed the up... | TrueNAS shell gives ~~ at an interval and eventually causes a crash | freebsd | -2 | 25 | 1 | 72,165,284 | 72,165,284 | 0 | true | 2022-05-06T21:57:13.143Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
TrueNAS shell gives ~~ at an interval and eventually causes a crash<p>After an update of my TrueNAS I started getting some strange double beeps.
I thought it... |
72,165,247 | Python calculator with order of operations?<p>I'm trying to make a python calculator that takes inputs like these:</p>
<pre><code>>>> 2+2*3
</code></pre>
<p>or</p>
<pre><code>>>> 3*45+2*52/3
</code></pre>
<p>or</p>
<pre><code>>>> 1+21/7-14/2
</code></pre>
<p>And return their answers with <str... | <p>Python has calculator built-in, check out</p>
<pre><code>exec(f"print({input()})")
</code></pre>
<p><a href="https://i.stack.imgur.com/rouqU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rouqU.png" alt="Calculator in python - Colab" /></a></p> | Python calculator with order of operations? | python|string|math|calculator | -2 | 203 | 1 | 72,165,446 | 72,165,446 | 0 | true | 2022-05-08T21:33:41.170Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python calculator with order of operations?<p>I'm trying to make a python calculator that takes inputs like these:</p>
<pre><code>>>> 2+2*3
</code><... |
72,166,117 | My JavaScript pop up modal only works on the first row<p>First question: I have a dynamic table, with edit icon on every row, when pressing the icon a popup modal should show up. But the popup modal only work on the first row. I tried to determine the problem and I think it’s because of the id "open5", that i... | <p>Your JavaScript code is looking for an element with the ID <code>open5</code>, HTML <code>id</code>'s should be unique, but your PHP code renders an element with the same ID for every row, ergo the JS code is satisfied when it finds the first element with ID <code>open5</code> and therefore all subsequent ones do no... | My JavaScript pop up modal only works on the first row | javascript|php|html | -2 | 96 | 1 | 72,166,162 | 72,166,162 | 0 | true | 2022-05-09T01:12:34.360Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
My JavaScript pop up modal only works on the first row<p>First question: I have a dynamic table, with edit icon on every row, when pressing the icon a popup ... |
72,166,351 | python index json array<p>I have a json file with 15000+ lines that looks like this;</p>
<pre><code>{
"address": [
"user address"
]
}{
"purchase": [
"details"
]
}{
"info1": [
"some information",
"other i... | <p><code>json.load</code> and <code>json.loads</code> need to have a correct JSON, from start to finish. Your file is not a correct JSON file; it seems it is a number of JSON documents concatenated with each other. To read it, you will have to be a bit more low-level:</p>
<pre><code>with open('my_file.json', 'rt') as f... | python index json array | python|json | -2 | 63 | 1 | 72,167,527 | 72,167,527 | 0 | true | 2022-05-09T02:08:12.673Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
python index json array<p>I have a json file with 15000+ lines that looks like this;</p>
<pre><code>{
"address": [
"user address&q... |
72,166,945 | How to delete nested element from mongo db based on conditon<p>{
"_id":62749de1c511aff4354802f0
"filename":"anomaly-detection-using-amazon.pdf"
"tags":[
{'entity': 'Aws', 'count': 21},
{'entity': 'Keras', 'count': 1},
{'entity': 'Amazon Ml', 'count': 1},
{'entity': 'Amazon Cloudw... | <p>Try this one:</p>
<pre><code>db.collection.aggregate([
{
$set: {
tags: {
$filter: {
input: "$tags",
cond: { $gt: [{ $strLenCP: "$$this.entity" }, 3] }
}
}
}
}
])
</code></pre>
<p><a href="https://mongoplaygr... | How to delete nested element from mongo db based on conditon | python|mongodb | -2 | 44 | 1 | 72,169,919 | 72,169,919 | 0 | true | 2022-05-09T04:15:29.733Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to delete nested element from mongo db based on conditon<p>{
"_id":62749de1c511aff4354802f0
"filename":"anomaly-detection-using-... |
72,161,498 | time complexity of (A[i]^x)>(A[i]&x)<p>'Is it possible to further optimize the time complexity this piece of calculation "(y^x)>(y&x)" in c++?(you are allowed to change the Boolean operation into other forms, for example this can also be written as log2(y)!=log2(x) and this gives the same Boolean outpu... | <p><code>(y^x)>(y&x)</code> is equivalent to <code>nlz(y) != nlz(x)</code> where <code>nlz</code> is a function that returns the number of leading zeroes of its input.</p>
<p>Therefore in order to count how often <code>(A[i]^x)>(A[i]&x)</code> is true for items in the array <code>A</code>, we could make a... | time complexity of (A[i]^x)>(A[i]&x) | c++|optimization|xor | -2 | 57 | 1 | 72,170,323 | 72,170,323 | 0 | true | 2022-05-08T13:31:30.113Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
time complexity of (A[i]^x)>(A[i]&x)<p>'Is it possible to further optimize the time complexity this piece of calculation "(y^x)>(y&x)" in c+... |
72,170,803 | Property 'bordered' does not exist on type 'Object'<p>Relevant TypeScript code:</p>
<pre><code>import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-ng-class-example',
templateUrl: './ng-class-example.component.html'
})
export class NgClassExampleComponent implements OnInit {
isBordered:... | <p>You can't just use <code>classesObj: Object</code> in TypeScript because it is assumed to be empty object <code>{}</code>. You need to use <code>any</code> like</p>
<pre><code>classesObj: any;
</code></pre>
<p>Or if you want to be specific</p>
<pre><code>classesObj: {
bordered: boolean
};
</code></pre> | Property 'bordered' does not exist on type 'Object' | javascript|html|angular|typescript | -2 | 51 | 1 | 72,170,854 | 72,170,854 | 0 | true | 2022-05-09T10:52:51.667Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Property 'bordered' does not exist on type 'Object'<p>Relevant TypeScript code:</p>
<pre><code>import { Component, OnInit } from '@angular/core';
@Component... |
72,169,268 | React Redux Typescript vs React Redux Javascript<p>I am starting to learn react with redux which should I focus on react redux with typescript or react redux java script</p> | <p>If you already know TypeScript like you are writing, use TypeScript.</p>
<p>Knowledge you acquire this way can be used with or without TypeScript - and you get nice editor support for free.</p>
<p>Go by the official <a href="https://redux.js.org/tutorials/essentials/part-1-overview-concepts" rel="nofollow noreferrer... | React Redux Typescript vs React Redux Javascript | javascript|reactjs|typescript|redux | -2 | 50 | 1 | 72,170,989 | 72,170,989 | 0 | true | 2022-05-09T08:49:57.523Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React Redux Typescript vs React Redux Javascript<p>I am starting to learn react with redux which should I focus on react redux with typescript or react redux... |
72,170,020 | SQL joining two columns on single column to get count<p>I am strugling to figure out how to receive what I need with t-sql. <br>
My goal is to count distinct operations, which contains certain item code combinations in side of them. <br>
Final desired output table:</p>
<pre><code>SELECT '1' as code_1, '2' as code_2, 2 ... | <p>Here are 2 queries which show the information that you are looking for.</p>
<ul>
<li>The first query is the format requested. It looks for all combinations of 2 codes. If you have operations with many codes the number of rows returned will grow exponentially.</li>
<li>The second query will group all the item_codes a... | SQL joining two columns on single column to get count | sql|sql-server|join | -2 | 61 | 1 | 72,170,993 | 72,170,993 | 0 | true | 2022-05-09T09:48:09.203Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SQL joining two columns on single column to get count<p>I am strugling to figure out how to receive what I need with t-sql. <br>
My goal is to count distinct... |
72,171,962 | Android NFC read Records getting a null Ndef Record<p>I am a junior android developper working on a Nfc Reader project. And I use Mifare Cards. I can only read the UID for the card but unable to read records that I wrote using Nfc Tools with my app but it gives me a null when logging the Ndef value in my console. Any h... | <p>You don't specify exact which type of card you are using (Model type of the card) but Most cards described as "Mifare" are not actual fully NFC standards compliant.</p>
<p>This especially is the case if it is a Mifare Classic Type card.</p>
<p>So there are 2 possible reason for your problem.</p>
<p>1)Mifar... | Android NFC read Records getting a null Ndef Record | java|android|nfc | -2 | 73 | 1 | 72,172,747 | 72,172,747 | 0 | true | 2022-05-09T12:24:22.987Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Android NFC read Records getting a null Ndef Record<p>I am a junior android developper working on a Nfc Reader project. And I use Mifare Cards. I can only re... |
72,172,596 | Deleting first 3 rows in Excel with python<p>I want to delete the first 3 rows from a specific sheet in Excel with Python (openpyxl).</p>
<pre><code>excel_file = xl.load_workbook('Test.xlsm')
excel_sheet = excel_file('Data')
excel_sheet.delete_rows(idx=0, amount=3)
excel_file.save('Test.xlsm')
</code></pre>
<p>But this... | <p>Try setting the sheet name using square brackets and the first row is row 1 not row 0</p>
<pre><code>excel_sheet = excel_file['Data']
excel_sheet.delete_rows(idx=1, amount=3)
</code></pre> | Deleting first 3 rows in Excel with python | python|excel|openpyxl | -2 | 90 | 1 | 72,173,031 | 72,173,031 | 0 | true | 2022-05-09T13:15:31.893Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Deleting first 3 rows in Excel with python<p>I want to delete the first 3 rows from a specific sheet in Excel with Python (openpyxl).</p>
<pre><code>excel_fi... |
72,173,714 | If a website built without port 80, can other client access this website as usual?<p>I know port 80 is one of well-know-port, but I am confused that if I build the website server process on other port except of 80, would it works when other client try to access this website server?</p> | <p>Port 80 is the default port for http. So connecting to http://domain would in essence send you to http://domain:80 (by default).</p>
<p>Port 443 is the default for https and would work the same way as stated for http above.</p>
<p>Any other port would require the you to do <code>url:port</code> to connect to. There ... | If a website built without port 80, can other client access this website as usual? | http|port|httpserver | -2 | 90 | 1 | 72,173,923 | 72,173,923 | 0 | true | 2022-05-09T14:33:08.497Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
If a website built without port 80, can other client access this website as usual?<p>I know port 80 is one of well-know-port, but I am confused that if I bui... |
72,174,108 | HTML page: Overflow of a 100vh<p>I have a page with a header and a section on a 100vh, and a footer on the rest (so you have to scroll to see it).</p>
<p>The problem is that if I scroll on the footer, and reduce the viewport height (by reducing the screen), the section content overflows on the footer ...</p>
<p>Here's ... | <p>Change the <code>.full-screen</code> <code>height</code> to <code>min-height</code>, still set to <code>100vh</code>:</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-css lang-css prettyprint-override"><code>.full... | HTML page: Overflow of a 100vh | html|css|viewport | -2 | 123 | 1 | 72,174,533 | 72,174,533 | 0 | true | 2022-05-09T15:00:51.120Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
HTML page: Overflow of a 100vh<p>I have a page with a header and a section on a 100vh, and a footer on the rest (so you have to scroll to see it).</p>
<p>The... |
72,179,143 | How can I Simplify this code of Laravel 8?<p>I have this code in routes, is it possible to simplify it?
Thanks</p>
<pre><code>Route::get('/post1', function () {
return view("post1");
})->name("/post1");
</code></pre> | <p>There is <strong>nothing wrong with that code</strong>, the only way you can "simplify" that code, better to say <strong>"abstract it"</strong> is by <strong>creating a controller</strong> with a method that returns the view.</p>
<p>In your case, if your route is very specific you can create a <s... | How can I Simplify this code of Laravel 8? | laravel|simplify | -2 | 47 | 1 | 72,179,263 | 72,179,263 | 0 | true | 2022-05-09T23:20:37.263Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I Simplify this code of Laravel 8?<p>I have this code in routes, is it possible to simplify it?
Thanks</p>
<pre><code>Route::get('/post1', function (... |
72,178,977 | Problems with python decorators returns<p>I'm having some problems with the decorators return.
I would like to create a decorator to calculate the function duration time, so I build this code to learn how to work with decorators.</p>
<p>When I use the decorator with the print method, it works, but the intention of this... | <p>Take a look at <code>timer2</code>:</p>
<pre><code>def timer2(function):
def wrapper(*args, **kwargs):
init_time = time.time()
function(*args, **kwargs) # Where does the result go?
end_time = time.time()
Answer = str(f'The function {function.__name__} takes {end_time - init_time}... | Problems with python decorators returns | python|decorator | -2 | 85 | 2 | 72,179,311 | 72,179,311 | 0 | true | 2022-05-09T22:51:43.443Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Problems with python decorators returns<p>I'm having some problems with the decorators return.
I would like to create a decorator to calculate the function d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.