input_text_instruct
stringlengths
288
45.8k
output_text
stringlengths
37
33.2k
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does this Flexbox-based layout require extra markup?<p>I'm getting into Flexbox now, trying to see how I can transition from using the traditional CSS grids....
<p>The answer is simple: <strong>Yes</strong>, that extra wrapper is required.</p> <p>I was able to find this article in Smashing Magazine from 2011 By <strong><a href="http://www.smashingmagazine.com/author/richard-shepherd/" rel="nofollow noreferrer">Richard Shepherd</a></strong> where confirms that sometimes an extr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Japanese characters cannot be seen in Spring Batch Admin UI<p>Japanese characters cannot be seen in Spring Batch Admin UI.<br> My code is as the following: ...
<p>When I set the <code>UTF-8 encoding</code> in freemarker template, Japanese character can be shown in Spring Batch Admin UI.<br> There are 2 ways to solve the problem: </p> <ol> <li>Using SpringBatchAdmin 1.2.2 and above because I found that the problem had already fixed on SpringBatchAdmin 1.2.2. </li> <li>Overr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: child_process spawn Race condition possibility in nodejs<p>I'm starting to learn and use node and I like it but I'm not really sure how certain features work...
<p>It is not a race condition. Node.js is single threaded and handles events on a first come first serve basis. New events are put at the end of the event loop. Node will execute your code in a synchronous manner, part of which will involve setting up event emitters. When these event emitters emit events, they will be ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel - calling method without user request<p>I have my own library class which is designed for gathering data from external web sites (uses curl). This cl...
<p>Your best bet is probably to create an artisan command. This gives you access to to run your code within the Laravel framework from the command line (or cron job).</p> <p>All the information you need for creating an artisan command can be found <a href="http://laravel.com/docs/4.2/commands" rel="nofollow">here</a>....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Visual Studio 2017 Debugger Not Working - Attach to Process appears<p>I'm a new learner of C++ and just downloaded Visual Studio 2017 last week. </p> <p>I'm...
<blockquote> <p>I tried running the same code in Visual Studio Code and it debugged like normal but I need the 2017 version for a class.</p> </blockquote> <p>First, please check whether you have opened a solution or a project rather than a <code>cpp</code> file. In general, all the debug configuration info are sto...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to clear validation errors for mat error after submitting the form<p>i am not able to clear validation errors for mat error after submitting the form. i ...
<p>You don´t need <code>ngForm</code>. You can simple set the errors of your control to <code>null</code>.</p> <pre><code>onSubmitchngPwd() { this.changepwdform.get("currentpassword").setErrors(null); // set errors to null } </code></pre> <p>Example: <a href="https://stackblitz.com/edit/angular-en6coj" rel="nofo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android camera2 api and exif<p>I am experimenting with the <code>camera2 api</code> and I have made an app that can take an a photo from the camera. Now I wa...
<p>What image format you try to capture? If JPEG, then all Exif tags are should be already written in image. The result image is delivered in OnImageAvailableListener.onImageAvailable(), not in CameraCaptureSession. onCaptureCompleted(). Try to add your custom tags in onImageAvailable method.</p> <blockquote> <p>EDI...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: TypeError: 'car' is an invalid keyword argument for print()<p>I don't understand the error. Here is the code,</p> <pre><code>car = 'mercedes' print("Is car ...
<p>if you want to check for equality then use == instead of =</p> <p>print(car <strong>==</strong> 'mercedes')</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Vue.js project compiling errors<p>I got a vue.js project from my friend. So I tried to run it on my local. But I was not able to do it. I got errors. I don't...
<p>Well your friend didn't use Eslint or he just ignored it. You can ignore it too.</p> <p>Go to your root directory of your app. There should be an <code>vue.config.js</code> file, if there isnt any file make one.</p> <p>To deactivate eslint write in:</p> <pre><code> module.exports = { lintOnSave: false } </co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Haskell - how do I strip trailing spaces<p>I want to convert [1,2,3] to "1 2 3". at the moment I get "1 2 3 ". I import strip function using</p> <pre><code>...
<p>You probably want to use <code>Data.Text.unwords</code> instead of all that. Or, if you're using <code>String</code> instead of <code>Text</code>, <code>Data.List.unwords</code>.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how can i use \d in php pdo to print the tables out of a database in progress?<p>\d from textarea</p> <pre><code>$stmt = $conn-&gt;prepare($mytextarea); ...
<pre><code>SELECT tablename FROM pg_catalog.pg_tables where tableowner ='username' </code></pre> <p>I found the answer, thanks.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Configure gradle distribution task<p>I am using the <code>application</code> plugin and would like to do something like this:</p> <p><strong>build.gradle</s...
<p>It seems that it's possible but You need to exchange variables via <code>project</code> instance. Try:</p> <p><strong>common.gradle</strong></p> <pre><code>apply plugin: 'application' project.ext.folder1Files = [] distributions { main { contents { into ("folder1") { from(folder1Files) } } } } <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Groupby and compute ratio in pandas<p>I have the following code to compute the conversion rate by age (the conversion column has two values 1 representing co...
<p>There's no need to actually perform the <code>groupby</code> many more times once it has been defined. I would use <code>div</code> instead of the operator <code>/</code> for series/df divisions. I would change the last two lines and obtain the same results:</p> <pre><code>conversion_by_age['rate'] = conversion_by_...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Django 1.7 error NoReverseMatch at '/post/'<p>i am newbie in django. I was encountered below error message exception value.</p> <pre><code>Reverse for 'cate...
<p>Have a look at your variable names, you are using <code>cat</code> to get the title and <code>category</code> to get the pk. Maybe <code>category</code> is undefined? This will result in an empty string inserted in the url tag and would lead to the received error message.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SocketIO Disconnect Leaving Socket Listening<p>I am attempting to use SocketIO combined with Redis Pub/Sub to monitor events in my application. So far, I hav...
<p>The problem was caused by the location of my <code>redis.on 'message'</code> listener. I was listenting for that on each and every socket that I created. In reality, I only needed to listen for it in a global sense and <em>then</em> message any rooms. This looks like this:</p> <pre><code>io.on 'connection', (socket...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Real Time chart performance issue c# winform<p>I am currently using liveChart to plot a real time graph of 3 values: a position, a load and a deformation. Th...
<blockquote> <p>In MainForm.cs, there is an event that is triggered everytime the sensor records a new value (every millisecond or so).</p> </blockquote> <p>That is natturally way higher then what Winforms Drawing can take. See, drawing a GUI is expensive. If you only do it once per user-triggered event, you will ne...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a tool to check supported devices before uploading to Google Play?<p>When you upload you apk to Google Play, you get a list of devices that are supp...
<p>I hope it will help you, using this command you can see support screens, permissions, version etc Run this command in cmd:</p> <blockquote> <p>aapt dump badging myapp.apk</p> </blockquote>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MQTT broker for Android<p>Does anyone know of an MQTT broker that runs on an Android smartphone? I tried to Google and found nothing, and on the app store th...
<p>Add these dependencies to the gradle </p> <pre><code> dependencies{ compile 'io.moquette:moquette-netty-parser:0.8.1' compile 'io.moquette:moquette-broker:0.8.1' compile 'io.moquette:moquette-parser-commons:0.8.1' } </code></pre> <p>And use </p> <pre><code>io.moquette.server.Server server = new io.m...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: BST total depth complication<p>Here is an excerpt of a working BST:</p> <pre><code>class BinaryTree(): def __init__(self,rootid): self.left = Non...
<p>Your recursive function <code>depth</code> needs a break condition:</p> <pre><code>def depth(tree): if tree == None: return 0 else: return 1 + max(depth(tree.getLeftChild()), depth(tree.getRightChild())) </code></pre> <p>And you forgot a <code>max</code> around the depths of the subtrees.</...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to put Stop and Reset button in html and javascript<p>I need help, How to put <strong>Stop</strong> and <strong>Reset</strong> button in html and javasc...
<p>javascript</p> <p>changes<br> 1.taken window variables t1,t2 where the timers are going to be assigned<br> 2.added a button(name:reset),which on click calls doReset function<br> 3.added doStuff function</p> <pre><code>window.t1=null; window.t2=null; function do_countdown() { var start_num = document.g...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: snowflake query still running after byte scanned is 100<p>This might be more of snowflake knowledge question rather than issue. I am running a copy command f...
<p>Sounds like you're referring to the 100% in the Bytes Scanned column of the query profile. If you have transformations in your COPY INTO command this will take additional time to process. As others have mentioned, the size of the warehouse will have an impact as the warehouse size will determine the number of cores ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I route in Flask based on the domain of the requested URL?<p>I'm trying to implement routing based on the host of the requested URL for a Flask site I...
<p>One way of debugging these situations is to just jump into a console and play with the underlying functions:</p> <pre><code>&gt;&gt;&gt; from werkzeug.routing import Map, Rule &gt;&gt;&gt; m = Map([Rule('/', endpoint='endpoint', host='&lt;host&gt;.example.com:&lt;port&gt;')], host_matching=True) &gt;&gt;&gt; c = m...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Angularjs and ecommerce: compatible?<p>As <a href="https://docs.angularjs.org/guide/ie" rel="nofollow">Angular 1.3 has dropped support for ie8</a> (and below...
<p>Depends on who your customers are, where they're from etc.</p> <p>For example, according to these statistics:</p> <p><a href="http://gs.statcounter.com/#browser_version-eu-monthly-201401-201501" rel="nofollow">http://gs.statcounter.com/#browser_version-eu-monthly-201401-201501</a></p> <p>IE8 usage in Europe is at...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Value of type 'UIView' has no member 'constant'<pre><code>@objc func handleKeyboardDidShow (notification: NSNotification) { let keyboardRectAsObject = n...
<blockquote> <p><code>self.changePassView.constant = -1 * keyboardRect.height/2</code></p> </blockquote> <p>You're getting the error because you're trying to access a property called <code>constant</code> in <code>self.changePassView</code>, which is apparently a <code>UIView</code>. It looks like you're trying to c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Xcode/Interface Builder is ignoring the Fill Color setting<p>I added an NSBox to my view, I set the fill color to the color I want:</p> <p><img src="https:/...
<p>From the <code>NSBox</code> <a href="https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSBox_Class/#//apple_ref/occ/instm/NSBox/setFillColor:">documentation</a>:</p> <blockquote> <p><strong>Special Considerations</strong></p> <p>Functional only when the receiver’s b...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can bracket notation be used to compress/obfuscate JavaScript?<p>This is mainly for academic reasons, but I'm curious as to whether there is anything wrong w...
<p>It does indeed cause JIT issues on some engines. A <a href="http://jsperf.com/simple-dot-vs-brackets" rel="nofollow noreferrer">much simpler benchmark</a> that doesn't conflate a dozen things demonstrates this (below). So you <em>can</em> do it, but you have to accept the performance cost, which is significant on so...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Making a button group act like radiobuttons with Bootstrap<p>Hopefully can someone help me with this one, I can't figure it out.</p> <p>I have 3 buttons in ...
<pre><code>$('.btn').click(function(){ $('.btn').removeClass('active'); $(this).addClass('active'); }); </code></pre> <p>and then select <code>clicked</code> by</p> <pre><code> $(".btn.active") </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change date range in javascript<p>I am trying to set start and end date in date picker where start date is week before current date and end date is week afte...
<p>Have you tried this:</p> <pre><code>var dt = new Date(); var weekBefore = dt.setDate(dt.getDate() - 7); var weekAfter = dt.setDate(dt.getDate() + 7); </code></pre> <p>JavaScript will figure it out automatically the date 7 days before and after!</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python 3 regex multiple substitution in a file<p>I am trying to use regex to substitute the found number in a file to a word instead. Example: "1" to "One". ...
<p><code>re.sub</code> does not change the string in-place, but it returns substituted string. Chain the return value of each substitution with next substitution to get what you want:</p> <pre><code>import re def convertEnglish(filename): with open(filename) as f: for line in f: line = re.sub(...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Adding repackage goal leads to "Error creating bean with name 'entityManagerFactory'"<p>I'm working on dockerizing a Spring Boot app and I'm running into som...
<p>After troubleshooting and narrowing things down, I found the issue. It was a filtering flag in the maven war plugin.</p> <p>Removing the <code>&lt;filtering /&gt;</code> here got everything up and running</p> <pre class="lang-xml prettyprint-override"><code>&lt;resource&gt; &lt;directory&gt;.&lt;/directory&gt; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Move some items to the end of the array if they fulfill a specific condition<p>I have an array of paths that I would like to sort ...</p> <pre><code>Array (...
<p>you can use <code>unset</code> and append <code>[]</code>, like so</p> <pre><code>$x = array(1,2,3); $x[] = $x[1]; unset($x[1]); print_r($x); Array ( [0] =&gt; 1 [2] =&gt; 3 [3] =&gt; 2 ) </code></pre> <p>You can thus loop over the array, test each element, and flip to the end the ones that contain th...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: best way to sum many subcounts<p>What is the most efficient equivalent to <code>functools.reduce(operator.iadd, ({info.foo : info.ct} for info in infos), Cou...
<p>Straight-forward loop solution:</p> <pre><code>ctr = Counter() for info in infos: ctr[info.foo] += info.ct </code></pre> <p>Avoids the O(n<sup>2</sup>) you get by repeatedly adding counters as well as the constructions of all your little dicts and Counters.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does Bower expose download statistics for each package?<p>Given a Bower package, I want to know how often people have installed it using Bower. Is that posib...
<p>EDIT: The registry API no longer provides the number of hits per package.</p> <p>The Bower registry keeps the number of "hits" per package which is actually the number of times a GET request for this package was sent to the registry. Since the Bower registry is only providing metadata (package lookup) and the downl...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is the insert into ... where not exists costlier in performance?<p>We are using Oracle database (12c)</p> <p>A table <em>ABCD</em> has below structure with ...
<p>I assume you're asking because you call this piece of code a large number of times. Generally, which approach is faster will depend on how probable it is that the values you're inserting already exist in the table. Throwing and catching an exception is orders of magnitude slower than checking that a primary key va...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to change color of facet borders when using facet_grid<p>When using <code>facet_grid</code>, <code>ggplot2</code> divides the major categories that make ...
<p>Although a year late, I found this to be an easy fix:</p> <pre><code>ggplot(mpg, aes(cty, hwy, color = factor(year)))+ geom_point()+ facet_grid(cyl ~ drv) + theme(panel.margin=unit(.05, &quot;lines&quot;), panel.border = element_rect(color = &quot;black&quot;, fill = NA, size = 1), strip.back...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: filling a matrix using recursion<p>As a practice for recursion i was trying to fill a 2-D array using recursion For simplicity i took the value to be inserte...
<p>Try running through it on paper from the first call, </p> <pre><code>fill(2,2) </code></pre> <p>This will fill the 22 element, and trigger the </p> <pre><code>if(rowV%2==0){ fill(rowV, colV-1);rowV--;} </code></pre> <p>line, which will call</p> <pre><code>fill(2,1) </code></pre> <p>This will fill the 21 elemen...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PostgreSQL 9.3: IF NOT EXISTS<p>I want to check whether the table exists or not in the database.</p> <pre><code>IF NOT EXISTS (SELECT * from INFORMATION_SCH...
<pre><code>DO $do$ BEGIN IF NOT EXISTS (SELECT * from INFORMATION_SCHEMA.Tables WHERE Table_name = 'test') THEN RAISE INFO 'Not exists'; else RAISE INFO 'Exists'; end if; end; $do$ </code></pre> <p>You should surround your postgresql statements with block</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Checkbox inside *ngIf panel not trigger with angular<p>It seems that the checkboxes inside an *ngIf condition don't trigger the event. I tried to reproduce t...
<p>Remove <code>$event.preventDefault()</code> from your <code>click</code> handler inside <code>app-details</code>.</p> <pre><code>&lt;app-details (click)="$event.stopPropagation()" *ngIf="item.expanded" [item]="item"&gt; &lt;/app-details&gt; </code></pre> <blockquote> <p>The Event interface's <a href="https://dev...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why some of the task were not "greened" in Azure Devops CI pipelines after it successfully build?<p>I'm deploying my Angular app in azure. I'm wondering that...
<p>So they do not have anything to do with your app failing on the release side. </p> <p>They are the included system tasks that will always run in any pipeline. While they could technically fail, the probably won't. Could think of them as always having a neutral status, that doesn't matter much to you, as apposed to ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Events not triggering after appended element<p><strong>Hello</strong></p> <p>So I'm trying to make dynamically added rows and when you enter numbers into th...
<p>You have few issues in your code.</p> <p>First of all you do not have the attribute like <em>data-target</em>, <em>row_margin</em>, <em>data-sum</em> set in any of the newly appended element that you are using to find the specific element.</p> <p>You also have to use <strong><em>delegation approach</em></strong> t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Vim: matching html attribute names<p>The following syntax rules:</p> <pre><code>" #f6266e syntax match tagOperator "\v\&lt;\/?\w+\s*[^&gt;]*\&gt;" contains=...
<p>Your pattern starts with a <code>/</code> (and also escapes the second <code>/</code> as <code>\/</code>, which isn't necessary); you probably forgot to remove those when copying from the search history:</p> <pre><code>syn match tagFunction "\v\&lt;\/?\w+\s+\w+/?&gt;" contained </code></pre> <p>You can easily veri...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Google Sheets script to clear checkboxes across multiple tabs<p>I have a spreadsheet with 16 tabs. Each tab is the same format. All tabs have checkboxes in c...
<p>Never done any google sheets scripting but I see this function getSheets() that might be useful? <a href="https://developers.google.com/apps-script/reference/spreadsheet/spreadsheet#getSheets()" rel="nofollow noreferrer">https://developers.google.com/apps-script/reference/spreadsheet/spreadsheet#getSheets()</a></p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Different results from similar T-SQL queries<p>Two t-SQL (MS SQL 2017) queries:</p> <pre><code>Select 125. / -124/ 125. Select 125. / (-124)/125. </code></...
<p>The explanation is that in T-SQL, the <code>* (Multiplication)</code> and <code>/ (Division)</code> operators have higher <a href="https://docs.microsoft.com/en-us/sql/t-sql/language-elements/operator-precedence-transact-sql?view=sql-server-ver15" rel="nofollow noreferrer">precedence</a> than the <code>- (Negative)<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Disable all past dates except for the last 2 days from jquery datepicker<p>I am trying to disable all past dates from the date-picker except for the last 2 d...
<p>you can use <code>minDate</code> option for this:</p> <pre><code>$( "#datepicker" ).datepicker({ minDate: -2}); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to compare the characters in beginning of the string without including trailing numbers or characters<p>I need to find the next highest number, minus the...
<p>You can use <a href="https://dev.mysql.com/doc/refman/5.6/en/regexp.html#operator_regexp" rel="nofollow noreferrer">the <code>REGEXP</code> operator</a>, which is available in MySQL 5.6:</p> <pre><code>where code regexp '^CR[0-9]+$' </code></pre> <p>Regex breakdown:</p> <pre><code>^ beginning of the string...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I can't type "(" (left parenthesis) anymore in the editor in Eclipse<p>I've been using Pydev/Eclipse in Linux for days, but after installing some new softwar...
<p>From the first screen-shot we can see that multiple commands were assigned to Shift + 8.</p> <p>Try these:</p> <ul> <li><p>Go to <code>Windows &gt; Preferences &gt; General &gt; Keys</code> in the search bar type Shift + 8 try to unbind this command or at least change the context of the command in <strong>When</st...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: jq Filter on sub object value<p>I have a json file people.json:</p> <pre><code>{ "Joe" : {"Job" : "Clown", "Age" : 22}, "Sally" : {"Job" : "Programmer",...
<p>use <code>with_entries</code> to convert to/from an intermediate format that represents that data as an array of objects with <code>key</code> and <code>value</code> elements:</p> <pre><code>cat people.json | jq 'with_entries(select(.value.Job == "Clown"))' </code></pre> <p>as per the docs here: <a href="http://st...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to take multiple slices of a line from a file in python?<p>Is there a way in python to specify multiple slices to read certain columns from a csv file?</...
<p>You're on the right track...</p> <pre><code>for line in fileObj: splitline = line.rstrip().split(',') date, name, time, data1 = splitline[0:4] data2, data3 = splitline[18:20] </code></pre> <p>or if you wanted to combine 2 lines:</p> <pre><code>for line in fileObj: splitline = line.rstrip().split(...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Use properties as an input variable prefix in a logic controller (i.e. foreach)<p>In JMeter I am exporting a list of properties from one thread group to anot...
<p>Indeed, looking into <a href="http://svn.apache.org/repos/asf/jmeter/trunk/src/components/org/apache/jmeter/control/ForeachController.java" rel="nofollow">ForEach Controller source</a> it appears that ForEach Controller is looking only in JMeter Variables. </p> <pre><code>final JMeterVariables variables = context.g...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PHP DOMDocument suddenly object of different class<p>I'm trying to return the root element of a DOMDocument (<code>$doc-&gt;documentElement</code>) and then ...
<p>This is a bug in the ext/dom GC. You always need a valid reference to your document object. If not the object can change its class to <code>\DOMDocument</code> or get removed from the memory completely. </p> <p>You create the document inside the function and return only the document element node, not the document. ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert Uint8List to String with Dart<p>cipher.process returns an Uint8List which is a list of unsigned integers (0-255). I need to convert this Uint8List to...
<p>I guess this should do it:</p> <pre class="lang-dart prettyprint-override"><code>String s = new String.fromCharCodes(inputAsUint8List); var outputAsUint8List = new Uint8List.fromList(s.codeUnits); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Problem in testing with withConsecutive()<p>I have a class FillUserPaymentStatisticService with methods:</p> <pre><code>public function fillStatisticForAllT...
<p>The main issue here is that your variables are mutable <a href="https://www.php.net/manual/en/language.oop5.references.php" rel="nofollow noreferrer">objects (passed by a reference)</a>.</p> <p>Also, mock assertions are being checked after a test and some of your variables have changed.</p> <p><strong>FIX:</strong...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to wait for a speech synthesis to complete<p>I'm writing a WP8.1 app, and am trying to output a voice in the following way:</p> <pre><code>using (Speech...
<p>The MediaElement has a MediaEnded event. You can use TaskCompletionSource to await it:</p> <pre><code>var tsc = new TaskCompletionSource&lt;bool&gt;(); mediaElement.MediaEnded += (o, e) =&gt; { tsc.TrySetResult(true); } mediaElement.Play(); await tsc.Task; </code></pre> <p>(Please double check if the event get's ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: select * for xml path is omitting columns<p><code>select * from ViewWhatever for xml path ('node')</code> returns a well-formed xml document, but wherever th...
<p>You need to use ELEMENTS XSINIL; <a href="http://go4answers.webhost4life.com/Example/including-null-columns-empty-elements-125474.aspx" rel="nofollow noreferrer">You can see how to do that here</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why doesn't java.lang.Integer extend java.lang.Long?<p>It is possible to assign an integer value into a long variable. It is possible to autobox an integer v...
<p>A <code>Long</code> contains a <code>long</code> member (<code>value</code>) that contains the value of that <code>Long</code>. </p> <p>If <code>Integer</code> was a sub-class of <code>Long</code>, <code>Integer</code> would either use that <code>long</code> member of the base class, which is wasteful (since <code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MongoDb in a container seed with multiple collections<p>I'm trying to feed my mongo running in a container with existing collections living outside the conta...
<p>I found a solution for that.</p> <p>Also the answer shows how to configure network so the webapp can see the mongodb container.</p> <p>Structure of files:</p> <pre><code>Web.Application . +-- docker_compose.yml +-- mongo | +-- dump | +-- DatabaseDb | +-- Dockerfile | +-- restore.sh...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ASP.NET: Bold parts of text using HtmlGenericControl<p>I am a complete ASP.NET newbie, so this will probably be simple. </p> <p>I have a label which text is...
<p>Try :</p> <pre><code>label.Text = string.Format(SOME-DYNAMIC-MESSAGE(ID,1), "&lt;span style=\"font-weight:bold\"&gt;" + bold + "&lt;/span&gt;", "&lt;span style=\"font-weight:bold\"&gt;" + day + "&lt;/span&gt;"); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why hibernate.cfg.xml is not being deployed?<p>I've built an javafx application using maven. The app uses hibernate to connect to a database. But when I depl...
<p>Add all the resources to the <code>src/main/resources</code>. </p> <p>By default, anything except <code>.java</code> files are ignored from the <code>src/main/java</code>, by the javafx-maven-plugin.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Powershell Query users<p>I have an issue with some query parts dues to some failures in the system so basically, I have to search all AD users, and check whi...
<blockquote> <p>$users= Get-ADUser -Filter {name -like "<em>" } -Properties memberof $Groups= Get-ADGroup -Filter {name -like "</em>" } -Properties memberof Select-Object -ExpandProperty memberof | where memberof -EQ "Users" Foreach( $user in $users) {</p> <p>$grups= $user | Select-Object -ExpandProperty mem...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: composition of a derived class in a base class<p>for example. We have <code>class A</code> and its derived class; <code>class B</code>. Is it possible to ins...
<p>You have a circular dependency among your headers: <code>"CharacterPlayer.h"</code> includes <code>"Warrior.h"</code>, and <code>"Warrior.h"</code> includes <code>"CharacterPlayer.h"</code>. This cannot compile, because the "sentinel" will stop inclusion.</p> <p>The trick is to forward-declare the <code>Warrior</co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to secure connection strings used by Unit Test in TFS?<p>I have a project with unit tests in TFS 2010. My unit test need to connect to database, so it ha...
<p>Connection to production database from unit tests is not the best approach. You should have test database with the same schema. <a href="https://stackoverflow.com/questions/145131/whats-the-best-strategy-for-unit-testing-database-driven-applications">What&#39;s the best strategy for unit-testing database-driven app...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Could not launch "MyApplication" launching failed:process launch failed:timed out waiting for app to launch?<p>I am working on one universal application, whe...
<p>Clean your didFinishLaunchingWithOptions method. You should not do any time taking tasks in that method.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Subsetting / unmerging data frames in R based on a variable<p>I have two data frames in R.</p> <pre><code>one &lt;- data.frame( x = letters[1:10] , y = 1:10...
<p>One solution in base R:</p> <pre><code>#using as.character since one$x and two$x are factors in this case &gt; two[ as.character(one$x) != as.character(two$x), ] x y z 11 k 11 -0.6680130 12 l 12 -1.0501888 13 m 13 -1.0987269 14 n 14 1.0045557 15 o 15 -0.6002310 16 p 16 1.3162201 17 q 17 -0.1209575 18...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Infer the (templated) return type of operator+ and other operators<p>I'm implementing a two-dimensional vector that can take any arithmetic type for its coor...
<p>In C++, the <code>+</code> operator overload has no means of determining what its result will be assigned to. C++ simply does not work this way.</p> <p>In many cases, it is possible to devise a workaround alternative in a slightly different way. Start by having the <code>+</code> operator figure out what it's optim...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Accessing original local time from Joda DateTime object<p>I have the following JSON string that is being converted into a Joda DateTime object (Using Jackson...
<p>Ok I finally found a solution. It is not the most elegant, I would rather have registered the custom object mapper in the application context.xml but could not get that working..</p> <p>Anyway the reason that I am getting UTC back during deserialization as that is what the DateTime deserializer supplied by Jackson ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How are permissions applied to a file using set_mode?<p>If my understanding is correct, the following code should produce an executable file. However it does...
<p>Use <a href="http://doc.rust-lang.org/std/fs/struct.OpenOptions.html" rel="noreferrer"><code>OpenOptions</code></a>:</p> <pre><code>use std::fs; use std::os::unix::OpenOptionsExt; fn main() { fs::OpenOptions::new() .create(true) .write(true) .mode(0o770) .open("somefile") ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to convert a column or row matrix to a diagonal matrix in Python?<p>I have a row vector A, A = [a1 a2 a3 ..... an] and I would like to create a diagonal ...
<p>You can use <a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.diag.html" rel="noreferrer">diag</a> method:</p> <pre><code>import numpy as np a = np.array([1,2,3,4]) d = np.diag(a) # or simpler: d = np.diag([1,2,3,4]) print(d) </code></pre> <p>Results in:</p> <pre><code>[[1 0 0 0] [0 2 0 0] [0...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Code not working when deployed on hosting server but works in local<p>My code is working correctly in local but when I deployed it to hosting server I am get...
<p>I got it working ,i commented all bound field and template field and for the girdview i kept AutoGenerateColumns="True" ,so all the columns were displayed and grid view is working</p> <p>This isn't proper solution to problem but what i found out after searching on the net is that may be it is caused due to differen...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: java.text.parseException: Unparseable date : 2020-02-06T08:00:00<p>Getting parse exception when I'm applying a particular format to the date.</p> <pre><code...
<p>You didn't apply correct format to your <code>SimpleDateFormat</code>. Use </p> <pre><code>SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); </code></pre> <p>And then parse time like below:</p> <pre><code>Date d = df.parse(s); String time = new SimpleDateFormat("hh:mm a").format(d); times.setT...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: HTML 5 Canvas Event Handler Working?<p>In W3schools it written that there is "No support for event handlers".But when i append onclick to canvas its working ...
<p>Because w3school content should be taken with a grain of salt. They are correct and provides nice examples for some things, but are directly wrong on other things - and does not have a proper mechanism to tell/correct them.</p> <p>Canvas do support events both as subscriptions (using <code>addEventListener()</code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Purpose of TRAN and COMMIT in single/multiple SQL INSERT SELECT UPDATE DELETE statement<p>Can someone please explain to me in simple layman words what the SQ...
<p>Refer this question's thread. It will clear your confusion. <a href="https://stackoverflow.com/questions/12369619/using-transaction-on-a-single-update-statement">Using transaction on a single update statement</a></p> <p><strong>@Panagiotis Kanavos</strong> has pointed out and articulated perfectly. </p> <p>Just k...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to update .sln (solution) file within Visual Studio 2019<p>I am clean <code>build</code>-ing and <code>rebuild</code>-ing the project I am working with a...
<p>You have to <code>unload project</code> by right-clicking on the project.</p> <p>Once unloaded you can right-click and edit <code>project.csproj</code>.</p> <p>Update the paths that are causing the problem.</p> <p>Save and reload.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Output an array of arrays in javascript<p>I have an array of arrays, each having a series of list items, which I am logging with <code>console.log(jobsList);...
<p>Use a combination of <code>forEach</code> and <code>join</code> this way.</p> <pre><code>jobsList.forEach(function(e){ $(".container").append("&lt;ul&gt;"+e.join("")+"&lt;/ul&gt;"); }); </code></pre> <p>Where <code>container</code> is the class of parent div of <code>ul</code>. If their is no parent of <code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to set cursor position in a textarea where I last inserted the text?<p>In a <code>textarea</code> I am doing two operations - one is finding current curs...
<p>Simply use this <code>selectionEnd</code> and sum with <code>txt_to_add</code> length</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function() { // G...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: IMediatR - Generic Request Handler for generic Requests<p>I'm currently facing a problem with IMediatR IRequestHandlers and IRequest. To give a little bit of...
<blockquote> <p>MediatR didn't find the request handler to the request</p> </blockquote> <p>MediatR is just a bunch of interfaces; it is not responsible for finding the request handler—Simple Injector is.</p> <p>You are currently using the following code to register your handlers:</p> <pre class="lang-cs prettypri...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Edit specific row from table (SQL & PHP)<p>I'm working on a project in PHP and I don't know how to do something.</p> <p>I have a table with data from a Data...
<p>you can add another td like:</p> <pre><code>&lt;td&gt;&lt;a href="edit.php?id=&lt;?php echo urlencode($row['id']); ?&gt;"&gt;Name&lt;/a&gt;&lt;/td&gt; </code></pre> <p>and then create a function like:</p> <pre><code>function find_client_by_id($client_id) { global $connection; $safe_client_id = mysqli_rea...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does an empty dataframe fail an is.null() test?<p>please excuse me if my question is quite basic. I created an empty data frame by <code>df &lt;- data....
<p><code>df</code> is not NULL because it is a data frame and thus has some defined properties. For instance, it has a class. And you can get the number of rows in the data frame using <code>nrow(df)</code>, even if the result should happen to be zero. Therefore, also the number of rows is well-defined.</p> <p>As fas ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AdaBoosting with several different base estimators at once<p>I know you can AdaBoost with multiple instances of a single model (e.g., 600 Decision Trees, Bay...
<p>Since AdaBoost is decoupled from the weak classifier's implementation: Yes, you can. These architectures are called <em>hybrid ensembles</em>. However, it's not always needed as AdaBoost only requires the weak classifiers to be slightly better than random. Thus, it's often enough to have a homogenous ensemble of cla...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: printing multiple lines with two for loop<p>I have to write program to check if all the elements of the given 2nd array are positive<br> if all the elements ...
<p>The problem is you have your print statement inside the loop, so if the element you are viewing is positive, it is going to display "positive" on the screen. My suggestion, add a boolean variable already set to true, then if the element is negative, change it to false inside your loop, then return that variable. Use...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What's the R equivalent of progn in lisp?<p>In lisp there is syntax to execute several expressions in sequence within function arguments. Given R's lispy ori...
<p>In R, brackets are used to group multiple statements in a "compound statement", which appears to be the role played by <code>progn</code> in Lisp. As with <code>progn</code>, all of the component statements are evaluated, but only the value of the final statement is returned.</p> <pre><code>with(mtcars, {qqno...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to load a component in console/shell<p>In CakePHP, how do I load a component in a shell?</p> <p>To use a component in a controller, you include an array...
<p>If you are trying to access a custom XyzComponent from a shell, then you probably have commonly-useful functionality there. The right place for commonly-useful functionality (that is also accessible from shells) is in <code>/Lib/</code>.</p> <p>You can just move your old XyzComponent class from <code>/Controller/Co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Migration to MobileFirst<p>I do migration of worklight projects to mobilefirst. When I open project created in worklight version 6.2 in new mobilefirst studi...
<p>As this is likely a migration error and since you cannot provide the project's source code here, my suggestion for you is to open an IBM support ticket (PMR) and provide your source code there so that the bug could be debugged and resolved.</p> <p>Edit: a smaller project was provided in the comments to this answer....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: IIS URL rewriting has trouble with subcalls<p>I have two virtual machines. The first one (VM1) is running a web application with an URL like this:</p> <bloc...
<p>I found out that i can use the following rule (<code>redirectRest</code>) before the existing <code>rewriteAll</code> rule to redirect subcalls (VM1/rest/..).</p> <pre><code>&lt;rule name="redirectRest" stopProcessing="true"&gt; &lt;match url="/.*" /&gt; &lt;action type="Redirect" url="http://VM1/{R:0}" /&gt; &lt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Creating subplots from list of pyplot axes<p>I'd like to create a plot from a list of axes that I get from plotting functions:</p> <pre><code>import matplot...
<p>Thanks to <a href="https://stackoverflow.com/users/4124317/importanceofbeingernest">ImportanceOfBeingErnest</a> the solution could be found:</p> <pre><code>import matplotlib.pyplot as plt def func(): x = range(10) y = range(10) plt.plot(x,y) return plt.gca() fig, axs = plt.subplots(nrows=1, ncols=4...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Passing shell commands in python subprocess.Popen() with two quoted words<p>I was trying to run the next command in my python code:</p> <pre><code>iostat -d...
<ol> <li>You don't need to add additional quotes because <code>subprocess</code> will automatically add them when needed.</li> </ol> <pre><code>command = ["iostat", "-d", "7", "7", "-p", "sda", "|", "awk", "!/^Device/", "|", "awk", "!/^Linux/"] device = subprocess.Popen(command, stdout=subprocess.PIPE) devicetr = devi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Jquery transition with css<p>I'm relatively new to Jquery and I'm trying to make a mouseover transition so when you hover over the title the background image...
<p>See example below. I've used the <code>background-color</code> property for example purposes but this can easily be substituted with <code>background-image</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...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: HtmlInputCheckBox and Label for=<p>Say I have the below HTML that I want to generate from the code behind in a C# WebForms application. How do I create the l...
<p>OK, you can add a label to the container and set the for= via the controls Attributes collection as below.</p> <pre><code>private static HtmlGenericControl CreateHtmlInputCheckBoxControl(Filters filter) { HtmlGenericControl column = CreateColumn(filter); column.Controls.Add(new HtmlInputCheckBox { ID = stri...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I need to append a list from these nested functions in Express but the items will not store<p>I am dealing with three nested functions and the last one is no...
<p>You're dealing with asynchronous handling, so you'll have to track how many results you're supposed to get, and only do "what needs to be done with all image urls" once you actually have all of those:</p> <pre class="lang-js prettyprint-override"><code>const globalImageList = []; app.get(`/api/getList`, (req, res) ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: match multiple numbers in sql and get count of all matches in rows<p>I have 3 rows in sql:</p> <pre><code>sno ids 1. 5,6,7 2. 6,8 3. ...
<p>While I'd highly recommend normalizing your database (i.e. not storing comma delimited strings in a colum), here's one option using <code>case</code> and <code>find_in_set</code>:</p> <pre><code>select sno, case when find_in_set(5, ids) then 1 else 0 end + case when find_in_set(6, ids) then 1 else 0 end + ca...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Parse Json in Javascript - Google Tag Manager<p>I do have that script:</p> <pre><code>function() { var publishedDate = ""; var yoastInfo = JSON.parse(do...
<p>Given JSON :</p> <pre><code>{ "@context": "https://schema.org", "@graph": [ { "@type": "WebPage", "@id": "id234234", "url": "https://www.whatevver.com", "inLanguage": "de-DE", "name": "this is the name", "isPartOf": { "@id": "id234234" // MAKE IT AS A STRING ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Syntax Error in in a python program with a displayed menu<p>I am learning Python for the first time. I have a syntax error and I can not figure out if I have...
<p>You cannot have a function name which contains a space , replace it with an underscore <code>_</code> , it should work.</p> <p>See Python <a href="https://www.python.org/dev/peps/pep-0008/" rel="nofollow">PEP 8</a>. The rules for naming variables have to followed strictly.</p> <p><strong><em>1)</em></strong> Funct...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I store validation errors related to image upload as flash massages in this Codeigniter 3 application?<p>I am working on a basic <strong>blog applica...
<p>In edit-post.php you have to change: </p> <pre><code>&lt;?php if ($this-&gt;session-&gt;flashdata('upload_errors')) { ?&gt; </code></pre> <p>With:</p> <pre><code>&lt;?php if ($upload_errors = $this-&gt;session-&gt;flashdata('upload_errors')) { ?&gt; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel multi profile types<p>I have two members type it's player and venue how i can better create tables? Maybe players with <code>user_id</code> or merge ...
<p>You may create new migration, using the <code>migrate:make</code> command on the Artisan CLI. Use a specific name to avoid clashing with existing models</p> <pre><code>php artisan make:migration add_type_to_users_table --table=users </code></pre> <p>You then need to use the Schema::table() method (as you're access...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Return give me always true<p>Guys i have this code:</p> <pre><code>class Test { public function __construct($valore) { if ($valore != TRUE ) { ...
<p>It's always true because the $test object is always NOT false, it's an object. The return value of the constructor isn't what you're testing.</p> <pre><code>class Test { var $valore; public function __construct($valore) { if ($valore != TRUE ) { $this-&gt;valore = false; } else { $this-&gt;...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add images in steps using primeNG for Angular8?<p>I have tried</p> <pre><code>import {StepsModule} from 'primeng/steps'; import {MenuItem} from 'prim...
<p>Looking at the documentation, it is currently not possible to include the images / icon in the steps component. </p> <p>However, you can achieve it in a different way ( bit of hacky way!! ) </p> <p><strong>Step 1:</strong> Make sure you have the proper image files <code>.svg or .png</code> in your assets folder. Y...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to create ribbon like windows 8 explorer in windows form application<p>i am beginner for win-forms and i was searching on Google last 2 days . i want tha...
<p>There are many commercial ribbon controls for WinForms out there for example from DevExpress, Janusys.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MathNet.Symbolics Algebraic.Expand in descending order?<p>With <code>MathNet.Symbolics</code> library, I try to print a polynomial with a descending power or...
<p>You can have Latex output with the corresponding format provider:</p> <pre><code>Console.WriteLine("LaTeX.Format: " + LaTeX.Format(expanded)); </code></pre> <p>The best I can get is to use <code>Summands</code> to get them and the reverse the list. Sadly the <code>+</code> sign is lost in the process:</p> <pre><c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do you replace the selection in medium-editor once it's lost?<p>I am trying to add an extension that replaces the existing link functionality in <a href=...
<p>medium-editor does have support for this built in:</p> <pre><code>MediumEditor.saveSelection() // Stores the selection internally MediumEditor.restoreSelection() // Re-applies the stored selection </code></pre> <p>From within your extension, since you're setting <code>this.parent = true</code> you can access <cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to iterate a list of list for a scatter plot and create a legend of unique elements<p><strong>Background:</strong></p> <p>I have a <code>list_of_x_and_y...
<p>The reason you get a long repeated list as a legend is because you are providing each point as a separate series, as <code>matplotlib</code> does not automatically group your data based on the labels.</p> <p>A quick fix is to iterate over the list and zip together the x-values and the y-values of each series as two...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sprite sheet animation in Silverlight<p>I'm trying to animate a sprite sheet in Silverlight with C#. I have made a lot of progress, the animations are workin...
<p>I think the problem is in the image itself. I tried to draw the border of each frame with the same width and it's impossible. </p> <p>I tried 233 pixels width: <img src="https://i.stack.imgur.com/kZroV.jpg" alt="233 pixels"></p> <p>151 pixels (suggested by KooKiz) also doesn't work: <img src="https://i.stack.imgur...