input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
How to Change URL and port of Gulp server ? <p>I've a application in angularjs and using gulp server it's running on port like :</p>
<p><a href="http://localhost:3000/" rel="nofollow">http://localhost:3000/</a> </p>
<p>I want to run this without port like : </p>
<p><a href="http://example.com/" rel="nofollow">http:/... | <p>While developing web applications we will set up a development server in our system.
So if you want to access your local server you can do so in the below ways</p>
<ol>
<li>Directly enter your IP Address like <code>192.10.138.138</code> as URL in web browser</li>
<li>Enter localhost(which is defacto name for referr... |
Is python tuple assignment order fixed? <p>Will</p>
<pre><code>a, a = 2, 1
</code></pre>
<p>always result in a equal to 1? In other words, is tuple assignment guaranteed to be left-to-right?</p>
<p>The matter becomes relevant when we don't have just a, but a[i], a[j] and i and j may or may not be equal.</p>
| <p>Yes, it is part of the python language reference that tuple assignment must take place left to right. </p>
<p><a href="https://docs.python.org/2.3/ref/assignment.html">https://docs.python.org/2.3/ref/assignment.html</a></p>
<blockquote>
<p>An assignment statement evaluates the expression list (remember that
th... |
How to add object to scene? <p>I have code like this:</p>
<pre><code><html>
<head>
<script src="js/three.js"></script>
<script type="text/javascript">
function init()
{
var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera... | <p>Just some fast tips:</p>
<p>-Place the camera to see the object, not just position but the direction where it is facing, do you have all your objects in front?</p>
<p>-Make the object visible, choose a good material definition, start with the "<a class='doc-link' href="http://stackoverflow.com/documentation/three.... |
Not able to install and use SwiftyXMLParser library via pod <p>I am trying to install and use <strong>SwiftyXMLParser</strong> (<a href="https://github.com/yahoojapan/SwiftyXMLParser" rel="nofollow">https://github.com/yahoojapan/SwiftyXMLParser</a>) via a podfile. The pod file installs the library without any issues bu... | <p>put ``pod 'SwiftyXMLParser', :git => '<a href="https://github.com/yahoojapan/SwiftyXMLParser.git" rel="nofollow">https://github.com/yahoojapan/SwiftyXMLParser.git</a>'` before the </p>
<pre><code> # Pods for ApplePaySwag
</code></pre>
|
do not allow to change ip address from inside a kvm guest <p>At the moment, a customer having a virtual machine on kvm can simply change his own ip address or add another one and probably cause an ip address conflict. </p>
<p>How can I prevent that a user can change the ip address of his virtual machine?
I read about ... | <p>I have found the solution. Libvirt provides a feature called <code>nwfilter</code> which allows you to setup filters. There are also some example filters. They exactly do what I wanted. See <a href="https://github.com/wiedi/libvirt/tree/master/examples/xml/nwfilter" rel="nofollow">this link</a>.</p>
<p>I have downl... |
Change TextView on content_main.xml in MainActivity.java <p>I'm using the Android Studio standard template "Navigation Drawer Activity" which contains the content_main.xml layout.</p>
<p>On this layout is my textView which I want to change the text from my MainActivity.java.</p>
<p><strong>I tried following but nothi... | <p>there is no need of LayoutInflater. Simply use:</p>
<pre><code>TextView textView = (TextView) findViewById(R.id.txt_head);
texView.setText("Hello");
</code></pre>
<p>Hope this helps.</p>
|
Maven error: URI has an authority component <p>I'm pretty new to maven and trying to build a code on Windows that works fine in linux.
I have 2 local repositories in my pom.xml:</p>
<pre><code><repositories>
<repository>
<id>p2-repo-equinox_3.8.1</id>
<layout>p2</la... | <p>On a windows machine, the complete syntax is <strong>file://host/path</strong> .<br>
If the host is your machine(localhost), it can be omitted, resulting in <strong>file:///path</strong> . </p>
<p>See <a href="http://www.ietf.org/rfc/rfc1738.txt" rel="nofollow">RFC 1738 â Uniform Resource Locators (URL)</a></p>
... |
SQL - Large XML file maxes out TEMPDB when importing <p>I have a query that works just fine for bringing XML data into a SQL table (usually). My current issue is that I have tried to use this query with a much larger XML file and it maxes out my tempdb (and diskspace) and fails. Can anyone help?</p>
<pre><code> ;... | <p>Without the actual XML this is reading the <em>magic glass bulb</em>, but I'll give it a try:</p>
<p>Your call to</p>
<pre><code>.nodes('/ETS/WellTours/WellTour/DayTours/DayTour/Tours/Tour/TimeLogs/TimeLog')
</code></pre>
<p>tells me, that there is one XML with a root node <em>ETS</em> and a nested <em>1:n-struct... |
Android user agent in URLConnection <p>I'm trying to "fool" Google Finance into thinking I'm a web browser by changing the user agent property in my connection. However, the response I get back still isn't what I should get when I use an actual web browser. I was wondering why this is, and what I need to do in order fo... | <p>The webform seems to behave normally without mucking with the user agent. This retrofit request returns a valid response:</p>
<pre><code>D/TAG: currency_converter_result>5 GBP = <span class=bld>6.3645 USD
</code></pre>
<p>Retrofit request:</p>
<pre><code> final Map<String,String> fieldMap = n... |
Swift UITextField Border bottom and shadow issues <p>I have a UITextField that must have a bottom border. Since autolayout use my code is this:</p>
<pre><code>override func viewDidLayoutSubviews() {
let border = CALayer()
let width = CGFloat(0.5)
border.borderColor = UIColor.darkGray.withAlphaComponent(0.3... | <p>You can use CAShapeLayerShadow </p>
<pre><code>func border(){
let border = CALayer()
let width = CGFloat(0.5)
border.borderColor = UIColor.darkGray.withAlphaComponent(1).cgColor
border.frame = CGRect(x: 0, y: CustomerTextBox.frame.size.height - width, width: CustomerTextBox.frame.size.width, height: Cu... |
Runtime memory for vectors in C++ <p>I am getting row data from a sensor (distances & amplitude) and saving them into a vector container in C++.<br>
Using OpenGL, I am visualizing it(see the pic below)<br>
<a href="http://i.stack.imgur.com/XK49b.png" rel="nofollow"><img src="http://i.stack.imgur.com/XK49b.png" alt=... | <p>This sounds like a vector of vector.</p>
<pre><code>// Vector of vector that will contain all your clusters
std::vector<std::vector<DATA>> clusters;
// everytime you have a new cluster you can then do something like :
std::vector<DATA> currentCluster;
// You add the data to the cluster
currentCl... |
Windows Forms: Pass clicks through a partially transparent always-on-top window <p>I am designing a window that is always on screen and around 20% opaque. It is designed to be a sort of status window, so it is always on top, but I want people to be able to click through the window to any other application below. Here's... | <p>You can make a window, click-through by adding <code>WS_EX_LAYERED</code> and <code>WS_EX_TRANSPARENT</code> styles to its extended styles. Also to make it always on top set its <code>TopMost</code> to <code>true</code> and to make it semi-transparent use suitable <code>Opacity</code> value:</p>
<pre><code>using Sy... |
Where is Laravel Password::broker() and what does it do? <p>Where is the broker() method in the Password Facade in Laravel? I'm trying to understand what the code does but I can't seem to find the method in any of the files. </p>
<p>I wish to change the current emailing system over to PHPMailer as the inbuilt Mail cla... | <p>This doesn't answer your question exactly but I think ultimately, it will be what you need. It would be pretty bad practice to modify Laravel code so it uses PHPMailer instead of its default mail system because then you would never be able to update Laravel as your changes would likely be overwritten. The better t... |
how to convert base 2 program in c. like 1010.1010 to decimal <p>Input - Enter a Real Number in binary form : 01101010.1001101</p>
<p>Output - Real number in Decimal form = 106.6015625</p>
<p>dot is being problem.</p>
| <p>The dots in binary base means that binary number divided by 2
(it is true for any other base)</p>
<p>example:</p>
<pre><code>a=1000101
Then
a/2=100010.1
a/4=10001.01
</code></pre>
|
Managing connection to WSO2 Message Broker <p>I'm trying out the sample code from this page to test publishing messages to a WSO2 Message Broker:</p>
<p><a href="https://docs.wso2.com/display/MB310/Sending+and+Receiving+Messages+Using+Queues" rel="nofollow">https://docs.wso2.com/display/MB310/Sending+and+Receiving+Mes... | <p>Samples are only for demonstration purpose. Since JMS is relatively heavy connection it's not recommended to establish connections per message. you can simply modify the code to send multiple message with same session. Based on attached code you can use simple for loop to send 5 messages.</p>
<pre><code>public void... |
How to draw vertical text as labels in D3 <p>I'm trying to draw vertical labels for the heatmap that I'm working. I'm using the example from <a href="http://bl.ocks.org/tjdecke/5558084" rel="nofollow">http://bl.ocks.org/tjdecke/5558084</a>. Here is the part of the code that I've changed:</p>
<pre><code> var timeLab... | <p>Two problems: first, the <code>translate</code> should have a comma separating the values:</p>
<pre><code>"translate(" + gridSize/2 + ",-8), rotate(-90)")
</code></pre>
<p>Assuming that <code>-8</code> is the y value for the translate. If you don't have a comma, the value inside the parenthesis should be just the ... |
Cannot compile ts files with gulp when targeting es5 <p>I've started my first Angular2 app, and I can't use gulp to compile for es5.</p>
<p>Here is the dependencies file:</p>
<pre><code>"dependencies": {
"@angular/common": "2.0.0",
"@angular/compiler": "2.0.0",
"@angular/compiler-cli": "0.6.0",
"@angu... | <p>It was a problem with the version of gulp-typescript, which was :</p>
<pre><code>"gulp-typescript": "^2.14.0",
</code></pre>
<p>I don't know how this package works, but it's look like it doesn't use the currently installed typescript package but it's own version.</p>
<p>When I upgrade the version, everything work... |
Check immediatly if bullet would collide with wall <p><a href="http://i.stack.imgur.com/LBDA3.png" rel="nofollow"><img src="http://i.stack.imgur.com/LBDA3.png" alt="enter image description here"></a></p>
<p>Currently I check on <code>update()</code> if the bullet collides with the collision wall like so:</p>
<pre><co... | <p>The bullet may be traveling in steps to large as to not actually intersect.</p>
<p>Consider making a line of the form y = mx + b to represent the path of the bullet, then the two vertical lines that represent the wall.</p>
<p>Solve algebratically for the intersection of the bullet line, and each of the two wall li... |
No output data at all for Producer/Consumer threading <p><strong>Edit:</strong>
I have a producer class that send some data to the SharedBuffer class. This data is added to an ArrayList with the limit set to 100. There is no problem with adding data to said list, but the consumer class does not manage to get any of the... | <p>Change your code (add <code>notyfyAll()</code> invokation)</p>
<pre><code>public synchronized void putData(String s){
while(this.isFull()){
try{
wait();
}catch(InterruptedException e){
//
e.printStackTrace();
}
}
data.add(s);
notifyAll();
}... |
Wordpress plugin keeps dying <p>I'm creating a plugin and i'm trying to use this code on the construct:</p>
<pre><code>if(!isset($root, $version, $itemID, $codeKey, $authKey, $channelKey)) {
wp_die('Missing params in $config for KM_Updates constructor');
}else{
echo 'getting here';
}
</code></pre>
<p>... | <p>$version null will give you false on isset accordying to <a href="http://php.net/manual/en/function.isset.php" rel="nofollow">official link</a>.</p>
<p>null is the php way of saying 'this does not exist'. So set it to something else</p>
|
check the value of a character in a string in c++ <p>I am writing a program that reads and writes to a .txt file with c++. Here is a partially edited sample of my code:</p>
<pre><code>#include <iostream>
#include <stdio.h>
#include <fstream>
#include <string>
#include <windows.h>
#include... | <blockquote>
<p>I do not understand how this is a pointer and an integer when they are both strings.</p>
</blockquote>
<p>They are <em>not</em> both strings! <code>line</code> is a string, but <code>line[i]</code> is a <code>char</code>.</p>
<p>And <code>"/"</code> is a character array (string literal).</p>
<p>Use... |
Best way to scroll HTML page to given anchor in a responsive page <p>I have created a page based on this responsive template</p>
<pre><code>https://html5up.net/uploads/demos/phantom/
</code></pre>
<p>I would like the blocks to have an anchor on the same page: when you click on it, it shows you the content (no redirec... | <p>The best way according to me is to place the target content on the same page with an ID(obviously unique) <code><div id="generic"> ..content.. </div></code>, and on your <code><a></code> tag's <code>href</code> target the required div with the ID with <code>href="#generic"</code>. like so</p>
<pr... |
How can I optimize this SQL query with JOINS and nested SELECT? <p>My SQL query takes a hell lot of time for execution because the transactions table is somehow very huge. I'm looking for ways to improve the performance of this query.</p>
<pre><code>SELECT users.user_id, users.name as user, IFNULL(SUM(IF(transactions.... | <pre><code>accounts: INDEX(user_guid, name, account_id)
users: INDEX(hidden, account_id)
</code></pre>
<p>Please provide <code>SHOW CREATE TABLE</code> for each table; with that, we might have further advice.</p>
<p><a href="https://mariadb.com/kb/en/mariadb/building-the-best-index-for-a-given-select/" rel="nofollo... |
Access GCS bucket from another project <p>How do I access Google Cloud Storage bucket (in a project) from another project ? I have sufficient permissions to manage both projects. I am programming in Python.</p>
| <p>GCS bucket names are globally unique. You can specify any bucket name from any project, and if your account has access to it, the call will just work.</p>
|
Android: WiFi-Direct communication when screen is off <p>I'm experimenting with P2P communication on Android using WiFi-Direct. I've got a service that searchs for other phones and automatically connects to them if they've been paired before. I like to have this working regardless of whether the screen is on or off.</p... | <p>So what is happening here is that you are calling <code>startDiscoveryProcess()</code> 50 seconds after screen is turned off and <code>startDiscoveryProcess()</code> is calling itself every 50 seconds. How to stop that process? You listen for <code>Intent.ACTION_SCREEN_ON</code> and if screen is on, we don't send t... |
tkinter programm opens with cmd <p>I writed a program with Python 3.5.2 using Tkinter (and IDLE). When I debug it, the window comes up. And the window too, where we can see the Error. But if i don't debug it and open it by double-clicking, the window comes up with cmd. If I close the cmd, my window closes too.</p>
<pr... | <p>I think it has to do with the main Event Loop, which may be fired in debug mode separately. Add in:</p>
<pre><code>win.mainloop()
</code></pre>
|
Nested function does not have same signature as delegate <p>I'm trying to achieve a currying-like effect in VB. I want to be able to do this:</p>
<pre><code>Dim wrap = WrapNumber("-")
wrap(5) 'returns "-5-"
</code></pre>
<p>Here's my function:</p>
<pre><code>Private Function WrapNumber(ByVal separator As String) As ... | <p>If you turn Option Strict On, it will show you a lot of what's going wrong. In addition to ByRef not being required as stated in the comments, the concatenation is trying to treat separator as a double. If you make those changes then it works fine:</p>
<pre><code>Dim wrap = WrapNumber("-")
Dim test As String = wrap... |
plotly in R - specifying bin size for choropleth maps <p>When creating a choropleth map using the plotly package in R, is there any way to specify the bin size?</p>
<p>Example:</p>
<pre><code>library(plotly)
df <- read.csv("https://raw.githubusercontent.com/plotly/datasets/master/2011_us_ag_exports.csv")
plot_ly(d... | <p>As suggested by @dww, using version 4.x:</p>
<pre><code>plot_ly(df, z=~total.exports, locations=~code, zmin=0, zmax = 30000, type="choropleth", locationmode="USA-states", colors = 'Purples', filename="", colorbar=list(title = "2011 US Agriculture Exports by State")) %>% layout(geo = list(scope="usa"))
</code></p... |
Sharepoint 2013 - Lookup item not working (Does not display value) <p>I have a Lookup value column in SharePoint 2013, which is linked to another field in the same list. </p>
<p>When I add a "New Item", this field is not showing any value whereas the field it's referring to on the same list does have a value.</p>
<p>... | <p>If you are just looking up the value of a different column in the same list, you should just use a calculated column instead of lookup. </p>
<p>Lookups should look to a seperate list entirely. When you select Calculated Column as the type, you should see the formula settings below. You can then select the column na... |
SQL Server Select specific rows within a group <p>I'm using SQL Server 2012. Below is an example dataset</p>
<pre><code>Prefix_Suffix First_Nm Last_Nm Acct_Registration_Line_1 Acct_Registration_Line_2 secondlevel TopLevel
NULL Jane Smith NULL NULL smith1-rep abc-quarterly
NULL John Smit... | <p>Is this what you want?</p>
<pre><code>select t.*
from (select t.*,
row_number() over (partition by coalesce(prefix_suffix, first_nm + ' ' + last_nm)
order by (case when first_nm is not null then 1 else 2 end)
) as seqnum
from ##tempta... |
PHPMailer : replace the default messageID <p>I send emails using PHPMailer, evthg works well but I would to set a uniq MessageID for each email.</p>
<p>PHPMailer version : "v5.2.16"</p>
<p>(loaded with Composer from <a href="https://github.com/PHPMailer/PHPMailer.git" rel="nofollow">https://github.com/PHPMailer/PHPMa... | <p>The structure of <code>MessageID</code> should be:</p>
<pre><code><sometext@sometext>
</code></pre>
<p>If your <code>MessageID</code> doesn't have this exact structure - PHPMailer will ignore your <code>MessageId</code> and generate it's own MessageId.</p>
<p>You can change your code to:</p>
<pre><code>$ma... |
Detect changes to playlist with Youtube Playlist API <p>Is it possible to detect the change to a user's video playlists and fire an event using the YouTube API ?</p>
| <p>I don't think there's a press-one-button solution here. But you can try using <a href="https://developers.google.com/youtube/v3/docs/playlistItems/list#top_of_page" rel="nofollow">PlaylistItems.list</a>. It returns the videos contained in the playlist (50 maxresult per set). So if you want to detect if there's any c... |
retrieve and combine chunks of information from string using regex in postgres <p>I need to retrieve information from structured text fragments which have the following format:</p>
<p><code>(AAB) Some name1 here 1234 (BB) More 12-text 99 (XY*) Hello world 12</code></p>
<p>What I want to get out is the following: <cod... | <p>You may try:</p>
<pre><code>SELECT array_agg(v) FROM (
SELECT array_to_string(
regexp_matches(
'(AAB) Some name1 1234 (BB) More text 99 (XY*) Hello world 12',
'\((.*?)\).*?(\d+)(?=$| \()', 'g'
),
''
) as v
) s;
</c... |
Jena querying specific remote SPARQL endpoint raises HttpException: 404 <p>I am using Jena to send SPARQL queries to remote endpoints. This works well for most of the endpoints. However, it doesn't work for the specific one that I need <a href="http://ff-news.ontotext.com/sparql" rel="nofollow">http://ff-news.ontotext.... | <p>Try end point is <a href="http://ff-news.ontotext.com/repositories/factforge_2016" rel="nofollow">http://ff-news.ontotext.com/repositories/factforge_2016</a></p>
<p>While <a href="http://ff-news.ontotext.com/sparql" rel="nofollow">http://ff-news.ontotext.com/sparql</a> is the web UI. We should provide more explicit... |
Long line displayed broken after setting output width of RStudio Markdown (to HTML) <p>I find several threads on to change the output columns in knitr using</p>
<pre><code>```{r set-options, echo=FALSE, cache=FALSE}
options(width = SOME-REALLY-BIG-VALUE)
```
</code></pre>
<p>in this post <a href="http://stackoverflow... | <p>Are you dead-set on using the raw output from R print? You could make it look nicer and accomplish your "table-splitting" using markdown tables with the <code>pander</code> package. </p>
<pre><code>Hello Stack
===========
```{r echo = FALSE, results = 'asis'}
x = matrix(rnorm(160), ncol=16)
pander::pander(as.data.... |
Uncaught TypeError: Cannot read property 'element' of undefined when press login button <p>I get this error</p>
<blockquote>
<p>Uncaught TypeError: Cannot read property 'element' of undefined</p>
</blockquote>
<p>when I press on login button in my ionic2 and angular2 app.
I tried to look on variable that not intial... | <p>Seems like you access a field 'element<code>somewhere in the template</code>modal-page.html`. For example, </p>
<pre><code>{{ something.element }}
</code></pre>
<p>If so, try <code>{{ something?.element }}</code> instead.</p>
<p>This check if <code>something</code> exists (not null or undefined) before accessing ... |
How to implement scrolling in RecyclerView on Android TV? <p>I have an application which I need adapt for Android TV. This application contains horizontal RecyclerView and it doesn't scroll when I press D-pad buttons on remote control.
I found <a href="http://stackoverflow.com/a/35403781/1393280">this solution</a>, but... | <p>Try this. Works for me.</p>
<pre><code> @Override
public void requestChildFocus(View child, View focused) {
super.requestChildFocus(child, focused);
View view = focused;
while (view != null && view.getParent() != child) {
try {
view = (View) view.getParent();
} cat... |
Editing Floodlight tag to grab form data from the page <p>I am trying to write some Javascript to amend a Floodlight tag so that it grabs form data from the page and populates a custom variable. My initial thought was to set a variable x lets say and call the document.getElementsByName('...') and reference that variabl... | <p>You shouldn't use the custom HTML for the floodlight tag and especially not document.write. The only reason the tag uses javascript in the first place is to create a random number as cachebuster, and GTM has a "random" variable that you could use instead and make this pure HTML.</p>
<p>However it is far better to u... |
ifort: error #10001: could not find directory in which g++ resides <p>I am going to compile a fortran code with ifort, but I received the following error:
((ifort: error #10001: could not find directory in which g++ resides))
Note: on my system g++ was installed.</p>
<p>Could you please help me in this way?</p>
| <p>Tips for resolving this are in <a href="https://software.intel.com/en-us/articles/intel-fortran-compiler-for-linux-ifort-error-could-not-find-directory-in-which-g-resides" rel="nofollow">https://software.intel.com/en-us/articles/intel-fortran-compiler-for-linux-ifort-error-could-not-find-directory-in-which-g-resides... |
Kotlin Can't create @Autowired field in Class that are annotated with @Configuration @EnableWebMvc <p><code>Autowired</code> field is <code>null</code> when initializing the project:</p>
<pre><code>package com.lynas.config
import org.springframework.stereotype.Component
import org.springframework.web.servlet.handler.... | <p>try <code>@field:Autowired lateinit var interceptorConfig</code> or <code>@set:Autowired</code> which will tell kotlin compiler to put annotations explicitly on field/setter. by default it places them on "property" which is kotlin-only construct and Java may have problems accessing it. refer to <a href="http://kotli... |
Appending to file, sed unterminated address regex <p>I'm trying to append to the end of a file, using the style from this <a href="http://unix.stackexchange.com/a/26639/179769">answer</a> but I get the error:</p>
<blockquote>
<p>sed: -e expression #1, char 16: unterminated address regex</p>
</blockquote>
<p>the com... | <p>With single quotes you don't need to escape <code>$</code> sign since it's not going to be evaluated by shell.</p>
<p>Either </p>
<pre><code> sed -e '$a...'
</code></pre>
<p>or</p>
<pre><code>sed -e "\$a..."
</code></pre>
|
Comparing 8 bits types of different signedness (int8_t, uint8_t): is result deterministic? <p>I run <a href="http://coliru.stacked-crooked.com/a/d5d2876f81e6e938" rel="nofollow">this simple program</a>:</p>
<pre><code>#include <stdint.h>
#include <iostream>
int main() {
uint8_t x = 100;
int8_t y = ... | <p>Yes, the result is deterministic, not (compiler's) implementation defined. Here follows the motivation for C++11 (it should be possible to do the same for other), following the document <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3337.pdf" rel="nofollow">here</a> (link suggested <a href="http:/... |
Authentication for AWS CLI <p>Key pair file.pem has been downloaded to a Mac when the EC2 was created, which is used during ssh from the local machine to the EC2 Amazon Linux instance. AWS CLI just got installed as well.<br>
CLI introductory tutorials indicate the use of a key, which seems to be different than the fil... | <p>It cannot. Your ssh key allows you to connect to your instance, but to access AWS APIs you need to have AWS credentials. For instances, it is recommended to launch them with a role which sdks and the cli will pick up on and use to access other AWS resources. That role should be as restrictive as possible to meet the... |
How to use webix datamapping? <p>I'm using a webix datatable. I'm having trouble mapping my values for the table. The data isn't displaying, although I know it sees the data.</p>
<p>Here is my webix script with my mapping: </p>
<pre><code> webix.ajax().get('urltourltourl',{
// Error callback
error:... | <p>If you want to use "map" attribute, you need to </p>
<ul>
<li>change keys to alpha-numeric string ( not a numbers ) </li>
<li><p>write the mapped values as strings </p>
<pre><code> map:{
"a1":"#centerNumber#",
"a2":"#centerNumber#"
},
columns:[
{ id:"a1", header:"CenterNBR" , width:88}... |
Griddle Tables : React : Visible set to false not working in column meta data? <p><a href="https://github.com/GriddleGriddle/Griddle" rel="nofollow">https://github.com/GriddleGriddle/Griddle</a></p>
<blockquote>
<p>Griddle Tables for React</p>
</blockquote>
<p>Column property set to <code>visible = 'false'</code>, ... | <p>I found a solution to this via this griddle :
<a href="https://jsfiddle.net/inillie/m374gnxd/" rel="nofollow">https://jsfiddle.net/inillie/m374gnxd/</a></p>
<pre><code> var TestTable = React.createClass({
getInitialState: function() {
return {
test: [{
firstName: "Foo",
lastName: "Ba... |
livereload (browser-sync) work just once <p>The problem is that when i'm start </p>
<blockquote>
<p>gulp watch</p>
</blockquote>
<p>and change sass file, the page is reloading and build the project just once. Then it stop on task sass and if i want change other sass files - nothing happend then(see logs below). How... | <p>I am not sure what behavior who want other than detecting subsequent modified .scss files. For that, what happens if you add a return:</p>
<pre><code>gulp.task('watch', ['livereload'], function(){
return gulp.watch('app/css/scss/**/*.scss', ['sass']);
});
</code></pre>
|
plot differently colored background rectangles on plot over several axes <p>The following code is a snippet from a much larger function that plots several financial indicators over 3 axis:</p>
<pre><code>left, width = 0.1, 0.8
rect1 = [left, 0.7, width, 0.2]
rect2 = [left, 0.3, width, 0.4]
rect3 = [left, 0.1, width, 0... | <p>You can use the <code>patches</code> from <code>matplotlib</code></p>
<pre><code>import matplotlib.patches as patches
left, width = 0.1, 0.8
rect1 = [left, 0.7, width, 0.2]
rect2 = [left, 0.3, width, 0.4]
rect3 = [left, 0.1, width, 0.2]
fig = plt.figure(facecolor='white')
axescolor = '#f6f6f6' # the axes backgrou... |
How to change text color of a Sublime 3 predefined color-scheme/theme? <p>Specifically, I'm using the <a href="https://github.com/oivva/st-boxy" rel="nofollow">Boxy theme</a> for Sublime text 3.</p>
<p>I'd like to change the color of the main text and comments and I can't find a default to change to do that - just "fo... | <ul>
<li>Install <code>PackageResourseViewer</code> with <code>Package Installer</code></li>
<li>go <code>ctrl+shift+p</code> and select <code>PackageResourseViewer: Open Resource</code></li>
<li>open the color scheme your using from that theme, and change whatever you want.<br></li>
</ul>
<p>Simple as that.</p>
|
Is there a well known design pattern to allow callbacks to be registered after the async call? <p>When you make an async call you usually have to pass it a callback to process the result.</p>
<p>This is counter-intuitive to the one reading the code. We usually think about what to do and then about what to do later but... | <p><a href="https://en.wikipedia.org/wiki/Futures_and_promises" rel="nofollow">Promises, Futures, or Deferreds</a> are callback managers that are used to chain subsequent asynchronous code such that they avoid nested callbacks.</p>
<p>In JavaScript, promises have been formalized in <a href="https://promisesaplus.com/"... |
How to properly structure my ansible playbook when sharing tasks between roles <p>I am trying to follow best pratices in designing my ansible playbook. So the playbook file itself looks like this:</p>
<pre><code>- hosts: ...
roles:
- dbservers
- webservers
- ...
</code></pre>
<p>Now there is a task <code>check_pro... | <p>The proper way to reuse tasks from other playbooks is as you stated, by using an include. </p>
<blockquote>
<p>Suppose you want to reuse lists of tasks between plays or playbooks. You can use include files to do this. Use of included task lists is a great way to define a role that system is going to fulfill.</p>
... |
update VM time periodically <p>I have a linux (debian) VM and I need it to run with he UTC time, but for some reason the clock gets out of time in a matter of days.</p>
<p>I don't know if the VM clock runs slower, faster, or gets updated at a certain moment.</p>
<p>It is a VM on a VMware server of virtual machines. I... | <p>1- Install ntp or openntpd - (I use ntp)</p>
<p>2- edit /etc/ntp.conf and be sure there is at least one server </p>
<p>3- start the service ntpd and config to run every time you turn on the PC with:</p>
<p>systemctl enable ntpd
systemctl start ntpd
systemctl status ntpd</p>
<p>Last line is to be sure that the se... |
angular 2 how to bind two components behavior <p>I've two equal components</p>
<pre><code><component><component>
<component><component>
</code></pre>
<p>I need that if one of them change the another one change too, e.g if I've a function that when I click the element write 'hello' if i do it ... | <pre><code><component #c1 (click)="c2.title = 'hello'"><component>
<component #c2 (click)="c1.title = 'hello'"><component>
</code></pre>
<p>For other ways see <a href="https://angular.io/docs/ts/latest/cookbook/component-communication.html" rel="nofollow">https://angular.io/docs/ts/latest/cook... |
d3 v4 brush extent Error: <rect> attribute x: Expected length, "NaN" <p>I am trying to follow this example: <a href="http://bl.ocks.org/mbostock/34f08d5e11952a80609169b7917d4172" rel="nofollow">http://bl.ocks.org/mbostock/34f08d5e11952a80609169b7917d4172</a></p>
<p>I think the problem is setting the extent of the <cod... | <p>The initialization of your brush contains an error. When calling <a href="https://github.com/d3/d3-brush/blob/master/README.md#brush_extent" rel="nofollow"><code>brush.extent()</code></a> you need to specify an <em>array</em> of points, i.e. an array of arrays (nested array):</p>
<blockquote>
<p><a href="https://... |
Combination of functions <p>What I'm trying to do is create a string object with asterisks which can be scaled by user input. Example, User input 4:</p>
<pre><code>****
* *
* *
****
</code></pre>
<p>So I had 2 seperate functions, one which creates the top and bottom part "****"
and one which creates the middle. It ... | <p>You need to add the line breaks to your final variable:</p>
<pre><code>final = var + '\n' + output + '\n' + var2
</code></pre>
<p>Note that your code can be reduced to this:</p>
<pre><code>def hollow(user):
print ('*' * user + '\n' + ('*' + ' ' * (user-2) + '*\n') * (user-2) + '*' * user)
hollow(4)
</code></... |
Multiple aggs with ElasticSearch <p>I'm a noob with ES and I dont know how to resolve this simple scenario:</p>
<pre>
dataType value
1 A
1 A
1 B
2 B
3 A
3 A
4 A
4 B
</pre>
<p>I need to know how many datatypes only have 'A' value, how many only have 'B' value, and how many have both. ... | <p>I guess this is tricky, It could be done by <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-scripted-metric-aggregation.html" rel="nofollow">scripted metric aggregation</a>. I created a test index and inserted the sample data you provided. The following query give... |
Change product image based on variant color <p><strong>Online example of my goal:</strong></p>
<p>I'm trying to display bike products on a category page. On each product there's a frame variant color, I'm displaying that using round divs.</p>
<p>When I click a color, the image should change as you can see on Speciali... | <p>Based on Adeneo reply I managed to modify the code a little so it worked out as I wanted.</p>
<p>First, I added a css line: <code>.categoryImage { display:none; }</code> to hide ALL the product images.</p>
<p>I then added the script based on Adeneo's reply. I start off with targeting EACH of the <code>.frameColor<... |
No Firebase App '[DEFAULT]' has been created in Angular 2 <p>Using the Angular 2 CLI, I have the following code:</p>
<pre><code>joinSubmit(){
var self = this;
firebase.auth().createUserWithEmailAndPassword(
'test@test.com',
'testpassword'
)
.then(function(response){
... | <p>I think this will help you. Initialize app in the main component.</p>
<pre><code>AngularFireModule.initializeApp({
apiKey: "*******************",
authDomain: "**********.firebaseapp.com",
databaseURL: "https://*********.firebaseio.com",
storageBucket: ""
})
</code></pre>
<p>Check the following <a href="htt... |
Configure debian server host for ipv6 <p>I nee my website to be accessible though ipv6 network, I used <a href="https://wiki.debian.org/DebianIPv6" rel="nofollow">this page</a> (IPv6 6to4 Configuration) and got some results but my website is still not reachable in ipv6.</p>
<p>I tested my domain (creforma.fr) on sever... | <p>You cannot use a Link-Local address for DNS in either IPv4 or IPv6. All IPv6 interfaces use the same Link-Local network (<code>fe80::/10</code>), so you must use a scope (interface identifier, which is local to a host) on the end of the Link-Local address, e.g. <code>%eth1</code>, and these addresses are not routabl... |
Go with Postgres: LastInsertedId for non sequential identifiers <p>I´m writing a small web service in Go which uses Postgres through the <a href="https://github.com/lib/pq" rel="nofollow">pq driver package</a>. </p>
<p>I´m using a uuid´s as identifier for my models so LastInsertId won´t work. </p>
<p>So I´m thin... | <p>From <a href="https://godoc.org/github.com/lib/pq#hdr-Queries">https://godoc.org/github.com/lib/pq#hdr-Queries</a> it looks like you should use QueryRow instead of Exec</p>
<blockquote>
<p>pq does not support the LastInsertId() method of the Result type in database/sql. To return the identifier of an INSERT (or U... |
Save change in custom list display using local storage <p>I am trying to create a customizable list with links that can be hidden using a class if you click in a button. Also the list have a sortable option that you can move the links on the list, which saves to localstorage.</p>
<p>The problem is that I don't know ho... | <p>You want something like this:</p>
<pre><code>var myApp = new Framework7({
swipePanel: 'left'
});
// Export selectors engine
var $$ = Dom7;
var mainView = myApp.addView('.view-main');
var list = document.getElementById('linklist');
var items = list.children;
var itemsArr = [];
for (var i in items)... |
Basic Python function <p>I am trying to complete two different questions but cannot get them to work. Please help me understand where I went wrong.</p>
<p>1) For each number between 1 and 100, odds should be normal and even numbers should print out the word "Billy". Must start at 1 not 0 and include the number 100. He... | <p>try this</p>
<pre><code>for i in range(1,101):
if i % 2 == 0:
print('Billy') #you missed quote marks here
else:
print(i)
</code></pre>
<p>(bad indentation, and missing quote marks)</p>
<p>and </p>
<pre><code>name = input("What is your name?")
if name == "Joe":
print("Hi Joe :)")
eli... |
Setting a symbolic breakpoint with Swift and lldb <p>How does one set a symbolic breakpoint in lldb when using Swift? For example, sometimes I use:</p>
<pre><code>(lldb) b set -F '-[UIView(AdditionalLayoutSupport) updateConstraintsIfNeeded]'
</code></pre>
<p>But this no longer works:</p>
<blockquote>
<p>Breakpoint... | <p>When lldb is setting breakpoints any of the fancier matching breakpoints (including -F), it needs to know the target language since the kinds of matching it does depends on that. By default, lldb chooses the language of the current frame, but you can override that. So for instance to break on an ObjC symbol when y... |
MYSQL PHP Inner Join Compare different values <p>I have this two columns:</p>
<p><a href="http://i.stack.imgur.com/V6ozc.png" rel="nofollow"><img src="http://i.stack.imgur.com/V6ozc.png" alt="enter image description here"></a></p>
<p>The first column name is TAGS and the second column name is PORTTAG.</p>
<p>I want ... | <p>It seems as though you need to use the <code>not exists</code> operator:</p>
<pre><code>SELECT nome
FROM tags t
WHERE NOT EXISTS (SELECT *
FROM porttag p
WHERE p.tag = tags.nome AND p.port = 1)
</code></pre>
|
VMware Workstation and Device/Credential Guard are not compatible <p>I have been running VMware for the last year no problems, today I opened it up to start one of my VM and get an error message, see screen shot.</p>
<p><a href="http://i.stack.imgur.com/KxtXR.png" rel="nofollow"><img src="http://i.stack.imgur.com/KxtX... | <p><a href="https://blogs.technet.microsoft.com/ash/2016/03/02/windows-10-device-guard-and-credential-guard-demystified/" rel="nofollow">Device/Credential Guard is a Hyper-V based Virtual Machine/Virtual Secure Mode</a> that hosts a secure kernel to make Windows 10 much more secure.</p>
<p><a href="http://i.stack.imgu... |
Eclipse Neon for c++ gdb debugger not working <p>I have 32 bit Eclipse Neon for C/C++ and installed the basic packages and c++ compiler for 32 bit MinGW. Everything in Eclipse seems to work fine except the debugger. When I tried debugging a simple hello world program, this is what the debugger will show:
<a href="http:... | <p>Ok, so I don't exactly know what happened, but the debugger works now. I fiddled with the environment variables a bit, and it started working after that. I tried isolating the solution, so I reinstalled Eclipse to see what setting actually fixed the debugger, but after this reinstall the debugger just worked normall... |
How to create mutually dependent components using Autofac <p>I have two mutually dependent classes that I want Autofac to instantiate. Basically, the parent needs a reference to the child, and the child needs a reference to a service that in this case the parent happens to implement.</p>
<pre><code>public class Parent... | <p>I found a rather elegant solution using <a href="http://docs.autofac.org/en/latest/resolve/relationships.html#parameterized-instantiation-func-x-y-b" rel="nofollow">parameterized instantiation</a>. It allows the child's dependency on <code>ISomeService</code> to be resolved using an existing object (the <code>Parent... |
SQL Query to get mapping of all users to their logins <p>What's a query that I can use to get a list of all logins associated with each user in SQL Azure?</p>
<p>So far I've found the following two queries to get all users and all logins, but I haven't found any way to see which user goes with which login:</p>
<pre><... | <p>It's hard to tell you your correct answer b/c we don't know the structure of your tables. If you share that we can help more. But below should get you to where you need to go.</p>
<p>They way to do it is by a MySQL JOIN. In this case you should use a INNER or OUTER JOIN depending on how your database is structur... |
Using filterNot with a Map <p>I have a simple map</p>
<pre><code>val m = Map("a1" -> "1", "b2" -> "2", "c3" -> "3")
val someList = List("b", "d")
m.filterNot( (k,v) => someList.exist(l => k.startsWith(l)) )
</code></pre>
<p>I'm getting an error:</p>
<pre><code>error: missing parameter type
</code></pr... | <p><code>filterNot</code> needs a <code>case</code> keyword and <code>{}</code> when you extract <code>k, v</code> from tuple.</p>
<p><em>note that its not <code>exist</code> its <code>exists</code></em></p>
<pre><code>m.filterNot { case (k,v) => someList.exists(l => k.startsWith(l)) }
</code></pre>
<p>or</p>
... |
How to use httpparamserializer in Angular2 <p>I am trying to use httpparamserializer in Angular2. I googled a lot but the examples are only for angular1 as shown below.
<a href="http://stackoverflow.com/questions/35756603/how-to-inject-httpparamserializer-for-use-in-templateurl">How to inject $httpParamSerializer for u... | <p>I had the exact same question <a href="http://stackoverflow.com/q/39538440/2593877"><strong>HERE</strong></a></p>
<p><strong>My Solution</strong>: I have a POST where I post data to a web service and I serialize my object this is how I do it. It is pretty simple and easy to use.</p>
<h2><a href="https://angular.io... |
Java - Properly format a String given escape sequences and escape characters <p>Given new line (\n), tab (\t) and an escape character \ how can I given a string format it properly so it deals with these escape sequences and escape characters properly. Example 1:</p>
<pre><code>"string \\t \t"
</code></pre>
<p>The out... | <p>looks like the one "brute force" combination you didn't try is correct</p>
<pre><code>replace("\\t", "\t")
</code></pre>
<p>reading "replace all < backslash >< t > combinations with < tab >"</p>
<p>String them all together to get</p>
<pre><code>v = v.replace("\\t", "\t").replace("\\n", "\n")
</code></pr... |
Handle dynamic generated checkboxes in javascript <p>I am generating dynamic checkboxes with the functionality of radiobuttons</p>
<pre><code>var foo = $("#foo");
for (var i = 0; i < 5; i++) {
var descr = $('<br><tr><td><label> TEST_'+i+':</label></td><td colspan="2">' +
... | <p>Firstly you should use <a href="https://learn.jquery.com/events/event-delegation/" rel="nofollow">event delegation</a> for dynamically generated element. And secondly you can use checkbox value for select similar checkbox like following.</p>
<pre><code>$(document).on('change', '.chb', function() {
var value = $... |
How can I speed up my EF query? <p>How can I speed up this query? Right now it's taking me around 2 minutes to pull back 210K records.</p>
<p>I turned off LazyLoading as well as set AsNoTracking on my tables.</p>
<p>I know it's a lot of data but surely it shouldn't take 2 minutes to retrieve the data?</p>
<pre><cod... | <p>You can do without <code>DbFunctions.TruncateTime()</code> and probably also without these <code>Trim().ToUpper()</code> calls.</p>
<p>If you execute a function on a database column before it is filtered, it's impossible for the query optimizer to use any indexes on this column. This is know as being <em>non-sargab... |
WebApi redirect to external site <p>I have a WebApi controller that after I invoke it I want it to redirect me to another site</p>
<p>Here is my c# code</p>
<pre><code>public async Task<HttpResponseMessage> Login(LoginParameters parameters, [FromUri]string returnUrl)
{
//same validations
var response = ... | <p>When you use <code>$http</code>, this uses an <code>XMLHttpRequest</code> object which does not adjust the location for the user. It will even follow redirects. You have a couple options:</p>
<ul>
<li><p>You could return the new location as a field, then in the <code>.then</code> callback, assign <code>window.locat... |
How to generate a file with version control information (TFS) during build <p>I'm tired of not knowing what builds web application is built from when an issue is presented to me by QA. My proposed solution is to generate some static content as part of the build process that has useful information in it. Somebody could ... | <p>The version control information is already generated in environment variables, you just need to write some simple command to read them from the environment variables. Check following links to see if these information meets your requirement:</p>
<p>For vNext build: <a href="https://www.visualstudio.com/en-gb/docs/bu... |
Access Login Password Update VBA & SQL <p>Have an Access front end Login Form which includes an option for the user to change password. In frm_Login Sub I'm attempting to use the following to pass the entered username "Me.txtUserName" to frm_PassChange:</p>
<pre><code>If Me.changepass = "Yes" Then
DoCmd.OpenForm "... | <p>You need one more comma before your <code>Me.txtUserName</code></p>
<p>Right now you're trying to pass it to the WindowMode argument</p>
<p>Just use Intellisense as you type and insert your commas - it'll popup the argument as you go along</p>
|
resampling error in MLR <p>My task would be to stratify a regression task, the data looks like</p>
<p>f1,f2,f3,... m1,m2...,p1,p2,p3...</p>
<p>where f_i are numerical and the other columns are factors and integers.</p>
<p>Now I define a self defined measure m1, after running the following </p>
<pre><code>measures1 ... | <p>It turns out using </p>
<pre><code>rapply(dat,function(x)length(unique(x)))
</code></pre>
<p>I could find out that there is one column with only 1 unique value, problem solved. </p>
|
What is meant by the following regex? <p>I am working on kernel module and the module outputs a hex code which is being read by a perl script using regex.</p>
<p>I am not able to make sense out of it:</p>
<pre><code>while (<>) {
s/^([a-fA-F0-9]+)(\.)([a-fA-F0-9]+)(\s+.*)/sprintf("%s%s%s%s", &$converter... | <pre><code>s/^([a-fA-F0-9]+)(\.)([a-fA-F0-9]+)(\s+.*)/sprintf("%s%s%s%s", &$converter(hex($1)), $2, hex($3), $4)/oe;
</code></pre>
<p>There are 4 capturing groups, each is covered by brackets ():</p>
<p><code>$1 -> ([a-fA-F0-9]+)</code></p>
<p><code>$2 -> (\.)</code></p>
<p><code>$3 -> ([a-fA-F0-9]+)... |
Time Comparison Multithreading <p>I have a program that reads some input text files and write all of them into one separate file. I used two threads so it runs faster!
I tried the following python code with both one thread and two threads! Why when I run with one thread it runs faster than when I run it with two thread... | <p>You have several problems I'll get to in a moment, but generally your program is disk-bound (it can't go faster than your hard drive) so even a properly threaded program isn't any faster. It can be hard to measure disk performance because of the file system cache: You run this once with threads and you go at hard dr... |
How do I run a animation on every input change? <p>I'm working on a animation that appears if you interact with some input elements. On a input change event, the script adds the class <code>highlight</code> and removes it after a delay of 1 second.</p>
<p>The problem is, If I switch the radio buttons faster than 1 sec... | <p>Queue them in the opposite direction:</p>
<pre><code>$("div").bind('DOMNodeInserted DOMNodeRemoved', function() {
$(this).removeClass('highlight').delay(10).queue(function(next) {
$(this).addClass("highlight");
next();
});
});
</code></pre>
<p>(and set animetion loop to once)</p>
|
Address Bar for Google Map API, which element to use <p>I would like to follow the same UI in Google map in its address bar, where one can enter an address. </p>
<p>I am creating a web Polymer app which uses the map.
Question is which element should I use for the address bar? Is it considered <strong>floating</strong... | <p>This example is not complete as it needs some behaviours that are elsewhere and pikaday imported which I have modified. But it should give a good idea as how to use a paper-input to do other stuff</p>
<pre><code><!--
`<pas-date-input>` us an element to collect dates from users. It is designed to provide
... |
AmCharts Gantt Chart with Data time not loading correctly <p>I'm trying to plot out a Gantt chart with Date/Time on the X axis, the code I have is something like this:</p>
<pre><code> AmCharts.useUTC = true;
var chart = AmCharts.makeChart( "user-pages", {
"type": "gantt",
"theme": "light",
"margi... | <p>You're calling <code>AmCharts.stringToDate</code> incorrectly. The second parameter is the format of the string date the function is trying to parse in the first parameter. Your dates are in YYYY-MM-DD format, not DD-MM-YYYY. Once you fix the format, the chart will render correctly. Ex: <code>AmCharts.stringToDate("... |
Upgrade to angular 2 RC7 issue with routes <p>I am trying to upgrade our app to angular 2 RC7 with router 3.0.0.rc-3 from RC5.
But I get the following errors on the child routes files. </p>
<pre><code>ERROR in [default] C:/src/app/routes/childroute1/child-routes-one.routes.ts:31:8
Type '{ path: string; componen... | <p>The <code>terminal</code> property is no longer supported in the newer Routers. Take that out and everything should build.</p>
|
PayPal REST API Recurring Payments, but strategy for 1 payment / 6 months? <p>I have a nicely working recurring payments setup with the PayPal REST API. However, I am scratching my head how to get this payment strategy to work:</p>
<p>__> 6 month long subscription cycle, infinitely repeating.
__> one-time payment for ... | <p>I think you just need to set the <code>frequency_interval</code> to 6 and the <code>frequency</code> to <code>MONTH</code> in the billing plan's <a href="https://developer.paypal.com/docs/api/payments.billing-plans#definition-payment_definition" rel="nofollow">payment definition</a>.</p>
<blockquote>
<p><strong>f... |
Limit Contact Form 7 hook (Before Send) to specific form <p>I have a website with 3 form, but only two of these forms must enter information into the Salesforce database. How do I define which forms should use the hook and which shall without going through it?</p>
<p>Follow the code I'm using:</p>
<pre><code>add_acti... | <p>I got a solution, I do not think itâs the best but here is what I did:</p>
<pre><code> add_action( 'wpcf7_before_send_mail', 'my_conversion' );
function my_conversion( $contact_form ) {
$title = $contact_form->title;
$submission = WPCF7_Submission::get_instance();
if ( $submission ... |
Netbeans GUI broken after Maven Transition (How do I change generated code that isn't part of a component?) <p>I'm trying to revive several applications that someone else wrote quite a while ago. I decided a good path was to get all of these in a good SCM system, and change the build style over to maven (for dependency... | <p>I was hoping to find a "safer" way to edit the generated code, which is the primary reason that I posted this question, but I still never found a method of changing the generated code within Netbeans.</p>
<p>I did end up solving my issue by using Notepad++ to edit my files, as described in this SO question: <a href... |
Get data before page load in the dialog on $http in node.js <p>I am trying to develop a dynamic dialog box. The text is coming on a $http.get response. but somehow it is not working. A little help will be really appreciated. I am using node.js and angular. </p>
<pre><code>angular.module('rugCoPro')
.controller('Dashb... | <p>The simplest solution to your problem is:</p>
<pre><code>$http.get("api/models/department").success(function(response, status, headers){
$scope.app_modes = response;
$scope.load();
});
</code></pre>
<p>And you loose the ng-init="load()". It will first load the data, then show the dialog.</p>
|
How to use Bing Speech for C# WPF Application <p>I'm trying to get Bing Speech followed this link: </p>
<p><strong>www.microsoft.com/cognitive-services/en-us/speech-api</strong> it says: <em>"Show Quota is temporarily unavailable. We are working hard to bring an improved version back in the middle of October."</em> an... | <p>Assuming you're interested in a C# sample, maybe this can help: <a href="https://github.com/Microsoft/BotBuilder-Samples/tree/master/CSharp/intelligence-SpeechToText" rel="nofollow">https://github.com/Microsoft/BotBuilder-Samples/tree/master/CSharp/intelligence-SpeechToText</a>. It is a sample speech-to-text bot, wh... |
perform back button press from an overlay window - android <p>I have an overlay view <i>(LinearLayout)</i> added to <code>WindowManager</code> with following params set:</p>
<pre><code>private void setWindowParams(WindowManager.LayoutParams params) {
params.height = WindowManager.LayoutParams.WRAP_CONTENT;
par... | <p>you can't do that because Context of the Dialog Will Be Destroy when Activity is Killed , you can use
<a href="https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwiRteiv7cHPAhVLaD4KHZ44B_8QFggcMAA&url=https%3A%2F%2Fdeveloper.android.com%2Fref... |
camera images pass another activity <p>How can i pass the captured photo to another activity?Currently i am trying using the following method.</p>
<p>public class Match extends Activity {</p>
<pre><code>private static final int CAMERA_REQUEST = 0;
public
ImageView logo;
Button Button;
@Override
pu... | <p>The best way to do that is to save the captured image in Application folder and then pass the file url to another activity and then in other activity load the image using <a href="http://square.github.io/picasso/" rel="nofollow">picasso</a>, which is really powerful Image Loading library.</p>
|
How to write fast code for matrix multiplication in C++? <p>I wrote some C++ code for matrix multiplication. I used <code>vector<double></code> to save the matrix entries, and I used a series of 3 nested <code>for</code> loops to calculate the multiplication entry-by-entry. It turns out that this is super slow (f... | <p>Here are some suggestions for performance improvement. </p>
<p><strong>Move Vector outside the loop</strong><br>
Creation of vectors requires time. Move the declaration before any of the for loops: </p>
<pre><code>vector<double> vtmp(A.n_r);
for (int c_b=0;c_b<B.n_c;c_b++)
{
for (int r_a=0;r_a<A... |
User login action is not working, showing invalid username and password in CakePHP3 <p>I am trying to implement login functionality in CakePHP3 by following all prescribed ways. I have already tried many alternatives apart from main method found on Authentication page of official Cake website.</p>
<p>The error, I am r... | <p>It is not working without PasswordHasher in Auth component.
You should add it in /src/Model/Entity/User.php</p>
<p>Add below code at the end. Also add use Cake\Auth\DefaultPasswordHasher;</p>
<pre><code>protected function _setPassword($value){
$hasher = new DefaultPasswordHasher();
return $hasher-&... |
images in assets folder not loading Im getting a 304 error <p>When Im trying to load this png file from assets folder im getting a 304 error. Im trying to load pictures from assets folder.</p>
<pre><code>const path = require('path');
const express = require('express');
const webpack = require('webpack');
const config ... | <p>HTTP 304 is a redirect - not an error. It means it is loading the image from the cache. If you have been making changes try clearing your cache or opening the browser in private browsing mode so it won't load from it. It may have cached an image/location that is invalid still which is why it isn't loading.</p>
|
Show marker on Google Maps Javascript external link <p>On the Google Maps javascript, there is a clickable link at the bottom left of the map with the Google icon to "See this area on Google Maps". This link opens up Google Maps, however, it only centers on the latitude/longitude provided and doesn't show the marker I ... | <p>Should be:</p>
<pre><code>function initMap() {
var center = {lat: 37.423021, lng: -122.083739};
var map = new google.maps.Map(document.getElementById('gmap_holder'), {
zoom: 4,
center: center
});
var marker = new google.maps.Marker({
position: center,
map: map
});
// you can set other... |
Error in tf.contrib.learn Quickstart, no attribute named load_csv <p>I am getting started in tensorflow on OSX and installed the lasted version following the guidelines for a pip installation using:</p>
<pre><code>echo $TF_BINARY_URL
https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.11.0rc0-py2-none-any.w... | <p>This function has been deprecated: <a href="https://github.com/tensorflow/tensorflow/commit/2d4267507e312007a062a90df37997bca8019cfb" rel="nofollow">https://github.com/tensorflow/tensorflow/commit/2d4267507e312007a062a90df37997bca8019cfb</a></p>
<p>And the tutorial seems not up to date. I believe you can simply rep... |
parse nodeList Value using Jsoup <p><a href="http://www.smbs.biz/ExRate/StdExRate.jsp" rel="nofollow">http://www.smbs.biz/ExRate/StdExRate.jsp</a></p>
<p>In this Website, I tried to parse the value of the table for the currency.</p>
<p>The below value in the table is the value I want to extract.</p>
<p>In developer ... | <p>When we load the page in a browser with disabled JavaScript, we note, that the table remains empty.</p>
<p>Activating JavaScript and monitoring the network tab (chrome dev tools/F12) on a reload, we see a request:</p>
<pre><code>http://www.smbs.biz/ExRate/StdExRate_xml.jsp?arr_value=USD_2016-09-13_2016-10-05
</cod... |
Within Group Error in Postgresql <p>I am getting a within group error in PostgreSQL 9.4:</p>
<p>ERROR: WITHIN GROUP is required for ordered-set aggregate rank
LINE 4: (select a1.rank as r1,</p>
<pre><code>create view a as (select rank() over (order by pid, time)
pid, event, time
from test5);
select e1.pr... | <p>I think your error is a typo in the view. I <em>believe</em> what you wanted was this:</p>
<pre><code>create view a as
select
rank() over (order by pid, time),
pid, event, time
from test5;
</code></pre>
<p>As it stands your current view definition:</p>
<pre><code>create view a as (select rank() over (order b... |
What exactly is the difference between 'float' and 'double' floating point storage types? <p>I've seen examples of the terms <strong>"float"</strong> and <strong>"double"</strong> being applied to different scenarios and seem to understand that bits and bytes serve some role, but I cannot find a <strong><em>clear</em> ... | <p>Floating point is a way to represent numbers that is used in computers, and is explained elsewhere, for example
<a href="http://stackoverflow.com/questions/56947/how-is-floating-point-stored-when-does-it-matter">here</a>
and
<a href="http://stackoverflow.com/questions/2386772/difference-between-float-and-double">her... |
C++: How to avoid vector from being destroyed after returning from method? <p>I am trying to overload the division operator <code>/</code> for a <code>Polynomial</code> class, but the algorithm in itself is irrelevant. The problem is C++ seems to be corrupting my polynomial when I try to return it for some unknown reas... | <p>Well, you return a reference to a local variable. Any code that will use the variable will be undefined behavior. There's a simple solution for your case: remove the <code>&</code></p>
<pre><code>// Notice that the function is not returning a reference anymore
Polynomial Polynomial::operator/(const double &... |
How can I store the opened room's chat at unique locations in Firebase and then retrieve them? <p>I want to do something like this: suppose there are 5 chat rooms and the user can enter and chat in any chat room by pressing the respective button. So, he should be shown the chats of that room only and not overall chat. ... | <p><em>To achieve this I would suggest you to re-structure your database. Avoid too much nesting and post the chat rooms/chat requests like this:</em> </p>
<p>So here you see two chat rooms under unique ids generated by <strong>.push()</strong> at the time of posting request. With one unique identifier for request wi... |
DL query in Protege related to equivalent class and object property <p><img src="http://i.stack.imgur.com/dzbmL.png" alt="Kindly click here to view the Ontology Snapshot for understanding the question"></p>
<p>I have shown a snapshot of an Ontology in the figure above.</p>
<p>I try to <strong>Execute</strong> a <stro... | <p>If I understand your question right, you need to get the value of <code>hasVolume</code> property, for <code>Apple</code>. I guess you writing a reversed (wrong) query. Try writing the following in your DL tab:</p>
<pre><code> inverse (hasVolume) value Apple
</code></pre>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.