input
stringlengths
51
42.3k
output
stringlengths
18
55k
How to fetch special char with five digits no in oracle? <p>I am trying to fetch :with five digits no values in oracle. my data look this format.</p> <pre><code>this :years 2016 only department :12345 aign:BR-PESP-THELIMITED-:30510 :thiss and :years 2016 only department :12345 travel visa :34322 LLL001 </code></pre> ...
<p>If you want to return the five digits after a colon:</p> <pre><code>select regexp_substr(check1, ':([0-9]{5})', 1, 1) </code></pre>
UITableView with embed UICollectionView is not working <p>I have a UITableView with 4 UITableViewCell inside. I want it to be dynamic by setting:</p> <pre><code>tableView.estimatedRowHeight = 44 tableView.rowHeight = UITableViewAutomaticDimension </code></pre> <p>For the third cell, with embed UICollectionView, it ha...
<p>Well the debugger is telling you what is wrong:</p> <blockquote> <p>frame = (20 0; 335 44)</p> </blockquote> <p>This is your collectionView frame and this means the height of the collectionView is only 44px, which is also the height of your cell. So it doesn't fit in the collectionView with the cell inset values...
Dynamically create Angular-Chart with data binding <p>Is it possible to dynamically create a chart while still have a data binding to the scope?</p> <p>I have the following code</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;head&gt; &lt;script src='Chart.js'&gt;&lt;/script&gt; &lt;script src='angular.js'&gt;&l...
<p>You are just updating the data but the chart has been already rendered on your view.So you need to draw it again with updated data. You can make a function to draw chart like this</p> <pre><code>function drawChart(element,dataset){ var myChart = new Chart(element,{type:'bar',data:{labels:$scope.labels,datasets :d...
Error while installing ibm case manager 5.2.1 on windows server 2012 <p>I’m using cmpit 5.2.1 on windows server 2012 to install ibm case manager 5.2.1, I’m having an error in step 34/38 in the installation. In cpit_install_stdout:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" dat...
<p>I do not read French, but Google Translate suggests that your LDAP configuration isn't properly configured.</p> <p>If you look at the log you might get some more information: <code>C:\Program Files (x86)\IBM\ECMClient\logs\nexus_configmgr_workspace\.metadata\.log</code></p> <p>The other error suggests that a file ...
Issue with pie chart matplotlib - startangle / len() <p>I have a script which creates a pie chart based on CSV files. My problem started when I was reading a CSV that had only one row (e.g. <code>percent = [100]</code>). Is there any limitation of using a pie chart, where is will not show 100% for only one item? It see...
<p>Change the <code>explode</code> parameter to a <code>list</code>:</p> <pre><code>percent = [100] explode = [0] plt.pie(percent, explode=explode, ...) </code></pre> <p>If you have more values, you can use a <code>tuple</code>, but with one value <code>(int)</code> is seen as an integer:</p> <pre><code>&gt;&gt;&gt...
How to generale partial/incremental updates used by “adb install-multiple”? <p>adb has a "partial application install":</p> <p>adb install-multiple [-lrtsdp] - push this package file to the device and install it (-l: forward lock application) ...
<p>The <em>partial application install</em> flag controls <code>PackageInstaller</code>'s <a href="https://developer.android.com/reference/android/content/pm/PackageInstaller.SessionParams.html#MODE_INHERIT_EXISTING" rel="nofollow"><code>SessionParams.MODE_INHERIT_EXISTING</code></a> mode. And the only officially docum...
Unable to Connect To NodeJS server Running on EC2 from NGINX on another EC2 <ol> <li>We are running a nodejs HTTP server on port 8090 on Amazon EC2 instance 1</li> <li>We are running NGINX on port 80 at Amazon EC2 instance 2</li> <li>In the NGINX we have configured upstream for our NodeJS Server</li> <li>Now we are una...
<p>I have solved the problem. You have to change the port from 80 to any other port in the /etc/nginx/conf.d/default.conf.</p> <p>I have changed the port to 81.</p> <pre><code>server { listen 81; server_name localhost; </code></pre> <p>Then please restart the NGINX and it will work.</p>
PHP array_filter multi callback <p>How can I set <code>multifilter</code> or <code>multicallback</code>?</p> <p>I want filter data by <code>City</code> and <code>Confirm</code> together.</p> <p>Input data:</p> <pre><code>$data1 = array( "L1" =&gt; array('Vanessa', 'Prague', 'OK'), "L2" =&gt; ...
<p>Finally, here is solution: <a href="http://stackoverflow.com/questions/31341563/php-5-2-filter-array-with-multiple-arguments-performance">PHP 5.2: Filter array with multiple arguments performance</a></p> <pre><code>$arrayToCompare = array('type'=&gt;'fruits','has_name'=&gt;'OK', 'has_color'=&gt;'Prague'); $new = a...
How to extract node values from xml to text file <pre><code> &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom"&gt; &lt;Document&gt...
<p>Assuming your formatting of the XML file is correct, the below should help you extracting the data you need and insert them into a text file line by line.</p> <pre><code> string pathToXmlFile = ""; XDocument document = XDocument.Load(pathToXmlFile); var coordinates = document.Descendants("c...
Calculate datetime difference in C <p>I need a function that can calculate the difference between two datetime (year, month, day, hours, minute, seconds). and then return the difference in the same format.</p> <pre><code>int main (){ struct datetime dt_from; init_datetime(&amp;dt_from, 1995, 9, 15, 10, 40, 15...
<p>Here is the basic idea:</p> <p>Convert your <code>datetime</code> into an integral type (preferable <code>long long</code> or <code>unsigned long long</code>) which represents your <code>datetime</code> value as it's smallest unit (second in your case). How to achieve that? Easy transform the single values into sec...
Unable to locate element in Selenium <p>I am trying to find an element which is like a container. I have used css selector and xpath. but I am getting unable to locate element. Could someone help?</p> <p>Here is the full html snippet </p> <pre><code>&lt;div class="container" data-aura-rendered-by="44:87;a"&gt;&lt;hea...
<p>You can use css or xpath.</p> <p>For css use:</p> <pre><code>div.interactions.siteDesignTimeRegion </code></pre> <p>For xpath use:</p> <pre><code>//div[@class='interactions siteDesignTimeRegion'] </code></pre> <p>Always try to select an element by attributes when possible and avoid using absolute xpaths like th...
macro in makefile? Conditional h-file inclusion? <p>Let me explain my situation: I have a program that contains different kinds of models (let's say 10, but the actual number is quite high). All these models have a name and corresponding file "model1.cu" and "model1.h". All of these files have a function that produces ...
<p>You can simply add a preprocessor definition to your Makefile, for each model you have. For example, in the case of MODEL1=1:</p> <pre><code>ifdef MODEL1 SRCS := model1.cu OBJS := model1.o CFLAGS += -DMODEL1 endif </code></pre> <p>Assuming you are using the <a href="https://www.gnu.org/software/make/manual/html_no...
"multiple definition" error when linking to boost::process 0.6 <p>I am a bit lost with this linking error, I assume the problem lies on my side rather than in the lib itself but I don't know how to solve this.</p> <p>I am trying to link to boost::process 0.6 <a href="https://github.com/klemens-morgenstern/boost-proces...
<p>This is a library bug, the functions in question are missing <code>inline</code>. I'll fix that today, so you'll be able to use it tomorrow. There's nothing wrong with your code:</p> <p>But thank you very much for giving the beta a try. The review is in the end of october, I'd be very happy if you participate there...
AngularJS: $q.race() in old angular versions <p>Angular 1.5.8 implements a <code>$q.race()</code> method which takes an array of promises and returns a promise which is resolves with the value of the first resolved promise.</p> <p>However i am stuck with angular 1.4 for now and need some kind of functionality like a <...
<pre><code>function myRaceFn(promises){ return $q(function(resolve, reject) { promises.forEach(function(promise) { promise.then(resolve, reject); }); }); } myRaceFn([promise1, promise2]).then(.... </code></pre>
How to validate if a user input is both a float and with a given range in Python? <p>I'm trying to validate a user input to check if it is both a number (float) and within a range (0-1). I have used Try except to check if the input is a float as below:</p> <pre><code>while True: try: rate=input(": ") ...
<p>You can consider using <code>try-except-else</code> in the following manner:</p> <pre><code>min_val = 1 max_val = 10 while True: rate = input(": ") try: rate = float(rate) except ValueError: print("That was not a valid numerical value, please try again") else: if min_val &lt;...
Shortcode - Display all terms of an attribute into an ordered list by alphabetical letters <p>I've created a simple shortcode to output attribute terms and link to their respective archives. I'd like to be able to split the results by letter so that they output as follows:</p> <pre><code>A Adidas Askwith B Bonham Bur...
<p>Here is your fully functional shortcode. I have test it with a different set of terms and it works perfectly (so I hope that yours is correct and working too).</p> <blockquote> <p>First I prepare the data in a bi-dimentional array with the alphabetical letters on level 1 and the corresponding terms pair name/slug...
Bugzilla REST Interface - How to provide API Key and authenticate for a POST request <p>I am able to make a <a href="http://ashish-sureka-delhi.blogspot.in/2016/09/invoking-bugzilla-rest-interface-from.html" rel="nofollow">GET Request</a> (please click on the link to see the program I have written to make a GET Request...
<p>Following is the code which worked for me and solved my problem. I am posting it here so that it useful to other. Also I have <a href="http://ashish-sureka-delhi.blogspot.in/2016/09/invoking-bugzilla-rest-interface-from_16.html" rel="nofollow">written a blog on it</a>. </p> <pre><code> &lt;?php $url...
Hibernate Mapping Exception : Unknown Entity <p>I am mapping a simple POJO to a database table in SQL server using xml file mapping. I am getting Hibernate Mapping Exception : Unknown Entity<br> These are my code files:<br> Entry point class : </p> <pre><code>public class Program { public static void main(Stri...
<p>open hibernate.cfg.xml file. press ctrl and hold it and click on mapping class "<strong><em>com.example.hibernate.User</em></strong>" check whether you are navigated to User class or not.</p>
301 redirect not working via .htaccess within WordPress <p>I'm trying to apply two 301 re-directs in my .htaccess file within WordPress, but I get a 404 error.</p> <p>Here's what I have:</p> <pre><code># BEGIN WordPress &lt;IfModule mod_rewrite.c&gt; RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] Rewri...
<p>Ordering of rules and mixing of <code>mod_rewrite</code> rules with <code>mod_alias</code> (<code>Redirect</code> directive) will cause problems.</p> <p>Have your rules like this:</p> <pre><code># BEGIN WordPress &lt;IfModule mod_rewrite.c&gt; RewriteEngine On RewriteBase / RewriteRule ^old-page-name(/.*)?$ https...
Sinch video chat , cannot get remote video displayed <p>I am currently trying the Android <code>Sinch</code> SDK , so i am currently developing a test app to try some functionalities . I successfully made a voice app to app call , but i had a problem while trying the video app to app call : when the connection is estab...
<p>you need to add the remote video on videotrack added</p> <pre><code> @Override public void onVideoTrackAdded(Call call) { // Get a reference to your SinchClient, in the samples this is done through the service interface: VideoController vc = getSinchServiceInterface().getVideoController(); View myPrevi...
immutable.js: Map versus Seq <p>What the difference between a Map and a Seq in Immutable.js? Can you please provide an example demonstrating the difference between the two.</p>
<p>Immutable’s <code>Map</code> is an unordered <code>Iterable.Keyed</code> which consists of <code>(key, value)</code> pairs.</p> <pre><code>// create a Map() const map = Map({a: 1, b: 'Hello'}); // get a value for a specific key console.log(map.get('b')); &gt; "Hello" // set a new value and assign it to a new Map(...
Finding maximum y value on a plot <p>I have a large set of raw data that corresponds to load-displacement which I would like to plot. [Refer to a sample here: <a href="http://pastebin.com/qgZGs39K]" rel="nofollow">http://pastebin.com/qgZGs39K]</a></p> <p>I want to store the displacement data in an array x and the load...
<p>I am not sure I got the question. As far as I understand, you have plotted data, and you want the maximum on the plot, which means that you want the maximum of the interpolated data, in other word, for points that are not part of the original x set.</p> <p>If this is the question, there are few things to make clear...
Collapse some fields in drill down <p><a href="http://i.stack.imgur.com/lMgqA.png" rel="nofollow"><img src="http://i.stack.imgur.com/lMgqA.png" alt="enter image description here"></a>I have a below requirement in Drill down report. we have below two values under Lost Customers.</p> <p>Lost Customers, Number of lost cu...
<p>Create a tablix placing your fields as follows:</p> <p><a href="http://i.stack.imgur.com/2zzzI.png" rel="nofollow"><img src="http://i.stack.imgur.com/2zzzI.png" alt="enter image description here"></a></p> <p>Select the second row and press <code>F4</code> to see the properties window.</p> <p><a href="http://i.sta...
Import validation plugin Error: $(...).validate is not a function <p>I'm trying to use jQuery validation plugin in my test app with <code>webpack</code>, when I <code>import</code> it in my file i get this error <code>$(...).validate is not a function</code>.</p> <p>I know that <code>jquery-validation</code> based on ...
<pre><code>resolve: { modulesDirectories: ["node_modules", "bower_components"], alias: { "jquery.validate": "jquery-validation/dist/jquery.validate", "jquery": "jquery/dist/jquery.min" }, extensions: ["", ".js", ".jsx", ".es6"] }, </code></pre> <p>Just change a positio...
How can I make an endpoint listen to my webservice? <p>Hello Stack Overflowers,</p> <p>I have been given 3 technical questions to do which involve writing up a web service which will fire when you call up localhost for example such that it should return to you a message once you type localhost/whatever or just localho...
<p>You would need to understand MEX : <a href="http://jeffbarnes.net/blog/post/2006/10/16/metadata-exchange-endpoint.aspx" rel="nofollow">Try this</a> </p> <p>And about your 404 error. You need to have your web service running on your local IIS .</p>
Google maps, get center is not on the center. Android <p>I have a problem that when i try to get the center of the map it is different from the center of the screen and in different devices there are different distance differences.. How can i get the true center of the map? I need to add a marker in it</p> <p>Thank yo...
<p>Target depends on the bearing and rotation of the camera. The best way is to get the screen point of the "center" of the map and then translate it to a map point by doing:</p> <pre><code>myMap.getProjection().fromScreenLocation(screenPoint); </code></pre> <p><a href="https://developers.google.com/android/reference...
How to combine result of SQL statement using MySQL <p>I have wrote a query which gives me result in separate rows but issue is that I want that result in single row.</p> <p>Which gives result like below </p> <p>Here count is having two possibilities <strong>yes or no</strong>.</p> <p>but i want something like</p> <...
<p>The <a href="https://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html#function_count" rel="nofollow">COUNT()</a> function accepts complex expressions, not just column names. I don't think I fully understand what your data contains or what you want to accomplish but you can try something on this line:</p> <pr...
Limit values for a field to entries in another table in hibernate <p>There are two entity classes:</p> <pre><code>@Entity public class Person { @ManyToOne(cascade = CascadeType.PERSIST) private Hobby hobby; } @Entity public class Hobby { private String hobby; } </code></pre> <p>The <code>Person.hobby</c...
<p>You already did it!</p> <p>By doing the @ManyToOne, the Person.hobby column becomes a foreign key to the Hobby.id.</p> <p>You also need to add an id in the Hobby, but I assume you already have that.</p> <p>Another thing to consider is that you need to load the Hobby entities from the EntityManager before using it...
Alfresco X-Frame options <p>i'm triying to display an iframe with alfresco, but is giving me error </p> <blockquote> <p>refused to display 'url' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.</p> </blockquote> <p>i follow this tutorial: <a href="https://www.alfresco.com/blogs/ewinlof/2013/03/12/introd...
<p>Always you modify some file from Alfresco, you need restart the server, stoping the tomcat service and starting again.</p> <p>If tomcat is not stopped, you will not see the changes, the fast solution, reset the server, the another solution is:</p> <p>Windows: <code>tasklist</code> get the PID and then <code>TASKKI...
Typo3 ai image - crop not working <p>When I upload a ai image the crop feature of typo3 is not working. The following error is showing up:</p> <blockquote> <p>No image found. Could also be that image is present but that the original dimensions are unknow.</p> </blockquote> <p>I'm using imagemagick and ghostscript...
<p>ai is a vector format, so the <em>original dimensions</em> are not defined at all as they could be anything.</p> <p>the preview is possible as the ai image can be any size.</p> <p>maybe it is a bug in the cropping process where a fixed size is assumed and you should open a forge ticket.</p>
Kivy - My ScrollView doesn't scroll <p>I'm having problems in my Python application with Kivy library. In particular I'm trying to create a scrollable list of elements in a TabbedPanelItem, but I don't know why my list doesn't scroll.</p> <p>Here is my kv file:</p> <pre><code>#:import sm kivy.uix.screenmanager Screen...
<p>I Myself haven't used kivy for a while but if I remember exacly: Because layout within ScrollView should be BIGGER than scroll view ex ScrollView width: 1000px, GridView 1100px. So it will be possible to scroll it by 100px</p>
Passing class's member function to std::thread <p>I have a problem with using std::thread in my code:</p> <pre><code>Class Timer { ... public: void Start(bool Asynch = true) { if (IsAlive()) { return; } alive = true; repeat_count = call_number; if (As...
<p>You should specify the scope </p> <pre><code>&amp;Timer::ThreadFunc </code></pre>
Find tables accessed by user in Oracle <p>Using Oracle XE 10g.</p> <p>We have an application that uses a database user with restricted access. Because it is very cumbersome to find out by trial and error which tables this user needs to have access to, we are looking for a way to query the Oracle Data Dictionary for in...
<p>You can track access with the <a href="http://docs.oracle.com/database/121/SQLRF/statements_4007.htm#SQLRF01107" rel="nofollow"><code>AUDIT</code></a> command. This can generate a lot of data so be careful.</p> <p>Enable auditing on all statements from a specific user, to capture all access:</p> <pre><code>audit ...
Advice on using Shiro to restrict resultset <p>We have an application that allows users to see a list of documents.</p> <p>Depending on the role of the user and the properties of the document, we want to filter out some of the documents on the list. For example we want to allow the user to view a list with only the d...
<p>You have a few options: First since it sounds like you want to display the full list of documents to the user you will still need to query all of them. (though I caution you on this, as that leaks information the user does NOT have access too. For example of user 'jcoder' sees a document titled 'Super Secret Passwor...
Getting FRACTIONAL difference (YEARS) between two dates in T SQL (MS-SQL Server) <p>Simple question: I need to detect a difference between two dates, such that when <code>Date_1 = 12-jan-2010</code> and <code>Date_2 = 01-jan-2016</code> I would <strong>NOT</strong> get 6 but a number &lt; 6.</p> <pre><code>SELECT DATE...
<p>It depends on required precision, try following:</p> <pre><code>SELECT DATEDIFF(DAY, @d1, @d2)/365.25 </code></pre>
How to remotely trigger Jenkins multibranch pipeline project build? <p>Title mostly says it. How can you trigger a Jenkins multibranch pipeline project build from a remote git repository?</p> <p>The "Trigger builds remotely" build trigger option does not seem to work, since no tokens that you set are saved.</p>
<p>At the moment (Jenkins 2.22) the "Trigger builds remotely" build trigger option is visible in the multibranch pipeline job configuration, but does not work (if you check it and specify a token, it gets reset after saving anyway). According to <a href="https://issues.jenkins-ci.org/browse/JENKINS-35310" rel="nofollow...
Multithreading / asynchronously in Php codeigniter <p>In my controller I load the HTML using view. Now before the view loads, I need to call 2 more functions. So what happens is, it waits for the function 1 to finish (5-6 seconds) and then 2nd function to finish (another 5-6 seconds) and the view loads. is it possible ...
<p>The answer is to use PHP's <code>exec()</code> function. (<a href="http://php.net/manual/en/function.exec.php" rel="nofollow">Read about <code>exec()</code></a> and <a href="https://nsaunders.wordpress.com/2007/01/12/running-a-background-process-in-php/" rel="nofollow">more info here</a>.) This can be implemented a ...
Pandas fuzzy detect duplicates <p>How can use fuzzy matching in pandas to detect duplicate rows (efficiently) </p> <p><a href="http://i.stack.imgur.com/yZxK6.jpg" rel="nofollow"><img src="http://i.stack.imgur.com/yZxK6.jpg" alt="enter image description here"></a></p> <p>How to find duplicates of one column vs. all th...
<p>Not pandas specific, but within the python ecosystem the <a href="https://github.com/datamade/dedupe" rel="nofollow">dedupe python library</a> would seem to do what you want. In particular, it allows you to compare each column of a row separately and then combine the information into a single probability score of a ...
How to set the default value of a dropdown in powerapps <p>I have a dropdown in powerapps and need to set the default value</p> <p>My <code>Items</code> property of my dropdown I have it linked to my data source which is an Azure table.</p> <p><code>'[dbo].[ColorTable]'</code></p> <p>One could see the contents simpl...
<p>I have a workaround that works but in conjunction with saving the selected value back again it can conflict with the saving.</p> <p>In the <code>Default</code> property of the dropdown I add the following code</p> <pre><code>LookUp('[dbo].[ColorTable]';ID=ThisItem.fk_ColorID;ColorName) </code></pre>
Possible to serve HTTPS on a static GCP website? <p>Is there any <em>production-ready</em> way to host a static website supporting SSL on GCP? The static website tutorial states that "SSL is not currently supported by the Cloud Storage webservers", but presumably they serve HTTPS on their own domains. Are there any wor...
<p>You're right, SSL is very important.</p> <p>I advise you to use <strong>Google AppEngine</strong>. You have 2 solutions:</p> <h3>1. Continue to store your static pages on GCS (Google Cloud Storage)</h3> <p>Just follow this tutorial in order to call your static pages from GCS with Google AppEngine: <a href="https:...
Maven and parent project <p>I'm trying to create a maven based project which has a parent pom and then two modules. One for business and one for a command line application which depends on business.</p> <p>The parent pom.xml</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;project xmlns="http://maven.a...
<p>In the pom of your command line application, replace maven-jar-plugin with the following.</p> <pre><code>&lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt; &lt;version&gt;2.4.1&lt;/version&gt; &lt;configur...
Select all checkbox in the same column <p>I am trying to implement something similar to <a href="http://stackoverflow.com/questions/17149434/jquery-check-all-checkboxes-in-column">Checking checkbox in column</a></p> <p>I have two select all checkboxes in a table and selecting one would select all the checkboxes of the...
<p>Basic idea is to select the cell, get the index, and than select the other table cells of the table with that index. </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>$("t...
Alamofire download issue <p>I am trying to download <a href="https://slove.tulleb.com/uploads/6/6/0/2/66027561/2791411.jpg-1447979839.png">this picture</a> in my code using Alamofire 4.0.0 with Xcode 8.0 and Swift 3.0.</p> <p>Here is my request:</p> <pre><code> func download(_ path: String, _ completionHandler: @e...
<p><a href="https://github.com/Alamofire/Alamofire/issues/1529" rel="nofollow">Official answer from cnoon (Alamofire member):</a></p> <blockquote> <p>Hi @Tulleb,</p> <p>Apologies for not getting back to you sooner. The example @katopz is not the same type of request. That example demonstrates how to use a d...
Spring Cloud: Switching from Brixton.M5 to Brixton.SR5 <p>I am currently using spring cloud Brixton.M5 version and I want to switch it to release version (SR5).</p> <p>When I do this, following problem appears:</p> <pre><code> java.lang.IllegalStateException: Failed to load ApplicationContext at org.springfram...
<p><code>RibbonClientHttpRequestFactory</code> is not enabled by default. You need to set <code>ribbon.http.client.enabled=true</code>. The question is, why are you referencing it directly?</p>
Change default User-Agent in WebView UWP <p>I need set custom UA and I use </p> <pre><code>httpRequestMessage.Headers.Add("User-Agent", "blahblah"); theWebView.NavigateWithHttpRequestMessage(httpRequestMessage); </code></pre> <p>But if I click any link on page this UA erased and set default UA.</p> <p>I found same q...
<p>WebView is not a general-purpose browser, it does have some "limitations" that not supported now. There is no API can set the default User-Agent that used in every request. As a workaround we can use <a href="https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.webview.navigationstarting.as...
Joda time calculating the days, hours, minutes, and seconds between two datetime objects <p>I am trying to find the days, hours, minutes and seconds between two date/times. I thought I could use period and I tried the code below but I get a non nonsensical answer.</p> <pre><code> DateTime dt1 = new DateTime("2004-1...
<p><a href="http://joda-time.sourceforge.net/apidocs/org/joda/time/base/AbstractPeriod.html#toString(org.joda.time.format.PeriodFormatter)" rel="nofollow"><code>toString()</code></a> method in <a href="http://joda-time.sourceforge.net/apidocs/org/joda/time/Period.html" rel="nofollow"><code>Period</code></a> gives you t...
Capatcha Implementation in android for forgot password <p>I wanted to implement security question facility in android app and also adding captcha ?</p> <p>please provide me any working example </p>
<p>You can use this <a href="https://github.com/floydfix/Android-Easy-Captcha" rel="nofollow">link</a> to create Capatcha in android </p>
Checking the visibility of a div not working inside ajax success function <p>Well long story short, I am trying hide a div inside Ajax success function depending on whether its visible or not. But don't understand why it isn't working. I can set it to hide simply and which works but in the console when I check I find t...
<p>Toggle visibility</p> <pre><code> $(document).ready(function() { $('#loading').css('visibility': 'visible'); setInterval(function () { $.ajax({ type: "GET", url: "generate_list.php", success: function (result) { if ($(...
Sorting array which contain mixed string php <p>I have a problem with sorting array which contain mixed string.</p> <p>String contains both number and characters. I want to Sort array with integer number which string contain.</p> <p>Also sorting should be in alphabetical order.</p> <p>Please take a look on Result ar...
<p>From my best interpretations of what you're asking for - sort by the number immediately following the letter (not the one in the parens), then the letter, your 'desired results' would have the first two entries the wrong way round.</p> <p>But try this out and see if it works for your requirements (I also sort by th...
Using cv::glob for multiple extensions <p>I'm trying to use <a href="http://docs.opencv.org/3.1.0/db/de0/group__core__utils.html#gaf91b7f383218e2d3f760939140942297" rel="nofollow">cv::glob</a> to find images in a folder system. What I now want is to search for multiple file extensions at once (let's say .jpg and .png)....
<p><code>Open CV</code> or even OS file system API has no build-in way to do that. You can improve your code by eliminating multiple iteration over the folder/folders. For example you can use <a href="http://www.boost.org/doc/libs/1_61_0/libs/filesystem/doc/reference.html#Class-recursive_directory_iterator" rel="nofoll...
How can I remove all child element of DIV element on onBlur event? <p>I have a web page where I have defined one DIV element with id "selectedProduct", now while I click on particular link it will call ajax request and it will fill DIV element with response data. But i have requirement that when onBlur event occurs on ...
<p>Use the below solution of getting all child elements and the removing them,</p> <pre><code>function focOFF(id) { $( "#"+id ).children().remove(); } </code></pre>
jQuery Ajax error reporting with ColdFusion <p>Following on from this question <a href="http://stackoverflow.com/questions/377644/jquery-ajax-error-handling-show-custom-exception-messages">jQuery Ajax error handling, show custom exception messages</a> I am trying to display to my users a custom error message from ColdF...
<p>I had similar problem. Try this please: First make sure "Enable HTTP status codes" unchecked in CF Admin under Server Settings -> Settings. You might need to restart your ColdFusion sever. That will prevent CF to set ALL statuses to either 404 or 500. Then add a line below to your server code (modify it according to...
How to store objects in android efficiently? <p>I am creating a quiz application. My application consists of a thousand questions every question with it's own id each question is either true or false. Where should I store this data for an efficient use?</p>
<p>If the questions wont change or you wanna change them manually a good way to do this is to use an xml file in your resources. A database is only needed if you want to query/search etc. in your data, otherwise its not different from a simple xml file (which is a database as well).</p>
How a Procfile is different from shellscript file and when should I use it? <p>In akk-http-microservice i have seen a procfile for the first time. I try to know about it. I came to know that procfile is meant for executing commands. But how it differs from shell script which also do same. When should i prefer to it?</...
<p>A Procfile is a mechanism for declaring what commands are run by your application's dynos on the Heroku platform. It follows the process model. You can use a Procfile to declare various process types, such as multiple types of workers, a singleton process like a clock, or a consumer of the Twitter streaming API. Thu...
CollectionView scroll to top <p>I have one CollectionViewController and have 10 cells in it.</p> <p>But when I run the app it displays the cell at bottom, but I want to display it from top cell at viewDidLoad.</p> <p>I tried many things but it didn't work.</p> <p>How to fix it?</p>
<p>To display the data from top cell in collectionView you can use one method </p> <pre><code>[collectionView setScrollsToTop:YES]; </code></pre> <p>Hope it will Help You.</p>
I can't fix size AVcapture with this code <p>I need to fix screen capture on horizontal But this my code can't fix size screen capture follow code > <strong>previewLayer.frame = CGRectMake(20, 40, 500, 100)</strong>.<br> see on below this screen picture not match with <strong>CGRectMake(20, 40, 500, 100)</strong>. </...
<p>Set the preview layer frame in viewDidAppear or in viewWillLayoutSubview</p>
Java synchronized method around parameter value <p>Consider the following method:</p> <pre><code>public void upsert(int customerId, int somethingElse) { // some code which is prone to race conditions } </code></pre> <p>I want to protect this method from race conditions, but this can only occur if two threads wi...
<p>The concept you're looking for is called <em>segmented locking</em> or <em>striped locking</em>. It is too wasteful to have a separate lock for each customer (locks are quite heavyweight). Instead you want to <em>partition</em> your customer ID space into a reasonable number of partitions, matching the desired degre...
Convert Json string to map in scala <p>I have a JSON string, say:</p> <pre><code>val json = JSONObject(Map("a" -&gt; 1)).toString() </code></pre> <p>I want to convert this json to map again. I tried:</p> <pre><code>val map = json.toMap[String, Int] </code></pre> <p>This gives me the following error:</p> <pre><code...
<p>Using <code>play-json</code> you can convert Json to Map using <code>validate</code>. Validate returns <code>JsResult</code> which can be <code>JsSuccess(data,path)</code> or <code>JsError(errors)</code>. Pattern match to get the map out of it.</p> <p>If you are using <code>sbt project</code> then add <code>play-js...
Buffer Overflow explanation <p>I made this simple password verification program, and I'm trying to overflow the buffer array to change the auth variable to 1 and i managed to do it except I can only change the auth variable to the character 1 and not the decimal 1, how can i do it?</p> <pre><code>#include &lt;stdio.h&...
<p>Following information is derived from runs on my Ubuntu-14.04 system using gcc version 4.8.4 as my compiler and gdb version 7.7.1 as my debugger</p> <p>First, the buffer overflow happens as a result of the strcpy function, and if you overflow <code>buf</code> so that it overwrites the memory location of <code>auth<...
Naturaltime with minutes, hours, days and weeks <p>I use naturaltime in my Django application.</p> <p>How can I display only time in minutes, then hours, then days, then weeks?</p> <p>Here is my code:</p> <pre><code>{{ obj.pub_date|naturaltime }} </code></pre>
<p>I use two custom filters to solve a very similar problem using babel and pytz. I write "Today" or "Yesterday" plus the time. You're welcome to use my code any way you like. </p> <p>My template code is two usages, one for writing "Today", "Yesterday", or the date if it was even earlier. </p> <p><code>{{ scored_docu...
How to dinamically unbind all event handlers and rebind them after doing something? <p>I'm looking for a common way to unbind all event handlers and rebind them again after doing something that would have triggered them. </p> <p>Currently, I'm using specific solutions like the following:</p> <pre><code>var PrevBefo...
<p>Why instead of unbinding them don't you just disable them through a variable ?.</p> <p>Define that "disabling" variable on your form, and activate it every time you want to avoid events.</p> <pre><code>type MyForm = class (TForm) ... private EventsDisabled: boolean; ... end; implementation ... Events...
return false If Value Is Not Numeric <p>The following is validation for a form I have created. I include the function step_2_validation() on submission of step 2.</p> <p>The function correctly spots if the inputs contain a string, but the form does not break with the return false; statement. What am I missing here?</p...
<p>The problem is, that the <code>return false</code> that you have simply halts the execution of the each, it does not return false from your outer function <code>step_2_validation</code>.</p> <p>One option is to revert to using a good ol' <code>for(...)</code> loop, which <em>will</em> return out of the outer functi...
Advice on basic login and signup <p>Hey Everybody I am new in android i want to make a project in which i first need signup and login pages and code . People say use Json and use SQLite etc. I need a perfect advice what should I do at my basic level. Pls advice me and give some links of codes and help. </p>
<p>If you are using Android Studio, create Login activity from the templates gallery. It will produce basic stuff you need to get start with. </p> <p>However at the end, how you want to implement user system is upto your environment.</p>
Poco + OpenSSL + CA PEM : "Unacceptable certificate" error for 1 out of 2 identical sites <p>I am trying to do a SSL handshake with <code>www1.filemail.com</code>. I am using cURL's <a href="https://curl.haxx.se/ca/cacert.pem"><code>cacert.pem</code></a>, but I am getting this error:</p> <pre><code>Unacceptable certif...
<blockquote> <p>www1 and www2 should be identically configured - and they both work fine in all browsers...</p> </blockquote> <p>Here are the certificates. A diff shows they are the same end-entity (server) certificate:</p> <pre><code>$ diff www1.txt www2.txt $ </code></pre> <p>Each server is could be a sending a...
MySQL OutFile to use data from table <p>I'm trying to generate an export that runs monthly which appends a value from one of the columns within a table to the OutFile name, is this even possible?</p> <p>The table is mytable and the column is col1 which contains "201601" at the minute</p> <p>I would like my OutFile to...
<p>You can try to do this with stored procedure. Eg. when you call this procedure - it export data from table <strong>mytable</strong> to file with name <strong>D:/tmp/Output_</strong> + top value from field Col1.</p> <pre><code>CREATE PROCEDURE `PrepareReport`() BEGIN SET @OutputFileName := 'D://tmp//Output_'; SEL...
Python/Json:Expecting property name enclosed in double quotes <p>I've been trying to figure out a good way to load JSON objects in Python. I send this json data:</p> <pre><code>{'http://example.org/about': {'http://purl.org/dc/terms/title': [{'type': 'literal', 'value': "Anna's Homepage"}]}} </code></pre> <p>to the b...
<p>This:</p> <pre><code>{'http://example.org/about': {'http://purl.org/dc/terms/title': [{'type': 'literal', 'value': "Anna's Homepage"}]}} </code></pre> <p>is not JSON.<br> This:</p> <pre><code>{"http://example.org/about": {"http://purl.org/dc/terms/title": [{"type": "literal", "value": "Anna's Homepage"}]}} </code...
Google Places - unexpected 50-char place_id values returned <p>I am using the Google Geocoding API to retrieve place_id (and other) information to use with the Places API. Most addresses return an expected 27-character place_id value, i.e.:</p> <pre><code>ChIJUXJ61wrsFogR3jv6yBBFlQY </code></pre> <p>However, a small ...
<p>You're truncating these IDs, so that's why the API says they are invalid. They can be more than 50 characters.</p> <p>If you keep the whole ID intact they <code>E</code> prefix IDs will work with Distance Matrix etc.</p>
Clustering points based on their function values and proximity <p>I have many points <code>X</code> and their function values <code>f</code> stored in <code>numpy</code> arrays. I want to find <strong>all points</strong> in <code>X</code> that don't have a better point (smaller <code>f</code> value) within a distance <...
<p>You could partition the space so that you could ignore partitions wholly outside the radius for the point being tested.</p> <p>You could also order the points by f, so you don't need to scan those with smaller values.</p>
HTML Background Chrome not working <p>i have this html code that plays a video as the full background and it works great for every browser except chrome not sure why can anyone help?</p> <p>the html code</p> <pre><code>&lt;video poster="" id="bgvid" playsinline autoplay muted loop&gt; &lt;source src="vid.mp4" type="v...
<p>add invert comma <code>""</code> in url</p> <pre><code>background: url("polina.jpg") no-repeat; </code></pre> <p><a href="http://www.w3schools.com/cssref/css3_pr_background.asp" rel="nofollow">http://www.w3schools.com/cssref/css3_pr_background.asp</a></p>
Send AWS IoT commands from cloud to device over unreliable connections <p>We're considering AWS IoT for an upcoming project featuring devices with unreliable network connections. One requirement is to send commands to devices. The commands must be reliably delivered (ack'd) and the devices should also signal success/fa...
<p>You are right that AWS IoT doesn't support persistence session nor message retention.</p> <p>As for using shadow device to store the command queues, it really depends on the frequency and variety of commands you have. What I can think of:</p> <ul> <li><p>If it's only used infrequently (e.g. once a month) then prob...
Can I install a SSL cert only for webmail subdomain, but not whm/cpanel? <p>I want to install a certificate only for webmail subdomain, but not for cpanel, whm, calendar, and others subdomains included as it appears in the option given in WHM » Home »Service Configuration »Manage Service SSL Certificates.</p> <p>Do...
<p>NO, It's not possible to install it only for webmail services. cPanel is providing options to install SSL for all services (Calendar, cPanel, WebDisk, Webmail, and WHM ) at a time.</p>
Parse CSV with embedded quotes on mixed string <p>I have looked around, but cannot find a tidy working solution to this. I have been trying to use TEXT:CSV_XS so this is not about merely doing something the hard way with a regex. I may not be able to easily install TEXT::CSV, but I do have the XS version.</p> <p>I sim...
<p>You can do with with <a href="https://metacpan.org/pod/Text::ParseWords" rel="nofollow">Text::ParseWords</a> which has been included in the standard Perl distribution since forever.</p> <pre><code>#!/usr/bin/perl use strict; use warnings; use Text::ParseWords; use Data::Dumper; my $str3 = '09/11/2016 22:05:00 +00...
How to find and replace a jar file using find command <p>I have multiple sub directories under a base directory. I need to copy few jar files available in another path if the sub directory have x.jar .</p> <p>I am using below command to find x.jar and after that I am trying to copy the jar files.</p> <pre><code>find ...
<p>How about this:</p> <pre><code>find . -type f -name x.jar -print0 | while IFS= read -r -d'' file; do cp -- /home/sampath.anisetti/tmp/*.jar "$(dirname -- "$file")" done </code></pre> <p>It will find all files called <code>x.jar</code> and then for each such file, it will find the directory where th...
Angularjs - Can't catch $watch event <p>I am trying to implement this directive into my code without much succces. <a href="https://github.com/shuyu/angular-material-fileinput" rel="nofollow">angular-material-fileinput</a>.</p> <p>I followed the instructions from the github page and i added "lfNgMdFileInput" to my mod...
<p>Watch will work on the Model property. You can change your code to use 'files02' only (i.e. without length).</p> <pre><code>$scope.$watch('files02',function(newVal,oldVal){ console.log($scope.files02); }); </code></pre>
Changing values of 2 textboxes with each other (VS.NET) <p>I want to know how to change the values of 2 textboxes with each other when I click on a button. vs.net</p>
<p>This is very easy :)</p> <pre><code>'Values to Store the text Dim textbox1 as String Dim textbox2 as String textbox1 = mytextbox1.text textbox2 = mytextbox2.text mytextbox1.text = textbox2 mytextbox2.text = textbox1 </code></pre> <p>this would be possible too</p> <pre><code>'Values to Store the text Dim textbox1...
Highcharts shared tooltip(for line series) - Change on hover ACCORDING TO PLOTBAND <p>Highcharts - Its a bit of a challenge to me, to change the shared Tooltip in accordance with the Plotband.</p> <pre><code>series: [{ name : 'one', data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 19...
<p>You can use x values of your plotbands inside tooltip formatter. If you are inside specific plotBand (so in specific x ranges) you can display one, two or three series:</p> <pre><code> $('#container').highcharts({ xAxis: { plotBands: [{ name: 'first', from: 0, to: 3, color...
Making a POST request to an external URL from a django + gunicorn + nginx setup <p>I am sending a post request from a method inside a web application running on django+nginx+gunicorn. I have no issues receiving 200 response from the same code when executed on django's own server (using runserver).</p> <pre><code>try: ...
<p>In my gunicorn settings, setting <code>workers=2</code> solved this issue.</p> <p>When I was sending a request to the external URL, the external application would send a request back. This new request would occupy the one and only worker in the application. The original request that I sent out is workerless, and so...
Need help writing a RewriteRule to strip selectors in URL <p>I need to write a simple rewriterule in apache for 2 conditions</p> <ol> <li>Remove date selector from the js name</li> <li>change the location /js/ into /jsmin/</li> </ol> <p>Input URL: /etc/designs/myapp/clientlibs/basefooter/js/foresee/foresee-trigger.2...
<p>Your regex needs to be modified </p> <pre><code>(.*)\.([0-9].+)\.js </code></pre> <p>Explanation</p> <ol> <li>First group of brackets would match the folder and file name /etc/designs/myapp/clientlibs/basefooter/js/<strong>foresee/foresee-trigger</strong>.20160819.js</li> <li>Second group of brackets would match ...
Transform string to date format ( from week number ) <p>I have a string with week numbers from 1 - 53 ( split weeks from 2015 ) and years in the form of:</p> <pre><code> Date_ID KW01/2016 KW35/2014 KW51/2014 KW53/2015 KW12/2014 KW03/2016 ... </code></pre> <p>and I want to transform the ...
<p>The idea is use to sys_calendar table in Teradata. It has weeks of year and other stuff. Below is the code.</p> <pre><code>insert into test values('KW01/2016'); insert into test values('KW35/2014'); insert into test values('KW51/2014'); insert into test values('KW53/2015'); insert into test values('KW12...
.bat to move files with specific exiftool color profile output <p>I have a simple .bat script that will output the color profile of jpgs via exiftool:</p> <pre><code>IF EXIST C:\Users\%Username%\Desktop\Color_Check_v1.4.5\_Upload\*.jpg for /f "delims=" %%a in ('C:\Users\%Username%\Desktop\Color_Check_v1.4.5\_Data\_exi...
<p>Exiftool can do this without scripting. Try something like:<br> <code>exiftool -if "$ProfileDescription ne 'sRGB IEC61966-2.1'" "-directory=C:\Users\%Username%\Desktop\Color_Check_v1.4.5\Convert" /path/to/target/dir</code> </p> <p>Add <code>-r</code> to recurse into subdirectories. Change <code>-directory</code>...
Extract trajectory at a contour level from streamline in MATLAB <p>When plotting streamlines in MATLAB using <code>quiver</code>, <code>streamslice</code> or similar, is it possible to extract the contour line at given contour level?</p> <p>Take this example (I have numerical data in my case, but I will use analytical...
<p><code>hs = streamslice(X,Y,DX,DY);</code> as result you obtain a vector with handles to the traject lines. For example, you can get the coordinates of the first traject line:</p> <pre><code>N_trajects = length(hs); % the number of all trajectories n = 1; % the chosen trajectory X_traject = get(hs(n),'XData'); Y_tr...
Can a module add a line in the DNN web.config when installing it? <p>Recently I was creating a module to install basic things for other modules dependent of it. I have to make a web.config change manually in order to all modules work and I was wondering if there is any way to automate it in the module instalation proc...
<p>Yes. In your module's DNN Manifest file, you can add a config section.</p> <p><a href="http://www.dnnsoftware.com/wiki/manifest-config-component" rel="nofollow">http://www.dnnsoftware.com/wiki/manifest-config-component</a></p> <p>Example:</p> <pre><code>&lt;component type="Config"&gt; &lt;config&gt; ...
How is "a" used in my program? <p>new to learning c++ and I was wanting to understand the program ive practiced. I have a section of code I want to understand but im kind of lost.</p> <pre><code> #include "stdafx.h"; #include &lt;iostream&gt;; // getValueFromUser will read a value in from the user, and return...
<p>You declare an uninitialized variable of type <code>int</code> with identifier <code>a</code>: </p> <pre><code>int a; </code></pre> <p>The user provides a value to <code>a</code>. </p> <pre><code>std::cin &gt;&gt; a; </code></pre> <p>A copy is returned from the function: </p> <pre><code>return a; </code></pr...
Using Swift 3 Measurement and Unit classes in Realm <p>Does Realm support the new Measurement and Unit classes in Swift 3 Foundation? It doesn't appear to be the case currently. If not, is there a recommended strategy for a workaround?</p>
<p>For Realm to remain consistent across platforms, it cannot expose support for types that cannot be represented on other platforms. So don't expect native Realm support for Measurement and Unit types recently added in Foundation.</p> <p>However, it's easy to use a computed property for that:</p> <pre><code>class My...
Revert a filter in AngularJS <p>I am applying an AngularJS filter programmatically like so:</p> <pre><code>filtered = $filter('number')(value, 2); </code></pre> <p>This will give me something like <code>5,000.00</code>. I need a way to take the filtered value and strip out the formatting so I can get <code>5000</code...
<p>How about to create own custom filter?</p> <pre><code>app.filter('round', function() { return function(input, count) { var output; //Your code here output = Math.floor(input, count); //something like that return output; } }); </code></pre> <p>and </p> <pre><code>filtered = $filter('round')(v...
how to run clang static analyzer on different target using scan-build <p>I want to run clang static analyzer on different target. Here is the makefile snip:</p> <pre><code>CC = &lt;path to clang folder&gt;/build/bin/clang . . . src/%.o: ../src/%.c ${CC} --target=powerpc -O0 -g3 -Wall -c -fmessage-length=0 -MMD...
<p>found the solution. I think there is a bug in the ccc-analyzer script in the next param:</p> <pre><code>my %CompilerLinkerOptionMap = ( '-Wwrite-strings' =&gt; 0, '-ftrapv-handler' =&gt; 1, # specifically call out separated -f flag '-mios-simulator-version-min' =&gt; 0, # This really has 1 argument, but alway...
SQL Server 2012 - varchar to date <p>I am running views against a table that has dates stored as <code>varchar(8)</code> as DDMMYYYY, can someone please tell me how do I convert them to <code>date</code> format?</p> <p>Thanks</p>
<p>In SQL Server 2012+, you can use <code>datefromparts()</code>:</p> <pre><code>select datefromparts(right(col, 4) + 0, substring(col, 3, 2) + 0, left(col, 2) + 0) </code></pre> <p>I just added the <code>+ 0</code>, because I'm not 100% sure if SQL Server will convert the arguments to integers.</p> <p>Of course, yo...
JQuery Draggable stops working inside updatepanel after a postback <p>I have an asp.net updatepanel with some devexpress controls inside it. </p> <pre><code> &lt;asp:UpdatePanel ID="upInsertPartNumber" runat="server"&gt; &lt;ContentTemplate&gt; &lt;div id="divSAFRReceivingPanel" style="width: 50%; posit...
<p>Well, that's because when you <em>raise</em> an event <strong>a postback ocurrs</strong>, and <strong>only the content in the UpdatePanel is refreshed</strong>, so, your elements <em>lose</em> the functionality they have before the postback.</p> <p>What you can do is:</p> <ul> <li>To keep track of the div's positi...
Symfony2 doctrine relations <p>I have 3 tables.</p> <pre><code>Product +-----+-----------+ | id | name | +-----+-----------+ | 1 | Product 1 | +-----+-----------+ | 2 | Product 2 | +-----+-----------+ Categories +-----+-----------+ | id | name | +-----+-----------+ | 1 | cat 1 | +-----+---------...
<p>You need only 2 entities, <code>Product</code> and <code>Category</code>, linked with ManyToMany mapping.</p> <p>Read <a href="http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/association-mapping.html#many-to-many-bidirectional" rel="nofollow">the documentation</a>, and you will found answ...
Trouble with resx file, while deploying site on IIS <p>So i am trying to deploy my web asp.net mvc website on IIS. It works perfectly on my pc etc, but after deployment i am getting this error:</p> <blockquote> <p>Compilation Error Description: An error occurred during the compilation of a resource required to ...
<p>Just copied (cntrl-c cntrl-v) a resource file to the server and it worked. Just wtf.</p>
Build on Azure Web App, Error:Can not find runtime target for framework '.NETStandard,Version=v1.6' <p>I have a asp.net core web project that was continuous deployed to Azure well. After I added another .net core class library to the solution, it gives the following build error on Azure: Microsoft.DotNet.Publishing.tar...
<p>I saw this error as well in the same situation and the problem ended up being the MSBuild arguments I was using to enable the creation of a WebDeploy package. I was using the <code>/p:DeployOnBuild=true</code> argument when I saw this.</p> <p>I was able to work around it by calling the <code>PackagePublish</code> ...
Winform C# : Node selection on expansion and collapse gets change at the bottom of the Treeview <p>I am using a Treeview in my windows form but getting some issue. My Node selection on expansion and collapse gets change at the bottom of the Treeview. I am using afterselect and MosueDown event. My problem is I have to d...
<p>You can use either of these options:</p> <ol> <li><p>Use <code>MouseDown</code> event, and after setting <code>SelectedNode</code>, <code>Toggle</code> it using <code>BeginInvoke</code>:</p> <pre><code>private void treeView1_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) {...
WPF binding IsEnabled not working (inner DataContext) <p>I have dialog window with properties, in xaml I put: </p> <pre><code>DataContext="{Binding RelativeSource={RelativeSource Self}}"&gt; </code></pre> <p>and trying to bind <code>Grid</code>'s <em>IsEnabled</em> to property that resist in my dialog class, as so:</...
<p>You need to <a href="http://www.daedtech.com/wpf-and-notifying-property-change/" rel="nofollow">notify</a> your view when the value is updated.</p> <p>In your case I would probably write classic get/set property, and update it when my selection item changed.</p> <p>Of course your ViewModel has to be <em>INotifyPro...
Use eslint-config-airbnb without react plugins <p>I want to use the airbnb's eslinter without installing any react plugins. Is that possible?</p> <p>Basically, all I want is to use this: <a href="https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb" rel="nofollow">eslint-config-airbnb</a>. Bu...
<p>If you don't care for the react rules, your best bet would be to use <a href="https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb-base" rel="nofollow">eslint-config-airbnb-base</a> instead.</p>
how to use an open file for reuse it in severals functions? <p>I am a beginner in python and not completely bilingual, so I hope you understand me. I'm trying to develop a code where anyone can open a file, in order to display its contents in a graph matplotlib, to do this using a function called <code>read_file()</cod...
<p>You can use a global variable to keep it, declaring it as global before the variable name (f in your case). However, I don't recommend it if you are modifying the file.</p>
How to program the computer to speak put loud in R <p>I have a script in R which returns <em>a</em> and I can print the result as</p> <pre><code>print(a) </code></pre> <p>Instead of <em>print()</em> I would like something like "speak()". So that the computer uses its "internal voice" and tells what the variable <em>a...
<p>Problem solved!</p> <p>As @Dason pointed out, it is possible to do a system call within R using <a href="https://stat.ethz.ch/R-manual/R-devel/library/base/html/system.html" rel="nofollow">system()</a> and <em>say</em> as <em>command</em>. </p> <p>The command in system() needs to be a complete string beginning wit...
(Java) Converting String of symbols to single digit integer array <p>I'm trying to take a String, i.e. <code>$!#</code>, convert each individual symbol to its corresponding ASCII value, it here being <code>36, 33, 35</code> and then ending up with an array of integers with each single number stored in a separate index,...
<p>Honestly, if I were you, I wouldn't worry too much about "efficiency" until you have an actual problem. Write code that you understand. If you have a problem with efficiency, you'll have to define exactly what you mean: is it taking too many steps? Is it taking too long? What is the size of your input?</p> <p>Note ...
php foreach, person appearing twice with codeigniter <p>So this is my database:</p> <p>TABLE NAME: user_account</p> <pre><code> Account_no Firstname Lastname Username Password 1 Larry Bird larryB larrylarry 2 Magic Jo...
<p>Use <a href="https://dev.mysql.com/doc/refman/5.5/en/group-by-handling.html" rel="nofollow"><code>group_by</code></a> and modify the code as follow</p> <pre><code>public function getServicesAvailed($id){ $this-&gt;db-&gt;select('*'); $this-&gt;db-&gt;from("tbl_service_type"); $this-&gt;db-&gt;join("tbl_...
Javascript: how do I copy the value of a single element from an array into another array at the same position? <p>If I want to clone an array, I can use the slice() function, but what if I want to "clone" a single element? I want to do something like this:</p> <pre><code>array1[i] = array2[i]; </code></pre> <p>but I ...
<p>You could use <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign" rel="nofollow">Object.assign</a> and <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/splice" rel="nofollow">Array.splice</a> </p> <pre><code> var clo...
JSON serialization with Swift 3 <p>I am trying to to populate a table by filling an array from JSON data. I am using the code below but keep getting the error:</p> <blockquote> <p>Type 'Any' has no subscript members</p> </blockquote> <p>on the following lines of code:</p> <pre><code>self.tableData.append(jsonResul...
<p>The compiler doesn't know the type of <code>jsonResult</code>, you have to tell what it is, for example with optional binding like this:</p> <pre><code>if let jsonResult = try JSONSerialization.jsonObject(with: urlContent, options: []) as? [[String:AnyObject]] { } </code></pre> <p>Here I downcast the JSON as an ...