input
stringlengths
51
42.3k
output
stringlengths
18
55k
Youtube API: Revert video thumbnail to the default thumbnail <p>I am trying to revert the thumbnail of youtube videos, via the v3 API, to the thumbnail that is automatically generated by YouTube from a screenshot of the video when it's uploaded.</p> <p>So, basically, I wanna delete the custom thumbnail I uploaded.</p>...
<p>The only thing I can think of is that you grab one of the three automatically generated thumbnails:</p> <pre><code>http://img.youtube.com/vi/{video_id}/1.jpg http://img.youtube.com/vi/{video_id}/2.jpg http://img.youtube.com/vi/{video_id}/3.jpg </code></pre> <p>You could then upload either of them via the API. Unfo...
multi-level sort and displaying details <p>The task I have at hand is "Write a SQL Statement to find the number of sessions scheduled for each screen in every branch. Display the screen details (id of branch and screen) and their corresponding number of sessions. Perform a multi-level sort with branchid and the number ...
<pre><code>select screenid, branchid, count(1) as no_of_sessions from screen A join session B on B.screenid = A.screenid and B.branchid = A.branchid group by screenid, branchid order by branchid, no_of_sessions ; </code></pre> <p>First, you join the two tables on <code>screenid</code> and <code>bra...
d3 4.0 - import statement gives __moduleExports wrapper <p>I'm having trouble with an import statement in D3 4.0 and Ionic2/Angular2 project.</p> <p>I believe I am using the correct import statement, and everything compiles. </p> <pre><code>import * as d3Request from 'd3-request'; export class HomePage { constr...
<p>The <code>unwrapExports(...)</code> and <code>__moduleExports</code> indicate that you're importing a CommonJS file (and transforming it with <a href="https://github.com/rollup/rollup-plugin-commonjs" rel="nofollow">rollup-plugin-commonjs</a>), not the ES module version. It's odd that it doesn't work, but no matter ...
UPDATE query is not working in DBI <pre><code>use DBI; my $jobID = 1; $dbh = DBI-&gt;connect("dbi:mysql:$database:$db_server", $user, $password) or die "Connection ERROR!"; $dbh-&gt;do('USE MultiRunScheduler'); $dbh-&gt;do('UPDATE Scheduler SET RequestStatus="CANCELED" WHERE ID="$jobID";') print "Scheduled Jobs delet...
<p>Perl does not expand variables inside single-quoted strings.</p> <p><a href="http://perldoc.perl.org/perldata.html#Scalar-value-constructors" rel="nofollow">http://perldoc.perl.org/perldata.html#Scalar-value-constructors</a> says in part:</p> <blockquote> <p>String literals are usually delimited by either single...
Generic Json To Object transformer <p>Is there any way to set the value of "type" attribute of a JsonToObject transformer dynamically ? For ex, A message header will tell you the target Java Object to which incoming Json payload should be converted to. Something like,</p> <pre><code>&lt;int:json-to-object-transformer ...
<p>Starting with version 3, the JTOT uses similar headers to the Spring AMQP JSON message converters. See <a href="https://github.com/spring-projects/spring-integration/blob/master/spring-integration-core/src/main/java/org/springframework/integration/mapping/support/JsonHeaders.java#L39" rel="nofollow"><code>JsonHeader...
TYPO3 meta description - Use closest <p>I have set the description meta using:</p> <pre><code>page.meta.description.field = description </code></pre> <p>Can I make it so child pages use the description from the closest page that has one set?</p> <p>So if the root page has description1 then all sub-pages use it, unle...
<p>two parts: </p> <ol> <li><p>in your typoscript: </p> <p><code>page.meta.description.data = levelfield:-1, description, slide</code></p></li> <li><p>in your Install-Tool add the field to the fields which should slide:</p> <p><code>$GLOBALS['TYPO3_CONV_VARS']['FE']['addRootLineFields'] = 'description';</code></p>...
Get unique records where column type is JSONB <p>I have a complicated Postgres query I'm trying to make, mainly because my columns / data is in the JSONB type.</p> <p>I need to get all records</p> <ul> <li>where <code>Auth.status</code> is <code>valid</code></li> <li><code>UserId</code> is <code>1</code></li> <li>Exc...
<pre><code>WITH sample_table AS ( SELECT "userId", p."Auth"-&gt;&gt;'status' as "authStatus", p."Detail"-&gt;'"reference"'-&gt;'card'-&gt;&gt;'number' as "referenceCardNumber", FROM my_table p ) SELECT DISTINCT ON ("referenceCardNumber") "referenceCardNumber", * FROM sample_table WHERE ...
javascript: Alter the output of a function to the specified demical place <p>I am not very good with my javascript but recently needed to work with a library to output an aggregated table. Was using <a href="https://github.com/openfin/fin-hypergrid" rel="nofollow">fin-hypergrid</a>.</p> <p>There was a part where I nee...
<p>you may try:</p> <pre><code>(rollups.sum(11)).toFixed(2) </code></pre> <p>enclosing number in parentheses seems to make browser bypass the limit that identifier cannot start immediately after numeric literal</p> <p>edited #2:</p> <pre><code>//all formatting and rendering per cell can be overridden in here dataMo...
scala futures execution in parallel using for-loop <pre><code>package p1 import scala.util.Failure import scala.util.Success import scala.concurrent.Await import scala.concurrent.Future import scala.concurrent.ExecutionContext.Implicits.global import scala.concurrent.duration._ object modCheck extends App { def get...
<p>Future starts computation when it's created.</p> <p><code>for (a &lt;- x; b &lt;- y) yield ???</code> is desugared to <code>x.flatMap(a =&gt; y.map(b =&gt; ???))</code> <code>flatMap()</code> and <code>map()</code> execute it's argument after a Future is completed.</p> <p><code>getDetails()</code> can start before...
web services throwing errors intermittently <p>I have a web service running on server but once in a while it throws an error. This is happening when calling one particular method and all other method works fine but on calling this method I receive following error:- </p> <blockquote> <p>An error occurred while receiv...
<p>I've also encountered that error. I encountered that error when almost thousands of user simultaneously accessing the web service.</p> <p>I put this piece of code..</p> <pre><code> ServiceClient = new ServiceClient (); var customBinding = new CustomBinding(ServiceClient.Endpoint.Binding); var transportElement =...
Programmaticaly find next state for max(Q(s',a')) in q-learning using R <p>I am writing a simple grid world q-learning program using R. This is my grid world</p> <p><a href="http://i.stack.imgur.com/I4RQD.png" rel="nofollow"><img src="http://i.stack.imgur.com/I4RQD.png" alt="enter image description here"></a></p> <p>...
<p>(The comments in your code don't correspond to what you are actually doing. Try to avoid this always.)</p> <p>You are conflating the transition and the reward matrices. For a non-stochastic environment, they should look something like this:</p> <pre><code>R &lt;- matrix(c( -1, -1, -1, -1, -1, -1, -1, -1, ...
How do I find the smallest number in a list of random integers on Python without using min()? <p>I'm trying to figure out why this code isn't working! The only part not working is the smallestNumber, it always comes back at zero? What am I doing wrong?</p> <pre><code>import random X = random.randint(10,15) pickedNu...
<p>There are several problems with your code that I won't address directly, but as for finding the smallest item in a list of integers, simply sort the list and return the first item in the list:</p> <pre><code>some_list = [5,7,1,9] sorted_list = sorted(some_list) smallest = sorted_list[0] &gt;&gt;&gt; smallest 1 </co...
How to override the existing content inside the HTML element by jQuery <p>I want to override the existing content inside the HTML element. I tried with method append() to the element but then it only append content to the existing, I was wonder is there anyway to override the whole content in the element ?</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>$('input.append').click(function() { $('span').append('append') }) $('input.html').click(function() { $('span').html...
How to execute test Method by gradle test task? <blockquote> <p>When i run my testing.xml as testNG suit its run properly but when run gradle test task it doesn't execute test</p> <p>testing.xml</p> </blockquote> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE suite SYSTEM "http://testng....
<p>As option you can generate xml directly in gradle in test task, it works fine in our project</p> <pre><code>useTestNG() { suiteXmlBuilder().suite(name: 'Default suite') { test(name : 'test') { classes('') { 'class'(name: 'com.example.EmpBusinessLogicTest') } ...
Dagger2 : Cannot find symbol @Autofactory classes <p>I want to migrate my project from dagger 1 to dagger 2. after adding dagger 2 dependent libraries i am getting " error: cannot find symbol class MyClassFactory" error for all @Autofactory classes in my project. However i see that these classes are generated but not...
<p>You probably have other compilation failures which block AutoFactory from generating any code. Try looking through the entire error log or increasing the error count as a javac flag to see if there's a dagger issue. This works in general - we have a dagger+ AutoFactory integration test</p>
Java Jenkins.war error <p>I install jenkins on my mac os X 10.6.8, after successfully install jenkins, I browse it in the browser with the default address <a href="http://localhost:8080" rel="nofollow">http://localhost:8080</a> but the tomcat page display not the jenkins home page. I read the documentaion on jenkins ...
<p>You should be able to deploy Jenkins out of the box, just go to:</p> <p>localhost:8080/html</p> <p>Select you jenkins.war and thats it.</p> <p>Just be sure you can deploy files with that size.</p> <p>You can follow up this link:</p> <p><a href="https://maxrohde.com/2011/04/27/large-war-file-cannot-be-deployed-i...
Could not find method android() for arguments in Android Studio 2.2 Windows 7 32bit <p>I am new to Android Studio. While trying to build first android app I got stuck with this issue.</p> <p>See the attached screen-shot</p> <p><a href="http://i.stack.imgur.com/McTGM.jpg" rel="nofollow">my-application-screen-shot</a><...
<p>I found something similar already asked, I dont know if it is a duplicate but have a look at this link, it might be the solution. It looks like something with the Gradle version or build you are using.</p> <p><a href="http://stackoverflow.com/questions/37250493/could-not-find-method-android-for-arguments">Could not...
select all products and join main category through sub-categories (unknown level) <p>I have 2 tables</p> <p>Categories</p> <pre> id - name - parent 1 - Category A - 0 2 - Category B - 0 3 - Category C - 0 4 - Category D - 0 5 - Subcategory Of 1 - 1 6 - Subcategory Of 5 - 5 7 - Subcategory Of 5 - 5 </pre> <p>Product<...
<p>As you want the complete path to a category, you can't start your non-recursive part with <code>c.id = 5</code> you have to start at the root using <code>where parent_id is null</code> (you should <strong>not</strong> identify the root nodes with a non-existing category ID, that prevents creating a proper foreign ke...
SGPLOT Procedure STYLEATTRS Statement <p><a href="http://support.sas.com/documentation/cdl/en/grstatproc/67909/HTML/default/viewer.htm#p1dt33l6a6epk6n1chtynsgsjgit.htm" rel="nofollow">Official document</a> said 6 style options are available</p> <pre><code>BACKCOLOR=color DATACOLORS=(color-list) DATACONTRASTCOLORS=(...
<p>BACKCOLOR is only available as of SAS 9.4 TS1M3. You have TS1M1. </p> <p>See the Note in the documentation you linked to under BACKCOLOR. </p> <p><a href="http://i.stack.imgur.com/RWajI.jpg" rel="nofollow"><img src="http://i.stack.imgur.com/RWajI.jpg" alt="Documentation Note"></a></p>
Cassandra : cant see any progress with the insertion of data <p>Am newbie to cassandra. My process workers are trying to insert into the cassandra db. After some few hours I cant see any progress of insertion.</p> <p>My debug logs are saying the below across nodes of cassandra:</p> <blockquote> <p>WARN [SharedPool...
<p>A batch is used in Cassandra to "bundle" related operations in a single execution, similar to a explicit transaction in a relational database.</p> <p>If what you want is to upload large volumes of data into Cassandra, you can use <a href="https://docs.datastax.com/en/cassandra/3.x/cassandra/tools/toolsBulkloader.ht...
Generate table using jquery <p><a href="http://i.stack.imgur.com/36ogy.png" rel="nofollow"><img src="http://i.stack.imgur.com/36ogy.png" alt="Updated Image"></a></p> <pre><code> var months = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "Dece...
<p>You should use a binding library such as Knockkout, when your drop down changes, build a view model with the month and empty value.</p> <p>ex: Include KnockoutJS in your page, download it from here <a href="http://knockoutjs.com/" rel="nofollow">http://knockoutjs.com/</a></p> <p>build a model, ex:</p> <pre><code>...
Data saving and data reading ( C Programming ) <p>The code below will ask for input, and is supposed to print it after. <br><br>However, I've encountered several problems.<br><hr><strong>Problems</strong></p> <ul> <li>program stops working after I confirm the entry.</li> <li>when it is supposed to print the input, it ...
<p>Your program prints "weird symbols" because <code>t1</code> is never initialized in the <code>printing</code> function.</p> <p>Here you never read from file:</p> <pre><code>void printing () { struct text t1; FILE *fp; fp=fopen(fname,"r"); // Missing read from file printf("\nName: %c",t1.name)...
Eclipse Oomph windows 64 bit installer downloading linux tools <p>I am installing eclipse using Oomph installer tool provided, I am seeing in logs that linux tools are getting downloaded which is taking time as well. I would like to understand the reason and if we are installing eclipse using Oomph we are not sure of w...
<p>Java lives on dependencies. For instance, bouncycastle is a crypto library. It's used for many things, including securing connections. It's probably a dependency of at least 10 other tools in Eclipse.</p> <p>Whenever a Java tool in Eclipse declares a dependency, the installer is going to go out to a public reposito...
Image slideshow useing Python ttk <p>I am looking for a way to display multiple photos in a slide show format.</p> <p>I have not tried anything as I have no idea of what I'm doing to get to that stage as there is no information anywhere that solves my problem.</p> <p>thank you. </p>
<p>NOT MY OWN CODE, TAKEN FROM <a href="https://www.daniweb.com/programming/software-development/code/468841/tkinter-image-slide-show-python" rel="nofollow">https://www.daniweb.com/programming/software-development/code/468841/tkinter-image-slide-show-python</a>`</p> <pre><code>''' tk_image_slideshow3.py create a Tkint...
Using Python to Read Rows of CSV Files With Column Content containing Comma <p>I am trying to parse this CSV and print out the various columns separately.</p> <p>However my code is having difficulty doing so possibly due to the commas in the addresses, making it hard to split them into 3 columns.</p> <p>How can this ...
<p>If you just want to parse the file, I would recommend using <a href="http://pandas.pydata.org/" rel="nofollow">Pandas Library</a> </p> <pre><code>import pandas as pd data_frame = pd.read_csv("city.csv") </code></pre> <p>which gives you a data frame that looks like this in iPython notebook. <a href="http://i.stack....
Is it possible to check for global variables in IPython when running a file? <p>I have a file like so:</p> <pre><code>import pandas a pd def a_func(): print 'doing stuff' if __name__ == "__main__": if 'data' not in globals(): print 'loading data...' data = pd.read_csv('datafile.csv') </code><...
<p>Everytime a python file is executed the globals() dictionary is reset by the interpreter. So if you will try to do something like </p> <pre><code>print globals().keys() </code></pre> <p>you can see that 'data' is not in globals. This dictionary gets updated as the program runs. So I don't think you can refer to th...
Mod rewrite refer 500 internal error error <p>I have written an rewrite rule for a folder in my website.</p> <p>its looks like this : </p> <pre><code>#page rewrites RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^([\w-]+)/note $...
<p>When you get a 500 error code there should be something in the error log. If there is nothing then it is the PHP that is being executed and crashing.</p> <p>The second argument to <code>ErrorDocument</code> is the HTTP return code. So you can use <code>ErrorDocument 500</code> to override the default page.</p> <p>...
High latency between the azure web app and azure sql database <p>I create azure web app in west europe and azure sql database in west europe. When app connecting to sql database and execute simple select it takes 4 sec (even in local cheap hosting it takes 200-300ms). Its horrible. I create MySQL clear db and the same ...
<p>First what you can try is to scale your pricing plan on database server and App service. Besides, Azure has build in tool - Database Advisor, which can help you to fix your possible db issues (like add index). Finally - check out database metric (there is possibility to edit chart) to know for sure that this is netw...
How the transcript of a video should be visible to accomplish WCAG 2.0? <p>I'm building a website that has to achieve the AA Conformance to WCAG.</p> <p>We are going to provide videos and to do it right there has to be a transcript of this video, my question is, in html were is the correct order to put this transcript...
<p>Ideally, the transcript should be placed before the video. There is no tag specifically for transcripts - you will need to mark up the speech and descriptions using paragraph tags and any other useful markup like headings, strong, emphasis, etc. I like to use a link just above the video to show/hide the transcript s...
Sed Command modification to make it work <p>In sed I just want to replace a range of text to a blank space from 13 to 21 line number and print rest all the line as it is. Please help me out.</p>
<p>If you want to delete lines 13 through 21</p> <pre><code>sed -i '13,21d' file </code></pre> <p>That will remove the lines from the file, if you don't want to actually delete them, but just remove them from your output</p> <pre><code>sed -e '13,21d' file </code></pre>
How to view the source code of numpy.random.exponential? <p>I want to see if <code>numpy.random.exponential</code> was implemented using F^{-1} (U) method, where F is the c.d.f of exponential distribution and U is uniform distribution. </p> <p>I tried <code>numpy.source(random.exponential)</code>, but returned '<em>No...
<p>numpy's sources are <a href="https://github.com/numpy/numpy" rel="nofollow">at github</a> so you can use github's <a href="https://github.com/numpy/numpy/search?utf8=%E2%9C%93&amp;q=exponential" rel="nofollow">source-search</a>.</p> <p>As often, these parts of the library are not implemented in pure python.</p> <p...
How to track recurring payment details with paypal in php? <p>I am using paypal as my payment gateway in one of my cakephp 3.3. </p> <p>I have already done with recurring payment and it is working fine.But i am not able to track every payment of specific user after the recurring payment start.</p> <p>So please help m...
<p>Take a look at <a href="https://developer.paypal.com/docs/classic/products/instant-payment-notification/" rel="nofollow">Instant Payment Notification (IPN)</a>. </p> <p>Each time a transaction occurs on your PayPal account, PayPal will send a POST request of the transaction data to a URL that you specify. </p> <...
How to insert using different table based on condition in same query <p>I am merging data in one table from tables of 2 database. Structure is as per below:</p> <blockquote> <p><strong>Table in new Database</strong> :</p> <p>User Table : {UserName,Email}</p> <p><strong>Table in Database1</strong> :</p> ...
<p>I think you are in need of this.. :)</p> <p>Try modifying it accordingly..</p> <pre><code>declare @Email_1 nvarchar(100),@Email_2 nvarchar(100),@UserName nvarchar(100),@Lastlogin_1 datetime,@Lastlogin_2 datetime,@loop int=0 use [Database1] while @loop != (select count(Distinct Email) from [User Table]) BEGIN use [...
Firebase and UISearchbarController searching via the server and not the client -Swift iOS <p>Does anyone have any info on how to incorporate Firebase into a UISearchController delegate? I can't find any solid info on it. There may possibly be thousands of employees.</p> <p>I know how to use the search controller deleg...
<p>Here is an example of how I have accomplished this using Firebase building a list of campuses. This method loads all of the data that is in the table view up front making it easy to search and filter.</p> <p>My campus object is pretty simple with an id and a name.</p> <pre><code>struct Campus { var id: String ...
how to determine the total free disk space in windows PC using Win APIs <p>I am wring a C++ code to determine the available free disk space in PC running Windows 10. I have tried a Win API GetDiskFreeSpaceEx which returns the free space size of one particular drive at a time. Is there any API or a way to get the total ...
<p>Try below code, which gives you available system memory:</p> <pre><code>MEMORYSTATUSEX stex; stex.dwLength=sizeof(stex); GlobalMemoryStatusEx(&amp;stex); </code></pre> <p>stex will have total physical, available physical, total page file,total virtual, available virtual memories....</p> <p>Below is documentation ...
Python PIL image warping / Affine transformations <p>Using Python PIL I want to transform input images in such a way that they seem to be in perspective. Most of the answers I have found are about rotating etc. The images below show one of the effects I am aiming at. Similarly I would like to do this not only from fron...
<p>I believe you are looking for <a href="https://en.wikipedia.org/wiki/3D_projection" rel="nofollow">perspective transformations</a>. You can do it with Pillow in following way:</p> <pre><code>transformed = image.transform( image.size, Image.PERSPECTIVE, [ a0, a1, a2, a3, a4, a5, a6, ...
ng2-datepicker isn't working <p>I am trying to use <a href="https://www.npmjs.com/package/ng2-datepicker" rel="nofollow">ng2-datepicker</a> in my Angular 2 app. I followed the instructions given in the above page but the date-picker is not showing up. The console logs following error.</p> <pre><code>url_resolver.js:24...
<p><a href="https://github.com/angular/material2/issues/974" rel="nofollow">https://github.com/angular/material2/issues/974</a></p> <p>What is the module builder, that use?</p> <p>don't use module.id in the component.</p>
"Potential Infinite Loop" Confusion <p>When I run the below function I get this error:</p> <p>"Error: Potential infinite loop."</p> <p>The problem seems to be the "0" I use in the splice method, because when I change it to any other number (1 - 9) I don't get this error. </p> <p>I'm not sure how this would create an...
<p><code>array.splice(i, 0, " ");</code> says to insert a new element at the current <code>i</code> index. Which means the item that was at <code>i</code> gets pushed up to be at <code>i + 1</code>. So then on the next iteration of the loop you process that same item again, resulting in another insert, etc., forever.</...
Sorting by maximum value and display a different column than the one used for sorting <p>I have data in a file that looks like :</p> <pre><code>id Name records 1 joe 3 1 james 4 1 jacky 4 2 mike 10 2 mat 8 2 peter 10 3 bob 3 3 alice 1 3 wis 1 </code></pre> <p>All reco...
<p>A couple of issues:</p> <ul> <li>you aren't ignoring the header row</li> <li>you aren't saving the name (<code>$2</code>) anywhere,</li> <li>you have 2 <code>END</code>s.</li> </ul> <p>I think you want this:</p> <pre><code>awk 'NR&gt;1{count[$1]+=$3;name[$1]=$2;} END{for(i in count){if(count[i]&gt;m){m=count[i]; ...
CPython 2.7 + Java <p>My major program is written in Python 2.7 (on Mac) and need to leverage some function which is written in a Java 1.8, I think CPython cannot import Java library directly (different than Jython)?</p> <p>If there is no solution to call Java from CPython, could I integrate in this way -- wrap the Ja...
<ul> <li>If you have lot of dependcieis on Java/JVM, you can consider using <code>Jython</code>.</li> <li>If you would like to develop a scalable/maintainable application, consider using microservices and keep Java and Python components separate.</li> <li>If your call to Java is simple and it is easy to capture the out...
Converting a JObject to a dynamic object <p>I'm using a library developed by another developer in our company. One of the calls in this library returns a JObject. What I need to do is convert this JObject to a dynamic object and return it to my caller. </p> <p>I've found lots of answers to create a dynamic with Newton...
<p>Well, I don't really understand your problem, but you can convert it like this:</p> <pre><code>dynamic result = yourJobject; </code></pre>
How to set default value of a new attribute for earlier items in dynamodb table? <p>I have a table with only hash key, now use case requires to create a GSI with creationDate as range key.</p> <p>I am achieving this by specifying creationDate value as a number in all new items.</p> <p>But the table already has about ...
<p>The existing items have to be updated individually. </p> <ul> <li>DynamoDB API doesn't allow to update item without the Hash key value either using <strong>UpdateItemSpec</strong> or <strong>DynamoDBMapper</strong></li> <li>DynamoDB doesn't have a feature to default some value when the new attribute is added to the...
How do i use the OnTriggerExit function and check inside if my ship collided? <p>I want to check if my ship/s collided and not some other objects. So this is the script that i attached to a GameObject and the GameObject have box collider and Rigidbody. The box collider: Is Trigger set to on. And he size is 500 600 500....
<p>From what i can gather,</p> <p>You CrashLandedShip objects do not have colliders, adding colliders should work.</p> <p>Also note that for triggers to work, One of the objects (the terrain or the ship) has to be a non-trigger (2 triggers will not cause a collision or trigger event)</p> <p>So try this : Add a spher...
Aggregate match pipeline not equal to in MongoDB <p>I am working on an aggregate pipeline for MongoDB, and I am trying to retrieve items where the user is not equal to a variable.</p> <p>For some reason, I couldn't make it work. I tried to use <code>$not</code>, <code>$ne</code> and <code>$nin</code> in different poss...
<p>Based on the answer <a href="http://stackoverflow.com/a/38606392/1611791">here</a>, you can change</p> <pre><code>var ObjectId = require('mongodb'). ObjectID; </code></pre> <p>to </p> <pre><code>var ObjectId = require('sails-mongo/node_modules/mongodb').ObjectID; </code></pre>
JAX-RS does not work with Spring Boot 1.4.1 <p>I am trying to develop a simple JAX-RS based web service using Spring Boot version 1.4.1.RELEASE. However getting this exception - </p> <pre><code>java.lang.IllegalStateException: No generator was provided and there is no default generator registered at org.glassfish.hk2....
<h2>The layout of the JAR has changed in Spring Boot 1.4.1</h2> <p>The <a href="https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-1.4-Release-Notes#executable-jar-layout" rel="nofollow">layout of executable jars has changed</a> in Spring Boot 1.4.1: application’s dependencies are now packaged in <code>...
Orders of growth involving both recursion and two inner for loops <p>I have attempted the below question but I am uncertain whether I am correct or not. I have arrived at the conclusion that it is a big theta of n^2 function. My reasoning is that the inner 2 loops for i and for j will amount to a sequence of operations...
<p><strong>EDIT:</strong> First there was <code>i+i</code> in question but now there is <code>i+j</code> so now my answer is wrong.</p> <hr> <p>When <code>x &lt; 1</code> it prints 'boo' - nothing intersting.</p> <p>When <code>x &gt;= 1</code> then you can reach loops</p> <pre><code>for i in range(x): for j in...
jQuery append() not working for concatenated String <p>(Full code below)</p> <p>This</p> <pre><code>$('#' + id).parent().append('&lt;div id="pop-up"&gt;hello&lt;/div&gt;'); </code></pre> <p>does work. But this</p> <pre><code>$('#' + id).parent().append('&lt;div id="pop-up-' + id + '"&gt;hello&lt;/div&gt;'); </code>...
<p>Use <strong><a href="http://api.jquery.com/appendto/" rel="nofollow">.appendTo()</a></strong></p> <ul> <li>The <code>.append()</code> and <code>.appendTo()</code> methods perform the same task.</li> <li>The major difference is in the syntax-specifically, in the placement of the content and target. </li> <li>With .a...
strange syntax error in node-apn library <p>I am trying to implement push notification server with nodejs. I downloaded node-apn library and tried to initiate sample code. When I run sample code file, I got an error "unexpected syntax token ,". So I looked code line where syntax error occurs.</p> <pre><code>const End...
<p>That's ES6 code for an <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Object_initializer" rel="nofollow">object initializer</a> and it's shorthand for:</p> <pre><code>const Endpoint = require("./lib/protocol/endpoint")({ tls: tls, protocol: protocol, }); </code></pre> <p>If y...
stop animation when button pressed <p>in my app I have a button and set below animation to it</p> <pre><code>&lt;set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/bounce_interpolator" &gt; &lt;scale android:duration="2000" android:fromXScale="...
<p>in your java code to stop the animation</p> <pre><code>myButton.clearAnimation(); myButton.clearFocus(); </code></pre> <p>to resize your button</p> <pre><code>myButton.setLayoutParams(new LinearLayout.LayoutParams(10, 100)); </code></pre> <p>hope this may help you.!</p>
Converting RAW byte data to Bitmap <p>I am taking a screenshot of an android device using ADB and receiving the screenshot as raw byte data.</p> <p>I know the raw byte data coming through is in the format rgba</p> <p>Red is offset 0, Green offset 8, Blue offset 16, Alpha offset 24, each value is 1 byte. This makes up...
<p>Did you have a look at this <a href="http://stackoverflow.com/questions/32513379/how-to-record-screen-and-take-screenshots-using-android-api">post</a> ? You're stating that every 'value' is 8 bytes, so 1 pixel is 4x8 = 32 bytes? But you are using 32bpp image format, so 32 bits per pixel -> 1 pixel = 4 bytes.</p> <p...
How to send interrupt/ ctrl C during execution of expect script <p>I am trying to execute some commands and one of which will not come back to console and need to explicitly bring it using ctrl+ c. After that I need to execute some more commands in that script. </p> <pre><code>expect "$ " send "sh /root/jboss-eap-6.3/...
<p>There are all sorts of ways to kill a process in <code>bash</code>. If you by some chance know the name of your (jboss eap) process you could run <code>pkill processName</code>, <code>killall processName</code> or <code>kill pidof processName</code> instead of trying to send key-strokes.</p>
Join two objects by key <p>I stuck on mergin 2 objects into one. Let's say I have 2 arrays of objects: One is childs:</p> <pre><code>let childsWithMoreInfo = [{ id: 1, name: 'somename', parent: { id: 2 }, }, { id: 2, name: 'some child name', parent: { id: 4 } }]; </code></pre> <p>And the secon...
<p>I really know how to use forEach, I wanted to avoid it.</p> <p>This is what I made:</p> <pre><code> this.combined = _.map(parents, (parent) =&gt; { parent.child = childs.find(child =&gt; child.parent.id === parent.id); return parent; }); </code></pre> <p>Thank you for all of your answer...
android studio Error:Unable to start the daemon process <p>Version of Android Studio 2.2 OS version: Windows 10 Java JRE/JDK version: 1.8.0_51</p> <blockquote> <p>Error:Unable to start the daemon process. This problem might be<br> caused by incorrect configuration of the daemon. For example, an<br> unrecognize...
<p>Try deleting your <strong>.gradle</strong> from <code>C:\Users\&lt;username&gt;</code> directory and try again.</p>
How can I change SharedSection in registry using NSIS? <p>Regarding to <a href="http://stackoverflow.com/questions/24382462/how-can-i-change-sharedsection-in-registry-using-c">this stackoverflow entry</a> in need to implement this functionality for a nsis update.</p> <p>In the registry <code>System\\CurrentControlSet\...
<p>The registry functions cannot perform string manipulation. If you need to manipulate a string you can take a look at some of the helper macros that ship with NSIS or write your own.</p> <p>I ended up with a hybrid that does a bit of both:</p> <pre><code>!include LogicLib.nsh !include StrFunc.nsh ${StrLoc} Section...
Visual Studio crashes on 'add reference' <p>Visual Studio crashes when opening any solution and right-clicking 'references' and choosing 'add reference'. The dialog opens for a few seconds, VS crashes and restarts. Tried uninstalling and reinstalling VS2013, then uninstalling again with VS Uninstaller and reinstalling,...
<p>This was solved by doing another reinstall of Visual Studio, but this time cleaning remnants manually. VS Uninstaller <strong>DOES NOT</strong> do a complete uninstall.</p>
MySQL php login <p>I am try to check if an activation link is valid or invalid, however I am always getting the $activated_message from my code even if the activation token or email is incorrect. What's wrong with my sql statement or functions? Thanks</p> <pre><code>&lt;?php include("mysql_functions.php"); // Check i...
<p>The problem is in the fact that <code>mysql_execute_query</code> always returns a result that resolves to <code>TRUE</code> when the given query is correct.</p> <p>You should read the results of the select statement, and base your logic on that, not on the fact that the query worked or not.</p> <p>That being said,...
Faster mail () php <p>So I was creating a mailing script for my customer support Basically what it's gonna be used for is when a user forgets their password a temporary password will be sent to their phone which they can use to reset their password</p> <p>The issue I'm having while testing it goes as follows</p> <p>I...
<p>If you want to keep doing it via email (which I don't reccommend), you could use <a href="http://mailgun.com" rel="nofollow">Mailgun</a>. It's by Rackspace and is incredibly easy to use. Your first 10k emails per month are free. </p> <pre><code># Include the Autoloader (see "Libraries" for install instructions) req...
SWI-Prolog: How to get unicode char from escaped string? <p>I have a problem, I've got an escaped string for example "\\u0026" and I need this to transform to unicode char '\u0026'.</p> <p>Tricks like string_concat('\\', S, "\\u0026"), write(S). didn't help, because it will remove \ not only the escape . So basicall...
<p>In ISO Prolog a char is usually considered an atom of length 1. Atoms and chars are enclosed in single quotes, or written without quotes if possible. Here are some examples:</p> <pre><code>?- X = abc. /* an atom, but not a char */ X = abc ?- X = a. /* an atom and also a char */ X = a ?- X = '\u0061'. ...
Is there something wrong with this Rails Console error message? <p>Very new to Rails, so bear with me -</p> <p>Currently paranoid that my ruby and gem versions aren't up to date because I'd occasionally get error messages when running <code>rails test</code>. Previously had rvm and rbenv both installed, but wow I've r...
<p>There's nothing wrong with your gems. The thing is that when you run irb, it's just that. You only run the ruby interactive. When you run <code>rails console</code> in order to show you the console it needs to go and set it for you with ActiveRecord, rails core, etc. So this (below) is all it does before it's set.</...
How can I redirect social URL when user clicks on social icon by php? <p>html code:</p> <pre><code>&lt;a href="http://www.facebook.com/sharer.php?u=https://simplesharebuttons.com" target="_blank"&gt;&lt;i class="fa fa-facebook"&gt;&lt;/i&gt;&lt;/a&gt; </code></pre> <p>My problem is, I want to redirect the user when t...
<p>Let say you have facebook url:</p> <pre><code>$facebookid = "https://web.facebook.com/abcxyz..."; </code></pre> <p>just put it in html code:</p> <pre><code>&lt;a href="&lt;?php echo $facebookid?&gt;" target="_blank"&gt;&lt;i class="fa fa-facebook"&gt;&lt;/i&gt;&lt;/a&gt; </code></pre> <p>Hope this helps..</p>
The import org.springframework.beans.Beanutils cannot be resolved <p>I am using spring 4.3.3.RELEASE in my project.</p> <p>As per spring <a href="http://docs.spring.io/spring-framework/docs/current/javadoc-api/" rel="nofollow">documentation</a> </p> <p>I can see BeanUtils is in <code>package org.springframework.bean...
<p>If you are building with eclipse and maven use the command as mvn eclipse:eclipse.</p>
Interacting with Gmail inbox using Selenium webdriver <p>I'm working in project where I have to buy a product from some website. I'll get a mail in Gmail I have to click on Received Email (Unread Mail) and interact with the clicked element.</p> <p>So far I have bought the product and now I'm stuck with the Gmail; I'm ...
<p>Why do you want to interact with the email using Selenium? Unless you're creating automated tests for Google there shouldn't be a reason to do this with Selenium. The reason for this is that every little change Google makes to Gmail has a chance to break your script and requires modification.</p> <p>Instead I'd rec...
SELECT ONE WORD FROM ONE STATEMENT <p>I have rule_query table which has number of query with constant variable appends to each query . In every query , variable takes input from another table, appends it and execute that query as result.</p> <p>But i want to return that variable too i.e coming from another table and...
<p>You can select </p> <pre><code> SELECT GMID, @FIPSNAME FROM @FIPSNAME+ADMIN1 </code></pre> <p>or </p> <pre><code>SELECT @FIPSNAME FROM @FIPSNAME+ADMIN1 </code></pre> <p>or </p> <pre><code> SELECT @FIPSNAME+ADMIN1 FROM @FIPSNAME+ADMIN1 </code></pre>
No static method canDrawOverlays <p>I've noticed someone who is using my app reported a crash which logged by the Google Developer Console:</p> <pre><code>java.lang.NoSuchMethodError: No static method canDrawOverlays(Landroid/content/Context;)Z in class Landroid/provider/Settings; or its super classes (declaration of ...
<p>Check the current API of the device which runs your code. If it >= 23, you can use the code</p> <pre><code>if(Build.VERSION.SDK_INT &gt;= 23) { // if (!Settings.canDrawOverlays(this)) { // }else{ // another similar method that supports device have API &lt; 23 } </code></pre>
Home screen shortcut to another application <p>I am making an app which makes a home screen shortcut for another app of mine if user has it installed.</p> <p>It works partially. On API level less then 23 it works perfectly. On android 6 it creates the shortcut, but bypasses <code>Intent.EXTRA_SHORTCUT_NAME</code> and ...
<p>It seems that there is some kind of a bug for Android <strong>M</strong>.</p> <p>For shortcut to get new icon and name, I had to put extra name to the first intent too. And it could be an empty string because the name will stay from second intent. It is working like this now:</p> <pre><code>ApplicationInfo selecte...
Error installing language pack magento2 on ubuntu <p>I am trying to install a language pack for magento using ubuntu 14.04. First I installed the language pack, after that i put it in the root of the magento installation. </p> <p><a href="http://i.stack.imgur.com/SaY4h.png" rel="nofollow"><img src="http://i.stack.imgu...
<p>Please check the file have proper permission for it</p>
How to create a TensorProto in c#? <p>This is a snipped of the c# client I created to query the tensorflow server I set up using this tutorial: <a href="https://tensorflow.github.io/serving/serving_inception.html" rel="nofollow">https://tensorflow.github.io/serving/serving_inception.html</a></p> <pre><code> var...
<p>I also implemented that client in another language (Java). </p> <p>Try to change </p> <pre><code>jpgeproto.Dtype = DataType.DtStringRef; </code></pre> <p>to </p> <pre><code>jpgeproto.Dtype = DataType.DtString; </code></pre> <p>You may also need to add a tensor shape with a dimension to your tensor proto. Her...
How to test java reflections code using JUnit <p>I have a java class that invoke a method via reflection. That method create database connection and perform database operations. i want to test my reflections code using junit. Is there any way to do that?</p> <p>Please find my code snippet below.</p> <pre><code> Cl...
<p>There is no real "pure unit test" way of testing *ReflectionClass**. Normally, you would do a unit test by providing a <strong>mocked</strong> instance of that class to your production code; then you could use the mocking framework to verify that the expected method was called.</p> <p>But in your case, you created ...
show all check box elements with the same id in html page <p>I'm creating an HTML page that contains a table , and at the header of the table above some columns there exist a button that when user click on it should show all checkbox that exist on each row of this column.</p> <p>I tries to create an empty CSS class , ...
<p>try this best and simple pure javascript Example <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>function togglecheckboxes(master,group){ var cbarray = document.getElementsByC...
Are there any softwares that implemented the multiple output gauss process? <p>I am trying to implement bayesian optimization using gauss process regression, and I want to try the multiple output GP firstly. </p> <p>There are many softwares that implemented GP, like the <code>fitrgp</code> function in MATLAB and the o...
<p>I am not sure my answer will help you as you seem to search matlab libraries.</p> <p>However, you can do co-kriging in R with <code>gstat</code>. See <a href="http://www.css.cornell.edu/faculty/dgr2/teach/R/R_ck.pdf" rel="nofollow">http://www.css.cornell.edu/faculty/dgr2/teach/R/R_ck.pdf</a> or <a href="https://git...
update query execution in python <p>I am executing this query on sql developer and it is working fine</p> <pre><code>update TABLE_X set COL_SID='19' where ID='1'; </code></pre> <p>But when I am doing this via python code </p> <pre><code>cur=conn.cursor() updt_query='update TABLE_X set COL_SID=? where ID=?' cur.execu...
<p>Could be the ID are number and not string so you should use </p> <pre><code> cur.execute(updt_query,(19,1)) </code></pre>
How to group json array data if exits the same value android studio <p>I have Json like this, I want to group by sub_name to get array of Phone, Mobile Operation(Every array have the same data value get only one of array).</p> <pre><code> category: { cate: [ { sub_id: "568", sub_name: "Phones", ns_...
<p>Create an ArrayList and add your data.Before adding 2nd item every time check your ArrayList has same data or not using for loop with the help of arrayList size.</p> <p>Whatever I understood about your query I made this code....</p> <pre><code>import android.os.Bundle; import android.support.v7.app.AppCompatActivi...
How to create Wordpress theme like <p>How to create WordPress theme like this websites one for govt jobs and another for show images slide </p> <p><a href="http://www.indiangovtjobs.in" rel="nofollow">www.indiangovtjobs.in</a></p> <p><a href="http://www.imgcluster.com" rel="nofollow">www.imgcluster.com</a></p>
<p>the job website have use this theme:</p> <pre><code>Theme Name: News Pro Theme Theme URI: http://my.studiopress.com/themes/news/ Description: A mobile responsive and HTML5 theme built for the Genesis Framework. Author: StudioPress Author URI: http://www.studiopress.com/ Version: 3.0.2 </code></pre> <p>But this are...
Android Wearable - Data Items: Unable to receive data on mobile device <p>I am trying to transfer heart rate sensors data from watch to mobile device. On the watch(wearable) side, I am getting message stating that the data has been transferred. I have set the priority of the message(PutDataMapRequest) as urgent on the ...
<p>Acording to this <a href="http://www.androprogrammer.com/2015/05/android-wear-how-to-send-data-from.html" rel="nofollow">tutorial</a>, make sure that the <code>applicationId</code> in the main app and wearable app are matched (build.gradle files) in order for the <code>WearableListenerService</code> to fire the <cod...
Jquery/JavaScript not working in a node-red simple custom node <p>I am developing a custom node for Node-Red. Below is the simple html, I am trying to select an element using Jquery. Jquery get/post/ajax is actually working, but selectors are not.</p> <pre><code>&lt;script type="text/javascript"&gt; RED.nodes.register...
<p>You should not be putting any code in <code> $( document ).ready()</code> - a node's edit form only gets created when a node is being edited.</p> <p>You should add any code you need for the edit form into the node's <code>oneditprepare</code> function. That gets called each time the edit form is being built for a n...
Picasso: adding multiple images dynamically in flipper for Android. <p>I'm new to picasso.using it i want to dynamically fetch images and be able to update the images whenever some new link has been updated. currently i'm only able to do this for a single Image. the code that i'm using is :</p> <pre><code>picasso.with...
<p>In your xml just add only this,</p> <pre><code>&lt;ViewFlipper android:id="@+id/flipper" android:layout_width="fill_parent" android:layout_height="wrap_content"&gt; &lt;/ViewFlipper&gt; </code></pre> <p>lets Say your URL Images Array like this.</p> <pre><code>String ImgAry[] = {"url1","url2","url3","url4","ur...
How to adjust label height and width in custom tableView Cell <p>I have a expandable tableView, in which when i expand a section, than there are three cell. On firth Cell there is only name and in second cell. It have a big content. Now I want to auto adjust this label height and width according to content.</p> <pre><...
<p>Try to set this. It will automatically adjust the height of the row for you. If it is not working, then you have something wrong with your constraints inside your storyboard.</p> <pre><code>override func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -&gt; CGFloat { return 40 ...
ES6 map feature <p>I am trying out es6 map datastructure, but I when I tried to iterate the map it is giving the following error </p> <pre><code>The error occurs on line 6: for (let [key, val] of m.entries()) SyntaxError: Unexpected token [ at exports.runInThisContext (vm.js:53:16) at Module._compile (module....
<p>I found one solution, here is code snippet that iterates over es6 map: </p> <pre><code>"use strict" let m = new Map() m.set("hello", 42) m.set(1, 34); for (let entry of m.entries()) console.log(entry[0]+" "+entry[1]); </code></pre>
Most up to date CSS compliance table for email clients <p>I've found this CSS compliance table for <strong>email clients</strong>:</p> <p><a href="https://www.campaignmonitor.com/css/" rel="nofollow">https://www.campaignmonitor.com/css/</a></p> <p><strong>Are there any improvements?</strong> (last update there is dat...
<p>As pointed by Pete in the comment, Mailchimp has it's own compliancy table, that can be found here:</p> <p><a href="http://templates.mailchimp.com/resources/email-client-css-support/" rel="nofollow">http://templates.mailchimp.com/resources/email-client-css-support/</a></p>
Daylight saving causing issue with scheduled job timing <p>I have a materialized view <code>MVIEW_MY_AU</code> which is getting refreshed from a stored procedure named <code>REFRESH_MVIEWS_VIA_PRC</code>. This SP contains following statement : </p> <pre><code>dbms_mview.refresh('MVIEW_MY_AU'); </code></pre> <p>A job ...
<p>The are several ways that Oracle will consider daylight saving times.</p> <p>Enter <code>TIMESTAMP WITH TIME ZONE</code> value for parameter <code>start_time</code>, e.g. <code>SYSTIMESTAMP</code> or <code>CURRENT_TIMESTAMP</code></p> <p>From <a href="http://docs.oracle.com/database/121/ARPLS/d_sched.htm#ARPLS7226...
How to let user create Annotations on MSChart? <p>How do you create an Annotation on-the-run and how do you enable end-user placement with <code>Annotation.BeginPlacement()</code>? I've tried to do this in multiple ways, but cannot get it working. It should render itself in real-time after the BeginPlacement() has been...
<p>You need to calculate the right positions. Remember that the MouseMove will not give you positions (percentages) or values(data) but pixels. You can transform them using the various axis functions. Officially they only work in a xxxPaint event, but during mouse events they also work fine.</p> <p><strong>Update</str...
Django Custom Permission for Authorization <p>I am working on a Django Project, where one model (lets say Document) has the following field:</p> <pre><code>#In models.py class Document (models.Model): choice = (('Yes','Yes'), ('No','No')) authorized = models.CharField (max_length=3, choices=choice, default='N...
<p>Django has awesome auth system. I couldn't understand you scenario. But you could try something like this below By default every Model object comes with three Permission object like (add_document, change_document and delete_document in your case). If you want some custom permission you can add it in model Meta clas...
Pharo Smalltalk: Reading from TextMorph <p>In Smalltalk using Pharo, I'm creating an application that reads the user input and does X.</p> <p>So far I've managed to make a TextMorph that a user could enter a value into, but I'm unsure of how to read from TextMorphs and then do something with the value.</p> <p>Any ide...
<p>Well, you can simply send <code>text</code> to your morph and get it's contents. So you could have a button and when button is pressed you do something with contents:</p> <pre><code>input := TextMorph new. button := SimpleButtonMorph new target: self actionSelector: #processTextMorph:; argument...
Django models: foriegn key or multiple data in a field <p>Actually, this question has puzzled me for a long time.</p> <p>Say, I have two models, <code>Course</code> and <code>CourseDate</code>, as follows:</p> <pre><code>class Course(models.Model): name = model.CharField() class CourseDate(models.Model): cou...
<p>I don't know about cheating, but it certainly goes against good database design. More to the point, it prevents you from doing almost all kinds of useful queries on that field. What if you wanted to know all courses that had dates within two days of a specific date? Almost impossible to do that with solution 2, but ...
How to use set rowcount in select query <p>I have a select query statement which will result 600k rows. When I blindly extract the result using select statement it will impact db performance. Is there an option to use Set rowcount for fetching the data? I tried the below code but it keep on resulting top 50000 rows and...
<p>If your <code>subject</code> is unique, you could try something like this:</p> <pre><code>set rowcount 50000 declare @subject varchar(...) select @subject = max( subject ) from tempdb..extract insert into tempdb..extract ( subject ) select subject from tablename where fldr_id=8 and (subject &gt; @subject OR @sub...
How to make side by side tags bottom align with each other <p>I have encountered a problem when I am using html to develop a website. Basically, I have two div tags align side by side. However, when the content of the first div tag is too long, the content may take more than one line to be displayed. Since the content ...
<p>Use <code>style="clear:both"</code> on the third div.</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-html lang-html prettyprint-override"><code>&lt;div style="float:left; width: 80%"&gt;text 1&lt;br&gt;text 1...
Browser.clearHistory(getContentResolver()); method is not work in Android 5.0 and new version,so how to clear the history of chrome in Android 5.0 <p>In my Android application i want to clear the history of Google Chrome on any button click. </p> <p><code>Browser.clearHistory(getContentResolver());</code> is working p...
<p>Android has removed Permission to read and write bookmark after API>=23. Pls refer this link <a href="https://developer.android.com/intl/ko/about/versions/marshmallow/android-6.0-changes.html#behavior-bookmark-browser" rel="nofollow">https://developer.android.com/intl/ko/about/versions/marshmallow/android-6.0-change...
WPF Grid Expander Listview vertical scrollbar missing <p>I have the following UI element tree:</p> <pre><code>&lt;Grid&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="Auto"/&gt; &lt;RowDefinition Height="Auto"/&gt; &lt;/Grid&gt; &lt;Expander&gt; &lt;ListView/&gt; &lt;/Expander&gt; &lt;Expander&gt...
<p><code>Auto</code> will fit to the content (that's why it stretches). So you need to change <code>Height</code> to <code>*</code> to be able to take any available space. </p> <pre><code>&lt;Grid&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="*"/&gt; &lt;RowDefinition Height="*"/&gt; &lt;/G...
Vector does not accept new element properly <p>I see some odd behaviour in the code below. My console is printing </p> <blockquote> <p>0lo1lo</p> </blockquote> <p>when in reality I am expecting </p> <blockquote> <p>0Hel1lo</p> </blockquote> <p>Node.cpp</p> <pre><code>std::vector&lt;Node&gt; Node::getChildren()...
<p>You're using global variables to store instance data:</p> <pre><code>std::string title; </code></pre> <p>That means there's only one <code>title</code> in your program and if you ever change it, it changes for every class, function, etc. that accesses it.</p> <p>Make it a non-static member variable of <code>Node<...
string convert to json in android <pre><code> client.post("http://10.0.2.2/project/process/selectalluser.php", new AsyncHttpResponseHandler() { @Override public void onSuccess(String response) { Integer contacts = controller.getContactsCount(); Log.d("Reading contacts: ", con...
<p>Your response isn't a <code>JSONObject</code> but a <code>JSONArray</code>, the <code>[]</code> indicate an array. A normal object wouldn't have those. You can use</p> <pre><code>JSONArray jsonArray = new JSONArray(response); </code></pre>
X-Axis label in mpandroidchart <p>Earlier, we could set label for X-Axis using the constructor of LineData.</p> <pre><code> LineData lineData = new LineData(labels,dataSet); </code></pre> <p>But after 3.0, it's not working. Has this been removed or am i missing something?</p>
<p>You can use value formatters . xAxis.setValueFormatter(new AxisFormatter)</p>
SQL need assistance <p>Hi all so im stuck on this sql query question: write an sql statement that displays details of session (id and date) that shows crime movies. You must use join to obtain the answer.</p> <p>I have a table for session with an id column and a date column and i have a movie table that has an moviege...
<pre><code>Select s.id, s.date, from Session s inner join Movie m on m.commoncol = s.commomcol where m.MovieGenre like 'crime'; </code></pre> <p>commomcol represents the mutual column between the tables. Name of the commoncol can be different in both tables.</p> <p>Hope it helps!!</p>
RSpec - equality match, two different instances <p>I created a parser, which reads from CSV file and creates objects from every row. It works fine, but now I created Rspec tests. I have:</p> <pre><code> let(:sample_row) { Call.new(date: '01.09.2016 08:49', service: 'International', phone_number: '48627843111', raw_dur...
<p>With all the given informations <code>eq</code> can't work out of the box. You have multiple options: </p> <ul> <li>compare every attribute like <code>expect(sample_row.service).to eq(parse('/file_test.csv').first.service)</code></li> <li>implement <code>Comparable</code> </li> <li>use a third party gem like <cod...
Multiple backgrounds with CSS animations <p>I'm using multiple backgrounds in CSS (one being a kind of corporate background, and the other is a member of staff).</p> <p>This is my code :</p> <pre><code>background: url("../../images/andy.png"),url("../../images/background.png") no-repeat top; -webkit-background-size: ...
<p><strong>Firstly:</strong></p> <p>Your JSFiddle was a little over-complicated and animations were on wrong elements etc.</p> <p>I'd removed unnecessary elements in the HTML for clarity.</p> <p>Here is an updated JSFiddle that shows your desired effect <a href="https://jsfiddle.net/6nstfftn/4/" rel="nofollow">https...
Using EF as an ORM after the EDMX is no longer supported <p>Currently I am using a database first approach where I reverse engineer the database using the EF designer from database to produce an EDMX file with pluralization. I then use the designer to produce C# compliant names and I then produce the corresponding POCO...
<p>You can still reverse engineer an existing database even without the designer support. In fact, we've had this capability for a while with various tools (EF Power Tools (from MS), the the EF6 version of the EF Designer (from MS), ReversePoco (reversepoco.com). These all create a set of domain classes that look just ...
android - changing the file played in mediaplayer dynamically <p>I'm trying to play sounds dynamically. I have a resource diractory that I have created under res folder that is called "raw". this diractory contains mp3 files. what I want to do is to make an Array with all the files names, and when a button is clicked t...
<p>1.Basing on this source: </p> <p><a href="http://stackoverflow.com/questions/12274891/dynamically-getting-all-image-resource-id-in-an-array" title="dynamically getting all image resource id in an array">dynamically getting all image resource id in an array</a></p> <p>you can try to write this kind of code:</p> <p...
exponential of real(16) in fortran <p>The largest number that is not an infinity in the model of the type of <code>real(16)</code> is 10^4932. I have the <code>exp(10000)</code> in Fortran 90 code that is 8.806818225×10^4342 calculated by simple calculator. I use this simple code:</p> <pre><code>real(16) :: a ... a ...
<p>First, who knows what is <code>real(16)</code>, the kind numbers are not portable and may mean anything.</p> <p>But let's say you want to use real of kind 16 whatever it actually is. Then you have to put real of kind 16 into the exp function</p> <pre><code> a = exp(10000._16) </code></pre> <p>In Fortran expressi...
Updating cells in table using jEditable, jQuery and DataTables <p>I am very new to using DataTables as well as jQuery. </p> <p>I am trying to display a table and let the user edit the cells and update the values in the MySQL database. </p> <p>I don't really understand what the sValue is used for/represents either. </...
<p>I managed to make it work using examples from <a href="http://kingkode.com/free-datatables-editor-alternative/" rel="nofollow">http://kingkode.com/free-datatables-editor-alternative/</a> and some of my own code, feel free to comment or ask any questions if you need any help.</p> <p>Instead of creating a dataSet wit...
GMSAutocompleteViewController iOS, how to change the text color in the searchBar <p>I'm using a GMSAutocompleteViewController and want to change the textColor in the searchBar but can't find a way to do it, I managed to change the some colors but not the searchBar text.</p> <p><a href="http://i.stack.imgur.com/TJP6A.p...
<p>Try this code </p> <pre><code>let searchBarTextAttributes: [String : AnyObject] = [NSForegroundColorAttributeName: UIColor.whiteColor(), NSFontAttributeName: UIFont.systemFontOfSize(UIFont.systemFontSize())] UITextField.appearanceWhenContainedInInstancesOfClasses([UISearchBar.self]).defaultTextAttributes = sear...
Convert.ToDecimal throws System.FormatExcept <p>Im trying to parse from a xml file a value of say 2.25 to be a decimal separated by ",". </p> <pre><code>decimal hrsElapsed = Convert.ToDecimal(caseNode["hrsElapsed"].InnerText, new NumberFormatInfo() {NumberDecimalSeparator = ","}) </code></pre> <p>However, I get a <co...
<p>A decimal has no implicit decimal separator, a string could have if you convert the decimal to one. So you need a <code>NumberFormatInfo</code>/<code>CultureInfo</code> that uses a dot as decimal separator to parse the string to <code>decimal</code>,f.e. <code>CultureInfo.InvariantCulture</code>:</p> <pre><code>dec...