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: Force Cassandra batch to execute in my order java<p>I figured that if i execute batch in Cassandra(using java driver) no matter where the update/insert/delet...
<p>Batching in Cassandra doesn't imply any particular order in which the batched statements are executed. In fact all statements will be executed using the same timestamp, just as if all statements have been executed concurrently at the same time. In your example the delete statement would be effective over the inserts...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error in MATLAB.Undefined function 'det' for input arguments of type 'embedded.fi'<p>I have already seen the link <a href="https://stackoverflow.com/question...
<p>If you check the documentation for <code>det</code>, it says that the input must be single or double. Fixed point is probably not supported. As your matrix is of fixed size 4, it's simple to replace the function:</p> <pre><code>det2=@(M)M(1)*M(4)-M(2)*M(3) </code></pre> <p>Then use det2 instead of det.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rules of arg, kwarg unpacking<p>What are all the places that (kw)arg unpacking can be used?</p> <p>For example:</p> <pre><code>&gt;&gt;&gt; a={1:2} &gt;&gt...
<p>Unpacking works in a tuple too. However, a single-item tuple (also known as a singleton) has to include a comma at the end of the expression enclosed in the parentheses, or else the parentheses would be treated as simple grouping, so do instead:</p> <pre><code>(*a,) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Update Jenkins which is currently running as a Linux service<p>How do I update jenkins from a existing jenkins install running as a Linux service without loo...
<p>First, you need to find where your jenkins.war file is installed:</p> <pre><code>locate jenkins.war </code></pre> <p>On my Centos machine, it's here: /usr/share/jenkins/jenkins.war</p> <p>Stop the Jenkins service:</p> <pre><code>service jenkins stop </code></pre> <p>Next, you can backup the existing jenkins.war...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: if user start typing in textbox value change to input else if user didn't type any thing value change to an specific string in C#<p>I have a listview and cre...
<p>This is just psuedocode but the concept is there and you need to implement the text change event for searching , you can do additional changes in event handler.</p> <pre><code>Textbox myTxtbx = new Textbox(); myTxtbx.Text = "Enter text here..."; myTxtbx.OnFocus += OnFocus.EventHandle(RemoveText); myTxtbx.LoseFocus...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how recursive function works level by level?<p>I have trouble on understating how recursion works, I have been struggling this for a while! Could anyone can ...
<p>First thing you have to understand about recursion is that you are executing the same method but you aren't <em>jumping</em> around in it. You get <em>different</em> executions. Let's start simple without recursion:</p> <pre><code>public void a() { System.out.println("&gt;&gt; before b()"); b(); System.out.pr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I encrypt multiple Web.config-sections at once with aspnet_regiis.exe -pef?<p>By running:</p> <pre><code>aspnet_regiis.exe -pef "connectionStrings" C...
<p>I successfully used aspnet_regiis to encrypt (and decrypt) two sections, connectionStrings and appSettings, by executing aspnet_regiis twice in a DOS .bat file. Looks like you have to execute aspnet_regiis once for each section you want to encrypt (and decrypt).</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change height value from px to % in .dotdotdot script<p>How can I change the height value from 100 pixels to a percentage value? Lets say 50%. I'm fairly new...
<p>Rather than modifying the <code>dotdotdot</code> code, it might be simpler to calculate a pixel value based on your percentage and pass that pixel value to <code>dotdotdot</code>.</p> <p>For example:</p> <p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippet-code-j...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it safe to store database ids in HTML pages?<p>Recently I've been doing some front-end code using JQuery, AngularJS &amp; AJAX. For server side coding I u...
<p>The issue of preventing a user from updating a record when they don't have permissions to do so is somewhat independent of whether or not it's okay to expose a particular id. Even if you didn't expose the id in html, there are other ways to discover ids: brute force iteration, for instance. Relying on the secrecy of...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can i change this android layout?<p>Layout Image :</p> <p><a href="http://s18.postimg.org/kihvabse1/Capture.jpg" rel="nofollow">http://s18.postimg.org/k...
<p>To achieve this layout you can have two way :</p> <ol> <li><p>Use SymmetricGridview and Customize it. I hope it will work. <a href="https://github.com/felipecsl/AsymmetricGridView" rel="nofollow">https://github.com/felipecsl/AsymmetricGridView</a></p></li> <li><p>Use list view and use adapter. In adapter inflate th...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Check if an object has changed<p>Is there a more native way (e.x. a built-in function) with less userland code to check if an objects property values have ch...
<p><strong>What you are trying to do?</strong> </p> <p>You are trying to compare object with itself, after some chain of "unknown" operations to check if the object has changed. If this is true, there are some logical points to observe. At first, if you want to compare object with itself, you've got only two options: ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Call java class from other project in soapui<p>I have 2 soapui projects. In 1st I have groovy script with my java class and all methods and I need to call it...
<p>It will not work you have to import jar of that 2 project or make a web service client of 2nd project's web service in your first project. </p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get Object returns empty string as values Golang<p>I am trying to get users from the DB with gorm and I get a 200 response but the user object got has empty ...
<p>In your service logic, you are returning a pointer and not a value.</p> <pre><code>func GetUser(userId string) (*users.User, *errors.Error) { fmt.Println("This is user ID 2 %s", userId) result := &amp;users.User{} if err := result.Get(database.DB, userId); err != nil { return nil, err } return &amp;u...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can a string ever get shorter when converted to upper/lowercase?<p>A string may get longer (in terms of Unicode codepoints) when converted to upper or lower ...
<p>I think this may be implementation dependent. I'll answer based on the CPython source.</p> <p>It seems to me that there are two possible situations where calling <code>lower</code> on a string can make it shorter.</p> <ol> <li>Some combination of two Unicode points next to one another get converted into one Unicode ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is this Scala construct doing?<p>I've been using Play! Framework with Java and would like to try it out with Scala. I've started on a Scala book but the...
<p>You are essentially calling <code>Action.apply()</code>, which is defined <a href="https://github.com/playframework/playframework/blob/master/core/play/src/main/scala/play/api/mvc/Action.scala#L305" rel="nofollow noreferrer">here</a> in <code>ActionBuilder</code>. The first and only parameter of the <code>apply()</c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Windows Form showing wrong value in ComboBox<p>Here is the data it is connected to:</p> <p><a href="https://i.stack.imgur.com/7uvtu.jpg" rel="nofollow noref...
<p>Use <code>SelectedValue</code> property which gets the value of <code>ValueMember</code> property which in your case is <code>privilege</code></p> <blockquote> <p>Gets or sets the value of the member property specified by the ValueMember property.</p> </blockquote> <pre><code>private void button1_Click(object ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Storing matrices in an array in visual basic 6<p>I am new to vb6 programming and i have the following problem. </p> <p>I am computing some 2x2 matrices insi...
<pre><code>Dim m As Variant ReDim m(1 To 2) Dim ar1() As Long, ar2() As Long ReDim ar1(1 To 2, 1 To 2) ReDim ar2(1 To 2, 1 To 2) m(1) = ar1 m(2) = ar2 'Accessing m(1)(1,2) = 42 </code></pre> <p>Note that this copies <code>ar1</code> and <code>ar2</code> into <code>m</code>, not puts them by reference.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Custom Java annotation that calls a REST API<p>I would like to create a Java annotation <code>@Ping</code> that sends a <code>POST</code> request to a REST A...
<p>Create a method level annotation and Use AOP to write a logic that will call your rest api</p> <pre><code>@Around("execution(@Ping * *(..))") public void entr(ProceedingJoinPoint joinPoint) throws Throwable { System.out.println("before method"); joinPoint.proceed(); System.out.println("after method"); } </code><...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android in-app purchase Pro Status<p>I am building a android app which i would like to have in-app billing for.</p> <p>I would just like to ask a general qu...
<p>You should definitely use <a href="https://developer.android.com/google/play/billing/api.html#managed" rel="nofollow">Managed In-app Products</a>.</p> <p>Once the product is purchased do not consume it. Google Play Services keep track of all purchased products and syncs it between devices. You just check if user ow...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cancatenate the range between two cells in a sheet from addresses of two cells in another sheet<p>I have two cells in sheet1 that contain address for two cel...
<p>Your syntax is incorrect because you're passing the whole parameter as a string, while it should be variables and strings. This should work, say all the rest is good: </p> <pre><code>Set wss = Sheets("sheet1").Range(sheet2.Cells(1, 1).Value &amp; ":" &amp; sheet2.Cells(1, 2).Value) </code></pre> <p><strong>Explana...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error while running the ping federate agentless sample application<p>I tried to run the sample application in the agentless integration kit. Login page is di...
<p>It seems you're running with Java 1.8 but the sample application is only supported on Java 1.7 so far. </p> <p>Having said that, you can make the agentless samples run under 1.8 with a few minor modifications as noted below. This is currently on the list of things for Ping development to fix. It should be noted tha...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Deprecation warning about boolean casting for *args<p>In upgrading from Rails 4.1.9 to 4.2.0, I received the deprecation warning <code>You attempted to assig...
<p>Although I was not explicitly setting a boolean with this call, I was implicitly setting one. The invocation of</p> <pre><code>Factory(:invitation) </code></pre> <p>calls the factory definition in the <code>factories.rb</code> file. The definition of the Invitation factory does set a boolean field of Invitation. ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Where to remove observer for NSNotification in Swift?<p>Where should I remove the observer for <code>NSNotification</code> in Swift, since <code>viewDidUnloa...
<p>Use below method which functions same as <code>dealloc</code>.</p> <pre><code>deinit { // Release all resources // perform the deinitialization } </code></pre> <blockquote> <p>A deinitializer is called immediately before a class instance is deallocated. You write deinitializers with the deinit keyword, s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R Turning several functions to one object using Object Oriented Programming (S3 and S4)<p>I'm trying to understand how to turn functions into object oriented...
<p>In R, object-oriented programming is implemented in several very different ways.<br> The S3 type of OO is the most used because it's very simple and yet does a good job at having what seems to be the same functions behave differently with different types of objects. A good reference is <a href="http://adv-r.had.co.n...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Selenium Python wait for animated element to stop<p>I am using Selenium with Python and I have not figured out how to wait for an animated element that moves...
<p>You should be able to use JavaScript &amp; jQuery to do this. For example:</p> <pre><code>def wait_for_animation(self, selector): is_animation_in_progress = self.is_element_animated(selector) while is_animation_in_progress is True: sleep(.5) is_animation_in_progress = self.is_element...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I restore lifecycle callbacks in sails?<p>After testing model creation, I noticed that lifecycle callbacks were not getting called and upon reading W...
<p>Your callback need to be on the exports object, its not an attribute.</p> <pre><code>/** * User.js * */ var bcrypt = require('bcrypt'); module.exports = { attributes: { 'email': { type: 'email', required: true, unique: true }, 'username': { type: 'string', required: tr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Django Queryset Iteration Optimization<p>I've noticed that my view is taking a long time to load. I believe this is because of the number of queries I'm perf...
<p>I don't understand the point of the ValuesQuerySet. You loop through it, but you then use the ID to do another db lookup in each row, to query the original item! Why do you do that? Why get the values at all? Why not just:</p> <pre><code>facility_list = Facility.objects.all().select_related('current_address__region...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: IText merge documents with acrofields<p>I currently have a PdfReader and a PdfStamper that I am filling out the acrofields with. I now have to copy another p...
<p>Depending on what you want exactly, different scenarios are possible, but in any case: you are doing it wrong. You should use either <code>PdfCopy</code> or <code>PdfSmartCopy</code> to merge documents.</p> <p>The different scenarios are explained in the following <a href="https://www.youtube.com/watch?v=6YwDME0Fl1...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Most elegant way of using recv in C++ / STL?<p>All I have found until now about receiving data with sockets (<code>recv</code>) is in plain old C.</p> <p>An...
<p>If you don't mind using 3rd-party libraries, <a href="http://boost.org" rel="nofollow">Boost</a> has nice templates for handling sockets in C++. Take a look at the <a href="http://www.boost.org/doc/libs/1_57_0/doc/html/boost_asio/overview/networking/bsd_sockets.html" rel="nofollow">equivalences</a> between plain old...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I use sentry with laravel 5?<p>I have tried installing sentry in laravel 5 but it doesn't work. I would like to know if anyone has done it and how to...
<p>I have this working.</p> <ol> <li><p>There is no official support right now for Sentry in L5. They state this right on their website. They are working on it however.</p> </li> <li><p>Add the following to your composer.json file in the require section.</p> <pre><code> &quot;cartalyst/sentry&quot;: &quot;dev-feature...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why current_thread() always return MainThread?<p>I started learning threads in python.<br> I saw this code here that says that if i want to run 2 threads at ...
<p>Change this:</p> <pre><code>if __name__ == '__main__': Thread(target = displayNums()).start() Thread(target = stam()).start() </code></pre> <p>to this:</p> <pre><code>if __name__ == '__main__': Thread(target = displayNums).start() Thread(target = stam).start() </code></pre> <p>The thread target i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting Camera Info in Cordova<p>How to get the camera information like megapixels, f 1/3 and other infos using cordova. I'm developing a simple project wher...
<p>It's not directly possible with Cordova.</p> <p>It's mentioned in the <a href="http://cordova.apache.org/docs/en/3.3.0/cordova_camera_camera.md.html#Camera" rel="nofollow">documentation</a></p> <blockquote> <p>Note that information about the camera's resolution is unavailable</p> </blockquote> <p>You have to wr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get current page name in wordpress<p>I want to put the Current page title in wordpress but unable to get the page name, i have tried to use following ...
<p>$page_name = $wp_query->post->post_title;</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Removing an element added by ::before pseudo selector<p>I have the following case: (styling is done in SASS and unnecessary stylings are omitted.)</p> <pre...
<p>Only CSS can remove pseudo element, so you need to have an other class that <code>display:none;</code> the before. First declare that class in the CSS :</p> <pre><code>.header { ... &amp;::before { ... position: absolute; height: 0.5rem; ... } &amp;.no-before::before{ display:none; } ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Special charaters show square box in webservice response<p>Here is the word pronounciation coming in my web services response <strong>tækˈsɑ:nəmi</strong> bu...
<p>I have found the way to solve this after consulting with a genius guy.</p> <pre><code> DefaultHttpClient httpClient = new DefaultHttpClient(); HttpPost httpPost = new HttpPost(url); httpPost.setHeader("Content-Type", "application/x-www-form- urlencoded"); HttpResponse ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Loop in Python List using more than one item per loop<p>So I'm writing a script for a program called Abaqus.... and I have a list of numbers, and I need to l...
<p>Assuming I've understood your question correctly, you could use an <code>iterator</code>:</p> <pre><code>listOfSteps = [1, 4, 7, 10, 17, 22, 28, 29, 30, 43, 47, 50] fileNameCreate = 0 it = iter(listOfSteps) for a in it: b = next(it) c = next(it) session.viewports['Viewport: 1'].odbDisplay.setFrame(s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What many-to-many relation I have to chose?<p>When I do have a table:</p> <p>user: userID</p> <p>product: productID</p> <p>and a table named user_product:...
<p>It depends on the application.</p> <p>Is a user always associated with product? Probably not, and if so, there is a '0..infinity' on the product side of the relation.</p> <p>Is a product always associated with a user? Probably yes, and if so, there should be a '1..infinity' on the user side of the relation.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Use LINQ to make a table using alternative addresses from two tables<p>I'm trying to build a single data table from two sql tables. I'd like to use a seconda...
<p>Haven't written VB.NET in a while, but unless I have terribly misunderstood something, you're trying to do a left join between <code>Building</code> and <code>Building_Alternate_Address</code>, in which case you should be able to do it like this, provided <code>Building_Alternate_Address</code> only contains rows wi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Forced to return into while loop<p>I am writing a Binary Tree. On trying to delete a node that has two children, I have written a method which searches for t...
<p>I think the issue is your recursion. Let's assume a really simple structure. A node with no left or right (both null).</p> <p>First, leafnode is null to begin with. Given the structure we can't go into the if-block. Given the flag==false, we can't go into the while loop. So you'll get a NPE when you return.</p> <p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Restoring node-modules and bower_components based on script contents<p>How do I restore node-modules and bower_components?</p> <p>I want to source control fi...
<p>You can just set up a <code>package.json</code> for <code>npm</code> to install your node_modules using <code>npm install</code>. I believe bower also has something similar with <code>bower.json</code>. </p> <p>I think both <code>npm init</code> and <code>bower init</code> should get you started.</p> <p><strong>Ed...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: regex to catch every thing between occurrences of a word<p>I want a regex to catch everything inside occurrences of a specific word say <code>hello</code>. l...
<p>You need to use <code>s</code> (DOTALL) flag with this regex:</p> <pre><code>/(hello.*?)(?=hello|\z)/gmsi </code></pre> <p><a href="https://regex101.com/r/pZ8jL7/3" rel="nofollow">RegEx Demo</a></p> <ul> <li><code>\z</code> will match last character in multiline text.</li> <li><code>s</code> will match newline as...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: QueryDSL DateTime field formatted projection<p>I trying to do a query that returns the date and time part of a Datetime field using QueryDSL.</p> <p>The que...
<p>If you use Querydsl SQL this should work</p> <pre><code>Expression&lt;String&gt; dateExpr = Expressions.stringTemplate("convert(varchar, {0}, 103)", table.feLecutra); Expression&lt;String&gt; timeExpr = Expressions.stringTemplate("convert(varchar, {0}, 108)", table.feLectura); List&lt;Tuple&gt; results = query.from...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: The difference between x += y and x = x + y<p>I have this python code</p> <pre><code>x = [1, 2, 3] y = x x += [4] &gt;&gt;&gt; print(y) [1, 2, 3, 4] </code>...
<p>The object &quot;on the left&quot; handles the operator (usually, see the r-operator forms); in this case it is an <a href="https://docs.python.org/3/library/operator.html#inplace-operators" rel="nofollow noreferrer">Inplace Operator</a>.</p> <blockquote> <p>10.3.2. Inplace Operators</p> <p>Many operations have an “...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Listener in multithreading only called when passed anonymously, not when declared as member<p><sup><strong>Edit</strong></sup></p> <p>I figured it out:</p> ...
<p>You claimed that upon registering TickListener as Service's member variable, onTicket will not get called.</p> <p>This was not correct. I ran the code myself and it got called.</p> <p>Here is my code,</p> <pre><code>package com.company; public class Service { private Timer timer; Timer.TickListener tick...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: is it possible to skip this event captured when clicked on Inner div<p>I am using Jquery collapsable set for my Application .</p> <p>when clicked on the (He...
<p>You can filter it regarding event target class:</p> <pre><code>$(document).on('collapsibleexpand', '.TreeMenu', function(e){ if($(e.target).hasClass('TreeMenuChild')) return; // skip it alert('sss'); }); </code></pre> <p><a href="http://jsfiddle.net/u8fjv78s/3/" rel="nofollow"><h2>-jsFiddle-</h2></a></p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: theme and mode path infer issue with ace.js and Angular<p>Sorry, the question unfortunately hasn't got much detail as I am not sure what exactly is required ...
<p>I finally was able to make my code work. My setup is different. </p> <p>The reason adding <code>script</code> tag explicitly made my code work is because <code>By default ace detcts the url for dynamic loading by finding the script node for ace.js. This doesn't work if ace.js is not loaded with a separate script ta...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Copy file in java to directory that may not exist<p>I am trying to copy a file to a path that may not exist with this code</p> <pre><code> public static ...
<p>You can create all paths with the code snippet below, e.g.:</p> <pre><code>File file = new File("C:\\test\\test1\\test2\\test3\\copiedFile.exe"); file.getParentFile().mkdirs(); FileWriter writer = new FileWriter(file); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Which part of a Javascript statement is literal?<p>I know that fixed values are literals, and variable values are variables. If I have a simple statement suc...
<p>The term "literal" refers to the notation that you use to represent the value that you're assigning to the variable. It does not refer to the value itself, but the way it is written in code.</p> <p>So in your simple example, the string value <code>"Audi"</code> is assigned to the variable <code>car</code> by writin...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Postgres preferring costly ST_Intersects() over cheap index<p>I'm executing a rather simple query on a full planet dump of OSM using Postgres 9.4. What I wan...
<p>maybe try something like this..?</p> <pre><code>WITH wy AS ( SELECT * FROM planet_20141222.ways WHERE ((tags-&gt;'highway') IS NOT null) AND (lower(tags-&gt;'ref') LIKE lower('A8')) ) SELECT DISTINCT wy.id FROM wy, planet_20141222.polygons py WHERE py.id=51477 AND ST_Intersects(py.geom,wy.linestring); </...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Facebook login session with a second login<p>I'm developing an android app that performs a two-stages login.</p> <p>First the user logs in using a Facebook ...
<p>Since the party name and password are already stored in your database, then you should just store the user association to a party as well.</p> <p>So one way of many</p> <ul> <li>Store a table with all the party names, party ID and passwords</li> <li>Store a table with the users, user ID and access tokens</li> <li>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to update image in cache when image changed on server with SDWebImage<p>I am using SDWebImage library to download images from server. <a href="https://gi...
<p><code>SDWebImage</code> does some caching by default, so it would be better to use a new URL if the image changes. So, for instance, if you have control over the URL and can change it every time the image has changed, you could do that.</p> <p>If that's not the case, try using <code>SDWebImageRefreshCached</code> i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Excel formula is doing the calculation, but still displaying the first answer in the cell<p>Pulling my hair out over this. When I use the drag button on my s...
<p>The answer was given as a response to my post by DataSmarter.</p> <p><a href="http://i.stack.imgur.com/eOiJx.png" rel="nofollow">http://i.stack.imgur.com/eOiJx.png</a></p> <p>Clicking this 'Calculation Options' button given on the 'Formulas' tab, and selecting the 'Automatic' option fixed this issue.</p> <p>Thank...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I add a branch from a new remote to an existing Git project?<p>I have an existing local Git repository and would like to add a branch corresponding to...
<p>Set up the remote with</p> <pre><code>git remote add -t template -f framework &lt;repo_url&gt; </code></pre> <p>which will also fetch the ref for just the one branch on the remote; and then checkout the branch into a new local branch using</p> <pre><code>git checkout -b template framework/template </code></pre> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error converting data type nvarchar to bigint caused by IN operator in Stored Procedure<p>Stored Proc:</p> <pre><code>ALTER PROCEDURE [dbo].[MyProcedure] ...
<p>Create following tabular function as SplitString in the database. When you want to select the items; use this:</p> <pre><code>Select Part from SplitString(@YourValues, ',') </code></pre> <p>Above select statement is used in your query.</p> <pre><code>SELECT Col1, Col2, Col3 FROM MyTable WHERE SomeCol_Big...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: OpenNLP - Tokenize an Array of Strings<p>I am trying to tokenize a text file using the OpenNLP tokenizer. What I do, I read in a .txt file and store it in a ...
<p>As compiler says, you try to assign array of Strings (result of <code>tokenize()</code>) to String (<code>tokens[i]</code> is a String). So you should declare and use <code>tokens</code> inside the inner loop and write tokens[] there, too:</p> <pre><code> for (String[] output : allRows) { // get current ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: iteratively appending N items to list gives last item N times instead<p>I am accessing a list of dictionary items <code>list_of_dict = [{'ka':'1a', 'kb':'1b'...
<p><strong>Whats wrong</strong></p> <p><code>my_list.append(my_dict)</code> appends a <strong>reference</strong> to the <code>my_dict</code> object to <code>my_list</code>. Therefore, at the end of the <code>for</code> loop in your example, <code>my_list</code> is a list of references to the exact same dictionary in m...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Trouble with Go Routines and its concurrency<p>TL;DR accepting and connecting two separate SETS of connections. Want to do it with RPC concurrently.</p> <p>...
<p>In the end, I think the issue was that I was attempting to <strong>pass</strong> in listeners to the <em>Go routine</em>, thus having each go routine having a dependancy with the main thread. The working solution ended up being as simple as this:</p> <pre><code>func main(){ ... node_ip_port := "127.0.0.1:9000" c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PHP object _construct function<p>I have the following code </p> <pre><code>&lt;!doctype html&gt; &lt;head&gt; &lt;meta charset = "utf-8"&gt; &lt;title&gt;O...
<p>The constructor should be __construct() with two underscores.</p> <p><a href="http://php.net/manual/en/language.oop5.decon.php" rel="nofollow">http://php.net/manual/en/language.oop5.decon.php</a></p> <p>And it will output "Constructor called with parameter one" in your code.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cutting a folder from url with .htaccess, said folder can be anywhere in the url<p>I have thoroughly searched for ways to remove a folder that is in the midd...
<p>Try this code in root .htaccess:</p> <pre><code>Options +FollowSymlinks -MultiViews RewriteEngine On RewriteRule ^(company)/((?!pages/).+)$ $1/pages/$2.php [L,NC] RewriteCond %{DOCUMENT_ROOT}/$1\.php -f [NC] RewriteRule ^([^.]+)/?$ $1.php [L] </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using C++ DLL in VB6 app<p>I am following the guide on: <a href="https://msdn.microsoft.com/en-us/library/ms235636.aspx" rel="nofollow">https://msdn.microsof...
<p>There are several points wrong in that what you are doing. Funny thing is,nevertheless it should work. </p> <p>If you specify a DLL directly, you do not need to register it with regsvr32.</p> <p>Read: <a href="https://msdn.microsoft.com/en-us/library/aa716201(v=vs.60).aspx" rel="nofollow noreferrer">https://msdn.m...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: python requests: how to authenticate with post and access file over proxy<p>I am trying to download a research article pdf via a university proxy into which ...
<p>You're using <code>requests.Session()</code> in order to save cookies/session that the website gives you, yet you're using <code>requests.get()</code> instead of <code>session.get()</code> for your initial request where you fetch your <code>longproxy</code>. Changing your</p> <pre><code>r2 = requests.get(long...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Control page behavior by key board<p>I need control the behavior page by key board ... I was trying like this: </p> <pre><code>this.showSearcherCustomerKey...
<p><code>keydown</code> and <code>keypress</code> will give you different values for <code>event.keyCode</code>. I guess you have to use <code>keydown</code> instead.</p> <p>Look this <a href="http://www.asquare.net/javascript/tests/KeyCode.html" rel="nofollow">Keyevent Tester</a></p> <p>I just tested your code with ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to highlight a point along a curve in ggplot<p>I have the below code to plot a probit model comparing the chance of success based on a maximum temperatur...
<p>Find the closest value to <code>y = 0.5</code>:</p> <pre><code>closest_value &lt;- which(abs(new.data$fit - 0.5) == min(abs(new.data$fit - 0.5))) </code></pre> <p>Calculate slope at this point:</p> <pre><code>slope_at_closest_value &lt;- (new.data[closest_value, "MaxTemp"] - new.data[closest_value - 1, "MaxTemp"]...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Displaying corresponding value of a column by matching it to value of the second column<p>Generated two datasets as below:</p> <pre><code> H&lt;-data.frame...
<p>May be you can try</p> <pre><code>ind &lt;- which.min(H$perc) label1 &lt;- paste0("H difference ", H$diff[ind], "% change count") label2 &lt;- paste('X2 value', H$X2[ind]) xyplot(X8+X9+X10~X1,H,type=c('p','l','g'), col = c('yellow', 'green', 'blue','red'), ylab='Count',layout=c(3, 1), xlab=paste(label1, label2, se...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: jquery function working well in chrome, but throws error in firefox<p>please help me out with this error that i get in my Firefox. the function is working we...
<pre><code>TypeError: jQuery(...) </code></pre> <p>This indicates, there's a conflict in your jQuery or jQuery library not included, or may be there's no such function. Try including jQuery library before your script, still occurs try including ,</p> <pre><code>jQuery.noConflict(); </code></pre> <p>before your scr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: When should element.all(locator).then(thenFunction) or element.all(locator) be used?<p>In protractor, what's the difference between (<a href="https://github....
<p>Essentially, <code>element.all</code> returns an <a href="https://www.protractortest.org/#/api?view=ElementArrayFinder" rel="nofollow noreferrer">ElementArrayFinder</a> object but <code>await element.all</code> will return an array of <a href="https://www.protractortest.org/#/api?view=ElementFinder" rel="nofollow no...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Setup of the project was unable to open database on another machine. my project is in c# windows application with sqlite database connection<p>I have inserte...
<p>try to use this connection string</p> <p> </p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Xpages DbLookup and combo boxes<p>Is it possible at all, in XPages, to have 3 combo boxes that are dependant from one another?</p> <p>Let's say I have Provi...
<p>Ben, not sure the @function implements using an array as a key, at least, I never got it to work.</p> <p>Just use the Domino view object and getAllEntriesByKey</p> <pre><code>var linksView:NotesView = session.getCurrentDatabase().getView("myview"); var search = new java.util.Vector(); search.add("Checksheet"); sea...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C++ Design issues: Map with various abstract base classes<p>I'm facing design problems and could do with some external input. I am trying to avoid abstract b...
<p>About casting I agree with with @rufflewind. The casts mean different thing and are useful at different times.</p> <p>To coerce a region of memory at compile time (the decision of typing happen at compile time anyway) use static_cast. The amount of memory on the other end of the T* equal to sizeof(T) will be interp...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Stop list item stacking in bootstrap navbar<p>I've created a bottom navbar (footer) in Twitter Bootstrap to contain some social media links:</p> <p><img src...
<p>So there were 3 issues I needed to solve:</p> <ol> <li><strong>Display the social media icons horizontally rather than stacked vertically when window width falls below a certain size.</strong></li> </ol> <p>As @fructurj pointed out this can be fixed by adding <code>display: inline-block</code> to the <code>navbar-...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python: Not able to find error in my code. filenames returned by os.walk()<p>I have following directory structure:</p> <pre><code>DICOMs: Dir_1 ...
<p>This is probably closer to what you meant to do:</p> <pre><code>for dirpath, dirnames, filenames in os.walk(dire_str, topdown=True): # Do some stuff that is per directory for filename in filenames: # Do some stuff that is per file pass </code></pre> <p>And if you wish to only operate on fil...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: my ojet application does not work in mozilla firefox or internet explorer<p>my ojet application does not work in mozilla firefox or internet explorer. It say...
<p>Try adding below tag by specifying encoding type in your view page i.e html file. Refer <a href="https://stackoverflow.com/q/24604466/6572971">this thread</a> for more information.</p> <pre><code>&lt;meta http-equiv="content-type" content="text/html; charset=utf-8" /&gt; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Generic constraint inherit from generic base<p>Sorry for the unclear title, I hope someone can clarify.</p> <p>I want to create a generic interface where I ...
<p>It depends on why you need <code>U</code> for? If you don't need it for constraint you can easily create non generic base and use that as your constraint</p> <pre><code>public class Base { } public class Base&lt;T&gt; : Base { } public interface ICommentRepository&lt;T&gt; : IBaseRepository&lt;T&gt; where T...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to pass a value and echo it within a form<p>hello i have a page where users can register, and so after registeration i want to pass the username and pass...
<pre><code>echo '&lt;form ACTION="'.$loginFormAction.'" METHOD="POST" name="one" id="one"&gt; &lt;input type="text" placeholder="Username" name="Username" value="'.$_POST["Username"].'" &gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;input type="password" placeholder="Password" name="Pa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Call js file in angular directive using grunt<p>I wrote a directive which work great before using the <code>grunt build</code> command. Indeed I have this in...
<p>You can try grunt-ng-constant, with two configurations one for local environment and other with production environment, and in the build task add the production ngconstant before all process, example:</p> <pre><code>ngconstant: { options: { dest: 'app/scripts/configuration.js', ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Put JRadioButtons in new rows in ButtonGroup?<p>Is there a way to put JRadioButtons on new lines in ButtonGroups? I don't mean 1 button on every line but for...
<p>You can add the radio buttons in a <code>GridLayout</code> or a <code>GridBagLayout</code> and in the sametime add <code>JRadioButtons</code> to a <code>ButtonGroup</code> as well.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Send data over http asynchronously<p>I am new in C# and I wold like to send web request asynchronously. I use HttpWebRequest with method <code>POST</code>. P...
<p>Assuming that you are using C# 5.0 you should be using the new <code>async-await</code> keywords with the Async functions.</p> <p>Instead of <code>GetRequestStream()</code> you can use <code>Stream s = await request.GetRequestStreamAsync()</code></p> <p>When you want to asynchronously receive the response you woul...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can I use the OpenCV Mat like a normal matrix?<p>Can I use the opencv Mat like a normal matrix for multiply them, sum them and other things. </p> <p>Like li...
<p>My fault. The error told me everything. My error was my matrix had not the correct type. I change the type to <code>CV_64FC1</code> and everything went right.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to convert Js.Json.t to Js.t('a)?<p>I have encoded an object via bs-json and want to send it as a data via post using bs-axios.</p> <pre class="lang-ml ...
<p>There's no way to safely convert a <code>Js.Json.t</code> to <code>Js.t</code>, as the latter represents a JavaScript object, and JSON doesn't just represent objects. But <code>bs-axios</code> seems to throw safety out the window anyway, so you could just cast it unsafely:</p> <pre><code>external jsonToObjects : Js...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to use WebChannelFactory to make requests to WebAPI/OdataController functions/actions?<p>I have implemented OdataController(s) for my Web-API....
<p>So the answer is a resounding YES. I just implemented the service contract and set up Routing to make the service operations work.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Iterating twice over HashMap Java<p>I have a HashMap declared as </p> <pre><code>static HashMap&lt;String,ArrayList&lt;Integer&gt;&gt; inverted_index = new ...
<pre><code>while (it.hasNext()) { Map.Entry pair = (Map.Entry)it.next(); writer.println(pair.getKey() + " " + pair.getValue()); it.remove(); // &lt;- This is your problem } </code></pre> <p>You're <em>removing</em> the entries while you're iterating through them. When the loop exits, you will have deleted...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What's the proper way of passing named functions to Javascript's higher-order functions?<p>I'm trying to use Javascript's higher-order functions for function...
<p>The problem are those optional arguments - that <code>map</code> and <code>reduce</code> pass to the callbacks, and that <code>parseInt</code> and <code>Math.max</code> unconcernedly accept.</p> <p>What you basically need to do is fix their arity, so that they take only one resp. two arguments:</p> <pre><code>Func...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to pass javascript date to laravel 4 API timestamp<p>This is the format of my <strong>Javascript</strong> date using <code>new Date()</code></p> <p><cod...
<p>It is better to do in the server side. You should do <code>date(&quot;Y-m-d H:i:s&quot;)</code></p> <p>So you shall use in the frontend (However it will executed at server)</p> <pre><code>&lt;?php $DateTime = date(&quot;Y-m-d H:i:s&quot;); //youroperationshere ?&gt; </code></pre> <p>Note : This is the format suppor...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to total table based on specific column or index with jQuery?<p>I have a table like blow code:</p> <pre><code>&lt;table class="somting"&gt; &lt;tr&gt;...
<p>You can use <a href="http://api.jquery.com/nth-child-selector/" rel="nofollow">:nth-child()</a>:</p> <pre><code>sum=0; $('.somting td:nth-child(3)').each(function(){ sum += parseInt($(this).text()); }) //log sum </code></pre> <p><strong><a href="http://jsfiddle.net/vodjfgrh/" rel="nofollow">Working Demo</a></st...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: gaussian process regression in multiple dimensions with GPflow<p>I would like to perform some multivariant regression using gaussian process regression as im...
<p>The shape of <code>z</code> must be <code>(N, 1)</code>, whereas in your case it is <code>(N,)</code>. However, this is a missing check in GPflow and not your fault.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: App crashing on some random devices<p>Today I encountered a Strange Problem in my app. SO in first activity, there is a navigation drawer with some items lis...
<p>You seem to be using three different item types, and you're respecting <code>convertView</code>. This means that you might be handed a different layout by the OS than you are expecting back, as it's being recycled. For example, you might get the <code>home</code> layout back, which does not appear to have a <code>ti...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: OnLocationChanged is never called<p>I made service to get location changes. But even if I requested for LocationUpdates, onLocationChanges(Location loc) is n...
<p>I found a problem. GPS in my phone isn't working. If I use only the network provider it works. Other GPS apps can't get any location from gps too.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Expand text in a JavaFX component<p>I have a String (about a paragraph long, contains newlines and unicode) that I'm displaying in a JavaFX component (Right ...
<p>Here's an example using a collection of <code>Text</code> objects in a <code>TextFlow</code>. Doing this enables you to register a mouse handler directly on each text object. This also sets a CSS pseudoclass on the text object, so you can easily change the style of the expanded word with a CSS stylesheet.</p> <pre>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error when inflating CardView<p>I am using a RecyclerView to hold a list of CardViews. On my device running Lollipop 5.0.2, the app runs fine and the list di...
<p>From the official notes of <a href="http://android-developers.blogspot.be/2014/10/appcompat-v21-material-design-for-pre.html" rel="nofollow">appcompat v21</a></p> <blockquote> <p>Why are there no ripples on pre-Lollipop? A lot of what allows RippleDrawable to run smoothly is Android 5.0’s new RenderThread. To opt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change Font(Text) Color using Color Picker in Vue js<p>I want to change font(text) color when user pick it from color picker,I had made this but it wont work...
<p>To dynamically assign a css color value to a html element you can use <code>:style="{}"</code> . Like this </p> <pre><code>&lt;template&gt; &lt;div&gt; &lt;textarea :style="{color:color}"&gt;&lt;/textarea&gt; &lt;v-color-picker v-model="color" /&gt; &lt;/div&gt; &lt;/template&gt; &lt;script&gt; export def...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a way to add a ToolTip to an MDI Parent Form in VB6?<p>I'm currently working on a project that utilizes an MDI Form. What I would like to achieve is...
<p>I'm not aware that any true menus on a VB6 for (even non-MDI) have a tool-tip property; hence, neither does the MDIForm when one its child forms has its menu displayed.</p> <p>However, there are a few controls that can be put on the MDI parent form. The most useful of these is probably the PictureBox, into which y...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Elements not where they are supposed to be (tables)<p><a href="https://i.stack.imgur.com/2rxPH.png" rel="nofollow noreferrer">I want the elements in the red ...
<p>Try moving your styles around, specifically: treat each element like a container or a box.</p> <pre><code>&lt;table style="width:70%;margin:0 auto;&gt; &lt;tr style="margin:0;border:none;padding:0;"&gt; &lt;td colspan="2"&gt;&lt;img src="pre_header.jpg" alt="" style="width: 100%"&gt;&lt;/td&gt; &lt;/t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rearranging character vectors in a row of a matrix<p>Suppose <code>M</code> has the following structure:-</p> <pre><code>&gt; dput(head(M)) structure(list(S...
<p>You need to split, strip the numbers and order, i.e.</p> <pre><code>M$SV &lt;- sapply(M$SV, function(i){i1 &lt;- strsplit(as.character(i), ' ')[[1]]; i2 &lt;- i1[order(as.numeric(gsub('\\D+', '', i1)))]; paste(i2, collapse = ' ')}) </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 add separate errorbars in ggplot to each item on the X axis?<p>I have this graph:</p> <p><a href="https://i.stack.imgur.com/sCtiH.png" rel="nofollo...
<p>Would first make a simple table of your mean and SE to use with <code>geom_errorbar</code>. Then you only need to have <code>geom_errorbar</code> included once in your <code>ggplot</code>.</p> <p>Here's an example with made up data:</p> <pre><code>library(tidyverse) sample.Stats &lt;- sample.Height %&gt;% group...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why do I not need 3 levels of braces for initializing 3 levels of arrays?<p>I came across to this example</p> <pre><code>struct sct { int t[2]; }; stru...
<p>This looks like a simple typo but the situation is complex enough to tackle it step by step.</p> <p>First let me show the solution that seems to work:</p> <pre><code>int main() { str t[2] = { { { {0, 2}, {4, 6} } }, { { {1, 3}, {5, 7} } } }; cout &lt;&lt; t[1].t[0].t[1] &lt;&lt; t[0].t[1].t[0] &lt;&lt; end...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Parse Array of JSON objects in NodeJS<p>I am wondering how can I parse Array of JSON objects in NodeJS?</p> <p>I want to post JSON array to the server, and ...
<p>In your <code>app.js</code>: </p> <pre><code>var bodyParser = require("body-parser"); ... app.use(bodyParser.urlencoded({extended: true})); </code></pre> <p>Then you can just use <code>req.body</code> to get the posted values: </p> <pre><code>app.post('/echo', function (req, res) { var Array = req.body.data; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Filter out Empty elements from Array - XPATH<p><strong><em><SUB>Context:</sub></em></strong></p> <p>I'm trying to <code>Filter</code> out <code>Empty</code>...
<p><strong>Improve <code>[Not(node())]</code> syntax</strong></p> <p>Simply use <code>//s[not(.='')]</code>, i.e.</p> <pre><code>arr1 = WorksheetFunction.FilterXML("&lt;t&gt;&lt;s&gt;" &amp; Join(arr0, "&lt;/s&gt;&lt;s&gt;") &amp; "&lt;/s&gt;&lt;/t&gt;", "//s[not(.='')]") </code></pre> <p>where <code>.</code> refers...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Passing list as arguments in Scrapy<p>I am trying to build an application using Flask and Scrapy. I have to pass the <code>list</code> of urls to spider. I t...
<p>Override spider's <code>__init__()</code> method:</p> <pre><code>class MySpider(Spider): name = 'my_spider' def __init__(self, *args, **kwargs): super(MySpider, self).__init__(*args, **kwargs) endpoints = kwargs.get('start_urls').split(',') self.start_urls = ["http://www.google.com...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cannot implicitly convert type long to a Object Model<p>I am trying to assign a object ie..(<code>Member</code>) with a <code>ID</code> property with a <code...
<p>The problem is that <code>editMember.MemberID</code> and <code>editMember.Member.MemberID</code> are from different types.</p> <p>Since <code>editMember.MemberID</code> is of type <code>Genesis.Domain.Entities.Member</code> (not <code>long</code>) you are getting the exception.</p> <p>In order for your code to wor...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Simplest way to write bytes to a writer?<p>I have written an implementation of <code>HttpServletResponse</code> and I am overriding a method <code>getOutputS...
<p>You can use <code>org.apache.commons.io.output.WriterOutputStream</code></p> <p>It has multiple constructors e.g. </p> <pre><code>public WriterOutputStream(Writer writer, String charsetName) </code></pre> <p>or wider one</p> <pre><code>public WriterOutputStream(Writer writer, Charset charset, int bufferSize, boo...