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: mouse actions for SVG in HTML<p>If I embed an SVG into a HTML page, then users can click on words in the SVG (that are included as text).</p> <p>Is it possib...
<p>you can determine on which element the action was performed like this:</p> <pre><code>const svg = document.querySelectorAll(&quot;.svg &quot;); svg.addEventListener('click', e =&gt; { if(e.target.classList.contains(&quot;f53&quot;)) { ... } }); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Result based in other column using pandas aggregation<p>I'm looking for a way in pandas agg to find the value of a column, based in other column value. </p> ...
<p>Not sure if this is the best way, but it seems to work:</p> <pre><code>aggregations = {'Project':{'Number of projects':'count'}, 'Value':{'Mean':'mean', 'Max':'max', 'Min':'min', 'Project_Max': lambda x: df['Project'][x.idxma...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ampl looping, repeat until loop , syntax error<p>I just started on ampl and tried some easy algorithm basics . Why is something like this repeat until loop n...
<p>The syntax for the <code>repeat until</code> loop in AMPL is the following (see, e.g., page 262 of <a href="https://ampl.github.io/ampl-book.pdf" rel="nofollow noreferrer">https://ampl.github.io/ampl-book.pdf</a>):</p> <pre><code>param x; let x := 8; repeat until x == 0 { display x; let x := x-1; } display x...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Finding and Dropping the Negative values<p><a href="https://i.stack.imgur.com/a1Zd7.png" rel="nofollow noreferrer">Database</a></p> <p>In this database i hav...
<p>you are close with <code>df[df['Benefits'] &lt; 0]</code>. You need any of those 3 columns to have this so you can &quot;or&quot; them with <code>|</code>. But you want to drop so we put <code>~</code> beginnig to invert the condition and select others.</p> <pre><code>new = df[~((df['Benefits'] &lt; 0) | (df['Overti...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Conditional batch rename (Windows XP)<p>I have several hundred files whose names have a sequential index at the end:</p> <pre><code>recipes0001.jpg recipes0...
<p>To compare the value of the variable <code>i</code>, you need to expand it when passing it to the <code>if</code> command.</p> <pre><code>if !i! lss 1000 ( ren "%%a" "recipes0!i!.new" )^ else ( ren "%%a" "recipes!i!.new" ) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can't connect to slave with Python's modbus_tk<p>I'm currently trying to develop an application that uses the Modbus-RTU protocol, and I have to use <em>modb...
<p>Found it !</p> <p>I updated the library and set the parameters of the constructor correctly. This works fine know.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert query to KQL<p>I have an application that contains an object. It has 2 guid values, guid1 and guid2. At any given time only 1 is populated. Firstly g...
<p>The assumption is that if we have a record with a guid2 and an empty guid1, we also have a record with that guid2 and a non-empty guid1.</p> <h4>Part 1</h4> <p><strong>Create a dictionary of guid</strong><br /> We take all records that have guid1.<br /> From those records, we keep only 1 record per guid1, preferably...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add smart contract functionality in PHP?<p>I'm working on project with main theme - sales. So, for front end (React) and Backend(PHP).</p> <p>I had a...
<p>AFAIK, there is no official support for PHP yet. You have 2 options here to interact with Ethereum blockchain:</p> <ol> <li><p>Use <a href="https://github.com/ethereum/wiki/wiki/JSON-RPC" rel="nofollow noreferrer">JSON RPC</a> - using <code>curl</code> or any HTTP client library written in PHP, you can communicate w...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: vb.net html input placeholder<p>HTML Code</p> <pre><code>&lt;input placeholder="0000000000" type="text" name="msisdn" id="msisdn"&gt; </code></pre> <p>i've...
<p>Try this:</p> <pre><code>WebBrowser1.Document.GetElementById("msisdn").SetAttribute("value", TextBox1.Text) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: D3 anywhere outside graph event listener<p>Basically I have a graph where the user can click different SVG shapes and by doing so a <code>.on('click')</code>...
<p>You might be able to use something like</p> <pre><code> window.onclick = function(event){ if(!(event.target.className.baseVal=="circleClass")){ d3.selectAll('circle').style('fill', function(d) { return d.color; }) } } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Scala code execution on master of spark cluster?<p>The spark application uses some API calls which do not use spark-session. I believe when the piece of code...
<p>It depends - closures/functions passed to the built-in function <code>transform</code> or any code in udfs you create, code in forEachBatch (and maybe a few other places) will run on the workers. Other code runs on driver</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: what "balance" used for in TDengine database<p>there is a configuration parameter &quot;balance&quot; in /etc/taos/taos.cfg, the default value is 1, I am won...
<p>TDengine's data is distributed on different vnodes. After a long time, there may be uneven data distribution. At this time, this switch can be used to automatically migrate data on different vnodes to achieve balanced distribution.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel Nova many-to-many resource failing<p>I've got two resources, Bricks and Walls.</p> <p>The <code>Brick</code> model is defined as</p> <pre><code>cla...
<p>For many to many relationship, you have to had intermediate table, for example <code>brick_wall</code> in your mysql database, to establish many to many relationship between <code>brick</code> table and <code>wall</code> table. It contains column <code>brick_id</code> and <code>wall_id</code> and having foreign key ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ListSearchExtender control<p>I try to use this ajax control</p> <pre><code> &lt;ajax:ListSearchExtender ID="lseregiondrop" runat="server" TargetControlID=...
<p>You need to close <code>ScriptManager</code> tag:</p> <pre><code>&lt;asp:ScriptManager ID="ScriptManager1" runat="server" /&gt; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Save pm2 logs to USB with ssh script<p>I have ssh script (auto run from usb) to export logs to usb once it plugged in. Have no problems with all other logs. ...
<p>To export pm2 logs, copy the file <code>~/.pm2/pm2.log</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Restart Generator that Consumes a Refillable Iterator<p>I have a problem using a generator that is using a refillable iterator.</p> <p>Here is my simple gen...
<p>I'm afraid the only solution might be to create a refillable generator wrapper class. EDIT: Original untested code wasn't working. I have now refactored the idea below and tested it. </p> <p>This object will raise <code>StopIteration</code> ONCE, after which it will restart. It is intended to be used with the <code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Postgresql full standalone backup on remote host<p>I am trying to figure out what is the correct way to create a full standalone backup which will be stored ...
<p>Sure that will work. It has the advantage that you can compress the backup before sending it over the network. And if the transfer fails, you could resume it (using rsync). It has the disadvantage that it stores the full backup on the server.</p> <p>Or you could backup from the &quot;reserve&quot; host using <cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting initilized object instead of what the service sent<p>I'm using <code>POST</code> to send an obejct as a parameter to a method in a service. The metho...
<p>Okay In the WCF C# project and the Spring JAVA project I wrote different type for the same property of the Response object. Spring could not parse it so it gave me empty initilized (zero) object.</p> <p><strong>I recommend everyone to use <code>@JsonProperty("XXX")</code> for each property of the response object so...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does Neo4j browser AUTO-COMPLETE toggle exist in 3.2.0?<p>According to <a href="https://stackoverflow.com/questions/32981525">Nodes() function returns relati...
<p>Looks like it moved to the bottom of the browser settings gear and is now labeled <code>Connect result nodes</code>. It defaults to checked. If you uncheck the box it appears as though it behaves like the autocomplete slider did previously.</p> <p><a href="https://i.stack.imgur.com/mnrr9.png" rel="noreferrer"><img ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python: Custom Exceptions with a embedded error handling routine?<p>Is it a bad idea to implement my own exceptions with special error handling/logging syste...
<p>Simply put, no this is not a bad idea at all. </p> <p>In fact, the way I see it, what you're trying to do is ultimately reason why programming languages have exception handling in the first place.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: histogram of distances between multiple tables<p>following <a href="https://stackoverflow.com/questions/37787030/sequence-by-date-add-date-before-and-date-af...
<p>I think I found an answer. The following worked:</p> <pre><code>--create empty table for results and fix key create table results ( resultID serial NOT NULL, vehicle_id numeric(10,0), eventid numeric(10,0), deltaMIN interval MINUTE, distance_m32138 double precision, eventtime timestamp with...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Kafka consumer does not start from latest message<p>I want to have a Kafka Consumer which starts from the latest message in a topic.</p> <p>Here is the java...
<p>Have you run this same code before with the same <code>group.id</code>? The <code>auto.offset.reset</code> parameter is only used if there is not an existing offset already stored for your consumer. So if you've run the example previously, say two days ago, and then you run it again, it will start from the last cons...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: operations with structure in matlab<p>I have a structure 1x300 called <code>struct</code> with 3 fields but I'm using only the third field called <code>way</...
<p>Let the data be defined as</p> <pre><code>st(1).way = [491751 491750 491749 492772 493795 494819 495843 496867]; st(2).way = [491753 491754 491755 491756]; st(3).way = [492776 493800 494823 495847 496867]; % define the data sought = st(1).way(end); </code></pre> <hr> <p>If you want to know <strong>which vectors</...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can we add a new Cassandra 3.11 DC, upgrade it to 4.0, then eventually get rid of the old DC?<p>We want to upgrade from cassandra 3.11.12 to cassandra 4.0.2 ...
<p>It is a valid upgrade path but bear in mind that there could be some disadvantages with your proposed approach. For example, if a node goes down (say for a hardware failure) then you won't be able to decommission it.</p> <p>Any operation that requires streaming will not work in a mixed-version cluster. Those operati...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to read all bytes of a file in winrt with ReadBufferAsync?<p>I have an array of objects that each needs to load itself from binary file data. I create an...
<pre><code> #include &lt;wrl.h&gt; #include &lt;robuffer.h&gt; uint8_t* GetBufferData(winrt::Windows::Storage::Streams::IBuffer&amp; buffer) { ::IUnknown* unknown = winrt::get_unknown(buffer); ::Microsoft::WRL::ComPtr&lt;::Windows::Storage::Streams::IBufferByteAccess&gt; bufferByteAcce...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Generate choose on custom data type with 2 options<p>I am trying to achieve something very simple. I have this data type :</p> <pre><code>import Test.QuickC...
<p><code>choose</code> has type <code>Random a =&gt; (a, a) -&gt; Gen a</code>, so <code>choose (G, B)</code> requires a <code>Random</code> instance for your <code>Letter</code> type. If you want to create a generator from a set of values you can use <code>elements</code> instead:</p> <pre><code>arbitraryLetter :: Ge...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Spark Hadoop Failed to get broadcast<p>Running a spark-submit job and receiving a "Failed to get broadcast_58_piece0..." error. I'm really not sure what I'm...
<p>For anyone coming across this, it turns out the model I was loading was malformed. I found out by using spark-shell in yarn-client mode and stepping through the code. When I tried to load the model it was fine, but running it against the datagram (model.transform) through errors about not finding a metadata direct...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Recursively enter nested object into tree view component inside return statement of a React functional component<p>I have a hierarchical object. Looks like t...
<p>you can do something like this</p> <pre><code>const renderTree = tree =&gt; { return &lt;TreeItem key={tree.id} nodeId={tree.id} label={tree.id}&gt; {tree.children &amp;&amp; tree.children.map(renderTree)} &lt;/TreeItem&gt; } return ( &lt;TreeView aria-label=&quot;file system navigat...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: plot variable position in dodged bar chart<p>I have a dodged bar chart generated from the mtcars dataset showing a histogram of gear vs cyl. I'd like to mark...
<p>You could try using <code>position_nudge</code> in this particular case, although it is a bit of a hack:</p> <pre><code>(ggplot(data=cars)+ aes(x=cyl,y=count,fill=gear) + geom_bar( position = &quot;dodge&quot;, stat=&quot;identity&quot;)+ geom_point(data=Hornet,size=5, position = position_nudge(-0.25))+ ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using custom component for data in Ionic 2<p>So I have a custom component that looks something like this:</p> <p><strong>student.ts</strong></p> <pre><code...
<p>What you should do it create the object array in your <code>page.ts</code> with an initial status value. Then pass the student object to the student component like this:</p> <pre><code>&lt;ion-list&gt; &lt;student *ngFor="let student of studentArray" [student]="student"&gt;&lt;/student&gt; &lt;/ion-list&...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can we have exactly-once-processing with Spring kafka?<p>I am trying to have exactly-once consuming of Kafka Consumer.<br /> My requirement is of:</p> <ol> <...
<p>Yes; Spring for Apache Kafka supports exactly once semantics in the same way as Kafka Streams.</p> <p>See</p> <p><a href="https://docs.spring.io/spring-kafka/docs/current/reference/html/#exactly-once" rel="nofollow noreferrer">https://docs.spring.io/spring-kafka/docs/current/reference/html/#exactly-once</a></p> <p>a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add dynamically QML Page on SwipeView QML<p>i need to add dynamically pages on swipeview. So my code: </p> <pre><code> SwipeView { id: viewSwipe ...
<p>RecipesPhase is a component not an Item, a component is analogous to a class and an Item to an object, so the idea is to create the item dynamically. For example, I will consider that RecipesPhase is the following component:</p> <p><strong>RecipesPhase.qml</strong></p> <pre><code>import QtQuick 2.0 Rectangle { ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I make GSAP find the "most optimal" rotation method?<p>I want my mesh to rotate at 90 degree angles in all directions, but make GSAP find the most &qu...
<p>So the main issue here is that regular (Euler) rotation angles don't interpolate well when they have to cross zero.</p> <p>Quaternions to the rescue!</p> <p>I know, I know, quaternions are hard to understand. But no worries, just call on the quaternion helper methods to do the heavy lifting :-). Once you convert all...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I show GET parameters as a new directory?<p>I am currently working on a website where <strong>pupils can create articles that can be commented by oth...
<p>Maybe you can do something like this with <code>.htaccess</code> file.<br/> You can redirect every page to your <code>index.php</code>page</p> <pre><code>&lt;IfModule mod_rewrite.c&gt; RewriteEngine On DirectoryIndex index.php RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FI...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Logging in with FireBase facebook authentication, getCurrentUser() keeps returning null<p>I am struggling right now to pass on the CurrentUser when I am logg...
<p>Okay I fixed my problem.</p> <p>So I tried to add the currentUser to actually be apart of my updateUi() method. Then it seemed my problem was, that I updated the UI in my facebookCallback(), which seemed to change the activity before actually handling the login.</p> <p>So now my code looks the following:</p> <pre...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to select part of a string value that comes before a space<p>I have a field that contains a string value but there are spaces inside the string. This val...
<p>Try <a href="https://dev.mysql.com/doc/refman/5.7/en/string-functions.html#function_substring-index" rel="nofollow noreferrer">SUBSTRING_INDEX</a>:</p> <pre class="lang-sql prettyprint-override"><code>SELECT SUBSTRING_INDEX(`f`, SPACE(1), 1) FROM `t`; </code></pre> <p>See <a href="https://dbfiddle.uk/?rdbms=mysql_...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CUDA kernel fails to launch after making simple code changes inside the kernel<p>I have a templated CUDA kernel for calculating and setting values at the int...
<p>Right, seems I found the answer to my problem.</p> <p>Looking at the generated errors I get "Too many resources requested for launch".</p> <p>I've reduced the number of threads per block from 512 to 256 and the kernel runs fine now.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to aggregate by month given start date and end date?<p>I have a table <code>my_table</code> that resembles:</p> <pre><code>id start_date end_date ...
<p>You can try to <code>JOIN</code> on date range, using <code>BETWEEN</code>, but your DateTime isn't a valid format, we need to use <code>STR_TO_DATE</code> function converts the string to DateTime then compare</p> <p><strong>Query 1</strong>:</p> <pre><code> SELECT t2.date_value,COUNT(*) num_people FROM my_ta...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: To Show/Hide <div> tag depending on the selection from previous drop down box<p>I have read many tutorials and many answers on stack overflow as well but it ...
<p>Your selector is not right, please make sure that you bind event on dropdown so add a class on dropdown</p> <pre><code>@Html.DropDownListFor(model =&gt; model.ParticipateInCAT4Scoring, listItems, &quot;&lt;----Select Yes or No----&gt;&quot;, new { @class = &quot;form-control pickerDropdown&quot; }) </code></pre> <p>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to draw 2D image with TWGL (WebGL helper Library)<p>There are dozens of examples on how draw 3d stuff with TWGL <a href="https://github.com/greggman/twgl...
<p>TWGL's only point is to make WebGL less verbose but WebGL basically only does 1 thing and that is <a href="http://webglfundamentals.org/webgl/lessons/webgl-how-it-works.html" rel="nofollow noreferrer">draw stuff with shaders you provide</a>. So you really can't do anything in TWGL without shaders just like you can't...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Idiomatic sync of concurrent activities ('map-reduce') in node?<p><strong>EDIT</strong></p> <p>Thanks to answers, I have a working version. Code at end of ...
<pre><code>fs.stat(fname1, function doneReading(err, stats) { ... fs.stat(fname2, function doneReading(err, stats) { ... </code></pre> <p>is still sequential and not parallel, the difference from <code>fs.statSync</code> is that it <code>fs.stat</code> is non-blocking.</p> <p>The suggested 'readable' appr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to find out the right syntax in MariaDB Error Based SQL Injection?<p>I am trying to inject SQL statements into a Box. I have the following injection poi...
<p>Given that when you tried <code>1'</code> the query included <code>'1''</code> it seems that the original query is something like this:</p> <pre><code>... '5' or dest like '$o') LIMIT 10 </code></pre> <p>e.g.</p> <pre><code>SELECT * FROM table WHERE (category = '5' or dest like '$o') LIMIT 10 </code></pre> <p>To...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Generator is limiting<p>It runs, the TK design is fine but the generated code is limited to one type. What it currently does when it runs is pops up a window...
<p>try this</p> <pre class="lang-py prettyprint-override"><code> password = password + random.choice(symbols + upper + lower) </code></pre> <p>OR</p> <pre class="lang-py prettyprint-override"><code>password += random.choice(symbols + upper + lower) </code></pre> <p>HERE IS YOU FULL CODE&gt; I am writing a comment where...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using Google Direcory API with SSH Tunnel<p><strong>Error:</strong></p> <p>com.google.api.client.auth.oauth2.TokenResponseException: 400 Bad Request { "erro...
<p>You will need to overwrite the "<strong>tokenServerEncodedUrl</strong>" parameter value in the GoogleCredential object, and "<strong>rootUrl</strong>" parameter value in the Directory object for using your non-standard SSH Tunnel Ports for GoogleAPI client communication.</p> <p>Use the following code snippet to ach...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Attempt of fit a Gaussian distribution: Error scipy/optimize/minpack.py", line 765, in curve_fit raise ValueError("`sigma` has incorrect shape.")<p>I have a ...
<p>There are two problems with the OP.</p> <p>First problem is that the code tries to fit the random samples with a normal distribution. This is wrong. One can fit the output of the histogram, though. This is shown in the code below. Better would be the use of <code>scipy.stats.norm.fit()</code> which allows to fit the...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: After searching on a name from db how I can get the searched name listed using python Django<p>I do search for user name from DB, now I want when I select an...
<p>You can make a new div using condition on data_list. And iterate over that data_list if it has values. <a href="https://docs.djangoproject.com/en/4.0/ref/templates/builtins/#for" rel="nofollow noreferrer">here</a> is the django docs for it</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: More concise jq code to get each value from file and place in another<p>My goal is to get each value of a group of keypairs, and insert each into another fil...
<p>For clarity, let's first define a jq helper function for modifying the key/value pairs:</p> <pre><code>def munge: {ParameterKey: .OutputKey, ParameterValue: .OutputValue}; </code></pre> <p>Let's also assume that the contents of vpc.json is available as the jq variable $vpc -- this can be accomplished (for example...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do i select a whole row based on the highest value of a column<p>Im trying to print the whole row with the highest number of casualties in this data. Cur...
<pre><code>print(df.loc[df['Number_of_Casualties'] == df['Number_of_Casualties'].max()]) Accident_Index Number_of_Casualties LSOA_of_Accident_Location 1 1 52 E01003117 </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Wrap everything between two tag occurrences with XSLT 1.0<p>I want to split an XML (actually, XHTML) document in sections by the top-level <code>h1</code> ta...
<blockquote> <p>as I understand it, Muenchian grouping is not a trick that would work for me.</p> </blockquote> <p>Well, something very close to it will:</p> <p><strong>XSLT 1.0</strong></p> <pre><code>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; &lt;xsl:output method="xm...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create download link<p><strong>file.php</strong></p> <pre><code>&lt;a href="download.php?filename=&lt;?php echo $basename; ?&gt;"&gt;&amp;nbsp;&amp;nbsp;&lt...
<p>You should get the mime type from <code>$file</code> (with entire path) not by just <code>$filename</code>:</p> <pre><code>$file = 'C:xampp/htdocs/project/user/'.$folder.'/'.$file_name; if (file_exists($file)) { header('Content-Type: ' . mime_content_type($file)); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: error when installing smartsheet-python-sdk on mac<p>I'm getting the following error when installing the smartsheet-python-sdk package on my Mac. Can anyone ...
<p>I found this post that refers to a known issue with python package dependencies on OS X 10.11 and to work around it using the '--ignore-installed' flag on the pip command and it worked!</p> <p><a href="https://github.com/donnemartin/haxor-news/issues/54" rel="nofollow noreferrer">link to solution post</a></p> <pre...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Highlight DataGrid Row if Cell Equals X<p>I am using an asp:DataGrid bound to a DataSet which is filled by my SQLDataAdapter. Before the asp:DataGrid is disp...
<p><em>Edit:</em> I just noticed you are using a DataGrid, not a GridView. I would recommend changing it to a GridView before following my example.</p> <p>Use the OnRowDataBound event for your gridview. </p> <p>So, as each row is generated in your gridview, you run a check to see if the row has an amount equal to $10...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Azure AD B2C domain cookie<p>I have a web app which runs under service.domain.de. For authentication in this app I use Azure AD B2C. In the azure security co...
<p>When you add CookieAuthentication, you can control the domain via CookieAuthenticationOptions' <a href="https://msdn.microsoft.com/en-us/library/microsoft.owin.security.cookies.cookieauthenticationoptions.cookiedomain(v=vs.113).aspx#P:Microsoft.Owin.Security.Cookies.CookieAuthenticationOptions.CookieDomain" rel="nof...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I'd like to change the order of HTML elements inside a section<p>This is basicly how my woocommerce product looks like:</p> <pre><code>&lt;section class="mp...
<p>The behaviour you optened is normal. What you want to do is <code>insertBefore</code> in the context of each section. Use child selector and a loop.</p> <pre><code>$('.mpcth-post-content').each(function(){ $(this).find('.mpcth-post-title').insertBefore($(this).find('.mpcth-cart-wrap')); }); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to load pdf worker javascript in wordpress<p>I have to display pdf thumb in wordpress and I'm using pdfjs. I want to load worker script in javascript but...
<p>Put the script inside your theme directory in the folder where also other js already should be (to keep cleaner the code in the theme) and to retrieve it just use:</p> <p><code>get_template_directory_uri()</code></p> <p><a href="https://developer.wordpress.org/reference/functions/get_template_directory_uri/" rel="...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ListView custom items graphically incorrect<p>I have defined a custom item in XML for my ListView and I want every one of them to have five fields: three alr...
<blockquote> <p>The execution works, but graphically it's not what I was expecting. </p> </blockquote> <p>You set an attribute <code>android:layout_marginBottom="368dp"</code> for the <code>Button</code>, that's why the list item gets so huge.</p> <blockquote> <p>Moreover, the item doesn't respond to other clicks...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Set value on table if related table value in array (postgresql)<p>I have 2 tables, <code>users</code> and <code>profiles</code>. And I'd like to set <code>pr...
<p>In Postgres, you don't mention the table being updated twice:</p> <pre><code>UPDATE profiles p1 SET verified = true FROM users u1 WHERE u1.id = p1.user_id AND u1.email in ('email1', 'email2', ...) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use regex in jquery attributes?<p>I've tried to use regex to find all elements that have indexed id "modal[index]" like this </p> <pre><code>$("input...
<p>You could use <a href="http://api.jquery.com/filter/#expr" rel="nofollow noreferrer">filter function</a> of JQuery, below example should work for you. <a href="https://stackoverflow.com/a/193787/4395050">source</a></p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why PHP included element won't show in included sidebar?<p>I have site where I have global sidebar included on all pages with PHP. I'm trying to include cont...
<p>you have to use dirname function of php</p> <p>for example</p> <p>file of sidebar</p> <pre><code>include dirname(__FILE__).'/contact.php'; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to combine two MySQL queries to show results in one table row<p>I have two separate queries showing results in two tables. I want to show result in one t...
<p>You can use <strong>group_concat</strong> with <strong>group by</strong>. For mor info see <a href="http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html" rel="nofollow">group by</a> doc. I change your query and hope it work :</p> <pre><code>SELECT prodlang.id_product AS "idprod", prodlan...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is my tkinter loop not modifying variable?<p>I am a beginner and experimented with tkinter (in Python) for a project. I am trying to let a loop pack numb...
<p>You set <code>text</code> to 0 at each iteration:</p> <pre><code>from tkinter import * window = Tk() window.title(&quot;window&quot;) window.resizable(False, False) window.geometry(&quot;500x500&quot;) window.configure(background=&quot;white&quot;) i = 0 text = 0 # &lt;- MOVE HERE while i &lt; 100: label = La...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to group similar groups by colum in pandas<p>folks! </p> <p>I have dataframe like this:<br></p> <pre><code>ID | Name | Thing | belongs ---+------+-----...
<p><strong>Setup</strong></p> <pre><code>df = pd.DataFrame({'ID': {0: 1, 1: 2, 2: 3, 3: 4, 4: 5}, 'Name': {0: 'John', 1: 'Tom', 2: 'Tom', 3: 'John', 4: 'Bob'}, 'Thing': {0: 10, 1: 10, 2: 10, 3: 10, 4: 10}, 'belongs': {0: 1, 1: 2, 2: 1, 3: 2, 4: 3}}) </code></pre> <p><strong>Solution</strong></p> <pre><code>#group...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Set Value With NULL When Pivot SQL Selection Return 0 Rows<p>How to set NULL value when you select data using pivot return 0 rows?</p> <pre><code>;WITH cte ...
<p>I solved my problem by using union to show 0 when there's no data to display.</p> <pre><code>;WITH cte AS ( SELECT DATENAME(month, RPT.DateID) as Month, ISNULL(SUM(RPT.TransactionIn), 0) as ATransactionIn, ISNULL(SUM(RPT.TransactionOut), 0) as BTransactionOut, ISNULL(SUM(RPT.Outstand...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Which C-standard introduced the "__weak" keyword?<p>I would like to use <code>__weak</code> in a library I am creating, but I want to make sure it is complia...
<p><code>__weak</code> is not part of the C standard.</p> <p><code>__weak</code> is a compiler extension specific to the compiler, for example available on Keil and COSMIC compiler. <code>__attribute__</code> is a compiler extensions from gcc GNU C compiler, available for example on clang, TASKING Compiler, TI Arm Comp...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R import of stata file has problems with French accented characters<p>I have a large stata file that I think has some French accented characters that have be...
<p>Your data file is a <a href="https://www.stata.com/help.cgi?dta_113" rel="nofollow noreferrer">dta version 113</a> file (the first byte in the file is 113). That is, it's a <a href="https://www.stata.com/help.cgi?dta" rel="nofollow noreferrer">Stata 8 file</a>, and especially pre-<a href="https://www.stata.com/stata...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: GET API calls to pull PDF in R<p>This code was working perfectly fine until 2021. After a long time ran this for some other project. The cals are successful ...
<p>You are getting a 200 because the request successfully returns html. It doesn't link directly to a pdf. A little snooping in the developer tools reveals the correct url for the actual pdf:</p> <pre class="lang-r prettyprint-override"><code>url &lt;- paste0(&quot;https://public.tableau.com/views/Book3_16512272064090/...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mysql retrieve orders from last year in the same month as today<p>I have a table orders and I would like to make a request to retrieve all orders from the mo...
<p>You dont need to subtract the month. It should be <code>MONTH(NOW())</code> to get the same month results from the previous year.</p> <pre><code>SELECT COUNT(*) FROM ps_orders o WHERE YEAR(o.date_add) = YEAR(NOW() - INTERVAL 1 YEAR) AND MONTH(o.date_add) = MONTH(NOW()) -- same as current month </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Call viewmodel method after control id is generated using attr binding<p>I have to call a viewmodel method after controls id are generated dynamically attr b...
<p>The general rule is:</p> <p>Whenever you want to touch the DOM,</p> <ol> <li>Try to do as much as possible via knockout's default bindings. Most event handling can be done by using the <code>event</code> or <code>click</code> binding. Values can be linked to your viewmodel with the <code>value</code> or <code>text...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: RETAIN removalPolicy on secret stack so it doesn't get deleted on synth<p>I have a cdk stack, including a secrets stack and I'm currently trying to do a depl...
<p>This happens because it tries to update the stack with the secrets first, and then the stacks that used to import them.</p> <p>This fails because exports cannot be deleted before imports.</p> <p>The solution to removing the stack is to make it a two-step process. First, and this is the main part, we need to ensure t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to Add Login to my iOS PDF reader App?<p>So I'm trying to add a login to my existing app. My App has two Storyboards one for iPhone and another for iPad....
<p>Create a <code>UITabBarController</code> in your `AppDelegate.h' file.</p> <pre><code>@property (strong, nonatomic) UITabBarController *tabBarController; -(void)userDidLoginSuccessfully; </code></pre> <p>And then declare a public function in <code>AppDelegate.h</code> file. (Lets say userDidLoginSuccessfully is my...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Initialize array based on C++ version and compiler<p>In C++11 or higher regardless of compiler <code>int myArray[10] = { 0 };</code> would initialize to all ...
<p>All elements would be zero. Quotes from C++98:</p> <blockquote> <p>[dcl.init.aggr]</p> <p>If there are fewer initializers in the list than there are members in the aggregate, then each member not explicitly initialized shall be default-initialized (8.5)</p> <hr /> <p>[dcl.init]</p> <p>To default-initialize an object...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I test jquery call using jasmine?<p>I have the next method in angular's component:</p> <pre><code>private onTopClick() { $('body,html').animate({ ...
<p>You would need to use a couple of functions ...</p> <ul> <li><p>First, set up spy for <code>animate</code> function. Probably you would want to do this for all your tests or before each, well may be just for one test; You may also want to do after the spy intercept the call, for example <code>.and.callFake()</code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python serialize/format text complex to json object<p>have this message in request.</p> <pre><code>event= [ {'payload': { 'key': 'eyJ'...
<p>So this is an interesting question, which you can solve by counting the opening and closing curly brackets.</p> <p>Split the value string on the <code>Body=</code> part, and then with a for loop you go over the remaining characters, counting the opening and closing curly brackets. Once this counter hits zero, you kn...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AWS Detecting Elastic IP<p>I want to know the elastic ip associatied with my ec2-instance. When i remote via putty and type ifconfig it's doesn't display e...
<p>At the command line, type <code>ec2metadata</code> for ubuntu-based images. On the amazon-based images, I use <code>ec2-metadata</code> Your public ip will be among the other data displayed.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using expansion files for android wear watchfaces<p>I am working a watch face everything works is fine but the problem is apk has crossed 100 MB (80% of spac...
<p>Got the solution to this issue. But not sure whether this is possible before wear 2.0,for 2.0 when uploading the wear apk, we can upload a expansion file for wear too. We can follow the same procedure, we use for handheld expansion file.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to disable a highchart chart completely<p>I am trying to figure out how to disable a chart (pie chart, column chart, etc.) completely but I haven't been ...
<p>** updated answer **</p> <p>so just as an example, I added a button to your <a href="http://jsfiddle.net/fv5aos97/23/" rel="nofollow">jsfiddle</a> demo. </p> <p>using jQuery, you can add a toggle event like this: </p> <p><code>$('button').click(function(){ $('#pieChartSection').toggle(function(){</code></p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How many processes may be in one android app? What is max count?<p>How many processes may be in one android app? </p> <p>We can added more than one process ...
<p>According to android docs from <a href="https://developer.android.com/guide/components/fundamentals" rel="nofollow noreferrer">here</a>:</p> <blockquote> <p>By default, every app runs in its own Linux process. The Android system starts the process when any of the app's components need to be executed, and then shuts ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: grails create-plugin doesn't work<p>when i run this command <code>grails create-plugin example</code></p> <p>i am getting this error:</p> <pre><code>| Erro...
<p>I can reproduce this when I try to create a plugin inside an existing plugin.</p> <p>If you are trying to create a second plugin, you need to run <code>create-plugin</code> in a different directory that isn't an existing Grails plugin or application.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Run background thread before UITableView Segues<p>I have a UITableView that shows a list of Movies. (Movie name and ID are stored in an pre-populated array)....
<p>You're close, but a bit out of order I think. Instead of calling <code>doMovieLookup</code> in <code>shouldPerformSegueWithIdentifier:sender:</code>, try doing it in <code>tableView:didSelectRowAtIndexPath</code>. </p> <p>Then, you can call <code>performSegueWithIdentifier:sender:</code> where you make your <code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Validating is there any different menu item with capybara<p>I will try to improve the question. How to validate if a different item is included in the menu: ...
<p><code>all('select#tbm2')</code> is going to find all <code>&lt;select&gt;</code> elements with an id of <code>tbm2</code>, of which there are none in your HTML. Also <code>.value</code> gets the <code>value</code> property of an element but you have all <code>div</code> elements which don't have a value. If you wan...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why there is a difference in no. of rows when fetched from schema & phpmyadmin<p>I am using MySQL as database to one of my PHP project. It is very big databa...
<p>If this is a table under the InnoDB storage engine, an approximate row count is returned. Have a look at <a href="https://dba.stackexchange.com/questions/17926/why-doesnt-innodb-store-the-row-count">https://dba.stackexchange.com/questions/17926/why-doesnt-innodb-store-the-row-count</a>. The comments in this referenc...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Register lambda as factory (with dependencies)<p>I'm trying to migrate from <a href="https://github.com/ipjohnson/Grace" rel="nofollow noreferrer">Grace</a> ...
<p>In Autofac it's up to you to resolve the dependencies in the lambda. The registration you found is correct.</p> <p>Let's say your lambda is <code>a =&gt; new Service(a)</code> and that's the factory. I say that because the Grace example you showed would <a href="https://autofac.readthedocs.io/en/latest/resolve/relat...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Subdirectory import giving error only when module gets imported from package<p>I've this package called <a href="https://pypi.org/project/classevivaAPI/0.2.0...
<p>The <a href="https://github.com/Lioydiano/Classeviva/blob/v0.2.0-dev.4/setup.py" rel="nofollow noreferrer"><code>setup.py</code></a> file was missing the information about the submodules, I added them this way:</p> <pre><code>packages=[ 'classeviva', 'classeviva.exceptions', 'classeviva.paths', 'clas...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Replace an attribute of an instance with a property<p>I would like to override an attribute with a property, but only on one instance. Here is how I try to s...
<blockquote> <p>Can it be done?</p> </blockquote> <p>It can not.</p> <p>A property is a descriptor, and descriptors can only be declared on the class level.</p> <p>Allowing instance descriptors was <a href="https://www.python.org/dev/peps/pep-0549/" rel="noreferrer">proposed, but rejected</a>.</p> <hr> <p>If you...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: mybatis transaction rollback<p><strong>case 1:</strong></p> <pre><code>class TestService{ @Autowired private SqlSessionTemplate sqlSession; p...
<p>Most probably you transaction configuration does not treat <code>TestService.insert</code> as a transactional method so it is not executed in transaction so each invocation of <code>objectService.insert</code> runs in its own transaction. </p> <p>It means that for example the first invocation <code>objectService.in...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Authorizing with Google APIs using a service account<p>I'm trying to access some google groups from the google-api using nodeJS and a service account file. I...
<p>A 400 error is not an authorization/authentication issue, but instead is a client request issue. According to the <a href="https://developers.google.com/admin-sdk/directory/reference/rest/v1/groups/list#query-parameters" rel="nofollow noreferrer">official documentation</a>, there are some query parameters required f...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: pytest -> How to use fixture return value in test method under a class<p>I have a fixture that returns a value like this:</p> <pre><code>import pytest @pyt...
<p>There's a technique outlined in the <a href="https://pytest.org/latest/unittest.html" rel="noreferrer">py.text unittest integration documentation</a> that may be helpful to you ... using the built-in <code>request</code> fixture. Otherwise, I'm not aware of way to access the return value of a fixture without providi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Creating an array from each key in an array of objects<p>I have an array that looks similar to this: The array of objects is much larger and each object has ...
<p>You can use <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map" rel="nofollow noreferrer"><code>Array.map</code></a> to extract the property values for each item in the array.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel=...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: HTML default value fo radio button input type based on python variable<p>so im making a Flask app where a user uploads a spreadsheet and then can play with t...
<p>You need to set the variable name in <code>render_template</code> by passing it as keyword:</p> <pre class="lang-py prettyprint-override"><code>@app.route('/', methods=['GET','POST']) def params_form(): value = 2 value_dict = {'1': 1==value, '2': 2==value, '3': 3==value} return render_template('hom...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to achieve minimum character length feature in react material-ui's autocomplete<p>I want to implement 'min-character-length' feature in react material-ui...
<p> Maybe you can try something like popoverProps={{style: {display: 'none'}}} and change that with state.</p> <p>In the <a href="https://github.com/callemall/material-ui/blob/master/src/AutoComplete/AutoComplete.js" rel="nofollow noreferrer">source</a> of AutoComplete it keeps the bool open in it's state. Your open p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Selecting data from a column that contains data from a separate column<p>I'm using SQL PLUS.</p> <p>I have a table with two columns, SERIALNUMBER, and ITEMN...
<p>A quick &amp; dirty option might be using <code>INSTR</code>:</p> <pre><code>select * from test where instr(itemnumber, serialnumber) &gt; 0 -- ITEMNUMBER contains SERIALNUMBER ... and itemnumber like '00%'; -- ... and ITEMNUMBER begins with 00 </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Iterating a list of Pandas dataframes / reshaping dataframe with .unstack<p>I have a dataframe with a DatetimeIndex:</p> <pre><code> ...
<h1>Problem cause</h1> <p>You need to check how assignment works in Python. This <a href="http://rhodesmill.org/brandon/talks/#plummeting-cliff" rel="nofollow noreferrer">talk</a> by Brandon Rhodes is pretty enlightening.</p> <p>When you do <code>df = df['X'].unstack()</code> you assign to <code>df</code> the unstack...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Syntax error: end of file unexpected<p>I define a function in Makefile</p> <pre><code>define write_file for i in $( seq 1 10 ) do echo "1234567" &gt;&gt...
<p>Each line of a make-recipe is a single command that <code>make</code> runs in a single new shell. So you need to make the body of the macro <code>write_file</code> into a single shell command.</p> <p>In addition, <code>make</code> expands anything of the unescaped form <code>$(....)</code>, treating <code>....</cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to install python-fitbit module?<p>I am following <a href="https://roboticape.wordpress.com/2014/01/13/first-steps-into-the-quantified-self-getting-to-kn...
<p>If you're just looking to use the library, you don't need to clone the git repo at all. You should be able to just use <code>pip install fitbit</code>.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rx flatMapLatest doesn't pass completed through?<p>I expected to see <code>timer -&gt; Event completed</code> get outputted right after I saw <code>running -...
<p>This is the solution I found:</p> <pre><code>struct TimerCountdown { let timer: Observable&lt;Int&gt; init(running: Observable&lt;Bool&gt;) { timer = running .flatMapLatest { $0 ? Observable&lt;Int&gt;.interval(1.0, scheduler: MainScheduler.instance) : Observable&lt;Int&gt;.never() } ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Tokenize a std::string to a struct<p>Let's say I have the following string that I want to tokenize as per the delimiter '&gt;':</p> <pre><code>std::string ve...
<p>You don't need an intermediate variable.</p> <pre><code>pack_item pitem; std::stringstream veg_ss(veg); std::getline(veg_ss, pitem.it1, '&gt;'); std::getline(veg_ss, pitem.it2, '&gt;'); std::getline(veg_ss, pitem.it3, '&gt;'); std::getline(veg_ss, pitem.it4, '&gt;'); </code></pre> <p>You might want to make that a ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Vue.js Filtered list Method<p>I am still learning Vue.js. At the moment I am trying to make a simple filtered list method that pulls the data from a json fil...
<p>You imported the data but never used anywhere inside the component:</p> <pre><code>import data from '@/assets/data.json'; // notice the data here is just a variable and it has nothing to do with the // component's data property export default { data () { return { products: data.products // init produ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Spinner not filled with ArrayAdapter<p>So my spinner isn't being filled programatically:</p> <pre><code>@Override public View onCreateView(LayoutInflater in...
<p>In <code>onCreateView</code> you should be using <code>return view;</code>, not <code>return inflater.inflate...</code> What you are doing is inflating a second copy of the fragment, which is not initialized with spinner data.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Need an example of how to do a button click on serenity-js<p>I am really new to serenity-js and Protractor. I followed the '<a href="https://github.com/seren...
<p>A great place to start is to follow <a href="https://serenity-js.org/from-scripts-to-serenity/readme.html" rel="nofollow noreferrer">the official tutorial</a>.</p> <p>To click on a button you'll need:</p> <pre class="lang-js prettyprint-override"><code>// an Actor const actor = Actor.named('Bob').whoCan(BrowseTheW...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I keep getting a permission denial error whenever I try to access a file in a speech recognition program<p>I'm trying out speech recognition and using it as ...
<p>Your solution works fine.</p> <p>I just would tweak it to leave the file behind (in case you want to listen to it for testing purposes) and instead, remove it at the beginning if it exists.</p> <p>Also passing filename to your function ensures nothing is hard coded</p> <pre><code>def speak(text, filename): if os...