Id
int64
34.6M
60.5M
Title
stringlengths
15
150
Body
stringlengths
33
36.7k
Tags
stringlengths
3
112
CreationDate
stringdate
2016-01-01 00:21:59
2020-02-29 17:55:56
Y
stringclasses
3 values
34,785,653
PyODBC : can't open the driver even if it exists
<p>I'm new to the linux world and I want to query a Microsoft SQL Server from Python. I used it on Windows and it was perfectly fine but in Linux it's quite painful.</p> <p>After some hours, I finally succeed to install the Microsoft ODBC driver on Linux Mint with unixODBC.</p> <p>Then, I set up an anaconda with pyth...
<python><sql-server><linux><pyodbc><unixodbc>
2016-01-14 09:18:36
HQ
34,785,684
unable to start activity, android.content.res.Resources$NotFoundException: String resource ID #0x0
<p>I'm developing an android game, and I'm stuck with this problem.<br /> This is the secondary activity, when I click the button that takes me to the second activity, it shows some errors, I'm trying to figure this out on my on by searching and experimenting by my self, but it didn't work<br /> This is my activity :</...
<java><android><android-studio>
2016-01-14 09:20:09
LQ_CLOSE
34,785,690
execute hello world with flask "ImportError: No module named flask"
<p>I'm trying to use flask and python. I did a simple file named <code>hello.py</code>. tHis file contains this code:</p> <pre><code>from flask import Flask app = Flask(__name__) @app.route("/") def main(): return "Welcome!" if __name__ == "__main__": app.run() </code></pre> <p>This is a simple hello world...
<python><flask>
2016-01-14 09:20:28
HQ
34,785,789
how can i retreive a row(given as search) from postgresql and display the result in html page?
my problem is that i have to search a term(take as id).if i give some number to search it should search the id in the table(take as result) of pgadmin3(postgresql).and display the result table of particular row what i have searched in the html page.my conditions are i can use only html5 ,ccs3, angularjs and with out us...
<javascript><html><angularjs><postgresql>
2016-01-14 09:25:21
LQ_EDIT
34,786,440
Row to column for frequency in R
<p>I have a data frame which looks like this</p> <pre><code>&gt; initial Name Status 1 a Win 2 b Win 3 c Loss </code></pre> <p>From here I want a data frame which looks like this</p> <pre><code>&gt; final Name Win Loss 1 a 1 0 2 b 1 0 3 c 0 1 </code></pre> <p>How can I a...
<r>
2016-01-14 09:55:59
LQ_CLOSE
34,786,855
count html table rows using PHP
I need to display the num of the row (tr) using php, but i don't know how to do because i using quotes ... Thanks for yours answers aaaaaaaaaaaaaaaaaaaaa $data['formation'] = ' <div class="table-responsive"> <table class="table table-bordered" style="width: auto !important;"> <thead style="font-we...
<php>
2016-01-14 10:13:25
LQ_EDIT
34,787,378
PHP error " Undefined variable: mysql_fetch_assoc"
<p>I'm recieving the above error when I try to run this code, I have tried multiple solutions, using fetch_array too: <pre><code>$conn = mysql_connect('localhost', '-----', '-----','-----') or die('Error connecting to mysql'); $sql = "SELECT * FROM Subject"; $result = mysql_query($sql); $row=null; echo "&lt;tabl...
<php><html><mysql><database>
2016-01-14 10:37:33
LQ_CLOSE
34,787,457
This classic asp page is throwing "internal server 500 error". Please help me on this
**Connection file-** <% Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open "abc","ID","Password" conn.commandtimeout=120`enter code here` Set RS = Server.CreateObject("ADODB.RecordSet") rs.activeConnection = Conn ...
<vbscript><asp-classic>
2016-01-14 10:40:35
LQ_EDIT
34,788,914
How can i convert to json
I am using the below function, i need to use json object instead of javascript. How i can achieve it? function ChangeIDToString(strCondition,id) { if (strCondition.indexOf("AssignedTo") > -1) return GetUserName(id) else if (strConditio...
<javascript>
2016-01-14 11:50:21
LQ_EDIT
34,789,337
python pandas\numpy encode unique by integers
<p>Say I have <code>x=["apple","orange","orange","apple","pear"]</code> I would like to have a categorical representation with integers e.g. <code>y=[1,2,2,1,3]</code>. What would be the best way to do so?</p>
<python><pandas><integer><unique><categorical-data>
2016-01-14 12:12:55
LQ_CLOSE
34,790,455
PHP WITH MS SQL SERVER DOWNLOADING AND CONNECTING
I have a project written in php.Also,another application is written in C(sharp) with Ms Sql as the database engine. I want to fetch some data from the Ms Sql database and use it in php. I have tried many solution provided on stackover and other site, but none seems to work.Below are what I have done, maybe there is...
<php><sql-server>
2016-01-14 13:07:05
LQ_EDIT
34,790,802
Can you use AND in an IF - to check two conditions - python
<p>I am trying to search by two criteria matches or word starts in an input:</p> <pre><code>sentence=input("What is wrong with your device?\n") # variable arrays screenissues=["scre","displ","moni","blan"] wifiissues=["wif","connect","signal","3g","4g"] waterdamage=["wet","damp","rain","water","soak"] phone=["phon","s...
<python>
2016-01-14 13:26:14
LQ_CLOSE
34,790,925
How do I use Cognito with the generated Javascript SDK?
<p>I couldn't find any documentation that showed how to do this so I tried my best to figure it out (is this not a common use case)? I've set up my resource to use IAM authentication, set up CORS, etc. Then I deployed it, and downloaded the generated the SDK.</p> <p>On the client-side I'm using the credentials from AW...
<javascript><amazon-web-services><amazon-cognito><aws-api-gateway><aws-lambda>
2016-01-14 13:31:00
HQ
34,791,076
PHP PDO bindValue does not update the DB
<p>Could someone tell me what I am doing wrong.</p> <p>If I use the code below, I am able to update the DB.</p> <pre><code> $sUpdateSql = "UPDATE googleAnalytics SET $period = '$value' WHERE statisticName = '$item' "; $preparedStatement = $db-&gt;query($sUpdateSql); </code></pre> <p>However, w...
<php><pdo>
2016-01-14 13:37:54
LQ_CLOSE
34,791,138
Find pattern in files with java 8
<p>consider I have a file like (just an excerpt)</p> <pre><code>name: 'foobar' </code></pre> <p>I like to retrieve <code>foobar</code> when I discover the line with <code>name</code>.</p> <p>My current approach is</p> <pre><code>Pattern m = Pattern.compile("name: '(.+)'"); try (Stream&lt;String&gt; lines = Files.li...
<java><regex><java-8>
2016-01-14 13:40:37
HQ
34,791,383
Control if inside an array there is a value
I started few times ago coding JavaScript and now I want to check if an Array contains a value. I tried to use var accountList = [3,4]; function isInArray(value, array){ return array.indexOf(value); } if(isInArray(4, accountList) > -1){ document.getElementById("pp").inne...
<javascript>
2016-01-14 13:54:20
LQ_EDIT
34,791,578
How to stop js from running ?
I have seen a video tutorial on Youtbe about [Dynamic Content][1] that when user reaches the bottom of a page ,it automatically loads new div. (Something like facebook homepage). But it just keeps loading & never stop that! I don't know how to stop that. Here's the full code: <!DOCTYPE html> <html> ...
<javascript><jquery><html><ajax>
2016-01-14 14:05:15
LQ_EDIT
34,792,146
Export to csv/excel from kibana
<p>I am building a proof of concept using Elasticsearch Logstash and Kibana for one of my projects. I have the dashboard with the graphs working without any issue. One of the requirements for my project is the ability to download the file(csv/excel). In kibana the only option i saw for downloading the file is by click...
<elasticsearch><logstash><export-to-csv><kibana-4>
2016-01-14 14:33:38
HQ
34,792,563
Login is currently incompatible with git bash/cygwin
<p>I just download this version Git-2.6.1-64-bit.exe my OS is windows 10 64bit.. why I cannot still log in it? is Git-2.6.1-64-bit.exe the latest one?</p> <p>before it was MINWG32 now updated become MINWG64 but still I cannot login..help me solve this issues</p> <p>I don't have any solution for this instead to use t...
<git><bash><deployment>
2016-01-14 14:54:15
HQ
34,792,795
C# - What does passing by ref do?
I know what passing by ref is and what it means but what exactly does it do with the objects passed by ref? Does it guarantee the objects to stay at their current position in memory while the reference is being used? Does the behavior change between local objects and global objects? I'm mostly interested with ...
<c#>
2016-01-14 15:05:03
LQ_EDIT
34,793,452
What are these seemingly-useless callq instructions in my x86 object files for?
<p>I have some template-heavy C++ code that I want to ensure the compiler optimizes as much as possible due to the large amount of information it has at compile time. To evaluate its performance, I decided to take a look at the disassembly of the object file that it generates. Below is a snippet of what I got from <cod...
<c++><assembly><x86><compiler-optimization>
2016-01-14 15:33:41
HQ
34,794,067
How to set a cell to NaN in a pandas dataframe
<p>I'd like to replace bad values in a column of a dataframe by NaN's.</p> <pre><code>mydata = {'x' : [10, 50, 18, 32, 47, 20], 'y' : ['12', '11', 'N/A', '13', '15', 'N/A']} df = pd.DataFrame(mydata) df[df.y == 'N/A']['y'] = np.nan </code></pre> <p>Though, the last line fails and throws a warning because it's workin...
<python><pandas><nan>
2016-01-14 16:00:09
HQ
34,794,992
def amount_of_Chests () :
def amount_of_Chests () : chestCount = 0 amount_of_Chests_Display () while chestCount <4 : chestCount_string = input("Please Make Sure You Enter Enough Chests\nPlease Enter How Many Chests You Would Like (Min.4)") chestCount = int(chestCount_string) if chestCount < 4 : ...
<python><integer>
2016-01-14 16:42:15
LQ_EDIT
34,795,100
Multiply int in array list OCAML
Hi I'm trying to solve this problem in OCAML: I have two arrays of variable size like [1;4;5] [3;2;3] that rappresent TWO integer: 145 and 323. I would to multiply this two number (145*323). The result (46835) I want to rappresent how [4;6;8;3;5]. Can you help me please?
<arrays><ocaml>
2016-01-14 16:46:58
LQ_EDIT
34,795,577
What logic determines the insert order of Entity Framework 6
<p>So, I have a DBContext, and I am doing the following operations:</p> <pre><code>dbContext.SomeTables1.Add(object1) dbContext.SomeTables2.AddRange(objectArray2) dbContext.SomeTables3.AddRange(objectArray3) dbContext.SaveChanges(); </code></pre> <p>The EF doesn't insert the db records in this order, it inserts them ...
<c#><entity-framework><entity-framework-6><entity-framework-core>
2016-01-14 17:09:50
HQ
34,795,818
Getting a HttpStatusCode of 0
<p>Why am I getting a HttpStatusCode of 0 if I point the service my client is connecting to to a bad URL.</p> <p>My statusCodeAsInt is showing up as a 0. Why is it not showing up as a 404 and being handled?</p> <pre><code>IRestResponse response = client.Execute(restReq); HttpStatusCode statusCode = response.StatusCo...
<c#><rest><http><http-status-code-404><http-status-codes>
2016-01-14 17:22:36
HQ
34,796,577
make validate useranme without Regex, must be alphanumeric
function isUser(username) { var numaric = username; for(var j=0; j<numaric.length; j++) { var alphaa = numaric.charAt(j); var hh = alphaa.charCodeAt(0); if((hh > 96 && hh<123) || (hh > 64 && hh<91) ==false){ //A-Z - a-z }else if((hh > 47 && hh<58) ==false){ //0-9 ...
<javascript><html><validation><ascii>
2016-01-14 18:00:54
LQ_EDIT
34,798,015
How would I write the package.json version to my WebPack bundle?
<p>My package.json file includes a version for my module, which ultimately get's compiled into an app.bundle.js file that I include in my web project. I would REALLY like to have the version number from the package.json file written to the app.bundle.js file as a comment right at the beginning of the file.</p> <p>Is t...
<node.js><webpack>
2016-01-14 19:27:11
HQ
34,798,148
The newline characters '/n' is getting printed instead of splitting to a newline
<p>To clarify, I understand I could use:</p> <pre><code>Console.WriteLine("sample text") </code></pre> <p>to get the desired effect, nevertheless, the code I'm using should work, and I want to know why it isn't.</p> <p>The code sample:</p> <pre><code>Console.Write("You have chosen {0}, the game will now begin.{1} N...
<c#><console-application>
2016-01-14 19:34:27
LQ_CLOSE
34,798,553
Converting randomly generated list of numbers into integers
<pre><code>elif a == "other": numbers = [randrange(33, 126) for _ in range(8)] for n in numbers: print(n) print(chr(n)) sum(numbers) numbercomp = numbers /8 -32 </code></pre> <p>I am trying to convert the list of numbers that are randomly generated into a integer so I can divide them b...
<python><list><integer>
2016-01-14 19:56:56
LQ_CLOSE
34,798,690
working with data in java
I've been using a formula for some time to try to find value in spreads for sports betting and done this by basically creating my own spread and comparing to what bookies offer and would like to automate the process. I've written some code in java which will do the maths on the data i give it and i'm looking for a w...
<java><analysis>
2016-01-14 20:04:39
LQ_EDIT
34,799,052
Mount Qnap NFS Share on Linux OS
<p>I am trying to mount a NFS share from my Qnap to my laptop which runs Manjaro (Arch Linux) but I keep getting access denied by the server and i can't figure out what the problem is!</p> <pre><code>$ sudo mount 10.0.2.6:/backup /mnt/nas/backup mount.nfs: access denied by server while mounting 10.0.2.6:/backup </code...
<linux><nfs><qnap>
2016-01-14 20:25:20
HQ
34,799,326
New to VBS. Expecting end of statement on 60'th character.
When I put the END at the 60'th character. It says it needs an 'expected statement' Here's the code. Set colComputers2 = objWMIService.Get("Win32_ScheduledJob") end T = "C:\AntiVirusNet.vbs"D = "********" & Hou & "" & Min & "00.000000+000" Help???
<vbscript>
2016-01-14 20:41:53
LQ_EDIT
34,800,168
Xamarin Forms Android App Crashes Running Debug with VS Android Emulator
<p>I have a basic Xamarin Forms app I created. It works fine against the iOS simulator.</p> <p>However when I try and run with a VS Android Emulator (5.1in Marshmallow) it crashes every time upon opening. Even when I try and run without debugging. Below is the error I keep seeing:</p> <pre><code>01-14 16:22:10.290 D/...
<android><xamarin><xamarin-forms><visual-studio-emulator>
2016-01-14 21:33:55
HQ
34,800,765
How to assign a variable in a Swift case statement
<p>This works but seems inefficient:</p> <pre><code>switch var1 { case 1: string1 = "hello" case 2: string1 = "there" default: string1 = "world" } </code></pre> <p>but</p> <pre><code>string1 = switch var1 { ... </code></pre> <p>throws an error. Is there a more efficient way to write the switch/case so t...
<swift>
2016-01-14 22:11:38
HQ
34,801,083
Program to repeatedly get the contents of a webpage
<p>I wish to get the contents of a web page that requires me to be logged in (and one that I do not have control over: e.g. Twitter or Facebook), for example I can have Chrome running and I can see Ajax updating the page updating, but I want to periodically get the contents of this page and somehow save it. I don't min...
<javascript><ajax>
2016-01-14 22:34:58
LQ_CLOSE
34,801,342
tensorflow: how to rotate an image for data augmentation?
<p>In tensorflow, I would like to rotate an image from a random angle, for data augmentation. But I don't find this transformation in the tf.image module. </p>
<python><tensorflow>
2016-01-14 22:56:24
HQ
34,801,691
Clion memory view
<p>I can't find a memory view in Jetbrain's clion IDE. Does anybody know to show it (has clion this feature)?</p> <p>Meant is this: <a href="http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.cdt.doc.user%2Freference%2Fcdt_u_memoryview.htm" rel="noreferrer">memory view</a> in eclipse </p>
<c++><memory><clion>
2016-01-14 23:24:17
HQ
34,802,465
Sklearn: Is there any way to debug Pipelines?
<p>I have created some pipelines for classification task and I want to check out what information is being present/stored at each stage (e.g. text_stats, ngram_tfidf). How could I do this.</p> <pre><code>pipeline = Pipeline([ ('features',FeatureUnion([ ('text_stats', Pipeline([ ...
<python><python-2.7><scikit-learn>
2016-01-15 00:40:50
HQ
34,802,882
Passing array to component property in React
<p>How can I pass an array to a component as a property. Neither of the following achieve what I am looking for. I want to pass the array of items through, manipulate them in the component and output in the render method. </p> <pre><code>&lt;List columns=['one', 'two', 'three', 'four'] /&gt; // unexpected token &lt;Li...
<javascript><reactjs>
2016-01-15 01:25:39
HQ
34,803,311
template and derived class definition : error: 'myClass' is not a class, namespace, or enumeration
<p>I'm trying to learn templates in C++ and I have the following code :</p> <pre><code>#include &lt;stack&gt; template&lt;typename T&gt; class myClass : public std::stack&lt;T&gt;{ public: myClass(void); myClass(myClass const &amp; src); virtual ~myClass(void); myClass &amp; operator=(myClass cons...
<c++><templates><derived-class>
2016-01-15 02:14:17
HQ
34,803,466
How to list the content of a named volume in docker 1.9+?
<p>Docker 1.9 added named volumes, so I..</p> <pre><code>docker volume create --name postgres-data docker volume ls </code></pre> <p>and I get</p> <pre><code>local postgres-data </code></pre> <p>all good so far.. </p> <p>so how do I see what is in the named volume? Is there a way to cd to it on th...
<docker>
2016-01-15 02:33:39
HQ
34,803,567
What pylint options can be specified in inline comments?
<p>I note that I can disable particular messages using a comment. For example, pylint by default complains about variable names of less than three letters. I can suppress that like this:</p> <pre><code># pylint: disable=invalid-name def some_string_operation(s): # (the same thing here would also work) return some...
<python><pylint>
2016-01-15 02:44:50
HQ
34,803,648
ConfigurationManager and AppSettings in universal (UWP) app
<p>I would like to store an API key in a configuration file without checking it into source control, and read the data in my UWP app.</p> <p>A common solution is to store the key in .config file (such as <code>app.config</code> or <code>web.config</code>) and access it like so:</p> <pre><code>var apiKey = Configurati...
<c#><uwp><portable-class-library>
2016-01-15 02:54:10
HQ
34,804,000
What is the best way to execute form submission?
<p>Please excuse any ignorant or ametuer perspective that I may seem to have. I am indeed an aspiring web developer :)</p> <p>The only thing that I need to achieve right now is having the user fill out a form with only two fields and have that information end up in my inbox.</p> <p>After much searching and different...
<javascript><php><forms><validation><submit>
2016-01-15 03:38:09
LQ_CLOSE
34,804,494
can any one clarify "S_NO" NUMBER(12,0) NOT NULL ENABLE PRIMARY KEY" what it means S_NO" NUMBER(12,0)
can any one clarify "S_NO" NUMBER(12,0) NOT NULL ENABLE PRIMARY KEY" what it means the datatype S_NO" NUMBER(12,0) Please clarify the each parameter
<sql><oracle><oracle11g>
2016-01-15 04:38:06
LQ_EDIT
34,804,803
Complete a string base on index of last character
<p>Example Word : String , the returned last index is 5 which is "g". I need to complete the word string base on the space before the word.</p> <p>For example</p> <p>obj string the last index is 5, which is g, "string" word should be completed.</p>
<c#><string>
2016-01-15 05:16:00
LQ_CLOSE
34,806,347
What is the comment syntax in Yesod (hamlet) templates?
<p>I just can not find how to comment line in hamlet template. Is there some syntax for comments? Like</p> <pre><code>-- &lt;p&gt;Some code should be ignored by template </code></pre> <p>or something?</p>
<templates><haskell><yesod><hamlet><shakespeare-text>
2016-01-15 07:42:01
HQ
34,807,187
java: Reading in multiple integers from the scanner and assigning each integer to a different variable?
I have to read in integers and the scanner has to continue to scan them in until 0 is entered. Then all of those numbers have to be saved to different variables. Then the variables have to be compared and the following has to occur: -Find the smallest integer -Find how many integers are even -Find the sum of the neg...
<java>
2016-01-15 08:43:42
LQ_EDIT
34,807,286
WebSocket SyntaxError: An invalid or illegal string was specified
<p>I'm getting a <code>SyntaxError: An invalid or illegal string was specified</code>, while trying to connect to a WebSocket on Firefox.</p> <pre><code>&lt;!doctype html&gt; &lt;html&gt; &lt;head&gt;&lt;meta charset="utf-8"&gt;&lt;/head&gt; &lt;body&gt; &lt;script&gt; var socket = new WebSocket('127.0.0.1...
<javascript><firefox><websocket>
2016-01-15 08:49:11
HQ
34,807,293
How to set teh selected option on a dropdown list on a jquery dialog?
i have a table od data, when i sent the a row of data to fields on a jquery dialog it fails to set the selected value of the `dropdown list` i have use this $('#ddlProducts').val(data.prodID); `data.prodID` has a value but it does not set it to the `value` of the `dropdown`. How do i fix this?
<jquery><asp.net-mvc-4>
2016-01-15 08:49:59
LQ_EDIT
34,807,532
iOS what is paperRect in core graphics topic
I was studying core graphics recently and always see some of the code assign paperRect in CGRect variable, so I search around in internet and I dunno what is paperRect doing? Counld any one explain to me. Thanks you.
<ios><core-graphics>
2016-01-15 09:03:16
LQ_EDIT
34,807,819
Using a argument as a property key
<p>Lets say I got this function:</p> <pre><code> vm.setSelectedItem = function(itemName, searchedItems){ vm.selectedItem = _.findWhere(searchedItems, {name: itemName}); }; </code></pre> <p>I need to make the "name" dynamic</p> <pre><code> vm.setSelectedItem = function(itemName, searchedItems, propertyKey){ ...
<javascript>
2016-01-15 09:20:08
LQ_CLOSE
34,807,971
Why does git diff-index HEAD result change for touched files after git diff or git status?
<p>If I <code>touch</code> a file tracked in a git repo, and run <code>git diff-index HEAD</code>, it will print output with <code>M</code> indicating the file has been modified. For example,</p> <pre><code>$ touch foo $ git diff-index HEAD :100644 100644 257cc5642cb1a054f08cc83f2d943e56fd3ebe99 0000000000000000000000...
<git>
2016-01-15 09:28:27
HQ
34,808,036
Hi, I wanted to know why the output of this code is nothing?
I wanted to know why the output of this code is nothing? is it something related to the use of SIZE in for expression? #include<stdio.h> int array[6] = {4, 5, 6, 10, -1, 0}; #define SIZE (sizeof(array)/sizeof(array[0])) int main() { int i; for (i= -1; i< SIZE; ++i) printf("%d", arr...
<c><type-conversion>
2016-01-15 09:31:49
LQ_EDIT
34,808,133
Simple countdown hh:mm:ss in android studio
<p>How can I create a simple countdown in Android studio with a fixed start time? It should start the count down as soon as the application is opened. The preferable format is hh:mm:ss</p> <p>thanks</p>
<android><android-studio><countdown>
2016-01-15 09:37:25
LQ_CLOSE
34,808,493
Java- formatted input
<p>How can I accept input from STDIN in the format <strong>HH:MM:SSAM</strong> <strong>here in place of AM , PM can also be there</strong> and display output in the form <strong>HH:MM:SS</strong></p>
<java>
2016-01-15 09:58:54
LQ_CLOSE
34,808,801
How to play flv video on mobile web browsers?
<p>Is it possible to view .flv format video movies with standard android web browsers fromm my web page? I tried to watch using videojs, but get an error "no compatible source was found for this video". </p>
<javascript><html><video><video-streaming><html5-video>
2016-01-15 10:16:23
LQ_CLOSE
34,808,925
Express and WebSocket listening on the same port
<p>I have an app.js which is used to trigger two events when some POST data are received: </p> <ol> <li>Insert POST data into a database</li> <li>Send a message to a client using a WebSocket</li> </ol> <p>Here is the <strong>app.js</strong> (only the important lines)</p> <pre><code>var express = require('express'); ...
<javascript><node.js><websocket>
2016-01-15 10:23:33
HQ
34,809,287
passing data from web form PHP application to Java web application
There is two WEB applications based on two different servers. How I can pass data from the web form, which consist 5-10 fields (php web application) to Java application(Struts2, Spring2) in the most elegant and safe way. please give me suggestions
<java><php><web-services>
2016-01-15 10:42:41
LQ_EDIT
34,809,845
Check Ansible version from inside of a playbook
<p>I have a playbook that is running in different way in Ansible 1.9.x and 2.0. I would like to check currently running ansible version in my playbook to avoid someone running it with old one. </p> <p>I don't think that this is the best solution: </p> <pre><code>- local_action: command ansible --version register: v...
<ansible><ansible-playbook>
2016-01-15 11:16:14
HQ
34,809,935
Change column names of data.frame based on column number and text
<p>In the data.frame <code>run</code></p> <pre><code>run &lt;- data.frame(1:4,2:5,3:6) X1.4 X2.5 X3.6 1 1 2 3 2 2 3 4 3 3 4 5 4 4 5 6 </code></pre> <p>I want to change the column names to</p> <pre><code>&gt; colnames(run) &lt;- c("runner1", "runner2", "runner3") </code></pre> <...
<r><dataframe>
2016-01-15 11:21:58
LQ_CLOSE
34,809,965
display hidden form when specific number of integers/characters are entered into a text field
<p>I am trying to create a function where when a specific number of integers (eg. a phone number) are entered into a text field, a hidden form is displayed and both initial text field and form re-positioned. </p> <p>Any examples available on how this can be accomplished?</p> <p>Thanks</p>
<javascript><jquery><html>
2016-01-15 11:23:49
LQ_CLOSE
34,810,451
WHy If condition block is getting executed ?
I have this conditions if (txtBoxFatherHusbandName.Text != "" || txtBoxName.Text != "" || txtBoxNICNo.Text != "") { ShowMsgBox("Please first <b>Save/Update</b> the data being entered in mandatory fields"); txtBoxFatherHusbandName.Focus(); ...
<c#><asp.net><webforms>
2016-01-15 11:50:21
LQ_EDIT
34,810,560
Version ranges in gradle
<p>What are the possible ways of specifying version ranges in gradle dependencies? I saw some 1.+ notation but I have not found a document which really says what is possible and what is not. Furthermore, I do not know whether the Maven ranges can be used as well.</p> <p>Can somebody give me a short overview so that I ...
<gradle><dependencies><repository>
2016-01-15 11:56:13
HQ
34,810,604
singly linked list counting algorithm
I need to write a metod that goes over a sorted singly linked list and returns the numer that appears the most times but goes over the list only one time can someone point me in the right direction? can't find an elegent solution yet, should i use recursion? I want the code to be as efficient as possible thank...
<java><algorithm><singly-linked-list>
2016-01-15 11:58:57
LQ_EDIT
34,810,835
How to create an array constructor for my class?
<p>I would like to create a constructor, which is similar to the <code>int</code> array constructor: <code>int foo[3] = { 4, 5, 6 };</code></p> <p>But I would like to use it like this:</p> <pre><code>MyClass&lt;3&gt; foo = { 4, 5, 6 }; </code></pre> <p>There is a private <code>n</code> size array in my class:</p> <...
<c++><arrays><c++11>
2016-01-15 12:12:26
HQ
34,811,268
No img-responsive in Bootstrap 4
<p>I just downloaded the source code for Bootstrap 4 alpha 2 and can't find the class <code>img-responsive</code> in it. It exists in Bootstrap 3 source code and I can find it with Notepad++ but in Bootstrap 4s <code>bootstrap.css</code> in <code>dist</code> folder it doesn't exist.</p> <p>What happend to it??</p>
<image><twitter-bootstrap>
2016-01-15 12:37:53
HQ
34,811,540
How to build a Fluent Nested Guard API
<p>I am building a simple Guard API to protect against illegal parameters being passed to functions and so on.</p> <p>I have the following code:</p> <pre><code>public static class Guard { public static GuardArgument&lt;T&gt; Ensure&lt;T&gt;(T value, string argumentName) { return new GuardArgument&lt;T...
<c#><lambda><fluent>
2016-01-15 12:53:26
HQ
34,812,486
Calling functions inside Vue.js template
<p>My template:</p> <pre><code>&lt;template id="players-template" inline-template&gt; &lt;div v-for="player in players"&gt; &lt;div v-bind:class="{ 'row': ($index + 1) % 3 == 0 }"&gt; &lt;div class="player col-md-4"&gt; &lt;div class="panel panel-default"&gt; ...
<javascript><vue.js>
2016-01-15 13:46:06
HQ
34,812,664
PHP Header = Location in a different folder in directory
<p>If I had a page inside of an includes folder but wanted a <code>header("location: dashboard.php");</code> to redirect out of the folder into the main directory, how would I do this?</p> <p>I want to come out of two folders to the main directory.</p>
<php>
2016-01-15 13:55:55
LQ_CLOSE
34,812,731
Html multiple select element accessibility
<p>In our web application we have a search form which contains a field for which a user can select one or more answers from a list of possible options. We currently use the "select" html element with the "multiple" attribute set as in the example below:</p> <p><div class="snippet" data-lang="js" data-hide="false"> <...
<html><accessibility>
2016-01-15 14:00:34
HQ
34,812,890
IabHelper class not working?
<p>I have implemented the IabHelper class in my android project and it says that the 'getBuyIntentToReplaceSkus' cannot be resolved. The full method:</p> <pre><code>buyIntentBundle = mService.getBuyIntentToReplaceSkus(5, mContext.getPackageName(),oldSkus, sku, itemType, extraData); </code></pre> <p>I implemented in a...
<android><android-intent><in-app-purchase>
2016-01-15 14:10:06
HQ
34,812,967
Bad performance of UIStackView within UICollectionViewCells
<p>I am using <code>UIStackView</code> to layout <code>UILabels</code> in my <code>UICollectionViewCell</code> subclass. I'm using the iOS SDK 9.2</p> <p>The scrolling of the collection view is smooth if I don't update the labels' <code>text</code> when I dequeue them. However, if I update their <code>text</code> as I...
<ios><uicollectionviewcell><uistackview>
2016-01-15 14:14:00
HQ
34,813,156
Need to change program filtering of files getting from FTP
<p>I've a C# program that received FTP records. The files we receive are all .csv so I check for that below:</p> <pre><code>private static bool IsAllowedExtension(string fileExtension) { return fileExtension.ToLower() == ".csv"; } </code></pre> <p>then we process only this sort of file:</...
<c#><.net>
2016-01-15 14:24:03
LQ_CLOSE
34,813,412
How to detect if building with address sanitizer when building with gcc 4.8?
<p>I'm working on a program written in C that I occasionally build with address sanitizer, basically to catch bugs. The program prints a banner in the logs when it starts up with info such as: who built it, the branch it was built on, compiler etc. I was thinking it would be nice to also spell out if the binary was bui...
<c><gcc><clang><address-sanitizer>
2016-01-15 14:36:22
HQ
34,813,726
google play services 8.4.0 - classes.jar not found - android studio
<p>I am getting this error when I Run or Debug the app but when I build or clean my project there are no errors. It sounds strange but I've wasted my 4-5 hours searching for this but nothing was helpful. Error:</p> <pre><code>Error:Execution failed for task ':app:compileDebugJavaWithJavac'.&gt; java.io.FileNotFoundEx...
<android><android-gradle-plugin><google-play-services>
2016-01-15 14:50:48
HQ
34,814,280
List<comma-separated strings> => List<string>?
<p>Trying to come up with a LINQy way to do this, but nothing's coming to me.</p> <p>I have a List&lt;> of objects which include a property which is a comma-separated list of alpha codes:</p> <pre><code>lst[0].codes = "AA,BB,DD" lst[1].codes = "AA,DD,EE" lst[2].codes = "GG,JJ" </code></pre> <p>I'd like a list of tho...
<c#><linq>
2016-01-15 15:19:43
HQ
34,814,306
Customize Radio and Checkbox with CSS
<p>Is it possible to customize the look of radio and checkboxes only using CSS? I see there is a lot out there regarding this, but most solutions require the use of images and javascript. </p>
<css><checkbox><radio-button>
2016-01-15 15:21:12
LQ_CLOSE
34,814,368
"Gradle Version 2.10 is required." Error
<p>As I've been using </p> <pre><code>classpath 'com.android.tools.build:gradle:+' </code></pre> <p>In the <strong>build.gradle</strong> file, I got the following error since <strong>gradle version 2.10</strong> has been released. The error is :</p> <blockquote> <p>Warning:Gradle version 2.10 is required. Current ...
<android><android-studio><plugins><gradle><android-gradle-plugin>
2016-01-15 15:24:36
HQ
34,814,952
Javascript: find english word in string
<p>i want to find any english word (min 4 letters) in one string.</p> <pre><code>Eg: hello123fdwelcome =&gt; ["hello", "welcome"]; </code></pre> <p>Could you suggest for me any solution or javascript lib to match english word.</p> <p>Thanks</p>
<javascript><node.js><dictionary>
2016-01-15 15:54:19
LQ_CLOSE
34,815,482
Accessing credentials in Jenkins with the Credentials Parameter plugin
<p>My Jenkins box needs to access Stash and Jira through their REST apis. For that I need to store their credentials.</p> <p>The way I am doing is via the Credentials Parameter, which asks me for a Name, Credential type, Required, Default Value, and a Description.</p> <p>I define a Name as CREDENTIAL_PARAMETER, in th...
<jenkins><jenkins-plugins>
2016-01-15 16:22:47
HQ
34,816,577
When can I use a SFSafariViewController, WKWebView, or UIWebView with universal links?
<p>In the <a href="https://developer.apple.com/library/ios/documentation/General/Conceptual/AppSearch/UniversalLinks.html#//apple_ref/doc/uid/TP40016308-CH12-SW1" rel="noreferrer">Universal Links</a> section of the <a href="https://developer.apple.com/library/ios/documentation/General/Conceptual/AppSearch/index.html" r...
<ios><uiwebview><wkwebview><applinks><sfsafariviewcontroller>
2016-01-15 17:27:29
HQ
34,816,578
How to detect API modifications when mocking e2e tests?
<p>I'd like to setup a solid e2e testing foundation on our team's project but I can't find a simple solution to that question :</p> <p><strong>When you are mocking all of your calls, what is the best way to detect if the actual model of the objects returned by your server has been modified ?</strong></p> <p>Your test...
<angularjs><unit-testing><mocking><protractor><e2e-testing>
2016-01-15 17:27:31
HQ
34,816,593
C scanf ignored when invalid input
<p>I wrote this code, and all it meant to do is input ints until a negative is entered:</p> <pre><code>int result = 0, input_number = 0; while(input_number &gt;= 0){ printf("Please enter students IDs(negetive to stop)= "); result = scanf("%d", &amp;input_number); if(result != 1){ printf("Invalid i...
<c><scanf>
2016-01-15 17:29:38
LQ_CLOSE
34,816,628
await await vs Unwrap()
<p>Given a method such as</p> <pre><code>public async Task&lt;Task&gt; ActionAsync() { ... } </code></pre> <p>What is the difference between</p> <pre><code>await await ActionAsync(); </code></pre> <p>and</p> <pre><code>await ActionAsync().Unwrap(); </code></pre> <p>if any.</p>
<c#><async-await>
2016-01-15 17:32:23
HQ
34,817,231
is there any way to restict the data into table if it is already present
I have an sp which when triggered, data will be inserted into the data. if the data being inserted is already present oin the table, I don't want the data to be inserted into the table. is there anyway i could use a logic to restrict the data into table. my query is declare @ident int = IDENT_CURRENT( 'SADE...
<sql><sql-server><tsql><tsql-sequence>
2016-01-15 18:13:01
LQ_EDIT
34,817,380
How do we set constant variables while building R packages?
<p>We are building a package in R for our service (a robo-advisor here in Brazil) and we send requests all the time to our external API inside our functions. </p> <p>As it is the first time we build a package we have some questions. :(</p> <p>When we will use our package to run some scripts we will need some informat...
<r><global-variables><environment-variables><packages><environment>
2016-01-15 18:22:23
HQ
34,817,549
How to convert Spark RDD to pandas dataframe in ipython?
<p>I have a <code>RDD</code> and I want to convert it to <code>pandas</code> <code>dataframe</code>. I know that to convert and <code>RDD</code> to a normal <code>dataframe</code> we can do</p> <pre><code>df = rdd1.toDF() </code></pre> <p>But I want to convert the <code>RDD</code> to <code>pandas</code> <code>datafra...
<python><pandas><ipython><pyspark><rdd>
2016-01-15 18:34:18
HQ
34,818,057
Unity C#: Help editing script to use Right Mouse Button instead of OnMouseDrag
I am having trouble figuring out how to adjust this script to use the Middle Mouse Button instead of Left. The script currently uses OnMouseDown, OnMouseUp, and OnMouseDrag. I need those to be middle mouse instead. (mouse button 3) I appreciate any help, as I am new to coding. Everything I have tried so far has ...
<c#><unity3d><unityscript>
2016-01-15 19:07:41
LQ_EDIT
34,818,088
jax-rs vs HttpServlet in jee
<p>I'm so confused. I worked servlet.</p> <p>which one is newest?</p> <p>which one is better for implementing <strong>restful</strong> architecture?</p> <p>jax-rs example :</p> <pre><code>// This method is called if XML is request @GET @Produces(MediaType.TEXT_XML) public String sayXMLHello() { return "&l...
<java><servlets><jakarta-ee><jax-rs><jax-ws>
2016-01-15 19:09:32
LQ_CLOSE
34,818,533
How to compare two Streams in Java 8
<p>What would be a good way to compare two <code>Stream</code> instances in Java 8 and find out whether they have the same elements, specifically for purposes of unit testing?</p> <p>What I've got now is:</p> <pre><code>@Test void testSomething() { Stream&lt;Integer&gt; expected; Stream&lt;Integer&gt; thingUnderT...
<java><junit><java-8>
2016-01-15 19:36:24
HQ
34,819,252
How to pass 'this' into a Promise without caching outside?
<p>I have a variable called <code>LangDataService.isDataReady</code> that is a Promise wawiting to be resolved. Upon resolve some logic will happen. How can I pass this into that Promise?</p> <pre><code>LangDataService.isDataReady.then(function () { this.modalOn() }); </code></pre> <p>I know i can cache <code>v...
<javascript><caching><asynchronous><promise><this>
2016-01-15 20:21:49
HQ
34,819,557
How to find and replace with regex in excel
<p>I have an excel file with 1 column and multiple rows.</p> <p>The rows contain various text, here's an example:</p> <pre><code>texts are home texts are whatever dafds dgretwer werweerqwr texts are 21412 texts are 346345 texts are rwefdg terfesfasd rwerw </code></pre> <p>I want to replace "texts are *" where * is a...
<regex><excel><replace>
2016-01-15 20:45:01
HQ
34,819,642
Appending a to-do list
<p>I am trying to make a "to do list" app. I am trying to append what I put in the input into a list under "To Do" with a "Done" button. Here is what I have so far:</p> <p>HTML:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;link rel="stylesheet" text="text/css" href="doneit.css"&gt; &lt;head&gt; ...
<javascript><jquery>
2016-01-15 20:50:47
LQ_CLOSE
34,820,239
Seaborn Heatmap Colorbar Label as Percentage
<p>Given this heat map:</p> <pre><code>import numpy as np; np.random.seed(0) import seaborn as sns; sns.set() uniform_data = np.random.rand(10, 12) ax = sns.heatmap(uniform_data) </code></pre> <p>How would I go about making the color bar values display in percent format? Also, what if I just wanted to show the first ...
<python-3.x><heatmap><seaborn>
2016-01-15 21:35:20
HQ
34,820,653
My comand prompt exits right after I test my code
<p>Right after I start my PYTHON code my comand prompt exits.I can't even test it out or see the result becaues it exits too fast.Any help?</p>
<python>
2016-01-15 22:04:37
LQ_CLOSE
34,820,755
Gitlab docker executor - cache image after before_script
<p>In <code>gitlab-ci</code> there's an option in the <a href="http://doc.gitlab.com/ce/ci/yaml/README.html" rel="noreferrer"><code>.gitlab-ci.yml</code></a> file to execute commands before any of the actual script runs, called <code>before_script</code>. <code>.gitlab-ci.yml</code> examples illustrate installing ancil...
<docker><gitlab><gitlab-ci><gitlab-ci-runner>
2016-01-15 22:12:16
HQ
34,820,817
ESLint's "no-undef" rule is calling my use of Underscore an undefined variable
<p>I am using Grunt as my Build Tool and ESLint as my linting tool for an app I am working on. I am also using the Underscore Node package, and have made use of it in my app. Unfortunately, when I run ESLint on my code, it thinks that _ is an undefined variable in the following line:</p> <p><code>return _.pluck(object...
<javascript><angularjs><gruntjs><underscore.js><eslint>
2016-01-15 22:17:46
HQ
34,820,975
Git clone: Redirect stderr to stdout but keep errors being written to stderr
<p><code>git clone</code> writes its output to <code>stderr</code> as documented <a href="https://www.kernel.org/pub/software/scm/git/docs/git-clone.html">here</a>. I can redirect this with the following command:</p> <pre><code>git clone https://myrepo c:\repo 2&gt;&amp;1 </code></pre> <p>But this will redirect all o...
<git><powershell><git-clone>
2016-01-15 22:31:30
HQ