input
stringlengths
51
42.3k
output
stringlengths
18
55k
Change color of cursor in Excel 2013 <p>Is it possible to change the color of the cursor in Excel 2013? </p> <p>I don't want to change the cell color, or other workarounds.</p> <p>If yes, how can I do that?</p>
<p>No you can't. Which is why if you google for it people are offering workarounds around the cells near the cursor. You'd have to <a href="http://stackoverflow.com/questions/18779354">do it in another language</a> but I have no idea how you'd invoke that via VBA.</p>
Handling very large data with mysql <p>Sorry for the long post!</p> <p>I have a database containing ~30 tables (InnoDB engine). Only two of these tables, namely, "transaction" and "shift" are quite large (the first one have 1.5 million rows and shift has 23k rows). Now everything works fine and I don't have problem wi...
<p>When collecting billions of rows, it is better (when possible) to consolidate, process, summarize, whatever, the data <em>before</em> storing. Keep the raw data in a file if you think you need to get back to it.</p> <p>Doing that will eliminate most of your questions and concerns, plus speed up the processing.</p>...
Populate location attribute into text area instead of alert <p>I have a function to retrieve my current location based on longitude and latitude. However, I would like to auto populate a text area (<strong>Populate Here)</strong> with my retrieved results, instead of prompting an alert.</p> <pre><code>&lt;!DOCTYPE htm...
<p>So lets say you have a span in html</p> <pre><code>&lt;span id="myspan"&gt;&lt;span&gt; </code></pre> <p>In your onSuccess function, you will set the innerHTML of that span, which is is between the opening and closing tags: <code>&lt;span&gt;</code>innerHTML is here<code>&lt;/span&gt;</code></p> <pre><code>var sp...
Search Keys and Replace Values in XML <p>I have an xml file which looks like below</p> <pre><code>&lt;name&gt;abcdefg&lt;/name&gt; &lt;value&gt;123456&lt;/value&gt; </code></pre> <p>I am trying to write a script using sed to search for the tag "abcdefg" and then <strong>replace the corresponding value</strong> "12345...
<p>Sample data used:</p> <pre><code> cat key &lt;name&gt;abcdaaefg&lt;/name&gt; &lt;value&gt;123456&lt;/value&gt; &lt;name&gt;abcdefg&lt;/name&gt; &lt;value&gt;123456&lt;/value&gt; &lt;name&gt;abcdaaefg&lt;/name&gt; &lt;value&gt;123456&lt;/value&gt; </code></pre> <p><code>sed</code> solution:</p> <pre><code> sed '/a...
Push Notification image from url? <p>Android push notification image is by default applications image. Is it possible that the icon of my push notification can be load through an external image url ? Is this possible ?</p>
<p>You have to download the image convert into bitmap and then create notification.</p>
Php string replace for symbols and special character <p>I creating a forum admin page where admin can send all registered members info message at once and mention their name or email using this <code>@username@</code> or <code>@useremail@</code> and so on. Now what i tried is to replace <code>@username@</code> if body ...
<p>IN your case you can use multiple replacement in string.</p> <p><strong>Example :</strong> </p> <pre><code>$string = Welcome @username@ we have sent you new info message at @useremail@; $array = array('@username@', '@useremail@'); $wordInString = array('@username@','@useremail@','@fname@'); $replaceInString = arr...
Select top N rows for each group <p>I have the following MS Access DB schema:</p> <p><a href="http://i.stack.imgur.com/kp4DD.png" rel="nofollow"><img src="http://i.stack.imgur.com/kp4DD.png" alt="DB schema"></a></p> <p>I want to select rows from Items table ordered by Items.score so that there are at most Group.top_c...
<p>If there were a constant number per group, you could do:</p> <pre><code>select i.* from items as i inner join groups as g on i.group_id = g.id where i.id in (select top 2 i2.id from items i2 where i2.group_id = i.group_id order by i2.score desc );...
Can't use the contrib in Idris <p>I'm trying to use some of the contrib code in Idris (0.12.3), specifically <code>DivMod</code> (<a href="https://github.com/idris-lang/Idris-dev/blob/master/libs/contrib/Data/Nat/DivMod.idr" rel="nofollow">https://github.com/idris-lang/Idris-dev/blob/master/libs/contrib/Data/Nat/DivMod...
<p>The following Idris file typechecks with <code>idris -p contrib</code>:</p> <pre><code>module SO39700630 import Data.Nat.DivMod x : 10 `DivMod` 4 x = divMod 10 3 </code></pre> <p>The output using 0.12.3 is:</p> <pre><code>$ stack exec idris -- -p contrib SO39700630 ____ __ _ / _/___/ /____(_)__...
How to create a custom ruleprofile javascript sonarlint CLI <p>I'm trying to create a custom rule profile for running a specific rule scan on directory.</p> <p>I want to run a console log check in all js files.</p> <p>I have defined a following property in environment variables. export -DSonar_PROFILE=D:\testProfile....
<p>There are two things going on here:</p> <ol> <li>That's just not the way to specify a profile at analysis time. You can only use profiles that have been <em>defined on the server</em>. You would then set <code>-Dsonar.profile=[profile name]</code>. You cannot point this analysis property to a file. Well, not and ge...
How to call Z-functions from a plugin on ImageJ <p>Good Morning </p> <p>I'm currently doing a plugIn for ImageJ in JAVA that needs to call the function "<strong>Maximum Intensity Z-projection</strong>", which I know that is already in ImageJ if you go for "Image/Stacks/Z Project...". <em>Documentation here: <a href="h...
<p>You can easily use the macro recorder for help to record all commands in ImageJ, see:</p> <p><a href="https://imagej.nih.gov/ij/docs/guide/146-31.html#sub:Record" rel="nofollow">https://imagej.nih.gov/ij/docs/guide/146-31.html#sub:Record</a>...</p> <p>Enable Java for the recorder and then use the "Create" action t...
Securing an existing API behind AWS API Gateway <p>Suppose I have a RESTful API that sits on a Windows EC2 cluster, behind an ELB. The existing API is a.NET application and hosted in IIS.</p> <p>I want to try and put AWS API Gateway in front of the existing API, so that security, scalability, etc is handled by AWS. Es...
<p>You will need to configure your set up your ELB to do TCP based load balancing and terminate SSL connection on your IIS/EC2 hosts. This will require distributing the SSL certificate to the hosts and configuring them to bind the certificate to the appropriate port.</p>
How to loop an image to represent a number <p>i was able to display repuations in a tab but i want an image to represent the reputation number.</p> <pre><code> &lt;i class="fa fa-star-half-o"&gt;&lt;/i&gt; {{$artists-&gt;reputations}} &lt;/a&gt;&lt;/li&gt; </code></pre> <p>For instance if the reputation is 5 i want...
<p>You are overwriting <code>$j</code> in your loop condition. So you always get 5 images. it should be looking like this if you only want 3 stars if <code>$artists-&gt;reputations = 3</code>.</p> <pre><code>&lt;?php $j = artists-&gt;reputations; for($i=1;$i&lt;=$j;$i++){ &lt;i class="fa fa-star-half-o"&gt;&lt;/i&gt...
java : Server-Side Encryption with Customer-Provided Encryption Keys (SSE-C) with using vfs s3 plugin <p>Experts<br> I am using vfs s3 plugin to perform file related operation in S3. Official guide for Server-Side Encryption with Customer-Provided Encryption Keys (SSE-C) is here <a href="http://docs.aws.amazon.com/Ama...
<p>Right now it is not possible to use customer-provided encryption keys with vfs-s3 library but I can take your PR or need some time to implement it - you are first one who have asked for it. </p>
How to check if an item belongs to a hasMany association before updating in CakePHP 3.2 <p><strong>What I am trying to do:</strong></p> <p>I have Estimates and Estimates have items "EstimateItems". When updating a Estimate the EstimateItems changed should update. (using patchEntity)</p> <p>This is working with my cur...
<p>Looks like you need to implement the check via a beforeSave callback function if you don't trust that setting fields hidden / not editable is not enough.</p> <p>In the callBack you can check if the relation was already there before before you overwrite them with a wrongly edited value.</p>
Select if comma separated string contains a value <p>I have table </p> <pre><code>raw TABLE ========= id class_ids ------------------------ 1 1234,12334,12341,1228 2 12281,12341,12283 3 1234,34221,31233,43434,1123 </code></pre> <p>How to define regex to select raws...
<h3>You shouldn't be storing comma separated values in a single column.</h3> <hr> <p>However, this is better done using string_to_array() in Postgres instead of a regex:</p> <pre><code>SELECT * FROM raw WHERE '1234'= any(string_to_array(class_ids, ',')); </code></pre> <hr> <p>If you really want to de-normalize yo...
Why Regex "(({12}*10)/100)".replace(new RegExp("{12}",'g'),value) not working? <p>My following regex is not working.</p> <pre><code>"(({12}*10)/100)".replace(new RegExp("{12}",'g'),value) </code></pre> <p>I want to replace {12} with "value". It is throwing error that</p> <p>Invalid regular expression: /{12}/: Nothin...
<p>You need to double escape the {} curly brackets see:</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>var value = 50; var result = "(({12}*10)/100)".replace(new RegExp("\...
Sql Server: Comma separated column values exist in other comma separated column <p>Let's say I have a table</p> <pre><code>OrgData OrgDataid columvalues 1 1,2,3,4,5 2 6,7,8,9 3 16,17,18,19 </code></pre> <p>Another table holds selected values</p> <pre><code>selectedData rowid sid orgid...
<p>You might try this:</p> <p>--<em>mock-up-tables</em> with your data</p> <pre><code>DECLARE @OrgData TABLE(OrgDataid INT,columvalues VARCHAR(100)); INSERT INTO @OrgData VALUES (1,'1,2,3,4,5') ,(2,'6,7,8,9') ,(3,'16,17,18,19'); DECLARE @selectedData TABLE(rowid INT,[sid] INT,orgid INT,[values] VARCHAR(100)); INSER...
How to check if the Battery Saver Mode is enabled on Android < 5.0? <p>As I know, there are some devices with version &lt; 5.0 that have the Power Saver option.</p> <p>An answer provided in <a href="http://stackoverflow.com/questions/33277525/how-to-check-battery-saver-is-on-in-android-api-21">this</a> similar questio...
<p>For KitKat and below power saving is not a standard feature enabled in the stock android but some manufacturers implement this through some different methods. So there are no standard ways for checking this.</p>
ASP.NET MVC: How to use multiple models in one View? <p>I have the following ViewModel that includes 2 other models:</p> <pre><code>public class ViewModel { public ViewModel1 viewModel1 { get; set; } public ViewModel2 viewModel2 { get; set; } } </code></pre> <p>My View looks like this:</p> <pre><code>@Html.Tex...
<p><strong>Edited</strong> following @Stephen Muecke's comment, doesn't sound like this is the case. However, I'll leave this answer here, as my first port of call would still be to check out the POST payload in the request to make sure it was going across the wire as expected, so this part may be useful</p> <hr> <p>...
Add two Storyboards to project for different languages <p>I want to add a right to left language to my project. May I have two Storyboard one of them for LTR and another for RTL languages? How?</p>
<p>Yes, you can use two storyboards to do it. You can put an if statement in your appDelegate class to check if the device language is RTL or LTR, then switch between storyboards by their ID.</p> <pre><code>let preferredLang = NSLocale.preferredLanguages().first! if NSLocale.characterDirectionForLanguage(preferred...
What BOOST_PP_AUTO_REC does? <p>I met in boost define </p> <pre><code># define BOOST_PP_ENUM BOOST_PP_CAT(BOOST_PP_ENUM_, BOOST_PP_AUTO_REC(BOOST_PP_REPEAT_P, 4)) </code></pre> <p>Could anyone explain what BOOST_PP_AUTO_REC does? Can't find any description in documentation. What this macros actually for? </p>
<p>The <code>BOOST_PP_AUTO_REC</code> help deduces the recursion level used in <a href="http://www.boost.org/doc/libs/1_61_0/libs/preprocessor/doc/topics/reentrancy.html" rel="nofollow">Automatic Recursion</a>, by performing a binary search using a predicate. The first argument is the predicate and the second is the si...
Entity Framework 6 does not recognize mapped function in database model <p>I have a problem with Entity Developer and model defined function. Ealier I was mapping functions as a stored procedures because Entity Developer has no support for database functions as it goes. I was using solution mentioned in this <a href="h...
<p>I just get a solution. The problem was in attribute, database namespace generated by Entity Developer and function and variables types. I had to make something like that: </p> <pre><code> [DbFunction("Ewid.Database.Entities.Store", "EW_BLOB_ILE_WYST")] public static decimal EwBlobIleWyst(string OWNER, decima...
Scroll Over Ad Control - Windows Phone UWP <p>I am using ad control in my xaml as below</p> <pre><code>&lt;Page x:Class="namespace" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:namespace" xmlns:ViewModels="using:namespace.Vi...
<p>You need to put the <code>ScrollViewer</code> inside the <code>PivotItem</code>'s <code>DataTemplate</code>.</p> <p>Currently the <code>ScrollViewer</code> wraps the whole <code>Pivot</code>, but the pivot itself handles the scroll event which means the <code>ScrollViewer</code> does not receive it. You can confirm...
Get content of FormData with data set from form element <p>I have <code>formData</code> from <code>&lt;form&gt;</code> element and I want to get content of elements inside form, but with <code>formData</code>. As you can see, I'm not using <code>formData.append()</code>. Also, please, do not post answers with <code>for...
<p>You can do it by using id of an element.</p> <pre><code>console.log($('#image').get(0).files[0]); &lt;input type="file" name="file" accept="image/*" id="image"&gt; </code></pre> <p>Multiple files can be appended by using <code>each</code></p> <pre><code>var data = new FormData(); $.each($('#image')[0].files, fun...
Selecting data from two different tables as shown in below , sqlite Android <p>For example, if I have a table credit:</p> <pre><code>id cr_amount created -------------------------------------------------- 1 1000 2011-07-01 00:10:16 2 2000 2011-07-08 10:11:45 3 ...
<p>You may need to put both columns in the union all:</p> <pre><code>select cr_amount,Null as 'db_amount',created from table_credit union all select Null,db_amount,created from table_debit order by created </code></pre>
React js how to inject javascript in jsx object <p>I don't want to display <code>"no file selected"</code> on input file and replacing with another button.</p> <pre><code>var form = React.createClass({ render : function(){ var fileStyle = { display : none }; return ( &lt;form&gt; ...
<ul> <li>Assign a ref to a field</li> <li>Find corresponding dom node using <code>findDOMNode</code> and the ref</li> <li>Trigger click manually.</li> </ul> <p><a href="https://codepen.io/tarabyte/pen/ozWzgr" rel="nofollow">Demo</a>.</p> <pre><code>const { Component } = React const { render, findDOMNode } = ReactDOM ...
Form with DateField: how to check for has_changed() <p>Django 1.10.</p> <p>Experimenting with forms for learning.</p> <pre><code>The problem is that I can't manage to make form.has_changed() become a False. </code></pre> <p>That is form.has_changed() is always True. The suspicion is that the reason is in DateField. ...
<p>Use a <code>date</code> object in the initial data instead of a string</p> <pre><code> pub_date_data = {'pub_date': date(2015, 1, 1)} </code></pre> <p>Note that the important thing is for the <code>initial</code> value to be a date. If you provide the form data as a string as in the example below, then <code>form....
TortoiseGit: How to logout? <p>I checked out a project from gitlab using username A.(with tortoisegit) Now I'd like to check out an other project from Gitlab with user B. Unfortunately tortoisegit doesn`t ask for my crendentials and just tries to check out with user A. How can I logout user a for my local tortoisegit c...
<p>you have to do it manually refer <a href="https://codeyarns.com/2012/12/04/how-to-set-user-name-and-email-in-tortoisegit/" rel="nofollow">https://codeyarns.com/2012/12/04/how-to-set-user-name-and-email-in-tortoisegit/</a> or use command line git config --user.email "Xyz@xyz.com"</p>
How do I print out individual words within my list? <p>I am trying to print each word from my list onto separate lines, however it is printing each letter onto individual lines</p> <pre><code>Words = sentence.strip() for word in sentence: print (word) </code></pre> <p>My full code (for anyone wondering) is:</p> ...
<p>You forgot to split sentence and use "Words" not "sentence" in first for loop.</p> <pre><code>#file = open("Task2.csv", "w") sentence = input("Please enter a sentence: ") Words = sentence.split() for word in Words: print (word) for s in Words: Positions = Words.index(s)+1 #file.write(str(Words) + (str(...
PHP code is not working inside HTML <p>As all have commented I have changed my code. Now the thing is when I am running my below php code as separate file its running like charm:</p> <pre><code>&lt;?php require("phpsqlajax_dbinfo.php"); </code></pre> <p>$conn = new mysqli($hostname, $username, $password, $database);<...
<p>Remove <code>select</code> inside <code>select</code> and don't mix <code>mysqli_*</code> with <code>mysql_*</code>.Do like below:-</p> <pre><code>&lt;div&gt; &lt;select&gt; &lt;?php require("phpsqlajax_dbinfo.php"); $conn = new mysqli($hostname, $username, $password, $database); ...
Trying to understand Scala enumerator/iteratees <p>I am new to Scala and Play!, but have a reasonable amount of experience of building webapps with Django and Python and of programming in general.</p> <p>I've been doing an exercise of my own to try to improve my understanding - simply pull some records from a database...
<blockquote> <p>How do i signal that the input is complete from the Enumerator callback?</p> </blockquote> <p>You return a <code>Future(None)</code>.</p> <blockquote> <p>How do I get the final result out of the Future to return from the controller view?</p> </blockquote> <p>You can use <code>Action.async</code> ...
Error while adding Xamarin plugin <p>I'm using Xamarin Forms with Visual Studio 2015. I get this error while I'm trying to add a messaging plugin.</p> <blockquote> <p>Severity Code Description Project File Line Suppression State Error Unable to resolve dependencies. 'Xamarin.Android.Support.v4 23.0...
<p>This is a dependency issue. For <a href="https://www.nuget.org/packages/Xamarin.Forms/2.2.0.45">Xamarin.Forms 2.2.0.45</a>, the dependencies are</p> <ul> <li>Xamarin.Android.Support.v4 (= 23.3.0)</li> <li>Xamarin.Android.Support.Design (= 23.3.0)</li> <li>Xamarin.Android.Support.v7.AppCompat (= 23.3.0)</li> <li>Xam...
Fast way of conversion of stl vector<bool> to bool * array <p>Is there some trick which allows to fast convert <code>vector&lt;bool&gt;</code> to <code>bool *</code> array ? I have vector that keeps a lot of cells and I have to convert it to <code>bool *</code> array. I can do it through for loop but it takes a lot of ...
<p>There is no way to do this without copying the data from the vector to a raw array.</p> <p>The reason is because <code>std::vector&lt;bool&gt;</code> only stores one bit per element (albeit stored contiguously). Thus, you cannot use the normal trick, which is...</p> <pre><code>std::vector&lt;Foo&gt; v(10); Foo* p ...
Mocking a private constructor <p>The <code>Site</code> class is provided to me by an external team and has a <strong>private</strong> constructor.</p> <pre><code>public class Site { int id; String brand; private Site(int id, String brand) { this.id = id; this.brand = brand; } } </code></pre...
<p>Here is how you could proceed assuming that your code access to the value of <code>id</code> and <code>brand</code> only through getters:</p> <pre><code>@RunWith(PowerMockRunner.class) public class MyTestClass { @Test @PrepareForTest(SiteUtil.class) public void myTest() throws Exception{ Site m...
Replacing CSV cell values using ForEach-Object -PipelineVariable <p>I have large CSV files in this format (simplified, many more columns)</p> <pre>|Id|Category|Url|</pre> <p>the fields separated with semi-colons. Assuming I have a file with the following data</p> <pre>id;category;categoryUrl 1;Xyz;http://1.com 2;Xyz...
<p>You get an empty file <code>data_categorized.csv</code> because you don't output the rows in the <code>ForEach-Object</code> loop, and as <a href="https://stackoverflow.com/questions/39701690/replacing-csv-cell-values-using-foreach-object-pipelinevariable/39702533?noredirect=1#comment66703524_39702533">@wOxxOm</a> p...
PHash fatal error: 'sys/sysctl.h' file not found <p>I am trying to add c++ native project to my library project.</p> <p>I have followed <a href="https://developer.android.com/studio/projects/add-native-code.html" rel="nofollow">this</a> tutorial</p> <p>and I get <code>fatal error: 'sys/sysctl.h' file not found</code>...
<pre><code>$ find android-ndk-r13/platforms/ -name sysctl.h ../../android-ndk-r13/platforms/android-19/arch-arm/usr/include/linux/sysctl.h more of the same... </code></pre> <p>Android doesn't have <code>&lt;sys...
Pretty print a JSON in Python 3.5 <p>I want to pretty print a JSON file, but popular solutions: <a href="http://stackoverflow.com/questions/12943819/how-to-python-prettyprint-a-json-file">How to Python prettyprint a JSON file</a> dont work for me. </p> <p>Code:</p> <pre><code>import json, os def load_data(filepath):...
<p><code>json.dumps()</code> produces ASCII-safe JSON by default. If you want to retain non-ASCII data as Unicode codepoints, disable that default by setting <code>ensure_ascii=False</code>:</p> <pre><code>print(json.dumps(data, indent=4, sort_keys=True, ensure_ascii=False)) </code></pre> <p>which, for your sample da...
Asynchronous Delay in swift <p>How can I get async delay in swift?</p> <p>I have 3 functions say suppose function first(), second() and third() which are called asynchronously. But after putting delay of 10sec in second() function, the third function is called after 10sec rather than I just want the code inside the fu...
<p>Assume that...</p> <ul> <li>All your functions do not contain any async call, i.e. all instructions in each function follow one another.</li> <li>There's no dependancy between the functions and they can be executed in any order.</li> </ul> <p>... you can use <code>OperationQueue</code> (formerly <code>NSOperationQ...
How to reshape the dimension of data cube in DM with script <p>I have an image with dimensions 1024*1024 stored in a HDF5 file, which is treated as a data cube of slice thickness 1, (so that stored dimension is 1024*1024*1) . I used the Niermann HDF5 plug-in (<a href="https://github.com/niermann/gms_plugin_hdf5" rel="n...
<p>If your input/output array sizes do not match in dimension (such that <code>slice</code> would not work), then you can also 'stream' the data into and out of 1D using the following:</p> <pre><code>number sx = 4 number sy = 5 number sz = 2 image oneLine := RealImage( "1D",4, sx*sy*sz ) oneLine = icol oneLi...
Return attributes of pmax function output <p>I have the following numeric vectors <code>x</code> and <code>y</code></p> <pre><code>x &lt;- c(a=1,b=2,c=3) y &lt;- c(d=2,e=1,f=4) </code></pre> <p>I want to find the parallel maximum of each elements in the vectors, so I used:</p> <pre><code>&gt; pmax(x,y) a b c 2 2 4 ...
<p>One option would be using <code>max.col</code> for finding the index of the maximum value per each row. For that, we need to create a matrix/data.frame by <code>cbind</code>ing the vectors ('xy') and its <code>names</code> ('nmxy'). Create a row/column index ('ij') and subset the elements of 'xy' and set the names ...
Calling class that initiates UI class in python <p>I have an issue while creating my small Python project. I am used to Java and this is still quite new to me. The problem is i create a UI class from QtCreator. Then convert it to <code>.py</code> and import to my project. I have a class that for now is considered <cod...
<p>I'm not exactly sure I understand what you're asking for, but it would seem to be as simple as this:</p> <pre><code>class Main(object): def __init__(self): self.window = MainPanelManager() self.window.show() class MainPanelManager(QtWidgets.QMainWindow, Ui_MainWindow): def __in...
Is apcu_fetch() lookup faster with prefix or suffix? <p>Scenario: - A small number of PHP projects (e.g. websites) using APCu. Each identified by a unique id / hash, which could be e.g. 20 characters long. We call this <code>$site_hash</code> below. - Each project stores a large number of small values stored in APCu, i...
<p>Even if the function uses a hash table, both of your methods can be faster than the other one. I explain:</p> <p>If the $site_hash is used before $key, then the speed depends on the ASCII value of the firsts characters (if the string starts with 'z', it will be slower than if it starts with 'a').</p> <p>And the pr...
Javascript - Copy fading in and out <p>I'm trying to have different quotes fade in and out of the body copy, but also keeping them on the same line. At the moment the quotes will only appear a separate line, rather than the same as the line before.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-cons...
<p>Just add <code>display: inline</code> to this block:</p> <pre><code>.intro h1, .intro h2 { overflow: hidden; vertical-align: top; font-size: 24px; display: inline; } </code></pre> <p>Example...</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class...
How to give constraints to a tableview when tableview cell is on xib. And table view is on storyboard <p>I have a table view on storyboard i.e. FirstStory.Storyboard. And for this tableview I have created a table view cell on xib file where I give size to its width as per my current storyboard width. But when I launch ...
<p>UITableViewCell's contentView property is always the size of the cell. So you have to setup the constraints of your UI components in the xib file with the Cell's contentView properly. The issue you are facing must be because you did not setup these constraints properly.</p> <p>To see which views or constraints have...
sql server migration assistant to mysql not connect to sql server <p>i want to migrate a mysql database to sql server. i have sql server 2008 and i have sql server migration assistant form mysql (SSMA) to do this.</p> <p>when i connect SSMA to mysql connects well, but when i connect to SSMA to sql server tells me this...
<p>Solved, the problem was that sql server not encrypt password, encripting password connects fine</p>
When using static classes in java <p>I am not very familiar with java. I created a jersey web server. There is different functions such as <code>startRodio()</code>, <code>stopRadio()</code>, <code>setRadioIp()</code>... I created one <code>RequestHandler</code> class to handle the <code>http</code> requests and one ot...
<p>I would say, that making properties static in default as you have made above is not good practice at all.</p> <p>If you have only one instance of such object as Radio is, then use <a href="http://www.javaworld.com/article/2073352/core-java/simply-singleton.html" rel="nofollow">singleton pattern</a> and private prop...
Intellij build error: Execution failed for task ':classes' @NotNull instrumentation failed <p>I use Intellij IDEA 2016.2.4 for developing a plugin. When execute the gradle task ("build" for example), I'm having the next error: <code>gradlew build --debug --stacktrace</code></p> <pre><code>[ERROR] [org.gradle.BuildExce...
<p>Fixed it in the last release:</p> <pre><code>IntelliJ IDEA 2016.3 EAP (build 163.5219.11), released on Sep 28, 2016 </code></pre>
Should I avoid `startActivity` outside an Activity class? <p>I've been avoiding calling the <a href="https://developer.android.com/reference/android/app/Activity.html#startActivity(android.content.Intent)" rel="nofollow"><code>startActivity</code></a> method outside a <code>class</code> that <code>extends Activity</cod...
<p>You can call startActivity outside the Activity subclass. As long as you have access to context reference you can call startActivity. In your case either keep a reference of Activity in util class or pass the data back to activity using the interface. </p>
Line two divs side by side with CSS and React <p>As the image shows I have two components that I want to be side by side and lined up. <a href="http://i.stack.imgur.com/d8tnZ.png" rel="nofollow"><img src="http://i.stack.imgur.com/d8tnZ.png" alt="Dashboard"></a></p> <p>I am using React and the component with Negotiatio...
<p>Solution to bring new <code>Newsbox</code> component next to <code>Coursebox</code></p> <p><code> import Coursebox from './Coursebox'; import Newsbox from './Newsbox' class ContainerRow extends React.Component { render(){ return ( &lt;div className='rowC'&gt; &lt;Coursebox /&gt; ...
How to compile this code on ubuntu? <p>this is probably a simple question, but I post it as a question since I can not figure it out. There might be a duplicate somewhere here on stackoverflow, but I could not find any. I am writing code on ubuntu with visual studio code. </p> <p>This is the content of my test.fs fil...
<p>You appear to have called the scala compiler which was called <code>fsc</code> before fsharp - see for example here <a href="http://stackoverflow.com/questions/7965028/error-expected-class-or-object-definition">error: expected class or object definition</a> for a question with that error message which is not an erro...
Advanced GREP / AWK - Export Characters > [X] <p>I have a large log file with over 900k entries. I'd like to do a couple of things using Grep / AWK (if it is even possible):</p> <p>I'd like to export a new txt file for each line entry for the symbol "~". With the conditions:</p> <p>If one line/entry uses the symbol "...
<p>give this one-liner a try:</p> <pre><code>awk -F'~' 'NF&gt;3' file &gt; newFile </code></pre> <ul> <li><code>-F</code> defines the field delimiter. we defined <code>~</code></li> <li>if there were at least two <code>~</code>s, the line should have at least 3 fields</li> <li>if you want the line with exact two <cod...
How can I force to call dynamically added element,s onclick() first <pre><code>&lt;div id="outerDiv" onclick="javascript:addEvent()"&gt; &lt;div id="inner"&gt; &lt;a class='editEV' href="javascript:void(0)"&gt;event1&lt;/a&gt;//*added dynamically from addEvent method.* &lt;/div&gt; &lt;/div&gt; </code>...
<p>You are using both - inline event set <strong>( onclick=.. )</strong> and Jquery <strong>on</strong>. Choose one of them to have more clear code. I would choose jquery <strong>on</strong>, and solution for this problem is to create two events - one on div, second on edit element, but in second We need to stop bubbli...
Shiny app, only showing some graphs <p>I am using shiny app to make some forecast graphs. However, I have a problem that the app only shows some graphs. I am currently using the following code for the server part of the app.</p> <pre><code>server &lt;- function(input, output) { output$graph &lt;- renderPlot({ ...
<p>Put <code>p1a</code> at the end of your <code>renderPlot()</code> chunk outside the <code>if</code> blocks. <code>renderPlot</code> attempts to plot the chunks last expression. In case of <code>input$n3 =="HW"</code> you generate your Plotting object <code>p1a</code> but then continue to evaluate the next <code>if</...
How can I set the Unix epoch of a moment js object? <p>I have a moment.js object whose Unix epoch value I'd like to change. </p> <p>Normally I'd use <code>myMoment = moment(someEpoch);</code>, but because of design constraints I'm having to pass the object by reference, so I must mutate the value rather than replacing...
<p>Assuming <code>m</code> is a moment object, and <code>t</code> is the timestamp to set (in ms), probably the easiest way is:</p> <pre><code>m.add(t-m); </code></pre> <p>Or if you prefer to be more verbose:</p> <pre><code>m.add(t - m.valueOf(), 'ms'); </code></pre> <p>Note that the default units are milliseconds ...
Showing different Footer layouts in RecyclerView <p>I would like to know what is the right way to implement a footer in RecyclerView which can be used to display different views. Few examples are as below</p> <ul> <li>View for network error with a button to reload.</li> <li>View when data is loading from server with a...
<p>RecyclerView is the new view more powerfull than listview, you can make a footer in this but it's for me not the right way. I recommend to create a <strong>layout</strong> include your RecyclerView and add a dedicated view like <strong>Snackbar</strong> or a custom footer.</p> <p>For your question, the RecyclerView...
How do I resolve builtins.ConnectionRefusedError error in attempting to send email using flask-mail <p>I am making a simple WebApp using Flask framework in python. It will take user inputs for email and name from my website (<a href="http://www.anshulbansal.esy.es" rel="nofollow">www.anshulbansal.esy.es</a>) and will c...
<p>You should update configuration before you initialize Mail:</p> <pre><code>app = Flask(__name__) app.config.update( DEBUG = True, MAIL_SERVER = 'smtp.gmail.com', MAIL_PORT = 587, MAIL_USE_TLS = True, MAIL_USE_SSL = False, MAIL_USERNAME = 'your_username@gmail.com', MAIL_PASSWORD = 'your_...
ApplicationContext import in spring <p>I'm learning Spring from this tutorial:</p> <p><a href="http://courses.caveofprogramming.com/courses/the-java-spring-tutorial/lectures/38024" rel="nofollow">http://courses.caveofprogramming.com/courses/the-java-spring-tutorial/lectures/38024</a></p> <p>In this tutorial, instruct...
<p>You have to add dependency</p> <pre class="lang-xml prettyprint-override"><code>&lt;dependency&gt; &lt;groupId&gt;org.springframework&lt;/groupId&gt; &lt;artifactId&gt;spring-context&lt;/artifactId&gt; &lt;version&gt;4.x.x&lt;/version&gt; &lt;/dependency&gt; </code></pre>
Unity Touch and UI Element works together <p>I'm making a 2d platform game. I used UI element for shooting and the character moves by touching on screen. </p> <p>So as to move the character </p> <pre><code>void Update() { if (Input.touches.Length&gt;0) { Touch firstTouch = Input.GetTouch (0); if (...
<p>Instead of using <code>Input.Touch</code>, you can create two large transparent buttons one covering left half of screen and other covering right half of screen. And call move left and move right code in OnClick event of each button respectively. As both buttons will be under your usual UI they wont be triggered if ...
how to pass struct pointer as argument in a variable argument function in C <p>I need to pass a struct pointer in my function which takes variable arguments. What is the correct way to do that. I tried this following code.Just pasting the code snippet, and not the full code.</p> <pre><code>struct node { int label, boo...
<p>Use dynamic array</p> <pre><code>int and_gate(int n, struct vertex *v1) { for(int i = 0; i &lt; n; ++i) printf("%d", v1[0].label); } int main() { int n=3; struct vertex *a; a = malloc(n * sizeof(struct vertex)); and_gate(n, a); } </code></pre>
Javascript Get value from JSON in loop <p>I have the following issue, i want to get all the polyline.points data from json:</p> <pre><code>"legs" : [ { "distance" : { "text" : "115 km", "value" : 115373 }, "duration" : { "text" : "1 hou...
<p>Hey your 'value' variable contains (key, value) pair. so use value['polyline'] to get your data.</p>
passport-saml integration with idp <p>My application need integration with SAML IDP, I am using passport-saml which is for node.js, below is the config</p> <pre><code>passport.use(new SamlStrategy( { issuer: 'http://192.168.1.5/assert', entryPoint: 'https://wwww.aa.com/webservices/public/saml2sso?SPID=http:/...
<p>You should check out this <a href="http://stackoverflow.com/questions/24419814/passport-saml-and-saml-encryption">thread</a> if you haven't already</p> <p>You have attached only the configuration part of your code, but I guess the [authentication callback] (<a href="https://www.npmjs.com/package/passport-saml#provi...
Spring Data Neo4j (4.2.0M1) count Cypher query return type different from embedded DB than for remote one <p>We have found an issue by testing our code where a count cypher query is used. If the test is running against an embedded database (EmbeddedDriver) the returned value within the Result type is a Long (or an Inte...
<p>The question crops up once in a while in various forms (see <a href="https://stackoverflow.com/questions/35772116/how-to-fixedly-assure-neo4j-will-return-a-long-value-for-attribute">this one</a> or <a href="https://stackoverflow.com/questions/33999835/cypher-creates-number-as-a-long-how-do-i-create-an-integer">that ...
C4700 Error and an issue on calling functions <p>I have been assigned a project that I am having trouble figuring out the issue. The project is : "The main() function, which shall ask for input from the user to compute the following: SumProductDifference and Power. There should be a well designed user interface. A void...
<p>Declaring <code>int choice;</code> but in the switch - <code>case '1'</code>? You are reading <code>int</code> but comparing it to a char literal. Either change <code>int choice;</code> --> <code>char choice;</code> or <code>case '1'</code> --> <code>case 1:</code></p> <p>Read about fundamental types in C/C++. Char...
Where clause using included relation in `OR` statement <p>I'm moving a project from MySQL to Postgres using Sequelize, and there is one thing that has failed straight away. It looks to be due to the fact that 'User' isn't included anywhere.</p> <p>Edit: the error message is 'missing FROM-clause entry for table users'...
<p>Try to wrap <code>Users.id</code> with double quotes like <code>"Users"."id"</code>, because in PostgreSQL all unquoted identifiers (table names, fields) will be folded to lowercase and PostgreSQL is case-sensitive: <a href="https://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIER...
Having trouble with PowerShell recurse in VB6 folder <p>I am using a script to build VB6 files. Until now every folder was hard coded which is not the best solution, so I try to change the script to find and build .vbp file from the folder. Unfortunately it isn't even executed. The code is below. <code>$outputfile</cod...
<p>My guess would be issues with the parsing the $_.fullname without enclosing in $(). Try this:</p> <pre><code>Get-ChildItem $folder -Include *.vbp -Recurse | foreach { &amp; vb6.exe /out $outputFile $($_.FullName) /make } </code></pre>
Static Array of the object the array is created in. Is this good or bad? <p>As you can see, I've created (instantiated?) a static array of Corner objects in the object Corner. Is this good form? I want all the Corner object to have access to all the other Corner objects.</p> <pre><code>package Main; public class Corn...
<p>If the amount of <code>Corner</code>s changes you need to create a new bigger array and copy all the <code>Corner</code>s from the old array to the new bigger one. This should indicate to you that you might want to ave a different data structure than an array. One that can grow like a <code>List</code> or a <code>S...
Exact Network time from php application Server to mysql database server <p>I got two servers One is <strong>application server on which PHP application</strong> is running and another server on which <strong>Mysql database</strong> is running. I want to measure time taken for the request send from application server to...
<p>PHP is synchronous so this can be pretty easy. Use something very simple that should return right away.</p> <p>Use <code>microtime(true)</code> to return a timestamp float (before and after).</p> <p>Then it depends on what SQL API you use, but run something like <code>SELECT 1</code>.</p> <p>Then compare the ti...
How to force a TextView to change width to the width of the text in Android <p>I have hints set on my <code>TextViews</code> which have <code>android:layout_width="wrap_content"</code> set and if the text that is typed into the <code>TextView</code> is not as wide as the width of the hint-text, then the <code>TextView<...
<p>Use "ems" with hint length</p> <p>e.g. In XML design</p> <pre><code>android:ems="2" </code></pre> <p>Here for you day_textview has hint "dd", it's length is 2 then android:ems="2"</p> <p>OR, In custom code</p> <pre><code>TextView tvDay = (TextView) findViewById(R.id.day_textview); tvDay.setEms(tvDay.getHint().l...
Control + F4 not working in ubuntu 16.04 <p>Control + F4 option which is used to close current tab in google chrome is not working in ubuntu 16.04.</p>
<p>Try this for closing the tab in chrome:</p> <pre><code>ctrl + w </code></pre>
load file with csv extension in ssis <p>I have to load file with csv extension from one particular folder to data base in ssis. file name is not known but folder and extension is fixed.</p>
<p>To load the content of a file, the file name with folder path is required else the connection manager can not be validated and configured.</p> <p>The easiest way is to get file name is using a For Each Loop container:</p> <ol> <li>Select the option [Foreach File Enumerator]</li> <li>Provide the Folder path and ext...
How to get the number of rows of gtk.ListStore <p>How to get the number of items / rows / length / count of gtk.ListStore in C</p> <p>Here is my sample code:</p> <pre><code> store = gtk_list_store_new (NUM_COLS, G_TYPE_STRING, G_TYPE_UINT); /* Append a row and fill in some data */ gtk_list_store_append (store, ...
<p>Use gtk_tree_model_iter_n_children to obtain the number of rows in the list store.</p> <p>In your case</p> <pre><code>number_of_rows = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store), NULL); </code></pre> <p><a href="https://developer.gnome.org/gtk2/stable/GtkTreeModel.html" rel="nofollow">gtk_tree_model_ite...
Message sent by server are not receiving on the client side <p>The message coming from one client is coming to the Java server. When a server sends this message to the another client, server showing "message sent" but that message is not received by the client in ws.onmessage block.</p> <p><div class="snippet" data-la...
<p>Thank you all for response to my question. The actual problem was because of my Redhat cloud. Cloud server was very slow that is why this problem came. When I tried to restart my server, that data was coming properly on my ws.onmessage block.</p>
Selenium return IWebElement by button text <p>I have button on a webpage that looks like this:</p> <pre><code>&lt;button type="button" class="btn btn-primary btn xs-width-100" onclick="startScreening(0, 'A', 'UK');"&gt;Start Screening&lt;/button&gt;` </code></pre> <p>This button has a very similar structure to other ...
<p>Why not use css?</p> <p><code>button[onclick*='startScreening']</code> or<br> <code>button[onclick*='startScreening'][onclick*='UK']</code></p>
import data from OpenOffice Calc spreadsheet <p>I'm using OpenOffice Calc and NEO4J and I'm trying to import data from spreadsheet.</p> <p>I have this structure: <a href="http://i.stack.imgur.com/xGNSf.png" rel="nofollow"><img src="http://i.stack.imgur.com/xGNSf.png" alt="enter image description here"></a></p> <p>I'v...
<p>So the formula <code>"create n:"&amp;A2&amp;"{id:"&amp;A2&amp;",name:"'&amp;B2&amp;"'};</code> when evaluated against the spreadsheet data sheet, will evaluate to (if it even evals):</p> <pre><code>create n:1{id:1,name:Maria'}; </code></pre> <p>Which isn't valid due to the mismatching quotes, missing parenthesis a...
Mutating self (struct/enum) inside escaping closure in Swift 3.0 <p>In swift 2.2, We could mutate a struct or enum within a closure, when it was inside a mutating function. But in swift 3.0 its no longer possible. I get the following error</p> <blockquote> <p>closure cannot implicitly captured a mutating self parame...
<p>Yeah, you can do something like this.</p> <pre><code>struct Point { var x = 0.0, y = 0.0 mutating func moveBy(x deltaX: Double, y deltaY: Double) { x += deltaX y += deltaY test { (a) -&gt; Void in self.x = Double(a) } } mutating func test(myClosure: (...
Google Awareness API v9.6 is missing <p>I'm interested in new maps styling feature, which is added in 9.6 Google Play Services release, but also I'm using Awareness API. In my <code>build.gradle</code> I have</p> <pre><code>compile 'com.google.android.gms:play-services-maps:9.6.1' compile 'com.google.android.gms:play-...
<p>Starting 9.6.0 it was renamed to "awareness", so you should use</p> <pre><code>compile 'com.google.android.gms:play-services-awareness:9.6.1' </code></pre> <p>You can check it in "Google Repository rev 35", simply navigate to: </p> <pre><code>ANDROID_HOME/extras/google/m2repository/com/google/android/gms </code><...
How to keep the connection pool from closing with a java driver on a mongodb? <p>I'm in the middle of upgrading from java driver 2.12.3 to 3.3.0. Curiously it seems that the collection pool is suddenly "acting up". </p> <p>My set up is as follows:</p> <p>The Connection is established in the main thread:</p> <pre><co...
<p><a href="https://api.mongodb.com/java/3.1/com/mongodb/MongoClientOptions.html" rel="nofollow">https://api.mongodb.com/java/3.1/com/mongodb/MongoClientOptions.html</a></p> <p>look at the link. there are several method that can probably help you. look into the timeout related methods for connection and connection poo...
Laravel shows parameter name instead of value (when using optional parameter in route) <p>I've got a form where a user can enter a start location, when submitting he will go to a map centered on this location. He can also just skip this step and go to the map directly. (this is the simplified version to skip the whol...
<p>Your routes work as expected. Keep in mind that <strong>{startLocation?}</strong> is not part of the URL, but a placeholder that will be <strong>replaced</strong> by the actual value of the parameter.</p> <p>Therefore, your <strong>Route::get('Map/{startLocation?}', ...);</strong> route says that <strong>startLocat...
Pin/Focus a ToolTip in WPF <p>In Eclipse I can focus a ToolTip by pressing F2 while it's open. It converts into a separate Popup, stays open as long as I want and I can resize it.</p> <p>How can i get this to work in WPF? </p> <p>Tooltips close themselves after 5 seconds, which makes sense for most of them. I don't t...
<p>Since this gave me a sleepless night i've made an (more or less) simple generic approach to solve this for now and forever.</p> <p>The following solution is based on Style-Behaviors, which require a bit of preperation sine there is nothing built in.</p> <p><strong>Make Styles accept Behaviors</strong></p> <pre><c...
How to select image from memory in Android <p>This is my code:</p> <pre><code>Intent in = new Intent(Intent.ACTION_PICK,android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); startActivityForResult( in, SELECT_PICTURE); public void onActivityResult(int requestCode, int resultCode, Inte...
<p>You are getting an error on Android 6.0.1 because Marshmallow version requires to follow permission model.</p> <p>You should be checking if the user has granted permission of external storage by using:</p> <pre><code>if (Build.VERSION.SDK_INT &gt;= 23) { if (checkSelfPermission(android.Manifest.permission.WRITE_...
Find the name of the caller in hyperledger <p>How would I find the name of the user invoking chaincode in hyperledger?</p> <p>in v0.5 this information was included in the transaction certificate however in v0.6 the 'common name' attribute has been changed to just say "Transaction Certificate" - the name has been remov...
<p>This is totally intentional to exclude <code>enrollID</code> from the subject of transaction certificate this is because <code>tcerts</code> are used for <strong>unlinkability</strong>.</p> <p>You can read <a href="https://github.com/hyperledger-archives/fabric/issues/1409" rel="nofollow">this</a> for more informat...
Not able to access ajax post request parameters in struts2 controller class <p>I am implementing simple login logic in my application. I have created a login.html and login.js files. In logins.js i am making a ajax post request and passing userId and password to struts controller class but both the values are null in m...
<p>There are a couple of things mising.</p> <p>1) If you need to send JSON to the Action, <code>you need the JSON Interceptor in your Interceptor Stack</code> to decode it correctly. You have only defined the JSON Interceptor, you've not applied it (along with the defaultStack) to the action; do it like follows:</p> ...
Deploying grails project in tomcat server <p>I'm getting the Valiate Jar file error when deploying the application in tomcat 7.0.57.Chaning the tomcat version to 8 is the only solution for this problem? This is my Error log:</p> <blockquote> <p>org.apache.catalina.loader.WebappClassLoader validateJarFile INFO: vali...
<p>Go to your build.gradle file and change</p> <pre><code>compile "org.springframework.boot:spring-boot-starter-tomcat" </code></pre> <p>to</p> <pre><code>provided "org.springframework.boot:spring-boot-starter-tomcat" </code></pre> <p>Then your war will deploy to Tomcat 7 as well.</p>
Memory Issue in angular Js Application <p>I am facing memory leak issue in angular js application. I have tried all the possible solutions like profile tool, timeline and some other tools related to angular js. My Work till now -</p> <p><strong>Profile Tool</strong></p> <p>In profile tool JS heap is keep on getting i...
<p>AngularJS has memory leaks when there are many bindings. Now limitation of angularJS is that it has 2-way binding. So, if you change any value in model, view that triggers $diget(), $watch() loop. So, depending upon how big your application is it consumes memory.</p> <p>I suggest to try couple of steps:</p> <ul> <...
How to add padding for vertical line shape in android <p>I have a layer-list background for my view</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;layer-list xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;item&gt; &lt;shape&gt; &lt;solid android:color="@color/white"/&gt...
<p>Here is link which is create online button or any view shapes Link : <a href="http://angrytools.com/android/button/" rel="nofollow">http://angrytools.com/android/button/</a></p> <p>Here is code like : </p> <pre><code>&lt;shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" &gt...
Remove last occurrence of string in list <p>Is it possible to remove the last occurrence of a string from a list using Linq? Something like this:</p> <pre><code>var arr = "hello mom hello dad".Split(' ').ToList(); //hello mom hello dad arr.RemoveLast(x =&gt; x.Contains("hello")); //hello mom dad </code></pre> <p>Basi...
<pre><code>list.RemoveAt(list.FindLastIndex(x =&gt; x.Contains("hello"))); </code></pre> <p>This above will remove last string that contains "hello" in it. If there's a possibility that none of the string items satisfies the search condition, and the code in that case should do nothing, then it's like this:</p> <pre>...
Google login works on localhost and test server, but not azure website (app service) <p>I am having a problem with signing in users with google on an Azure website using OWIN. Everything works fine localhost and on our test server, but when I deploy to our Azure website, the login fails.</p> <p>I am using web api and ...
<p>I finally found the problem. It was an unhandled exception in the "OnAuthenticated" event. It took some time to find the problems, because this line:</p> <pre><code>HttpContext.Current.GetOwinContext().GetUserManager&lt;ApplicationUserManager&gt;(); </code></pre> <p>Sometimes failed on azure. I changed alot of cod...
Compare object values after typecasting <p>I am passing a two values that needs to be compared as string format, but their actual types are different.</p> <p>So, i call a typecast function which will typecast the given value and return an object.</p> <pre><code>public object typeCast(columnDataType,columnFormat,colum...
<p>Problem 1: You cannot use <code>&lt;</code> or <code>&gt;</code> operators on reference types. Possible solution: Use the <code>Comparable&lt;T&gt;.comparteTo(T)</code> method.</p> <p>Problem 2: The <code>Object</code> class does not implement <code>Comparable</code>. Possible solution: Return a <code>Comparabl...
Angular 2/Typescript 2/ASP.Net Core @angular/core not recognised <p>I am new to Angular and TypeScript. I am trying to run an angular app inside ASP.Net core project. It was working fine when running on TypeScript 1.8. I need to upgrade to TypeScript 2 since I wanted to use ng2-bootstrap and then the application comple...
<p>Thanks all. </p> <p>I am still not sure why the angular and other packages are not getting recognized and the red squiggly lines are appearing. The build using Visual Studio is still failing with these errors.</p> <p>However, I am able the execute the code. I just select the last working build option in VS and sin...
Can not install RealmSwift with cocoapods <p>Every time I am trying to install RealmSwift with cocoapods gives me <code>[!] /bin/bash -c set -e sh build.sh cocoapods-setup</code> error. I have updated to xcode 8 and cocoapods to 1.1.0 however when I try from another mac with older cocoa RealmSwift 1.0.2 is getting i...
<p>Open terminal and hit this command </p> <pre><code>$ [sudo] gem install cocoapods </code></pre> <p>It will simply update CocoaPods version of your system. And then try to install Realm using this. </p> <p>Add this piece of code to pods file,</p> <pre><code>post_install do |installer| installer.pods_project.tar...
How to use multiple FirebaseMessageListeners in an android app? <p>I have done this using GCM but since I am not able to found out GCMReceiver kind thing in Firebase. </p> <p>I am using an SDK called Clevertap that has its own FirebaseMessageListenerService. I have also onother such service in my app. Now, when I incl...
<p>I was not able to find solution for the question. But I was able to rectify this particular use case.</p> <p>I used following code to handle notification:</p> <pre><code>Map data = message.getData(); if(data.containsKey("wzrk_id")) { //'wzrk_id' is a key in message from clevertap Bundle bundle = new Bundle()...
concourse ci does not trigger on certain committed files <p>First, I do know that if I use <code>[ci skip]</code> in the commit message to GitHub it should not trigger based upon the commit message. However, I am only committing one file to GitHub. So instead of using this commit message, is there a way to exclude cert...
<p>See <code>ignore_paths</code> in the Git resource docs:</p> <p><a href="https://github.com/concourse/git-resource#source-configuration" rel="nofollow">https://github.com/concourse/git-resource#source-configuration</a></p>
iOS 10: NSFetchedResultsController + UICollectionView, SIGABRT on performBatchUpdates <p>I'm using this <a href="https://gist.github.com/iwasrobbed/5528897" rel="nofollow">gist</a> for FRC and <code>UICollectionView</code>. This was working fine till <strong>iOS 9</strong>.</p> <p>Now, in <strong>iOS 10</strong> somet...
<p>After doing some research, found a fix for this. My app fetches data from a web server and inserts it using <strong>main thread</strong>.</p> <p>I assumed that this signal is getting raised because of some kind of invalid data manipulation. As I doubted <code>controllerDidChangeContent</code>( <strong>main thread</...
ajax call function with parameters in mvc <p>I am very new to this, what I am trying to do is use ajax to call a controller function from view, this is my controller.</p> <pre><code>public ActionResult EditSiteGetContact(int? id) { if (id == null) { return new HttpStatusCodeResult(Http...
<p>Add [HttpPost] attribute before EditSiteGetContact(int? id).</p> <p>In the ajax function change<br> var contactId = @Model.Org.ContactId; to var contactId = "@Model.Org.ContactId";</p> <p>Please see below code. It may help you.</p> <pre><code>$("#alanTest").ready(function(){ var alanURL = "@Url.Action("EditS...
Convert UTC to Local Timezone in Oracle PL/SQL <p>how to convert UTC to local time with Oracle PL/SQL? My data provider send me following: </p> <pre><code> &lt;EndDateTime&gt;"2016-09-26T08:00:00Z"&lt;/EndDateTime&gt; </code></pre> <p>and I would like to convert it to "Berlin" Time. I've searched here for an answe...
<p>Something like that should help You:</p> <pre><code>SELECT FROM_TZ( CAST( TO_DATE('2000-01-01T11:00:00Z','YYYY-MM-DD"T"HH:MI:SS"Z"') AS TIMESTAMP ), 'Greenwich' ) AT TIME ZONE 'Europe/Berlin' as converted_timestamp FROM DUAL; </code></pre> <p>Where <em>2000-01-01T11:00:00Z...
Angular2 need to click twice to retrieve JSON and generate HTML <p>In my template I have a button to trigger the following method:</p> <pre><code>getResults() { this.resultService.getResultsAsTree(this.disk1.id, this.disk2.id, this.mode) .subscribe( results =&gt; this.json = results...
<p>Solution for your problem:</p> <pre><code>getResults() { this.resultService.getResultsAsTree(this.disk1.id, this.disk2.id, this.mode) .subscribe( results =&gt; this.json = results, // what to do with result error =&gt; this.errorMessage = &lt;any&gt;error), // what to do if you g...
Sugarcrm Dependent Field Formula <p>In SugarCRM I'm trying to make a dependent field that will be visible if the Dropdown is equal to "Specialist".</p> <p>But I see the dependent field while loading the page itself in that tab.</p> <p><strong>The Dependent field is in different TAB is that a problem?</strong></p> <p...
<p><a href="http://support.sugarcrm.com/Knowledge_Base/Studio_and_Module_Builder/Sugar_Logic/Dependent_Field__Display_Based_on_List_Values/" rel="nofollow">Reference Link </a></p> <p><strong>Dependent Field - Display Based on List Values Overview</strong></p> <p>Dependent Fields use Sugar Logic to control the fields'...
Chaining together akka stream flows that each make HTTP requests <p>I have a restful blog server (<a href="http://jsonplaceholder.typicode.com" rel="nofollow">http://jsonplaceholder.typicode.com</a>) that responds to these two URIs</p> <pre><code>/posts/{id} : get a blog post by ID /comments?postId={id} : ge...
<p>There is a very good <a href="http://danielwestheide.com/blog/2012/12/26/the-neophytes-guide-to-scala-part-6-error-handling-with-try.html" rel="nofollow">blog entry</a> for dealing with <code>Try</code>. In your particular example I would preserve the <code>Try</code> so you can get information on the original fail...
Dynamic templateUrl by using attrs in Angularjs <p>We are currently using the code labeled <strong>#2</strong> but want to use the code labeled <strong>#1</strong> and would like to confirm if there would be any negative side impacts or issues.</p> <pre><code>// #1 &lt;my-thumb my-type="'type01'"&gt;&lt;/my-thumb&gt; ...
<p>You can add conditions on your <code>templateUrl</code> just like this :</p> <pre><code>app.directive('myThumb', function() { return { restrict: 'E', templateUrl: function(elem, attrs) { if (attrs.type === 'type01') { return 'components/thumb.type01.tpl.html'; } else if (at...
How use hostvars from multiple hosts in one variable in Ansible? <p>I want to add more servers to Aerospike cluster. For that i want to use facts from gather_facts. Here the example how i do it for one server. How i can add all hosts which works with my playbook ? I don't want to use hosts from groups in inventory - be...
<p>Your question is a little vague. I would suggest writing a dynamic inventory script (<a href="https://docs.ansible.com/ansible/developing_inventory.html" rel="nofollow">https://docs.ansible.com/ansible/developing_inventory.html</a>)</p> <p>That said if you're insistent about using facts to dynamically generate inv...