input_text_instruct
stringlengths
288
45.8k
output_text
stringlengths
37
33.2k
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does `using namespace ...` increase compilation time or can it somehow affect performance?<p>Does <code>using namespace ...</code> increase compilation time ...
<p><strong>tldr</strong> No, it doesn't affect neither compilation time nor run-time</p> <p>Strictly speaking every change in the source code modifies the compilation time. Using directives, using statements and all forms of aliases don't affect compilation time in any meaningful or note-worthy way.</p> <p>As for run...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: fluent plugin kafka json escaping<p>I am using version <a href="https://github.com/fluent/fluent-plugin-kafka/releases/tag/v0.12.3" rel="nofollow noreferrer"...
<p>using <a href="https://docs.fluentd.org/filter/record_transformer" rel="nofollow noreferrer">record transformer filter</a> i was able to mutate the incoming data.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R: t-test for each pairwise combination of a grouping variable, done for every element in an ID variable<p>Following up on <a href="https://stackoverflow.com...
<p>Another option in <code>data.table</code>:</p> <pre><code>mydf[, rbindlist(combn(split(Value, Patient), 2L, function(x) c(as.list(names(x)), .(t.test(x[[1]], x[[2]])$p.value)), simplify=FALSE)) , Marker] </code></pre> <p>output:</p> <pre><code> Marker V1 V2 V3 1: M1 P1 P2 0.3945742 2: ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to add list of object to change state of Entity Framework<p>Is it possible to change Entity List state in EF6</p> <pre><code>List&lt;AuditTra...
<p>Yes. You can apply change state for every element using linq <a href="https://msdn.microsoft.com/en-us/library/bwabdf9z(v=vs.110).aspx" rel="nofollow">ForEach</a>:</p> <pre><code>List&lt;AuditTrail&gt; auditLogs = new List&lt;AuditTrail&gt;(); auditLogs = GetLog(context, CreatedBy); context.AuditTrails.AddRange(aud...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: API Key for Amazon Cognito Sync Demo<p>I am trying to use this sample application code: <a href="https://github.com/awslabs/aws-sdk-android-samples/tree/mast...
<p>The api_key is for Login with Amazon integration. From the <a href="https://github.com/awslabs/aws-sdk-android-samples/blob/master/CognitoSyncDemo/README.md" rel="nofollow">README</a>:</p> <ol start="6"> <li>To add support for Login with Amazon. (Optional) <ul> <li>Follow the instructions at <a href="https://login....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Haskells Weak Head Normal Form<p>I've stumbled over some irritating things. I know that haskell works with weak head normal form (WHNF) and I know what this ...
<p>Note that <code>:sprint</code> does <strong>not</strong> reduce an expression to WHNF. If it did, then the following would give <code>4</code> rather than <code>_</code>:</p> <pre><code>Prelude&gt; let four = 2 + 2 :: Int Prelude&gt; :sprint four four = _ </code></pre> <p>Rather, <code>:sprint</code> takes the na...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: mongoose exec call with async.parallel<p>I have a code like this in my express controller</p> <pre><code> function (req, res) { var queries = []; ...
<p>When you directly pass the <code>exec</code> function of your query to <code>async.parallel</code> as a function to execute, you're losing the <code>this</code> context of that function call that contains your query to run.</p> <p>To use this approach, you would need to call <a href="https://developer.mozilla.org/e...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Find a String with Python?<p>i am searching fo a way to get a Hex Number from a line.</p> <p>It is a bigger file and i can find the number this way:</p> <p...
<p>Once a line starts with <code>.text</code>, split it and the third item will be your target value:</p> <pre><code>with open('large_file.txt') as f: for number,line in enumerate(f): if line.startswith('.text'): bits = line.split() try: print('Found at line # {} - {}'.for...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I send the write attribute of a NiFi processor to next processor?<p>I am using GetHDFSEvents processor to know hdfs.inotify.event.path. I need to get...
<p>Try using ListHDFS processor and use Fetchhdfs or ExecuteStream command processor. Use Expression language ${path}/${filename}</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I display a clicked button's text on another page?<p>So I was asked to do a multi-task website in Visual Studio 2010 and I never used it.</p> <p>And ...
<p>You need a lable on each page to do the same? Use MasterPage. <a href="http://www.w3schools.com/aspnet/aspnet_masterpages.asp" rel="nofollow">http://www.w3schools.com/aspnet/aspnet_masterpages.asp</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: UI logic in View<p>I am finding that my UI code is looking rather messy, because I am having to add .Net formatting code, to my View code. An example:</p> <...
<p>It's a good practice to have all the logic separated from view. With that approach you'll be able to test your logic. And views are not testable.</p> <p>I usually pass a viewmodel to the view with existing properties. In your case it should be something like LineClass. So you'll have:</p> <pre><code>&lt;tag class=...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Asp / C# .Net Entity Framework - Create Extended Parameterized Query based on Conditions<p>In ADO.Net I created a DAL file that took parameters from the user...
<p>I just found out working with Entity framework is a totally different world that classic approach. In here, we work with models/objects and their relationships with each other and we access them based on that relationship. So to answer the question we need to get that model first like</p> <pre><code>Movie movie = d...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sql Query for number of available and total books<blockquote> <p>I need a query which will return list of book from book table</p> <p>but it will sh...
<p>In brevi:</p> <pre><code>select isbn, booktitle, sum(case when status='available' then 1 else 0 end) as avail, count(*) as total from Book group by isbn, booktitle </code></pre> <p><a href="http://sqlfiddle.com/#!2/80a41/5" rel="nofollow">http://sqlfiddle.com/#!2/80a41/5</a></p> <p>i definitely suggest you to rea...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Protractor - Find all elements and loop length of found elements and click button<p>So I have been trying to figure out on how to click a button x times depe...
<p>The reason of your <code>it</code> inside for loop not executed is those <code>it</code> generated dynamically in run time and did not respected by the test framework, Jasmine, Mocha.</p> <p>As I learned, Jasmine need to load and parse the static <code>it</code> in test script files before executing them, dynamic <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do you "launch" a Windows protocol from Python?<p>We have a python script that needs to trigger the open of the Microsoft Store. We believe that the easi...
<p>Use <code>os.startfile("ms-windows-store://pdp/?ProductId=9WZDNCRFHVJL")</code>. This calls WINAPI <code>ShellExecuteW</code> directly. If you use subprocess, you have the expense of starting a child process. Plus CMD's <code>start</code> command will first search <code>PATH</code> to find a file that it can execute...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I correctly install and run gdb?<p>I've tried</p> <pre><code>sudo apt-get install gdb </code></pre> <p>but whenever I type gdb in the terminal, it ...
<blockquote> <p>It just hangs like in an infinite loop. Any suggestions?</p> </blockquote> <p>You don't know whether it's waiting for something or is actually in infinite loop.</p> <p>Your first steps should be:</p> <ol> <li>Run <code>top</code> and see whether GDB process is consuming CPU or is increasing in memo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use non activeX content controllers in VBA for Microsoft word<p>I am attempting to find a way to use the non-activeX content controllers in Microsoft ...
<p>Those controls are named <a href="https://docs.microsoft.com/en-us/office/vba/api/word.contentcontrols" rel="nofollow noreferrer">ContentControls</a></p> <pre class="lang-vb prettyprint-override"><code>Private Sub CommandButton1_Click() Dim ccs As ContentControls,cc as ContentControl Set ccs= Me.ActiveWindow.Docume...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CRecordset::GetFieldValue exception "GetFieldValue operation failed on field ..." in c++ multithreading<p>I am getting an exception "GetFieldValue operation ...
<p>Identified the problem and fixed it. The exception arises because two different threads try to access the same <code>CDatabase</code> handle. <code>CDatabase</code> is not thread safe right now.</p> <p>The solution is to implement the application level locking using <code>mutex</code>. Write the adapter class for <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: cameraX TextureView preview height is stretched in real device<p>I'm trying to unstrech the height of the preview that cameraX TextureView is showing.</p> <...
<p>you can refer here for more customization <a href="https://github.com/android/camera-samples/blob/master/CameraXBasic/app/src/main/java/com/android/example/cameraxbasic/fragments/CameraFragment.kt" rel="nofollow noreferrer">https://github.com/android/camera-samples/blob/master/CameraXBasic/app/src/main/java/com/andr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can not acces localhost:3000 ruby on rails ubuntu<p>I have been trying to access or at least show my server in my Rails by running the command <code>rails s<...
<p>You have to run <code>rails s</code> from the project root directory.</p> <p>eg, If you create a rails application, say <code>rails new my_app</code>, it will create a skeleton application <code>my_app</code> in the current directory. Now you have to <code>cd</code> to that directory to start the server</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: flatten a list of int array<p>I have a list of int arrays in Java 7.<br> At the end,I need to flatten out the entire list into a single concatenated int arra...
<p>You can use streams:</p> <p>removed - Java 7 was sneaked in later!</p> <p>I don't think you can make it any more elegant than:</p> <pre><code>int newlen = 0; for( int[] a: list ){ newlen += a.length; } int[] out = new int[newlen]; int pos = 0; for( int[] a: list ){ System.arraycopy( a, 0, out, pos, a.leng...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Stop page load and redirect in a content script<p>I am making a extension in Chrome and need to stop a page load (without loading the page completely) and re...
<p>You're trying this with a content script.</p> <p>Content scripts have a <a href="https://developer.chrome.com/extensions/content_scripts#run_at" rel="nofollow"><code>run_at</code> parameter</a>, which indicates when (relative to page loading) they execute.</p> <p>By default, content scripts run at <code>document_i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: hrtimer runs even thogh it is not started<p>I'm performing</p> <pre><code>hrtimer_init(hr_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); </code></pre> <p>And a...
<p>Just a stupid hardcoded variable caused a reset on timerID 0. I've even created a separate module with the timers alone to see if the hrtimer wrapper is working properly.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pass a method through/as a parameter - ANDROID<p>I have 2 classes: </p> <p>TelaCadastroRestaurante (extends Activity) and Metodos (doesn't extends Activity)...
<p>You can't pass a method, but an object containing a method. This means maybe slightly more code. Call <code>caixaCerteza</code> with something like</p> <pre><code>caixaCerteza(..., ..., new Callable() { @Override public void call() { mandarNuvem(); } }); </code></pre> <p>In method <code>caixaCe...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: RestKit 0.24 || getObjectsAtPath || resulting object has NSString parameters set to NSNull<p>I am having NSString parameters in my object getting set to NSNu...
<p>I'm grasping at straws since I am just starting out with Restkit myself...but, do you perhaps think there might be an issue with the mappings?</p> <p>It looks like the values in your cMyClass are ivars instead of properties. If I am not mistaken, unless otherwise stated, those are "protected" so you can't really ac...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: EF 6 how to set two foreign keys to same table<p>I have a table UserForms that has two foreign keys to a Countries table, but on creating my controller and c...
<p>The comment left by @T.Glatzer is correct. You should expose foreign key properties on your dependent entities:</p> <pre><code>public class UserForms { public int Id { get; set; } public string FullNames { get; set; } public int IndividualsCountryId { get; set; } [ForeignKey("IndividualsCountryId"...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add a .h file to a flex definition in CMake<p>So I am trying to use flex in a project with Clion (because I'm on windows), which uses CMake but I cann...
<p>Problem Solved:</p> <p>I had to add <code>${CMAKE_SOURCE_DIR}</code> to the <code>include_directories()</code> call for it to find the header file.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why won't my loop end?<p>in the game I am making, I have a loop that runs in the show method of my libgdx screen. The loop basically says that combat is goi...
<p>This is an assignment that is always <code>true</code></p> <pre><code>while (combatisgoing = true) { </code></pre> <p>Change it to </p> <pre><code>while (combatisgoing) { </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Parsing nested list F# confused<p>I have a text file of rain measured over 3 years, where each number after the year corresponds to the month. For example, ...
<p>Something like this should work:</p> <pre><code> let months = [ "Jan"; "Feb"; ...; "Dec" ] let (year, values, _, min, _) = TupleWithSmallestValue let month = values |&gt; List.mapi (fun i x -&gt; (i, x)) |&gt; List.find (fun (m, v) -&gt; v = min) |&gt; fst ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rails JOINS with a twist<p>I have been trying and failing for 2 days now :) to get a list of ideas (posts basically) with likes. Order Desc preferably.</p> ...
<p>To specify a different column as foreign key which gets used in joins, you could add <code>foreign_key: ...</code> option to <code>belongs_to</code> as follows:</p> <pre><code># app/models/like.rb belongs_to :user, foreign_key: :liker_id belongs_to :idea, foreign_key: :likeable_id </code></pre> <p>See referenced ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: error LNK2019: unresolved external symbol "public: __thiscall : constructor issue<p>I want to test the following lines but I get a LNK2019 error, pointing an...
<p>The problem seems to be the fact that there are two projects and one cannot find the compiled class of the other.</p> <p>I will try to explain the procedure to use one project as library and one as application in Visual Studio.</p> <p>First in the library project do rightclick->properties, then under the tab Gener...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Directly referencing userform entry in VBA instead of passing value to a variable<p>folks. I am new to programming, but I am writing some macros to help man...
<p>Yeah I've also pondered over "best practise" with userforms over the years... I guess it's just through experience that I use approach below most often:</p> <ol> <li>Use as little code as possible in the userform itself (thinking is, the form is more "reusable" if it does as little as possible back to its parent......
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android, JSON array into ArrayList<String><p><br> How to parse JSON string array into Java arraylist<br></p> <p>I have this json:</p> <pre><code>{ "a": [ ...
<p>Op has updated the question specifying that org.json is to be used, and either array or list needs to be returned.</p> <p>I would strongly recommend using a more fully featured json library such as jackson - see <a href="https://stackoverflow.com/questions/28527067/android-json-array-into-arrayliststring/28527250#2...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to pause vimeo in a dynamic iframe?<p>I have a set of items, when I click on one of the, I am loading an iframe inside. When I click on another item, I a...
<p>Resolved it like this, basically I empty the span where I load the iframe, and I reload it each time.</p> <pre><code>$(document).on( 'click', '.item:not(.is-expanded)', function() { $(".item span.video").empty(); var videoSpan = $(this).find("span.video"); var url = videoSpan.data("vimeoid"); if(url){ ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Send embedded image email from web application<p>I have created a class called Mailer for sending Image Enabled Email through my asp.net web application 4.0....
<p>The error shows what's wrong - you are trying to load the empty string as the xml document:</p> <pre><code>oXml.LoadXml(@""); </code></pre> <p>Obviously the root element is missing here.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python: Pass by reference modifies the argument<p>I have this piece of code in Python:</p> <pre><code>def sortList(x): x.sort() print "Values inside t...
<p>Because arguments are passed by assignment, argument names in the function may share objects with variables in the scope of the call. Hence, in-place changes to mutable arguments in a function can impact the caller. </p> <p>And in your code at first time because of you use <code>sort()</code> function and it change...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Assign output of 'requests' in python<p>I was using the <code>requests</code> module to get some data in JSON form and I want to assign some of the output re...
<p>You basically have what is called a dictionary in python.</p> <p>A dictionary looks like this: <code>dictionary = {key: value}</code></p> <p>You can get the value of a key using <code>dictionary.get(key)</code></p> <p>For example, consider the code below:</p> <pre><code>def getValue(key): data = {'text': 's...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Emacs: Is it possible to set specific indentation settings for specific desktops in desktop+?<p>I have to work on a lot of different projects that all tend t...
<p>Rather than doing this via emacs-desktop, I suggest using <a href="https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html" rel="nofollow">Per-directory Local Variables</a>. These are designed for exactly this purpose.</p> <p>For example, here is the <code>.dir-locals.el</code> that I us...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android HttpURLConnection Error<p>I have an issue on my Android Project,</p> <p>I want to call php page with get method and I use HttpURLConnection, when I ...
<p>I have solved this issue with following code,</p> <pre><code> StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); StrictMode.setThreadPolicy(policy); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Putting a Meteor App on Site5?<p>I have a domain on <a href="http://site5.com" rel="nofollow">http://site5.com</a> and I will like to put a <a href="http://m...
<p>Bassed on yours edit.</p> <p>The most easy way its deploying on Meteor servers.</p> <pre><code>meteor deploy myapp.meteor.com </code></pre> <p>or another good choose its <a href="https://www.digitalocean.com" rel="nofollow">Digital Ocean</a>. <a href="http://devo.ps/blog/deploy-your-meteor-apps-on-digital-ocean-i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create a dynamic object with data obtained from subtraction of 2 other objects in Node.JS?<p>I've a use case in which I need to generate the object wi...
<p>You can try something like this:</p> <pre><code>data.current = { _id: data.lables[0], ...(data.variables.reduce((obj, variableName, variableIndex) =&gt; { obj[variableName] = data.values[variableIndex][0] return obj }, {}) } data.previous = { _id: data.lables[1], ...(data.variab...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Split and merge nested DataFrame in Python<p>I have a dataframe, which has two columns. One of the columns is also another dataframe. It looks like below:</p...
<p>This will do:</p> <pre><code>pd.concat( iter(final_df.apply( lambda row: row['Weights-Barcode'].assign( Date_Region=row['Date_Region'], ), axis=1, )), ignore_index=True, )[['Date_Region', 'transformed_weight', 'Barcode']] </code></pre> <p>From the inside out:</p> <u...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Remove line breaks "\n" in R<p>I have been trying to remove the line breaks from a data set in R. All the columns are factors hence before i could replace th...
<p>You could specify <code>na.strings</code> and <code>stringsAsFactors=FALSE</code> in the <code>read.csv/read.table</code>. (I changed the delimiter to <code>,</code> and saved the input data)</p> <pre><code> stk &lt;- read.csv('Akash.csv', header=TRUE, stringsAsFactors=FALSE, sep=",", na.strings="\\N") hea...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the best way to add an instantiated objects to an ArrayList<p>In this example, I created an ArrayList&lt;> of dogs instead of the usual Array[]. But,...
<p>Right now, <code>dogs</code> is empty. This means that <code>sort</code> has no effect, and the enhanced-for will never execute.</p> <p>You have several options:</p> <ul> <li><p>Add them when you instantiate them. Don't create variables that aren't going to be used.</p> <p>As an example, one of your lines would...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Confused about protecting against XSS and which tools to use<p>VS2013, MVC, VB</p> <p>I'm asking this question now because much time has passed since most o...
<p>Followed the guidance from <a href="http://www.mikesdotnetting.com/article/222/request-validation-in-asp-net-web-pages" rel="nofollow">this post</a> as a basis for coding a whitelist filter using the html agility pack. The link shows a function used in a web pages approach, but the basic algorithm works fine coded ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Oracle.DataAccess not available for selection in Visual Studio 2013<p>I've recently set up a Windows 8.1 64 Bit Machine with Visual Studio 2013 (probably 32 ...
<p>Yes, Visual Studio is an 32bit application.</p> <p>It depends on your compilation target (<code>x86</code> or <code>x64</code> or <code>AnyCPU</code>) which Oracle Client you need for running/debugging your application, regardless of the architecture from Visual Studio.</p> <p><code>AnyCPU</code> will run as 64 bi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to turn Bootstrap Carousel slides to change on scroll?<p>I am using <a href="http://getbootstrap.com/javascript/#carousel" rel="nofollow">bootstrap carou...
<p><code>$('#myCarousel').carousel('next')</code> slides to next item as <a href="http://getbootstrap.com/javascript/#carousel" rel="noreferrer">documented</a>. So you can bind scroll event to do that:</p> <pre><code>$('#myCarousel').bind('mousewheel', function() { $(this).carousel('next'); }); </code></pre> <p>E...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: An error combining DO and IF in Fortran<p>This is a part of code that I am writing in Visual FORTRAN 6.6A:</p> <pre><code> . . . DO 24 I=1,80 24 IF ...
<p>The termination of a do loop using a label is not valid the way you specify it. For FORTRAN 77 use: </p> <pre><code> DO 24 I=1,80 IF ((NODNUM(1) .EQ. I) .AND. (CAUCHY(3,2) .LT. CTI(I+12))) THEN ARRAY(1)=C1*0.99 END IF 24 CONTINUE </code></pre> <p>In Fortran 90+ you could simply leave out th...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: correct way to get $wpdb object in custom plugin file<p>I want to have a correct way to get $wpdb object in a custom file under <code>XYZ_Plugin</code>. Thin...
<p>Depending on where you are loading this file from. If its in your plugin folder (DOWNLOAD_FILE) like you said, you are looking to add something like this to the top of your code.</p> <pre><code>require_once('../../../wp-load.php'); </code></pre> <p>Once that is added you can go ahead and call the $wpdb globals and...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I format a resource string?<p>I have this snippet so far:</p> <pre><code> resetSettings: function (type, showConfirm, OnImageLoad) { if (...
<p>It sounds like you want to be able to call <code>Localization.GetBrowserLocalResource</code> with an optional second parameter. You'll have to modify that function. This should get you started on defining an optional parameter to a method:</p> <pre><code>// type is optional // callback = callback(key,value) GetBro...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Google Analytics Event not firing containing hit type<p>I've got a small little internal app that counts code, and I'm trying to set it up so that Google Ana...
<p>From your comment it is clear that you are using the <code>gtag</code> library while the event is sending it with <code>ga</code> (Analytics Universal).</p> <p>So you need to edit your event from this:</p> <pre><code>ga("send", "event", "code", "counted", "Counted Code", jsonReturn.data.raw_total); </code></pre> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is TypeScript able to 'const' assertions to number calculation?<p>Please see this minimum example, this is my real usage:</p> <pre class="lang-js prettyprin...
<p>I've created the <a href="https://github.com/rimbu-org/rimbu/tree/main/packages/typical" rel="nofollow noreferrer"><code>@rimbu/typical</code></a> library to allow type-level calculations. It uses some trickery but works reasonably well.</p> <p>In your case, you would just have to write a multiplication function tha...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SSMS removing pre-BEGIN comments from my stored procedures<p>I'm running SSMS 12.0.2000.8</p> <p>If I use the SSMS query editor to create a stored procedure...
<p>After observing some other strangeness (namely <code>with execute as caller</code> being added to my scripts), I did some Googling and discovered the answer:</p> <pre><code>delete \Users\[user]\AppData\Roaming\Microsoft\SQL Server Management Studio\12.0\sqlstudio.bin </code></pre> <p><strong>WARNING:</strong> You ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Linux Rename Multiple Files At a Shell Prompt<p>I want to change:</p> <p>Input: changing_colorlow_actual_take000000.png Output: changing_colorlow_expected.p...
<p>A simplistic approach, assuming these are all in the current directory:</p> <pre><code>for f in *actual_*.png; do mv "$f" `echo $f | sed "s/actual_[^/]*\.png$/expected.png/"` done </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What does the "_" function in Vala do?<p>I've seen that some projects used <code>_</code> function that takes string as an argument, like <code>_("Hello Worl...
<p>That is the GNU <code>gettext</code> localization function. You can provide language specific alternate strings for the one specified in the function call.</p> <p>There is the <code>xgettext</code> tool, which generates a <code>.pot</code> file (abbreviation for <em>portable object template</em>) from your applicat...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Kendo UI Validation for Razor instead of Html<p>I use Kendo validator in my MVC application and <strong>want to change the position of validation message fro...
<p>try this (updated)</p> <pre><code> @Html.TextBoxFor(m =&gt; m.Question, new { @class = "k-textbox", required = "true", validationmessage = "required field" }) @Html.ValidationMessageFor(model =&gt; model.Question) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java second variable dismisses first one<p>What I have to do is make a little GUI that when a <code>button</code> is clicked it starts to progress bars with ...
<p>Your inner class should maintain it's own reference to the <code>JProgressBar</code> that it is passed.</p> <p>Simply take...</p> <pre><code>private JProgressBar jpb; </code></pre> <p>and move it inside your inner class</p> <pre><code>class InnerProgress extends JPanel implements Runnable { private JProgres...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JavaScript doesn't block DOM constructing<p>I have this html:</p> <p></p> <pre><code>&lt;head&gt; &lt;/head&gt; &lt;body&gt; &lt;h1&gt;TEST&lt;/h1&gt; ...
<p>Only <em>future</em> DOM construction halts when a script is being downloaded/parsed. DOM elements which have already been parsed (such as your <code>&lt;h1&gt;</code>), which come <em>before</em> the script tag, remain in the DOM - the downloading of a script does not result in them being removed until the script i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Oracle numeric type which start with 0<p>Which I have to use numeric data type(if numeric) in Oracle database, if i will store in that column the values whic...
<p>That isn't numeric though. In numeric speak 00001 = 0001 = 001 = 01 = 1. They are all the same. If you are looking for something that distinguishes between those you will need a char/varchar column.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: select QString which is added to QcomboBox by setEditText(QString) method<p>how to select a text which I have add to my QComboBox by comboBox->setEditText(so...
<p><code>#include &lt;QLineEdit&gt; .... ui-&gt;comboBox-&gt;lineEdit()-&gt;selectAll();</code></p> <p>If I understood question.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the simplest way to include a hidden field when using Django's generic editing views<p>I would like to pass a hidden form field but still take advant...
<p>Subclass <code>CreateView</code> and modify the <code>get_form</code> method:</p> <pre><code>class ObjectCreateView(CreateView): model = Object fields = ['title','content','rating'] def get_form(self, form_class=None): form = super().get_form( form_class) form.fields['rating'].widg...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to Invoke JavaScript from Xamarin.Forms app without using Uno.UI?<p>I have a Xamarin.Forms app and it projected to WASM via <a href="https://platform.uno...
<p>You can use hybrid webview then inject JavaScript code to detect every click on this web view <a href="https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/custom-renderer/hybridwebview" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/custom-rende...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Data Type conversion error in Pivot Table<p>I have a database that stores our company's positions and "requirements". I.e. each position needs to have underg...
<p>Your <code>PIVOT</code> query is not arranged properly. Try this one:</p> <pre><code>SELECT * FROM ( SELECT PositionName, RequirementType, RequirementName FROM [Position Requirements] A LEFT JOIN Positions B ON A.Position_ID=B.PositionID LEFT JOIN Requirements C ON A.Requirement_ID=C.Requireme...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can't select inputs after TransformY on chrome for a "card flipping" effect<p>I have a "card" design in which I have an <code>div</code> with two children, a...
<p>It seems, that <code>.card</code> overlaps the back after rotation.</p> <p>Maybe you could rotate not <code>.card</code> but <code>.card__face--front</code> and <code>.card__face--back</code>. I made some modifications in snippet.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" dat...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: show con_name command returns SP2-0158: unknown SHOW option "_name"<p>I'm using SQL*PLUS with Oracle g11 express edition.</p> <pre><code>SQL&gt; show con_na...
<p><a href="https://docs.oracle.com/cd/E11882_01/server.112/e16604/ch_twelve041.htm#SQPUG124" rel="nofollow noreferrer">That's not a valid option in 11g</a>. It shows your current container, and multitenant databases weren't introduced until 12c.</p> <p>The <code>CON_ID</code> and <code>CON_NAME</code> options <a href...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cassandra Number Of Tokens Per Partition<p>I've recently started learning Cassandra and while going through the Datastax docs on Nodesync <a href="https://d...
<p>Yes, one partition == token. I think that confusion comes from the <em>segment</em> term that is used by NodeSync - one NodeSync segment may include multiple partitions, but it couldn't be smaller than partition.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Show different time when at different country<p>Want to ask. How do I create a website that is able to show different time when at different country. Example...
<p>You should do it on the client-side. I have read a forum once and they recommended it to be done in the client per se. Take what you think might help you from this javascript code example:</p> <pre><code>var now = new Date(); var utcString = now.toISOString().substring(0, 19); var year = now.getFullYear(); var mont...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Write a random value in a cell if the cell has the same value that can be found in another sheet<p>I have the below two sheets in an excel file. I need a VBA...
<p>Use array is fast.</p> <pre><code>Sub setStatus() Dim Ws1 As Worksheet, Ws2 As Worksheet Dim rngDB As Range Dim vDB, vR() Dim i As Long, n As Long Set Ws1 = Sheets(1) Set Ws2 = Sheets(2) With Ws1 vDB = .Range("a2", .Range("a" &amp; Rows.Count).End(xlUp)) End With With W...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Do I need to new ArrayList in loop every time?<p>Here, I created a new 2D ArrayList and sort it.</p> <pre><code>//1. sort list, based on col 0. //list : Lis...
<p>The difference between your two approaches are in the way of how the references are. In general both should work.</p> <p>In your first approach you have created a copy of the 2D list, meaning changes to the old list would not affect your sorted list. The first way is more secure.</p> <p>In your second approach you...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Excel macro to select certain worksheets and print to one pdf<p>I have an excel workbook in excel 2007 which has approx 110 separate worksheets. </p> <p>I w...
<p>In order to print all the sheets into on PDF file, you will need to store all the sheet names you want to print into an array and then use the following command.</p> <pre><code>Worksheets(printSheets).PrintOut Preview:=False, ActivePrinter:="Adobe PDF", PrintToFile:=True, PrToFileName:=PSFileName </code></pre> <p>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to read specific data in this oddly structured text file? Python<p>I've been developing a discord bot for the game Counter Strike Global Offensive and up...
<p>From what I see, once you are inside the map object (curly braces), you could see a pattern which is similar to a json object.</p> <p>The solution what I'm going to suggest should only be used if the file that has this stats is a small file otherwise there would be a lot of memory overhead.</p> <p>Solution : Read...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to align navbar to center with css<p>I need help to align my navbar bar to center Here is my code What's wrong with it? It does not align the menu to the...
<p>One way would be to set the <code>display</code> of <code>#nav ul</code> to <code>inline-block</code>. Then add <code>text-align: center</code> to the parent element in order to center the child <code>ul</code>:</p> <p><a href="http://jsfiddle.net/7yykswx4/" rel="noreferrer"><strong>Example Here</strong></a></p> <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I want to select the greater of the two values from two columns in R<p>My data looks like:</p> <pre><code>head(myframe) id fwt_r fwt_l [1,] 101 72 ...
<p>You are looking for the 'pmax' function</p> <p>Just run this:</p> <pre><code>pmax(myframe$fwt_r, myframe$fwt_l) </code></pre> <p>pmax means 'parallel maxima' (or vectorized)</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Vim cursor moves forward 7 characters when I use my remapped <Esc><p>I took a stab at writing my own .vimrc for the first time. I've gotten used to using "k...
<p>There are trailing spaces right after <code>inoremap kj &lt;Esc&gt;</code>, which is interpreted as a part of the mapping. Try removing these spaces.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I fix the slide navigation<p>I working on this sliding menu. It can slide fine, but have problem to close it by clicking x.</p> <p><div class="snipp...
<p>You need to add actionListeners on buttons(links) rather than on document.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>let slide = document.querySelector(".slide"); let...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: why is item not being deleted from dictionaries list values<p>I have a dictionary:</p> <pre><code>new_members = {'member1': ['PCP2'], 'member10': ['PCP2'],...
<p>you can filter each list from your dict: </p> <pre><code>bad_items = pcps_in_negative | pcps_at_zero new_members = {k: [e for e in v if e not in bad_items] for k, v in new_members.items()} print(new_members) </code></pre> <p><strong>output:</strong></p> <pre><code>{'member1': ['PCP2'], 'member10': ['PCP2'], 'm...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JSP String array comparison<p>This may be a repeat question but I couldnt find any working answer.</p> <p>So in my jsp, I am trying to compare two arrays, o...
<pre><code> String c[] = new String[Ques_low]; String cAns[] = new String[Ques_low]; for (int i = 0; i &lt; Ques_low; i++) { c[i] = (String) request.getParameter("" + i); cAns[i] = (String) session.getAttribute("" + i); out.println(Arrays.asList(c).containsAll...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React-final-form - input losing focus after every keystroke<pre class="lang-js prettyprint-override"><code>import React from "react"; import { Field, Form } ...
<p>Since an inline lambda is used for the component, its identity changes every render.</p> <p>While according to many other questions an unique key should be enough, moving the <code>component</code> function outside the master component fixes it altogether.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can we add image in UITableView section header using swift?<p>In my willDisplayHeaderView I have changed color of section header But I want to add an ima...
<p>You could design your own header, like you would design a custom cell in a table view. Or you could just add an image like so:</p> <pre><code>func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -&gt; UIView? { var myCustomView: UIImageView var myImage: UIImage = UIImage(named: "myI...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Duplicate partial line text with vi/vim<p>I have two lists like these below:</p> <pre><code>abc.domain.com defg.domain.com hijklmn.domain.com </code></pre> ...
<p>Assume the two lists are in two different buffers. We can do the job using vim's <code>:s</code> command:</p> <h2>For list1:</h2> <pre><code>%s/\v([^.]+).*/&amp;?ref=\1/ </code></pre> <h2>For list2:</h2> <pre><code>%s#\v.*/([^/]+)/$#&amp;?ref=\1# </code></pre> <p>If the two lists are mixed in one buffer, you ca...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: "Don't know about Xamarin.Forms.Color"<p>Why gives me this code "Don't know about Xamarin.Forms.Color" exception?</p> <p>Exception detail:</p> <p><code>Sys...
<p>You can't have a <code>Color</code> field in your sqlite db, so ignore it.</p> <pre><code>namespace Notes.Models { public class Note { [PrimaryKey, AutoIncrement] public int ID { get; set; } public string Text { get; set; } public string Title { get; set; } public str...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android Studio unit testing support vs robolectric<p>Hitherto I used robolectric unit testing with JUnit 4.x for testing my business logic. In the last versi...
<p>There is no reason you cannot use both. Robolectric has the advantage that you can test against actual Android behaviour when needed. Plain JUnit will just let you test the parts of your code that do not interact with Android.</p> <p>This will let you view the results of the robolectric tests in Android Studio alon...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SIGSEGV when using pt::ptree::value_type for a great number of json matrices<p>M'm trying to parse the following json file which consists mainly of json matr...
<p>your problem is here : </p> <pre><code> for (pt::ptree::value_type &amp;row : e.second.get_child("value.matrices")) { for (pt::ptree::value_type &amp;cell : row.second) { double matrix[4]; matrix[x] = cell.second.get_value&lt;double&gt;(); // ..... } x++; } </code></pre> <p><code>d...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I delete nested array element in a mongodb document with the c# driver<p>I am new in the MongoDB world and now I am struggling of how can I delete, u...
<p>You are calling method <code>Pull(string name, MongoDB.Bson.BsonValue value)</code> and according to the docs it </p> <blockquote> <p>Removes all values from the named array element that are equal to some value (see $pull)</p> </blockquote> <p>and you provide <code>{ "Identifier", productId }</code> as the val...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to deploy tika-server-1.7.jar on tomcat<p>How to deploy tika-server as WAR file, under a servlet container Tomcat? I prefer to deploy without using in ma...
<p>As of February 2015, this isn't possible. The Tika Server is only available as a runnable jar.</p> <p>There is ongoing work to do a war version as well, that's being tracked on <a href="https://issues.apache.org/jira/browse/TIKA-894" rel="nofollow">TIKA-894</a>. If this matters to you, your best bet is to review <a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create trigger to change status after insert and update in MySQL?<p>i have a table (input) with some fields :</p> <ul> <li>check_number int (primary ...
<p>You won't be able to cover all your requirements with triggers. </p> <p>What you can do and better be doing anyway is calculating <code>status</code> on the fly or using the same conditions in <code>WHERE</code> clause if you're fetching rows for of a specific status</p> <pre class="lang-sql prettyprint-override">...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using Avahi ServiceBrowser with (PyQt5) QtDbus and connected slots are not called<p>I'm having a problem using the QtDbus in PyQt5. What I would like to do i...
<p>Qt is not finding your slot properly. You need to redecorate your slot -- what you receive (via DBUS) is not a function call with 6 parameters, it's a single QDBusMessage. Try this:</p> <pre><code>... @pyqtSlot(QDBusMessage) def onServerAdd (self, msg): print("Avahi peer added:") print(" ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ERROR! 'sudo' is not a valid attribute for a Play<p>I have an ansible play file that has to performs two tasks, first on the local machine get the disk usage...
<p>Ansible play keyword <code>sudo</code> was (long ago) <a href="https://docs.ansible.com/ansible/devel/porting_guides/porting_guide_2.0.html#deprecated" rel="noreferrer">deprecated with warnings in version 2.0 and removed in version 2.2</a></p> <p>See the <a href="https://docs.ansible.com/ansible/latest/reference_app...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android SDK gives wrong path, Android Studio<p>Recently I've started to get involved in Android developing, and I learned that Android Studio was available c...
<p>AppData is a hidden folder on windows. In order to show hidden files and folders on windows 8, follow <a href="http://blogs.msdn.com/b/zxue/archive/2012/03/08/win8-howto-19-show-hidden-files-folders-and-drives.aspx" rel="nofollow">this guide on msdn</a>.</p> <p>In short, you should go to Control panel->Folder optio...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Spring Data JPA Custom findBy not working<p>Service where i call the method </p> <pre><code>public String deleteEmployeeByID(int id){ if(employeeReposit...
<p>It would be good if you have posted your related codes not just the doubted area seemed to you by chunk. Try <code>@Autowired</code> your service where you are using it and replace your method by this:</p> <pre><code>findByEmployeeId(Integer id); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to I create a labelled scatter plot?<p>I would like to draw a labelled scatterplot, like shown below, in Gadfly.</p> <p><img src="https://i.stack.imgur....
<p>While @Oxinabox's answer works, the Gadfly way would be to use <a href="http://gadflyjl.org/geom_label.html" rel="noreferrer"><code>Geom.label</code></a>, e.g.</p> <pre><code>using Gadfly X = [1, 2, 2, 3, 3, 3, 4] Y = [4, 4, 7, 7, 9, 1, 8] Labels = ["bill", "susan", "megan", "eric", "fran", "alex", "fred"] plot(x=...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to detect an octagonal shape in Python and Opencv<p>I am working on a <strong>shape</strong> detection algorithm with <strong>opencv</strong> in <strong>...
<p>To perform shape detection, we can use contour approximation. With the assumption that the objects are <em>simple</em> shapes, here's an approach using thresholding + contour approximation. Contour approximation is based on the assumption that a curve can be approximated by a series of short line segments which can ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Order of action commands using subpass dependency?<p>From what I have read so far, commands in a single command buffer can be out of order without explicit s...
<p>So what is happening is that somehing is rendered to <code>img1</code> (as color attachment). Then <code>img1</code> is sampled, and stuff is written to <code>img2</code> (as color attachment). Then <code>img2</code> is sampled and written to a swapchain image.</p> <pre><code>dependencies[0].srcSubpass = VK_SUBPAS...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to embed a report from Power BI?<p>How to embed a report from Power BI Report Server into an Angular application? Found only one article that says it's i...
<p>Add an <code>&lt;iframe&gt;</code> tag, set its source to be the URL of the report and add <a href="https://docs.microsoft.com/en-us/power-bi/report-server/developer-handbook-overview#embedding" rel="nofollow noreferrer"><code>?rs:Embed=true</code></a> to it.</p> <p>For example:</p> <pre><code>&lt;iframe width="80...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java JFrame distance between ovals not equal<p>I had to implement a JFrame with the size of 500 x 500 pixels that should have a 9 x 9 "field" of circles, but...
<p>You should really subclass a JPanel, not the JFrame. And all of this should be done on the EventDispatchThread, not the main thread. Further, don't use "magic" numbers like 500, 20, and 40. Here's a solution that paints the entire panel, regardless of what size it is (note that there is no provision here for having ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Uncaught TypeError: Cannot read property 'basePrice' of undefined<p>I'm not sure what the error (Uncaught TypeError: Cannot read property 'basePrice' of unde...
<p>The error means that <code>plans[ selectedPlan ]</code> is not defined.</p> <p><code>selectedPlan == "free"</code> and <code>plans.free</code> doesn't exist.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Must be array type but resolved to vector<p>I get this error when trying to use vectors in my code - must be array type but resolved to Vector. I'm trying t...
<p><strong>You cannot access Vector items by the angle brackets syntax. That is only supported for arrays in Java</strong>.</p> <p>Use <code>student.add(Tokens[0])</code> instead.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React Redux -possible to have a call back in dispatch function<p>Guys i am having some trouble or quite doubtful.</p> <p>am having one component and one red...
<p>The correct way for solving this is setting a global <code>loading</code> flag and in your <code>componentDidUpdate()</code> method, checking for the value to determine that the action has just succeeded. You already seem to have the <code>isLoading</code> flag. Just set it when the action's dispatched, and unset it...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I need to find 5 most used words by using dict method and also words provided by moodle system<pre><code>import sys girdi = sys.stdin.read() girdi = girdi....
<p>This should do the trick:</p> <pre class="lang-py prettyprint-override"><code>from collections import Counter import re #instead of all the replacing - do this on your raw data: x=Counter(re.findall("\w+", girdi)) #top 5 values: y=sorted(x.values(), reverse=True)[:5] #top 5 words, along with respective counts re...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Setting onClickListener to the whole item in onBindViewHolder<p>I have an <code>RecyclerView Adapter</code> and I want to set the <code>onClick</code> to the...
<p>Like other users already mentioned <code>myViewHolder.itemView.setOnClickListener</code> to set onClick on the recyclerView holder. But, correct me if I am wrong, it seems you want your checkbox to be checked/unchecked only by holder click. In that case you need to disable it by adding following codes to your layout...