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,881,775
Automatic cookie handling with OkHttp 3
<p>I am using okhttp 3.0.1. </p> <p>Every where I am getting example for cookie handling that is with okhttp2 </p> <pre><code>OkHttpClient client = new OkHttpClient(); CookieManager cookieManager = new CookieManager(); cookieManager.setCookiePolicy(CookiePolicy.ACCEPT_ALL); client.setCookieHandler(cookieManager); </c...
<cookies><okhttp3>
2016-01-19 16:19:45
HQ
34,882,125
Getting 403 (Forbidden) when loading AWS CloudFront file
<p>I'm working on a video app and storing the files on AWS S3, using the default URL like <code>https://***.amazonaws.com/***</code> works fine but I have decided to use CloudFront which is faster for content delivery.</p> <p>Using CF, I keep getting <code>403 (Forbidden)</code> using this URL <code>https://***.cloudf...
<amazon-web-services><amazon-s3><amazon-cloudfront>
2016-01-19 16:36:04
HQ
34,883,026
Django migrations error KeyError: ('list', u'user')
<p>I am trying to run</p> <pre><code>python manage.py migrate </code></pre> <p>or</p> <pre><code>python manage.py makemigrations </code></pre> <p>I got this error:</p> <pre><code>Running migrations: No migrations to apply. Traceback (most recent call last): File "manage.py", line 10, in &lt;module&gt; exec...
<python><django><migrate><makemigrations>
2016-01-19 17:17:17
HQ
34,884,140
find and replace all periods that are not followed by punctuation or a space
<p>I'm trying to format user input using PHP, and am frequently running into issues where there are not spaces between sentences (i.e. after a closing period). This creates problems, as this user input gets professionally printed. If we miss these during a manual QC process, it costs the company money, as it has to b...
<php><regex>
2016-01-19 18:17:14
LQ_CLOSE
34,885,226
VB.NET - Query will not update SQL Server
In the below code, my second query will not insert into the SQL database, but the first one will update. I can copy the query (from the msgbox i added for testing) and paste it in SQL Server Management Studio, and it will execute fine. I also do not get any error messages back from SQL, though i'm not sure if that cod...
<sql-server><vb.net><winforms>
2016-01-19 19:19:59
LQ_EDIT
34,885,380
What happen to SketchFlow and what we should use instead?
<p>What is the new <strong>Microsoft way</strong> of UI prototyping since VS2015 doesn't support SketchFlow projects. <em>(I'm having hard time to accept that they removed such a useful tool without providing alternative)</em></p> <blockquote> <p>I know we still have <em>PowerPoint StoryBoards</em> for basic UI moc...
<visual-studio><sketchflow>
2016-01-19 19:29:03
HQ
34,885,551
All possible combinations of elements from different bins (one element from every bin)
<p>I have a list, where each element is a set of numbers. Lengths of all sets are different:</p> <pre><code> a &lt;- list(1,c(2,3),c(4,5,6)) #&gt; a #[[1]] #[1] 1 #[[2]] #[1] 2 3 #[[3]] #[1] 4 5 6 </code></pre> <p>I'd like to get all possible combinations of one element from each set. In this example it should be:...
<r><combinatorics><lapply><sapply>
2016-01-19 19:40:41
LQ_CLOSE
34,886,172
OKhttp PUT example
<p>My requirement is to use <code>PUT</code>, send a header and a body to server which will update something in the database.</p> <p>I just read <a href="http://square.github.io/okhttp/">okHttp documentation</a> and I was trying to use their <code>POST</code> example but it doesn't work for my use case <strong>(I thin...
<android><retrofit><okhttp><android-networking><androidhttpclient>
2016-01-19 20:18:13
HQ
34,886,407
SQLAlchemy eager loading multiple relationships
<p>SQLAlchemy supports eager load for relationship, it is basically a <code>JOIN</code> statement. However, if a model has two or more relationships, it could be a very huge join. For example,</p> <pre><code>class Product(Base): __tablename__ = 'product' id = Column(Integer, primary_key=True, autoincrement=Tru...
<python><mysql><sql><sqlalchemy>
2016-01-19 20:32:05
HQ
34,886,461
Why is it that when i run my code it says "AttributeError: Enemy instance has no attribute 'enemy'"?
<p>my code can both be found and ran here : <a href="https://repl.it/Bda9/10" rel="nofollow">https://repl.it/Bda9/10</a></p> <p>right now i'm focusing on the 'explore' then 'attack' pathways, but for some reason this code will not run a single attack. I need to get this at least working by tonight. We just started OOP...
<python>
2016-01-19 20:35:13
LQ_CLOSE
34,886,853
Unfortunately, APP has stopped error. Are there any view limitations for an activity?
<p>I am trying to develop an app for Android with Android studio. I have a login page and trying to open an another activity named main with button from login page. I have lots of rows in two table layout. You can find codes there. When i clicked imagebutton in login, sometimes i get Unfortunately, APP has stopped erro...
<android><android-studio>
2016-01-19 21:01:11
LQ_CLOSE
34,886,921
What is the ideal target time for rendering a page of a PHP forum?
<p>I am creating this question because I am currently working on my free time (for fun) on a PHP forum, using MySQL for my database. And for a little while now (most of the essential features being implemented), I have been questioning the performance of my scripts.</p> <p>I already did some profiling of my scripts an...
<php><mysql><performance><wampserver><forum>
2016-01-19 21:06:02
LQ_CLOSE
34,887,347
How to detect if webpack-dev-server is running?
<p>How can I determine if <code>webpack.config.js</code> was loaded via <code>webpack</code> vs <code>webpack-dev-server</code>?</p>
<webpack><webpack-dev-server>
2016-01-19 21:33:55
HQ
34,887,361
PHP SHA1 function in Java
<p>I was wondering if there is any way to get the PHP SHA1 with raw returning in Java. Just like this in PHP: sha1("abc123", true) Anyone got an idea? It would be appreciated very much.</p>
<java><php><android><hash>
2016-01-19 21:34:46
LQ_CLOSE
34,887,813
assertNull J Unit, fails with null pointer (JAVA)
For my project one of the returns has to be null. When testing using assertNull(Null Object here) it fails with a null pointer exception. Can someone please tell my why?? I thought assertNull is suppose to test for null. Heres part of my code. public static UVI calculateUVI(double[] radiation) ...
<java><junit><null>
2016-01-19 22:03:07
LQ_EDIT
34,887,938
Convert CURRENT_TIMESTAMP to only Y-m-d
<p>I have a column named "timestamp" in my DB with datatype <code>timestamp</code> and standard <code>CURRENT_TIMESTAMP</code>.</p> <p>When I echo it (<code>echo $row['timestamp'];</code>) i get this:</p> <pre><code>2016-01-18 21:06:37 2016-01-19 12:32:16 2016-01-19 20:52:41 </code></pre> <p>But I want it to turn ...
<php><phpmyadmin>
2016-01-19 22:12:17
LQ_CLOSE
34,888,012
return statement no result in java
<p>I have declared a method in a class named Teacher used return statement,</p> <pre><code> public String info(){ return "Name is " +name +"Location is "+location; </code></pre> <p>Then I built the constructor then I called it from main class </p> <pre><code>Teacher t1= new Teacher("Tim","Guildford","Reader"...
<java><return>
2016-01-19 22:17:09
LQ_CLOSE
34,888,205
Insert padding so that points do not overlap with y or x-axis
<p>I have the created this plot in D3: <a href="http://bl.ocks.org/cddesja/aee65f660c24cb2144fd" rel="noreferrer">http://bl.ocks.org/cddesja/aee65f660c24cb2144fd</a></p> <p>There are two things I would like to change.</p> <p>1) I would like to make it so that none of my points overlap with the y or x-axis. I thought ...
<d3.js>
2016-01-19 22:30:30
HQ
34,888,206
how to proxy to backend server on certain path?
<p>Here is the routes config:</p> <pre><code>&lt;Route path='/' component={CoreLayout}&gt; &lt;IndexRoute component={HomeView}/&gt; &lt;Route path='/404' component={NotFoundView}/&gt; &lt;Redirect from='*' to='/404'/&gt; &lt;/Route&gt; </code></pre> <p>Here is the proxy config for webpack-dev-server:</p> <pre>...
<react-router><webpack-dev-server>
2016-01-19 22:30:41
HQ
34,888,420
Crashlytics: How to see user name/email/id in crash details?
<p>I am using Crashlytics for collecting crashes from iOS app. To make crash more specific I want to see user name/email/id in crash details.<br> For this goal I use such code:</p> <pre><code>[Crashlytics setUserIdentifier:@"userID"]; [Crashlytics setUserEmail:@"user@email.com"]; [Crashlytics setUserName:@"userName"];...
<ios><crashlytics>
2016-01-19 22:46:56
HQ
34,888,636
Change Background color of MenuItem on MouseOver
<p>I want to change the default background color of a MenuItem at mouseOver. Here is my xaml code:</p> <p><a href="https://i.stack.imgur.com/S5SwM.png" rel="noreferrer"><img src="https://i.stack.imgur.com/S5SwM.png" alt="enter image description here"></a></p> <p>Style :</p> <pre><code>&lt;Style TargetType="{x:Type ...
<wpf><xaml><wpf-controls>
2016-01-19 23:05:38
HQ
34,888,793
How to cancel Alamofire.upload
<p>I am uploading images on server via <code>Alamofire.upload</code> as multipart data. Unlike <code>Alamofire.request</code> it's not returning <code>Request</code> object, which I usually use to cancel requests. </p> <p>But it's very reasonable to be able to cancel such a consuming requests like uploading. What are ...
<swift><alamofire>
2016-01-19 23:19:37
HQ
34,889,793
Why did kotlin drop the "new" keyword?
<p>Why did kotlin drop the <strong>new</strong> keyword ? It makes it harder to see the difference between a function call and an object allocation.</p>
<kotlin>
2016-01-20 01:07:06
HQ
34,889,957
A solution to SQLAlchemy temporary table pain?
<p>It seems like the biggest drawback with SQLAlchemy is that it takes several steps backwards when it comes to working with temporary tables. A very common use case, for example, is to create a temporary table that is very specific to one task, throw some data in it, then join against it.</p> <p>For starters, declari...
<python><postgresql><sqlalchemy><temp-tables>
2016-01-20 01:24:51
HQ
34,890,654
How to Add Changing Variable Element to ArrayList in Java
<p>I have a need create an ArrayList to collect positions of some points.</p> <pre><code>ArrayList&lt;int[]&gt; collection = new ArrayList&lt;int[]&gt; ; //the position has 2 coordinations. int[] location = new int[2] //add first position a,b location[0] = a; location[1] = b; collection.add(location); //add second ...
<java><arrays><arraylist><element>
2016-01-20 02:43:53
LQ_CLOSE
34,890,747
Beginner programmer, and I received an error
printf("The rate of train 1 and train 2 respectively are what values?\n"); scanf("%d%d", &rate_1_mph, &rate_2_mph); printf("What was the total distance the trains were apart initially?\n"); scanf("%d", &distance_total_mile); printf("The time it takes both trains to arrive side-by-side is %.31f minutes.\n",...
<c>
2016-01-20 02:55:03
LQ_EDIT
34,891,720
Import excel data using angular js
<p>I am currently working on a web-application using angularjs.I want to import data from excel sheet using angularjs and add it into the ng-grid.Please give me possible solutions.</p>
<angularjs>
2016-01-20 04:38:14
LQ_CLOSE
34,891,743
Realm migrations in Swift
<p>I have a Realm Object modeled as so</p> <pre><code>class WorkoutSet: Object { // Schema 0 dynamic var exerciseName: String = "" dynamic var reps: Int = 0 // Schema 0 + 1 dynamic var setCount: Int = 0 } </code></pre> <p>I am trying to perform a migration.</p> <p>Within my <code>AppDelegate...
<swift><migration><realm><data-migration><data-management>
2016-01-20 04:41:10
HQ
34,892,434
Update code to swift 2
<p>How do i update following code to swift 2 i am new</p> <pre><code>if let rtf = NSBundle.mainBundle().URLForResource("rtfdoc", withExtension: "rtf", subdirectory: nil, localization: nil) { let attributedString = NSAttributedString(fileURL: rtf, options: [NSDocumentTypeDocumentAttribute:NSRTFTextDocumentType...
<ios><swift><swift2><rtf>
2016-01-20 05:48:22
LQ_CLOSE
34,892,478
git lfs "objects" taking a lot of disk space
<p>I have a project with a lot of binaries (mostly pdfs) that I'm using git-lfs with. The project is about 60mb but I found that my .git/lfs/objects director is about 500mb. I presume these are cached versions of previous commits. Is there a way to gracefully delete these (ie delete them without corrupting the state...
<git><github><git-lfs>
2016-01-20 05:51:58
HQ
34,892,541
Notice "Undifined Variable"
<p>I am running a PHP script, and keep getting errors like: <a href="http://i.stack.imgur.com/89eot.png" rel="nofollow">this is my error</a></p> <p><a href="http://i.stack.imgur.com/YTYKT.png" rel="nofollow">this is script</a></p>
<php>
2016-01-20 05:57:59
LQ_CLOSE
34,892,601
what does the weak_alias function do and where is it defined
<p>So I'm looking through the source of gcc compiler and I've come along this in fork.c:</p> <pre><code>int __fork () { __set_errno (ENOSYS); return -1; } libc_hidden_def (__fork) stub_warning (fork) weak_alias (__fork, fork) #include &lt;stub-tag.h&gt; </code></pre> <p>I'm trying to figure out what weak_alias d...
<c><linux><gcc><compiler-construction><gnu>
2016-01-20 06:02:20
HQ
34,892,696
how to show selected item in another activityin android
<p>I am new in android. My app is basically is shoppping cart.Now I want help. when user select items from custom listview.Those items display with image ,name and quantity to next activity such as view cart.I have been searching tutorial but cannot find a complete one. Can anyone guide me through proper code how could...
<android>
2016-01-20 06:08:02
LQ_CLOSE
34,893,279
Spring Data Redis Expire Key
<p>I have a One Spring Hibernate Application. In my application, Recently i am implemented Spring data Redis.</p> <pre><code>spring-servlet.xml &lt;!-- redis connection factory --&gt; &lt;bean id="jedisConnFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory" p:use-pool="true"/&gt; &...
<java><spring><hibernate><redis>
2016-01-20 06:49:25
HQ
34,893,623
i want to conect a microcontroller to PC and play audio recived to pc by using naudio
i want to connect a microcontroller to PC and send wave file form micro to PC and play real-time and save it to PC i can set a connection with USB between micro and PC to receive array i should play this array and add next array in real-time without gaps in play and i use C# to programming
<c#><microcontroller><naudio>
2016-01-20 07:10:04
LQ_EDIT
34,895,019
Node Modular Architecture
<p>I am building a nodejs application that is fairly large now. In an attempt to avoid a monolithic node application I have gone down the architectural route of a more modular system breaking out several components into separate npm modules. These are published using npm and installed in the dependent modules. I have a...
<node.js><architecture><npm>
2016-01-20 08:32:39
HQ
34,896,097
Nothing displaying in console when using console.log with if statements in for loops
<p>I have two objects:</p> <pre><code>var obj = { first: "Romeo", last: "Montague" }; var search = { last: "Montague" }; </code></pre> <p>My goal is to find if the second object (<code>search</code>) is present in the first one, and <code>console.log</code> it if it is.</p> <p>First, I get the keys of both objects:<...
<javascript>
2016-01-20 09:25:45
LQ_CLOSE
34,897,704
Use svg as map using leaflet.js
<p>Is it possible to use SVG image as the base map for leaflet.js ?</p> <p>In my case I have huge svg file and I wish to allow my users to use all of leaflet's features such as zoom, markers, layers.</p>
<javascript><svg><leaflet>
2016-01-20 10:39:10
HQ
34,897,843
Why does Go panic on writing to a closed channel?
<p>Why does Go panic on writing to a closed channel?</p> <p>While one can use the <code>value, ok := &lt;-channel</code> idiom for reading from channels, and thus the ok result can be tested for hitting a closed channel:</p> <pre><code>// reading from closed channel package main import "fmt" func main() { ch :...
<go><concurrency><channel><goroutine><panic>
2016-01-20 10:45:29
HQ
34,898,267
Using CameraCaptureUI in Windows 10 fullscreen
<p>Is their a way to tell the <a href="https://msdn.microsoft.com/en-us/library/windows/apps/windows.media.capture.cameracaptureui">CameraCaptureUI</a>, that it should start in fullscreen mode, instead of a small window?</p> <p>my current code from the linked webside:</p> <pre><code>CameraCaptureUI cameraUI = new Cam...
<c#><camera><windows-runtime>
2016-01-20 11:03:27
HQ
34,898,589
Particles over background image
<p>As seen on <a href="https://discordapp.com/" rel="nofollow">https://discordapp.com/</a> there's floating particles overlaying the background of the header. I've searched pretty much everywhere, trying to export transparent videos, gifs from Premiere CC, After Effects even Photoshop, but none of them will work as see...
<html><css>
2016-01-20 11:18:43
LQ_CLOSE
34,900,023
Read files sent with spark-submit by the driver
<p>I am sending a Spark job to run on a remote cluster by running</p> <pre><code>spark-submit ... --deploy-mode cluster --files some.properties ... </code></pre> <p>I want to read the content of the <code>some.properties</code> file by the <strong>driver</strong> code, i.e. before creating the Spark context and launc...
<apache-spark>
2016-01-20 12:25:07
HQ
34,900,047
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unexpected start state'
<p>I've strange and rare to reproduce crash that happening on iOS 9. The question are <strong>How to fix this</strong> or <strong>What leads to this exception</strong> </p> <p>As you can see traces not contains my code and crash happens on app start. </p> <pre><code>Last Exception Backtrace: 0 CoreFoundation ...
<ios><crash><ios9.2>
2016-01-20 12:26:04
HQ
34,900,862
cheating online test javascript timer
First of all, I have no intention of cheating, I'm just one of these people who tend to see flaws everywhere. These days before the job interview you may be required to do online test, most of them have javascript timers (countdown), so you don't have enough time to google the answers. But the way I see it (corre...
<javascript><timer>
2016-01-20 13:04:41
LQ_EDIT
34,901,258
Are there sample tables on sqlfiddle
<p>Are there any default tables on SqlFiddle that I can query from?</p> <p>I want to try a basic analytical query on a simple table but I don't want to set up the schema and seed data etc.</p> <p>normally I would do something like <code>select * from all_objects</code></p> <p>( <a href="http://sqlfiddle.com/" rel="n...
<sqlfiddle>
2016-01-20 13:22:32
HQ
34,901,556
sass classes for colorizing in html
<p>i would like to create sass classes, such as .blue and .bg, but depending on which i use, it should colorize the fonts and/or the background.</p> <pre><code>// Classes for colorizing elements .blue { color: $primary-color; &amp;.bg { background-color: $primary-color; color: initial; } } .light-gray...
<html><css><sass>
2016-01-20 13:36:49
LQ_CLOSE
34,902,612
FILE I/O: two file pointes
<p>I'm new to FILE I/O Stream and I want to write a program, which converts chars (read from "texti.txt") like "ä,Ä,ü,Ü,ö,Ö" to "ae,Ae,ue,Ue,oe,Oe" and write them in a new file called "texto.txt".</p> <p><strong>First Question:</strong> Is it ok to have two file pointers (on to each file) at the same time like i do?</...
<c><file><io>
2016-01-20 14:22:28
LQ_CLOSE
34,902,663
Permission denied inside Docker container
<p>I have a started container <code>gigantic_booth</code> and I want to create the directory <code>/etc/test</code>:</p> <pre><code># docker exec -it gigantic_booth /bin/bash $ mkdir /etc/test $ mkdir: cannot create directory '/etc/test': Permission denied </code></pre> <p>And <code>sudo</code> command is not found. ...
<docker>
2016-01-20 14:25:05
HQ
34,904,328
Click: "Got unexpected extra arguments" when passing string
<pre><code>import click @cli.command() @click.argument("namespace", nargs=1) def process(namespace): ..... @cli.command() def run(): for namespace in KEYS.iterkeys(): process(namespace) </code></pre> <p>Running <code>run('some string')</code> produces:</p> <p><code>Error: Got unexpected extra arguments ...
<python><python-click>
2016-01-20 15:41:13
HQ
34,904,499
want to add multipules tables to a frame dynamicly
hi want to add a number of tables to my frame , depending on the out come of something so put this int x=17; int y=95; for(int i=0;i<5;i++) { table[i].setBounds(x+50,y+50, 525, 44); contentPane.add(table[i]); } but nothing happing any one has some sorte of idia
<java><swing><jtable>
2016-01-20 15:49:22
LQ_EDIT
34,904,523
ES6/ES2015 object destructuring and changing target variable
<p>How can I rename the target during object destructing?</p> <pre><code>const b = 6; const test = { a: 1, b: 2 }; const {a, b as c} = test; // &lt;-- `as` does not seem to be valid in ES6/ES2015 // a === 1 // b === 6 // c === 2 </code></pre>
<javascript><ecmascript-6><destructuring>
2016-01-20 15:50:41
HQ
34,904,548
How to grab a single image from RTSP stream using FFMPEG
<p>I have seen several other related questions but they all seem to be related to grabbing a still shot every X number of seconds. How can I grab 1 image when the command is run.</p> <p>I was trying</p> <pre><code>ffmpeg -y -i rtsp://admin:admin@192.168.10.113:554/live -f image2 -updatefirst 1 do.jpg </code></pre>
<ffmpeg>
2016-01-20 15:51:43
HQ
34,904,991
Telerik Kendo MVC TextBox Multiline Mode
<p>Does anyone know what properties to set to make a Kendo MVC Textbox Multiline?</p> <pre><code> @(Html.Kendo().TextBox() .Name("txtComments") .Value(@Model.Comments) .HtmlAttributes(new { style = "width:100%" }) ) </code></pre> <p>Thanks.</p>
<razor><textbox><kendo-asp.net-mvc><multiline><telerik-mvc>
2016-01-20 16:12:06
HQ
34,905,292
how to compare two images in java?in terms of height and width
<p>i had been working on my project which encompasses the technique for comparing images. I want to compare two images in java in terms of height and width, i can't compare it if any one can help it please do..</p>
<java><image><comparison><height><width>
2016-01-20 16:25:30
LQ_CLOSE
34,905,363
Create File with Google Drive Api v3 (javascript)
<p>I want to create a file with content using Google Drive API v3. I have authenticated via OAuth and have the Drive API loaded. Statements like the following work (but produce a file without content):</p> <pre><code>gapi.client.drive.files.create({ "name": "settings", }).execute(); </code></pre> <p>Unfortunately...
<javascript><google-drive-api>
2016-01-20 16:28:35
HQ
34,905,794
Android Image upload/download with Base64 into JSON causes Out of memory error
<p>I currently encode and decode images to Base64. I overcame the initial issue with OOM's with the use of streams to encode the images into strings.</p> <p>My issue now is that I cannot fathom how to add multiple Base64 encoded strings for multiple resolutions images (5620 x 3747 - 4.92MB or 3264 x 1836 - 1.35MB) to ...
<android><image><base64><gson><android-volley>
2016-01-20 16:48:57
HQ
34,905,850
Child node "2" exited prematurely
<p>I recently retargeted my Windows 8.1 app to Windows 10. I'm getting this error when building the UI projects, </p> <pre><code>"MSBUILD : error MSB4166: Child node "2" exited prematurely. Shutting down. Diagnostic information may be found in files in the temporary files directory named MSBuild_*.failure.txt." </cod...
<msbuild><visual-studio-2015><windows-10-universal>
2016-01-20 16:51:34
HQ
34,905,900
Swift "retry" logic on request
<p>So i'm a bit lost on how to implement a retry logic when my upload request fail.</p> <p>Here is my code i would like some guidance on how to do it</p> <pre><code>func startUploading(failure failure: (NSError) -&gt; Void, success: () -&gt; Void, progress: (Double) -&gt; Void) { DDLogDebug("JogUploader: Crea...
<swift><alamofire>
2016-01-20 16:53:50
HQ
34,905,905
General android programming guide lines
<p>I have been programming on android for the past few months and have hit a point where I comprehend the basic ideas and principles for Android development. </p> <p>Currently I think that my code lacks the appropriate structure and clearance that is required in order for your code to be readable. I know this because ...
<android><coding-style>
2016-01-20 16:53:58
LQ_CLOSE
34,906,002
Increase width of entire HTML Rmarkdown output
<p>I am looking to increase the overall width of my HTML Rmarkdown output. </p> <p>When producing PDF documents from Rmarkdowns there is an option to set the margin in the YAML section of the Rmd (ex. geometry: margin=.5in).</p> <p>I am looking for something similar for HTML docs. The following link is a good example...
<html><rstudio><r-markdown><margins>
2016-01-20 16:58:15
HQ
34,906,042
sql query to delete data from 2 tables
currently trying to accomplish the following task adn i using this sql to doit but still not working '' DoCmd.RunSQL " delete tbl_siphon_req_info.* from tbl_siphon_req_info a, tbl_siphon_PO b where concat(a.ross_PO_nbr, a.ross_sku12) = Concat(b.PO_ID, Sbstr(bitem_id,1,12))" if any one can help me to correct and...
<sql><vba><ms-access>
2016-01-20 17:00:09
LQ_EDIT
34,906,301
How to get other pages followers count number in Instagram?
<p>is there possibility to get other pages follower count number in Instagram? I can get only my profile followers count number, but I want to get other followers too? (for example in php)</p> <p>Any ideas?</p>
<php><instagram><instagram-api>
2016-01-20 17:12:39
HQ
34,906,305
Protocol buffer3 and json
<p>Protocol buffer v3 claims, that library is json friendly (<a href="https://developers.google.com/protocol-buffers/docs/proto3#json" rel="noreferrer">https://developers.google.com/protocol-buffers/docs/proto3#json</a>), but I cannot find how to achieve get that mapping. Should I add some plugin, or some option into p...
<c++><json><protocol-buffers><proto3>
2016-01-20 17:12:58
HQ
34,906,500
Why is a type registered twice when lifetime manager is specified?
<p>I'm using Unity's <em>Register by convention</em> mechanism in the following scenario:</p> <pre><code>public interface IInterface { } public class Implementation : IInterface { } </code></pre> <p>Given <code>Implementation</code> class and its interface I'm running <code>RegisterTypes</code> in the following way:...
<c#><.net><unity-container>
2016-01-20 17:22:22
HQ
34,906,624
Android support EditTextPreference input type
<p>Is there any way to specify the input method type for <code>android.support.v7.preference.EditTextPreference</code>?</p>
<android><android-support-library><edittextpreference>
2016-01-20 17:28:34
HQ
34,906,888
Angular 2 access parent routeparams from child component
<p>I've got this (main parent) component -</p> <pre><code>@RouteConfig([ { path: '/', name: 'ProjectList', component: ProjectListComponent, useAsDefault: true }, { path: '/new', name: 'ProjectNew', component: ProjectFormComponent }, { path: '/:id', name: 'ProjectDetail', component: ProjectDetailComponent }...
<javascript><routing><angular><angular-routing>
2016-01-20 17:41:15
HQ
34,907,151
Handling refresh tokens using rxjs
<p>Since i've started with angular2 i have setup my services to return Observable of T. In the service i would have the map() call, and components using these services would just use subscribe() to wait for the response. For these simple scenarios i didnt really need to dig in to rxjs so all was ok. </p> <p>I now want...
<angular><rxjs>
2016-01-20 17:53:54
HQ
34,908,193
Spotify API: INVALID_APP_ID
<p>I am currently working on an android app which is implementing the Spotify API. I have all of the code connecting my app to spotify using the tutorial and have been working on my app for sometime now. When I play a song through my app after authenticating the user, it works perfectly, that is on my emulator. When I ...
<android><spotify><libspotify>
2016-01-20 18:55:52
HQ
34,908,646
How to call webservice using ExecutorService
<p><strong>I would like to know the right way to consume a webservice using ExecutorService in java application, I suppose that the webservice call should be parallel and queues but i don't know how to do it.</strong></p>
<java><multithreading><concurrency><executorservice>
2016-01-20 19:20:34
LQ_CLOSE
34,908,917
Angular2 Routing redirect with routeParams
<p>Is there a way to access the routerParams in the redirecTo-Statement?</p> <p>I want to pass the orderId of the 'Order' route to the 'OrderDashboard' route but I can't figure out what to write instead of <code>???</code></p> <p>If I replace <code>???</code> with <code>3</code> all works fine (in case the user only ...
<angular><angular2-routing>
2016-01-20 19:33:37
HQ
34,909,101
How can I easily switch between PHP versions on Mac OSX?
<p>I would like to test my application on PHP 5.3 up to PHP 7.0.</p> <p>Where and how can I install the versions and how can I switch them by running a small script?</p>
<php><macos>
2016-01-20 19:44:18
HQ
34,909,345
How to test spring configuration classes?
<p>I have a spring application whith configuration classes where instance the beans.</p> <p>Aplication class:</p> <pre><code>@Configuration @EnableAspectJAutoProxy @EnableSpringDataWebSupport @EnableTransactionManagement @ComponentScan(basePackageClasses = Application.class) @PropertySource(value = {"classpath:foo.pr...
<java><spring><spring-mvc><junit>
2016-01-20 19:57:44
HQ
34,909,972
Converting 13 decimals to datetime C++
I have a project about cars with GPS. I need to return the start and the finish moment for each car. Please help me! So we have : time_t x, y; Because I will use later them for a transformation. I have a problem! I read from an external file data in this format: auto1 1439467747492 ...
<c++><class><decimal><ctime>
2016-01-20 20:34:32
LQ_EDIT
34,910,435
Is there a way to prevent fastclick from firing “active” state on scroll?
<p>I’m using <a href="https://github.com/ftlabs/fastclick">FastClick</a> on a page with large links because I want to bypass the 300ms delay for taps in mobile browsers. I have a “highlight” style for the links’ <code>:active</code> states and it is properly firing quickly, thanks to FastClick.</p> <p>My problem is th...
<javascript><css><mobile-safari><fastclick.js><fastclick>
2016-01-20 21:01:45
HQ
34,910,638
looping over AWK commands doesn't work
<p>I have a huge dictionary file that contains each word in each line, and would like to split the files by the first character of the words. </p> <p>a.txt --> only contains the words that start with a</p> <p>I used this awk commands to successfully extract words that start with b.</p> <pre><code> awk 'tolower($0)~...
<bash><awk>
2016-01-20 21:13:14
LQ_CLOSE
34,911,181
How to undo setting Elasticsearch Index to readonly?
<p>So I just set one of my indices to readonly, and now want to delete it.</p> <p>To set it to readonly:</p> <pre><code>PUT my_index/_settings { "index": { "index.blocks.read_only" : true } } </code></pre> <p>When I tried to delete it I got this response:</p> <pre><code>ClusterBlockException[blocked by: [FORBIDDEN/...
<elasticsearch>
2016-01-20 21:43:04
HQ
34,911,474
django aggregation: sum then average
<p>Using django's ORM annotate() and/or aggregate(): I want to sum up based on one category field and then average over the category values per date. I tried to do it using two annotate() statements but got a FieldError.</p> <p>I'm doing this: </p> <pre><code>queryset1 = self.data.values('date', 'category').annotate(...
<python><django><orm>
2016-01-20 22:01:11
HQ
34,912,099
Limited number of tires to a simple game?
How would I limit the tries of a simple game to just three? I would think you would use a boolean. But not sure. import java.util.Scanner; public class guess { public static void main(String[] args) { int randomN = (int) (Math.random() * 10) + 1; Scanner input = new Scanner(System.in); int gu...
<java><boolean><java.util.scanner>
2016-01-20 22:46:05
LQ_EDIT
34,912,156
AStudio issue #66894
<p>In the middle of development it threw an error at me complaining about gradle plugin being too old (was 2.0.0-alpha3, changed to 2.0.0-alpha5 and worked. Hurrah!). Then it complained about <code>distributionUrl</code> pointing to an also outdated piece of software. I have Overcome that as well. Now google nailed me...
<android-studio>
2016-01-20 22:49:21
HQ
34,912,265
Eloquent get only one column as an array
<p>How to get only one column as one dimentional array in laravel 5.2 using eloquent?</p> <p>I have tried: </p> <pre><code>$array = Word_relation::select('word_two')-&gt;where('word_one', $word_id)-&gt;get()-&gt;toArray(); </code></pre> <p>but this one gives it as 2 dimentional array like:</p> <pre><code>array(2) {...
<laravel><eloquent><laravel-5.2>
2016-01-20 22:58:19
HQ
34,912,673
Java Error invalid start
So I'm trying to get my display method to work... private static displayResults(String gender,int age,String rateResult); { System.out.Println("Thank you"); System.out.println("the "+ gender + " is " + age + " years old."); System.out.println("the rate class is: " + r...
<java>
2016-01-20 23:30:12
LQ_EDIT
34,913,078
Importing and changing variables from another file
<p>Okay...</p> <p>I have searched and searched looking for an answer that directly answers my question, but have had no success. My problem is pretty straight forward and I honestly thought there would have been a more direct answer out there. Please keep in mind I am still relatively new to the language, and am still...
<python><python-2.7><variables>
2016-01-21 00:07:21
HQ
34,913,087
Hangman Assignment: Need help revealing the secret word
<p>I have a school assignment and in hangman you reveal the word slowly as the user guesses and I am having trouble with that.</p> <p><strong>For example, this is what I want (ex. applesauce):</strong></p> <p>guess: 'a'</p> <p>display: 'a*****a***'</p> <p>guess: 'p'</p> <p>display: 'app***a***'</p> <p><strong>Thi...
<java>
2016-01-21 00:08:45
LQ_CLOSE
34,913,177
Command Line Git Problems
<p>I'm not fully understanding git. I have a repository on github.com which I checkout by cloning. Then I add a file called index.html and commit via command line. Then nothing happens on github.com. I cannot see the new file updating nor do I see any of the new branches I create. What am I doing wrong?</p>
<git><shell><github><command>
2016-01-21 00:17:01
LQ_CLOSE
34,913,328
All MySQL records from yesterday
<p>What is the most efficient way to get all records with a datetime field that falls somewhere between yesterday at <code>00:00:00</code> and yesterday at <code>23:59:59</code>?</p> <p>Table:</p> <pre><code>id created_at 1 2016-01-19 20:03:00 2 2016-01-19 11:12:05 3 2016-01-20 03:04:01 </code></pre> ...
<mysql><datetime>
2016-01-21 00:33:19
HQ
34,913,840
Best practice for connecting to a vpn though docker
<p>Some apps we have depend on being connected to our VPN to connect to different (not-yet dockerized)solutions. </p> <p>What is the 'docker way' of doing this? In my mind adding OpenVPN to an existing image is against the docker philosophy. </p> <p>From where I'm standing I feel that creating a docker VPN client con...
<docker><docker-compose><openvpn>
2016-01-21 01:31:37
HQ
34,913,956
Looking for a light-weight cross-platform C threading library
<p>I wanted to use OpenMP for this, but it is not appropriate for my purposes: creating my own thread pool.</p> <p>So, this needs to be C89 code with, of course, platform specific code for windows and unices.</p> <p>I need this for a C only library, so no C++, boost C++11, etc.</p> <p>Thanks!</p>
<c><multithreading>
2016-01-21 01:43:46
LQ_CLOSE
34,914,572
How to get data submitted from HTML form that insert into redis database use Rust lang?
I have problem get data from HTML form store value into redis database when user submit. Use Nickel web framework, this is code: fn save_db<'a>(req: &mut Request, res: Response<'a>) -> MiddlewareResult<'a>{ let mut server = Nickel::new(); /* FIXME: connect redis*/ l...
<rust><lifetime>
2016-01-21 02:52:18
LQ_EDIT
34,914,843
What is the difference between continuous integration, continuous delivery and DevOps?
<p>I hear these terms together and wonder what is the difference? How are they related to continuous builds and continuous deployments?</p>
<continuous-integration><devops><continuous-delivery>
2016-01-21 03:22:45
HQ
34,915,003
How can I add an object to an arraylist of objects
<p>The purpose is to add teams to an arraylist. Each team is an object with a String name, String division, int wins, and int losses. </p> <pre><code>import java.util.ArrayList; import java.util.Arrays; public class Default { ArrayList&lt;team&gt; teams = new ArrayList&lt;team&gt;(); team Mavericks = new te...
<java><arraylist>
2016-01-21 03:41:38
LQ_CLOSE
34,915,140
Translate my website content
<p>Guys I know that this question asked before but its not the same.</p> <p>I have a website that I want to translate its content.</p> <p><strong>What I came up with:</strong></p> <p>1-gettext //its not good for me</p> <p>2-google api //google translate is very bad and also google add its name in my wbesite</p> <p...
<php><html><translation>
2016-01-21 03:56:25
LQ_CLOSE
34,915,276
UWP ObservableCollection sorting and grouping
<p>In UWP apps, how can you group and sort an ObservableCollection and keep all the live notification goodness? </p> <p>In most simple UWP examples I've seen, there is generally a ViewModel that exposes an ObservableCollection which is then bound to a ListView in the View. When items are added or removed from the Ob...
<c#><sorting><listview><win-universal-app><uwp>
2016-01-21 04:10:41
HQ
34,915,585
Message: session_start(): Cannot send session cache limiter - headers already sent
<p>Having a problem with sessions which is becoming very annoying. Every time I try to start a session on a particular page I get the following error:</p> <p>Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/uplbcdcn/public_html/CDC/admin_uplbcdc/header.php:57)...
<php><session>
2016-01-21 04:46:21
LQ_CLOSE
34,915,869
Example of Big O of 2^n
<p>So I can picture what an algorithm is that has a complexity of n^c, just the number of nested for loops. </p> <pre><code>for (var i = 0; i &lt; dataset.len; i++ { for (var j = 0; j &lt; dataset.len; j++) { //do stuff with i and j } } </code></pre> <p>Log is something that splits the data set in ha...
<algorithm><big-o><time-complexity>
2016-01-21 05:14:29
HQ
34,915,886
Editing locked files from a CocoaPods framework
<p>I have an Xcode workspace that uses CocoaPods to include several third-party frameworks. I would like to edit a line of source code within one of these dependencies. However, when I do so, Xcode warns me that the file is locked and that any changes I make may not be saved. So my question is: will my changes to the s...
<ios><xcode><dependencies><cocoapods>
2016-01-21 05:15:41
HQ
34,916,703
How to Identify maven archtype?
I have an existing maven project for java services So is there any way to identify archetype from pom file or is there any way? The folder structure for this project is: src/test/java src/main/java src/main/resource And it has "Referenced Libraries" not "Maven Dependencies". Can anyone please let me k...
<java><eclipse><maven><maven-2>
2016-01-21 06:22:32
LQ_EDIT
34,917,203
How to divide the web page in different segment.?
<p>Hi Currently i am working in web project. There it self i am designing a website for mobile device. Here i want to know behalf of what i can use pixel for footer,header.And what is default height and width for mobile device. Here some sample code is there</p> <pre><code> &lt;body&gt; &lt;div id="header"&...
<java><html><css>
2016-01-21 06:55:03
LQ_CLOSE
34,917,349
Is there a way to put quotes in a cout?
<p>I was trying to make a simple calculator and I would like to display quotes in the instruction when you first run the program. </p>
<c++>
2016-01-21 07:05:21
LQ_CLOSE
34,918,025
How to restart Postgresql
<p>I have Postgresql 9.3 and 9.4 installed on my Linux Mint machine. How can I restart postgresql 9.4? A method to restart both versions together is also fine. </p>
<postgresql><linux-mint>
2016-01-21 07:46:00
HQ
34,918,057
What is the faster WebService to use for my android app?
<p>I am new in android i need to start a new project that consume a web Service. I need to know what language to use to develop a very fast web service to consume in my android app?</p>
<android><android-webservice>
2016-01-21 07:48:18
LQ_CLOSE