input
stringlengths
51
42.3k
output
stringlengths
18
55k
Adding a dict as a value to another dict is overwriting the previous value <p>I have a piece of python code like below ( I am sorry that I couldn't paste my actual code because its very big)</p> <pre><code>final_dict = {} default_dict = some_data for dict in list_of_dicts: # I am getting list_of_dicts from a json...
<p>Why don't you generate the <code>id</code> first and then straight away assign the merge_dicts value there?</p> <pre><code>for dict in list_of_dicts: # I am getting list_of_dicts from a json file id = return_value_from_a_function final_dict[id] = merge_dicts(dict, default_dict) </code></pre> <p>EDIT: S...
How to get the custom image name in a UIBarButtonItem button in Swift 3? <p>I have this method in a custom class:</p> <pre><code>func changeImage(btn:UIBarButtonItem, imageName: String){ btn.image = UIImage(named: imageName) } </code></pre> <p>I would like write another method that can give me the same name passe...
<p>Basically what you can do is subclass <code>UIBarButtonItem</code> and declare a property as <code>var imageName: String?</code> and when you assign the <code>image</code> to your <code>UIBarButtonItem</code>, assign this <code>imageName</code> with actual value. So that you can access it later anywhere(unless it is...
Getting the values of data stored in firebase <p>I'm trying to get access to the values stored in firebase dashboard to use them in different functions and methods in the class. </p> <p><a href="http://stackoverflow.com/questions/39497157/get-the-values-of-the-retrieved-nodes-and-use-them-globally-firebase-and-swift">...
<p>Change <code>ref.child(byAppendingPath: self.strUserid as String)</code></p> <p>To:- </p> <pre><code>ref.child(self.strUserid) </code></pre> <p>Also remove <code>let refer = FIRDatabase.database().reference().child("UserDevices")</code>.</p> <p>You can not initialise your reference globally outside a scope becau...
Updating DecalGeometry vertices, UVs, <p>I am currently playing with <a href="http://threejs.org/examples/webgl_decals.html" rel="nofollow">ThreeJS decals</a>. I have been able to put a beautiful stain on my sphere.</p> <p>Here is the piece of code I use to "apply" the decal on my sphere. (I have some custom classes, ...
<p>You are trying to update vertices of your geometry.</p> <p>You can change the value of a vertex componnent,</p> <pre><code>geometry.vertices[ 0 ].x += 1; </code></pre> <p>but you can't add new veritices</p> <pre><code>geometry.vertices.push( new THREE.Vector3( x, y, z ) ); // not allowed </code></pre> <p>or ass...
Can Django collectstatic overwrite old files? <p>In my deb postinst file:</p> <pre><code>PYTHON=/usr/bin/python PYTHON_VERSION=`$PYTHON -c 'import sys; print sys.version[:3]'` SITE_PACKAGES=/opt/pkgs/mypackage/lib/python$PYTHON_VERSION/site-packages export PYTHONPATH=$SITE_PACKAGES echo "collect static files" $PYTHON ...
<p>(Added here, maybe someone will have same problems with mine.) Yes.</p> <p>The timestamp of css files in /opt/pkgs/mypropject/lib/python2.7/site-packages/mypropject-py2.7.egg/myapp/static/css (directory A) is the time when package building finished, not the time when css files installed.</p> <p>But the timestamp o...
Query appears to work in console but cannot get data in view <p>I am trying to use this query</p> <p>pages_controller.rb</p> <pre><code># GET /pages/1 # GET /pages/1.json def show @page = Page.where('category_title = ?', params[:category_title]).where('slug = ?', params[:slug]) end </code></pre> <p>routes.rb</p> ...
<p>Turns out all I had to do was add ".first" to the query</p> <pre><code>@page = Page.where('category_title = ?', params[:category_title]).where('slug = ?', params[:slug]).first </code></pre> <p>worked</p>
Jenkins Multi-Pipeline Build Not Detecting Changes in Repository <p>We have a Subversion repository setup in this manor:</p> <ul> <li><code>http://svn.vegicorp.net/svn/toast/api/trunk</code></li> <li><code>http://svn.vegicorp.net/svn/toast/api/1.0</code></li> <li><code>http://svn.vegicorp.net/svn/toast/data/trunk</cod...
<p>I finally found the answer. I found a entry in the <a href="https://issues.jenkins-ci.org/browse/JENKINS-34737" rel="nofollow">Jenkins' Jira Database</a> that mentioned this exact issue. The issue is called <em>SCM polling is not being performed in multibranch pipeline with Mercurial SCM</em>. Other users chimed in ...
How to change the colour of navigation links dynamically? <p>I'm designing a website which have navigation pages, I need to dynamically change the colour of navigation links. I am using a single header.php</p> <p>For example if I'm in page 1 the header colour of page 1 should be changed. (to depict that is active; pl...
<p>If you want the active navigation icon to be another color, you can add a CSS class dynamically in your PHP file (assuming you have the possibility to check, wether a page is currently active or not), e.g.</p> <pre><code>&lt;li class="&lt;?php echo isActive($yourPage) ? 'active' : ''; ?&gt;"&gt;Page 1&lt;/li&gt; </...
Consumption rate of Kafka messages using spark streaming <p>I'm trying to benchmark the consumption rate of Kafka messages from a topic with 20 partitions using spark streaming, this is the code snippet i'm using and I'm passing number of threads as '20' along with the rest of the args on basis of one consumer per part...
<p>You can go for <strong><code>StreamingListener</code></strong> implementation, where you will get events after every batch completion along with batch information like <strong><code>batch number of records, batch start time, batch end time, batch processing delay and scheduling delay</code></strong>. Based on this i...
Is this the most efficient and accurate way to extrapolate using scipy? <p>I have a set of data points over time, but there is some missing data and the data is not at regular intervals. In order to get a full data set over time at regular intervals I did the following:</p> <pre><code>import pandas as pd import numpy...
<p>You should apply interpolation function only once, like this</p> <pre><code>new_data = f(time) </code></pre> <p>If you need values at regular intervals fill_value='extrapolate' is redundant, because it is just interpolation. You may use 'extrapolate' if your new interval is wider than original one. But it is bad p...
Add reference using GUID <p>I am trying to activate Visual Basic For Applications Extensibility Library(version 5.3) programmatically using GUID. My code encounters the error "Object library not registered" when trying to do this. I have enabled access to VBProjects. </p> <p>Any help would be appreciated!</p> <pre><c...
<p>Try this</p> <pre><code>ActiveWorkbook.VBProject.References.AddFromGuid _ GUID:="{0002E157-0000-0000-C000-000000000046}", _ Major:=5, Minor:=3 </code></pre> <p>You may want to see <a href="https://msdn.microsoft.com/en-us/library/office/gg264769(v=office.15).aspx" rel="nofollow">This</a></p>
Switch value of variables using double pointers <p>I got a problem with my pointer program, it should use double pointers to switch the value of double values x and y. I am pretty new to pointers and I am not able to accomplish that.</p> <pre><code>#include &lt;stdio.h&gt; #include &lt;math.h&gt; /* todo implement sw...
<p>Look at what you're doing here:</p> <blockquote> <p><code>switch_pp(&amp;x,&amp;y);</code></p> </blockquote> <p>and compare that to your <code>swap</code> function:</p> <blockquote> <p><code>void switch_pp(double** a,double** b)</code></p> </blockquote> <p>What would you say the type of <code>&amp;x</code> i...
How to add text form the left side of the menu bar in HTML <p>I'm new to HTML and CSS.I want to add text/image from the left side of the menu bar.how to do it?found many other ways but couldn't match with the code I got. this is the code I used</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console=...
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-css lang-css prettyprint-override"><code>ul { list-style-type: none; width:75%; margin: 0 auto; padding: 0; overflow: hidden; ba...
How to use a Set in Swift 3.0 without generic usage <p>First of all i have to say i come from Java programming and compared with Java everything in Swift 3.0 seems to be totally complicated. I thought what i want to do is easy but it turned out it is not.</p> <p>I have two objects:</p> <pre><code>protocol Customer { ...
<p>Since you intend to use types conforming to <code>Customer</code> in applications where they must be <code>Hashable</code> (e.g. as members of a <code>Set</code>), there is no reason why not to add this <code>Hashable</code> constraint directly to the <code>Customer</code> protocol. This way you move the responsibil...
CSS: how to center a list with image <p>How do I center an unordered list that is divided with an image inside?</p> <p>I want to achieve that the unordered list is one row, centered and also the image inside is centered so that the image divides the rest of the list in two halves (<code>topnav-left</code> and <code>to...
<p>Try to use <code>display:flex;</code> add this to add this,</p> <pre><code>ul {display:flex;justify-content: space-around;list-style-type: none;} ul.nav li { flex:1; text-align: center; } /* Edit from comment by Paulie_D </code></pre> <p>Working <a href="http://codepen.io/Paulie-D/pen/GjNZzR" rel="nofollow"><stro...
My App crashes when I pass a UITableViewCell as AnyObject? to an other function <p>I already know the solution for my problem, but I just really don't understand what's going on here. I have a <code>UITableViewController</code> that takes the cell in <code>didSelectRow</code> and uses it for something in an other funct...
<p>Basically, you don't "own" the reusable cells. The <code>UITableView</code> owns them. Since you're passing the same cell three times to the function with strong reference (you wrote, you know the solution, so I'm omitting it), you increase the ref count of the cell (in this case to be +3, but it doesn't matter). At...
XDrawString incorrect encoding <p>I want to display cyrillic symbols with <code>XDrawString()</code>, but on screen they are shown in wrong encoding.</p> <p>I have installed <code>xfonts-cyrillic</code> in my system (ubuntu 14.04), but still any font from <code>xlsfonts</code> list shows wrong result.</p> <p>My code ...
<p>X11 predates Uicode by several millennia (in Internet years). Your program probably uses UTF-8, and X11 by default does not. Try Xutf8DrawString.</p> <p>Alternatively, figure out which encodings your fonts use (xlsfonts will tell you, because the encoding is a part of XLFD, but it looks like KOI8-R to me) and use t...
Convert python cryptography EC key to OpenSSH format <p>I am looking to convert EC key generated using cryptography module to their respective OpenSSH strings. like</p> <pre><code>ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAhANiNlmyHtBUgaPXG+CtCVK8mQxBUtDjX3/nqqPZAHhduAAAAIE/JNDqLTeq9WVa5XWyU2Y7NJXfV54wakHm...
<p>Cryptography added support for doing this in June 2016, it is possible as follows</p> <pre><code>from cryptography.hazmat.primitives import serialization key.public_bytes(serialization.Encoding.OpenSSH, serialization.PublicFormat.OpenSSH) </code></pre> <p>this gives those neat OpenSSH public keys</p>
Ninject: Binding Classes from Data Store <p>I have a windows console app (that will eventually be a windows service) that reads from queues (5 for each client). It needs to be able to read from a data store so that all of the client queues have the appropriate queue listeners set up. To make matters more complex we're ...
<p><strong>As far as i understand i see two problems in your code:</strong></p> <ul> <li>You initiate your ClientJob objects using the "new" keyword by yourself, while doing that you are coupling your code and you are lossing all the point of using IOC and DI.<br/> If you are using ninject as your tool i suggest you u...
SASS Files in Wordpress <p>Is there a way to access SCSS files from the Wordpress Theme editor UI? I have tried moving it to the root, next to my style.css and also leaving it in the SASS folder.</p> <p>I am building a custom theme and already had SASS running on it locally and am now going to continue development in ...
<p>You have to add the file extension before it will show up in the editor. You can do this with the <a href="https://developer.wordpress.org/reference/hooks/wp_theme_editor_filetypes/" rel="nofollow"><code>wp_theme_editor_filetypes</code></a> filter.</p> <p>For example:</p> <pre><code>add_filter('wp_theme_editor_fil...
EWS Api 2.0 not returning ID of copied Appointment <p>I'm having a problem with "Copy" method of "Item": As explained in documentation (<a href="https://msdn.microsoft.com/en-us/library/dd634844(v=exchg.80).aspx" rel="nofollow">here</a>) that method should return the copied item (and the relative fresh UniqueId), but I...
<p>Are you copying the Item between two folders in the same mailbox or between two folders in different mailbox as per <a href="https://msdn.microsoft.com/en-us/library/office/dn600291(v=exchg.150).aspx" rel="nofollow">https://msdn.microsoft.com/en-us/library/office/dn600291(v=exchg.150).aspx</a></p> <blockquote> <p...
locate home directories of deleted users in linux <p>I'm trying to write a bash script to locate home directories of users long since deleted, that have nothing but their profile files (.bashrc, .bash_logout, .profile, etc....) still left in.</p> <p>I tried <code>find . -type d -empty -print</code></p> <p>but it only...
<p><code>find</code> has an option that might come in handy in this case: <code>-nouser</code>. It matches with files that have a (numeric) user id that corresponds to no user as specified in <code>/etc/passwd</code>. So for example, the following command will print all directories under <code>/home</code> that are not...
Full-screen DialogFragment dismissing Activity <p>I am working on a full-screen DialogFragment over an Activity for form input, using these two other questions as primary sources: <a href="http://stackoverflow.com/questions/31606871/how-to-achieve-a-full-screen-dialog-as-described-in-material-guidelines">How to achieve...
<p>Pop the backstack in your fragment's <code>onOptionsItemSelected</code></p> <pre><code>@Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if (id == R.id.action_save) { // Save data to DB return true; } else if (id == android.R.id.home) { /...
How to unselect feature after selecting all <p>I have a map with a vector layer with some features.</p> <pre><code>var map = new ol.Map({ view: mapManager.zoomedView(), target: 'map-business', layers: [ new ol.layer.Tile({ source: new ol.source.OSM() }) ] }) var vectorSource = new ol.source.Vecto...
<p>I would do something like:</p> <pre><code>var vectorSource = new ol.source.Vector({ format: new ol.format.GeoJSON, url: '/test.geojson' }); var vectorLayer = new ol.layer.Vector({ source: vectorSource, // ... }); map.addLayer(vectorLayer); var featuresInteraction = new ol.Collection(); var selectSingleCl...
node res.render changes view but not url <p>I am sending an <code>id</code> from a <code>jade view</code> to its <code>controller</code>(backend), the controller then queries <code>mongodb</code> and the result is sent to a new <code>jade view</code>-<code>angular</code>. The results &amp; view appear but <code>URL</co...
<p>You need to redirect ,if you want the URL to change like this</p> <pre><code> res.redirect('/some/path') </code></pre>
Large video files failing to upload to a WebApi via WebClient.UploadFileTaskAsync <p>I'm building a iOS (and later Android) app with Xamarin that allows the user to record a video and upload it to a server using POST to a Web API I have in place.</p> <p>When I run the application on a device in debug mode, I can see t...
<p>This isn't the real answer I was looking for, but it works. I'd still like to get UploadFileTaskAsync working, but it seems to be timing out, so I wrapped UploadFile() in a Task.Run() to get it working (without a progress indicator, however):</p> <p>I got this working by moving to UploadFile instead of UploadFileTa...
Positioning the exponent of tick labels when using scientific notation in matplotlib <p>I am looking for a way to change the position of the exponent on an axis when using scientific notation. I got stuck at this problem already a few times. I know already that the default formatter is the <code>ScalarFormatter</code> ...
<p>To access the list of <a href="http://matplotlib.org/api/text_api.html#matplotlib.text.Text" rel="nofollow">Text objects</a> you can use a method of that class, e.g. <code>get_text()</code>:</p> <pre><code>print([s.get_text() for s in ax2.get_xmajorticklabels()]) </code></pre> <p>However, the result of that is</p>...
Copy file path to other variable in multer <pre><code>var multer = require('multer'); var storage = multer.diskStorage({ destination: function (req, file, cb) { cb(null, './uploads/') }, filename: function (req, file, cb) { cb(null, file.originalname+ '-' + Date.now()+'.jpg') } }); var ...
<p>Why not:</p> <pre><code>var multer = require('multer'); var storage = multer.diskStorage({ destination: function (req, file, cb) { cb(null, './uploads/') }, filename: function (req, file, cb) { var fileName = file.originalname+ '-' + Date.now()+'.jpg'; console.log(fileName); cb(null,...
Oracle Issue with retreiving single row when multiple rows returned <p>I have a problem that i've spent about 3 days on.</p> <p>I have a table(CDKEY) with 6 columns: CDKEYSEQ, Userseq,Banned, Communityseq, cdkey, Email.</p> <p>Banned is always 0 (at this point), Userseq is NULL unless someone logged on/registered wi...
<p>You <em>think</em> a query will not work - and your reasoning is "because a query will return too many rows." That is incorrect. Add a WHERE clause (or add to the filters you already have), with the condition <code>ROWNUM = 1</code> - this will return the first row that meets all the other conditions, the processing...
How can I make an app by phonegap or cordova using ruby on rails? <p>I made a website by ruby on rails on c9 and I want to make this as a mobile application.</p> <p>I found there are cordova, phonegap and etc.</p> <p>I don't know how to use my previous code I wrote on c9 by using ruby on rails.</p> <p>Is there any w...
<p>Phonegap uses primarily JavaScript/HTML5/CSS so it's not clear that you'd be able to "directly" reuse your existing codebase as a Phonegap application in the "now it's a web site, now it's a mobile app" sense. The answer that elimcjah posted does present some reasonable ideas though.</p> <p>As a broader point, the ...
How do I set the color to default if user doesn't specify it? <p>I want the user to enter the desired color to be set as background color, but if it is not set, I want it to be set to silver.</p> <p>It doesn't work anyway, but this is what I wrote so far and now I'm stuck!</p> <pre><code>&lt;?php if(isset($_GET['bgCo...
<p>You should be using the following code to change the background color - Try putting the body tag inside if else:</p> <pre><code>if (Condition) { echo '&lt;body style="background-color:blue"&gt;'; } else { echo '&lt;body style="background-color:white"&gt;'; } </code></pre> <p><strong>Updated</strong>: I've up...
Style indent background color of a QML TreeView <p>I want to change indentation background color as shown in following image: <a href="http://i.stack.imgur.com/f5WSn.png" rel="nofollow"><img src="http://i.stack.imgur.com/f5WSn.png" alt="enter image description here"></a></p> <p>Up to now, I have something like:</p> <...
<p>To customize each row in a <code>TreeView</code>, override <a href="http://doc.qt.io/qt-5/qml-qtquick-controls-treeview.html#rowDelegate-prop" rel="nofollow"><code>rowDelegate</code></a> property. For example,</p> <pre><code>TreeView { rowDelegate: Rectangle { color: "pink" } style: TreeViewStyle { b...
Google Maps API v3 - how to detect when map changes to full screen mode? <p>Is there a way to detect when the user clicks the default fullscreen mode button?</p> <p>These are the map options I'm using:</p> <pre><code>var mapOptions = { center: { lat: 40.907192, lng: 20.0368...
<p>You can use <a href="https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API" rel="nofollow">HTML5 Fullscreen API</a> which has the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API#Notification" rel="nofollow">fullscreenchange</a> event: </p> <blockquote> <p>"When fullscreen mode i...
With pytest, why do inherited test methods not give proper assertion output? <p>I am working on an application that has a command line interface that I would like to test using pytest. My idea was to define test classes like</p> <pre><code>class TestEchoCmd(Scenario): commands = [ "echo foo" ] stdo...
<p>Found the answer myself: Pytest likes to rewrite the <code>assert</code> statements in the Python AST to add the more explicit output. This rewriting occurs (among other places) in classes that it deems to contain test methods, i.e., ones whose names start with <code>Test</code>. If a test method is inherited from a...
Randomly generate an element from an array VB <p>I am trying to create a program to randomly generate a name from a cake rota array. I cannot seem to get it to work. Currently, the message box shows a random number rather than the name stored in the array. Help please!</p> <pre><code>Public Class Form1 Private Sub...
<p>The line</p> <pre><code> For i = 0 To 18 strNames(i) = i Next i </code></pre> <p>is setting the values of strNames to a number. </p> <p>Taken out and it appears to work</p> <pre><code> Dim strNames(18) As String Dim frances, emma, piotr, jake, jess, jonah, john, flynn, will, nick As String ...
Changing the scrolling direction inside a scrollView <p>I have created a swipe navigation using this tutorial: <a href="https://www.youtube.com/watch?v=3jAlg5BnYUU" rel="nofollow">https://www.youtube.com/watch?v=3jAlg5BnYUU</a></p> <p>I am creating a book so i have 65 xib files. an example of my code is:</p> <pre><co...
<p>Why are you making so many VC variables? Is each class really that distinct? You could probably reuse one VC for everything you are trying to do, and rely on separate instances of that VC to render the content differently.</p> <p>To answer your question, though, in order to manually page the scrollView, you can use...
REGEX - controll <p>I've got the following example text:</p> <pre><code>There are 7 apples, 3 lemons. </code></pre> <p>I've got a software, which search with regex pattern, but two times: one for "apples" (as attribute) and a second time for "7" (as value).</p> <p>My problem is: if i search with the pattern "lemons"...
<p>If you want the digit associated with <code>lemons</code> use this pattern:</p> <pre><code>/(\d+)\slemons/ </code></pre> <p>If you want the digit associated with <code>apples</code> use this pattern:</p> <pre><code>/(\d+)\sapples/ </code></pre> <p>Obviously this could be DRYed up by a program that allows you to ...
Warning frame for "Navigation bar" will be different at the run time appears in XCode 8 Swift 3 <p>Before I've upgraded to <code>XCode 8</code> I haven't seen this error in such case. I have different Navigation Controllers. For all of them I see an error <code>Frame for "Navigation bar" will be different at the run ti...
<p>Warning will disappear if you change the property "Simulated Size" to "Freeform". </p> <p><img src="http://i.stack.imgur.com/tj9Nu.png" alt=""></p>
Google tag manager and advanced ecommerce - transaction products <p>I'm trying to configure advanced ecommerce analytics to read transaction data from an order confirmation page.</p> <p>I'm scraping the data from the Dom elements since this is the only option available to me.</p> <p>I'm able to read fields for transa...
<p>That's not really answerable as long as you do not show how the HTML for you products look, but basically you'd use Document.querySelectorAll on the elements that contain the products and then iterate through the results and pick the values from the inner elements for each indivdual result. Assign to a (temporary) p...
Lucene index field not searchable <p>So I have a field in my Lucene index documents named "Field1" (for all intents and purposes).</p> <p>When I open Luke, and browse the documents, I see most of the documents have this field. However when I switch to the search tab, and I input <code>Field1:parameterValue</code> I g...
<p>The "IdfpTSVopNLB#" field is a collection of flags. You should see a key to it in Luke:</p> <p><a href="http://i.stack.imgur.com/FkqL1.png" rel="nofollow"><img src="http://i.stack.imgur.com/FkqL1.png" alt="Luke flags key location"></a></p> <p>I would guess the reason your searches are failing is because you aren'...
Use Vue JS to make default selection(s) within Array <p>I see a lot of questions on Stack Overflow dealing with Vue JS and selecting a default <em>single</em> value from an Array. I, however, need to compare each item's array <code>groups</code> to an array of ALL THE GROUPS <code>ensemble_groups</code>, and load the c...
<p><a href="https://vuejs.org/guide/forms.html#Checkbox" rel="nofollow">Multiple checkboxes can be bound to an array</a> to work the way you want. The snippet below lists the <code>ensemble_groups</code> with checkboxes beside them. Below that, the <code>cast_groups</code> array is listed. The <code>cast_groups</code> ...
How to fix com.android.builder.internal.aapt.AaptException: Failed to crunch file? <p>I have the latest version of Android Studio (as of Sep 21, 2016). When I create a brand new project in Android Studio and try to build it, I am getting this build error:</p> <blockquote> <p>Error: com.android.builder.internal.aapt....
<p>Amazing. It's 2016 and Google's tool chain still has these annoying file path limitations.</p> <p><a href="http://stackoverflow.com/questions/33905687/error-file-path-too-long-on-windows-keep-below-240-characters">Error: File path too long on windows, keep below 240 characters</a></p> <p>Move project further up yo...
laravel elixir mapping similar file <p>I have many different files which I combined in one file via elixir and gulp.</p> <p>I also minimize some files which has similar name and different source and also this files storing in the different folders. But in generated <code>.map-file</code> I got only unique names of fil...
<p>I have no idea why your code doesn't work, anyway I suppose the cause could be your <code>PUBLIC_FOLDER</code> variable or where the js files are located.</p> <p>I have files that shares the same name and have no problem while debugging, that makes your issue particularly weird.</p> <p>Move your source js files in...
A circular reference was detected while serializing an object of type 'MicrossDashboard.DB.Customer' <p>I am quite new to MVC and am therefore having trouble populating a DropDown list with data from a table in my DBContext. I have the following setup:</p> <p>Within my Controller I have the following ActionResult:</p>...
<blockquote> <p>A circular reference was detected while serializing an object of type 'MicrossDashboard.DB.Customer'.</p> </blockquote> <p>That class is referencing itself in one of its properties. As a simplified example, consider this:</p> <pre><code>public class MyClass { public int MyInt { get; set; } ...
AngularJS Promise Loop error <p>I have a <code>configs</code> object. For each object in <code>configs</code>, I am looping and performing a call using $http.get (which is in SPARQLService). The <code>configs</code> object contains different object and thus doing different calls on different URLs. Within that loop, whe...
<p>I think your problem is that <code>newConfig</code> within your <code>then</code> function is bound to the value of <code>newConfig</code> by reference, so when the promise finishes executing it will take whatever value is in <code>newConfig</code> at that time - not at the time the promise was invoked. </p> <p>Eve...
Get Firebase InstanceId from another app <p>I am writing an Android library that be installed on several external apps. This library will have to receive and send Firebase Message from and to my server.</p> <p>To do that I need to get a FirebaseInstanceId for the app using my library, however a FirebaseInstanceId usag...
<p>Aaand I found the answer less than one hour after...</p> <p>We can use <code>FirebaseInstanceId.getToken(String authorizedEntity, String scope)</code> to get a token allowing us to perform firebase operation on another app (ex : set "FCM" in the scope to use the Firebase Cloud Messaging)</p>
setOnItemSelectedListener() for spinner in Fragment <p>I'm trying to add a spinner and a listener in my fragment. Android studio did not report any error to me, but when I run it, it crashes with this FATAL EXCEPTION:</p> <pre><code>14267-14267/? E/AndroidRuntime: FATAL EXCEPTION: main ...
<p>Move all of your <code>onCreate()</code> code &mdash; starting with the line that is crashing &mdash; into <code>onViewCreated()</code>. You cannot execute any of that until <code>onCreateView()</code> has been called, and <code>onCreate()</code> will be called before <code>onCreateView()</code>. <code>onViewCreated...
need splitting a variable into 6 variables - SQL <p>need help filling in the blanks i am struggling with splitting a variable into 6 variables.</p> <pre><code> DECLARE @item VARCHAR(MAX) = 'MG1111.TG2222.MW3333.JG4444.MG5555.MH6666' DECLARE @item1 VARCHAR(MAX) DECLARE @item2 VARCHAR(MAX) DECLARE @item3 VA...
<p>Why not use this pattern?</p> <pre><code>set @item1 = SUBSTRING_INDEX( @item, '.', 1) . set @item3 = SUBSTRING_INDEX( SUBSTRING_INDEX( @item, '.', 2), '.', 1) . . set @item6 = SUBSTRING_INDEX( @item, '.', -1) </code></pre> <p>I am assuming by 6 variables you mean each substring between the dots in <code>@item</cod...
How divide items (not just list) in RelativeLayout? <p><a href="http://i.stack.imgur.com/eJPGd.png" rel="nofollow"><img src="http://i.stack.imgur.com/eJPGd.png" alt="enter image description here"></a></p> <p>On this picture have divided lines, but this just <strong>drawble-line</strong> where use <code>android:drawabl...
<p>You could use a vertical <code>LinearLayout</code> and set <code>android:divider="@drawable/border_line"</code>. This will automatically add the divider in between all items in the layout.</p>
Is there a way that I can set buildConfigField value from build.gradle to view directly in layout xml file? <p>Let's say I set some <code>buildConfigField</code> for my specific flavor in my build.gradle file, for example:</p> <pre><code>... productFlavors{ stage { buildConfigField 'String', 'HOST_URL', '"...
<p>Use:</p> <pre><code>resValue "string", "whatever", '"your string literal goes here"' </code></pre> <p>in each of your flavors. Then, refer to <code>R.string.whatever</code> in your layout.</p>
How to wait for the bootbox.prompt() result before executing the further statements in javascript? <p>I have following code:</p> <pre><code>var bootboxresult; bootbox.prompt('Please enter some data', function(result) { if (result != null) { bootboxresult = result; }}); alert(bootboxresult); if(bootboxresult === nul...
<p>I think you can write all your code inside call back of bootbox. See example below. </p> <pre><code> var popup_content = "&lt;b&gt;Are you sure?&lt;/b&gt;&lt;br&gt;&lt;br&gt;Do you want to delete?"; bootbox.confirm(popup_content, function(result) { if(result){ // Write...
Median of 3 Numbers: Without using Array or Sorting Concept <p>How can I calculate the median of three given numbers without using any array. Can we do it by simple calculation or comparison?</p> <p>What i have tried so far:</p> <pre><code>#include&lt;stdio.h&gt; #include&lt;conio.h&gt; void main() { int a[3],i...
<p><b>Median</b> is a number that is either halfway into the set or you can think of it as middlemost number in the set. so for finding it we will just do the comparisons like below</p> <p><code>median = max(min(a,b), min(max(a,b),c));</code> <br>answer reffered from <a href="http://stackoverflow.com/questions/158235...
Set TextBlock Text if Windows 10 uses dark theme (UWP) <p>I want to set the text of a TextBlock if the windows 10 user uses the dark/light theme. I have tried</p> <pre><code>RequestedTheme == ElementTheme.Dark </code></pre> <p>but it doesn't work.</p> <p>EDIT: I want to set it like this</p> <pre><code>if(user uses ...
<p><code>ApplicationTheme</code> is an <code>Enum</code> for you to check what theme is imposed on your application. You can check like below.</p> <pre><code>if (Application.Current.RequestedTheme == ApplicationTheme.Dark) { mTextBlock.Text = "Dark" } elseif(Application.Current.RequestedTheme == ApplicationTheme.L...
Javascript, From ArrayBuffer to RAW binary data: How to? <p>Using the FileReader.readAsArrayBuffer() I read some content from a binary file and I got an ArrayBuffer.</p> <p>Now I have to send the RAW binary read using a JQuery $.ajax. </p> <p>The FileReader.readAsBinaryString() function is deprecated because marked a...
<p>Have you tried the <code>FileReader.readAsText</code> method? It allows to specify the encoding but uses UTF-8 by default.</p> <p>See <a href="https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsText" rel="nofollow">https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsText</a></p> <h1>ED...
How can I assign each item in a list a seperate number, and then print these numbers as a string? - Python <p>please bear with me as I'm rather new to python. </p> <p>I would like to take a string of a few words, change this to a list, and give each item in the list an individual number (i guess you call it an index)....
<p>Below is the sample code. Value of each variable is mentioned in comment at each step to explain you regarding how it worked:</p> <pre><code>my_string = "How does one do this How does one do this" my_list = my_string.split(" ") # my_list: ['How', 'does', 'one', 'do', 'this', 'How', 'does', 'one', 'do', 'this'] co...
Copy Range of Data and paste in recording sheet without overwrite and follow the next available line <p>I'm very new to VBA but i manage to gather up a code that I actually need. but the code is recording multiple rows in one row. I need to record range of rows every week and clear master sheet only specified columns. ...
<p>You had a few errors in your code that I've corrected for you. This code works for me. It takes the 10 columns of data from "Master sheet" and places all of the data on 1 row in "report". On the report page, it places everything on the next available row. <strong>Issues I found:</strong></p> <ol> <li><p>You didn't ...
Invalid Column in a Oracle Pagination query? <p>I'm writing a Oracle SQL query for pagination, it works fine in sql developer but when I try to run through java application using Spring JDBC Template it throws </p> <blockquote> <p>SQLException: <strong>Invalid column type</strong></p> </blockquote> <p>Actual Query:...
<p>I believe the issue is with special "__" characters of your alias for the rownum speudocolumn. Try a different alias name for your rownum return column, or try including the {escape '_'} inclusion syntax. I'd simply change the pseudocolumn alias myself.</p>
python loadtxt with exotic format of table <p>I have a file from simulation which reads like :</p> <pre><code>5.2000 -0.01047 -0.02721 0.823400 -0.56669 1.086e-5 2.109e-5 -1.57e-5 -3.12e-5 0.823400 -0.56669 -0.02166 -0.01949 -2.28e-5 -2.66e-5 1.435e-5 1.875e-5 1.086e-5 2.109e-5 -2.28e-5 -2.66e-5 -0.01878...
<p>If the "tables" are always 4x8 then it may be easier to read the data in as a 1D array, then index/reshape this in order to get the output you desire:</p> <pre><code># to get s you could do something like s = open(fname, 'r').read() s = """ 5.2000 -0.01047 -0.02721 0.8234 -0.56669 1.086e-5 2.109e-5 -1.57e-5...
display HTML $scope variable in iframe as content <p>I want to display some HTML in Angular 1.2 in an iframe, but I don't have an URL, instead I have the content in a variable. How to display it?</p> <pre><code>$scope.serverMessage = $sce.trustAsHtml(data); $scope.switchMessage('serverError'); // this displays a modal...
<p>I made a directive for this... it's pretty ugly but you can get the gist and clean it up if you'd like.</p> <pre><code>.directive('dynamicIFrame', function($document){ return { restrict:'E', scope:{ html:"=" }, link:function(scope, iElem, iAttr){ // Create an IFrame and add it to the c...
In JavaScript, is there a way to print multiple Objects properties using the "this" keyword or a (for, in) LOOP? <pre><code>var object1= new Object(); object1.name= 'Dana'; object1.age = 18; var object2= new Object(); object2.name= 'Togo'; object2.age= 21; var object3= new Object(); object3.name= 'Chris'; object3....
<p>There is indeed. Object Oriented Javascript is the answer to what you want to do here. </p> <p>Here's an example similar to what you've mentioned: </p> <pre><code>var Person = function (firstName) { this.firstName = firstName; }; Person.prototype.sayHello = function() { console.log("Hello, I'm " + this.firstN...
How to mutate an object without duplication? <p>I have this object </p> <pre><code>var originalObj = { shop: [ { id: 1, list: "buy milk", complete: false}, { id: 2, list: "buy bread", complete: false} ] } </code></pre> <p>I would like to change the first item to <code>complete: true</code></p> <pre><code...
<p>Deep copy may have issues sometime. Object.assign() copies the property reference when the property being assigned is an object. It is better you can use the following method.</p> <pre><code>var originalObj = { shop: [ { id: 1, list: "buy milk", complete: false}, { id: 2, list: "buy bread", complete: fals...
Import data from xml file into two tables w/ foreign key at MySQL database <p>I need to load file of the following format into MySQL database.</p> <pre><code>&lt;item value="{$\emptyset $}"&gt; &lt;subitem value="(empty language)"&gt;&lt;/subitem&gt; &lt;subitem value="(empty set)"&gt;&lt;/subitem&gt; &lt;/item&...
<p>I was able to do it by reading xml with python and then inserting it into MySQL database. First one need to install needed software:</p> <pre><code>sudo apt install mysql-server sudo apt-get install python-mysqldb </code></pre> <p>Then this py-file will do the job:</p> <pre><code>import xml.etree.ElementTree impo...
Is there an alternative for .bashrc for /bin/sh? <p>I need a script which is run on startup of <code>/bin/sh</code>, similar to <code>.bashrc</code> for <code>/bin/bash</code>. Is there any way to do this?</p> <p><strong>EDIT:</strong></p> <p>I tried both <code>/etc/profile</code> and <code>~/.profile</code>, I wrote...
<p>I will assume, as is true on debian-ubuntu-like systems, that your <code>/bin/sh</code> is <code>dash</code>.</p> <p>For dash, set the environment variable <code>ENV</code> to have the path to the initialization file of your choice. This would be dash's analog to <code>~/.bashrc</code>.</p> <p>If you are interest...
creating two frontpages in moodle <p>is there anyway to create two homepages for moodle or someway of doing something similar to having a two homepage effect.</p> <p>At my work (educational) we offer qualifications and we also offer online (e-learning) courses.</p> <p>Ideally I want to create one area just for the qu...
<p>What you can do is to have a single front page and then restrict access to individual courses based on their <a href="https://docs.moodle.org/31/en/Enrolments" rel="nofollow">enrollment status</a>. </p> <p>You can add an <a href="https://moodle.org/plugins/enrol_apply" rel="nofollow">additional plugin</a> to allow ...
Using a DLL exported from D <p>I've created a simple encryption program in D, and I had the idea to make a DLL from it and try to import it to, for example, Python.</p> <p>I've could simply call my <code>main</code> function, becouse it dosn't need any params. But when I get to my encrytion method, <strong>it uses dyn...
<p>Well tbh. there's no real elegant way other than wrapping a pointer with a length or wrapping to C arrays and then to D.</p> <p>However you can make a somewhat elegant purpose with the first way using a struct that has a pointer, a length and a property that converts it to a D array.</p> <p>Then the function you e...
Conditional replacement of NAs in two dataframes R <p>Probably simple but tricky question especially for larger data sets. Given two dataframes (<code>df1</code>,<code>df2</code>) of equal dimensions as below:</p> <pre><code> head(df1) a b c 1 0.8569720 0.45839112 NA 2 0.7789126 0.36591578 NA 3 0.6...
<p>We can use <code>colSums</code> on the negated logical matrix (<code>is.na(df1)</code>), negate (!<code>) the</code>vector` so that 0 non-NA elements becomes TRUE and all others FALSE, use this to subset the columns of 'df2' and assign it to NA.</p> <pre><code>df2[!colSums(!is.na(df1))] &lt;- NA df2 # a ...
Facebook not showing proper thumbnail of app image <p>I built an app, the Facebook however does not shows the thumbnail completely. It just crops the image everytime. I have tried with various image sizes but still no success.The open graph data is also included and Fb OG Debugger does not show any error. </p> <p>A ...
<p>Well, that's Facebook. It stretches the image proportionally and that's why it's cropping.</p> <p>Workaround: attach an image itself in the post. Save image as... > save it > click Photo/Video when posting</p>
Seekbar focus not wanted <p>I am using a SeekBar in my layout and I have another View that is a RelativeLayout.</p> <pre><code>&lt;CoordinatorLayout&gt; &lt;RelativeLayout&gt; ... &lt;/RelativeLayout&gt; &lt;SeekBar android:id="@+id/progressSeekBar" android:layout_width="match_parent"...
<pre><code>&lt;SeekBar android:id="@+id/progressSeekBar" android:layout_width="match_parent" android:layout_height="wrap_content" android:progress="70" android:progressDrawable="@drawable/player_seek_bar_progress" android:focusable="false"/&gt; </code></pre>
How to integrate git-aware-prompt with shortened pathname in bash <p>I am using a <a href="https://github.com/jimeh/git-aware-prompt" rel="nofollow">git aware prompt</a> and I would like to integrate it with a shortened version of the path name</p> <p>The shortened pwd is created dynamically with </p> <pre><code>pyth...
<p>I solved the question with @chepner assistance in comments, by replacing <code>\u@\h:\w</code> with <code>$(python ~/.short.pwd.py)</code>.</p> <p>Finally the updated <code>export</code> is</p> <pre><code>export PS1="\${debian_chroot:+(\$debian_chroot)}\$(python ~/.short.pwd.py) \[$txtcyn\]\$git_branch\[$txtred\]\...
Cart checkout function without User logged in <p>Hi everybody i've searched everywhere over the web and can't seem to find an answer to this so here goes.</p> <p>I have a website with Tutor Profiles being listed. The function i would like to achieve is to allow users to be able to shortlist users and have a "checkout"...
<p>As it was already mentioned you can use guest user or store info in <code>session</code> (both approaches are quite similar actually).</p> <p>With <strong>guest user</strong> you will still store his id in session (<code>warden</code> does that for you) and a record in DB (that will be used only while user session ...
Check which value contains property Java WebDriver <p>I'm almost do NOT know Java, but I'm learning and have to write some tests in it using WebDriver &amp; jUnit :) I have already performed some, looks like:</p> <pre><code>import org.junit.Assert; import org.junit.BeforeClass; import org.openqa.selenium.By; import or...
<p>I think you mean "Attributes".<br> you can get those using getAttribute: e.g element.getAttribute("display");</p>
ggplot2 geom_smooth line not showing up on my graph <p>I am trying to add a line through my plotted data using <code>geom_smooth</code>, but I am running into difficulty. </p> <p>Here is my code:</p> <pre><code>plot.BG = ggplot(data) + geom_point(aes(x=Mass_LT, y=BG, colour=factor(Temp.f))) plot.BG + geom_smooth(m...
<p>Aesthetic mappings defined in <code>ggplot()</code> are inherited by subsequent layers. However, if mappings defined in a layer (e.g., inside <code>geom_point()</code>) are local to that layer only. Since you want the same mappings to be used by both the <code>geom_point</code> and the <code>geom_smooth</code> layer...
how to reverse 'list' function to its original input <p>I <code>list</code> some data frames(same structures) to a list to perform <code>lapply</code> to each data frames. But after the lapply i want the list elements back to the original data frames format.</p> <p>Is there any function except for loop to do this?</p>...
<p>Use sapply, manipulate on each data frame in the loop, return it as a list. rename the list to newdt-n and you should be good to go.</p> <pre><code>A &lt;- sapply(1:length(lst), function(i){ a_tmp &lt;- list(lst[[i]]) names(a_tmp) &lt;- sprintf('newdt%s', i) a_tmp }) &gt; names(A) [1] "...
VSTS - How to add Bug using Scrum template - No dropdown <p>I am using Visual Studio Team Services, with the Scrum template. I can't figure out how to add a bug. I HAVE selected the option to treat bugs as backlog items. However, when I go to add a new backlog item, there is no dropdown for the Type (see below screensh...
<p>Configure <a href="https://www.visualstudio.com/en-us/docs/work/customize/show-bugs-on-backlog" rel="nofollow">Bugs as Requirements</a>. This has to be done at the individual Team level. </p>
C++ Visual Studio 2015 “non-standard syntax; use '&' to create a pointer to member” <p>I work with TaskScheduler COM, this is my code:</p> <pre class="lang-cpp prettyprint-override"><code>typedef HRESULT(*FuncOfBoll)(_Out_ VARIANT_BOOL* b); static bool GetBool(FuncOfBoll func) { VARIANT_BOOL b = VARIANT_FALSE...
<p>I am guessing that <code>get_StopIfGoingOnBatteries</code> is a member function of<code>ITaskSettings</code>. Such a function cannot be used when the expected argument type is <code>FuncOfBoll</code>. You'll need to create a wrapper function and use it.</p> <pre><code>ITaskSettings* currentSetttings = NULL; HRESUL...
d3 enter not placing data <p>Using d3, I am reading in 8760 data points (one for each hour of 2013) from a csv into a 2-d array and then trying to create them as circles in an <code>&lt;svg&gt;</code> element. The code successfully imports the data, as I can view it in the browser's console. However, the enter functi...
<p><code>d3.csv</code> is an asynchronous function. The code that creates the circles is executed before your csv data has returned. Place your d3 code inside the callback.</p> <pre><code>&lt;script&gt; var w = 900, h = 500; var dataset = []; d3.csv("Jsorted2.csv", function(error, data) { dataset = data.map...
Change cell subview height after cell animation is ended Swift <p>I use <code>Swift 3.0</code> and have <code>tableViewCell</code> and its subview. I use <code>heightForRowAt</code> function to change <code>cellView</code> height.</p> <p>I have two states of <code>cellView</code>: default and expanded. <code>CellViewS...
<p>Solution that worked for me:</p> <p>I've stopped using <code>bottom equal constraint</code> between <code>cellView</code> and <code>cellViewSubview</code>. Instead of it I've set <code>height constraint</code> to the <code>cellViewSubview</code> and change its height after <code>heightForRowAt</code> is complete.</...
Html dynamic table in JavaScript <p>I'm creating a small system (for personal use) in order to analyze some school marks. In an Html page (<strong>index.html</strong>), I would like to insert a JavaScript script that calculates the averages of the values of <strong>mydata.js</strong> of the same subject and put them in...
<h2>See this <a href="https://jsfiddle.net/lalu050/czxbyahd/" rel="nofollow">fiddle</a></h2> <p>Below given is the relevant part of the JS that I've used</p> <pre><code>for (var i = 0; i &lt; myData.length; i++) { if (myData[i].subject == '1') { avg1 = avg1 + myData[i].value; count1++; } else if (myData[...
Angularjs : 2 different scopes with same object data sharing same behaviour <p>I am making a nested tree structure with checkbox option in angularJs.</p> <p>My object from the backend is as follows.</p> <pre><code> { "2": { "id": 2, "name": "Under Graduate", "slug": "under-graduate", "parent_id": 0, ...
<p>By assigning <code>$scope.a = object;</code> and <code>$scope.b = object;</code>, both <code>$scope.a</code> and <code>$scope.b</code> reference the same object. Therefore, modifying one of them will affect the other. </p> <p>If you would like <code>$scope.a</code> and <code>$scope.b</code> to be independent, you c...
Polymer CLI: build component page <p>Using <code>polymer init</code> you can create an element project and using <code>polymer serve</code> you can serve the component page (showing docs and demo). </p> <p>To serve it, Polymer CLI does some path remapping because the import tags do not match the project structure. Fr...
<p>There is a tool for deploying the component page to github pages.<br> From the <a href="https://www.polymer-project.org/1.0/docs/tools/reusable-elements#publish" rel="nofollow">docs</a>:</p> <blockquote> <p>In the commands below, replace with your GitHub username, and with your GitHub repository name.</p> <pre...
Where can I find the pending amount from invoices in DynamicsAX Database? <p>This is what I already know, Tables for open invoices:</p> <ul> <li>"CustTransOpen"</li> <li>"CustInvoiceJour"</li> <li>"CustTrans"</li> </ul> <p>I've been working on this for a while without a clue, there must be a way to get the pending am...
<p>This is the AX Query to get the open balance in MST for a customer. To do it in SQL, you can rewrite it and/or at least use this to maybe get towards what you want.</p> <p>This code originates from <code>\Data Dictionary\Tables\CustTable\Methods\openInvoiceBalanceMST</code> in AX.</p> <p><code>this</code> below r...
Duplex WCF Project In Visual Studio InvalidOperationException <p>I'm a beginner in C# and I'm trying to build a simple library project the service is working nicely but in client always throw exception in service object</p> <blockquote> <p>InvalidOperationException Could not find default endpoint element that ref...
<p>Your client requires an app.config file that contains the endpoint of your service. Something like this...</p> <p><strong>app.config</strong></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;configuration&gt; &lt;system.serviceModel&gt; &lt;bindings&gt; &lt;wsHttpBinding&gt; &lt;...
performance comparison when arguments are pre-known? <p>I have a function</p> <pre><code>enum Limit {MIN, MAX}; inline int f(pair&lt;int, int&gt; p, Limit l) { return l == MIN ? p.first : p.second; } </code></pre> <p>Compare the computatinal time of <code>f(p, MIN)</code> and <code>p.first</code>, is the first o...
<p>Questions of performance are impossible to answer through prediction. It entirely depends on what optimisations the compiler is able to make.</p> <p>In this contrived case:</p> <pre><code>#include &lt;utility&gt; enum Limit {MIN, MAX}; inline int f(std::pair&lt;int, int&gt; p, Limit l) { return l == MIN ? p....
How can i make bootstrap thumbnail all same height? <p>Heeyy, i am making my website with bootstrap.. but i have some column problems. i want to have columns with text, but when the page get smaller, they start pushing each other down and way. How can i fix that?</p> <p>My website is: <a href="http://www.dev-bunker.nl...
<p>Thats the default behavior of bootstrap. If the content gets too big for the screen size, if will push down the columns on mobile devices.</p> <p>it works like this:</p> <p>the classes col-lg-3, col-md-3 and col-sm-6 override how the class "row" places the columns.</p> <p>the col-lg-3 mean it will use 3/12 of the...
Push Notifications to Ionic app using GCM <p>I'm writing an Ionic app and trying to make Push Notifications to work.</p> <p>I'm using the <a href="https://github.com/phonegap/phonegap-plugin-push" rel="nofollow">phonegap-plugin-push</a> plugin to do so.</p> <p>On the "$ionicPlatform.ready" event I get the device toke...
<p>I got it. The error message was really misleading.</p> <p>The full token returned after registration was something like this:</p> <pre><code>dWWt-ohQFWg:APA91bFBgEU1aRyykLCw2lNat57WSePvbXyiLcCoHh6Tt6dkzXs5HUNl8C4wDL-BgaBrzJJc0lHH8IGQ3zACcfyQEdQmpKTJWOWshWKIH0e_RByg5zkhX0AlvFL4_0DLMzd_Hz1YKZ1g </code></pre> <p>For...
Spinner won't get displayed on running the application <p>I'm trying to work with spinner. I have other views along with the spinner. All other views are displayed and work fine except spinner. Upon execution spinner is not visible at all. It is however displayed in design mode but not upon execution.</p> <p>My XML is...
<p>Fill property is deprecated, use: </p> <pre><code>&lt;Spinner android:id="@+id/spinner" android:layout_width="match_parent" android:layout_height="wrap_content" android:prompt="@string/spinner_title" /&gt; </code></pre>
Firebase support on Authentication <p>I have been evaluating Firebase Mobile backend as service features, I doubt on a authentication support of it. Does Firebase MBaaS support "LTPA" authentication? I could see it supports oAuth anyway.</p> <p>Could anyone tried Firebase help me with your answers and reference on LTP...
<p>Firebase Authentication supports email + password, Google, Facebook, Github, Twitter and anonymous sign-in out of the box.</p> <p>On top of that it allows you to integrate any other authentication by <a href="https://firebase.google.com/docs/auth/server/create-custom-tokens#create_custom_tokens_using_the_firebase_s...
javax.net.ssl.SSLHandshakeException: No negotiable cipher suite when calling Apple APNS using HTTP2 implemented by jetty library <p>I am using this code and it working fine on local server, but not working on BlueMix server</p> <pre><code> public void pushNotification(String notificationTitle, String notificationBody,...
<p>Based on a discussion with the Liberty for Java Team, we think that you are using a down-level version of the JDK. The current level of the buildpack now provides JRE 8.0: SR3 FP11. Try using the latest buildpack so that you can pick up the new JRE levels.</p>
Issue with rails saying a nested model's field is blank when it is not <p>I'm having an issue with getting a nested model to save properly when it has validations. This seems to only be happening to a single field in this model.</p> <p>I have two models, a Veterinarian</p> <pre><code>class Veterinarian &lt; Applicati...
<p>Your expiration date is invalid.</p> <pre><code>"1":{ "number":"Test Number", "expiration_date":"09/16/2020", "_destroy":"false" }, </code></pre> <p>In rails console try,</p> <pre><code>date = Date.parse("09/16/2020") </code></pre> <p>You will get error</p> <pre><code>ArgumentError: invalid date from (i...
How can i get the Execution Transcript log data? <p>Just i would like to know if it's possible to get the execution transcript </p> <p><img src="http://i.stack.imgur.com/wyqRE.png" alt="execution_transcript"></p>
<p>No, you'll have to manually copy the execution transcript.</p>
Ionic Angular Js making 2 requests to server <p>Using Ionic framework 1, </p> <p>Making request using <code>$http.post();</code> but, in the console.. two requests are getting generated. </p> <p>the first request doesn't contain the <code>POST</code> parameters and is blank , while the second request contains the <co...
<p>The first request is the <code>Request Method: OPTIONS</code> request. It checks whether or not the actual request is safe to send. It is also called 'preflighted request'</p>
Using variance to convert a parent class (ObservableCollection) to a child <p>Until I tried to do this, I assumed that I knew how this worked; however, the following code throws an exception. Because <code>TestOC</code> is a child of <code>ObservableCollection</code>, I thought I could do this:</p> <pre><code>class M...
<p>You cannot cast an <code>ObservableCollection&lt;MyClass&gt;</code> to <code>TestOC</code>. </p> <p>Because it is derived. Meaning <code>TestOC</code> extends <code>ObservableCollection&lt;MyClass&gt;</code>. So if you want to cast an <code>ObservableCollection&lt;MyClass&gt;</code> to <code>TestOC</code>, it is mi...
When I pressed quickly play button, sound play has failure <p>I'm working on my first Android project. So i litle novice. </p> <p>I have 3 buttons for playing sounds. At the same time this sounds has looping.. When pressed play/pause button (iv) everything is normal but when i pressed quickly to play/puse button the s...
<p>The solution: I used <code>soundPool.autoPause();</code> instead of <code>soundpool.stop(soundID)</code></p>
display content of json <p>I'm trying to display data from a JSON I retrieve using <code>$.getJSON</code> but the following code comes back as <code>undefined</code>. I'd like to display all the data within a new row of a table for example:</p> <pre class="lang-js prettyprint-override"><code>var sales = $.getJSON(_r...
<p><code>$.getJSON</code> is an asynchronous operation. You are getting a promise back instead of your object that you are expecting.</p> <p>try this instead:</p> <pre><code> $.getJSON(_routes['salesInAMonthJS'], { month: "September 2016" }).then( function(d){ console.log(d); }); </code></pre> <p><...
Import database table (specific row) based on matching validator <p>I have a database running now that has had all data in the "leads column" / "phone number row" removed. I have created an updated csv file that has most of the phone numbers present in addition to the client name, email and address. </p> <p>How can I ...
<p>This sounds like the perfect fit for an SSIS package! (this is assuming you are referring to SQL Server...since you didnt list an RDBMS it is just a guess)</p> <p>Some SSIS package basics materials:</p> <p><a href="http://www.codeproject.com/Articles/155829/SQL-Server-Integration-Services-SSIS-Part-Basics" rel="no...
How to assign decimal to variable on windows command line? <p><code>echo %time:~-5%</code> returns a 5-character string, such as <code>18.09</code></p> <p>However, i cannot seem to set that string to a variable:</p> <pre><code>set start = %time:~-5% echo %start% </code></pre> <p>returns <code>10:07:18.09</code></p>...
<h1>Simply:</h1> <pre><code>set start=%time:~-5% set new=%start:~6% set new=%start:~6,5% echo %new% </code></pre> <p>Choose one of line 2 and line 3.</p> <h1>Syntax:</h1> <pre><code>%variable:~skip% %variable:~skip,keep% </code></pre> <p><strong><code>skip</code>, <code>keep</code>:</strong> A positive or negative...
Disable hits and use exclusively inner_hits <p><strong>>Beginner here.</strong></p> <p>I have made a architecture for my profile - photo's application. In this application user can search for member by member's attributes and photo's attributes. And returned is only the photo's that have matched the query.</p> <p>The...
<p>Duplicate of: <a href="http://stackoverflow.com/questions/35589084/elasticsearch-return-only-nested-inner-hits">Elasticsearch: Return only nested inner_hits</a></p> <p><strong>Quoting:</strong> Should be able to achieve it by disabling source-field at top-level by specifying "_source" : false</p> <pre><code>POST ...
Inside an array, how to check forript? <p>So I will be constantly retrieving an object with the following format: </p> <pre><code>student: { "student_id": "12345", "location": "below", }, ] }, ] </code></pre> <p>Thank you and will accept answer and upvote!</p>
<p>Something like this should do the trick:</p> <pre><code>var students = []; function addStudent(student) { // Check if we already know about this student. var existingRecord = students.find(function (s) { return s.student_id === student.student_id; }); var classInfo = { class_number: student.class_...
Same data is inserted during insert <p>I have couple insert queries which are merged in transaction. First of that insert is to create new product articel number incrementing the most higher in table by one. Unfortunetly i just noticed that <code>mostly</code> during tests if for instance two users from two diffrent ap...
<p>Just about the only way to assure that users are not assigned the same values is to issue them from the server when the row is inserted. It is the entire premise behind the server issuing AI values for PKs.</p> <p>BUT since your thing is a multi-segment, "numeric string" that presents a problem. Rather than teari...
data.table column number in .SDcols <p>I want to exponentiate every column sepecified in .SDcols, by the column number of every column, is that possible?</p> <p>I think it's possible if one can get information about the columns like col number.</p>
<p>We can use <code>Map</code> to do this. Suppose, if we are changing the first and second columns ('i1'), specify it in the <code>.SDcols</code>, and with <code>Map</code> we apply the function on each column of Subset of Data.table (<code>.SD</code>) with the corresponding index specified in 'i1' and assign (<code>...