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: table in database rows<p>I have a table <strong>People</strong>, having <em>people_id,people_name,people_lastname</em>. I am facing difficulties creating a p...
<p>One option is to return refcursor:</p> <pre><code>SQL&gt; create or replace function f_test (par_deptno in number) 2 return sys_refcursor 3 is 4 l_rc sys_refcursor; 5 begin 6 open l_rc for 7 select empno, ename, job, sal 8 from emp 9 where deptno = par_deptno; 10 return...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Calling delete[] breaks my C++ program<p>Updated: Thanks for the quick replies. It seems that I have posted an older version of the code. Everything remains ...
<p>You have a number of problems I can see already:</p> <ol> <li>You should not be calling the constructor explicitly like this. It doesn't do what you think. Put allocations in a real member function.</li> <li>Every time you "grow" your array, you just allocate new, causing a leak because the previous pointer wasn't ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I make a thrift call to a specific service of a server that supports multiple versions<p>Let's say I have the following services declared on the same ...
<h2>Calling newer services "the old fashioned way"</h2> <p>Calling an <code>PositionService</code> server using a <code>PositionServiceV2</code> client is not possible, because it is a different service. And even if you get it to succeed, you will still run into troubles when you start using service multiplexing.</p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use || inside a lambda expression<p>I filter out what documents a user can see in the webapi Get call. The CompanyName in the Document object must mat...
<p>only use <code>y =&gt;</code> once</p> <pre><code> return context.Documents .Where(j =&gt; j.CompanyName == user.CompanyName1 || j.CompanyName == user.CompanyName2 || j.CompanyName == user.CompanyName2) .ToList(); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to schedule a TimerTask a long time in advance<p>Heavily edited/updated: I am trying to schedule a task a long time in advance. I believe it is doing ...
<p>I ran a test stating Friday around 11:30. I changed the windows sleep settings set to 1 hour (Start -&gt; Settings -&gt; System -&gt; Power &amp; sleep). Since Friday 8:00 had passed, I changed the day to Saturday. I also changed the repeated interval to every half hour <code>3*1000*60*10</code>, since I wanted to ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Regex for checking if a string should not contain certain words but those words are ok if they have a 'to' or 'for' preceeding the words<p>I have a use case ...
<p>You could use</p> <pre><code>^(?!.*\b(?:com|dot)\b).+ </code></pre> <p>See <a href="https://regex101.com/r/pLwrQz/1/" rel="nofollow noreferrer"><strong>a demo on regex101.com</strong></a>.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ASCII value output of the last character in a user input string (using fgets) is 10 while expected value is 0<p>I am writing a program to simulate strcmp(). ...
<p>The function <code>fgets</code> can append the new line character <code>'\n'</code> - decimal <code>10</code> (that corresponds to the key Enter) to the entered string if there is enough space in the destination character array.</p> <p>You should remove it. For example</p> <pre><code>#include &lt;string.h&gt; //....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Set class variable from interface implemented function and AsyncTask<p>Correct the title if you think it does not descibe the question correctly.</p> <p>I w...
<p>The issue is that the <code>isUserLoggedIn()</code> method returns with the current status immediately, but it has kicked off <code>DbHandler</code> in the process. So the caller of <code>isUserLoggedIn()</code> is not waiting for the result. Rework your <code>Activity</code> code to run a check on login status (s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to query nested data in mongoose model<p>I am attempting to build a Vue.js app with a MEVN stack backend and Vuex. I am configuring my Vuex action handle...
<p><code>name</code> is inside <code>activeuser</code> so you need to construct params object variable like this:</p> <pre class="lang-js prettyprint-override"><code>postRoutes.route("/currentuser").get(function(req, res) { let params = { activeUser: {} }; let username = req.query.activeUserName; if (use...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to start the process of coming up with the predicted math score?<p>This concerns a "software algorithm" from <a href="https://stackoverflow.com/help/on-t...
<p>There are a lot of possible strategies to do this, the purpose in asking the question seems to be to try to determine which works the best.</p> <p>It seems impossible to get 100% correct, so the goal is really to come up with a strategy that provides the correct answer more often than not, and hopefully beats the c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I place the cursor and highlight a word programmatically? c#<p>How do I place the cursor and highlight a word programmatically?</p> <p>For example, i...
<p>You are just missing one line of code:</p> <pre><code>gTBxInfo.SelectionStart = iIdx; gTBxInfo.SelectionLength = iLength; gTBxInfo.Focus(); </code></pre> <p>You need to set the focus on the <code>TextBox</code> before the highlight appears.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert a C++ class to double array<p>I have a library that exposes a C++ API that only allows for a double array and a callback function. The callback funct...
<p>Maybe it is better solution to create a class which is convertible to <code>const double*</code> and constructible from <code>const double*</code>, so you can pass your instance to api and let the compiler implicitly do conversion and construct the class in <code>FUN</code> callback. I am not sure it fits your needs...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Represeting timedelta object in 12'o Clock time format<p>How to represent timedelta objects in 12'o clock.</p> <pre><code>from datetime import timedelta pr...
<p>You could use any datetime value that corresponds to midnight to perform arithmetics with <code>timedelta</code>:</p> <pre><code>&gt;&gt;&gt; from datetime import datetime, timedelta &gt;&gt;&gt; delta24h = timedelta(hours=13) &gt;&gt;&gt; (datetime.min + delta24h).strftime('%I:%M:%S %p') '01:00:00 PM' </code></pre...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Paypal Chained Payment - Pay Key & IPN<p>I recently converted from basic Paypal payments to Chained Payments...and I have a few questions if you guys would b...
<p>I would add your record ID into the tracking ID parameter of the Pay request like you mentioned. That way you'll get it back in your IPN similar to what you're doing with the custom parameter now.</p> <p>The IPN notification URL is what you want to set in order to trigger IPNs for the Pay request. You do not want...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: 'ascii' codec can't encode characters in position 2307-2309: ordinal not in range(128)<p>I am making a request using requests lib, as can be seen in the cont...
<p>This was due to sublime text not supporting utf-8 by default. I was able to get the output in python IDLE</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Export to Excel - Need Space in Between Text<p>I have a HTML table and a button to export into Excel. The exporting works well - every data from the table i...
<p>I just changed</p> <pre><code>$(".exportExcel").click(function(e) { e.stopPropagation(); var table = $("." + $(this).data('target')); window.open('data:application/vnd.ms-excel,' + $(table).html()); e.preventDefault(); ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to set a specific key of a var in Twig<p>In a Twig template, if I have the following variable:</p> <pre><code>{% set varName = { "key": { ...
<p>Twig isn't designed to manipulate data. You should probably use twig extension or do it in your controller.</p> <p>You can still do it though, but it's ugly.</p> <pre><code>{% set varName = varName|merge({"key": varName.key|merge({"subkey2":"value"}) }) %} </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Chromedriver basic authentication alert pop up not detected<p>I am having issues detecting Basic Auth alert with ChromeDriver 2.14 (Chrome 40.0.2214.111 (64-...
<p>Your question is similar to this question <a href="https://stackoverflow.com/questions/28543989/how-to-close-authentication-pop-up-in-selenium-ie-webdriver/28544422#28544422"> here </a></p> <p><code>Authentication popup</code> is NOT generated by Javascript / it is not a javascript alert. So It can not be handled b...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: UnicodeWarning fired only once<p>Consider:</p> <pre><code>Python 2.7.5 (default, Mar 9 2014, 22:15:05) [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.6...
<p>The default configuration for Python is to use the <a href="https://docs.python.org/2/library/warnings.html#the-warnings-filter" rel="nofollow"><code>default</code> warning configuration</a> (with a <a href="https://docs.python.org/2/library/warnings.html#default-warning-filters" rel="nofollow">few specific exceptio...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ?android:attr/selectableItemBackground not visible enough on a dark background<p>On Android Lollipop, I'm using:</p> <pre><code>android:background="?android...
<p>On API 21+ you can set <code>android:theme="@android:style/ThemeOverlay.Material.Dark"</code> on a <code>View</code> or <code>ViewGroup</code> to change all of the theme attributes (text color, ripple color, button color, etc.) to the "dark" versions. If you set it on a <code>ViewGroup</code>, the theme is also appl...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting Data back from Push_back<p>I copied some images to a vector in c++. Now I need the same mats in some place. How I will get my data back from push_bac...
<p>You could use <code>std::vector::back()</code>.</p> <pre><code>crop = Ims.back(); </code></pre> <p>If you want to enumerate through <code>Ims</code>, you can do</p> <pre><code>for (size_t i = 0; i &lt; Ims.size(); ++i) crop = Ims[i]; </code></pre> <p>and do what you want on <code>crop</code>.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to INSERT/UPDATE a relational record that may exist based of the existence of a different record<p>A have a relational table which relates tags to photos...
<p>If you want to insert <code>landscape</code> where there is <code>landscape</code>, then just do an <code>insert</code>:</p> <pre><code>insert into tag_photo_x(photo_id, tag_id) select photo_id, 'landscape' from tag_photo_x tp where tag_id = 'landscapes' and not exists (select 1 ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Automate Connect-AzureAD using powershell in Azure Devops<p>I am unable to automate Connect-AzureAD powershell command.</p> <p>In order to get user objectID...
<p>I found the solution and test it.</p> <p>I'm running this task in an Azure Devops pipeline; this tasks is called &quot;Azure PowerShell script&quot; executed with the latest installed version.</p> <pre><code>Install-Module -Name &quot;AzureAD&quot; -Force $context = [Microsoft.Azure.Commands.Common.Authentication.Ab...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Which is more cost-effective for a mobile backend: Parse or Google Cloud endpoints?<p>So me and my partner are working on a mobile app.</p> <p>And I'be been...
<p>As you can see <a href="https://cloud.google.com/pricing/#cloud-endpoints" rel="nofollow">here</a>, Google Cloud Endpoints are completely free. You only will need to pay for your back-end in Google App Engine or in Compute Engine.</p> <p>But definitely, the prices will be lower than those offered in Parse, except t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: get_reader() got multiple values for argument 'mode'<p>this is my code:</p> <pre><code> reader = read(uri, format,"i", **kwargs) with reader: ...
<blockquote> <p>reader = read(uri, format,"i", **kwargs)</p> </blockquote> <p>I expect the "i" parameter is the mode argument (though I gues it could also be <code>format</code>), but the kwargs dict also contains a value for mode. As a result, Python gets a conflict where the mode argument is provided twice, and re...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add Specfic Namespace to appsettings.json - Serilog ASP.NET Core 3.1<p>I followed a tutorial that gets you to set all the <code>Serilog</code> config up in <...
<p>In the <code>Using</code> field of the <code>appsettings.json</code>, you have to specify the sinks that you'll be using. </p> <p>For example, if you're writing to the <code>Console</code>, you should specify the full name of the class including the namespace (in this case <code>Serilog.Sinks.Console</code>), provi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Check duplicate on multiple userform textbox value<p>Im still working to improve my library booklist. This is previous question to check duplicate value whil...
<p>Using the same Sub from the previous question:</p> <pre><code>Private Sub CheckButton_Click() DupCheck TitleTextBox.Text, 2, Title_checker DupCheck ISBNTextBox.Text, 5, ISBN_checker DupCheck CallNoTextBox.Text, 6, CallNo_checker End Sub Sub DupCheck(txt, ColNo As Long, theLabel As Object) Dim ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Trim() input value of any TextField in a Form by default in flutter app<p>I have different form fields and I want to trim each value of the form field by def...
<p>just add </p> <pre><code>inputFormatters: [WhitelistingTextInputFormatter(RegExp(r'[a-zA-Z0-9]'))], </code></pre> <p>as property to TextInputField and user will not even able to type space or any other chars except whitelisted and you can remove also additional checks from validator</p> <p>full example</p> <pre>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Find specific element index from Tensor(Matrix)<p>I am a student just beginning to study deep learning.</p> <pre><code> x_norm = (x**2).sum(1).view(-1, 1)...
<p>If it is normal tensor you can use <a href="https://pytorch.org/docs/stable/torch.html#torch.nonzero" rel="nofollow noreferrer"><code>torch.nonzero</code></a> </p> <pre class="lang-py prettyprint-override"><code>&gt;&gt;&gt; (dist &gt; 0.5).nonzero() </code></pre> <p>which will return indices of all elements that ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: OpenCV - Detect only a particular line in an image<p>I'm trying to isolate a single line in the following image, I know of a few methods such as CannyEdge De...
<p>In Python/OpenCV, you can threshold on the red color of the line, then get the biggest contour or on contours larger than some threshold in area, which is what I show below..</p> <p>Input:</p> <p><a href="https://i.stack.imgur.com/5mZli.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5mZli.png" ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mailchimp add name<p>i'm trying to add a new user to my list on mailchimp (email, first name and last name). But i've could not, any help would be apreciated...
<p>solved it! by adding the missing parameters</p> <pre><code>try { $merge_vars = array("FNAME"=&gt;$arr[0],"LNAME"=&gt;$arr[1],); $double_optin = FALSE; $subscriber = $Mailchimp_Lists-&gt;subscribe( $list_id, array( 'email' =&gt; $email), $merge_vars,'html',$double_optin ); } catch (Exception $e) { ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to print macros in msvc preprocessor?<p>Is there a way to see my #defines in preprocessor file using msvc or gcc?</p> <p>here's a little code: </p> <pr...
<p>There is an undocumented compiler switch, <code>/d1PP</code>, that will retain macro definitions in the preprocessor output. If you compile Rado's example with <code>/P /d1PP</code>, you'll get the following output file:</p> <pre><code>#line 1 "q.cpp" #define BLAH 1 int main() { cout &lt;&lt; "BLAH defined...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Layout with system grid<p>code:</p> <pre><code>&lt;GridContainer&gt; &lt;NewsWrapper /&gt; &lt;News2Wrap&gt; &lt;div&gt;a&lt;/div&gt; &lt;div&gt...
<p>If you divide your <strong>parent grid</strong> into 8 squares (2 rows each containing 4 squares) you can define the areas of each news item.</p> <p>When defining each area, it's <strong><em>very important</em></strong> you think in terms of <strong>lines</strong>:</p> <p><strong>Vertically:</strong></p> <ul> <li...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: After inserting data into Cassandra with node.js, the program seems like it is still waiting<p>I am really new to Cassandra and node.js now. I am trying to i...
<p>Node.js event loop will stay active until open connections are closed.</p> <p>In this case, it means you need to call <code>client.shutdown()</code>.</p> <p>Also, consider that <code>client.execute()</code> is an async operation, so invoking it from a sync loop it is generally not a good idea. You can use a workfl...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Compiling a program that is dependent on boost libraries with only .so or .a files<p>I have a small test case program just to see if boost works on some syst...
<p>you want to use</p> <p><code>g++ -isystem /share/apps/boost/1.55.0/include -L /share/apps/boost/1.55.0/lib test.cpp -o test -lboost_system -lboost_filesystem</code></p> <p><code>-isystem</code> tells the compiler where to look for system header files. And <code>-L</code> tells the linker where to look for librarie...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reading Armv8-A registers with devmem from GNU/Linux shell<p>I want to read the values of some Cortex-A53 registers, such as</p> <ul> <li>D_AA64ISAR0_EL1 (AA...
<p>Disclaimer: I am not an Aarch64 expert, but I am currently learning about the architecture and have read a bit.</p> <p>You cannot read <code>ID_AA64ISAR0_EL1</code>, <code>ID_ISAR5_EL1</code> nor <code>ID_ISAR5</code> from a user-mode application running at <code>EL0</code>: the <code>_EL1</code> suffix means than ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to multiply a row of pandas df by a number n, keeping a delimeter in between?<p>I have a pandas df as below:</p> <pre><code>Type,Col1,Col2,Col3,Col4 Typ...
<p>Filter rows by <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.eq.html" rel="nofollow noreferrer"><code>Series.eq</code></a> and columns names by <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Index.difference.html" rel="nofollow noreferrer"><code>Index.dif...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PHP Word followed by a numeric value<p>I have the following example address string:</p> <pre><code>$address1 = "Flat 2 House Name 21 Another Road"; </code><...
<p>Edit: </p> <pre><code> &lt;?php $address1 = "Fre 2 House Name 21 Another Road"; $ex = explode(' ', $address1); $cant = 0; $out = ''; for($i = 0; $i &lt; count($ex); $i++) { if(is_numeric($ex[$i])) { $cant++; if($cant == 1 &amp;&amp; $ex[$i - 1] == 'Flat') { $out .= ' ' . $ex[$i] ....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Symfony/doctrine slip element in textarea before persist<p>Hi i'm new in symfony2 and i want to make one thing</p> <p>I have in my view a textarea, and in t...
<p>The two best solutions for this kind of job will be:</p> <p>1) Add an event listener on the <code>FormEvents::POST_SUBMIT</code> event to the field <code>users</code>, where you will take the submitted value and process it as you need it and resubmit it in the new form. More: <a href="http://symfony.com/doc/current...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Re-exporting from multiple modules in ES5<p>I have index.js with the following code that works fine on the client, re-exporting functions defined in three ot...
<p>A simple but effective solution would be</p> <pre><code>Object.assign(module.exports, require('./validators'), require('./comparators'), require('./transforms'), ); </code></pre> <p>This is similar to what ES6 does, but does not support updating of exported members. For a closer approximation, you'd ne...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can only instantiate 1 generic-uio device<p>I'm trying to expose interrupts to userspace using the uio_pdrv_genirq driver. However I can only instantiate 1 d...
<p>Alright, this turned out to be a problem in the kernel source that I was using.</p> <p>The lines:</p> <pre><code>if (ret) goto err_get_minor; </code></pre> <p>in drivers/uio/uio.c and the lines:</p> <pre><code>if (ret) { dev_err(&amp;pdev-&gt;dev, "unable to register uio device\n"); goto bad1; } </co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Implicitly convert an Iterable to Option<p>I have a requirement in which I want to implicitly convert and Iterable to Option. The requirement is if the Itera...
<p>Implicit conversion alone is not going to help you if you want to do this. What you need here is an <a href="http://docs.scala-lang.org/overviews/core/implicit-classes.html" rel="nofollow">implicit class :</a></p> <pre><code>object Rich { implicit class RichIterable[T](it: Iterable[T]){ def toOption: Option...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Javascript/Canvas - find mouse coords relative to the location of the coordinate grid<p>I have made a little toy thing that would get the angle of my mouse i...
<p>Instead of moving the whole canvas, why not just move the center point of your 'toy thing'?</p> <p>So instead of </p> <pre><code>//move the location of the coordinate grid on click canvas.addEventListener('click', function (evt) { var mousePos = getMousePos(canvas, evt); gridOffsetX = mousePos.x - 250; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Select all from Table A, one column from Table B - LEFT JOIN<p>Psuedocode:</p> <pre><code>SELECT (* from tableA, columnX from TableB) FROM TableA LEFT JOI...
<p>The syntax you appear to be looking for would be,</p> <pre><code>SELECT TableA.*, TableB.columnX FROM TableA LEFT JOIN TableB ON TableA.columnY = TableB.columnX </code></pre> <p>The <code>TableA.*</code> syntax will return all columns associated to <code>TableA</code>.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get Category image in with getChildrenCategories->getImageUrl (MAGENTO)<p>I use this <code>$categories</code> through out the page</p> <pre><code>$categorie...
<p>Basically, When we are using <code>getChildrenCategories()</code> function only few fields has been retrieve from category field collection -><code>url_key,name,all_children,is_anchor</code>. </p> <p>you can see that on class <code>Mage_Catalog_Model_Resource_Category</code>.So if want tget image url from functio...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Autodesk forge Viewer in React Application markup extension`s not all functions don`t come<p>I have a React Apllication and integrated Autodesk forge viewer....
<p>A few things to check here:</p> <ul> <li><code>onToolbarCreated</code> is only effective when using Viewer v7 or later</li> <li>it'd only get called after the <code>Autodesk.Viewing.TOOLBAR_CREATED_EVENT</code> event is fired</li> <li>you can either add a breakpoint inside your function or print to the console in t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get current displayed month in table_calendar package flutter<p>I'm building a calendar using the table_calendar flutter package. Other all things are...
<p>Looking at <a href="https://pub.flutter-io.cn/documentation/table_calendar/latest/table_calendar/CalendarController-class.html" rel="nofollow noreferrer">https://pub.flutter-io.cn/documentation/table_calendar/latest/table_calendar/CalendarController-class.html</a></p> <p>You should be able to get the current month ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Spring Data jpa (hibernate) nullpointer Exception when adding List of Entities<p>first my Code.</p> <p><strong>Specialization</strong></p> <pre><code>@Enti...
<p>I've got my mistake. Sleeping a bit helped. I've mixed up the relations.</p> <p>If one <code>Specialization</code> has many <code>Attribute</code>s, the annotations should look like this:</p> <pre><code>@OneToMany(cascade = CascadeType.ALL) @JoinColumn(name="specc_id", referencedColumnName = "name") private List&l...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Manipulating this dictionary to return desired output?<p>I'm working with a dictionary that contains sub-dictionaries. I would like to convert this to a usab...
<p>This should work:</p> <pre><code>mydict = {1005672: {4461048: {'body': 'Mnow test test', 'msg_id': 4461048}, 4620511: {'body': 'test sms,test sms', 'msg_id': 4620511}, 4620584: {'body': 'test sms', 'msg_id': 4620584}, 4646648: {'body': 'test sms', 'msg_id': 4646648}, 4646...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What are Rust's exact auto-dereferencing rules?<p>I'm learning/experimenting with Rust, and in all the elegance that I find in this language, there is one pe...
<p>Your pseudo-code is pretty much correct. For this example, suppose we had a method call <code>foo.bar()</code> where <code>foo: T</code>. I'm going to use the <a href="https://doc.rust-lang.org/stable/book/ch19-03-advanced-traits.html#fully-qualified-syntax-for-disambiguation-calling-methods-with-the-same-name" rel=...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to sort array as items as added in Javascript?<p>I have an array of objects, whose elements as displayed using ng-repeat from AngularJS. Each object has ...
<p>Resorting the array each time you add an element will cost a heavy runtime penalty, especially since some default array.sort implementations have an O(n^2) runtime for a nearly-sorted array.</p> <p>Instead, use binary search to insert new elements into the correct position in the sorted array.</p> <p>Check this re...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Difference checker of two files and display what line is different<p>Hello I have this code I have been working on, </p> <p>I have two files standard.txt, n...
<p><a href="https://docs.python.org/3.7/library/functions.html#enumerate" rel="nofollow noreferrer">enumerate</a> and <a href="https://docs.python.org/3.7/library/functions.html#zip" rel="nofollow noreferrer">zip</a> are your friends here. To obtain the differences I would do something like:</p> <pre><code># Make sure...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Need basic encryption understanding from existing Android code<p>I am new in Android and I have started to working on existing project which have some encryp...
<p>I can not help you in more detail but one thing i have found that</p> <p>PEMWriter is already deprecated. You are not getting this message because you are importing PEMWritter from different package like util package</p> <p>Instead import it from </p> <pre><code>org.spongycastle.openssl.PEMWriter </code></pre> <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Start index with certain value zipWithIndex in pyspark<p>I want to start value of indexes in data frame with certain value instead of default value zero, if ...
<p>the following solution will help to start zipwithIndex with default value.</p> <pre><code>df = df_child.rdd.zipWithIndex().map(lambda x: (x[0], x[1] + index)).toDF() </code></pre> <p>where index is default number you want to start with zipWithIndex.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: HQL Query adding JOINS for lazy associations<p>I have an entity 'Notifications' that has about 10 <code>ManyToOne</code> relations which are marked as <code>...
<p>You're using a join table to map your toOne association, instead of a join column (which is the default). Since the association is optional, Hibernate has no way to know, just by getting the columns of the main table, if there is an associated entity or not. With a join column, it can:</p> <ul> <li>if the column is...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to unnest deeply nested objects recursively?<p>I am working with an array that could have a number of objects/arrays of <em>unpredictable</em> nesting. E...
<p>Yes, this is very easy using recursion. Here is your basic case:</p> <ul> <li>You receive something that's not an object - you return <code>null</code>. </li> </ul> <p>Then your basic recursion case:</p> <ul> <li>You receive an object, you construct a new object with a property the <code>name</code> of the object...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Dynamic programming: find the subset with product of all members is equals to given number<p>I will find an algorithm for this problem.</p> <blockquote> <...
<p>This is similar to the subset sum problem, where you are required to find a subset whom sum is a value <code>k</code>.</p> <p>Since there is a solution to your problem (you have a subset <code>S</code> whom multiplication is <code>k</code>) if and only if you have a subset of log(x) for each x in the set, whom sum ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: split export mongodb to json<p>I have a lots of data in my mongodb and I want to export to the entire data to json where each file no bigger than 500 kb (sma...
<p>You could do this with a shell script and via the mongoexport options <code>--skip</code> and <code>--limit</code> so basically limit the number of documents in each file and use skip as an offset.</p> <p>Something like this if your total is let say 5 milion records:</p> <pre><code>limit=10000; skip=0; for i in {1...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Replace string variable with string variable using Sed<p>I have a file called <strong>ethernet</strong> containing multiple lines. I have saved one of these ...
<p>You need to escape your <code>oldline</code> so that it contains no regex special characters, luckily this can be done with sed.</p> <pre><code>old_line=$(echo "${old_line}" | sed -e 's/[]$.*[\^]/\\&amp;/g' ) sed -i -e "s/${old_line}/${new_line}/g" ethernet </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Property rows does not exist on type HTMLElement error TS2339 when loop through table<p>problem</p> <blockquote> <p>Property rows does not exist on type HTML...
<p>When you call <code>document.getElementById</code> TypeScript doesn't know what is the specific type of the element, so the function returns the generic type HTMLElement. You should cast it to HTMLTableElement.</p> <p>Try something like this:</p> <pre><code>var table = document.getElementById("CompareParts") as HT...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Eliminate duplicate from list of lists<p>I need to eliminate duplicates from a list of list like this one:</p> <pre><code> list = [[10, 5, 3], [10, 5, 3]...
<p>You should use <code>map</code> in order to convert to <code>tuple</code></p> <pre><code>result = [list(set(i)) for i in set(map(tuple, mylist))] </code></pre> <p>Output</p> <pre><code>[[3], [10, 3, 5], [10, 3], [10]] </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel REST API and frontend<p>I created a project in Laravel, small database and added REST API in laravel to connect mobile app with database. What should...
<p>Laravel also support for Restful API in own way. for this </p> <ul> <li>you create your controller in Api folder: <code>php artisan make:controller Api/TestController</code></li> <li><p>define your routes in <code>routes/api.php</code> : </p> <pre><code>Route::group(['namespace' =&gt; 'Api'], function (){ Route:...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ElasticSearch Filter not working with must AND must_not<p>I am trying to filter out errors in Kibana, but not all errors, just errors that do not have a spec...
<p>Your question already contains the solution to your "problem".</p> <p>In your <code>must_not</code>-clause you are using a <code>term</code>-query which tests for exact match, whereas in your "test"-query you use a <code>phrase</code>-query. If your message contains the <em>phrase</em>, but also some additional byt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Product a scalar with a matrix in mathematica<p>I want to product a scalar with a matrix in mathematica. My codes are : </p> <p><code>w.P + (w^3).P</code></...
<p>The <code>.</code> operator is specifically for tensor (including vector and matrix) multiplication. Just multiply without the <code>.</code>:</p> <pre><code>w P + (w^3) P </code></pre> <p>I can't explain your statement that the product as you have it yields a scalar. For example:</p> <pre><code>P = {{1, 2}, {2...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make react-native-maps animateCamera change heading from last heading to new heading<p>Is there any way I can make the map changes from last heading t...
<p>I have found the answer. I need to use initialCamera props in MapView component instead of using initialRegion. Then I use animateCamera method to change the map coordinate and heading.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does JavaScript have a language construct similar to the php list command?<p>Does JavaScript have a language construct or something similar to the php list c...
<p>I've just written a simply function, and it works. Just not exactly like list in php. Here it is</p> <pre><code>function list(fn,array){ if(fn.length &amp;&amp; array.length){ for(var i=0;i&lt;array.length;i++){ var applyArray = []; for(var j=0;j&lt;array[i].length;j++){ ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: URL mapping mistake in Django<p>I am creating "Loan Application and Verification System" in which, This page <code>http://127.0.0.1:8000/applicant_policy/2/<...
<p>Your url should be </p> <pre><code>&lt;td&gt;&lt;a class="btn btn-sm btn-info" href="{% url 'applying_for_policy' policy.id %}"&gt;Check&lt;/a&gt;&lt;/td&gt; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: perl -pi -e remove .bak automatically on cygwin<p>Under Cygwin, <code>perl -pi -e</code> will always save <code>.bak</code> files. I don't exactly understand...
<p>You can use perl to delete <code>.bak</code> files,</p> <pre><code>.. | xargs perl -i.bak -pe 'BEGIN{ @d=@ARGV } s/foo/bar/; END{ unlink map "$_$^I", @d }' </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Git can't find dangling tree origin<p>I was running a difference checker between my current files and a backup of the files on my external drive, and I found...
<p>meh, rookie mistake. Turns out, the extra dangling commit was pointing directly to the missing tree. I thought that doing <a href="http://git-scm.com/docs/git-ls-tree" rel="nofollow"><code>git ls-tree &lt;sha1&gt;</code></a> on a commit object would give the tree it was pointing to, but it actually gives the childre...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to save string as json in scala spark<p>I have the raw of string in logs file . I do many filter and other operation after that . I have reached the foll...
<p>You can use <code>scala.util.parsing.json.JSONObject</code> to convert a map to JSON and then to a string.</p> <pre><code> val df = spark.createDataset(Seq("Comm=Qwe123,Elem=12345,Elem123=Test")).toDF("col3") val dfWithJson = df.map{ row =&gt; val insMap = row.getAs[String]("col3").split(",").map{kv =...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: cannot create and modified variable in java<p>I tried to modify a String variable in java but I get that error: Local Variable defined in an enclosing scope ...
<p>Variables outside threads on listener must be declare as final so computer can know they are not being changed or modified.</p> <ol> <li>You can either make it a global variable </li> <li>You can make it a variable inside on action</li> <li>you can make it final as Final a="value";</li> </ol>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Script not running thru all iterations, and getting stuck in a loop<p>I have a script that is working. It is to loop thru a number of different spreadsheets...
<p>Try this:</p> <p>I just replaced all of the inner loop indices with j</p> <pre><code>function myFunction() { var sheetIds=SpreadsheetApp.getActive.getSheetByName("Blueprints"); var values=sheetIds.getRange('j19:j96').getValues(); var idList=values.map(function (row) {...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: echo arguments to java program<p>I have a simple java program which counts arguments passed into it:</p> <pre><code>public class SubsetTest { public sta...
<p>The <a href="http://en.wikipedia.org/wiki/Pipeline_%28Unix%29" rel="nofollow noreferrer">pipe</a> is going to send the output of <code>echo</code> to the other process' standard input. </p> <blockquote> <p>a pipeline is the original software pipeline: a set of processes chained by their standard streams, so tha...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Firebase cookie issue for Twitter Authentication<p>I am currently trying to allow users to login to my Vue.js <a href="https://i.stack.imgur.com/X4mPH.png" r...
<p>I had the wrong callback url in my Twitter app. Didn't realise firebase gave you a callback URL once you insert the API/secret API key in firebase.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Storing string value to array<p>I am new to iOS developing. I am building a sample project where I have a textfield. I have stored the textfield text into a ...
<p>This is a very basic question, i won't down vote it but if you Google it, you can find the answer pretty fast <a href="http://rypress.com/tutorials/objective-c/data-types/nsarray" rel="nofollow">ArrayLinks</a></p> <p>Basically, you need to have a <code>NSMutableArray</code> and then you can call</p> <pre><code>NSS...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: HashSet in EF many to many<p>I'm trying to implement many to many in EF Code-first. I have found this code : </p> <pre><code> public class Student { ...
<p>It's necessary because you have to instantiate the particular implementation of <code>ICollection</code> that you would like to use. <code>HashSet</code> implements a hash table that is very efficient for a lot of operations, for instance searching a large set for a single item. But you might have reasons for choosi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Loop through a nested python dictionary/list loaded from yaml<p>Ok, this is probably stupid. Basically i'm trying to loop through my nested yaml-file and do ...
<p><em>This alone</em> should have raised an error: <code>settings['lev-0a']['lev-1a'].iteritems():</code>. In your code, the value pointed to by <code>['lev-1a']</code> appears to be a <code>list</code>, not a <code>dict</code>, so calling <code>iteritems()</code> on it is very suspect.</p> <p>What you seem to have b...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Safely add a non-null column to an existing table<pre><code>IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE Name = N'MyColumn' AND Object_ID = O...
<p>You can use following syntax:</p> <pre><code>BEGIN TRANSACTION ALTER TABLE [MySchema].[MyTable] ADD [MyColumn] VARCHAR(10) NOT NULL CONSTRAINT MyTableDefault DEFAULT 'ValueForExistingData'; ALTER TABLE [MySchema].[MyTable] DROP CONSTRAINT MyTableDefault; COMMIT </code></pre> <p>On Enterprise e...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create an issue with image via GitHub API<p>I am creating issues with <a href="https://developer.github.com/v3/issues/#create-an-issue">https://developer.git...
<p>There is no simple solution to this. The official docs say nothing about that which means it's not supported.</p> <p>The GitHub.com authentication works based on cookies while the API authentication uses tokens/passwords. That means if you really want to hack the things to upload your image using GitHub, you have t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Angular-DataTables custom filter<p>I am trying to add a custom filter to <strong>angular-DataTables</strong> with server side processing, which works perfect...
<p>After searching and browsing, combined few examples and came up with this.</p> <p>HTML :</p> <pre><code> &lt;label&gt;&lt;input type="checkbox" id="customFilter" value="player" ng-click="reload()" &gt; Player&lt;/label&gt; </code></pre> <p>JS:</p> <pre><code> 'use strict'; angular.module('showcase', ['datat...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add image in the headersection using PHPWORD?<p>I am using phpword and yii , here i want to generate docx file which includes an image at the top righ...
<p>Can you post more of the code please?</p> <p>Meanwhile, I think the <code>createHeader();</code> function has been deprecated. The <code>addHeader();</code> function worked fine for me. You could give it a try too. Also, consider bringing down the width of the cells being created. Of course, these are wild guesses ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL where to use LIMIT in query<p>I am trying to limit my results to 10. The below query returns all results without the 'LIMIT 10' but when I add LIMIT 10 i...
<p>In SQL Server: You can use top 10 instead of limit as shown in the below query.</p> <pre><code>SELECT TOP 10 dbo.Organizations.cmoName AS "Organizations not quoted" , dbo.Calls.kbpCallID AS "kbpCallID" , MAX(dbo.CallLines.kblCallLineID) AS "kblCallLineID" FROM ( ( ( ( ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android Emulator Connection to http://10.0.2.2 refused<p>I got this error on an Android Emulator when I tried connecting to a local server:</p> <pre><code>I...
<p>You'll need to set StrictMode before calling your server:</p> <pre><code>StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().permitNetwork().build()); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CSS - Creating a play button<p>I have a jsfiddle here - <a href="http://jsfiddle.net/0nvns9Lj/1/" rel="nofollow">http://jsfiddle.net/0nvns9Lj/1/</a></p> <p>...
<p>You can (and should) do this simpler.</p> <p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippet-code-css lang-css prettyprint-override"><code>* { margin:0; padding:0 } figure { background: #ddd; height: 200px; display: -ms-flex; display: -webkit-flex; di...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to convert an array of map in Firestore to a List of map Dart<p>I am trying to build an app with Flutter and Firestore, but I am confused by the way I ha...
<ol> <li><p>Create a class in dart similar to that in firestore1. Create a class in dart similar to that in firestore. I have a Post class in Dart and an array of posts in firestore. <a href="https://i.stack.imgur.com/pNzF0.png" rel="noreferrer">Firestore Array of Map</a></p></li> <li><p>My class in Dart is like below...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Force user to start with 0 in angularjs<p>Here's my fiddle : <a href="http://jsfiddle.net/7htqdk7y/5/" rel="nofollow">Demo</a><br> this directive controll if...
<pre><code>var clean = val.replace(/(1){11,}|(2){11,}|(3){11,}|(4){11,}|(5){11,}|(6){11,}|(7){11,}|(8){‌​11,}|(9){11,}|(^0)[0-9]{10,}/g, '') ; </code></pre> <p>is, I think, what you want to achieve. Check the last part:</p> <pre><code>(^0)[0-9]{10,} </code></pre> <p>checks that the value entered starts with 0</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: iCloud vcalendar multiple events<p>I am trying to insert multiple events at once to an iCloud calendar. If I use this vcalendar, everything works just fine:<...
<p>Similar to this question: <a href="https://stackoverflow.com/q/27609122/2203005">Adding events to Davical server using Http request and DDay.iCal</a>.</p> <p>The iCloud calendar is a CalDAV server. In CalDAV (<a href="https://www.rfc-editor.org/rfc/rfc4791#section-4.1" rel="nofollow noreferrer">RFC 4791 Section 4.1<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How an implicit operator overload is selected by the compiler for real number literals<p>Given the following code - which C# rule causes that a real number l...
<p>Read <a href="https://docs.microsoft.com/uk-ua/dotnet/csharp/language-reference/language-specification/conversions#processing-of-user-defined-explicit-conversions" rel="nofollow noreferrer">this</a>, and specifically this part:</p> <blockquote> <p><strong>Processing of user-defined explicit conversions</strong></p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React Native FlatList component data constantly refreshing after firebase data call without consistent display of Firebase data<p>I am trying to build a flat...
<p>In my experience, FlatList performs better if you put a setTimeout in the function that's called by onEndReached. I have experienced FlatLists constantly refreshing because it hasn't finished loading more data before onEndReached gets called again. FlatList is supposed to have something built in that prevents this b...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Trigger OnPropertyChanged in PostSharp's INotifyPropertyChanged aspect manually<p>I'm using the NotifyPropertyChanged aspect from PostSharp.</p> <p>I have a...
<p>I think you have misunderstood the following:</p> <blockquote> <p>Raises the PropertyChanged event. If this method is already present in the target code, the NotifyPropertyChangedAttribute aspect will use it to raise the PropertyChanged event. Otherwise, the aspect will introduce the method into the target class....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to submit consecutive bash jobs using another job with a loop<p>I have to phase (using shapeit software) 29 chromosomes, so it would be great if a could ...
<p>Assuming you can change the first script to something like</p> <pre class="lang-sh prettyprint-override"><code>#!/bin/bash shapeit \ -P "$1".ped "$1".map \ --duohmm \ --rho 0.01 \ -O "$1".phased </code></pre> <p>and call it <code>sbatch</code> (or is that <code>phase.sh</code>?), you can then call it with<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Linq to XML is Reducing File Size<p>I have an XML file that begins at 1,030KB. After I run my code, which is adding an element to a section of the xml file, ...
<p>It sounds like an encoding issue. You're probably saving down as a different encoding to the original document, and different from what the target application is expecting. Hence the change in file size.</p> <p>It's possible to change the encoding used for the save as described by dbc above:</p> <blockquote> <p>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error when trying to self-update composer<p>when I trying to self-update composer I get "Permission denied" error message, but when I try to do same command ...
<p>In terminal with sudo I type full path to composer.phar and it's work for me!</p> <p>sudo /usr/bin/composer.phar self-update</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: XPages appendDocLink on Anonymous User Error<p>I am attempting to replace my 'traditional Notes' User Name and Password Request form with one designed in XPa...
<p>Make sure Anonymous user can access the default view of the database - so make it accessible to public access users. appendDocLink() method requires this view in order to append doc link to RT item.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to run the subquery with the non equality clause on Spark?<p>I have this query and I want to execute it on spark </p> <pre><code>SELECT A.PFR, A....
<p>Just use <code>rank()</code>:</p> <pre><code>SELECT A.PFR, A.MFR, A.MST, RANK() OVER (PARTITION BY PFR, MFR ORDER BY MST DESC ) as rank FROM Table1 A; </code></pre> <p>If <code>rank()</code> doesn't do exactly what you want, then perhaps <code>row_number()</code> or <c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Having trouble styling SVG with CSS?<p>Hi I'm new to using SVG's but i thought the whole idea of SVG's is that you can change the background-color etc. Anywa...
<p>Basically, you cannot change the color of an SVG used as an actual image or background-image. </p> <p>CSS can only affect <strong>inline</strong> SVG in the page HTML.</p> <p>EG.</p> <p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippet-code-css lang-css prettypr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mutate to obtain values before and after a value<p>I have a a data set with a format similar to:</p> <pre><code>amount | event ------ | ------ 3 | FAL...
<p>You can use this code:</p> <pre><code>library(dplyr) d %&gt;% mutate(before=ifelse(event,lag(amount),NA), after =ifelse(event,lead(amount),NA)) # amount event before after #1 3 FALSE NA NA #2 4 FALSE NA NA #3 6 TRUE 4 7 #4 7 FALSE NA NA #5 3 FAL...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Make dataframe from list of lists but each element a column<p>I would like to create a dataframe from a list of lists where the resulting dataframe has a col...
<p>If the names are always a match one-by-one, you can simply do,</p> <pre><code>do.call(rbind, lapply(myList, unlist)) # L1 L2 L3 a1 a2 a3 b1 b2 b3 #[1,] 1 2 3 1 2 3 1 2 3 #[2,] 4 5 6 4 5 6 4 5 6 #[3,] 7 8 9 7 8 9 7 8 9 </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I customize a GELF appender for log4j2?<p>We have a log4j2-graylog.xml file that we use to bridge our log4j output to GrayLog 3.0 using the <code>biz....
<p>Based on <a href="https://logging.apache.org/log4j/2.0/manual/lookups.html" rel="nofollow noreferrer">information</a> from the log4j2 manual, I was able to get the thread name by adding <code>threadName</code> to the <code>additionalFieldTypes</code> and using a <code>%t</code> pattern specifier like so:</p> <pre cl...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I fix these JSLint errors?<p>I'm trying to fix some errors according to JSLint and there are some errors I can't get rid of:</p> <pre><code>line 46 c...
<blockquote> <p>Missing 'new'.<br> SortPosts(categories[categoryNumber].textContent);</p> </blockquote> <p>Functions with names starting with capital letters are, by convention, constructor functions. Yours is not. Rename the function to <code>sortPosts</code>.</p> <blockquote> <p>Unexpected '('.<br> ...