input
stringlengths
51
42.3k
output
stringlengths
18
55k
Identityserver3 - HybridFlow not returning profile scope <p>I have set-up identityserver3 and MVC4 client using <a href="https://identityserver.github.io/Documentation/docsv2/overview/mvcGettingStarted.html" rel="nofollow">this</a> tutorial. When I configured client to use 'Implicit' flow things are working as expecte...
<p>When you only ask for an id_token all the claims for the user are in the id_token. When you change your request to get a token (either by asking for code or token) then only the user claims configured as "AlwaysInclude" are included in the id_token. The rest must be retrieved from the user info endpoint using the ac...
send_mail is clearly sending email but no email is showing up in inbox <p>I have these email settings in my <code>settings.py</code></p> <pre><code>EMAIL_USE_TLS = True EMAIL_HOST = 'smtp.gmail.com' EMAIL_HOST_USER = 'email@myemail.com' EMAIL_HOST_PASSWORD = 'password' EMAIL_PORT = 587 </code></pre> <p>and am using t...
<p>Try to add the following in settings.py</p> <pre><code>EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' DEFAULT_FROM_EMAIL = EMAIL_HOST_USER </code></pre>
Update React component by key <p>I have a React app that has a tabbed interface of open files. The open files array looks like this:</p> <pre><code>[ { name: 'file1', path: '/path/to/file1', fileContents: '...' }, { name: 'file2', path: '/path/to/file2', fileContents: '...' }, { ... } ] </code></pre> <p>Which a...
<p>Keys shouldn't be used to access components. They're just used to let react keep track of the components within that scope. I'd just use <code>i</code> for your key (so that React doesn't lose track of the components) and use ref (<code>&lt;div key={i} ref={(f) =&gt; this[file.name] = f} /&gt;</code>) to access the ...
Where does my MessageWebSocket.OutputStream dispose? <p>I'm struggling to find out where my <code>MessageWebSocket.OutputStream</code> disposes.</p> <p><strong>WebsocketManager():</strong></p> <pre><code>public WebsocketManager() { baseInit(); } </code></pre> <p><strong>baseInit():</strong></p> <pre...
<p>I was able to fix the problem. Before I send data, I was always creating a new DataWriter. Now I only create one DataWriter which gets initializied when I connect the WebSocket to the server.</p> <p>I guess the problem was that when the datawriter got cleaned by the garbage collector, the outputstream got closed. I...
passing font size to user control tool tip in Winform C# project <p><strong>Question:</strong> I have a Winform C# project that changes the tool tip text of a user control tool tip when passed from a host project. I need to pass font size as a variable, but dont know where to make the changes. I have tried a plethora o...
<p>Set <code>OwnerDraw</code> on <code>ToolTip</code> to <code>true</code>, in <code>ToolTip</code>'s <code>Draw</code> event set the desired font, then in <code>Popup</code> event measure and set the size of your <code>ToolTip</code>, as is explained in the example <a href="https://msdn.microsoft.com/en-us/library/sys...
.htaccess redirect URL with id param to human friendly URL <p>I'm trying to create a URL redirect but so far everything I have tried just hasn't shown any effect on the site. I know ModRewrite is enabled as there are other rewrites taking place. The whole purpose of this is to handle old URLs from the former version of...
<p>You can use these 2 rules in your site root .htaccess:</p> <pre><code>Options -MultiViews RewriteEngine On # external redirect from actual URL to pretty one RewriteCond %{THE_REQUEST} /resources/view\?id=(\d+) [NC] RewriteRule ^ /resources/%1? [R=301,L,NE] # internal forward from pretty URL to actual one RewriteR...
swift turn-by-turn mapping ios <p>Are there anyway to do turn-by-turn mapping like the googlemaps app with mapkit? like picture down bellow. Thanks</p> <p><a href="http://i.stack.imgur.com/R8C4u.jpg" rel="nofollow"><img src="http://i.stack.imgur.com/R8C4u.jpg" alt="enter image description here"></a></p>
<p>You want to use turn-by-turn navigation inside your app I guess? In MapKit you can show routes by coordinates(<a href="https://www.raywenderlich.com/110054/routing-mapkit-core-location" rel="nofollow">tutorial for iOS9</a>), but as You can see, there is no voice commands etc. </p> <p>If you want user to navigate in...
How to find out active members during a specific period (month) in cassandra? <p>In the following real-world scenario:</p> <p>Users come to a club (e.g. : gym) and purchase a membership for an indefinite amount of time and after a specified amount of time the membership is cancelled. After the membership cancelled, th...
<p>The simple fact that your PK consists of</p> <blockquote> <p>PK (member_id, event_type_id, event_time)</p> </blockquote> <p>makes your question hard to solve, and at least inefficient because you need to query all partitions without being able to filter any record at database level (basically you must perform a ...
How to generate swagger.json using gradle? <p>I want to use swagger-codegen to generate REST clients and possibly static HTML documentation.</p> <p>However, swagger-codegen needs swagger.json for input.</p> <p>I am aware, that I can get this from a running REST server equipped with Swagger.</p> <p>But is there a way...
<p><strong>Gradle</strong></p> <pre><code>// https://mvnrepository.com/artifact/io.springfox/springfox-swagger2 compile group: 'io.springfox', name: 'springfox-swagger2', version: '2.0.1' </code></pre> <p><strong>Java code , If you are using spring then It will help</strong></p> <pre><code>@Configuration @EnableSwag...
Git: cannot do a partial commit during a merge (SourceTree) <p>After updating the SourceTree to it's latest version I am fighting with this issue. Assume following scenario:</p> <p>There are file <strong>A</strong>, <strong>B</strong> and <strong>C</strong> under the version control and there is just one branch. In my...
<blockquote> <p>fatal: cannot do a partial commit during a merge.</p> </blockquote> <p>This indicates that your merge is still in progress, there could be some conflicts which you still need to resolve.</p> <p>Please select <em>Conflicts</em> from the drop down box as screenshot and you should be able to see a list...
Line height/font size is variable visual studio 2015 update 3 <p>The line height or font height is variable in Visual Studio 2015 and it's driving me nuts. I am using <a href="http://tobiasjung.name/profont/" rel="nofollow">ProFontWindows</a> because I like to have more code on my screen without the need to scroll whil...
<p>This is a setting of the Productivity Power Tools. Go to <code>Options</code>, <code>Productivity Power Tools</code> then <code>Other Extensions</code> and disable both checkboxes that relate to <code>Syntactic line compression options</code>.</p>
Alexa lambda_handler not creating event session <p>I am having a problem getting my python lambda function to work. I get an invalid key for the event array that should be created when the skill is invoked. The error I get is:</p> <pre><code>{ "stackTrace": [ [ "/var/task/lambda_function.py",...
<p>The problem was I had configured the wrong test in the Lambda Function dashboard. When I changed it to an Alexa Start Session, the event object got created. :)</p>
Jenkins integration to Protractor project <p>I am try to do Jenkins integration for my protractor project.I am using Protractor, Jasmine to write the test. I configure the project in Visual studio with nodeJs.</p> <p>I can run all test manually.Now, I am aiming to try the Jenkins integration so my project can run cont...
<p>Jenkins can run your build jobs. But first you need to create a build job that will run your script. To do this:</p> <ol> <li>Make sure your program is available to jenkins from your VCS (ie- your git repository).</li> <li>Create a build job that will check out your project</li> <li>In this build job, create a scri...
Is it possible to change a users SFTP password (renci.sshnet) <p>Does anyone know if it is possible to programmatically change a users password on an SFTP site using SSH.NET library (Renci.SshNet)? I have not been able to find anything definitive either way.</p> <p>If it is I would appreciate any pointers you can pro...
<p>No. While there's an API in the SSH protocol to change a password on request, the explicitly request is not implemented by the SSH.NET library.</p> <p>In the SSH.NET library, you can only only change the password, if the server asks for it. Typically a servers asks for a password change, when the previous password ...
Best way to display files from directory and from FTP server using Swing components <p>I am looking for best way to display files. Should I use <code>JTable</code> or is there another way of displaying files?</p> <p><a href="http://i.stack.imgur.com/hlZ1j.jpg" rel="nofollow"><img src="http://i.stack.imgur.com/hlZ1j.jp...
<p>You can try with a <code>JTree</code>.</p> <p>See <a href="http://www.codejava.net/java-se/swing/jtree-basic-tutorial-and-examples" rel="nofollow">JTree basic tutorial and examples</a> for more details.</p>
SQL Server - Update field in all table records, using a field from the same table and values from other table <p>I have this scenario:</p> <p>Table <code>Territory</code></p> <pre><code>ID (int) - CODE (varchar) - NAME (varchar) </code></pre> <p>Data:</p> <pre><code>1 - GB - UNITED KINGDOM 2 - GB - ISLE OF MAN 3 - ...
<p>What you are looking to do is a <em>Bad Idea</em>. It is a good thing that you recognize this is a bad Idea. But for those reading this question and do not understand why it is bad, this violates the <a href="https://en.wikipedia.org/wiki/First_normal_form" rel="nofollow">First normal form (1NF) principle</a>. Which...
Get all column's qualifier that matches regex <p>Is it possible get all of the column qualifier's names with pattern matching? E.g. Get all column's qualifiers that starts with myNeeded_</p> <p>Thank you.</p>
<p><strong>Answer is Yes</strong>. Use <code>ColumnPrefixFilter</code>.</p> <pre><code> ColumnPrefixFilter columnPrefixFilter = new ColumnPrefixFilter(qualifierPrefix); Scan scan = new Scan(); scan.setFilter(columnPrefixFilter); </code></pre> <p><a href="http://www.programcreek.com/java-api-examples/index...
Singleton - Impl. using static class member vs. static member variable <p>Bring you two different implantation of singleton design pattern:</p> <h3>static class member</h3> <pre><code>class SingletonCSM; using SingletonCSMSp = std::shared_ptr &lt; SingletonCSM &gt; ; class SingletonCSM { public: ~SingletonCSM()...
<p>When you put a <code>static</code> variable inside a function it is created the first time the function is called so it is guaranteed to have been instantiated to <strong>all</strong> callers of the function.</p> <p>Members that are declared <code>static</code> could be instantiated before or after you call your fu...
Not able to open the deck UI for spinnaker <p>I installed spinnaker using the command</p> <pre><code>bash &lt;(curl --silent https://spinnaker.bintray.com/scripts/InstallSpinnaker.sh) </code></pre> <p>on a local ubuntu machine. </p> <p>After installation I am not able to connect to the Deck UI of spinnaker using URL...
<p>Check logs in /var/log/apache2 for errors, and /etc/apache2/ports.conf to see if it is is listening on 127.0.0.1:9000</p> <p>The install script should have made those changes for you, but maybe you had a permissions issue or some other kind of local system policy preventing the installation from working properly.</...
Dynamicaly fetch associated entities <p>I have 3 entities</p> <p>Project.java</p> <pre><code>@Entity public class Project { @Id @GeneratedValue private Long id; @Column(nullable = false) private String name; @OneToMany(mappedBy = "project", fetch = FetchType.LAZY) private List&lt;Project...
<p>You can use follwoing annotations to solve the infinite recursion problem : @JsonManagedReference and @JsonBackReference.</p> <p>Use @JsonManagedReference in User.java and Project.java for variable "projectReviews" and @JsonBackReference for "reviewer" and "project"</p> <p>If you are not able to get reviewer and p...
Django using functions from a python class from frontend? <p>I am new to Django, but i managed to create the back-end and front end for my website but in the front end i am connecting to an external socket and getting data on the fly and i implemented a class that has the function <code>add_data2GraphDB(Data)</code> th...
<p>You can start providing an api point to your Django app that will take parameters from the request body (or/and request parameters) and call your function. So create an url like <code>/api/add2grah</code>. And you call it in the front end with a classic async call.</p> <p>Now if your function takes a long time, you...
spring-boot-maven-plugin >= 1.4.0 jar structure changes <p>I have a spring-boot project where all integration tests are in separate module which starts the application module using <code>spring-boot-maven-plugin</code> during the <code>integration-test</code> phase and executes the suite against it. This construct wor...
<p>Hm, there've been plenty of changes in testing recently, so did you check the <a href="https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-1.4-Release-Notes" rel="nofollow">upgrade notes for 1.4.0</a>?</p>
How to create loader filling dots background as animation? <p><img src="http://i.stack.imgur.com/DlGzk.png" alt="Here is the img."></p> <p>Dots on this img should be filling background. Only jquery animation. How to create this? Canvas? Any ideas?</p>
<p>Try this <a href="http://jsfiddle.net/AlexanderPechkarev/o10yhn56/10/?utm_source=website&amp;utm_medium=embed&amp;utm_campaign=o10yhn56" rel="nofollow">jsfiddle.net</a>, simply change your logic by defining how and when to change opacity.</p> <p>CSS</p> <pre><code> .circleBase { border-radius: 50%; behavior...
Marker icon colors on map are not showing also i want to add title on my map <p>I am working on asp.net MVC 5 I have added a Google api v3 map into my project </p> <p>I have added different icon colors for my markers but they are not visible, just only red standard icon </p> <p>Bellow i have included this</p> <pre>...
<p>You forgot to the <strong>increment the <code>iconCounter</code></strong> value :-)</p> <p>So Please Change:</p> <pre><code>var marker = new google.maps.Marker({ position: new google.maps.LatLng(locations[i][1], locations[i][2]), map: map, icon: icons[iconCounter] }); </code></pre> <p>...
Reverse the list while creation <p>I have this code:</p> <pre><code>def iterate_through_list_1(arr): lala = None for i in range(len(arr))[::-1]: lala = i def iterate_through_list_2(arr): lala = None for i in range(len(arr), 0, -1): lala = i </code></pre> <p>Logically, iterating throug...
<p>Well designed test shows that first function is slowest on Python 2.x (mostly because two lists have to be created, first one as a increasing range, second one as a reverted first one). I also included a demo using <code>reversed</code>.</p> <pre><code>from __future__ import print_function import sys import timeit ...
App crashes after add a new content to html <p>I need to reload <code>GridView</code> on the tab click event. I wrote the next code:</p> <pre><code>&lt;script&gt; function OnTabClickEvent(s, e) { var tableUrl; switch (e.tab.Index) { case 0: tableUrl = '@Url.Action("CGri...
<p>Try this:</p> <pre><code>&lt;script&gt; function OnTabClickEvent(s, e) { var tableUrl; switch (e.tab.Index) { case 0: tableUrl = CGridView.PerformCallback(); // where CGridView is the name of the grid view break; default: t...
iOS best way to download bulk images <p>In my app, I have to download nearly 500 images as I open a ViewController. Downloading all 500 images at a time is not a right idea. I'd like to keep 5 active asynchronous downloads at a time. When any one in five is completed, it should start the next. </p> <p>I also have a re...
<p>I would use an OperationQueue like this</p> <pre><code>let queue = OperationQueue() queue.maxConcurrentOperationCount = 5; for url in imageUrls { queue.addOperationWithBlock { () -&gt; Void in let img1 = Downloader.downloadImageWithURL(url) NSOperationQueue.mainQueue().addOperationWithBlock({...
Nesting mpi calls with mpi4py <p>I am trying to use mpi4py to call a second instance of an mpi executable.</p> <p>I am getting the error:</p> <pre><code>Open MPI does not support recursive calls of mpirun </code></pre> <p>But I was under the impression that is exactly what Spawn is supposed to be able to handle - i....
<p>The following code seems to perform the way I wanted.</p> <pre><code>#!/usr/bin/env python from mpi4py import MPI import numpy import sys import os rank = MPI.COMM_WORLD.Get_rank() new_comm = MPI.COMM_WORLD.Split(color=rank, key=rank) print(new_comm.Get_rank()) cwd=os.getcwd() os.mkdir(str(rank)) directory=os.pat...
Clicked 'Cherry-Pick` on accident in Android Studio and now project seems like it is messed up <p>I clicked the "Cherry-Pick" button in the "Version Control" tab at the bottom of Android Studio and it seems like all hell has broke loose.</p> <p>I have these tags around my code in some classes:</p> <pre><code>&lt;&lt;...
<p>You have a merge conflict. You have made changes to files that are also changed in the cherry picked commit, and git can't figure out which changes to use, so it's showing both options.</p> <p>See (for example) this question for more information: <a href="http://stackoverflow.com/questions/161813/how-to-resolve-me...
UI is getting blocked when fetching video duration from AVURLAsset in dispatch_async <p>I have 2 View Controllers Home and Home Details. In Home I have a table view in which I am showing thumbnail and duration of a video. When I click on a particular row it's details are shown in Home Details. On returning back I am up...
<p>You need to load the duration asynchronously, like this:</p> <pre><code>- (void)videoDuration:(NSURL *)videoURL completion:(void (^)(CMTime))durationCallback { AVURLAsset *videoAVURLAsset = [AVURLAsset assetWithURL:videoURL]; [videoAVURLAsset loadValuesAsynchronouslyForKeys:@[ @"duration"] completionHandle...
Several special IP connect to server with ssh <p>I want Several special IP connect to my server with ssh and block any another ip</p> <p>what do you think about solve this question؟</p> <p>i have centos 7</p> <p>firewall is CSF</p> <p>I use cpanel &amp; whm</p>
<p>You can setup limited IP access for the WHM and SSH with the /etc/hosts.allow file. You can edit this file through command line OR WHM, For the WHM please try with WHM >> Security Center >> Host Access Control </p> <p>Here are the some information from cPanel documentations.</p> <p><a href="https://documentation...
Do AND, OR strings have special meaning in PLY? <p>When using PLY (<a href="http://www.dabeaz.com/ply/" rel="nofollow">http://www.dabeaz.com/ply/</a>) I've noticed what seems to be a very strange problem: when I'm using tokens like <code>&amp;</code> for conjunction, the program below works, but when I use <code>AND</c...
<p>Ply has a slightly eccentric approach to ordering token regular expressions, in part because it depends on the underlying python regular expression library. Tokens defined with functions, such as your <code>number</code> token, are recognuzed in the order they appear, and unlike many lexical scanner generators, Ply ...
value of variables are not displayed via debugger <p>I am trying to learn how the debugger is working, so i created the below example and placed a breaking point at the line mentioned below in the code. When i ran the debugger, I expected the to see only the value of the varibale "a" on the screen, but actually what ha...
<p>You've stopped the device during <code>onResume</code>. At this point nothing has actually been drawn, instead you've set the text values. After this function completes, the UI will get to be redrawn, and you'll see the changes. This is an optimisation that most UI development code makes.</p>
Sequelize caching with node-cache-manager <p>I'm trying to introduce the simplest caching layer in my webapp, all I want to do is cache the results from a few queries for 24 hours as that is how often the DB receieves new data. I'm trying to use node-cache-manager (which looks great) but struggling! I don't think I com...
<p>I could not get this to work as per the examples given, I had to specifically set and get the key value pair to and from the cache each time.</p> <p>Now it works fine, structured as below:</p> <pre><code>memoryCache.get(cacheKey, function(err, result) { if (result !== undefined){res.json({billingAddress12LastN...
Why does my app rotate without animation? <p>I have an app with an animated splashscreen and a main interface.</p> <p>To transition from the splashscreen to the main interface I used this code:</p> <pre><code>presentViewController(mainViewController, true) { UIApplication.sharedApplication.keyWindow.rootViewContr...
<p>According to UIWindow documentation;</p> <blockquote> <p>If the window has an existing view hierarchy, the old views are removed before the new ones are installed.</p> </blockquote> <p>Source Link -> <a href="https://developer.apple.com/reference/uikit/uiwindow#//apple_ref/occ/instp/UIWindow/rootViewController...
Unselecting radio buttons using AngularJS and Ionic <p>I'm creating a Survey app using Ionic and AngularJS 1.x and I am stuck trying to send the correct data when the user submits the form. </p> <p>When a question has a group of radio buttons (answers), my app marks the answer as "selected" when the user hit one of th...
<p>That is not how a radio button works in angularjs.</p> <p>You must have the same model for every radio buttons. And then the value will be the one that is selected. </p> <pre><code>&lt;ion-radio name="{{q.question}}" ng-if="q.is_simple == 1" ng-repeat="a in q.answers" ng-model="m...
Lambda return only 200 respose code <p>I have created a sample lambda function for producing success &amp; error responses. function is like below</p> <pre><code>exports.handler = (event, context, callback) =&gt; { if(event.val1=="1") { callback(null, 'success'); }else { callback(true, 'fail'); } }; </code></pre> <...
<p>You may want to look at API Gateway's new simplified <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-create-api-as-simple-proxy-for-lambda.html" rel="nofollow">Lambda proxy</a> feature.</p> <p>Using this you can define your status codes, return headers and body content directly fro...
Find all child and grandchild nodes from given parent id PHP <p>I am working in referral system. let's say user A invites user B and user C. And then User B invites user D and user C invites user E and so on. How can i iterate through all the child and grandchild node?</p> <p>Here is the example data in my db</p> <p...
<p>This should do, assuming <code>$downline_query</code> contains all the rows you need. IE 1 DB query.</p> <pre><code>$affilites = []; $parents = [] foreach($downline_query as $row){ if( $row['referral_id'] ){ if( !isset( $affilites[$row['referral_id']] ) ){ $affilites[$row['referral_id']] = [...
Search response time doubled erratically <p>Our system recently faced a CPU usage spike and the underlying reason is still unknown. We have faced high memory usage and disk alerts in the past, since we run a nightly job of bulk indexing, updating almost all our docs. But high CPU usage has not been a problem.</p> <p>T...
<p>Node 03 definitely seems to have undergone heavy indexing. </p> <pre><code> "bulk": { "threads": 8, "queue": 0, "active": 0, "rejected": 0, "largest": 8, "completed": 9528532 </code></pre> <p>I compared N...
How to change font size, color, type and create bullets when sending a mail from perl script <p>I have a perl script which is capable of sending mail to a certain list of users and user reads it in their MS Office Outllook.</p> <p>I was wondering if it is possible to set the font size, color and type for the mail body...
<p>"Rich text" in an email is just HTML. If you can do it in HTML then you can do it in email. Just replace the plain text with an HTML version. And add a "Content-type: text/html" header.</p> <p>You don't say anything about what tools you're using to create and send the email, so it's hard to be much more help. Excep...
java.lang.NoSuchMethodError: No static method getDrawable(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable; <p>I updated Android Studio to 2.2 and my project won't build anymore. My Activity's super.onCreate(savedInstanceState) gives me an error:</p> <pre><code>java.lang.NoSuchMethodError: No static meth...
<p>I was able to resolve this problem. Under my /libs folder I had an old android-support-v13.jar that got compiled with gradle. My app tried to use the ContextCompat class of this .jar and the class didn't have the static getDrawable(Context) method. Removing this .jar solved my problem.</p>
Siddhi CQEngine used within filter section <p>My incoming event contains userId property. I'd like to be able to read the parameter value according to userId from the CQEngine. Should I implement this as extension of FunctionExecutor and use it like:</p> <pre><code>define stream cseEventStream (userId string, symbol s...
<p>You can go ahead with a <code>FunctionExecutor</code> and implement initialization logic within either <code>init()</code> or <code>start()</code>. Both will be called once per function usage. Calling order is <code>init()</code> followed by <code>start()</code>. However, as per API doc, it's advised to use <code>st...
General Search with array of objects <p>Anyone knows if it is possible to do the following search in elasticsearch without using scripts.</p> <p>Any suggestion it is welcome, as I couldn't find anything in the documentation.</p> <pre><code>{ "query": { "match": { "brands.*.shirts.colors": "red" } } ...
<p>Try with <code>query_string</code> like this:</p> <pre><code>{ "query": { "query_string": { "query": "brands.\*.shirts.colors:red" } } } </code></pre>
What is the purpose of the <noscript> element? How can use it? <p>I found this tag, page source in Stack Overflow! </p> <pre><code>&lt;noscript&gt; &lt;div id="noscript-warning"&gt;Stack Overflow works best with JavaScript enabled&lt;img src="http://pixel.quantserve.com/pixel/p-c1rF4kxgLUzNc.gif" alt="" class="dno"&...
<p>The <code>&lt;noscript&gt;</code> tag defines an alternate content for users that have disabled scripts in their browser or have a browser that doesn't support script.</p>
Cannot Modify Headers Information - Wordpress IDX <p>I have located the line that is the culprit from the Header Error line:</p> <p><em>Warning: Cannot modify header information - headers already sent by (output started at /home/prissy/public_html/wp-content/themes/tortuga/header.php:11) in /home/prissy/public_html/wp...
<p>The file: <code>/home/prissy/public_html/wp-content/plugins/dsidxpress/client.php on line 483</code> wants to send data after the theme has been set up and the header is already spitting out it's HTML. So my guess would be that the hook on which the plugin is trying to change headers is being called too late. The ho...
Can't enable tail call optimization in node v6.4.0 <p>I wan't to play around with tail call optimization in node/es2015, but I keep getting <code>RangeError: Maximum call stack size exceeded</code>. So I tried a very simple test function: </p> <pre><code> function countTo(n, acc) { if(n === 0) { return acc;...
<p>Using node v6.5.0, the following works :</p> <pre><code>function countTo(n, acc) { 'use strict'; if(n === 0) { return acc; } return countTo(n - 1, acc + n); } console.log(countTo(100000 , 0)); </code></pre> <p>Running with <code>--harmony-tailcalls</code> flag :</p> <pre><code>node --harmony-tailcalls...
angular 2 - how to import / inject a component during runtime <p>Let's say that there are two views of product, and I want to show one of those views based on user preferences.</p> <p>I am thinking to have two views <code>&lt;my-product&gt;</code> maintained at two different folders and after user logged in, I want to...
<p>Why not just have an *ngIf on two elements that will swap based on the users preference?</p> <pre><code>&lt;my-product1 *ngIf="userPref1"&gt;&lt;/my-product1&gt; &lt;my-product2 *ngIf="!userPref1"&gt;&lt;/my-product2&gt; </code></pre> <p>Where userPref1 is a variable (or function) located on App.Component that get...
Pagination with changing content <p>This is a known issue for every developer when using pagination. I did not found any simple solutions, except using something complicated like google pagination cursor.</p> <p>We have the next scenario: Our pagination object has 5 items per page and 10 items in total</p> <ol> <li>P...
<p>Use the ID of the news-item to offset your DB-limit.</p> <p><code> $offset_id = $_GET['offset']; $sql = "SELECT * FROM `table` WHERE `id`&gt;'".$offset_id."' LIMIT 5"; </code></p> <p>Note: The code above is vulnerable to SQL-injections, using the code above your responsibility, it's just an example.</p>
How to explicitly reference core classes in Ruby? <p>I'm working with Chef, and I have run into a situation where I need to use the Ruby <code>File.dirname()</code> class method. Problem is, Chef has it's own <code>Chef::Resource::File</code> class which is resolved when executing code within a <code>ruby_block</code> ...
<p>Prepend the class name with <code>::</code>, i.e., <code>::File</code>.</p>
Conditional command from Raster Calculator transfer to R <p>So far I used the following statement in the Raster Calculator of ArcGIS:</p> <pre><code>Con(("Land_use.rst" == -20), "Export.rst") </code></pre> <p>This calculates a new Raster which only contains the Data from Export where Land_use equals -20. That is exa...
<p>I don't habe your data, so I cant reproduce your error. However this is how I would do it with dummy data:</p> <pre><code>#create dummy matrix a &lt;- matrix(c(10,10,10,10,10,10,10,10,10),nrow=3) b &lt;- matrix(c(-20,-20,-20,3,3,3,4,4,4),nrow=3) #create raster from matrix r1 &lt;- raster(a) r2 &lt;- raster(b) #Cr...
add environment to cron in order to make pulseaudio work <p>running aplay in command line work correctly The result of: sudo service cron status</p> <p>Is: Sep 21 14:49:01 ag CRON[5450]: (ag) CMD (env ; /usr/bin/aplay -q /home/ag/alarm.wav >> /home/ag/cron.log 2>&amp;1)</p> <p>Sep 21 14:47:01 ag pulseaudio[5350]: [p...
<p>Sorry - I dont know how to delete the Question</p>
Android - Populating data into a list view <p>I am trying to populate data from an sqlLite Database into a list view. </p> <p><strong>Below is the code where I am trying to fetch the data into a listview using cursoradapter.</strong></p> <pre><code>public class TransactionActivity extends AppCompatActivity { DBOpera...
<p>In your <code>bindView(View, Context, Cursor)</code> method from the <code>Myadapter</code> class:</p> <pre><code>TextView Accnameview = (TextView)findViewById(R.id.textView); TextView Incomevalueview=(TextView)findViewById(R.id.textView2); </code></pre> <p>You need to call <code>findViewById(int)</code> on the <c...
Put most nonUI code in background thread? <p>Is it a good idea to put most of the non UI code in background thread to improve the UI experience? Especially in ViewDidLoad? Below is my viewDidLoad code and I have made comment about where I think I could put background thread</p> <pre><code>override func viewDidLoad() {...
<p>Moving an operation to background thread improves user experience only in situations when the operation delays rendering of the screen. This happens in two situations - when the operation is CPU-intensive, and when the operation goes into a wait state, e.g. to wait for a network request to complete.</p> <p>We can e...
Python - separate duplicate objects into different list <p>So let say I have this class:</p> <pre><code>class Spam(object): def __init__(self, a): self.a = a </code></pre> <p>And now I have these objects:</p> <pre><code>s1 = Spam((1, 1, 1, 4)) s2 = Spam((1, 2, 1, 4)) s3 = Spam((1, 2, 1, 4)) s4 = Spam(...
<p>I would group together the objects in a dictionary, using the <code>a</code> attribute as the key. Then I would separate them by the size of the groups.</p> <pre><code>import collections def separate_dupes(seq, key_func): d = collections.defaultdict(list) for item in seq: d[key_func(item)].append(i...
ListBox bind to ObservableCollection is not updated with collection <p>I have next model:</p> <pre><code>public class MyModel { public ObservableCollection&lt;MyObject&gt; MyList {get; set;} } public class MyObject { MyObservableDictionary MyDictionary {get; set;} } public class MyObservableDictionary : Obse...
<p><code>ObservableCollection</code> is able to notify UI about changes when collection itself is changed(elemends are added or deleted). But <code>ObservableCollection</code> is not aware of changes that are happening when you modify one of it's items. To solve the problem you may subscribe to <code>CollectionChange</...
Dynamic Number of UILabels in custom tableviewcell <p>I created a custom tableview cell and I want to display some strings in that cell. I fetch strings from backend thus I don't know how many labels I needed. I tried to concat strings in one label and implemented like below however I want to display strings with diffe...
<p>It sounds like you want to change the attributes such as formatting of a section of text within a UILabel. You can do this by:</p> <ol> <li>Creating an attributed, mutable copy of your string (a.k.a converting an NSString into an NSMutableAttributedString).</li> <li>Changing the attributes to parts of this copy.</l...
How do I retrieve the value of parameter from controller to view? <p>These is what I have, I'm using Codeigniter MVC.</p> <p>CONTROLLER</p> <pre><code>public function index() { $sample = "call: 887-65-31"; $this-&gt;load-&gt;view('contact_view', $sample); } </code></pre> <p>now how do i retrieve it on con...
<p>Try this:</p> <p><strong>Controller</strong></p> <pre><code>&lt;?php class Example extends CI_Controller { public function index() { $viewData['sample'] = "call: 887-65-31"; $this-&gt;load-&gt;view('contact_view', $viewData); } } </code></pre> <p><strong>View</strong></p> <p><em>then <str...
How to click confirm navigation box with protractor <p>I am running multiple cases using --suites config in protractor. I have to launch my webapp newly for each case but my app is having an alert which will be pop out for the confirmation [Stay on this page or Leave the page] whenever the page reloads or closed. In th...
<p><a href="http://www.protractortest.org/#/api?view=webdriver.WebDriver.prototype.switchTo" rel="nofollow">Switch to</a> the alert and <em>accept</em> it:</p> <pre><code>browser.switchTo().alert().accept(); </code></pre> <hr> <p>This though might not work in Chrome, in this case <a href="http://stackoverflow.com/a/...
HTML / CSS centering controls to the screen <p>I am pretty new to ASP.Net and anything really web development related. Watched a few videos and got the basic idea.</p> <p>The issue I have now is that I would like to center my views to the center of the page.</p> <p>So as an example, I create a new ASP.Net MVC project...
<p>You will have to specify a height for the container. Check this out:</p> <pre><code>body{ position:relative; height:100%; } .full-height{ text-align:center; display:table; height:300px;//this is just and example height width:100%; border:1px solid red; } .center{ display:table-cell; vertical-alig...
Serverless Deployment of Common Functions Package in AWS Lambda <p>I have several AWS Lambda functions in Serverless, and found I was writing the same sendEmail function over and over. Just setting up the client and composing the SES response with a few minor tweaks. I decided it would be best to abstract this to a sin...
<p>An option would be to package all your functions together (that is with a <code>serverless.yml</code> file at the root only) and declare your functions with full path like</p> <pre><code>functions: alarm1: handler: AlarmsManager/Alarm1.handler ... alarm2: handler: AlarmsManager/Alarm2.handler .....
How to start off on a tab built in javascript/html instead of it being blank and having to click on one <p>Hello i have a tab system built in javascript/html and css currently it only displays anything if you click on it first but i was wondering if i could make tab content automatically show up when the page is loaded...
<p>Find this particular html</p> <pre><code>&lt;div id="chatrooms" class="tabcontent"&gt; </code></pre> <p>change it to:</p> <pre><code>&lt;div id="chatrooms" class="tabcontent" style="display: block;"&gt; </code></pre> <p>This should work for you. As I look in F12 tools I can't see class being changed on click, ju...
How to import jquery typing for angular2 seed? <p>I'm failing to integrate jquery typings into an <a href="https://mgechev.github.io/angular2-seed/" rel="nofollow">anguler2-seed</a> project.</p> <p>In my component I'm using jquery like this:</p> <pre><code>declare let $: any; export class LeafletComponent implements...
<p>Hey I was running into the same issue. I found a solution, let me know if this helps.</p> <p>in <code>tools/config/project.config.ts</code></p> <p>add this to the constructor:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre cla...
add a custom view to JHipster app <p>Is there a Yeoman way of creating all the necessary templates required when adding a new view in a JHipster app? I want a simple static page, or a page that doesn't require a new entity. Let's say I want to add an "About" page, I believe I would need to do the following:</p> <p>A...
<p>You may try creating an entity without any fields or relations and with "--skip-server" option.</p> <p><code>yo jhipster:entity about --skip-server</code></p>
Multiple file access using threads <p>I am using multiple threads to access various random files using threads. However, I get an error <code>[Thread 0x7ffff7007700 (LWP 16256) exited]</code>. Also, info threads shows that only 2 threads are created. However, I am trying to create 100 of them. Also, do I have to use t...
<p>There are missing things in the code, first, in your encrypt function you need to close the threads at the end and also in the main function BUT, before you do so, after your for loop you need to join them all, then they are going to be processed and closed correctly.</p> <p>The flow will go like this:</p> <pre><c...
ExtJs: Get store data on store creation <p>I have an in-line store that is inside of a simple combobox. This store has some default inline-data. Now I'm looking for an event that gets fired once the store is created and this event needs to supply me with the data that is in the store.</p> <p>I tried it like this:</p> ...
<p>You can easily do this by creating store afterrender of combo box and set store to combo box.</p> <pre> Ext.create('Ext.form.ComboBox', { fieldLabel: 'Choose', queryMode: 'local', valueField: 'name', displayField: 'name', renderTo: Ext.getBody(), listeners: { afterrender: function(me...
Why does PHP header(charset) work while HTML <meta charset> doesn't? <p>this one may be easy, but seems a problem for my server (or me myself).</p> <p>I have this piece of code in <code>index.php</code>:</p> <pre><code>&lt;?php header('Content-Type: text/html; charset="UTF-8"'); // Some code for generating data to b...
<p>The formatted look is preserved, because in the first case you have the content-type <code>text/plain</code>, while in the second case it is HTML (<code>text/html</code>). You can wrap it in <code>&lt;pre&gt;&lt;/pre&gt;</code> tags to preserve formatting when returning HTML.</p> <pre><code>&lt;?php include 'view/...
Hide "web" from URL in Symfony2.8 application <p>I have two different Symfony2.8 applications. During development they are accessible via two separated domains (virtual hosts): <code>www.app1.local</code> and <code>www.app2.local</code>. And everything works fine. But finally both applications should be deployed to the...
<p>In general, it should be configurated via web-server itself. But if you don't have any access to configuration of web-server (Apache, nginx), you can do the following.</p> <p>Put in your <code>/httpdocs/app1</code> copy of <code>app1/web</code>, and in <code>/httpdocs/app2</code> copy of <code>app1/web</code></p> ...
c# calling a list of a class into another class <p>so im trying to call a class into a method. but it gets mad because this method isnt calling for a list and the class i made is a list. i tried making a separate variable that isnt a list but it didnt seem to work when i ran the program.</p> <p>Its the "egg.BounceRock...
<pre><code>public class Egg { public void BounceRock(Rock rock) { // Bounce the rock... } public void BounceRocks(List&lt;Rock&gt; rocks) { foreach(Rock rock in rocks) { BounceRock(rock); } } } </code></pre> <p>So your egg knows how to bounce a singl...
Excel Transform Sub to Function <p>I am quite new in VBA and wrote a subroutine that copy-paste cells from one document into another one. Being more precise, I am working in document 1 where I have names of several product (all in column "A"). For these product, I need to look up certain variables (e.g. sales) in a sec...
<p>Here is an example to create a function that brings just the first 3 letters of a cell:</p> <pre><code>Public Function FirstThree(Cell As Range) As String FirstThree = Left(Cell.Text, 3) End Function </code></pre> <p>And using this in a Excel worksheet would be like:</p> <pre><code>=FirstThree(b1) </code></pr...
operator[] for a template based array of O(1) complexity <p>I want to make an array type using template's recursion as in the code chunk below. <a href="https://ideone.com/CQqgUQ" rel="nofollow">This is code dump on ideone</a>. </p> <p>Acctually, I can not figure out how to create the <code>double&amp; operator[](int)...
<p>As mentioned by @PeterBecker in comments, using recursion here is probably not a good idea, but for the sake of the exercise, you could simply do:</p> <pre><code>// Generic case: double&amp; operator[] (size_t i) { if (i == N - 1) { return x; } return Array&lt;N - 1&gt;::operator[](i); } // Tri...
how to update a highcart column chart on a button click <p>i have a column chart, and i need to refresh (redraw) it, on button click.</p> <p>this is the code i load when i load the page:</p> <pre><code> function setParetoChart(data) { $('#liveChart2').highcharts({ chart: { type: 'column' ...
<p>This thread might help... <a href="http://stackoverflow.com/questions/26801793/lazy-highcharts-drilldown">Lazy Highcharts drilldown</a></p> <p>The soultion implements lazy drill down highcharts using Ajax.</p>
Clustered Apache Camel <p>We have created a little spring boot application with Camel embedded. It simply polls an Office365 mailbox via imap for unread emails.</p> <p>We have some verbose logging and we have seen Box one consumes the message and then processes it (sends some REST requests) and finishes. 2s later af...
<p>Idempotent consumer will not work in clustered environment as idempotent repository is a in-memory one. </p> <p>You have to use central database or Hazelcast data grid based implementation.</p> <p>For more info refer: <a href="http://camel.apache.org/idempotent-consumer.html" rel="nofollow">http://camel.apache.org...
Can't change the height of the Chrome developer tools Certificate view <p>Is it able to change the height of the certificate information in Google Chrome? I can only change the width.</p> <p><a href="http://i.stack.imgur.com/qB1fj.png" rel="nofollow"><img src="http://i.stack.imgur.com/qB1fj.png" alt="enter image descr...
<p>I've got the same problem on macOS Sierra with Chrome 53.x. I've just upgraded to Chrome 54 and it resolved the issue.</p>
Selenium : Unable to Retrieve WebElements Stored in Map <p>Defined a number of <strong>WebElements</strong> using <strong>@FindBy</strong> Annotation</p> <pre><code>@FindBy(id="Corporate Insiders") private static WebElement FS_LvFd_Filers_CorporateInsidersLink; @FindBy(id="Companies") private static WebElement...
<p>Based on the information you provided, I am assuming, that you are storing the web element reference but not actual web element object, that is, you have to put the web element objects in map only after PageFactory.initElements(driver, class); gets called</p> <p>So, I suggest you to add the web elements into map af...
Chrome DevTools not working with the Select element <p>I am working on fixing a style sheet for mobile devices for a website and I am using the DevTools that come built into Chrome for testing purposes. I am using Chrome version 53.0.2785.116 on a Windows operating system right now.</p> <p>My problem is that, when I'm...
<p>For testing purposes you can change the device type from mobile to desktop(touch). This will allow you to get around the issue with the <code>select</code> element and mobile emulation.</p> <p>To enable these options open your developer tools by righting and inspecting the page you are on or press f12. Click on the...
Opening Date/Time Picker programatically in Material UI LIbary <p>I'm doing a project which uses React and Material Design. I'd like to go with <a href="https://github.com/callemall/material-ui" rel="nofollow">Material UI</a>, as I need fancy Dat- and Time Pickers, which this Library supplies as components.</p> <p>As ...
<p>I resolved this problem adding <code>ref</code> for each <code>datepicker</code></p> <pre><code>handleChangeDPOne(){ this.refs.datePickerTwo.openDialog() } handleChangeDPTwo(){ // something } render(){ return ( &lt;div&gt; &lt;DatePicker ref='datePickerOne' onChange={this.handleChangeDPOne} /&gt;...
Stop errorbars from overlapping in matlab <p>I have multiple sets of data with standard deviations I need to present - and I've been using error bars. When I plot multiple sets on the same plot, however, some of the error bars overlap.</p> <p>Is there an easy way to make it such that the error bars for a certain tick...
<p>Specify the <code>x</code> input to <a href="http://es.mathworks.com/help/matlab/ref/errorbar.html" rel="nofollow"><code>errorbar</code></a> and add a little offset manually. You can do it as follows. Modified lines are indicated with comments.</p> <pre><code>val1 = [818.23,819.12,820.73,821.93,819.21]; val2 = [840...
org.dom4j.DocumentException: Connection refused: connect Nested exception in Hibernate <p>I am not much familiar with Hibernate. Can anyone please help me in resolving error I am getting in my code.</p> <p>I am using Eclipse Helios, Hibernate 3 &amp; Java 6. I have generated java code from Database tables <code>Emp</c...
<p>Thanks Pradeep for your help. Error solved by downloading dtd file "<a href="http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" rel="nofollow">http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd</a>" and "<a href="http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd" rel="nofollow">http://www...
Why hdfs throwing LeaseExpiredException in Hadoop cluster (AWS EMR) <p>I am getting LeaseExpiredException in hadoop cluster -</p> <p><strong>tail -f /var/log/hadoop-hdfs/hadoop-hdfs-namenode-ip-172-30-2-148.log</strong></p> <blockquote> <p>2016-09-21 11:54:14,533 INFO BlockStateChange (IPC Server handler 10 on 80...
<p>I resolved the issue. Let me explain in detail.</p> <p>Exceptions that is coming -</p> <ol> <li>LeaveExpirtedException - from HDFS side.</li> <li>FileNotFoundException - from Hive side (when Tez execution engine executes DAG)</li> </ol> <p><strong>Problem scenario-</strong></p> <ol> <li>We just upgraded the hive...
inner query issue <p>I have a doubt regarding an inner query</p> <p>Schema:</p> <ul> <li><code>DEPARTMENT</code> (<em>deptnum</em>, descrip, instname, deptname, state, postcode)</li> <li><code>ACADEMIC</code> (<em>acnum</em>, deptnum*, famname, givename, initials, title)</li> <li><code>PAPER</code> (<em>panum</em>, t...
<p>Use <a href="https://www.techonthenet.com/sql_server/joins.php" rel="nofollow"><strong>Join</strong></a></p> <p>Try Like this</p> <pre><code>SELECT acnum,title,givename,famname,no_of_papers FROM academic a JOIN ( SELECT COUNT(*) AS no_of_papers,acnum FROM author auth JOIN paper p ON auth.panum=p.panum ...
Rails Not able to save data, association <p>I'm doing a parking permit website. The problem I met is that I'm not able to save my data to the PERMIT database which associated with the USER database. The problem i think is I didn't bring the user to the permit(Maybe i missed something). I found out the error when I tryi...
<p>I guess you are using Rails 5. The problem is you have <code>belongs_to</code> association on <code>permit</code> that is belongs to <code>user</code> but while creating <code>permit</code> you are not associating any user with it and in <strong>Rails 5</strong> it is mandatory to assign data to <code>belongs_to</co...
Illuminate Eloquent return null relation on a relation returning different objects <p>I have an object in Illuminate that has a relation that can return different objets depending on a property of the main object</p> <pre><code>public function relation(){ switch($this-&gt;type){ case "type_1": ...
<p>Well..this is probably not the best option but works</p> <pre><code>public function relation(){ switch($this-&gt;type){ case "type_1": return $this-&gt;belongsTo('\Models\Type1', 'idType1'); break; case "type_2": return $this-&gt;belongsTo('\Models\Type2', 'id...
SQL query to get all the data from different tables with same id <p>Sorry if this is too elemental but I cannot work it out. Don’t know how to search information on it either:</p> <p>I have three tables: </p> <p>Provider</p> <pre><code>id_provider name ---------- ----------- 100 John 101 Sam ...
<pre><code>select * from Provider P1 left join Contact C2 on C2.id_contact = P1.id_provider left join Product P2 on P2.id_product = P1.id_provider </code></pre>
How to initiate model without get() on laravel <p>I have this on my model <code>Scholar</code></p> <pre><code>&lt;?php namespace App; use Illuminate\Database\Eloquent\Model; class Scholar extends Model { protected $primaryKey = 'scholar_id'; protected $fillable = ['ngo_id','scholar_lname','scholar_fname','s...
<p>You can use <a href="https://laravel.com/api/5.3/Illuminate/Database/Eloquent/Model.html#method_newQuery" rel="nofollow">newQuery</a>;</p> <pre><code>$scholars = (new Scholar)-&gt;newQuery(); if(Input::get('age_from')) { $scholars-&gt;where('age', '=', Input::get('age_from')); } return $scholars-&gt;get(); </...
Instant run issue on Android Studio 2.2 <p>I have updated my android studio to 2.2, Since then I get this strange issue when running the studio gives me error Instant Run requires that the platform corresponding to your target device (Android 1.0) is installed. I am using Note 4 on android 6.0.1. Why is this error hap...
<p>If you have connected your android device, unplug it then uninstall the current app. Then plug the usb back and click run. You good to go.</p>
Iterate through Java jsonObjects without array included <p>My problem is that this will create 3 new instances of DailyJobObjects with the same values as object number one (01, Bill, 50). And it's logical that it would do so, so how can I iterate through my jsonObject so I can separate the three objects? I have looked ...
<p>As @Selvin has mentioned, your json is not valid. Either get proper json from the database or parse it in a non-standard way. I would suggest getting a proper json array from the DB. </p> <pre><code> String[] splitString = jsondata.split("[^a-zA-Z \\{\\}]+(?![^\\{]*\\})"); for ( String s : splitString) { ...
how to put new obj in ARToolKit for android <p>I need import my own Object, i tried in arsimplenativecars replace the cars but it didnt work. I have changed the version in gradle but still did not work.</p> <p>I need help plz.</p>
<p>In the ARToolKit Forum there are several similar Questions about this topic. Go there and use the Search Field.</p> <p>Beside of that probably you find your solution here? <a href="http://artoolkit.org/community/forums/viewtopic.php?f=26&amp;t=16052&amp;p=20493&amp;hilit=replace+obj+android#p20493" rel="nofollow">A...
Convert cURL command to post request to send notification to kaa server <p>I want to send a notification to kaa server. The below cURL command is working fine but I want to send POST request from my node.js server. Kindly help me in converting to post request. </p> <pre><code> curl -v -S -u devuser:devuser123 -F'noti...
<p>Here is a solution.</p> <p>First import next modules.</p> <pre><code>var fs = require('fs'); var request = require('request'); var crypto = require('crypto'); </code></pre> <p>We need two utility functions to generate <strong>boundary</strong> for multipart content type and the other to build raw POST request bod...
Agenda which is added to the calendar is fine with Week view but in month view it is coming one day earlier in US <p>I am using FullCalendar to publish an agenda. In full calendar in week view it is displaying the added agenda perfectly but when i am trying to see it in month view it is displaying the added one day bef...
<p>I am able to solve this issue, hope it will help to others.</p> <p>Previous code</p> <pre><code>day = jsDate.getDate (); </code></pre> <p>Now</p> <pre><code> day = jsDate.getUTCDate (); </code></pre>
How to prevent request via curl in my mvc4 Application <p>I want to prevent request that comes from <strong>curl</strong> command in my Application.can we prevent <strong>curl</strong> command request ?</p>
<p>cURL does nothing more than sends HTTP request to your server. Anyone can send the exact request you send from a browser via cURL, Postman or any other tool.</p> <p>However, if the person who forms the request in cURL is not so carefull, he might skip User-Agent or any other header which browser sends by default, a...
Rstudio reorder stacked ggplot geom_bar <p>So I've made a stacked Barplot with help of @Axeman . So far so good.. Now I would love to swap the Blue plot with the Red plot. I've literally tried everything using the order function in ggplot and I cant get it right. Here is the Plot: </p> <p><a href="http://i.stack.img...
<p>Try to manually select the colors that you want:</p> <pre><code>+ scale_fill_manual(values=c("#999999", "#E69F00"), name="Legend title", breaks=c("Electrical", "Power grids"), labels=c("Electrical", "Power grids")) </code></pre> <p>as found on <...
How to set Number of Dynamic Tile in HCP portal service? <p>I just want to use number from my server to change tile number, such as using URL <code>http://10.59.XXX.100:8080/Map/dynamicTileOnlyNo</code> </p> <p>In <a href="http://scn.sap.com/community/hana-cloud-portal/blog/2015/05/03/flphana-cloud-platform--building-...
<p>As mentioned in the SCN blog, you need to use relative paths in the URL in combination with odata. It also seems like your destinations are not configured properly. Please check HCP documentation on this.</p>
Jenkins Failed to connect to repository : Command returned status code 128: <p>OK, So I spent years trying to set this jenkins server up and there is errors everywhere. Most answers out there are for linux, This jenkins server is on windows(if you know how to setup msbuild on a linux jenkins im all ears). </p> <p>The...
<p>For those wondering I ended up doing two things, using git config --system to configure the credentials with roles, and then I added the global username and email in the jenkins system settings under "Git plugin" one of them did it. </p>
How to loop through Registry with cmd <p>I would like to </p> <ol> <li>Loop for a registry path - lets say <code>HKLM\SOFTWARE\Wow6432Node\Mozilla\Firefox</code>, which has several sub-paths (in my case databases like DB1, DB2, DB3) like Firefox, Mozilla Firefox, Developer Edition and so on</li> <li>Take each of this ...
<p><strong>Try the following batch file (RegLoopValue.cmd):</strong></p> <pre><code>@echo off setlocal for /f "tokens=*" %%k in ('reg query HKLM\SOFTWARE\Wow6432Node\Mozilla\Firefox') do ( echo reg add %%k\Extensions /t REG_DWORD /d 0x15F90 /f ) endlocal </code></pre> <p>Notes: </p> <ul> <li>Remove the <code>ec...
Elements outside screen in android xml <p>So I'm trying to fix my UI on an android project, however some elements end up off screen with my current xml. I have no idea why, which is why I'm asking this question.</p> <p>I have a listview containing songs and two textviews with current song's artist and song name. Under...
<p>The problem is that your <code>ListView</code> and its parent <code>LinearLayout</code> have a height of <code>match_parent</code>. This means that those two elements will be as tall as the parent element.</p> <p>If you try to place Views below a View that takes up the entire height of the screen, they will be some...
Insert collection into list with nested array <p>I have this collection</p> <pre><code> db.UserWatchtbl.insert( { fbId: "", Name: "user1", pass: "pass1", Watchtbl: [ { wid: "1350", name: "bought stock1", Symboles: [ { Name: "AAA" }, { Name: "BSI" } ] }, { ...
<p>You have to iterate through the <code>Result</code> of <code>FindAsync</code>. This will collect the data into user (<code>List&lt;UserWatchTblCls&gt;</code>) </p> <pre><code>var user = new List&lt;UserWatchTblCls&gt;(); var cursor = collectionWatchtbl.FindAsync(filter).Result; cursor.ForEachAsync(batch =&gt; { ...
Batch: Calculating time elapsed from timestamps <p>guys, i have a task to analyze some log files like this one:</p> <pre><code>12:03:11 Testing Import (test #240.) 12:10:47 Testing Searches (test #241.) 12:14:39 Testing Default notifications (test #242.) 12:20:05 Testing Inventory list monitor (test #243.) 12:34:31 Te...
<pre class="lang-dos prettyprint-override"><code>@ECHO OFF SETLOCAL SET "sourcedir=U:\sourcedir" SET "destdir=U:\destdir" SET "filename1=%sourcedir%\q39619700.txt" SET "outfile=%destdir%\outfile.txt" SET "starthh=" ( FOR /f "tokens=1-3*delims=: " %%a IN ( 'findstr /L /c:"(test #" "%filename1%"') DO ( IF DEFINED start...
Savitzky-Golay filtering for large data set <p>I would like to apply a Savitzky-Golay filter (from <code>prospectr</code>package) to a set of samples taken for different areas of interest. Here is a sample of the data. </p> <pre><code> &gt; head(file,10) subject eye sample_num area sample_value 1 L ...
<p>If you want to pad the returned vector with <code>NA</code>s, you can just use <code>c()</code>:</p> <pre><code>set.seed(123) x &lt;- rnorm(100) w &lt;- 3 # must be odd number out &lt;- c(rep(NA, (w-1)/2), savitzkyGolay(x, 1, 1, w = w), rep(NA, (w-1)/2)) length(out) # [1] 100 head(out) # [1] NA 1.0595920 ...
EBS Read Speeds <p>Looking at the C4 specifications at <a href="http://www.ec2instances.info/" rel="nofollow">http://www.ec2instances.info/</a> I see that it has an EBS Optimized bandwidth.</p> <p>My question is, is this bandwidth on a per EBS volume or for all EBS volumes bandwidth? </p> <p>Also, is this still goin...
<p>When an EC2 instance is "EBS Optimized", the instance has a dedicated network channel to Amazon EBS. The available bandwidth to Amazon EBS is based on the EC2 instance type.</p> <p>This means that:</p> <ul> <li>Non-EBS-related network activity should not affect the network connection to the EBS volumes.</li> <li>T...
Upload file avoiding HTTP OPTIONS <p>I have an OpenuI5 webapp with a backand developed with Delphi Datasnap technology. I use Upload Collection component to manage a list of fields <a href="https://openui5.hana.ondemand.com/explored.html#/entity/sap.m.UploadCollection/properties" rel="nofollow">https://openui5.hana.ond...
<p>There may be a bit confusion about what is actually happening here. UI5 is not explicitly behind the <code>OPTIONS</code> call that you're seeing, but your browser is. The browser is instructed to <code>GET</code> the <code>$metadata</code> from your server to introspect the OData service and see which entities and ...