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: Why does Java truncate the preceding is in JSON responses?<p>I have a spring rest API that returns a JSON response from the response class shown below:</p> ...
<p>If you're using Spring Boot, then somewhere internally it uses Jackson to transform your object into json string.</p> <p>you can dive into the logic of ObjectMapper class, but the idea is that it follows <a href="https://docstore.mik.ua/orelly/java-ent/jnut/ch06_02.htm" rel="nofollow noreferrer">JavaBeans conventio...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Edit text content for multilingual website via admin<p>I'm a beginner with Symfony 4 and I would like to create an admin on my multilingual website, where I ...
<p>You can do this with <a href="https://github.com/a2lix/TranslationFormBundle" rel="nofollow noreferrer">a2lix/TranslationFormBundle</a></p> <p>Check their website site for example at :</p> <p><a href="https://a2lix.fr/bundles/translation-form/3.x.html" rel="nofollow noreferrer">https://a2lix.fr/bundles/translation...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to send an email with a custom template using aws pinpoint<p>I'm trying to send a email with a template and a got this error message:</p> <pre><code>Unk...
<p>Test using the SDK for Python (Boto 3) version 1.9.62 and Python version 3.6.7.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Char array in linked list causes core dump<p>I created a linked list program it works perfect with ints in c. but if change the parameter to char array, and ...
<ol> <li><p>Your allocation is wrong, because you made it confusing by <code>typedef</code>ing a pointer, don't do that</p> <pre><code>n = malloc(sizeof(*n)); </code></pre> <p>is less error prone.</p></li> <li><p>Check the return value of <code>malloc()</code> and there is no need for the cast, so</p> <pre><code>n =...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fails to iterate through a loop - python Flask server<p>I'm trying to iterate through a list object in python. I'm uploading two files and retrieving it thro...
<p>Looking at <code>help(flask.Request.files)</code>:</p> <pre><code>Each key in :attr:`files` is the name from the ``&lt;input type="file" name=""&gt;`` </code></pre> <p>and at <code>help(werkzeug.datastructures.MultiDict.getlist)</code>:</p> <pre><code>Return the list of items for a given key. If that key is not i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Class not found (PHP)<p>I get a fatal error, the class THBS_AUTH_API is not found, the weird thing is i include it (correct file).</p> <p>I tried require, r...
<p>You defined your class under the namespace THBS_AUTH_API. To use this namespace, add the line <code>namespace THBS_AUTH_API;</code> befor you call the class.</p> <p>or change</p> <pre><code>&lt;div class="licensecard" id="license"&gt;License key: &lt;?php echo THBS_AUTH_API::CMD_AUTH("LICENSE_KEY", 1); ?&gt;&lt;/d...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Subset list of dataframes containing specific column name<p>I have a list of dataframes and I'd like to get column <code>x</code> from each dataframe as a st...
<p>One option involving <code>purrr</code> could be:</p> <pre><code>keep(testing, ~ any(grepl("A", names(.), fixed = TRUE))) [[1]] A B 1 Yes No [[2]] A 1 Yes </code></pre> <p>Or:</p> <pre><code>keep(testing, ~ sum(names(.) == "A") != 0) </code></pre> <p>If the desired output is indeed to have the A colum...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: jQuery: drag/drop images inside div's with same class?<p>I'm trying to use the jquery drag and drop in my web application and drag and drop images in differe...
<p>Try something like this, Hopefully it's more what you are looking for</p> <pre><code>$(document).ready(function () { var x = null; //Make element draggable $(".drag").draggable({ helper: 'clone', cursor: 'move', tolerance: 'fit', stack: '.drag', revert: "invali...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Trying to find a username variable to creat files on the desktop said "user" is using<p>Basically, the code im looking for is how to find username with a var...
<p>You should write it like that :</p> <pre><code>strUser = CreateObject("WScript.Network").UserName wscript.echo strUser </code></pre> <p>And to continue with your code like that :</p> <pre><code>Dim fso,strUser Set fso = CreateObject("Scripting.FileSystemObject") strUser = CreateObject("WScript.Network").UserName ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Some changes in a bubbleplot (ggplot)<p>I need some changes to this plot: <img src="https://i.stack.imgur.com/PzvMT.jpg" alt="enter image description here"><...
<p>Is that what you want?</p> <pre><code>ggplot(data=dfx.test_data, aes(x=x_var, y=y_var)) +geom_point(aes(size=(size_var),color=size_var))+scale_color_gradient(low="yellow", high="red")+labs(colour="NEW TITLE") </code></pre> <p><img src="https://i.stack.imgur.com/o2kMc.jpg" alt="enter image description here"></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Custom Error Queue Name when using EasyNetQ for RabbitMQ?<p>Rather than having my unhandled exceptions go into <strong>EasyNetQ_Default_Error_Queue</strong> ...
<p>Yes, you can customize the naming conventions by overriding the delegates on the IConventions object (or just create your own implementation of it and register that as a dependency):</p> <p><a href="https://github.com/EasyNetQ/EasyNetQ/blob/master/Source/EasyNetQ.Tests/ConventionsTests.cs" rel="nofollow noreferrer"...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Update state of a screen struct from SceneDelegate<p>I'm coming from react-native and a beginner at Swift and SwiftUI and I was curious how to perform an act...
<p>Here is simplest approach</p> <pre><code>struct Test: View { @State private var isNotificationsEnabled : Bool private let foregroundPublisher = NotificationCenter.default.publisher(for: UIScene.willEnterForegroundNotification) var body : some View { Toggle(isOn: self.$isNotificationsEnabled) { ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: unable to execute compare command of ImageMagick from Java im4java<p>I am using Eclipse JUNO JDK 7 im4java-1.4.0</p> <p>When I execute the Java progrm I am ...
<p>Adding path of ImageMagick into PATH variable. as well as</p> <pre><code>CompareCmd compareCmd = new CompareCmd(); compareCmd.setSearchPath("D:/ImageMagick-6.8.5-Q16"); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to enumerate an IEnumerable while another thread populates it<p>I want two threads on the same machine, one that populates a collection and the other one...
<p>What you have is a classic Producer/Consumer pattern. </p> <p>You can use a <code>ConcurrentQueue&lt;T&gt;</code> or, probably better, a <a href="https://msdn.microsoft.com/en-us/library/dd267312%28v=vs.110%29.aspx"><code>BlockingCollection&lt;T&gt;</code></a></p> <p>The BoundedCapacity property lets you regulate...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reading Bigtable data from the middle of a Dataflow pipeline<p>I have a pipeline that receive some data from pub sub, do some processing, and needs to proces...
<p>To complement @Billy's answer, you can also try using the BigtableDataClient class inside a ParDo transformation. The data input will be the parameters contained in a PubsubMessage to configure the Scan object, then in the ParDo set the Scan parameters, make the connection to BigTable and obtain the filtered results...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: group_concat is not working in php<p>I have following mysql table: table: bid</p> <pre><code>id | compid | itemid | rate | year 1 | 1 | 1 | 2....
<p>If you want to make columns, maybe this query.</p> <pre><code>SELECT itemid, MAX(CASE WHEN compid = 1 THEN rate END) as 'company01', MAX(CASE WHEN compid = 2 THEN rate END) as 'company02', MAX(CASE WHEN compid = 3 THEN rate END) as 'company03' FROM bid GROUP BY itemid </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Array.Sort() by string tkey<p>I have two arrays; <code>indexArray() as String</code>, and <code>valueArray() as Decimal</code>.</p> <p>indexArray is actuall...
<p>Not sure if there is another way, so let's wait if someone has a better idea, but you could use a list of a custom class to store your values and then ask Linq OrderBy method to sort your list of values</p> <pre><code>Sub Main Dim indexArray() as String = {"1.1", "12.2", "10.3", "2.4", "2.1"} Dim valueArray...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Segue UI Image to ViewController with Swift<p>I'm trying to pass an uiimage to my secondViewController but keep running into an error with my coding. How ca...
<p>Write this code</p> <pre><code>if let image = UIImage(named: mainpictures) { self.mainImage.image = image } </code></pre> <p>instead of this </p> <pre><code>self.mainImage.text = mainpictures </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cannot Create Database with credentials using Entity Framework Code-First?<p>I'm a bit new to code-first approach but I used Database first approach before u...
<p>OP:</p> <blockquote> <p>I want to <strong>create a database</strong> with <strong>code-first</strong> using <strong>credentials</strong>, </p> </blockquote> <p>...and:</p> <blockquote> <p>after a lot of research I didn't find a solution and mostly tutorials use "Trusted Connection".</p> </blockquote> <p>Ther...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python Prime Numbers Looping<p>I am trying to find the prime numbers in a list. I wrote the code below. My code returns</p> <pre><code>not prime prime prime...
<p>You should print <code>prime</code> after you check all of the <em>divisors</em> and you don't find any divisor for a given number.</p> <p>So, I recommend to write a <em>function</em> which checks if a <em>number</em> is <code>prime</code> or <code>not</code>.</p> <pre><code>check_prime = [26, 39, 51, 53, 57, 79, ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Player join event and player login event not working (minecraft bukkit coding)<p>Ok, so since i updated to java 8, nothing works properly in my code, only th...
<p>You need to register your <code>Listener</code> first:</p> <pre><code>@Override public void onEnable() { Bukkit.getServer().getPluginManager().registerListeners(this, this); getLogger().info("[CoreStats] Has been enabled!"); } </code></pre> <p>For more information, have a look at the <a href="http://wiki.b...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How could I configure the MSSQLLocal default datetime format<p>I am writing a program to interact with MSSQLLocal DB using C# through winforms but I find a p...
<p>Turns out before adding a new value to the row you would need to include in the string CAST(01/01/2020) as dateformat</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Update DaysOfWeekDisabled of bootstrap datepicker on changing value in a select dropdown<p>I am trying to change datepicker option based on the input of a dr...
<p>You just need to add : <code>$('#iEventDays').datepicker('remove');</code> when you initialize your On Change event function.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why do I have to specify parameter names in a TS function type?<p>I am using typescript to write some function and this is the one that TS accepts:</p> <pre...
<p>I think the closest thing you can hope for to a canonical answer is in the GitHub issues <a href="https://github.com/microsoft/TypeScript/issues/13152" rel="noreferrer">microsoft/TypeScript#13152</a> and <a href="https://github.com/Microsoft/TypeScript/issues/3081" rel="noreferrer">microsoft/TypeScript#3081</a>. ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to make pandas read_csv handle numpy str (or unicode) scalar datatypes<p>Whenever I read a CSV file that has a column of strings, I've found that by defa...
<p>This was a technical decision taken by Wes <strong>not</strong> to use numpy's string datatype: Numpy allocates all strings as the same size.</p> <p>In most real world use cases strings are not fixed size and often a few are very long. It's wasteful to allocate a very large contiguous block of memory (and IIRC, co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Setting EnvironmentObject from a Shake Gesture (using UIKit) in SwiftUI doesn't update View<p>I am looking to trigger a SwiftUI function by physically shakin...
<p>example </p> <pre><code>import SwiftUI import Combine class MyDevice: ObservableObject { //let objectWillChange = ObservableObjectPublisher() var isShaken: Bool = false { willSet { self.objectWillChange.send() } } } struct ContentView: View { @ObservedObject var model = ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to find the difference between two numbers in angular.js?<p>I want to find the difference between two numbers in anuglar js directive tags. </p> <pre><...
<p>Add something like this to your <code>post</code> definition (in the model)</p> <pre><code>... // assuming you have these already (or similar) post.upvotes = 2; post.downvotes = 1; ... // add something along the lines of post.voteDiff = function(){ return Math.abs(upvotes - downvotes); // would return 1 in this ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SCSS Not working in my view [Code igniter]<p>My SCSS code is not working in my code igniter project : </p> <pre><code>$custom-file-text: ( en: "Browse", ...
<p>SCSS needs to be compiled into CSS. Link the CSS once you have compiled it! Better yet minify it after compiling it!</p> <p><a href="https://www.google.com/search?client=firefox-b-d&amp;q=compile+SCSS" rel="nofollow noreferrer">https://www.google.com/search?client=firefox-b-d&amp;q=compile+SCSS</a> </p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: UI-Select reset-search-input does not work<p>Please see my code below, when a choice is select from an input by typing something in i.e "Fr" and all the coun...
<p>You can set it at the global level using the uiSelectConfig constant like:</p> <pre><code>app.config(function(uiSelectConfig) { uiSelectConfig.resetSearchInput = true; }); </code></pre> <p>It worked for me.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How would I write a regex that matches the values following a string (to the next comma)<p>I have a csv of key=value pairs. How do I write a regex that matc...
<p>Match anything other than whitespace or <code>,</code> after <code>password=</code>: </p> <pre><code>var kv = 'system=blah, user=stevedave, password=1234$32@a, mylocation=amsterdam', re = /password=([^\s,]+)/, match = re.exec(kv); alert(match[1]); </code></pre> <p>Demo: <a href="https://regex101.com/r/bE4b...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: keep label text aligned center to screen while scrolling uilabel with view iOS?<p>I have a <code>UITableView</code> and 10 sections in it. For each section I...
<p>After knocking my head for hours finally i got this solution.</p> <p>Simply i used</p> <pre><code>(void)scrollViewDidScroll:(UIScrollView *)scrollView* </code></pre> <p>method and <em>changed my label frame</em> <em>with</em> <em>table view content offset</em>.</p> <pre><code>myLabel.frame = CGRectMake(tableview...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Passing a struct data to a variable C++?<p>first I'd like to apologize for my bad English and thank you in advance for reading and helping.</p> <p>Basically...
<p>This code shouldn't compile, is that correct? You can't assign a value of type <code>fractionAnswers</code> to a variable of type <code>numbers</code>, even though they have the same layout of members. Some options are:</p> <ul> <li><p>Change the return type of <code>addSubFractions</code> to <code>numbers</code>.<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Merge lists of lists beginning at certain element in first list<p>Beginning at A[2], I want to merge B[0] into A[2] and so on for both lists. List A has mor...
<p>Add empty lists in front of <code>B</code>, as needed, to align the two lists. <code>zip</code> the lists and concatenate them pairwise:</p> <pre><code>offset = 2 # Align at position #2 [x+y for x,y in zip(A, [[]] * offset + B)] #[[1, 1, 1], [2, 2, 2], [3, 3, 3, 6, 6, 6], ...] </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Probabilistic forwarding of messages to a subset of servers<p>There are <code>n</code> servers (<code>n</code> >= 1) and we want to forward a portion of the ...
<p>Forward each request to <code>n * ratio</code> of the servers.</p> <p>If, as is likely, <code>n * ratio = k</code> is not a whole number, forward to <code>floor(k)</code> or <code>ceil(k)</code> servers, with the probability of forwarding to <code>ceil(k)</code> being <code>k - floor(k)</code>.</p> <p>In terms of ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Connect to WinForm server using SignalR?<p>I have downloaded the official example of <code>SignalR</code> and it works fine when I try to connect from WinFor...
<p>Your firewall may block the connection.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can anyone have a look at this code to solve the issue<p>This is a exercise from codecadamy, the following program is to find the total costing of a vacation...
<p><strong>Newest issues</strong></p> <ul> <li><p>The <code>TypeError</code> complaining about adding <code>int</code> and <code>NoneType</code> is due to the issue pointed out by MarkG below: because you are not returning anything explicitly from <code>rental_car_cst</code>, you are implicitly returning <code>None</c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to increase the heap size of WebSphere Application Server V8.5 Liberty Profile in Eclipse?<p>I have a WebSphere Application Server V8.5 Liberty Profile i...
<p>Correct way to do it is to create <code>jvm.options</code> file in the server directory with the following content e.g.:</p> <pre><code>-Xms512m -Xmx1024m </code></pre> <p>Check this link <a href="http://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.wlp.nd.multiplatform.doc/ae/twlp_admin_cu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Counting returned objects from jobs in powershell?<p>quick question, I've got a short little script that creates 2 background jobs and pings some websites, n...
<p>Fix to the script is below.</p> <p>Everytime you use Receive-Job, it takes the data from stream and displays it. After displaying it, that data is no longer accessible via Receive-job. To fix this, either Use -Keep switch or store the data you get from Receive-Object in a variable to use it multiple times.</p> <pr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Markdown: code snippets in the ordered list<p>I am using Octopress to generate static html-pages with markdown. What I want to do is to embed Pygments-highli...
<p>In Kramdown you <a href="http://kramdown.gettalong.org/syntax.html#fenced-code-blocks" rel="nofollow">have to</a> use tildes for fenced code blocks (while other markdown implementations support backticks as well):</p> <pre><code>1. list item 1 its description ~~~ code block here ~~~ </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android - Is there a way to register my Activity and Service other than Manifest file<p>Actually I want to know the other way if exist to register my Activit...
<p>The short answer to your question is <strong>NO</strong>, you cannot "register" your <code>Activity</code>s and <code>Service</code>s anywhere other than the manifest.</p> <p>Now I'll explain the long answer, the <strong>WHY</strong>. The Android architecture divides an application into 4 top-level components: </p>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Best way to pass a ConcurrentHashMap to another class?<p>I have a handler class that contains a private ConcurrentHashMap which other classes want, but I'm n...
<p>There is no such thing as <em>the best way to pass a</em> <code>ConcurrentHashMap</code> <em>to another class</em>. It all depends on your use case, i.e. on what you want your classes to do.</p> <p>You have three options:</p> <ol> <li><p>Return the map as is:</p> <pre><code>return myStuff; </code></pre> <p>This ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Download xpi files in PHP<p>I'm working on project that should create link to download xpi file.</p> <p>T his is my php code to download file:</p> <pre><co...
<p>Open downloaded file in some kind of text editor like Notepad and check if there are not any plain text PHP-related errors at the beginning of the file.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python Append From Text file outputs error<p><br> I am currently testing the third phase of my program, and this errors repeatedly appears throughout the tes...
<p>When you print the scores at the end, you're looking them up via the variable <code>worker</code> which doesn't change in your loop, rather than <code>name</code>.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Force share.js use the same express session data<p>I have a simple <code>express</code> app that use <code>session</code> middleware together with <code>pass...
<p>After several days of inspecting the code I have found a solution. If we look at <a href="https://github.com/josephg/node-browserchannel/blob/master/dist/server.js#L636" rel="nofollow">this line in browserchannel/dist/server.js</a> we can see that the session is being created using some information from initial req...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to run pipeline from other pipeline?<p>How to trigger pipeline build from multi stage pipeline? From stage "One" and "Two"</p> <pre><code>pipeline.yml ...
<p>When you use OAuth token you should map the <code>System.AccessToken</code> in this way:</p> <pre><code>env: System_AccessToken: $(System.AccessToken) </code></pre> <p>So in your first option:</p> <pre><code>- task: inputs: authenticationMethod: 'OAuth Token' env: System_AccessToken: $(System.Acce...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Different width for Navigation Drawer in Tablet and Phone<p>I was trying to implement material design for one of my project and <a href="http://www.google.co...
<p>Create values-sw600dp folder in your project and add dimens.xml file in it. Define width in dimens.xml file of both values and values-sw600dp folder</p> <p>For values-sw600dp/dimens.xml</p> <pre><code> &lt;resources&gt; &lt;dimen name="width"&gt;300dp&lt;/dimen&gt;&lt;/resources&gt; </code></pre> <p>For va...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I use a form's global variable to put it in a panel?<p>This is a continuation of my question: <a href="https://stackoverflow.com/questions/28677586/h...
<p>The way I've done this before to avoid having to iterate through all you ArgForm's children is by having a "master container" of sorts on the ArgForm that has all the children you need. How I set this up is by </p> <ol> <li>first placing a TLayout, aligned to Client on the ArgForm</li> <li>Next, I added all my chi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make a plot from method read_html of Pandas on Python 2.7?<p>I'm trying to make a plot (whichever) and cannot see method .plot() and also i'm getting ...
<p><strong>SOLUTION</strong></p> <pre><code>dfs = pandas.read_html(str(table), decimal=',', thousands='.', header=1, index_col=1, encoding='utf-8').pop(0) print dfs x=[] y=[] y1=[] y2=[] for i, row in dfs.iterrows(): x.append(row[0]) y.append(int(row[1])) y1.append(int(row[2])) y2.append(int(row[3])...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: All uses of Ellipsis in C++<p>Currently, I could recollect only three uses of <code>...</code> in C++:</p> <ol> <li>variadic functions</li> <li>variadic temp...
<p>That's pretty much it, besides variadic macros mentioned in the comments. I made a grouped tree list:</p> <ul> <li>Variadic <ul> <li>Template parameter packs <ul> <li>Template parameter delcaration</li> <li>Function parameter declaration</li> <li>Parameter pack expansions (these can be in many contexts) <ul> <li...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cannot tab to select dropdown menus in Bootstrap Navbar<p>So I'm having a problem where for some reason you can't select the dropdowns from my Bootstrap navb...
<p>You're missing the href attribute on all the dropdown toggle anchors. See <a href="http://www.bootply.com/UW3Wet166j" rel="nofollow"><strong>this bootply</strong></a> for the fixed version.</p> <p>This:</p> <pre><code>&lt;a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"&gt;Proje...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use a variable in a LIKE clause in PL/SQL<p>I am new to Oracle and learning; I am simply trying to run this T-SQL query</p> <pre><code>DECLARE @Searc...
<p>Well, yes - those "translators" don't always do what they are supposed to.</p> <p>This is how your code should look like:</p> <ul> <li>use <code>like</code>, not <code>=</code> in the <code>where</code> clause</li> <li>in PL/SQL, you have to put the result of the <code>select</code> statement <code>into</code> som...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to sort an array of strings by everything but the first letter<p>My array is expected to have elements that look like <code>"B1"</code> and <code>"C22"</...
<p>If the array contains a huge number of elements, then you can replace <code>Arrays.sort()</code> with <code>Arrays.parallelSort()</code> to sort efficiently. </p> <pre><code>Arrays.sort(arr, (ele1, ele2) -&gt; ele1.substring(1).compareTo(ele2.substring(1))); </code></pre> <p>if you are confident that <code>su...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pass a parameter into a class that implements IMappingAction<p>I am using and implementing the <a href="https://docs.automapper.org/en/stable/Before-and-afte...
<p>You can use <code>ResolutionContext</code> to pass parameter (<code>name-value</code> pair) to <code>AfterMap</code> action function. </p> <p>The approach will be as:</p> <pre><code>// AfterMap Action function that usages context public class AfterMapAction : IMappingAction&lt;Source, Destination&gt; { public ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Design a data structure that moves referenced element to the beginning. C++<p>I need to design a data structure that allows access to an array by index in a ...
<p>Balanced <a href="https://en.wikipedia.org/wiki/Rope_(data_structure)" rel="nofollow noreferrer">ropes</a> guarantee amortized O(log N) indexing, deletion and insertion time. The operation in question can be decomposed into a sequence of the three.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Dequeing reusable Cell crash in tableView<p>I'm having some troubles adding new cells on table view.</p> <p>The strange thing is that I run once the functio...
<p>I've got the solution for you:</p> <p><a href="https://stackoverflow.com/a/49157374/8737121">https://stackoverflow.com/a/49157374/8737121</a></p> <p>Really thanks to: <a href="https://stackoverflow.com/users/5867574/shan-ye">Shan Ye</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error: Actions must be plain objects. Use custom middleware for async actions. ToDo app<p>I checked a lot of blogs but none got me this error solved. Can som...
<p>The error info you are facing:</p> <blockquote> <p>Use custom middleware for async actions. </p> </blockquote> <p>Follow it and add <strong>applyMiddleware</strong> to your <code>createStore</code>.</p> <pre class="lang-js prettyprint-override"><code>import { composeWithDevTools } from 'redux-devtools-extensio...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I submit a Rails AJAX form using onclick<p>How can I submit an AJAX form in rails by using a button?</p> <p>My Code:</p> <pre><code>Controller: def...
<p>Use following way</p> <pre><code>&lt;form id="get_event"&gt; &lt;input type='button' onclick="document.getElementById('get_event').submit();" value="Change City"&gt; &lt;/form&gt; </code></pre> <p>issubmit() is not a function , but submit() is.</p> <p><strong>For AJAX</strong> use Ajax call to submit form wit...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Leaflet.js/Mapbox.js On Library Ready event?<p>Is there a way to know when the Leaflet.js or Mapbox.js library is loaded &amp; ready? I'm running into troub...
<p>Too be short, there isn't. You could however, hook into the <code>onload</code> event of the <code>script</code> tag:</p> <pre><code>&lt;script type="text/javascript" onload="console.log(L)" src="//cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"&gt;&lt;/script&gt; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Strange behavior with constexpr static member variable<p>This is a follow up question to <a href="https://stackoverflow.com/questions/28530278/undefined-refe...
<p>The standard does not require any diagnostics for a failure to provide a definition where one is required.</p> <blockquote> <p><strong>3.2 One definition rule [basic.def.odr]</strong></p> <p>4 Every program shall contain exactly one definition of every non-inline function or variable that is odr-used in that program...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ehcache: unexpected behavior when evicting cache elements<p>I have two cached methods:</p> <pre><code>@Cacheable(value = CacheName.CACHE_STATIC, key="'getIm...
<p>According to the logs, there are only two invalidatings made in thread <code>http-nio-8080-exec-7</code>:</p> <pre><code>2020-02-10 16:48:32.695 [http-nio-8080-exec-7] TRACE o.s.c.i.CacheInterceptor - Invalidating cache key [getImageUserLayer:5510461] for operation Builder[public void com.prognoz.smkoob.data.dao.me...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: iTunes connect screenshot issue<p>It is possible to upload screenshot to iTunes connect if the image doesn't show directly a part of the app but just an effe...
<p>I don't think anyone can give you a definite answer. It depends, and the review team will make their decision. It sounds reasonable to me to show something that your app does, even outside of the app, in one of your screenshots.</p> <p>Note that your app's executable can get approved but have its metadata rejected ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create pd series based on conditions on df1, and reporting values from df2 or df3<p>First post here. I'm new to Python, but have made alot of progress lever...
<p>use <code>Series.where()</code>, specify the column names.</p> <p>see <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.where.html" rel="nofollow noreferrer">https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.where.html</a></p> <pre><code>&gt;&gt;&gt; df3.where...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how do i take 3 different schema tables with 1 query in laravel<p>I want to take 3 different schema tables, each schema requires a join with a params table, ...
<p>You can use <code>unionAll</code> instead of collection <code>merge</code>, it will reduce the IO cost of database.</p> <pre class="lang-php prettyprint-override"><code>$tabel1 = DB::table('schema1.vendors AS ven') -&gt;leftJoin('schema1.admin_params AS ap','ap.admin_param_uuid','=','ven.pr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Map of strings can't handle more than varchar(255)<p>Once total length of Map String(s) is greater than 255, JPA fails committing transaction. I'm using JPA ...
<p>I think you are using <code>varchar(255)</code>. Use a <code>text</code> column instead of <code>varchar(255)</code>. </p> <p>In PostgreSQL always use text (unless of course there is a real length constraint).</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Update a column of table with ROW_NUMBER<p>I am new to Oracle I need to Update a Column of a Table with <code>ROW_NUMBER()</code> in oracle </p> <p>i.e </p>...
<p>Put this query with <code>row_number</code> as source table of <code>merge</code> statement:</p> <pre><code>merge into tablefull tgt using (select rowid rwd, columnid, row_number() over (partition by columnid order by datecolumn) - 1 rn from tablefull) src on (src.rwd = tgt.rowid and tgt.col...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Doctrine Query Language, Two joins query<p>I have a problem with dql. I can't write properly query. Need to rewrite the query to dql </p> <blockquote> <pre>...
<p>You have a many-to-many association between order and movie you can set your entities to achieve this relation something like below</p> <p><strong>Order Entity</strong></p> <pre><code>/** * @ORM\ManyToMany(targetEntity="Namespace\YourBundle\Entity\Movie", cascade={"persist"}) * @ORM\JoinTable(name="Order_has_Mov...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Django FileField passing the files<p>OK, I have a model for <code>TemporaryFile</code> and the final file model (<code>File</code>) they have different stora...
<p>This questions has been answered here: <a href="https://stackoverflow.com/q/5764803/1349940">copy file from one model to another</a>.</p> <p>Spoilers: it requires StringIO. </p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to pass Mobx store as props to react compoent<p>I have this app that uses mobx, in it there is a component called "Listings" that uses some state from mo...
<p>As <code>&lt;Listings/&gt;</code> can be provided with <code>listing</code> and <code>loading</code> you can:</p> <pre><code>const Listings = ({listings, loading}) =&gt; { if(loading) return &lt;Loading /&gt; return ( &lt;div className="pa2"&gt; &lt;div className="flex flex-wrap"&gt; {listings...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JAXB getting Attribute value from child<p>I cannot seems to get attribute information from Child in xml. I tried several different approaches and non of them...
<p>Your problem isn't that the <code>Harness</code> XML attribute is not being mapped, your problem is that the entire <code>Harness</code> object is not being mapped.</p> <p>That's because the default element name is not the name in the XML. To fix, specify the name:</p> <pre><code>@XmlElement(name = "Harness") priv...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Remove tags with one or more spaces without regex<p>How to remove tags with one or mor spaces without regex. (and with jQuery)</p> <p>I can remove tags with...
<p>There's no reason not to use regular expressions for this, but if you really want to, you can use <code>$.trim</code> instead:</p> <pre><code>$('#tot').children().each(function() { if ($.trim($(this).text()) == "") { $(this).remove(); } }); </code></pre> <p>That will remove elements that ha...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: why $viewValue === $modelValue on select?<p><a href="http://plnkr.co/edit/iVvvdbvI3it7KrYZW6mK" rel="nofollow">http://plnkr.co/edit/iVvvdbvI3it7KrYZW6mK</a><...
<p>The nature of <code>$viewValue</code> is determined by the directive. The <code>$render</code> method brings the view value to the screen and if the user can change a value, the directive converts the user's input to the view value. How that happens is completely up to the directive.</p> <p>The default implementati...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R: Changing the size of a heatmap.2 rowname column<p>I used the following code:</p> <pre><code>library("gplots") heatmap.2(assay(vsd)[ens_union,], trace = "...
<p>Just add the <code>margins</code> argument</p> <pre><code>library("gplots") # generate some example data data &lt;- as.matrix(mtcars) # make ridiculously long names long.names &lt;- paste("ENSMUSG000000000", rownames(mtcars)) rownames(data) &lt;- long.names # GO! heatmap.2(data, trace = "none", density.info ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I parse YouTube URLs to get the video ID from a URL using Dart?<p>I'm trying to convert *this function to Dart with no success so far. I'm a bit confu...
<p>Well, I do not have the complete solution but I hope this will help you, Your problem is you are using a RegExp which returns the result as a group which you need to select:</p> <pre><code>final urls = [ 'http://www.youtube.com/watch?v=0zM3nApSvMg&amp;feature=feedrec_grec_index', 'http://www.youtube.com/user/In...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Selecting video from Google Photos provider doesn't give mimetype information<p>I've created a sample <a href="https://github.com/ShivamPokhriyal/BuggyGoogle...
<p>I wasted couple of days trying to figure out where the problem exists. Unfortunately it turned out to be a bug in google photos version 4.17 which seems to be fixed in version 4.32</p> <p>Here is the linked google issue <a href="https://issuetracker.google.com/issues/149416521" rel="nofollow noreferrer">https://iss...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Decoding encrypted malicious script<p>I found in my old application directory a script from 2017. It is clearly malicious, can anybody help decoding it? The ...
<p>The <code>$zkvaoku</code> string at the beginning of the script isn't encoded in any "traditional" encoding. If you look at the block of statements following it, up until the <code>foreach</code> loop, you'll see that it's used to dynamically construct an array of strings that are much more readable. </p> <p>If you...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a to perform animation/movement to uitableviewcell after cell is created?<p>This is what i want, i have a tableview with 3 custom cells. Each cell p...
<p>So after digging around i found a way to bypass this issue.</p> <p>I made a simple notification to check when the button has been pressed. On cell class,</p> <pre><code> @IBAction func ActionPaymentOne(_ sender: Any) { NotificationCenter.default.post(name: Notification.Name("moveAnimation"), obje...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Use GROUP BY/ HAVING, but then expand the results<p>I am not sure if my title question makes sense. But I have the query below.</p> <pre><code>SELECT mdn, ...
<p>Are you trying to get the detail associated with the cost centers? If so, then use a <code>join</code>:</p> <pre><code>SELECT v.* FROM verizon v JOIN (SELECT cost_center FROM verizon GROUP BY cost_center HAVING SUM(mib) &gt; SUM(data_allowance) ) vsum ON v.cost_center = vsum.cost_...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Logout doesn't redirect - Symfony2<p>Logout is successfuly performed and user is disconnected. The problem is that it doesn't redirect to the page set in con...
<p>Is a problem related to PHP, has mentioned in the <strong><a href="https://github.com/sensiolabs/SensioDistributionBundle/commit/2a518e7" rel="nofollow">SymfonyRequirements</a></strong> for php version before 5.4.11:</p> <blockquote> <p>When using the logout handler from the Symfony Security Component, you sho...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use managed bean property in command button action<p>How do I do set the action:</p> <p><code>&lt;h:commandButton id="submit" value="Submit" action="...
<p>The <code>&lt;h:commandButton action&gt;</code> <a href="https://docs.oracle.com/javaee/7/javaserver-faces-2-2/vdldocs-facelets/h/commandButton.html" rel="nofollow">requires</a> a method expression, not a value expression. The exception tells you exactly that. There's nothing which can change that other than hacking...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Boto-like library for Google Cloud Storage<p>Boto provides a simple way to upload a file to Amazon S3:</p> <pre><code>conn = boto.connect_s3(settings.AWS_AC...
<p>For program use via Python, the boto library and gcs-oauth2-boto-plugin let you use essentially the same code for interacting with GCS, as you can use for S3 (or presumably other cloud storage services with the right plugins).</p> <p>See <a href="https://cloud.google.com/storage/docs/gspythonlibrary" rel="noreferre...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Broadcast Receiver using RINGER_MODE_CHANGED<p>I am trying to update and log the changed modes for the ringer into a textview. Thanks for the Help!</p> <p>...
<p>Your receiver name is not declared properly in your manifest file.</p> <p>Change this line of code </p> <pre><code>&lt;receiver android:name="RingTypeMainActivity$RingTypeBroadcastReceiver" &gt; </code></pre> <p>to this</p> <pre><code>&lt;receiver android:name=".RingTypeMainActivity$RingTypeBroadcastReceiver" &g...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Slim trailing slash route<p>I have this route in a Slim application:</p> <pre><code>$app-&gt;get('/fasi/:id/',function ($id) use ($app) { $app-&gt;r...
<p>You can make optional the slash and the parameter also, like this:</p> <pre><code>$app-&gt;get('/fasi/[:id[/]]',function ($id) use ($app) { $app-&gt;render("fasi.html"); }); </code></pre> <p>This works with:</p> <blockquote> <p><a href="http://test/fasi/1" rel="noreferrer">http://test/fasi/1</a></p> </block...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Conditionally add a class if a specific string is found Rails CoffeeScript<p>I have a simple ruby on rails app and am trying to have the table rows colored i...
<p>I would recommend entering like the following:</p> <pre><code>$(document).ready -&gt; $("td:contains('Pending')").parent().addClass('warning') </code></pre> <p><strong>Edit</strong></p> <p>Ok, by doing the following:</p> <pre><code>addWarningClassToPending = -&gt; $("td:contains('Pending')").parent().addClas...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to filter results using "v-for" in Vue.JS<p>I am using a tabbed interface built with Bootstrap-Vue. When clicking on one of these tabs I'm using <strong>...
<p>As @seantunwin suggested, I changed my JSON from an object to an array - required some tidying up and formatting but made life easier in the long run.</p> <p>So my new structure now looks like this:</p> <pre><code>[ { "id": 1, "prizeTitle": "", "prizeImage": "", "prizeFirstLineText": "", "prizeType1": { "Im...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Adding properties to single DatagridViewCell<p>I'm on a project where base control is a DatagridView, in there is displaying numbers of production quantities...
<p>Why you not use the property Tag that's every rows has to storage the batch information, than you can retrieve easily</p> <pre><code>structure BatchInfo{ //===&gt;Informacion de tu batch aqui. //===&gt;Add here fields of information of your batch ... } //===&gt;You can fill each datagrid row tag property with the b...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: GKE - how to connect two clusters to each other<p>I'am new to the kubernetes and gcp. I have one cluster called <code>A</code> where my service is running. I...
<p>You can expose your service with type <code>LoadBalancer</code>. This will create an internal load balancer which other GKE cluster can reach.</p> <p>This <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/internal-load-balancing" rel="nofollow noreferrer">article</a> details the steps.</p> <p>This <a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android code folding the Switch block<p>Under Android Studio 1.0.2 is there a way to fold the block of code for a Switch conditional statement? I could not f...
<p>Select the code block and right click to choose fold code block (it "says" Ctrl-Shift-Period but Ctrl-Shift-Period doesnt really do it....)</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Random numbers in Ruby<p>I am trying to make n random numbers from -0.5 from to 0.5 </p> <p>and I made a function like this </p> <pre><code>def create_nois...
<p>You would just do</p> <pre><code>def create_noise(n) n.times.collect { rand(-0.5..0.5) } end </code></pre> <p>that will spit back an array like this:</p> <pre><code>[-0.034680737617880486, 0.34802029078157803, 0.1346483808607455, 0.12155616615186282, -0.41043213731234474] </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Object-Oriented programming private class field + get / set or public class field?<p>I'm a junior developer (currently exercise Java) and I have one question...
<p>Generally, you would use get/set methods, because they allow the class to control access, via those methods</p> <p>Any other class which uses your class, should only be able to access and change your fields in the way you describe.</p> <p>For example let's look at a simple (oversimplified) fuel pump</p> <pre><cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to convert string into JSONObject?<p>I have a string with value <code>abc@xyz.com.</code> I have to pass this value to server like: </p> <pre><code>{"em...
<p>You can simply use <code>JSONObject</code> to achieve this</p> <pre><code>JSONObject jsonObject = new JSONObject(); jsonObject.put("email", "abc@xyz.com"); String result = jsonObject.toString(); </code></pre> <p><strong>Output:</strong></p> <pre><code>{"email":"abc@xyz.com"} </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Swift Array of Functions<p>I'm very new to Swift, but slowly learning by following the <a href="https://itunes.apple.com/us/course/developing-ios-8-apps-swif...
<p>@Nate Cook answer is corret but why do you have to use enum in this case? Consider using typealias like following :</p> <pre><code>var ops = [String: Op]() func addOperation(symbol: String, op:Op) { ops[symbol] = op } addOperation("×", (*)) addOperation("÷", ({ $1 / $0 })) addOperation...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Keras ImageDataGenerator flow class indices for sparse and categorical classes<p>For keras's <code>ImageDataGenerator</code> <code>flow_*</code> methods, it ...
<p>You can set as per your requirement using <code>classes</code> argument. But currently <code>classes</code> argument is working for <code>flow_from_directory</code> but not working as expected in <code>flow_from_dataframe</code>. I can see a ticket open for this in keras <a href="https://github.com/keras-team/keras-...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Automate test run using Selenium IDE<p>I have used Selenium IDE to automate some basic screens of a website and they are working fine. However, just wanted t...
<p>You can run your ide tests from the command line: <a href="http://www.seleniumhq.org/docs/05_selenium_rc.jsp#running-selenium-server" rel="nofollow">http://www.seleniumhq.org/docs/05_selenium_rc.jsp#running-selenium-server</a></p> <p>using the htmlSuite option: <a href="https://wiki.mozilla.org/Running_IDE_scripts_...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why, in the result of this object type intersection, is the type of the `constructor` property intersected with `Function`?<p>If I perform this type intersec...
<p>This is because:</p> <ul> <li>The type <code>{ constructor: 'FooConstructor', value1: boolean } &amp; { value2: number }</code> is a subtype of <code>object</code>, because every object type is.</li> <li>The type <code>object['constructor']</code> is <code>Function</code>.</li> </ul> <p>And that's because objects ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: 404 on weblogic hello world application<p>I'm trying to run a simple hello world web application to make sure I've got the structure of everything right. </p...
<p>Check your URL again, make sure you are actually referencing the right URL for the server your application is deployed on. </p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I merge 2 HTML documents and their styles correctly?<p>I'm the author of an email client and one of things I'm in the process of doing is adding suppo...
<p>The solution I've come to is to add all the incoming styles from the multiple documents to a global style sheet. Styles are matched by first checking the count of properties is the same, then enumerating each property and comparing it's value. This basically gives the software a minimum number of styles to correctly...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: proper way of setting up a packaged_task<p>When compiling the program below, I get the error message:</p> <p><em>Error 1 error C2228: left of '.get_futur...
<p>Most vexing parse.</p> <pre><code>std::packaged_task&lt;T(Iterator,Iterator)&gt; task(accumulate_block&lt;Iterator,T&gt;()); </code></pre> <p>declares a function called <code>task</code> that takes a parameter of type pointer to function taking no arguments and returning a <code>accumulate_block&lt;Iterator,T&gt;<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to bind an attribute in a AngularJS directive?<p>I've defined a Angular directive, which seems to be working fine --- provided I hard-code it's attribute...
<p>It should work. Here's a super simple plunkr that examplifies it: <a href="http://plnkr.co/edit/tYFbxxAxwLXAzaNyCOwE?p=preview" rel="nofollow">http://plnkr.co/edit/tYFbxxAxwLXAzaNyCOwE?p=preview</a></p> <h2>HTML</h2> <pre><code>&lt;body ng-controller="MainCtrl"&gt; &lt;p&gt;Hello {{name}}!&lt;/p&gt; &lt;test f...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error message from console stating that res is not defined<p>I am currently trying to build a fullstack application using javascript(node.js). My goal is to ...
<p>@GaloisGirl is correct, <code>res</code> is not defined because you are not defining <code>res</code> within the scope of the anonymous function where you set the <code>submit</code> event listener.</p> <p>Given that you're not already using <code>async</code>/<code>await</code>, seems best to stick with promise no...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: get_or_create fails for unique_together for decimals<p>I have the following model:</p> <pre><code>class LocationPoint(models.Model): latitude = models.D...
<p>Well, it seems to fail because of using floats in <code>Decimal</code> constructors…</p> <p>Replacing floats with string representation resolved the issue:</p> <pre><code> def test_create_duplicate(self): point1 = self.__get_or_create_location_point.exec(Decimal('10.5'), Decimal('5.01')) self.__...