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,957,825
for-loop and getchar() in C++
Why does the code get the empty data directly in even times? I have no idea what is going on. Thank you very much. #include <stdio.h> #pragma warning(disable : 4996) void main() { int f, a = 10, b = 20; for (int i = 0; i < 5; i++) { ...
<c><for-loop><getchar>
2016-01-22 23:45:50
LQ_EDIT
34,957,890
Javascript string size limit: 256 MB for me - is it the same for all browsers?
<p>Curious about what was the maximum string length I could get in Javascript, I tested it myself, today, on my Firefox 43.0.1, running in Windows 7. I was able to construct a string with length <code>2^28 - 1</code>, but when I tried to create a string with one more char, <a href="http://getfirebug.com/" rel="noreferr...
<javascript><string><memory><out-of-memory>
2016-01-22 23:52:52
HQ
34,957,971
Why Does code.runnable.com Allow Me to Change a Variable's Value in Java?
<p>I heard that Java integers are <strong>pass by value</strong>, so why does the following code work in code.runnable.com? </p> <pre><code>public class HelloWorld { public static void main(String[] args) { int number = 0; number = 2; System.out.println(number); } } </code></pre> <p>The code will prin...
<java><pass-by-value>
2016-01-23 00:01:20
LQ_CLOSE
34,958,319
PHPDocumentor 2 and PHP 7 with opcache issues in Doctrine
<p>Hopefully someone here knows a thing or 2 about this.</p> <p><b>Short Question</b></p> <p>I am running into an error using phpdoc on the command line, installed via pear on PHP 7.0.2. The error is:</p> <pre><code>#&gt; phpdoc PHP Fatal error: Uncaught Doctrine\Common\Annotations\AnnotationException: You have t...
<php><phpdoc><php-7><opcache><phpdocumentor2>
2016-01-23 00:46:32
HQ
34,958,389
I'm having some problems when I try localhost:3000 for programming with Google Chrome Browser
<p>I'm having many problems when I try use my localhost:3000 for programming in Ruby On Rails 4. When I put in the Chrome browser in my Mac OS X "El Capitan". This redirect's of this link</p> <pre><code>http://www.free-merchants.com/partner/promokod_aliexpress-by-alibabacom#e4da3b7fbbce2345d7772b0674a318d5-http%3A%2F...
<ruby-on-rails><ruby><google-chrome><localhost><google-chrome-devtools>
2016-01-23 00:57:21
LQ_CLOSE
34,958,776
is there a command such as "sed" in bash scripts in c++?
Currently ım trying to convert my bash script to c++ executable but ı stuck in "sed" command here is my bash script: unset WIFIMAC unset BTMAC # Skip processing if MAC addresses are already written if [ -f /data/.mac.info -a -f /data/.bt.info ]; then echo "MAC addresses already f...
<c++><linux><bash><shell><sed>
2016-01-23 02:01:56
LQ_EDIT
34,958,795
How do I enable the Ruby 2.3 `--enable-frozen-string-literal` globally in Rails?
<p>I am building a greenfield Rails application on top of Ruby 2.3, and I would like all Rails commands (e.g. <code>rails s</code>, <code>rails c</code>) and all Ruby commands (e.g. <code>rake do:something</code>) to use the new immutable-String functionality introduced in Ruby 2.3. (See, e.g. <a href="https://wyework...
<ruby-on-rails-4><ruby-2.3>
2016-01-23 02:04:02
HQ
34,958,855
SublimeText3 Fold/Unfold all methods
<p>I am using SublimeText3 for C++ and Java. I am wondering if there is a way to fold all of the methods in a file / class, and then unfold them all, regardless of where the caret is. Or is there a way to list all the functions / methods. </p> <p>Basically I would like to be able to enter a file and see all the method...
<sublimetext3>
2016-01-23 02:12:00
HQ
34,958,908
Where can I find documentation for the NuGet v3 API?
<p>I'm interested in writing a client library around the NuGet v3 API in a non-.NET language. Where can I find documentation/resources on it that would tell me e.g. what URLs to make requests to and what responses it would return?</p> <p>I tried doing a quick Google search, but the only thing that turns up is <a href=...
<c#><.net><nuget><nuget-package><nuget-server>
2016-01-23 02:19:37
HQ
34,959,038
NPM stuck giving the same error EISDIR: Illegal operation on a directory, read at error (native)
<p>I am stuck with this error no matter what directory I am in, and what I type after "npm" in cmd.exe. Here is the npm-debug.log: </p> <pre><code>0 info it worked if it ends with ok 1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe', 1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js' ]...
<node.js><windows><cmd><npm><file-permissions>
2016-01-23 02:43:37
HQ
34,959,257
Why isn't my future value available now?
<p>My ajax call is not returning anything! Here is my code:</p> <pre><code>var answer; $.getJSON('/foo.json') . done(function(response) { answer = response.data; }); console.log(answer); </code></pre> <p>Even though the network call is succeeding, and I can see that the response contains data, the console logs "undef...
<ajax><asynchronous><async-await><promise>
2016-01-23 03:28:39
LQ_CLOSE
34,959,432
bat script to trim characters after a particular length from 1st word of every line
I have text file like below Input sample text file ------------------------------- <Line1> 69273ww01/080-100 1021/00 11123 <Line2> 80381ew20/937-134 1372/92 12737298323 <Line3> 02ws88749/263-379 2836/39 121 <Line4> 4793de592/343-283 7384/49 233792740562263 Required output text file -------------------...
<batch-file><trim>
2016-01-23 03:55:47
LQ_EDIT
34,959,558
Select MySQL rows with timestamp older than 12 hours?
<p>In my table <code>monitoring</code>, I want to select the content from the content <code>domain</code>. But I only want to select it for rows where the timestamp on them is older than 12 hours and it should list the oldest entries first.</p> <p>Here's what I've got so far and need help with:</p> <pre><code>SELECT...
<mysql><sql>
2016-01-23 04:21:02
LQ_CLOSE
34,959,643
How can I specify where my local developer's service fabric cluster is created?
<p>My problem: I am learning Service Fabric, and doing simple tutorials, and the local cluster is filling up my C drive. I run the projects in Visual Studio. It first creates a cluster in a folder SfDevCluster. That takes up 842 MB of space. Then it deploys the services and web api sites. Remember, these are trivial tu...
<azure-service-fabric>
2016-01-23 04:33:40
HQ
34,960,296
Prime Number in clisp
Well I'm just completely new to CLISP programming language and I have started learning this language by my own from yesterday and that too out of interest.Now when i came across functions and loop,after learning about them I started developing the Prime Number problem in CLISP. My code is as follows: (defun prime ...
<common-lisp>
2016-01-23 06:15:02
LQ_EDIT
34,960,308
How optimise code in the scenario ??? instated of writing multiple else if conditions
This My DAOImple class:::: here i have two drop down boxes like 1'st box options are ALL,in pool,out of pool. 2ed box option are ALL,active,inactive,Frozen,Baried,Delete. ------------------- public class FleetDetailsDAOImpl22 extends CustomJdbcDaoSupport implements FleetDetailsDAO { @Autowired private ...
<java>
2016-01-23 06:16:47
LQ_EDIT
34,960,457
Matlab convolution code in C
<p>I'm trying to make the MATLAB conv function in C. So far I have this:</p> <pre><code>int n=Length(SignalArray); int m=Length(FilterArray); TempX=[SignalArray,Zeros(1,FilterArray)]; TempH=[FilterArray,Zeros(1,SignalArray)]; for(int i=0;i&lt;n+m-1;i++){ ResultArray(i)=0; for(int j=0;j&lt;=m-1;j++){ ...
<c><matlab><convolution>
2016-01-23 06:38:08
LQ_CLOSE
34,961,066
Run remote php script from terminal
<p>how would I go about running a script @ <code>http://www.domain.com/php/script.php/</code> from my terminal window. Also, I would need to pass a variable, <code>$var1 = "string"</code>. How would I do this?</p>
<php>
2016-01-23 07:58:21
LQ_CLOSE
34,961,505
Delete files in Windows>Temp>tmp0000* repertories : Windows 8.1
<p>I do not have enough space on my disk, I would like to know if I can delete the Temp files of the <code>Windows directory&gt;Temp&gt;tmp0000*</code></p>
<windows>
2016-01-23 08:52:46
LQ_CLOSE
34,961,563
show/hide a div with drop dwon value in asp.net
its my code i want to hide div which have id selnumber (when i select form 60/61 and show a text message "It is form 60/61" at the place of div) but when select pan then show the div. <div id="selpan"> <asp:DropDownList ID="ddlpan" runat="server"> <asp:ListItem...
<html><css><asp.net>
2016-01-23 08:58:47
LQ_EDIT
34,961,598
Issues with Macros in C
I'm still trying to firgure out macros in C #define A(x) #x int main() { int i = -i; char *s = A(i); i = -(s[0] == 'i'); printf("%d", i); return 0; } Anyone care to enlighten me and comment the code, especially what the macro does and this ...
<c><macros>
2016-01-23 09:02:59
LQ_EDIT
34,961,682
can javascript be inline with webpack?
<p>I need to import a library to my project, the library should is a javascript file, which need to be inlined to html.</p> <p>for example: </p> <p>library code:</p> <pre><code>(function(){ var a = 0; })(); </code></pre> <p>I need to make this code inline in html.</p> <p>html:</p> <pre><code>&lt;html&gt; &lt...
<webpack>
2016-01-23 09:14:18
HQ
34,961,981
Why converting from base 10 to base 2 is considered slow?
<p>As stated <a href="http://codeforces.com/blog/entry/22712" rel="nofollow">here</a> it is quadratic, but why?</p>
<algorithm>
2016-01-23 09:49:40
LQ_CLOSE
34,962,677
Twitter Streaming API limits?
<p>I understand the Twitter REST API has strict request limits (few hundred times per 15 minutes), and that the streaming API is sometimes better for retrieving live data. </p> <p>My question is, what exactly are the streaming API limits? Twitter references a percentage on their docs, but not a specific amount. Any in...
<api><twitter><twitter-streaming-api><tweetstream><twitter-rest-api>
2016-01-23 11:09:24
HQ
34,963,051
Webpack not loading css
<p>This is my first time trying to set up Webpack, so I'm sure I'm missing something here.</p> <p>I am trying to load my PostCSS files with Webpack, using the ExtractTextPlugin to generate a css file into "dist". The problem is Webpack does not seem to pick up the css files. They are under "client/styles", but I've tr...
<javascript><css><webpack><postcss>
2016-01-23 11:47:08
HQ
34,963,138
Error: stat_count() in ggplot2
<p>In many of my programs I have been using ggplot2 to render charts. I have loaded them on shinyapps.io and they are working absolutely fine. However, when I try to run the program on my machine, i am getting the following error:</p> <pre><code>Error : stat_count() must not be used with a y aesthetic. </code></pre>...
<r><ggplot2>
2016-01-23 11:56:02
HQ
34,963,550
When should I use * and when &?
<p>I am learning some C++, and I came across pointers and addresses. However, in none of the materials, I could find a good explanation on when to use pointer, and when to use address. As I understand it is that when I use pointer, I POINT to address in memory, where some variable is stored. So for example:</p> <pre><...
<c++><pointers>
2016-01-23 12:37:55
LQ_CLOSE
34,963,949
Kotlin: Why are most variables underlined in Android Studio and how do I turn that off?
<p>I wanted to know why most variables in Kotlin are underlined. Some files contain a lot of underlining which is very annoying. If I hover my mouse over a variable it doesn't give any information most of the time. But on some it says "This property has a backing field" or "Value captured in a closure". Does anybody kn...
<android-studio><syntax-highlighting><kotlin>
2016-01-23 13:20:22
HQ
34,964,454
VBA excel programming
[![output sheet][1]][1] [![The sheet from which data has to be dumped.][2]][2] There is an excel sheet with ItemId and ItemName.For a single ItemID there are 4-5 ItemName.The data from this sheet needs to be dumped into another sheet using VBA Excel Programming. The sheet in which the data is dumped shall list...
<vba><excel>
2016-01-23 14:07:17
LQ_EDIT
34,964,462
Yii2 | requires bower-asset/jquery
<p>I'm trying to install Yii2 via composer:</p> <pre><code>composer global require "fxp/composer-asset-plugin:~1.1.1" composer create-project --prefer-dist yiisoft/yii2-app-basic basic </code></pre> <p>~/.composer/composer.json</p> <pre><code>{ "require": { "fxp/composer-asset-plugin": "~1.1.1" } } </cod...
<yii2><composer-php>
2016-01-23 14:08:01
HQ
34,964,901
Finding number of methods used in a java program after selecting the file
<p>Are there any specific methods or functions to calculate the number of methods and not the constructors in java?</p> <p>Very important, please share if you know something.</p>
<java><methods><count>
2016-01-23 14:52:55
LQ_CLOSE
34,965,277
Regex vs, versus, vs., v. matching in lines for c# code
>Hi I need to write a regex that matches the word >versus,verse, vs. , v. , v but v should not be jumbled in words @"\b((.*?)" + Regex.Unescape(xz) + @"[.,:/s]?)\b", RegexOptions.IgnoreCase)) >here i ll pass the array and test it
<c#><regex>
2016-01-23 15:29:06
LQ_EDIT
34,965,856
What is the point of the constants in redux?
<p>For example from this example:</p> <pre><code>export const ADD_TODO = 'ADD_TODO' export const DELETE_TODO = 'DELETE_TODO' export const EDIT_TODO = 'EDIT_TODO' export const COMPLETE_TODO = 'COMPLETE_TODO' export const COMPLETE_ALL = 'COMPLETE_ALL' export const CLEAR_COMPLETED = 'CLEAR_COMPLETED' </code></pre> <p>It...
<javascript><redux>
2016-01-23 16:24:50
HQ
34,965,885
Data is not enter in database using php
<p>I want to insert data into the database.but when i click on save button than data did not go in database.i did not understand where i did mistake. This is my php code:</p> <pre><code> &lt;?php $host = "localhost"; $user = "root"; $password =""; $database = "crud"; $conn = new mysqli($host, $user, $password); mys...
<php><mysql><database>
2016-01-23 16:27:33
LQ_CLOSE
34,966,066
Xamarin.Forms: How can I load ResourceDictionary from another file?
<p>I wrote following code, but XamlParseException has bean thrown. ("StaticResource not found for key CustomColor")</p> <p>MyPage.xaml</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009...
<c#><xaml><xamarin><xamarin.forms>
2016-01-23 16:44:35
HQ
34,966,124
How to make RxJava interval to perform action instantly
<p>Hello I am making observable to ask my server about its online/offline status every 15 seconds:</p> <pre><code>public Observable&lt;Response&gt; repeatCheckServerStatus(int intervalSec, final String path) { return Observable.interval(intervalSec, TimeUnit.SECONDS) .flatMap(new Func1&lt;Long,...
<java><android><rx-java>
2016-01-23 16:50:00
HQ
34,966,560
Algorithm for joining circles into a polygon
<p>What is the best way of combining overlapping circles into polygons?</p> <p>I am given a list of centre points of circles with a fixed diameter.</p> <p><a href="https://i.stack.imgur.com/LE7b3.png" rel="noreferrer"><img src="https://i.stack.imgur.com/LE7b3.png" alt="Rendering of 5 random circles"></a></p> <p>I ne...
<algorithm><geometry><polygon>
2016-01-23 17:30:30
HQ
34,966,960
Different audio by language
<p>Different audio by language.</p> <p>Hello, I wonder if it is possible to use different audio tracks according to the user's language, similar to strings.xml but for sound files.</p>
<android><audio>
2016-01-23 18:11:21
LQ_CLOSE
34,966,987
Update columns through SQL Query
<p>I have made a PHP script that upgrades his/her Firewall app (a function of my website). I have written this code:</p> <pre><code>&lt;?php session_start(); include_once 'dbconnect.php'; $servername = "localhost"; $username = "root"; $password = ""; $dbname = "dbtest"; // Create connection $conn = new mysqli($server...
<php><mysql>
2016-01-23 18:13:57
LQ_CLOSE
34,967,093
How to redirect stderr to a file in a cron job
<p>I've got a cron job that is set up like this in my crontab:</p> <pre><code>*/1 * * * * sudo /home/pi/coup/sensor.py &gt;&gt; /home/pi/sensorLog.txt </code></pre> <p>It puts stdout into sensorLog.txt, and any stderr it generates gets put into an email. </p> <p>I want both stdout and stderr to go into sensorLog.t...
<sh><crontab>
2016-01-23 18:25:17
HQ
34,967,273
Add metadata comment to Numpy ndarray
<p>I have a Numpy ndarray of three large arrays and I'd just like to store the path to the file that generated the data in there somewhere. Some toy data:</p> <pre><code>A = array([[ 6.52479351e-01, 6.54686928e-01, 6.56884432e-01, ..., 2.55901861e+00, 2.56199503e+00, 2.56498647e+00], ...
<python><arrays><numpy>
2016-01-23 18:40:40
HQ
34,967,391
RSpec: Is there a not for `and change`, e.g. `and_not to change`?
<p>I find the <code>.and</code> method very useful for chaining many expectations.</p> <pre><code>expect { click_button 'Update Boilerplate' @boilerplate_original.reload } .to change { @boilerplate_original.title }.to('A new boilerplate') .and change { @boilerplate_original.intro }.to('Some nice introduction') ...
<rspec>
2016-01-23 18:49:59
HQ
34,967,958
Create an array from hash replacing all of the keys and values with integers in Ruby
I have a hash in Ruby, like that: a = {"0" => ["2", "3"], "1" => "4", "3" => "5"} and I need a function to make an array from it, like that: a = [[2, 3], 4, nil, 5] Is there any simple way to do this?
<arrays><ruby><hash>
2016-01-23 19:41:51
LQ_EDIT
34,968,112
How to give jupyter cell standard input in python?
<p>I am trying to run a program on a jupyter notebook that accepts user input, and I cannot figure out how to get it to read standard input. For example, if I run the code with shift-enter:</p> <pre><code>a = input() print(a) </code></pre> <p>the cell indicates it is running, but does not accept input from me. How do...
<python><jupyter><jupyter-notebook>
2016-01-23 19:54:09
HQ
34,968,174
Set text-cursor position in a textarea
<p>I'm working on a BBCode editor and here is the code:</p> <pre><code>var txtarea = document.getElementById("editor_area"); function boldText() { var start = txtarea.selectionStart; var end = txtarea.selectionEnd; var sel = txtarea.value.substring(start, en...
<javascript><textarea>
2016-01-23 19:59:48
HQ
34,968,371
Integrate Spring Boot with JBOSS EAP Server
<p>1) Can Spring-boot use JBOSS EAP 7.0 server as an embedded server?</p> <p>2) please let us know, if any one can the sample code for the above. </p>
<spring-boot>
2016-01-23 20:19:15
LQ_CLOSE
34,968,391
Can i fetch the data from SQL database table without using any Query...????? in vb or C#
<p>Can i fetch the data from SQL database table without using any Query...????? in vb or C#</p>
<c#><sql><vb.net>
2016-01-23 20:21:26
LQ_CLOSE
34,968,571
Xamarin Studio not Recognizing Provisioning Profiles
<p>I'm at my wit's end with these apple certificates. I have a Xamarin.Forms app that I need to sign with a provisioning profile so I can enable push notifications. However, Xamarin Studio isn't recognizing any of the provisioning profiles that I'm making. Can someone please help?</p> <p>Xamarin Studio trying to link ...
<ios><xcode><xamarin><provisioning-profile><xamarin-studio>
2016-01-23 20:38:22
HQ
34,969,287
What is the current status of C++ AMP
<p>I am working on high performance code in C++ and have been using both CUDA and OpenCL and more recently C++AMP, which I like very much. I am however a little worried that it is not being developed and extended and will die out.</p> <p>What leads me to this thought is that even the MS C++AMP blogs have been silent f...
<c++><c++11><gpgpu><c++-amp>
2016-01-23 21:48:10
HQ
34,969,292
How to set default HTTP header in Angular2?
<p>I know how to set headers for a single HTTP call using the <a href="https://angular.io/docs/ts/latest/api/http/Headers-class.html" rel="noreferrer">Headers class</a>.</p> <p>Is there a way to do it for <strong>all</strong> HTTP calls? </p>
<angular>
2016-01-23 21:48:53
HQ
34,969,525
CAN standard frame and extended frame related
<p>Is it possible to have both CAN standard frame and CAN extended frame coexist on a single CAN bus ?</p> <p>can bus protocol allows this to happen?</p>
<embedded>
2016-01-23 22:11:59
LQ_CLOSE
34,969,552
How to configure 3 way merge feature on compare in Visual Studio 2015
<p><strong>Problem:</strong> The default diff/ merge tool in visual studio 2015 (and previous versions) does not allow merging when you compare a file. It only allows you to see differences. The only occasion I'm aware of the 3 way merge option being enabled is when there is a merge conflict.</p> <p>I want to see the ...
<visual-studio><merge><visual-studio-2015><diff><merge-conflict-resolution>
2016-01-23 22:14:58
HQ
34,969,848
"textAlignVertical" is not a valid style property
<p>I am getting an error saying "textAlignVertical" is not a valid style property when attempting to use the 'textAlignVertical' style on a Text element. I've checked the documentation and it says I should be able to use this style property: <a href="https://facebook.github.io/react-native/docs/text.html" rel="noreferr...
<react-native>
2016-01-23 22:42:40
HQ
34,970,081
How much jquery in angular app?
<p>I'm learning javascript and I'm at the point where I can't figure it out on my own, how much do I need to know about jquery to develop app with angular, ember or whatever framework i chose to, <strong>is jquery optional, something good to know but i can do all i wanted just by going with some popular framework</stro...
<javascript><jquery><angularjs><ember.js>
2016-01-23 23:10:13
LQ_CLOSE
34,970,704
What is a fast and proper way to refresh/update plots in Bokeh (0.11) server app?
<p>I have a bokeh (v0.11) serve app that produces a scatter plot using (x,y) coordinates from a data frame. I want to add interactions such that when a user either selects points on the plot or enters the name of comma-separated points in the text box (ie. "p55, p1234"), then those points will turn red on the scatter p...
<python><bokeh>
2016-01-24 00:19:24
HQ
34,970,881
Inject a service into an Ember Object [not an Ember Controller]
<p>I'm trying to inject an Ember service into an Ember Object but keep getting the following error:</p> <pre><code>"Assertion Failed: Attempting to lookup an injected property on an object without a container, ensure that the object was instantiated via a container." </code></pre> <p>My code looks essentially someth...
<ember.js>
2016-01-24 00:42:39
HQ
34,970,899
batch if, for, do sentences
I discovered while I tried to add a function with if command that I probably don't understand the real function of theese commands. what I tried to achieve: I tried to tell the script that "if" (variable) equals to (this) then it will "SET" (this variable) to 0 how I tried to acomplish this: i tried to acomplish...
<batch-file><if-statement>
2016-01-24 00:45:42
LQ_EDIT
34,971,082
Create date - Carbon in Laravel
<p>I'm starting to read about <code>Carbon</code> and can't seem to figure out how to create a <code>carbon date</code>.</p> <p>In the docs is says you can;</p> <blockquote> <p><code>Carbon::createFromDate($year, $month, $day, $tz); Carbon::createFromTime($hour, $minute, $second, $tz); Carbon::create($year, $mo...
<php><laravel><laravel-5><php-carbon>
2016-01-24 01:12:21
HQ
34,972,023
call event function in another event function As3
i am calling function on another function like below. function loadXML(e:Event = null):void{ xmlData = new XML(e.target.data); //var production:String = xmlData.production.app_id.text(); trace(xmlData); var states:String = xmlData.state.place.text(); var desc:String = xmlData...
<actionscript-3><flash>
2016-01-24 03:54:03
LQ_EDIT
34,972,895
Lombok.hashCode issue with "java.lang.StackOverflowError: null"
<p>I have two tables has one to one relationship as below:</p> <pre><code>@Entity @Data @NoArgsConstructor @AllArgsConstructor public class Book { @Id @GeneratedValue(strategy = GenerationType.TABLE) private int id; private String name; @OneToOne(cascade = CascadeType.ALL) @JoinColumn(name = "book_dtail_...
<hashcode><lombok>
2016-01-24 06:28:12
HQ
34,973,432
OkHttpClient throws exception after upgrading to OkHttp3
<p>I'm using following lines of code to add a default header to all of my requests sent using Retrofit2:</p> <pre><code>private static OkHttpClient defaultHttpClient = new OkHttpClient(); static { defaultHttpClient.networkInterceptors().add(new Interceptor() { @Override public Response intercept(Ch...
<android><retrofit><okhttp><retrofit2><okhttp3>
2016-01-24 07:57:15
HQ
34,974,095
Is it possible to install Oracle 11g server version on windows 7 non server
I want to install oracle 11g server class on my windows 7 ( NON SERVER OS). If it is possible then what step to follow client-server installation. plz help.
<oracle><oracle11g><windows-7>
2016-01-24 09:25:34
LQ_EDIT
34,974,220
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in line 2
<pre><code>$query2 = mysql_query("SELECT *from order where reservation_id = '$reservation_id' "); //query for getting the order_id $row = mysql_fetch_assoc($query2); //this is the line that warns echo $row['order_id']; // the value of order id </code></pre> <p>// anyone knows how to solve this? i keep getting warnin...
<php><mysql>
2016-01-24 09:41:32
LQ_CLOSE
34,974,535
Install latest nodejs version in ubuntu 14.04
<p>This is the way I installed <a href="https://nodejs.org/en/">nodejs</a> in ubuntu 14.04 LTS:</p> <pre><code>sudo add-apt-repository ppa:chris-lea/node.js sudo apt-get install nodejs </code></pre> <p>When I checked the node version with this:</p> <pre><code>node -v </code></pre> <p>I get this</p> <pre><code>v0....
<node.js><ubuntu>
2016-01-24 10:14:19
HQ
34,975,572
Why sysout allways prints 1?
<p>In below code, why sysout allways prints 1?</p> <pre><code>public class A implements ActionListener{ public static int X = 0; private Timer timer; public A(){ timer = new Timer(16 ,this); timer.setInitialDelay(16); timer.start(); } public void actionP...
<java>
2016-01-24 12:08:10
LQ_CLOSE
34,975,972
How can I make a video from array of images in matplotlib?
<p>I have a couple of images that show how something changes in time. I visualize them as many images on the same plot with the following code:</p> <pre><code>import matplotlib.pyplot as plt import matplotlib.cm as cm img = [] # some array of images fig = plt.figure() for i in xrange(6): fig.add_subplot(2, 3, i +...
<python><animation><matplotlib>
2016-01-24 12:48:14
HQ
34,976,058
Pycharm 5.0.1: Scanning files to index taking forever
<p>I am using PyCharm Community Edition 5.0.1 It was working fine till yesterday. But it has been stuck at 'Scanning files to index' for a very long time now. Since yesterday. </p> <p>I have tried re-installing it, and also tried invalidating cache.</p> <p>I can make changes to programs and use it as a text editor bu...
<python><pycharm>
2016-01-24 12:56:07
HQ
34,976,140
C P.L., using goto statement for temperature conversion. Need to learn :)
#include <stdio.h> int main() { char choice; float x,y; start: printf("[c] Converts Celsius -> Fahrenheit\n[f] Converts Fahrenheit -> Celsius\n\n\n"); printf("Enter Choice: "); scanf("%c",&choice); if (choice!='c' || choice!='f' || choice!='x') { printf("Wrong Choi...
<c><goto><temperature>
2016-01-24 13:06:12
LQ_EDIT
34,976,283
In Ionic 2, how do I create a custom directive that uses Ionic components?
<p>Creating a basic directive is simple:</p> <pre><code>import {Component} from 'angular2/core'; @Component({ selector: 'my-component', template: '&lt;div&gt;Hello!&lt;/div&gt;' }) export class MyComponent { constructor() { } } </code></pre> <p>This works as expected. However, if I want to use Ionic...
<javascript><ionic2>
2016-01-24 13:21:06
HQ
34,976,385
Ruby On Rails & Interacting with the Database
<p>How can I write SQL queries for CRUD if I don't want to use the constructors &amp; ghost methods' concept of the Rails. Eg. What if i want to INSERT INTO Values() instead of using Tablename.create()...and the saving it..</p>
<ruby-on-rails><ruby><sqlite>
2016-01-24 13:30:36
LQ_CLOSE
34,977,230
Separate form validation with Meteor
<p>I'm using <a href="https://github.com/aldeed/meteor-collection2">collection2</a> and I'm trying to get it to handle validation is a specific way. I have a profile schema which looks kind of like this:</p> <pre><code>Schema.UserProfile = new SimpleSchema({ name: { type: String, optional: false ...
<meteor><meteor-collection2><simple-schema>
2016-01-24 14:56:49
HQ
34,977,381
Append each data frame iteratively into a larger data frame R
I did search for this and linking to entries here: http://stackoverflow.com/questions/22053090/appending-multiple-files-into-a-data-frame-using-r http://stackoverflow.com/questions/22053090/appending-multiple-files-into-a-data-frame-using-r http://stackoverflow.com/questions/12162278/appending-column-to-a-data-fram...
<r><dataframe><pivot-table>
2016-01-24 15:10:29
LQ_EDIT
34,977,789
Cannot change visual studio code settings
<p>I try to change visual studio code settings but I cannot edit anything. What should I do ? I want to set encoding to </p> <pre><code>"files.encoding": "ISO 8859-1", </code></pre>
<visual-studio-code>
2016-01-24 15:47:44
HQ
34,978,182
a code for checking leap year and counting no of days in a month in python
this is my code: def cal(month): if month in ['January', 'march','may','july','august','oct','dec']: print ("this month has 31 days") elif month in ['april','june','sept','nov']: print ("this month has 30 days") elif month == 'feb' and leap(year)== True: print ("this month has ...
<python><if-statement>
2016-01-24 16:20:22
LQ_EDIT
34,978,828
Uncaught ReflectionException: Class log does not exist Laravel 5.2
<p>I am currently trying to clone an existing project of mine from github. After clone I run <code>composer install</code> during the process I receive the following error:</p> <p><code>Uncaught ReflectionException: Class log does not exist</code></p> <p>I am running Laravel 5.2 on Centos 7. </p> <p>I have seen refe...
<php><laravel><centos7><laravel-5.2>
2016-01-24 17:12:30
HQ
34,978,960
Making a simple page responsive through CSS
<p>I am using a simple half bootstrap / half designed by somebody login template. Now it opens just as it should through the web browser:</p> <p><a href="https://i.stack.imgur.com/lKZNP.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lKZNP.jpg" alt="enter image description here"></a></p> <p>But whe...
<html><css>
2016-01-24 17:22:35
LQ_CLOSE
34,979,139
String Encoding Python 2.7
I have a non-literal string that is programmatically obtained from the title of a printed document online: "wxPython: Windows Styles and Events Hunter « The Mouse Vs. The Python" # retrieved string I am trying to put it in to a database which does not accept non-ASCII characters and it always throws exceptio...
<python><string><python-2.7><unicode><utf-8>
2016-01-24 17:42:00
LQ_EDIT
34,979,411
I got error when i was installing django.Pls Help me?
>>> import django Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named django >>> [enter image description here][1] [1]: http://i.stack.imgur.com/OveNv.png
<python><django><django-templates>
2016-01-24 18:05:29
LQ_EDIT
34,979,522
NotificationManager getActiveNotifications() for older devices
<p>I want to be able to get active notifications from my Android app on demand. (actually I just need to know if there are any) I've been searching for this behavior and it seems, like I have only two options: <code>NotificationManager.getActiveNotifications()</code> which is exactly what I need, but is only available ...
<android><notifications><notificationmanager>
2016-01-24 18:15:05
HQ
34,980,144
Difference between lambda and LINQ?
<p>Can someone explain me the difference between lambda and linq?</p> <p>Please don't point me out to other stackexchange answers or trivial explanations, I've checked most of them and they're orribly confusing.</p> <p>I've used a bit of LINQ (I believe?) in these days with expressions like (merely an invented exampl...
<c#><linq><lambda>
2016-01-24 19:08:39
HQ
34,980,253
I write this code but I need to use a function in order to get a return instead printing the output
"""A catering company has hired you to help with organizing and preparing customer's orders. You are given a list of each customer's desired items, and must write a program that will count the number of each items needed for the chefs to prepare. The items that a customer can order are: salad, hamburger, and water. ...
<python>
2016-01-24 19:18:01
LQ_EDIT
34,980,308
How many is too many for create dispatch_queues in GCD (grand central dispatch)?
<p>There is a wonderful article about a lightweight notification system built in Swift, by Mike Ash: (<a href="https://www.mikeash.com/pyblog/friday-qa-2015-01-23-lets-build-swift-notifications.html" rel="noreferrer">https://www.mikeash.com/pyblog/friday-qa-2015-01-23-lets-build-swift-notifications.html</a>).</p> <p>T...
<multithreading><grand-central-dispatch>
2016-01-24 19:22:11
HQ
34,980,465
Way to break out of an inner For loop in Swift
<p>Is there a simple way to break out of an inner For loop, i.e. a Fro loop within another For loop? Without having to set additional flags for example</p>
<swift><for-loop>
2016-01-24 19:34:39
HQ
34,980,618
can somebody help me understand this more. javascript selection
var select = document.getElementById('select'); var opsArray= select.options; select.onchange = userSelection; function userSelection(){ var i = select.selectedIndex; document.location.assign('projects/' + opsArray[i].value + '/'); } so i know that when the user select...
<javascript><jquery><javascript-objects>
2016-01-24 19:47:32
LQ_EDIT
34,981,341
two trees and a joint table between them
i have three tables, 2 hierarchical and 1 junction between these. Teams id idParent 1 null 2 1 3 null 4 null 5 4 Projects id idParent 1 null 2 null 3 2 4 2 5 null TeamProjects idTeam idProject 2 2 3 1 5 5 ...
<sql-server><entity-framework><linq><tsql><entity-framework-6>
2016-01-24 20:55:16
LQ_EDIT
34,981,745
Taskkill /PID not working in GitBash
<p>I'm trying to kill a process on GitBash on Windows10 using the taskkill command. However, I get the following error:</p> <pre><code>$ taskkill /pid 13588 ERROR: Invalid argument/option - 'C:/Program Files/Git/pid'. Type "TASKKILL /?" for usage. </code></pre> <p>it works fine on cmd. Can anyone help?</p>
<bash><git-bash>
2016-01-24 21:30:49
HQ
34,984,212
How can I set the UIColor of a UIBezierPath in Swift?
<p>Let's say I have something like this in Objective-C</p> <pre><code> - (void)drawRect:(CGRect)rect { if (1 &lt; [_points count]) { UIBezierPath *path = [UIBezierPath bezierPath]; [path setLineWidth:3.]; MyPoint *point = _points[0]; [path moveToPoint:point.where]; NSTimeInterval now = [NSDate ti...
<objective-c><swift><uibezierpath>
2016-01-25 02:25:08
LQ_CLOSE
34,984,647
Sudoku Checker Program C
<p>I'm trying to complete a sudoku solution checker program in c. I'm still trying to understand the steps in building this program before I start coding it. I found this example online <a href="http://practicecprogram.blogspot.com/2014/10/c-program-to-find-out-if-solved-sudoku.html" rel="nofollow">http://practicecprog...
<c><arrays><multidimensional-array><sudoku>
2016-01-25 03:32:00
LQ_CLOSE
34,984,820
How to generate offline Swagger API docs?
<p>I have a spring boot MVC java Web app. I've been able to integrate Springfox for API documentation. I can visually see all of the APIs when server is up and running. </p> <p>How can I generate OFFLINE swagger API documentation? Note: I would not like to use asciidoc or markdown documentation, but I'd like the same ...
<java><spring-mvc><spring-boot><swagger><springfox>
2016-01-25 03:55:16
HQ
34,985,282
Incompatible types : String cannot be converted to int error in java
<p>I've checked my codes many times but not seeing any error in lines. But It shows <code>incompatible types: string cannot be converted to int</code> in the package name. I've tried copying all codes in new package also but still seeing the same error. What was the exact problem. Here is my error screenshot <a href="h...
<java>
2016-01-25 04:45:27
LQ_CLOSE
34,985,284
How to get all Airlines from DBpedia in Asia
<p>I'm just learning querying DBpedia. How would look query to return all Airline companies located in Asia that have income greater than X and are used by Y passengers.</p>
<sparql><dbpedia>
2016-01-25 04:45:54
LQ_CLOSE
34,985,620
Confusion on ruby local variables when calling methods and method invocation variables
a = 5 # variable is initialized in the outer scope 3.times do |n| a = 3 # is a accessible here, in an inner scope? end puts a What is the value of a when it is printed to the screen? mind you times is a method invocation, there is inner scope created here. The value of a is 3. This is bec...
<ruby>
2016-01-25 05:19:04
LQ_EDIT
34,985,713
How to perform Undo(remove last entered string) and Redo(add it back) Operations on Strings ? ( using Core Java data structures )
How to perform Undo(remove last entered string) and Redo(add it back) Operations on Strings ? ( using Core Java data structures ) . This was an interview question,which expected , creating our own pool of strings (asking for number of strings and strings from user) UNDO : removing last string from Redo : Adding...
<java><string>
2016-01-25 05:30:07
LQ_EDIT
34,985,889
How to get the zoom level from the leaflet map in R/shiny?
<p>I create a map using leaflet package in Shiny which have a <code>selectInput</code> to allow user to select from a site list. The site list also adds into leaflet as markers.</p> <p>When user selects a new site, I want to recenter map into the selected site without change the zoom level. The <code>setView</code> fu...
<r><shiny><leaflet>
2016-01-25 05:46:56
HQ
34,985,939
How is multiple User Interface or Views achieved in Chrome App AND How do i connect to MySQL from the Chrome App
I have a web portal developed with Php and MySQL. I want to create a desktop app to work to connect to the Database through the internet. I have two huge challenges 1. Chrome App doesn't navigate from page to page like a website does so HOW DO I ACHIEVE MULTIPKE USER INTERFACES OR VIEWS 2. IndexedDB is not suitable f...
<php><mysql><interface><navigation><google-chrome-app>
2016-01-25 05:51:10
LQ_EDIT
34,987,978
Deloyment failed in aws beanstalk, getting 502 error
Everything worked in my local, I googled few questions, all have to do with port problem. But since I'm using express, I think I will not have hardcoded port problem, as you can see below is partially the code in www var port = normalizePort(process.env.PORT || '3000'); app.set('port', port); I have a ...
<node.js><amazon-web-services><express><amazon-elastic-beanstalk>
2016-01-25 08:23:57
LQ_EDIT
34,988,163
Linux - Check if a file has multiple lines
<p>Is there a command or bash function to check if a file has multiple lines? Lets say i have these two files:</p> <p><strong>foo.txt</strong></p> <pre><code>Hello World </code></pre> <p><strong>bar.txt</strong></p> <pre><code>Hello World </code></pre>
<linux><bash>
2016-01-25 08:36:28
LQ_CLOSE
34,988,593
How to get the count of # data rows in .csv file in R using nrow() function
<p>I have a data file (data.csv file) in my working directory. The first row of my file has column names. I want to count all the rows in my .csv file (excluding the first row) using the nrow() function. Size of the file is 4kb on disk, otherwise 2.83 kb Thanks Jyoti</p>
<r>
2016-01-25 09:03:04
LQ_CLOSE
34,989,182
need a sql query for this can any one suggest two join simultaneously
Table Product Id name t1 t2 1 A 1 4 2 B 5 2 3 C 3 1 4 D 4 5 Tan Table id tan 1 tanA 2 tanB 3 tanC 4 tanD 5 tanE I have two above table and i want the result as below in expecting result how it is possible please assist Expecting result A tanA tanD B tanE tanB C ta...
<sql>
2016-01-25 09:35:18
LQ_EDIT
34,989,915
Write only, read only fields in django rest framework
<p>I have models like this:</p> <pre><code>class ModelA(models.Model): name = models.CharField() class ModelB(models.Model): f1 = models.CharField() model_a = models.ForeignKey(ModelA) </code></pre> <p>Serializers:</p> <pre><code>class ASerializer(serializers.ModelSerializer): model_b_ids = seriali...
<django><django-rest-framework>
2016-01-25 10:11:26
HQ