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
35,108,044
Is there any way to make code organized if I have a super long list?
<p>Is there any way to avoid single lines containing thousands of characters if I happen to have a super long list?</p>
<python><python-3.x>
2016-01-30 22:34:34
LQ_CLOSE
35,108,046
Python Reindex Producing Nan
<p>Here is the code that I am working with:</p> <p><code>import pandas as pd</code></p> <pre><code>test3 = pd.Series([1,2,3], index = ['a','b','c']) test3 = test3.reindex(index = ['f','g','z']) </code></pre> <p>So originally every thing is fine and test3 has an index of 'a' 'b' 'c' and values 1,2,3. But then when I ...
<python><pandas><series>
2016-01-30 22:34:42
HQ
35,108,243
Vim command: how to select a word under cursor in normal mode
<p>I'm looking for a Vim command to select a word under cursor in normal mode, like double-clicking by mouse. Does it exist like this?</p>
<vim><macvim><xvim>
2016-01-30 22:57:44
HQ
35,108,453
What is the difference between (++c) & (c++)?
<p>What is the difference between (++c) and (c++)?</p> <p>Lets say c = 4</p> <p>I know that for (++c) you would increment increment 4 by 1 so 5, but for (c++)?</p>
<java><operators><increment>
2016-01-30 23:24:02
LQ_CLOSE
35,108,637
java.lang.NoSuchMethodError: org.springframework.util.ReflectionUtils.clearCache()
<p>I faced with a problem, was google it for a half of this day. Nothing could help me. It was working. But after that something has happened and i didn't capture that.</p> <p>Here are TomCat Catalina Log</p> <pre><code>31-Jan-2016 00:35:27.278 INFO [RMI TCP Connection(2)-127.0.0.1] null.null HHH000412: Hibernate Cor...
<java><spring><maven><tomcat>
2016-01-30 23:49:11
HQ
35,109,051
How do you console log inside a knockout template
<p>I thought this was correct:</p> <pre><code> &lt;div data-bind="foreach: amount_options, visible: $parent.displayAskAmoutRadioButtons()"&gt; &lt;!-- ko console.log(amount_option) --&gt;&lt;!-- /ko --&gt; &lt;label class="donor-js-amount-choice"&gt; &lt;!...
<knockout.js>
2016-01-31 00:48:17
HQ
35,109,451
How to access “Saved Queries” programmatically?
<p>In BigQuery Web UI, there is a “Saved Queries” Section.<br> Is there way to access (read/write) those programmatically?<br> Any API? </p>
<google-bigquery>
2016-01-31 01:51:33
HQ
35,109,964
I am doing a (StrIns) funcion that mix 2 words but the program is not working at all
this is my code ________________________________________________________________________ #include <stdio.h> #include <stdlib.h> char strins(char[],char[],int,int,int); int main(void) { char zk1[1000]; char zk2[1000]; int pos=0; int n1=0; int n2=0; pri...
<c><string><for-loop>
2016-01-31 03:20:41
LQ_EDIT
35,110,363
React Native init specific version
<p>I upgraded my latest project to React Native 0.19 and instantly the video no longer works. How can I create a new project with a specific version? I want to init a new project at version 0.18.1. I did some google searches but couldn't find anything about this.</p> <pre><code>$ react-native init newproject --verbose...
<ios><react-native>
2016-01-31 04:32:06
HQ
35,110,610
What's the right way to clear a bytes.Buffer in golang?
<p>I'm trying to clear a <code>bytes.Buffer</code>, but there's no such function in the document</p> <p>Maybe I should just renew the buffer? What's the right way to do it?</p> <pre><code>buffer = bytes.NewBufferString("") buffer.Grow (30000) </code></pre>
<go><buffer>
2016-01-31 05:18:51
HQ
35,110,694
Cant do a rounded picture box, help me
im having a problem to round a picturebox edge on visual studio enterprise 2015 private void pictureBox3_Click(object sender, EventArgs e) { System.Drawing.Drawing2D.GraphicsPath gp = new System.Drawing.Drawing2D.GraphicsPath(); gp.AddEllipse(0, 0, pictureBox1.Width - 3...
<c#><picturebox>
2016-01-31 05:34:30
LQ_EDIT
35,110,777
Is there a way to create clusters in arcgis
<p>I have arcgis Web application.In that I need to create clusters.I have tried with examples which I got in Google search. Can anyone tell me how to do it</p>
<arcgis-js-api>
2016-01-31 05:47:06
LQ_CLOSE
35,110,895
What is the best and most used way of wiring in spring dependency injection
<p>This question is not pure coding but pre coding. Actually I am new to spring in winter season. I have a question is that What is the best and most used way of wiring in spring dependency injection? I come to know that xml based wiring is old now. I have confusion between annotation and java-based autowiring. I didn'...
<java><spring><spring-mvc>
2016-01-31 06:04:23
LQ_CLOSE
35,111,223
How to make app alway running in background , so user alway get notif even the app is close?
hello what must i do to make my app(android) that integrate wit smooch SDK always running in background. example if you have BBM ,Facebook ,or Gmail , when you close the app with back button or exit . the app will send you a notification even you dont open the app.
<android><smooch>
2016-01-31 06:54:26
LQ_EDIT
35,111,244
codeigniter URL routes not working properly
Usually codeigniter URL format is domain/controllerName/functionName/id but i want it like domain/product-name/product-detail-page. I have made changes in routes.php also but it gives me 404 page. Any help. Urgent. ASAP.
<php><codeigniter>
2016-01-31 06:58:35
LQ_EDIT
35,111,283
OS as algorithm?
<p>Can an Operating System be considered as an algorithm? Focus on the finiteness property, please. I have contradicting views on it right now with one prof. telling me something and the other something else.</p>
<algorithm><operating-system>
2016-01-31 07:07:01
LQ_CLOSE
35,112,165
MongoDB: Bulk insert (Bulk.insert) vs insert multiple (insert([...]))
<p>Is there any difference between a <a href="https://docs.mongodb.org/manual/core/bulk-write-operations/" rel="noreferrer">bulk insert</a> vs <a href="https://docs.mongodb.org/manual/reference/method/db.collection.insert/" rel="noreferrer">inserting multiple documents</a>? </p> <pre><code>var bulk = db.items.initiali...
<mongodb>
2016-01-31 09:17:01
HQ
35,112,185
travis-ci — Waiting for status to be reported
<p>I pushed a new commit to my git repo, but travis-ci build isn't triggered.</p> <p><a href="https://i.stack.imgur.com/DYs8x.png" rel="noreferrer"><img src="https://i.stack.imgur.com/DYs8x.png" alt="enter image description here"></a></p> <p>It show:</p> <blockquote> <p>continuous-integration/travis-ci — Waiting f...
<github><travis-ci>
2016-01-31 09:19:39
HQ
35,112,581
a simple while loop does not read all matches. Reads only the first match and ignores the others
The problem is the code skips the first echo statement no matter what. $query = mysql_query("SELECT index_no, lesson FROM c8_lessons_list WHERE index_no ='456'"); ($row = mysql_fetch_array($query)); if ($row['index_no'] !== '456' && $row['lesson'] !== "Fertilisation process" ) { ...
<php><mysql>
2016-01-31 10:04:43
LQ_EDIT
35,112,588
Python: How to run a select amount of code n amount of times where user input is n
newbie to python: I'm having some trouble trying to repeat a certain part of code n times where n is user input. It would start off something like roominput = int(input("How many rooms do you require painting?")) The user would then input with an integer(n) and a select part of the program would repeat n amoun...
<python><python-2.7><python-3.x><input><output>
2016-01-31 10:06:10
LQ_EDIT
35,112,633
convert String to Util date in "dd-MMM-yyyy" fromat
<p>I am working in Eclipse . I have string date = "12-DEC-2016" </p> <p>now i want to convert it into util date in same format. Please help me with this query.</p>
<java><swing><datepicker>
2016-01-31 10:10:06
LQ_CLOSE
35,112,921
How to detect change in model for input field from directive in angular2
<p>I have this code for a textarea, it is working great with the ngModel and updating live, however i would like my-custom-directive to know when the model bound to this textarea is changing.</p> <p>How can i detect a model change for this textarea in the my-custom-directive?</p> <pre><code> &lt;textarea my-custom-d...
<angular>
2016-01-31 10:45:31
HQ
35,112,991
Is it possible to change the return value of a method in this case?
<p>I want to change the return value of method getvalue() to string "firefighter" which i tried from main method but did not work out. looking forward to some soln. </p> <pre><code>public class Summ2 { private String getValue() { return "TUHH"; } public static void main(String[] args) { Summ2 GO = new Summ2()...
<java><methods><return-value>
2016-01-31 10:53:31
LQ_CLOSE
35,113,892
QComboBox - Select no entry
<p>I have a QComboBox on my ui and set the model like this:</p> <pre><code>QStringListModel* model = new QStringListModel; QStringList stringlist; stringlist &lt;&lt; "Test1" &lt;&lt; "Test2" &lt;&lt; "Test3"; model-&gt;setStringList(stringlist); ui-&gt;comboBox-&gt;setModel(model); </code></pre> <p>Now I want to ch...
<qt><qcombobox>
2016-01-31 12:35:52
HQ
35,115,375
Can someone please help me with this program?
Write a program that reads four integers and prints "two pairs" if the input consists of two matching pairs (in some order) and "not two pairs" So far I have written: public static void main(String[] args){ Scanner in = new Scanner(System.in); int n; int number1; int number2; int number3; i...
<java>
2016-01-31 15:10:39
LQ_EDIT
35,115,414
Copy or clone a collection in Julia
<p>I have created a one-dimensional array(vector) in Julia, namely, <code>a=[1, 2, 3, 4, 5]</code>. Then I want to create a new vector <code>b</code>, where <code>b</code> has exactly same elements in <code>a</code>, i.e <code>b=[1, 2, 3, 4, 5]</code>. </p> <p>It seems that directly use <code>b = a</code> just create ...
<collections><julia>
2016-01-31 15:14:14
HQ
35,116,699
Piping not working with echo command
<p>When I run the following <code>Bash</code> script, I would expect it to print <code>Hello</code>. Instead, it prints a blank line and exits.</p> <pre><code>echo 'Hello' | echo </code></pre> <p>Why doesn't <code>piping</code> output from <code>echo</code> to <code>echo</code> work?</p>
<bash><echo>
2016-01-31 17:11:56
HQ
35,116,789
Error: Could not find or load main class
<p>I am new to java and I am currently trying to run a program for a class assignment and it compiles however, every time I run it I get this error "Error: Could not find or load main class sailboat.java" To make things worse I need to submit this in a different way from standard assignments logging onto the main serv...
<java><class><find><load><main>
2016-01-31 17:19:55
LQ_CLOSE
35,117,220
Please help me to get this PHP code work correctly
<?php include 'header.php'; error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); $con = mysql_connect("localhost","root",""); $db_selected = mysql_select_db("layout",$con); $name = $_POST['name']; $password = $_POST['password']; if($_POST["submit"] == "LOGIN" ) { $sql = ...
<php><mysql><arrays><if-statement><while-loop>
2016-01-31 17:55:21
LQ_EDIT
35,117,289
Markdown doesn't work in attachments
<p>I'm creating a Slack integration with the Slack API. I followed <a href="https://api.slack.com/docs/formatting">the documentation</a> but the markdown formatting doesn't work on my attachments...</p> <p>Here is my response object:</p> <pre><code>{ response_type: "in_channel", text: "List:", attachments: [ ...
<slack-api>
2016-01-31 18:01:32
HQ
35,117,302
How to get all possible combination of 2xn matrix
<p>I was unable to solve this problem, tried much but logic not working. Problem is, I have to calculate all possible combinations of 2 x N matrix. conditions:</p> <ul> <li>sum of all elements must be N.</li> <li>elements in a row or a column must be in non increasing way.</li> <li>all elements must be positive and r...
<c>
2016-01-31 18:02:59
LQ_CLOSE
35,117,499
missing right paranthesis Oracle while creating table
oracle error SQL> desc user_details; Name Null? Type ----------------------------------------- -------- -------------- USER_ID NUMBER(38) NAME VARCHAR2(20) DOB ...
<oracle>
2016-01-31 18:18:39
LQ_EDIT
35,118,432
Is it possible to easily copy applications settings from one web app to another on azure
<p>I was wondering if there is an easy way to completely copy all the key values from one web app's application settings to another, as seen in the below picture I have a lot of these key values and having to do this manually every time is very cumbersome.</p> <p><a href="https://i.stack.imgur.com/4vfJm.png" rel="nore...
<azure-web-sites>
2016-01-31 19:34:38
HQ
35,118,677
C# Count Threading Not Working
<p>Good afternoon everybody. I am new to Parallel.ForEach and even newer to threading and I wanted to ask your opinion on what is wrong with this code.</p> <pre><code> using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; namespace MultiThrea...
<c#><multithreading>
2016-01-31 19:54:47
LQ_CLOSE
35,119,032
how to use Socks4/5 Proxy Handlers in Netty Client (4.1)
<p>I need to configure socks proxy in Netty client (to request different sites via socks4 or 5 proxies). Tried a lot of proxies from free socks lists (like www.socks-proxy.net, <a href="http://sockslist.net/" rel="noreferrer">http://sockslist.net/</a> etc) but with no luck:</p> <pre><code>@Test public void testProxy()...
<java><httpclient><netty><http-proxy><socks>
2016-01-31 20:23:29
HQ
35,119,819
Why duplicate code is needed with const reference arguments?
<p>In this <a href="http://www.stlport.org/resources/StepanovUSA.html">interview</a> Stepanov shows how to implement generic <code>max</code> function in C++. </p> <blockquote> <p>Try to implement a simple thing in the object oriented way, say, max. I do not know how it can be done. Using generic programming I can...
<c++>
2016-01-31 21:39:37
HQ
35,119,858
python regex polish characters fail
I need to replace a string with polish characters. I tried something like that: k = 'aąkkk cdkkk aą xskkk' odp = re.sub('(?<!aą|cd)kkk', '***', k) print (odp) but it doesn't work. I get an error: File "/usr/lib/python2.7/re.py", line 244, in _compile raise error, v # invalid express...
<python><regex>
2016-01-31 21:43:17
LQ_EDIT
35,120,082
How to get started with Akka Streams?
<p>The Akka Streams library already comes with quite a <a href="http://doc.akka.io/docs/akka/2.4.2-RC1/scala/stream/index.html">wealth of documentation</a>. However, the main problem for me is that it provides too much material - I feel quite overwhelmed by the number of concepts that I have to learn. Lots of examples ...
<scala><akka-stream>
2016-01-31 22:02:40
HQ
35,120,091
How to print data from database?
<p>I am supposed to create webpage with a list of literature, where admin will maintain the list and users will be able to choose the books and print a list. I already have the web app done, but I have no idea, how to print it. Definetly some button, which will print just the data in a list. Any ideas ?</p>
<php><mysql><database><printing>
2016-01-31 22:03:25
LQ_CLOSE
35,120,219
A database schema vs a database tablespace?
<p>Doing my databases reading when I read...</p> <p>Schema: Is a container for objects</p> <p>Tablespace: A logical storage unit for objects</p> <p>Can anyone explain the difference between these?</p>
<database><database-design>
2016-01-31 22:17:48
HQ
35,120,413
jQuery add html content in hidden div
<p>When I use jQuery selectors for add dynamically generated html in hidden div, they don't work. How to add something in hidden div with jquery? I need to make div hidden while adding content after ajax query, because I should generate many html blocks and add them on page, I want to add all blocks in hidden div and ...
<javascript><jquery><html>
2016-01-31 22:37:41
LQ_CLOSE
35,121,491
How to build dynamic where in EF 6 query
<p>How to dynamically filter the results received from the EF. I'm using EF 6. In previous versions of the EF it is very hard. Maybe something has changed? I know I can use filters, one after another, but it is not the most efficient way. Is there a way to do it efficiently and elegantly with the EF 6. On the internet ...
<c#><entity-framework><entity-framework-6>
2016-02-01 00:52:08
LQ_CLOSE
35,121,560
How to identify an optimal subsample from a data set with missing values in MATLAB
<p>I would like to identify the largest possible contiguous subsample of a large data set. My data set consists of roughly 15,000 financial time series of up to 360 periods in length. I have imported the data into MATLAB as a 360 by 15,000 numerical matrix.</p> <p><a href="https://i.stack.imgur.com/qOnzk.png" rel="nof...
<matlab>
2016-02-01 01:01:28
HQ
35,122,257
Promoting my GitHub repo
<p>I've just recently open-sourced my app, but I'm not entirely sure how to promote the GitHub repository. The whole idea of open-sourcing it was to get the power of the developer community on my side, but I'm not sure how to get people noticing the repo. Does anyone have any suggestions?</p>
<github><open-source><uwp>
2016-02-01 02:39:08
LQ_CLOSE
35,122,376
How can I remove a file from Git within IntelliJ VCS?
<p>VCS has an <code>Add</code> option (Git Add) but seems to lack Git Remove.</p> <p>What's the idiomatic way to Git Remove with VCS?</p>
<git><intellij-idea><version-control>
2016-02-01 02:55:11
HQ
35,122,750
How to write this from javascript to JQuery
<p>Simple question I need these few lines of javascript in jquery. Just trying to close a modal when I select outside of it.</p> <p>Thank you.</p> <pre><code> // When the user clicks anywhere outside of the modal, close it window.onclick = function(event) { if (event.target == myModal) { myModal.style.display = ...
<javascript><jquery><window><simplemodal>
2016-02-01 03:51:20
LQ_CLOSE
35,122,773
single command to stop and remove docker container
<p>Is there any command which can combine the <code>docker stop</code> and <code>docker rm</code> command together ? Each time I want to delete a running container, I need to execute 2 commands sequentially, I wonder if there is a combined command can simplify this process.</p> <pre><code>docker stop CONTAINER_ID dock...
<docker>
2016-02-01 03:53:59
HQ
35,123,540
No suitable driver found for jdbc:oracle:thin:@localhost:1522:xe
<p>I am trying to create a connection to my database(oracle), when I put test my code using the main method, it works seamlessly. However, when trying to access it through Tomcat 8, it fails with error: No suitable driver found for "jdbc:oracle:thin:@localhost:1522:xe" I have added ojdbc6 jar file to lib and also conf...
<java><oracle><tomcat><servlets><jdbc>
2016-02-01 05:29:10
LQ_CLOSE
35,123,671
Android list view Base adapter getView fire multiple times?
<p><strong>This is my XML</strong> </p> <pre><code>&lt;RelativeLayout android:id="@+id/preview_header" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/socialbottom" android:padding="10dp"&gt; &lt;TextView android:layout_width="wrap_c...
<android><android-layout>
2016-02-01 05:41:40
LQ_CLOSE
35,123,750
whereNear query doesn't seem to work properly in Parse
<p>I'm working on an Android app related to Geolocations. I'm using Parse as backend. I need to display results based on user's current location. </p> <p>I'm using this query:</p> <pre><code>ParseQuery&lt;ParseObject&gt; query = ParseQuery.getQuery("Restaurants"); ParseGeoPoint sLatlong = new ParseGeoPoint(currentL...
<android><parse-platform>
2016-02-01 05:49:33
HQ
35,123,856
How to set objects around circle correctly on UIView
<p>I've write some code to place objects around circle that locate on center of the Custom view, but it not perfectly around the circle. I don't know where of the code is wrong.</p> <p><a href="https://i.stack.imgur.com/HfTDD.png" rel="noreferrer"><img src="https://i.stack.imgur.com/HfTDD.png" alt="enter image descrip...
<ios><swift>
2016-02-01 05:57:42
HQ
35,123,890
What is a DOMString really?
<p>I came across <code>DOMString</code> while reading the <a href="https://html.spec.whatwg.org/" rel="noreferrer">HTML spec</a>. On some research, found the following data regarding it:</p> <p>From <a href="https://developer.mozilla.org/en/docs/Web/API/DOMString" rel="noreferrer">MDN</a>: </p> <blockquote> <p>DOMS...
<javascript><html><dom>
2016-02-01 06:00:22
HQ
35,124,065
What will perform better?
<p>I do have 'topics', each 'topic' has 'questions'. Both, topics and questions, have 'statistics' that will be updated at every use. </p> <p>Should I create 'questions' as a subfield of 'topic' documents? Or I must create a collection named 'questions' and relate it to 'topic' using sort of a foreign key? </p...
<mongodb><meteor><database-design>
2016-02-01 06:15:44
LQ_CLOSE
35,124,179
How print first and last row in an array using C
I have m x m array and i am trying to find out first and last row of a given matrix (using C) which is e.g mat[3][3]={1,2,3, 4,5,6, 7,8,9}; But i could not figure out how to get first and last row using c. If some have the algorithm then please share with me.
<c>
2016-02-01 06:24:52
LQ_EDIT
35,125,912
How to do a 2d quadratic fit in C++?
<p>How would you perform a 2d quadratic fit in C++? The equation to fit is of the form:</p> <pre><code>f(x, y) = a*x^2 + b*x*y + c*y^2 + d*x + e*y + f </code></pre> <p>where a, b, c, d, e and f are the fit parameters. Is it straightforward to write? Is there a library that is free to use for that?</p>
<c++><math>
2016-02-01 08:25:54
LQ_CLOSE
35,126,349
React-native android ignores navigator.geolocation.getCurrentPosition
<p>I'm trying to use <code>navigator.geolocation.getCurrentPosition</code> on my Android device (Philips Xenium). It works absolutely ok in iphone and genimotion simulator.<br> <code>navigator.geolocation.getCurrentPosition</code> returns absolutely nothing - no errors, no success. However, if I turn off geolocation s...
<android><geolocation><react-native>
2016-02-01 08:55:23
HQ
35,126,428
Dynamic breadcrumbs using react router
<p>There is very good example of how to make a <a href="https://github.com/rackt/react-router/blob/master/examples/breadcrumbs/app.js" rel="noreferrer">breadcrumbs on site in examples folder of react-router repo</a>. But I'm wondering how to make breadcrumbs with dynamic routes.</p> <p>Assume we have this configuratio...
<reactjs><react-router>
2016-02-01 08:59:56
HQ
35,126,670
android: data binding error: cannot find symbol class
<p>I am getting started for using <code>DataBinding</code> feature. I am facing problem with it.</p> <blockquote> <p>Error:(21, 9) error: cannot find symbol class ContactListActivityBinding</p> </blockquote> <p><strong>build.gradle(Module: app)</strong></p> <pre><code>apply plugin: 'com.android.application' and...
<android><android-databinding>
2016-02-01 09:13:39
HQ
35,127,002
Material UI doesn't select a SelectField on hitting 'tab'
<p>Using <a href="http://www.material-ui.com/" rel="noreferrer">Material UI</a> for some components in my app. I added a <code>&lt;SelectField /&gt;</code> <a href="http://www.material-ui.com/#/components/select-field" rel="noreferrer">select field</a> in a form. </p> <p>Is there a way to make it work like a normal H...
<javascript><reactjs><material-design><material-ui>
2016-02-01 09:30:31
HQ
35,127,109
Date and time in 24 hours format
<p>I have a date in this format <code>Fri, 15 Jan 2016 15:14:10 +0800</code>, and I want to display time like this <code>2016-01-15 15:14:10</code>.</p> <p>What I tried is:</p> <pre><code>$test = 'Fri, 15 Jan 2016 15:14:10 +0800'; $t = date('Y-m-d G:i:s',strtotime($test)); echo $t; </code></pre> <p>But it is display...
<php><mysql><date><datetime><datetime-format>
2016-02-01 09:36:02
HQ
35,127,257
How to get the size of a filtered (piped) set in angular2
<p>I wrote my own filter pipe as it disappeared in angular2:</p> <pre><code>import {Pipe, PipeTransform} from 'angular2/core'; @Pipe({ name: 'myFilter' }) export class MyFilter implements PipeTransform { transform(customerData: Array&lt;Object&gt;, args: any[]) { if (customerData == undefined) { return;...
<filter><typescript><pipe><angular>
2016-02-01 09:43:22
HQ
35,127,383
npm http-server with SSL
<p>I'm using the npm package "http-server" (<a href="https://www.npmjs.com/package/http-server" rel="noreferrer">https://www.npmjs.com/package/http-server</a>) to set up a simple webserver, but I cannot get it to use SSL. My command in package.json is</p> <pre><code>http-server -p 8000 -o -S </code></pre> <p>with a c...
<node.js><ssl><npm><httpserver>
2016-02-01 09:50:09
HQ
35,127,478
VB equivalent code to C#; List of Strings
<p>What is the equivalent of the following code in C#?</p> <pre><code>Dim intValidChars As New List(Of Integer)(New Integer() { Asc("0"), Asc("1"), Asc("2"), Asc("3"), Asc("4"), Asc("5"), Asc("6"), Asc("7"), Asc("8"), Asc("9"), _ Asc("A"), Asc("B"), Asc("C"...
<c#><vb.net><string><list><integer>
2016-02-01 09:54:25
LQ_CLOSE
35,127,520
asyncio queue consumer coroutine
<p>I have a <code>asyncio.Protocol</code> subclass receiving data from a server. I am storing this data (each line, because the data is text) in a <code>asyncio.Queue</code>.</p> <pre><code>import asyncio q = asyncio.Queue() class StreamProtocol(asyncio.Protocol): def __init__(self, loop): self.loop = lo...
<python><python-3.x><coroutine><python-asyncio>
2016-02-01 09:56:40
HQ
35,127,818
Android: Get Notified when the current Mode inside AudioManager gets changed
<p>In Android I need to get notified when the current <strong>audio mode</strong> gets changed.</p> <p>I can get this value through <a href="http://developer.android.com/reference/android/media/AudioManager.html#getMode()" rel="noreferrer">getMode()</a> but this is polling. </p> <p>I don't want to poll every few sec...
<android><android-audiomanager>
2016-02-01 10:10:50
HQ
35,127,954
Hi again XD, now I'm trying to kill/re-spawn my enemy each time my player goes through the doors
import pygame import os,sys import random import math img_path = os.path.join("punch.png") img_blob = os.path.join("blob.png") img_bullet = os.path.join("bullet.png") img_heart = os.path.join("heart.png") score = 0 class Actor(pygame.sprite.Sprite): def __init__(s...
<python><pygame><kill>
2016-02-01 10:16:59
LQ_EDIT
35,127,981
text-align: -webkit-center vs text-align: center
<p>Does anyone know why there is a difference between text-align: center and , text-align:-webkit-center ? For example if you have :</p> <pre><code>&lt;section&gt; &lt;h1&gt;Title&lt;h1&gt; &lt;div class="image"&gt;&lt;/div&gt; &lt;/section&gt; </code></pre> <p>// CSS with text-align: center;</p> <pre><code>sectio...
<css>
2016-02-01 10:18:25
HQ
35,128,229
Error: No toolchains found in the NDK toolchains folder for ABI with prefix: llvm
<p>I want to compile an open source android project (Netguard) using gradel (<code>gradlew clean build</code>) But I encountered this Error:</p> <pre><code>A problem occurred configuring project ':app'. &gt; Exception thrown while executing model rule: NdkComponentModelPlugin.Rules#cre ateToolchains &gt; No toolcha...
<android><android-ndk><android-gradle-plugin>
2016-02-01 10:29:48
HQ
35,128,646
Don't trigger the parent event when clicking on the child element
<p>See my snippet, as I click the parent element, the child element is shown but as I click the child element, the parent element events seems also triggered along with the child elements event, any ideas to trigger only parent elements event when on click and only child elements event when on click (must not bubble th...
<javascript><jquery>
2016-02-01 10:50:57
LQ_CLOSE
35,129,135
Valgrind reporting a segment overflow
<p>When running my program with valgrind / callgrind I get the following message a lot:</p> <p><code>==21734== brk segment overflow in thread #1: can't grow to 0x4a39000</code> (with different addresses)</p> <p>Note that it is not preceded by a stack overflow message.</p> <p>I can't find any documentation on this me...
<c++><overflow><valgrind><callgrind>
2016-02-01 11:15:49
HQ
35,129,773
Android push notification offline
<p>im trying to implement push notification in my app,already using GCM. But the case is i want it in the way which works offline too. i.e: for multiple conditions inside android app it should trigger push notification.</p> <p>Currently im trying : </p> <pre><code>NotificationManager mNotificationManager = (Notifica...
<java><android><push-notification><google-cloud-messaging>
2016-02-01 11:48:42
LQ_CLOSE
35,129,977
How to install latest version of openssl Mac OS X El Capitan
<p>I have used <code>brew install openssl</code> to download and install openssl v1.0.2f, however, it comes back saying:</p> <pre><code>A CA file has been bootstrapped using certificates from the system keychain. To add additional certificates, place .pem files in /usr/local/etc/openssl/certs and run /usr/local/o...
<macos><openssl><homebrew>
2016-02-01 11:58:35
HQ
35,130,013
How to get attribute name instead of slug in variation?
<p>I need to get attribute from woocommerce product variation. </p> <pre><code>$terms = get_post_meta($value['variation_id'], 'attribute_pa_color', true); </code></pre> <p>This code is giving me an attribute slug instead of name. How can I get attribute name?</p> <p>Thank you so much in advance!</p>
<php><variables><attributes><woocommerce><slug>
2016-02-01 12:00:01
HQ
35,130,051
Order of notify handlers
<p>I have a task:</p> <pre><code>- name: uploads docker configuration file template: src: 'docker.systemd.j2' dest: '/etc/systemd/system/docker.service' notify: - daemon reload - restart docker </code></pre> <p>in Ansible playbook's <a href="http://docs.ansible.com/ansible/playbooks_intro.html" re...
<ansible>
2016-02-01 12:02:03
HQ
35,130,119
Linux configuration -- ssmtp: Cannot open smtp.gmail.com:587
<p>Hi I have RHEL5 with ssmtp installed on it ssmtp-2.61-22.el5.i386.rpm</p> <p>my /etc/ssmtp/ssmtp.conf updated as below :-</p> <pre><code>AuthUser=mymail@gmail.com AuthPass=mypassword FromLineOverride=YES mailhub=smtp.gmail.com:587 UseSTARTTLS=YES UseTLS=Yes RewriteDomain=gmail.com </code></pre> <p>also revaliases...
<linux><gmail><mailx><ssmtp>
2016-02-01 12:06:03
HQ
35,131,143
How to enable Live Visual Tree and Live Property Explorer in Visual Studio
<p>I'm running a .Net 4.5 WPF application in Visual Studio 2015 Update 1 in a Debug build configuration.</p> <p>In Tools > Options > Debugging > General I have checked Enable UI Debugging Toos for XAML and Preview selected elements in Live Visual Tree.</p> <p>However, when I run my application, both the Live Property...
<c#><wpf><visual-studio-2015>
2016-02-01 12:57:08
HQ
35,131,615
what is difference between < length() and <=length()-1?
<pre><code>'String s=" ";'//java developer for(int i=0;i&lt;=arg0.length()-1;i++)//it's subtracts </code></pre> <p>i.e length()=10-1=9.?? otherwise it's index starts from 0? Hope u guys </p>
<java>
2016-02-01 13:20:46
LQ_CLOSE
35,131,814
How to script Gradle in order to publish shadowjar into Artifactory
<p>I am using shadowJar in my java project. I would like to push the outcome into artifactory.</p> <p>My gradle script look like this, I am not sure how to connect the dots:</p> <pre><code>shadowJar { baseName = 'com.mycompany.myapp' manifest { attributes 'Main-Class': 'myapp.starter' } } ] ...
<java><gradle><build>
2016-02-01 13:31:12
HQ
35,131,861
What does the --pre option in pip signify?
<p>I saw on <a href="https://github.com/neo4j-contrib/neo4j_doc_manager" rel="noreferrer">this</a> page that <code>pip install neo4j-doc-manager --pre</code> was used. What does the <code>--pre</code> flag mean?</p>
<python><pip>
2016-02-01 13:33:16
HQ
35,132,427
Why its happening?
So, i'm tryin' to create a full width navbar using bootstrap, but theres a kind of limit in my nav [LIKE THIS][1] This is my html: <div class="row"> <div class="col-md-12 text-center"> <nav class="navbar navbar-default"> <div class="container-fluid"> <ul class="na...
<html><css><twitter-bootstrap>
2016-02-01 14:00:23
LQ_EDIT
35,132,459
how to create mysql database backup file in windows
<p>I wrote the following code in cmd but it showing an error </p> <pre><code>&gt; cd C:\Program Files\MySQL\MySQL Server 5.5\bin &gt; mysqldump.exe –e –u[username] -p[password] [database name] &gt; C:\[filename].sql </code></pre> <p>error</p> <blockquote> <p>A required privilege is not held by client</p> <...
<mysql>
2016-02-01 14:02:07
LQ_CLOSE
35,132,566
How to Use LoginGdi+ theme
<p>Guys would you please tell me how to use this theme in my project ? I like this theme &amp; I want to know how to use it<br> the theme link <a href="http://xertzproductions.weebly.com/login-gdi-theme.html" rel="nofollow">http://xertzproductions.weebly.com/login-gdi-theme.html</a> I tried but I failed ! thanks in ad...
<vb.net>
2016-02-01 14:06:32
LQ_CLOSE
35,133,202
How can I read a text from a php site with javascript
<p>my php site will echo a number. Now I want to read the content with JavaScript. How can i do this.</p>
<javascript><php>
2016-02-01 14:37:04
LQ_CLOSE
35,133,317
NumPy save some arrays at once
<p>I working on different shapes of arrays and I want to save them all with <code>numpy.save</code>, so, consider I have </p> <pre><code>mat1 = numpy.arange(8).reshape(4, 2) mat2 = numpy.arange(9).reshape(2, 3) numpy.save('mat.npy', numpy.array([mat1, mat2])) </code></pre> <p>It works. But when I have two matrices w...
<python><arrays><numpy>
2016-02-01 14:41:27
HQ
35,133,480
Error Messages when I try to load ggplot2 after installatio
I get an error message when i try to load ggplot2 even after download. Even when i tried: install.packages('ggplot2',dependencies = T) I get the following error message: No package called 'Rcpp' Error:package or namespace load failed for ggplot2. Then i try: install.packages('Rcpp') ...
<r>
2016-02-01 14:49:50
LQ_EDIT
35,133,507
How do linked list work if nothing has been added to them and you try to pring that variable.
I have a linked list and want to print it out in the end. My questions is, if the linked list variable in the struct is left untouched and nothing is added to the list, if I try to print using `while(school->student != NULL)` will this work? Note: I have no made the list NULL at any point, I have just allocated nam...
<c><linked-list>
2016-02-01 14:51:32
LQ_EDIT
35,134,036
Macro to fill down based on number contents of adjacent cell or other sheet
I've seen a few other posts similar to this but I can seem to get mine to work. Right now I have data in Column A, from A5 to A50 but the end point is subject to change. I am looking for a macro to select B5 to Y5 and fill down to the end of column A (in this case to row 50, but this will change every time). The am...
<vba><excel>
2016-02-01 15:17:55
LQ_EDIT
35,134,344
This program crashes
I made up some program that view the 7*7 table of powered by.... It's work, but from some reason the program crash at the end of the program. My compiler is GCC and I'm using C99. #include <stdlib.h> #include <stdio.h> #include <time.h> #include <math.h> #include <string.h> #define LEN...
<c><arrays><loops>
2016-02-01 15:34:28
LQ_EDIT
35,134,661
Are there any examples of serious websites using riot.js?
<p>I have scoured the internet (clicked next page on google a couple of times) and the riot.js docs, and can't find a single high traffic website that uses riot.js. </p> <p>Are there any large scale websites/webapps using riot.js?</p>
<javascript><riot.js>
2016-02-01 15:50:58
LQ_CLOSE
35,134,681
Installing OpenMP on Mac OS X 10.11
<p>How can I get OpenMP to run on Mac OSX 10.11, so that I can execute scripts <strong>via terminal</strong>?</p> <p>I have installed OpenMP: <code>brew install clang-omp</code>.</p> <p>When I run, for example: <code>gcc -fopenmp -o Parallel.b Parallel.c</code> the following expression returns: <code>fatal error: 'om...
<c><gcc><openmp>
2016-02-01 15:51:52
HQ
35,134,960
Adjust size of leaflet map in rmarkdown html
<p>I'd like to change the height and width of <code>leaflet</code> map outputs in html document. Is there a simple way to do this in R markdown without getting into whole CSS business?</p> <pre><code>```{r} library(leaflet) library(dplyr) m &lt;- leaflet() %&gt;% setView(lng = -71.0589, lat = 42.3601, zoom = 12) m %&...
<html><r><leaflet><markdown>
2016-02-01 16:05:01
HQ
35,135,225
Android WebView handle onReceivedClientCertRequest
<p>I'm developing an Android app using Client Certificate Authentication within WebView. The certificate (cert.pfx) and password are embedded in the application.</p> <p>When executing Client Certificate Authentication request with ajax call in the WebView, the following function getting called :</p> <pre><code>@Overr...
<android><ssl><webview><client-certificates>
2016-02-01 16:17:50
HQ
35,136,307
Equivalent to get_contents_to_file in boto3
<p>In boto3, is there an equivalent of <a href="http://boto.cloudhackers.com/en/latest/ref/s3.html#boto.s3.key.Key.get_contents_to_file" rel="noreferrer"><code>get_contents_to_file</code></a>, that copies the contents of an object to a file handle?</p> <p>In boto, if I have an S3 object <code>key</code>, I can copy th...
<python><amazon-s3><boto3>
2016-02-01 17:10:05
HQ
35,136,345
Maximum number of thread Android
<p>I want to know if there is a maximum number of threads that it is possible to run on an Android device. It depends on the type of the device?</p>
<java><android><multithreading>
2016-02-01 17:11:37
HQ
35,136,425
Could not find or load main class java hello world
<p>I am trying to write <strong>hello world</strong> on java. My code is:</p> <pre><code>class myfirstjavaprog { public static void main(String args[]) { System.out.println("Hello World!"); } } </code></pre> <p>And when I run <strong>java youtube.java</strong> on cmd I got this er...
<java>
2016-02-01 17:16:27
LQ_CLOSE
35,136,778
This is the python code and it gives unexpected answer
<pre><code>school = 'Massachusetts Institute of Technology' numVowels = 0 numCons = 0 for char in school: if char == 'a' or char == 'e' or char == 'i' \ or char == 'o' or char == 'u': numVowels += 1 elif char == 'o' or char == 'M': print char else: numCons -= 1 print 'numVowels is: ' + str(numVowels) p...
<python>
2016-02-01 17:34:22
LQ_CLOSE
35,136,836
React component render is called multiple times when pushing new URL
<p>I am building a PhotoViewer that changes photos when the user presses left or right. I am using React, Redux, react-router, and react-router-redux. When the user presses left or right, I do two things, I update the url using <code>this.context.replace()</code> and I dispatch an action to update the currently viewed ...
<javascript><reactjs><react-router><redux>
2016-02-01 17:37:44
HQ
35,137,027
How do Pointer Arithmetic works after Pointer Casting?
int main() { short int a[4] = {1,1, [3] = 1}; int *p = (int*)a; printf("p: %p %d \n ", p, *p); printf("p+1: %p %d\n", (p +1), *(p+1)); } why does *p = 65537 and *(p+1) = 65536?
<c><pointers><endianness>
2016-02-01 17:47:30
LQ_EDIT
35,137,227
Wrong output from dictionary in C#
<p>Why do I get output of my namespace.object when printing from dictionary?</p> <p>This is my data object.</p> <pre><code>namespace MoleCalculator { public class elementDO { public int AtomicNumber { get; set; } public string Symbol { get; set; } public string Name { get; set; } ...
<c#><dictionary>
2016-02-01 17:58:55
LQ_CLOSE
35,137,280
How to put something on the screen?
<p>I use <strong>Ubuntu Studio 15.10</strong> and I want to learn to program in <strong>C++</strong>.</p> <p>I'm absolutely new into the <strong>C++</strong> programming world.</p> <p>I wrote my first "code", with <strong>gedit</strong>.</p> <p>In simple words, I want to put on the screen some text (like the old Bas...
<c++>
2016-02-01 18:02:02
LQ_CLOSE