input
stringlengths
51
42.3k
output
stringlengths
18
55k
Filter ng-repeat based on search input with transformation filter <p>I have an array of records and I'm repeating on a HTML table with filters in the header. It turns out that some values are transformed by filters thus making the ng-repeat filter to fail.</p> <pre><code>&lt;table class="table"&gt; &lt;thead&gt; ...
<p>You're probably going to need to play with a directive. Try this:</p> <pre><code> angular.module("app").directive("myDirective", function(){ return { require: 'ngModel', link: function(scope, element, attrs, ngModelController) { ngModelController.$parsers.push(function(data) { /...
Public key to RSA public key for c# <p>I need to use RSA Cryptography in c# project to send ecrypted data to service. Service gave me a public key like this:</p> <pre><code>-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjU/bq6YZD2H0DUhbtEBg JIyiurM8eX3aH02/ZWr6VZ27WF93ylWC4cGAe50sSgiA8NCW0G/UL7...
<p>I found solution, it was easy: I need to use:</p> <pre><code> CryptographicKey key = asym.ImportPublicKey(keyBuffer, CryptographicPublicKeyBlobType.X509SubjectPublicKeyInfo); </code></pre>
JSOUP is not rendering complete html <p>I am trying to render a URL to read a few parameters by using JSOUP, but found that it is not rendering complete HTML.</p> <p>Below is my code </p> <pre><code>Document doc=Jsoup.connect("http://www.svbcgold.com/").get(); System.out.println("HTML.."+doc.html()); </code></pre> <...
<p>I think Jsoup didn't parse your entire document. That's why you don't able to get all the contents or someone's are missing. Try this :</p> <pre><code>Document doc = Jsoup.connect("http://www.svbcgold.com/").header("Accept-Encoding", "gzip, deflate").userAgent("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/201...
Excel - lots of conditional formatting converted to VBA <p>For an Excel spreadsheet order form, I need a way to apply conditional formatting to all rows with one macro, from row 78 down until there is no more data.</p> <p>Each column has its own conditional formatting formulas. Some have multiple formulas. I tried usi...
<p>You can do this fairly easily with a <code>DO-WHILE Loop</code>. I'll give a start for "D78" and you should be able to finish the rest.</p> <pre><code>sub formatCells() Dim count as Integer Range("D78").Activate count = 0 Do While ActiveCell.Offset(count, 0).Value &lt;&gt; "" If ActiveCell...
WordPress 4.6 had problems with cURL error 23 <p>After a recent upgrade to WordPress 4.6 had problems with cURL (eg when updating plug-ins that use cURL): cURL error 23: Failed writing body (373 = 449!)</p> <p>Judging by the forum, to 4.6 cURL broke, and 4.6.1 are still not rolled out the fix.</p> <p>The decision to ...
<p>the problem is that PHP was built without curl, not with the source code. if you're compiling PHP yourself make sure to compile with <code>--with-curl</code> as described here <a href="http://php.net/manual/en/curl.installation.php" rel="nofollow">http://php.net/manual/en/curl.installation.php</a></p> <p>if you're ...
Why are there black and white bars on the top and bottom of my page? <p>I am still a beginner... </p> <p>The first time I created the page everything worked well. The background img was covering everything and the navigation was transparent. But as soon as I put in the links to bootstrap everything changed what am I m...
<p>Remove Navbar-inverse .. its adding black background.</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-css lang-css prettyprint-override"><code>* { box-sizing: border-box; } html, body { margin: 0...
How do import directive in testModule in Angular 2.0 <p>I am trying like this </p> <pre><code>TestBed.configureTestingModule({ declarations: [MyDirectiveName] }); </code></pre> <p>But it's not working, I am getting error, Cannot create instance of component as it's not imported in TestModule<...
<p>Trying the create the directive with <code>TestBed.createComponent(Directive)</code> isn't going to work. That method is just for component creation. What I normally just do is create a dummy test component, and add the directive to that component's template. This is also the recommended way in <a href="https://angu...
Michael Hartl's Rails 5 tutorial chapter 10, listing 10.56, test if the admin attribute is forbidden <p>I was trying to pass the exercise in <a href="https://www.railstutorial.org/book/updating_and_deleting_users//" rel="nofollow">listing 10.56</a> and test if the admin attribute is forbidden. I added admin parameter ...
<p>This error is intended. As the exercise says you added <code>:admin</code> to permitted params before.</p> <p>Your test now will send the patch request and set <code>admin: true</code> for @other_user (which is possible here, since you added <code>:admin</code> to permitted params). After that you use <code>"assert...
persisting a session causes detached entity passed to persist error <p>I have the the below posted two hibernate classes, and i am trying to insert records into TestAuthor table using the code mentioned in populateAuthorTable method which is posted below as well. when i run the code i receive </p> <pre><code>detached ...
<p>When you set an @Id field of a new object, hibernate will think it's a detached entity. The point of the sequence generator you've created, is to generate Ids for new entities. Just don't set the Id and it should work. Very rough solution:</p> <pre><code>public TestAuthor(Long id, String fName, String lName) { ...
Need IFTTT recipe to send specific gmail attachments to specific dropbox folders <p>For example: Email arrives with subject "Report for domaina.com". It has an attachment. I want to setup the recipe to save domainareport.pdf to Dropbox under /reports/Domaina. I'd then create similar recipes for domainb, domainc, etc. S...
<p>Create a trigger on gmail using email from search and typing in this <a href="http://i.stack.imgur.com/oeQDa.png" rel="nofollow"><img src="http://i.stack.imgur.com/oeQDa.png" alt="Try This"></a> Create an action using Dropbox and it will have automatically filled out everything EXCEPT the folder path edit the folde...
tsserver: Error processing request (No Project) <p>When working on a TypeScript (v2.0+) project within 'Visual Studio Code' (v1.5.3) I get the following error:</p> <pre><code>[Error - 10:03:50 AM] 'format' request failed with error. Error processing request. No Project. Error: No Project. ... </code></pre> <p>I resta...
<p>As per the <a href="https://github.com/Microsoft/TypeScript/blob/master/src/server/server.ts#L182" rel="nofollow">tsserver.js source code</a></p> <pre><code>$ export TSS_LOG='-level verbose -file &lt;my-home&gt;/tss.log' $ code </code></pre> <p>The verbose log file holds the answer but not reported as an error.</p...
Wordpress AJAX not passing POST data <p>I am integrating AJAX into a WordPress plugin with the following code:</p> <p>PHP:</p> <pre><code>add_action( 'wp_ajax_nopriv_myajax-submit', 'myajax_submit' ); add_action( 'wp_ajax_myajax-submit', 'myajax_submit' ); function myajax_submit() { $amount = $_POST['amount']; ...
<p>You aren't sending the data properly. If you checked your <code>$_POST</code> you will have a value for <code>$_POST['data']</code></p> <pre><code>jQuery("button.compareLoans").click(function() { jQuery.post( MyAjax.ajaxurl, { action : "myajax-submit", postID : MyAjax...
Mutex under using block behaves differently <p>I was following this article regarding threading <a href="http://www.albahari.com/threading/part2.aspx" rel="nofollow">here</a>. In that under section Mutex the following code was there.</p> <pre><code>class OneAtATimePlease { static void Main() { // Naming a Mut...
<p>You have to understand how mutex works. <code>WaitOne</code> acquires it and <code>ReleaseMutex</code> <strong>or Disposing it</strong> releases it. At the end of using block (when control flow leaves it), mutex is Disposed (that's why using block exists in the first place), and so is released. In your updated code,...
Understanding double and integers <p>Absolute beginner programmer and wondered if you could help me understand some results and terms. I'm trying to follow the programs logic and how it works out certain values. The following case is an example to try and understand these concepts.</p> <pre><code>#include &lt;stdio.h&...
<p>The C compiler will do integer arithmetic only if both operands are integers (integer / integer, integer + integer, etc.), otherwise it will do floating point arithmetic (double / integer, double + integer, etc.)</p> <p>First result:</p> <pre><code>11 (an integer) / 4 + (33.0) / 5 </code></pre> <p>The first part ...
Auto update pod on every image push to GCR <p>I have a docker image pushed to Container Registry with <code>docker push gcr.io/go-demo/servertime</code> and a pod created with <code>kubectl run servertime --image=gcr.io/go-demo-144214/servertime --port=8080</code>.</p> <p>How can I enable automatic update of the pod e...
<p>I would suggest switching to some kind of CI to manage the process, and instead of triggering on docker push triggering the process on pushing the commit to git repository. Also if you switch to using a higher level kubernetes construct such as <code>deployment</code>, you will be able to run a rolling-update of you...
PyCharm - Python Strange behavior <p>I dont know if I can post this here or not. But a strange thing happened recently. </p> <p>I use pycharm to run my python codes and surprisingly when I opened a piece of my code - it got deleted. The file is 0KB now - for some reason. I am using this file for over a month now and t...
<p>PyCharm has Local History feature, it might recover your deleted file...</p> <ul> <li>Right click on your file</li> <li>Click <code>Local History</code> </li> <li><p>Click <code>Show History</code></p> <p><a href="http://i.stack.imgur.com/82Fd6.png" rel="nofollow"><img src="http://i.stack.imgur.com/82Fd6.png" alt=...
SFINAE template constructor with boost::hana <p>Given the following code, what is an appropriate way to express the same functionality with Boost hana?</p> <pre><code>#include &lt;type_traits&gt; #include &lt;boost/hana/type.hpp&gt; #include &lt;boost/hana/core/when.hpp&gt; namespace hana = boost::hana; struct S { ...
<p>As @Barry says in the comments, <code>hana::when</code> is useful for partial specializations, and it can't be used in your case. Hana does not provide an incantation that is more succinct than what you already have (which is fair given it's a one liner). Also note that you may drop the extra <code>typename</code> k...
Access MySQL database in R on Mac OS X <p>I am having problems accessing my MySQL database from R on mac (Mac OS X 10.11.2). The following code:</p> <pre><code>library("RODBC") mycom &lt;- odbcConnect("wsn_mysql_5", uid="root", pwd="*****") </code></pre> <p>Gives this error:</p> <pre><code>1: In RODBC::odbcDriverCo...
<p>I finally manage to have a working configuration by using unixODBC and using a 64-bit ANSI connector. If you are trying to connect to a MySQL database with RODBC I recommend:</p> <ol> <li>To follow <a href="http://hiltmon.com/blog/2013/09/18/setup-odbc-for-r-on-os-x/" rel="nofollow">this tutorial</a> to install uni...
ResourceBundleMessageSource Error <p>Configuration file:</p> <pre><code>@Configuration @ComponentScan("com.test.spring") public class SpringConfiguration { @Bean("msg") public MessageSource messageSource() { ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource(); message...
<p>Try to retrieve value and display like below on jsp.</p> <pre><code>&lt;%@taglib uri="http://www.springframework.org/tags" prefix="spring"%&gt; &lt;spring:message code="msg.Welcome"/&gt; </code></pre> <p>and your locales.properties file should have entry like below</p> <pre><code>msg.Welcome= Welcome...!!! </cod...
C# : make derived object conditionally share same base object <p>I have a base class with is inherited by multiple derived classes. I am initializing some properties of base class in constructor. Is there any way i can make the base class property being shared by my derived objects rather than creating the same propert...
<p>You could store the <em>result</em> of having made the call statically, rather than the value itself.</p> <pre><code>public class ClassA { static Dictionary&lt;string,string&gt; codeToCountryLookup = new Dictionary&lt;string,string&gt;(); protected string country { get; set; } public ClassA(str...
Excel file on network share - It is already opened exclusively by another user, or you need permission to view and write its data <p>I am developing an SSIS package that uses a data flow task that has an Excel source. The provider for the connection is Microsoft.ACE.OLEDB.12.0.</p> <p>If I point the connection manager...
<p>Solved it by using a variable for the file path and then using that variable as an expression for the ConnectionString property of the connection. I also doubled the backslashes in the variable that contains the pash, so instead of \computer\share\ I used \\computer\share\.</p> <p>My guess is that the slashes solve...
Sort a Substring in Descending order using Vector, however getting segmentation fault <p>I want to sort the string from N to M where N indicates the starting index and M indicates the ending index.</p> <p>However, my code is getting failed with segmentation fault. Here is my code:</p> <pre><code>#include &lt;iostream...
<p>This example does work fine for me:</p> <pre><code>#include &lt;iostream&gt; #include &lt;algorithm&gt; #include &lt;vector&gt; #include &lt;string&gt; using namespace std; int main() { string s = "ABCDEFG"; int N = 1; int M = 5; vector&lt;char&gt; data(s.begin(), s.end()); std::sort(da...
Can't find out base GitLab API base url <p>I've created project and repo on my gitlab.com account, generated private key, now I'm trying to do api call to get list of commits.</p> <p>Now I want to get list of projects via api, from documentation <a href="https://docs.gitlab.com/ce/api/projects.html#list-projects" rel...
<p>The correct base url for the hosted GitLab is <code>https://gitlab.com/api/v3/</code> so your request to<br> <code>GET /projects</code> would be</p> <pre><code>curl --header "PRIVATE-TOKEN: XXXXXX" "https://gitlab.com/api/v3/projects" </code></pre> <p>Also, the project ID is not the same as the project name. You c...
How to subtract known substring from larger string <p>I have been trying to deconstruct a string in the following way:</p> <p><strong>Full String</strong></p> <pre><code>str = 'Hello world I am Bob' </code></pre> <p><strong>Substring 1</strong></p> <pre><code>sub_str1 = 'Hello world' </code></pre> <p><strong>Subst...
<p>You can <code>replace</code> parts of a string with some other string.</p> <p><em>"Substracting"</em> would be replacing a substring with an empty string:</p> <pre><code>&gt;&gt;&gt; 'Hello world I am Bob'.replace('Hello world', '') ' I am Bob' </code></pre>
Strange work of the CAST function in SQL Server <p>I have simple SQL:</p> <pre><code>SELECT Count(c.[id]) 'Count' ,Count(c.[phone_home]) 'phone_home ' ,CAST(Count(c.[phone_home])*100/Count(c.[id]) as decimal(18,2)) '%' ,Count(c.[phone_other]) 'phone_other ' ,CAST(Count(c.[phone_other])*100.0/C...
<p>CAST(Count(c.[phone_other])<strong>*100.0</strong>/Count(c.[id]) as decimal(18,2) ) '%'</p> <p>CAST(Count([primary_address_state])<strong>*100</strong>/Count(c.[id]) as decimal(18,2)) '%'</p> <p>Your difference is in <strong>bold</strong>, you need to change the second 100 to 100.0, SQL is interpreting the first a...
Trying to reference a .NET 4.6.1 class library from a .NET Core project <p>Screenshots => <a href="http://imgur.com/a/NWsbh" rel="nofollow">http://imgur.com/a/NWsbh</a></p> <p>I'm trying to reference a .NET 4.6.1 Class library in a .NET Core 1.0.0 project. It's added to references but whenever I try to include the "us...
<p>You can either only target .NET 4.6.1, and that way you would not support .net core. Or you can add <code>#if NET461</code> directives in your code, and that way it will be able to find the type and namespace in the if.</p> <p>your problem is that the code is unsupported in .net core, and therefore cannot build for...
How to link shared preference with apk? <p>I build an android app where I'm using shared preference to store data. When I'm editing the data from the app it works fine for my device. But if I share the apk with another device, the data of shared preference for that device remains the default value, not the edited one. ...
<p>I think you have misunderstood the concept of Shared preference as it is used to store data inside app. </p> <p>Shared preference is similar to local db. It stores data like name-value pair. Means it stores data in your app's internal storage permanently until you clear data or uninstall app. If you want to share ...
Using columns to arrange HTML <p>First off, apologies if my title isn't the most descriptive in the world, I couldn't think of anything else for it. </p> <p>I'm using a HTML5 theme by <a href="https://html5up.net/" rel="nofollow">HTML5UP</a> called <a href="https://html5up.net/alpha" rel="nofollow">Alpha</a>. The webs...
<p>i try to change column width and it's working..!!<br/></p> <p><strong>changes:</strong><br/><br/> class="6u 12u(narrower)" --> class="4u 12u(narrower)"<br/> class="6u 12u(narrower)" --> class="8u 12u(narrower)"<br/><br/><a href="http://i.stack.imgur.com/UAAnR.png" rel="nofollow"><img src="http://i.stack.imgur.com...
How do I use the output of an ls command in an if statement in a bash shell <p>I want to check if only one instance of a file exists before going on to process that file.</p> <p>I can check how many instances exist using this command: </p> <pre><code>ls -l $INPUT_DIR/${INPUT_FILE_PREFIX}cons*.csv.gz | wc -l; </code><...
<p>Change your <code>if</code> condition as below:</p> <pre><code>if [ "$(ls -l $INPUT_DIR/${INPUT_FILE_PREFIX}cons*.csv.gz | wc -l)" = "1" ] </code></pre> <ul> <li>There need to be a space after <code>[</code> and before <code>]</code></li> <li>Running the command within <code>$()</code> will invoke a subshell and r...
numpy.fromfile is reading only 1st row <p>I'm trying to read tabular data using </p> <blockquote> <p>numpy.fromfile()</p> </blockquote> <p>for its fast speed,but its only reading the first row. How to read the entire table? I don't want to use pandas or numpy.loadtext() </p> <pre><code>np.fromfile('abc.txt', coun...
<p>I can read a white-space separated multiline file:</p> <pre><code>In [312]: cat mytest.txt 0.26 0.63 0.97 1.01 0.42 1.66 1.54 1.07 2.13 1.44 2.57 2.73 2.45 2.47 2.29 3.75 3.91 3.37 3.32 4.32 ...
Swift variable giving wrong value <p>I am making a game in swift, I have a variable called <code>score</code>, I increment and print this variable in my <code>onTick()</code> method, and it works fine. However when I try to access this variable to display the final score after the player dies, I get <code>0</code> or ...
<p>I solved this by making the variable static, I don't know if this is the proper solution but it's working for me, thanks everyone for their help.`</p>
React update component state from child component <p>I have the following component:</p> <pre><code>import React from 'react'; import Header from './header.jsx'; import Footer from './footer.jsx'; class Wrapper extends React.Component { constructor(props) { super(props); this.state = { open: false, ...
<p>Your approach is correct, but your code has two problems: first of all, your upper component's <code>toggleWrapper</code> function does not actually change the state to anything other than <code>false</code> (or rather, <code>!true</code>). Fix it like this:</p> <pre class="lang-js prettyprint-override"><code>tog...
Excel VBA pass file path to routine to open Outlook <p>I have a few routines that I'm trying to get to work together. The first 2 find the outlook.exe file on the user's machine and I would like the 3rd to use that file to open Outlook if it isn't already running. The issue I'm having is being able to pass that file'...
<p>Exactly as Comintern commented - </p> <pre><code>Sub Test() Dim oOL As Object Dim ns As Object Dim fldr As Object Set oOL = CreateOL Set ns = oOL.GetNameSpace("MAPI") Set fldr = ns.GetDefaultFolder(6) 'olFolderInbox fldr.display End Sub Public Function CreateOL() As Object Dim ...
Android Reportbug get Error/Exception <p>I'm releasing a beta-version of my app for friends. So that they can test it. I implemented an email function for them to report bugs. But to know specific what triggered the error/exception I want to add the logcat to the email. How can I do that?</p>
<p>I suggest you use <a href="https://fabric.io/" rel="nofollow">https://fabric.io/</a>. It 's quite good, you can see bugs/exception even when you use proguard( still can see your bugs)</p>
Print hash in ruby with indentation for each line <p>I am trying to print a hash of strings and integers in ruby in the following format:</p> <pre><code>x = {"abc" =&gt; 12,"abcdef" =&gt; 44, "sryyy" =&gt; 5} puts x </code></pre> <p>the output should look like:</p> <pre><code> abc 12 abcdef 44 sryyy 5 </code>...
<p>Given this example. I think something as simple as finding the max length and padding using sprintf would be sufficient eg </p> <pre><code>def justified_printing_hash(h) max_length = h.keys.max_by(&amp;:length).length h.each {|k,v| puts sprintf("%&lt;key&gt;#{max_length}s %&lt;value&gt;d",{key:k,value:v}) } end...
How to send email via Concourse CI pipeline? <p>How can I set an email to be sent upon completion or failure of a job in Concourse?</p>
<p>You can use <a href="https://github.com/pivotal-cf/email-resource" rel="nofollow">https://github.com/pivotal-cf/email-resource</a> along with the on_failure step: <a href="https://concourse.ci/on-failure-step.html" rel="nofollow">https://concourse.ci/on-failure-step.html</a></p>
pouchDB filtering replication based on logic <p>I am trying to figure out how the filter works.</p> <p>My goal is to exclude documents with a <code>type</code> of <strong>user_submits</strong> and only grab the documents with <code>type</code> <strong>form</strong> that was created less than a month ago.</p> <p>Am I ...
<p>A filter function return true of false. It returns true if the document should be replicated. Otherwise false.</p>
Invalid argument to function in access sql WHERE NOT IN <p>I have a table1</p> <pre><code> PreA BaB CPS CommName CommName_CPS we ds 123 Degree 123-Degree Se dd 345 arrow 345-arrow KM sd 674 inv 674-inv </code></pre> <p>I have a table2</p> <pre><code> PreA BaB CPS Co...
<p>Try this one, not exists will be better to use if CommName_CPS could be null, you can read more about it in this article <a href="http://sqlinthewild.co.za/index.php/2010/02/18/not-exists-vs-not-in/" rel="nofollow">http://sqlinthewild.co.za/index.php/2010/02/18/not-exists-vs-not-in/</a></p> <pre><code>SELECT * FROM...
Where to put business logic when using entity with MVP pattern <p>I have entities that are very dumb and only holds the data. I used to put some business logic inside the entities or presenter, i.e. </p> <ul> <li><code>Movie.findMostWatchedTopTenMovies</code> </li> <li><code>Movie.hasWatchedThisMovie</code></li> <li><...
<p>You are correct, It is against SOLID principle and your Models must be atomic, which means they only hold values and do not do any changes by themselves.</p> <p>By referencing to <a href="http://rads.stackoverflow.com/amzn/click/0132350882" rel="nofollow">Clean Code book</a>, You must declare some classes that do t...
Error grok pattern <p>I want to parse this log and get back only two elements (2016-05-26T10:40:39,513 babacar).</p> <p>My log is :</p> <blockquote> <p>2016-05-26T10:40:39,513 INFO [00000003] babacar - NOTE: Unable to open SASUSER.PROFILE. WORK.PROFILE will be opened instead.</p> </blockquote> <p>But my filter ...
<p>Try <code>%{TIMESTAMP_ISO8601:datecreer} %{WORD} \[%{INT}\] %{DATA:app_name} - %{GREEDYDATA}</code>. You can test your grok patterns at <a href="http://grokconstructor.appspot.com" rel="nofollow">http://grokconstructor.appspot.com</a></p>
Access Denied error when uploading multiple files in sequence using aws s3 <p>As the final step of a CI Build process, I am using the following shell script to upload a single file at a time to an S3 Bucket:</p> <pre><code>#!/usr/bin/env bash echo "Uploading the file: "$1 aws s3 cp "$1" "s3://BUCKET_NAME/$2$1" --gran...
<p>This issue appears to be resolved - the machine running the scripts (the Build Agent) was using two different connections when making the requests, and those connections each had their own external IP addresses (WiFi and Wired connections.) Only one of those IPs was allowed by the AWS Access Policy, causing the rand...
Creating rugs using ggplot in R <p>I have a dataframe, having 496 observations of 10 variables which are case,water81, water80,water79,income,education,retire,peop81,cpeop,peop80. Now Iam interested in creating a ggplot (income distribution by retirement) . I also need to create a rugs on the left side of the plot. But...
<p>Where would you expect the system to put rug marks on the y-axis of that example plot? And, just as importantly: how would you interpret them? Rug marks are not intended for this kind of data display.</p> <p>Providing a reproducible example of your code would help, but even without it I can tell that you did not ma...
ASP.NET Core 1.0 Localization <p>I've followed <a href="http://docs.asp.net/en/latest/fundamentals/localization.html" rel="nofollow">this</a> guide and I've successfully configured localization in my web application.</p> <p>There's only two things that I don't understand.</p> <p>Let's see some code:</p> <p><strong>S...
<p>firstly, and as you see, you do need to set the .SupportedCulture and .SupportedUICulture properties on the options object:</p> <p><code>options.SupportedCultures = supportedCultures;</code> <code>options.SupportedUICultures = supportedCultures;</code> </p> <p>what I find interesting, and this behavior is sporadi...
Apply replace to all columns of SQL server query <p>I know how to replace something in one field:</p> <pre><code>Select Replace(Clmn1, char(9), ' ') as Clmn1 From TableA </code></pre> <p>Now I would like to apply replace statement to all columns in the table. Is there an easy way to do it?</p>
<p>Sorry, there's no shortcut here (short of dynamic sql, but you dont want to do that!)</p> <pre><code>Select Replace(Clmn1, char(9), ' ') as Clmn1, Replace(Clmn2, char(9), ' ') as Clmn2, Replace(Clmn3, char(9), ' ') as Clmn3 From TableA </code></pre> <p>If this is something you do often, you could wri...
Xcode 8 Auto Layout Constraints not working as expected. Very basic setup with centering plus an issue with pins. Video attached <p>I am having trouble getting a grasp on how auto-layout constraints work. In theory one should be able to add a label to the storyboard, then assign a horizontal center constraint and it sh...
<p>-- Red lines mean Constraints are ambiguous. Yellow means warning, Its show you the runtime demonstration of view.</p> <ul> <li><p>View need four constraint to satisfy its full position. </p> <p>x, y, width and height </p></li> </ul> <p>When you give only center horizontally constraint, this is not enough you hav...
Refresh IconTabFilter count after Navigation in view in SAPUI5 <p>In my SAPUI5 application, I am facing a an issue with the refresh. There are multiple views like Orders, OrderInfo, OrderChange, OrderClose.</p> <p>In the first view Orders, I have IconTabFilter to filter different types of Orders and I am using setCoun...
<p>Re-rendering control will solve this issue,instead of refreshing model or bindings.</p> <p>Invoke <a href="https://sapui5.hana.ondemand.com/#docs/api/symbols/sap.ui.core.Element.html#rerender" rel="nofollow"><code>rerender</code></a> on control to be updated.</p> <blockquote> <p>This triggers immediate rerenderi...
Injecting Javascript in iframe using selenium <p>I am a novice in selenium. I want to hit a url, search for all the iframes and in every iframe, I want to inject a Javascript code. So how would I do that. So far, I have come up with basic selenium code but do not know how to inject JS.</p> <pre><code>public class Poc ...
<p>Use JavascriptExecutor for writing javascript code in selenium</p> <p>Example code for you is</p> <pre><code>JavascriptExecutor js = (JavascriptExecutor) driver; WebElement element = driver.findElement(By.linkText("Click ME")); js.executeScript("arguments[0].setAttribute('attr', '10')",element); </code></pre>
Use exception for mod_expires <p>Is it possible that a file like test.js dont use mod_expires ?</p> <pre><code> &lt;IfModule mod_expires.c&gt; ExpiresActive on ExpiresByType image/jpg "access 2 month" ExpiresByType image/gif "access 2 month" ExpiresByType image/jpeg "access 2 month" ExpiresByType...
<p>I would suggest using the <code>&lt;If&gt;</code> syntax:</p> <pre><code>&lt;If "%{REQUEST_URI} =~ /\/test\.js/" &gt; ExpiresDefault "access plus 1 hour" &lt;/If&gt; </code></pre> <p>This assumes that you're running Apache httpd 2.4, which you should be.</p>
Why am I getting linear run time with Quicksort? <p><strong>Update:</strong> I see what my problem is. I'm sorting 10000 datapoints every time. That will take the same time each iteration. <code>t</code> was my incorrect way of attempting to sort 100 of those datapoints, then add the next 100 datapoints, sort and so on...
<p>If you go by your current code, you will see that after first sorting, you are using the sorted array again. That is wrong.</p> <p>To correct that, you can:</p> <ul> <li>use a new random array (as @Lashane suggested); or,</li> <li>use the same random array (i.e. in the same unsorted state that you started with) an...
Undeclared type adter 'swift build' <p>I'm trying to integrate my library with the Swift Package Manager. After running <code>swift build</code> it successfully downloads the dependency, but then it also gives me the following error:</p> <pre><code>/Users/nikita/Documents/Projects/Projects/TestFramezilla/test/Package...
<p>It looks like you are trying to build an iOS framework. The package manager itself does not currently support directly targeting other platforms than the one it is running on (macOS in this case).</p> <p>If you want to build for iOS, you will have to do so by generating an Xcode project and building from that (<cod...
Do post to servlet using jQuery <p>I am trying writing a server side validation using servlet and ajax, but it is not working properly. The value passed to the servlet cannot be accessed in the servlet.</p> <p>How to fix this.</p> <p>My javaScript function:</p> <pre><code>function employeeValidate() { var params...
<p>Use <code>request.getParameter()</code> instead of <code>request.getAttribute()</code></p>
Hashmap in Treeset (java) <p>I have a HashMap. key - producer, value - price.</p> <p>I need to transfer an idea HashMap in TreeSet with comparator for the price.</p> <p>Pls, help, I do not understand what it means to convey an idea in a TreeSet HashMap. Send a key-value pair as one item in the TreeSet? How to do it? ...
<p>Create TreeSet for pairs (entries) and pass your own comparator to the constructor.</p> <pre><code>Set&lt;Entry&lt;Producer,Price&gt;&gt; set = new TreeSet&lt;&gt;(new YourComparator); </code></pre>
Jump on slideUp jQuery <p>I'm trying to create a material design Stepper using Materializecss and I'm almost there, but I'm having some strange issue with the slideUp animation on each step.<br> When it's just about to end, there is an abrupt jump. I prepared a jsFiddle for you to see, but I'm also writing the code in ...
<p>Remove <strong>margin-bottom: 8px</strong> on <strong>.step-title</strong> and add <strong>margin-top: 8px</strong> to <strong>.step-content</strong>.</p> <p>It should stop abrupt jump</p>
trying use excel to count how many times a doctor is on a rotation in a month <p>I'm currently trying to come up with a way to have excel look at a monthly schedule for my doctor's service rotations and to provide a summary of the services they're scheduled for and how many of each. </p> <p>below is an example of how ...
<p>I hope I've set-up my Excel file correctly (see image below), I only used a sample of data as you provided, from rows 2 to 4:</p> <p><a href="http://i.stack.imgur.com/h2roA.jpg" rel="nofollow"><img src="http://i.stack.imgur.com/h2roA.jpg" alt="enter image description here"></a></p> <p>Then I used the formula:</p> ...
font-face setup with multiple styles <p>I have a question about setting up the Roboto font family (multiple styles) on our local server. We cannot link to an outside service for these styles.</p> <p>I have searched and read a ton of articles and tried a lot but still not getting it to work for me. I'm sure it's someth...
<p>When you declare your font in <code>roboto_stylesheet.css</code> you should have a similar code. </p> <pre><code>@font-face { font-family: 'RobotoFont'; //use this name to set any text font font-style: normal; font-weight: 400; src: local('Roboto'), local('Roboto'), url("&lt;font path&gt;.woff2") format('wo...
how to populate static database tables in django <p>I am trying to learn Django and so far I have been able to create models and be able to inject data into the database using views and have a small web app working nicely.</p> <p>I have a small confusion regarding how Django works with tables that will need to be popu...
<p>For Products that should already be populated you could use <a href="https://docs.djangoproject.com/en/1.8/howto/initial-data/" rel="nofollow">initial data</a> to prepopulate</p> <p>If some external software wants to change the product list, well hmm if you need to do it manually you can create a <a href="https://d...
Unable to initialize UserControl with nested Dependency properties <p>I'm trying to expose two dependency properties of a nested control. In this case <code>Mask</code> and <code>DisplayFormatString</code>.</p> <pre><code>&lt;UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" ...
<p>The <a href="https://msdn.microsoft.com/en-us/library/ms557329(v=vs.110).aspx" rel="nofollow"><code>PropertyMetadata(object defaultValue)</code> constructor</a> uses its <code>object</code> parameter as a default value for the dependency property. Here...</p> <pre><code>new PropertyMetadata(0) </code></pre> <p>......
How to build string with Bullet format <p>I am trying to display string as </p> <blockquote> <pre><code>. string1 . string2 . string3 </code></pre> </blockquote> <p>By using Append function of Jquery how to build string with bullet format.</p>
<p>Seeing as html lists are set up using <code>ul</code> and <code>li</code> tags, we can create a html list as follows:</p> <pre><code>&lt;ul class="myList"&gt; &lt;li&gt;Coffee&lt;/li&gt; &lt;li&gt;Tea&lt;/li&gt; &lt;li&gt;Milk&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>To append to it using jQuery:</p> <pre><c...
How to add info that will show on each page <p>I have event coded to show the event on each page of the website. Is there a way to code it so that when you need to update it, you can do it once and it will show on each page? (vs having to update HTML text on each page). </p>
<p>Yes, create a external JavaScript(.js) file and include it on the each page. e.g</p> <pre><code> &lt;script src="scriptfile.js"&gt;&lt;/script&gt; </code></pre> <p>Whenever you want to update/change, just update the js file.</p>
How return boolean for TwoPane Layout in BaseAdapter Class <p>I have created Portrait and Landscape Views with Fragments. I implement the TwoPane boolean code in my MainActivity. </p> <pre><code> boolean mTwoPane; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInst...
<p>Right now you have:</p> <p><code>mTwoPane = findViewById(R.id.details_fragment_container) != null;</code></p> <p>You could replace it with method:</p> <p><code>boolean isLandscape(Context context) { return context.getResources().getBoolean(R.bool.isLandscape); } </code></p> <p><code>mTwoPane = isLandscape(t...
Sympy to numpy causes the AttributeError: 'Symbol' object has no attribute 'cos' <p>I am trying to do partial derivatives using sympy and I want to convert it to a function so that I can substitute values and estimate the derivatives at some values of t_1, t_2. The code I am using is as follows:</p> <pre><code>import ...
<p>This type of error occurs when you call <code>np.cos(a_symbol)</code>, which apparently translates under-the-hood in numpy to <code>a_symbol.cos()</code>.</p> <p><code>lambdify</code> is for numeric calculations - it replaces all <code>sp</code> calls with <code>np</code> calls. But what you're doing is symbolic. T...
Mapbox {"message":"Tileset does not exist"} <p>Why is this link saying : <code>{"message":"Tileset does not exist"}</code> for the given URL which was working few months before. </p> <pre><code>http://c.tiles.mapbox.com/v3/examples.map-9ijuk24y/6/17/27.png </code></pre>
<p>The resource has been removed.</p>
matching negative number in a line not working <p>How to match negative number in a line.</p> <pre> input line :strongest_signal_indication Invalid {-1} some text </pre> <p>I was trying this regex expression:</p> <pre><code>/ ( [+-]?\d+ )| (\s+ ( \{ [^-]+ \} |\S+)) /xg </code></pre> <p>but it did not work for me...
<p>Your pattern actually does match.</p> <pre><code>$ perl -E' say "Invalid {-1}" =~ / ( [+-]?\d+ )| (\s+ ( \{ [^-]+ \} |\S+)) /x ? "match" : "no match";' match </code></pre> <p>In fact, <code>/ [+-]? \d+ /x</code> would have sufficed.</p>
getElementsByClassName error within a div <p>I have a page with multiple div's containing html5 video players. Basically something like this</p> <pre><code>&lt;div class="panel"&gt; &lt;video class="player"&gt;&lt;source src="video1.mp4" type="video/mp4" /&gt;&lt;/video&gt; &lt;/div&gt; &lt;div class="panel"&gt; &...
<p>Your question has a mispelling. It refers to:</p> <pre><code>document.getElemtsByClassName(...) </code></pre> <p>which should be:</p> <pre><code>document.getElementsByClassName(...) </code></pre> <p>Assuming that is just a typo in your question (since you don't report the error that would cause), then:</p> <hr...
android adding fragment programatically doesn't accept parameter <p>I am trying to add a fragment programatically to my layout in the <code>MainActivity</code>, to be more specific in its <code>onCreate</code> method. I keep getting an error <code>Cannot resolve method add()</code>, and that really shouldnt happen beca...
<p>If you are importing <code>android.app.Fragment;</code> change it to <code>android.support.v4.app.Fragment;</code></p>
How can an average equation be added to this? <p>I am taking GCSE programming and have be set a task to create a program which takes "n" amount of numbers and works out the average.</p> <pre><code>#presets for varibles nCount = 0 total = 0 average = 0.0 Numbers = [] ValidInt = False #start of string nCount = (input(...
<p>You're <em>really</em> close to the answer. Looks like you've got everything setup and ready to calculate the average, so very good job.<br> Python's got two built-in functions <code>sum</code> and <code>len</code> which can be used to calculate the sum of all the numbers, then divide that sum by how many numbers ha...
SignalR: Connection has not been fully initialized. Use .start().done() or .start().fail() to run logic after the connection has started <p>Trying to replicate an example I have encountered the problem that the connection is not made, when it comes to do it from a server to my computer, but when I work remotely if it w...
<p>You should only have one <code>connection.start()</code> and not two. You need to add the <code>done()</code> and <code>fail()</code> into that call.</p> <pre><code>connection.start({ ... }).done(function() {...}).fail(function() {...}) </code></pre> <p>Otherwise you'll try to start it twice. It might seem to work...
Array search in elasticsearch <p>I have 3 document,</p> <pre><code>{ "category":[{"id":"1"},{"id":"2"},{"id":"3"}] } { "category":[{"id":"1"},{"id":"4"}] } { "category":[] } </code></pre> <p>How I can find document which have category.id in (2,3) like mysql, also which type of DSL query I need to use in java api q...
<p>Here's how your query should look like:</p> <pre><code>{ "query": { "bool": { "filter": [ { "term": { "category.id": "1" } }, { "term": { "category.id": "2" } } ] } } } </code></pre>
Formating strings in C# <p>I'm trying to format array elements to look like a table with some columns to have right alignment and some left as shown in <a href="https://msdn.microsoft.com/en-us/library/txafckwd.aspx" rel="nofollow">Composite Formatting</a> article (or <a href="http://stackoverflow.com/questions/3262085...
<p>Interesting - the formatter seems to be picky about excess whitespace in format strings. This worked for me:</p> <pre><code>Console.WriteLine("{0, -15} | {1, 5}", Bar[i].Name, Bar[i].Age); </code></pre>
Hybris Admin User Access <p>I am using version 6.1. I want to create a user who has most admin capabilities. However I do not want them to have access to creating user groups, users etc. I want them to have access to products etc. Is there a functionality in Backoffice to restrict users from adding users. Is there a wa...
<p>Use Hybris <a href="https://help.hybris.com/6.1.0/hcd/8b4aa00e866910148df2920f69d68b27.html" rel="nofollow">access rights</a>, for example to give read permissions to user group <em>mygroup</em> for item type <em>User</em> <strong>(this can be executed as an Impex query)</strong>:</p> <pre><code>$START_USERRIGHTS;;...
Keydown keyboard shortcut <p>I'm trying to create a keyboard shortcut for focus purposes (this is for 508 compliance). I'd like to be able to do it while inside an iframe body, but if this isn't possible I can go to plan B and whenever the class is highlighted, to do it from there (this is by tabbing to the link). In t...
<p>It's not working because you can't find <code>.final</code> in <code>$(this)</code>. Remember that you put the <code>keydown</code> event on the <code>.link</code>, so you're looking for children of the <code>.link</code> to be <code>.final</code>. There are none.</p> <p>The event is firing, but it can't find the e...
Easiest way to deploy with docker-compose? <p>I want to have something similar to generic docker containers updating process:</p> <pre><code>docker-compose pull projectname:latest docker-compose run projectname:latest </code></pre> <p>Is there any possibility to do that? Or I definitely need to store <code>docker-com...
<p>Not at the moment. Docker Compose is a client tool, it just parses the local YAML file and sends <code>docker</code> commands to the Engine. </p> <p>We will have the ability to create <a href="https://blog.docker.com/2016/06/docker-app-bundle/" rel="nofollow">Distributed Application Bundles</a> soon - this is avail...
java-grpc: How to increase the message size limit in a ManagedChannel? <p>Our communication exceeds the default <a href="https://github.com/grpc/grpc-java" rel="nofollow">grpc-java</a> limit on the message size:</p> <pre><code>Caused by: io.grpc.StatusRuntimeException: INTERNAL: Frame size 4555602 exceeds maximum: 419...
<p>Today, you can't increase the limit on <code>ManagedChannelBuilder</code>; you are forced to specify the transport implementation you want to use.</p> <p>So most users would explicitly use <code>NettyChannelBuilder</code>, and Android users would use <code>OkHttpChannelBuilder</code>:</p> <pre><code>ManagedChannel...
Using Authentication Headers in REST API Proxy, extJS and Chef <p>I am trying to make an API GET request to an endpoint on my Chef Server and was wondering how I could use my username and username.pem file in order to successfully make the request. I am currently using the extJS framework in order to perform this actio...
<p>When you say extJS I'm assuming you are talking about doing this from a browser. This is not recommended since you would have to load the whole RSA private key into Javascript which is unsafe as you cannot reasonably ensure it won't leak out to other contexts. You'll need some kind of proxy (such as the PHP code you...
How to bind kendo combo in kenod grid based on Id <p>I am binding kendo combo in kendo grid. Combo should bind dynamically based on item code from adjacent column. I have written below code. Combo does not bind.</p> <pre><code>$("#DieItemGrid").kendoGrid({ dataSource: { data...
<p>In your <code>options</code> argument, you have a property called <code>model</code>, which is the model of the current row.</p> <p>Use it like: </p> <pre><code>data: { itemCd: options.model.ChildItemCd } </code></pre> <p><a href="http://dojo.telerik.com/AjOFU" rel="nofollow">Demo</a></p>
NSLayoutConstraints breaking but seem fine <p>I'm trying to pin an image view to the top, left, and right of a superview, and give it a height with <code>NSLayoutConstraint</code> like so:</p> <pre><code>backgroundView.addSubview(imageView) backgroundView.addConstraint(NSLayoutConstraint(item: imageView, attribute: .T...
<p>fixed by adding <code>imageView.translatesAutoresizingMaskIntoConstraints = false</code> before adding the imageView as a subview to backgroundView.</p>
there is something like didAppear for a cell in a collection view? <p>I have a problem with my textViews, because when they appear, always appear scrolled to the bottom, I read here that is a problem that occurs when the textview has constraints, and the solution is set the isScrollEnabled to false and in the didAppear...
<p>I suggest to override <code>prepareForReuse</code> to make any changes before the cell will be visible. </p>
how to solve data loading issue in Chrome <p>All:</p> <p>I wonder how can I make Chrome handle about 4GB data loaded into it? My use case is:</p> <p>The Front End starts and tries to download 3GB json file data and makes some calculation. But Chrome always crash. </p> <p>Any solution for this? Thanks</p>
<p>When you work with large data typically optimization rule is :</p> <p><strong>Don't read all data at once, don't save all data at once</strong>.</p> <p>If your code allows perform calculations "step-by-step", split your JSON to small parts (for example, by 50Mb). Of course, it works slowly, however this approach ...
Polylines not being removed from GoogleMap <p>I have a Map where i'm placing markers and connecting them with PolyLines:</p> <pre><code>PolylineOptions p = new PolylineOptions(); p.color(Color.BLUE); p.width((float) 7.0); Polyline polyLine = this.mMap.addPolyline(p); p.add(actualLocation); LatLng previousPoint = latLn...
<p>It looks to me like you are in fact adding two polylines to the map... If PolylineOptions() are mutable once attached to a Polyline, they are in the same spot, otherwise you are adding one without positioning followed by a second. Only the second Polyline is being added to your List.</p> <p>Instead of this:</p> <p...
Error connecting JMX caused by SSLHandshakeException <p>I am a newbie to JMX. I need to create a custom JMX client that would connect to remote server and read data from mbeans.</p> <p>Here is the app code that I have so far:</p> <pre><code>String url = "service:jmx:rmi:///jndi/rmi://host:port/jmxrmi"; JMXServiceURL ...
<p>The problem was in lacking server's certificate in client's keystore.</p>
Collections in XML, the right structure <p>I'm wondering what is the difference between two below XML structure when we have collection. Which one is preferred?</p> <pre><code>-- having &lt;Databases&gt; node and list the databases inside it &lt;Server&gt; &lt;Databases&gt; &lt;Database Name="master"/&gt; ...
<p>The first one is better if that is the only info needed, but the second one can hold more info under the server like a user node</p>
file writing not working as expected <p>I have a python code where it will take the first column of a sample.csv file and copy it to temp1.csv file. Now I would like to compare this csv file with another serialNumber.txt file for any common rows. If any common rows found, It should write to a result file. My temp1.csv ...
<pre><code>with open('temp1.csv', 'r') as file1: list1 = file1.readlines() set1 = set(list1) with open('temp2.csv', 'r') as file2: list2 = file2.readlines() set2 = set(list2) </code></pre> <p>now you can process the contents as sets</p> <p>I want to note that your original code does not insert line breaks ...
How to solve Facebook tools:replace="android:theme"? <p>I have</p> <pre><code>compile 'com.facebook.android:facebook-android-sdk:4.16.0' </code></pre> <p>My manifest:</p> <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" ... &lt;...
<p>1) Add <code>xmlns:tools="http://schemas.android.com/tools"</code> to <code>&lt;manifest&gt;</code> element at AndroidManifest</p> <p>2) Add <code>tools:replace="android:theme"</code> to (facebook activity) <code>&lt;activity&gt;</code></p> <p>Here is my manifest file</p> <pre><code>&lt;manifest xmlns:android="ht...
Working with Combinations/Probability in Excel <p>Working an a project with many more possible combinations and I'm not sure how to approach it, so I'm going to ask how to do it on a smaller scale and then apply it to a larger scale. I have to buy 1 of product A and 1 of product B They both come in 100 varieties at dif...
<p>You would need a formula like this:-</p> <pre><code>=SUM((A$2:A$6+TRANSPOSE(C$2:C$6)=F2)*B$2:B$6*TRANSPOSE(D$2:D$6)) </code></pre> <p>which would have to be entered as an array formula using <kbd>Ctrl</kbd><kbd>Shift</kbd><kbd>Enter</kbd></p> <p>It builds up a 2D array with ones at the elements where the correspo...
How do i manage content workflow for hexo site? <p>I've used static site generators like jekyll and had it hosted through github pages just fine using prose.io as a content management system.</p> <p>I decided I wanted to go with a site using Hexo static site generator, but I cannot seem to figure out a good workflow f...
<p>One approach I am trying myself:</p> <ul> <li><a href="http://prose.io" rel="nofollow">prose.io</a> or similar to write and save on github repository</li> <li><a href="https://travis-ci.org" rel="nofollow">travis-ci.org</a> to build hexo site and deploy</li> </ul> <p>This is how it works:</p> <ol> <li>Edit docume...
Possible Staircases using Dynamic Programming <p>For the Staircase problem mentioned in the URL <a href="http://acm.timus.ru/problem.aspx?num=1017&amp;locale=en" rel="nofollow">http://acm.timus.ru/problem.aspx?num=1017&amp;locale=en</a> <a href="http://i.stack.imgur.com/bIwJ8.png" rel="nofollow"><img src="http://i.stac...
<p>Suppose, you have a function which takes 2 parameters, one <code>left</code> which is number of bricks left and the other one is <code>curr</code> which is the current height of the step which you are on. Now, at any step you have 2 options. The first option is to increase the height of the current step you are on b...
Ultrahook and MAMP PRO 4.0.5 in Codeigniter on Mac El Capitan <p>I have successfully installed ultrahook. I had to install this in usr/local/bin on Mac El Capitan, because I was not able (due to the new security policy) to install it in usr/bin.</p> <p>When I run the command:</p> <pre><code>ultrahook &lt;my.namespace...
<p>Ok! It took two days to figure out what was going wrong and now everything is working correctly.</p> <p>So, as a dedicated SO user i feel that I must share what I have found out.</p> <p>First think to be mentioned is that ruby has a very general way to report the generated errors and if you don't know nothing (as ...
trying to display information from xml with javascript <p>just want to set up a search engine like netflix or google which updates my webpages with results without refreshing. therefore i have tried a lot and this is my code. but the code stops at the first entry of xml and i dont know why. </p> <p>this is my html</p>...
<p>You have a break statement after you find a matching film, so the loop never goes through the remaining films.</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> fun...
How to insert plugin URL (wordpress.org) <p>I'm trying to upload plugin to wordpress.org but found it kinda difficult. See Screenshot</p> <p><a href="http://i.stack.imgur.com/eGM3j.png" rel="nofollow"><img src="http://i.stack.imgur.com/eGM3j.png" alt="enter image description here"></a></p> <p>When I click "Send Post>...
<p>The link needs to be a direct link to the zip file. Most file upload services won't allow this. Chances are it will need to be on a file server.</p>
Join LINQ tables based on model definition <p>I want to join tables using linq, based on the definition of the model. Example of what I want: </p> <p><strong>from department in User.departments...</strong></p> <p>My classes are:</p> <p><strong>USER CLASS:</strong></p> <pre><code>public class User { public User(...
<p>If the spelling of your message is exact then the reason for the error must be <code>departments</code> with lower <code>d</code>. Your 'Departments' property in the class definition is capital <code>D</code>.</p>
Query code generating Invalid Use Of Null <p>My code is generating an Invalid Use Of Null and I am not seeing the issue. When I compile the code, I do not get an error, but when I run and debug it, the error occurs at strRESMILE = rs("RESMILE"). </p> <p>Any thoughts? I can upload the database if need be.</p> <pre><co...
<p>Handle the evident <code>NULL</code> in your <code>[RESMILE]</code> field by using <code>Nz()</code>.</p> <p>So change <code>strRESMILE = rs("RESMILE")</code> to <code>strRESMILE = Nz(rs("RESMILE"))</code></p>
Application crash while using spinner <p>This method is to get the inputs that includes three <code>EditText</code> boxes and one spinner which is populated from <code>string-array</code>.The click of the button is the trigger for undertaking the calculations. While the <code>OnClick</code> method is pressed the applic...
<p>I hope you have missed </p> <pre><code>break; </code></pre> <p>in switch case statement</p>
How to Drag Custom Icons Mapbox GL JS <p>I'm currently using Mapbox GL JS and I have <a href="https://www.mapbox.com/mapbox-gl-js/example/custom-marker-icons/" rel="nofollow">custom icons like this example</a> and I want to be able to drag the icons.</p> <p>I'm doing it similar to <a href="https://www.mapbox.com/mapbo...
<p>I ran into a similar problem and after many hours, managed to combine the two examples and export the coordinates to form fields. Try this snippet (use your own accessToken, map style and marker image)</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="...
what is the general way to find what dependencies do I need on .net core? <p>I'm trying to create a simple .net core app from code I've found on some blogs. I'm on Ubuntu 16.04. My files are:</p> <p>project.json</p> <pre><code>{ "version": "1.0.0-*", "buildOptions": { "debugType": "portable", "emitEntryPo...
<p>There really isn't going to be one. You may be able to find a tool like resharper that knows the official Microsoft packages and will tell you to "Microsoft.EntityFrameworkCore" or whatever you are missing. However, it's to general of a problem to be reliably solved. In your example, you're missing a class that is s...
How do I say if value exists display value otherwise leave well enough alone with simple_form? <p>I'm using simple_form and I only want the <code>value: @image.start_at.strftime("%m/%d/%Y %I:%M %p") %&gt;</code> to execute if @image.start_at has a value. </p> <pre><code>&lt;div class="input-group date" id="datetim...
<pre><code>&lt;%= f.text_field :start_at, class: 'form-control', value: @image.start_at? ? @image.start_at.strftime("%m/%d/%Y %I:%M %p") : nil %&gt; </code></pre> <p>based on @luissimo 's answer</p>
Im trying to print the "J" in initial = dotmatrix.dotJ("J") <p>I have a project where I build a dotmatrix module and then import it into another program that will print out my initials. I have it done to the point where it will print out my initials, but it won't print the "J" in the </p> <pre><code>initial = dotmatri...
<p>A simple way would be to define your <code>dotJ</code> variable with a star and then <code>replace</code> the star with the character:</p> <pre><code>def dotJ(char): """Creates a capital J in 7 x 7 dots""" dotJ = " * \n" dotJ += " * \n" dotJ += " * \n" dotJ += " * \n" do...
position relative but fixed header <p>I need to have following Header in relative position like here: <a href="http://i.stack.imgur.com/XC13t.png" rel="nofollow"><img src="http://i.stack.imgur.com/XC13t.png" alt="enter image description here"></a></p> <p>But I want to be the header fixed, when scrolling content, so i ...
<p>If your topbar's height is known, add the same width as top position to your content, look at the code or check the fiddle:</p> <pre><code>&lt;div class ="topbar"&gt; &lt;/div&gt; &lt;div class="content"&gt; &lt;p&gt;first line&lt;/p&gt; &lt;p&gt;abc&lt;/p&gt; &lt;p&gt;abc&lt;/p&gt; . . . &lt;p&gt;abc&lt;/p&gt; &l...
Android : Can't convert string to json object which is written in php format <p>Error occurs in second try block where <code>JSON</code> data is fetched from the <code>php</code> file and it can't convert it into <code>JSONObject</code>. </p> <p>Following is error log</p> <pre><code>E/log_tag: &lt;html&gt;&lt;body&gt...
<p>post the return of PHP here. It should be something like... </p> <p><code>{"id_proposta":"1","id_pedido":"1","id_transportador":"2","id_cliente":"1","aceita":"1","finalizada":"1"}</code></p>
How to pass the non dataframe argument to udf in spark <p>Can any please help to know how to pass the non dataframe value as an argument to udf.</p> <pre><code>val df2 = df1.withColumn("newcol", udffunc(df1("col1"), x)). </code></pre> <p>The udf function i defined as below.</p> <pre><code>udffunc = udf(method _) </c...
<p>I am able to fix the issue by just writing the below code for udf. </p> <p>def udffunc = udf((y:String) => { var format:String = "x" method(y, "x") })</p> <p>So with this I am able to pass one argument(dataframe column) from .withColumn to the udf function "udffunc" and then am ...
Best way to store multiple content types in SQL Server that are displayed on a single list <p>I have a .net application that will display many content types in a single view for a user , in a card listing. These cards would be displayed in a chronological order and have different layouts and display different informati...
<p>SQL is not a good solution for this kind of model. You'll want to look at a document store like ElasticSearch or MongoDB. Those are designed specifically for what you want to do.</p> <p>I prefer ElasticSearch over MongoDB since the syntax is much cleaner IMO. ElasticSearch is also much, much, much faster then SQL o...