pid
int64
2.28k
41.1M
label
int64
0
1
text
stringlengths
1
28.3k
27,279,740
0
In spring config xml file all dependency are instantiate for Singleton scope when application context start? <p>As I know "the instantiation of the application context create the container that consists of the objects define in that XML file.</p> <p>This XML file is then provided to the <code>ApplicationContext</code> ...
3,061,186
0
<p>They buy their data from other companies to form the maps. I beleive they purchased the majority of it from Tele Atlas. <a href="http://code.google.com/apis/maps/signup.html" rel="nofollow noreferrer">http://code.google.com/apis/maps/signup.html</a></p> <p>Here is a lot of information on the history of it: <a href=...
38,421,784
0
<p>Most likely the function is not the bottleneck, but the fact that you are calling it 12 million times :-)</p> <p>An obvious improvement is having a variable </p> <pre><code>const char* file_pos = file + pos; </code></pre> <p>simplifying every single access. You don't say how tline is implemented; if a line never co...
20,211,559
0
Converting arbitrarily nested lists to POCOs or DataTables <p>I like to use nested Lists like <code>List&lt;List&lt;double&gt;&gt;</code>. Unfortunately I am using a library that only supports POCOs, ie plain old clr objects or DataTables.</p> <p>Is there a way to create a POCO or DataTable out of <code>List&lt;List&lt...
33,905,192
0
<p>MATLAB has a built-in for this. If N is the number of shades you want (471 in your case) you can do</p> <pre><code>N = 471; c = colormap(jet(N)); </code></pre> <p>then access c in every loop iteration via <code>c(i, :)</code>. For reference see the <a href="http://uk.mathworks.com/help/matlab/ref/colormap.html" rel...
21,305,099
0
<p>If you don't really care about the <code>IList&lt;T&gt;</code>, you can change your model to <code>IEnumerable&lt;T&gt;</code>. <a href="http://msdn.microsoft.com/en-us/library/hh833697%28v=vs.118%29.aspx" rel="nofollow">DisplayNameFor</a> method has an overload for <code>IEnumerable</code>, that means you will be ...
30,850,931
0
<p>You can't append to a <code>tuple</code> at all (<code>tuple</code>s are <em>immutable</em>), and extending to a <code>list</code> with <code>+</code> requires another list.</p> <p>Make <code>curveList</code> a <code>list</code> by declaring it with:</p> <pre><code>curveList = [] </code></pre> <p>and use:</p> <pre>...
15,185,127
0
Cmake generates incorrect configurations <p>I use CMake, and on one of my machines, the generation seems to be messy. When I open the project properties in Visual Studio 2010, the debug configuration seems to be a release one: <code>_DEBUG</code> is not defined, optimizations are enabled, the linked runtime is the rele...
37,892,431
0
<p>The short answer is: you use a generational garbage collector. </p> <p>Except that most modern Java implementations<sup>1</sup> use a generational collector <em>by default</em>. In other words, you (the programmer) don't need to deal with the problem because it is already dealt with.</p> <p>The only situation where...
35,508,423
0
<h3>Step 1 : the target datastructure :</h3> <p>There are two issues with your data structure :</p> <ul> <li><p>You're forgetting to put the names between quotes. <code>John</code> should be <code>"John"</code>. <code>Mary</code> should be <code>"Mary"</code>. etc.</p></li> <li><p>You're trying to use an object for <c...
36,916,053
0
How do I obtain values of a curve f(x1,x2) = 0 in R to visualize it? <p>I have <code>ggplot</code> scatters of points and I'm trying to visualize the different decision boundaries i get with <code>glm</code>. I can grab the coefficients from <code>glm</code> and I end up with something like <code>f(x1,x2) = 0</code> wh...
15,252,037
0
<p>Do not extend Activity class in AppPreferences. and remove the <code>onCreate()</code> method.</p> <p>Do like this way.</p> <pre><code>public class AppPreferences extends Activity { private SharedPreferences settings = null; AppPreferences(Context context) { settings = context.getSharedPreferences(LOGIN_CREDENTIALS...
776,966
0
<p>PersonView is generated by the DataTemplate for the ItemsControl in CommunityView (CommunityView.xaml:16). </p> <p>DataTemplates automatically assign the DataContext of their visuals to the data that the template is displaying. This is how WPF works.</p> <p>CommunityView gets its DataContext set by inheritence from...
8,187,781
0
<p>The Code 39 specification defines 43 characters, consisting of uppercase letters (A through Z), numeric digits (0 through 9) and a number of special characters (-, ., $, /, +, %, and space). An additional character (denoted '*') is used for both start and stop delimiters. Each character is composed of nine elements...
23,369,426
0
<p>Change</p> <pre><code>from OpenGL import * </code></pre> <p>to</p> <pre><code>from OpenGL.GL import * </code></pre> <p>However, I favor using this format:</p> <pre><code>import OpenGL.GL as GL import OpenGL.GLU as GLU import OpenGL.GLUT as GLUT window = 0 width, height = 500,400 def draw(): GL.glClear(GL.GL_COLOR_B...
35,271,814
0
<p>Here is a pure CSS solution I quickly hacked up: <a href="http://codepen.io/nikrich/pen/yeQYGE" rel="nofollow">CSS Hover Effect</a></p> <p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippet-code-css lang-css prettyprint-override"><code>h1, h2, h3, h4, h5{ margin:0p...
25,096,495
0
<p>I did not know about an funktion like you ask for. But maybe you know a time for timeout. So you could use the connection timeout: <a href="http://docs.spring.io/spring/docs/3.0.x/javadoc-api/org/springframework/web/client/RestTemplate.html#RestTemplate(org.springframework.http.client.ClientHttpRequestFactory)" rel...
27,737,330
0
<pre><code>AppDomain.CurrentDomain.SetData("DataDirectory", Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)); </code></pre> <p>This should work always because Directory.GetCurrentDirectory() may return other directory than the executable one</p>
10,235,309
0
<p>If you only want to work with the vision part then AForge.net is your best bet. I have used it in the past and it was pretty good for video/feed stuff. Don't expect to do something with your audio later on though since AForge.NET only supports Vision related stuff. Personally I wouldn't use DirectShow since that is...
6,181,671
0
<p>This is the sort of thing that, in general, you can't override. You can try using <a href="http://msdn.microsoft.com/en-us/library/aa768268%28v=vs.85%29.aspx" rel="nofollow">ShowBrowserBar</a>, but if it doesn't work you will have to reconsider your design. </p>
39,183,961
0
<p>Well you have tried but having no solution please try this</p> <pre><code>RewriteEngine on RewriteRule ([a-zA-Z]+)/([0-9]+)$ index.php?name=$1&amp;pg=$2 [NC,L] </code></pre> <p>Put this .htaccess in category directory</p>
12,619,745
0
<p>It's a bit of a mystery, isn't it? Several superficially plausible theories turn out to be wrong on investigation:</p> <ol> <li><p>So that the <code>POST</code> object doesn't have to implement mutation methods? No: the <code>POST</code> object belongs to the <a href="https://github.com/django/django/blob/master/dj...
26,699,669
0
What will get removed if i remove a pointer in c++ <p>If I remove a pointer to an object, what will be removed? Only the pointer or also the object which the pointer points to? For example:</p> <p>Assume I have a class with a variable</p> <pre><code>int *root </code></pre> <p>If I do the following in a method of that c...
10,056,284
0
<p>I would suggest using MVC Display/EditorTemplates rather than a helper in this context. With templates you get automatic collection support, and you can use a strongly typed model.</p> <p><a href="https://web.archive.org/web/20151112171922/http://blogs.msdn.com/b/nunos/archive/2010/02/08/quick-tips-about-asp-net-mv...
10,874,666
0
<p><code>preg_replace("|[^abcdef]|", '')</code>? (where abcdef are the characters to allow)</p>
1,732,216
0
<p>There are free tools available to look at the managed heap in .Net, using the <a href="http://www.stevestechspot.com/SOSEXANewDebuggingExtensionForManagedCode.aspx" rel="nofollow noreferrer">SOSEX</a> extensions to <a href="http://www.microsoft.com/whdc/devtools/debugging/default.mspx" rel="nofollow noreferrer">Win...
33,084,184
0
<p>You didn't provide example output or what it's used for but what I'd normally do is create a simple value object. We can also leverage Ruby's <code>Date</code> and <code>Range</code> objects to do most of the heavy lifting.</p> <pre class="lang-rb prettyprint-override"><code>require 'date' class DateRange def self....
11,772,716
0
<pre><code>var img = new Image (); img.onload = function () { $('body').css('background','url(image.png)'); }; img.src = src; </code></pre>
19,683,021
0
<p>The turbolinks gem caused the problem.</p> <p>Solved by following these tips here: <a href="http://reed.github.io/turbolinks-compatibility/twitter.html" rel="nofollow">http://reed.github.io/turbolinks-compatibility/twitter.html</a></p> <p><a href="http://reed.github.io/turbolinks-compatibility/facebook.html" rel="n...
3,225,534
0
Where do I start with reporting services in SQL Server 2008 R2 <p>I have installed Visual Web Developer Express 2010, and SQL Server 2008 R2 Express with advanced services.</p> <p>How can I write reports to use with reporting services?</p> <p>Do I need to install Visual Studio C# Express 2010 for instance?</p> <p>Thank...
30,274,264
0
<p>To prevent ctrl + x (Cut) from div you need to use following JQuery :</p> <pre><code>if (event.ctrlKey &amp;&amp; event.keyCode === 88) { return false; } </code></pre> <p>It will prevent to cut text from div.</p> <p>Check <a href="http://jsfiddle.net/wfae8hzv/20/" rel="nofollow">Fiddle Here.</a></p>
26,616,859
0
<blockquote> <p>so my question is, can I directly edit the string resources from the xml file?</p> </blockquote> <p>No, you can't change <code>resources</code> at runtime. But your code seems kind of goofy. This is all going to run when the <code>Activity</code> starts up. So, you can check the message then just set i...
34,711,569
0
node.js: Is it possible to pass jQuery code in server-side html response? <pre><code>var server = http.createServer(function (req, res) { if (req.method.toLowerCase() == 'get') { displayForm(res); } else if (req.method.toLowerCase() == 'post') { //processAllFieldsOfTheForm(req, res); processFormFieldsIndividual(req, re...
8,963,180
0
<p>You may be able to parse it from the <code>__FILE__</code> <a href="http://php.net/manual/en/language.constants.predefined.php">magic constant</a>. I don't have any Windows computer, but I guess it will be the first character. So this may work:</p> <pre><code>$drive = substr(__FILE__, 0, 1); </code></pre>
12,920,429
0
Anyone Have MediaPlayer Working with ParcelFileDescriptor and createPipe()? <p>Related to <a href="http://stackoverflow.com/questions/12894976/anyone-have-mediarecorder-working-with-parcelfiledescriptor-and-createpipe">my recent question on <code>MediaRecorder</code> and <code>createPipe()</code></a>, and a discussion ...
7,346,621
0
<p>No, it is not a good practice for large applications, especially not if your static variables are mutable, as they are then effectively global variables, a code smell which Object Oriented Programming was supposed to "solve".</p> <p>At the very least start by grouping your methods into smaller classes with associat...
3,653,698
0
<p>I kept this project as a bookmark a while ago : <a href="http://code.google.com/p/gaedjango-ratelimitcache/" rel="nofollow noreferrer">http://code.google.com/p/gaedjango-ratelimitcache/</a></p> <p>Not really an answer to your specific question but maybe it could help you get started.</p>
38,733,233
0
How to wait broadcast results with akka-stream? <p>I tried akka-stream 2.4.8 with the following sample code:</p> <pre><code>import scala.concurrent._ import scala.concurrent.duration._ import akka.actor.ActorSystem import akka.stream._ import akka.stream.scaladsl._ class AkkaStreamSample01 { def doit = { implicit val a...
39,278,406
0
Where do webpack assets go in an Angular 2 CLI project <p>Where should I place general, cross-component <code>.css</code>, <code>.scss</code>, <code>.svg</code>, <code>.gif</code>, etc. assets (e.g., theme resources) in an Angular CLI (webpack) project so both the development and production versions of my application w...
19,876,693
0
<p><em>(This was originally a comment)</em></p> <p>You seem to miss what the point of pseudo code is. Pseudo code is neither standardized nor somewhat defined. In general it is just a <em>code-like</em> representation of an algorithm, while maintaining a high level and readability. You can write pseudo code in whateve...
25,122,613
0
<p>You need to include the appropriate header for <a href="http://en.cppreference.com/w/cpp/algorithm/transform" rel="nofollow"><code>std::transform</code></a>:</p> <pre><code>#include &lt;algorithm&gt; </code></pre> <p>You should also avoid <code>using namespace std;</code> in the global namespace in headers, you pol...
38,456,604
0
How to update Android in-app billing to the latest version? <p>I am using in-app billing 3 in my apps. I want to update to in-app billing 5. How do I do that? I have searched without finding any info. Is the only thing I should do to update the IInAppBillingService.aidl file? No other files need to be updated?</p>
2,444,704
0
<p>The construct you are looking for is called <code>column_property</code>. You could use a secondary mapper to actually replace the amount column. Are you sure you are not making things too difficult for yourself by not just storing the negative values in the database directly or giving the "corrected" column a diff...
8,767,871
0
<p>You need to download the source packet of QT and compile it. It takes some time but is not really complicated. </p> <ul> <li>Download and unzip QT source</li> <li>Start a compiler shell (Visual Studio or mingw)</li> <li>Execute configure in the QT source directory - add a flag for static compile here</li> <li>execu...
18,036,788
0
<p>First of all per K&amp;R, the answer is yes.</p> <p>At the conceptual level an array name is a ptr, they are absolutely the same thing, CONCEPTUALLY.</p> <p>How a compiler implements an array is up to the compiler. This is the argument between those who say they are not the same thing and those who say they are.</p...
24,629,115
0
How do you hide an expanded tableviews label when it is expanded? - IOS <p>I would like to hide an expanded tableviews label, when the cell is expanded and hide a button when it is collapsed. I have my cell implementation in another class, with the property of the label and the button in the header. The problem is that...
15,224,268
0
<p>Is this:</p> <pre><code>&lt;configuration&gt; &lt;encoding&gt;UTF-8&lt;/encoding&gt; </code></pre> <p>definitely the correct character encoding for your script?</p>
10,796,671
0
<p>if anybody else (like me) wants to try to get some jdbc information and you are using hibernate 4.x, you might try it that way:</p> <pre class="lang-java prettyprint-override"><code>import java.sql.Connection; import java.sql.SQLException; import org.hibernate.jdbc.Work; public class ConnectionInfo implements Work ...
1,493,516
0
<p>I would use mocks, something like EasyMock, where you could mock the IOrderLogger, and then do something like this:</p> <pre><code>IOrderLogger log = EasyMock.createMock(IOrderLogger.class); log.Action(EasyMock.isA(LogAction.class)); EasyMock.expectLastCall(); </code></pre> <p>This assumes that Action() returns voi...
17,407,409
0
<p>This is the feature that lets you to auto-merge different Auth Providers into the same account in ServiceStack.</p>
997,954
0
<p>I'm not sure why you would want to use a hill-climbing algorithm, since Djikstra's algorithm is polynomial complexity O( | E | + | V | log | V | ) using Fibonacci queues: <a href="http://en.wikipedia.org/wiki/Dijkstra" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/Dijkstra</a>'s_algorithm</p> <p>If you're ...
40,839,019
0
<p>You can use <strong>svg</strong> in <strong>img</strong> tag and append via jquery like below snippet I hope helps and It is working fine for <strong>print</strong> on <strong>Chrome</strong> and <strong>FF</strong> browser. </p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babe...
20,732,858
0
JFrame simple moving oval moving game positioning fails? <p>I have a game start I've made, basically a oval, and I can move it anywhere with the keyboard key arrows.</p> <p>I dont want to allow it to exit the frame, so I check if X is less than 0, return if higher than width return, same for y.</p> <p>But it doesn't wo...
38,647,215
0
<pre><code>MyModel._meta.get_all_field_names() </code></pre> <p><a href="https://docs.djangoproject.com/en/1.9/ref/models/meta/" rel="nofollow">Django doc</a>.</p>
861,109
0
<p>Questionably useful Python hacks are my forte.</p> <pre><code>from types import * class Foo(object): def __init__(self): self.bar = methodize(bar, self) self.baz = 999 @classmethod def bar(cls, baz): return 2 * baz def methodize(func, instance): return MethodType(func, instance, instance.__class__) def bar(self): r...
14,920,406
0
<p>Heres a couple of better syntax options:</p> <pre><code>&lt;?php if(isset($_SESSION['guest2First'])){ $name = $_SESSION["guest2First"]. (isset($_SESSION["guest2Middle"])?' '.$_SESSION["guest2Middle"]:null). (isset($_SESSION["guest2Last"])?' '.$_SESSION["guest2Last"]:null); ?&gt; &lt;tr&gt; &lt;td&gt;&lt;input type=...
37,130,244
0
HtmlAgilityPack - How to get the tag by Id? <p>I have a task to do. I need to retrieve the a <code>tag</code> or <code>href</code> of a specific <code>id</code> (the <code>id</code> is based from the user input). Example I have a <code>html</code> like this </p> <pre><code>&lt;manifest&gt; &lt;item href="Text/Cover.xht...
38,865,180
0
<p>Excel evaluates both parts of an <code>OR</code> expression independent if the first part is true. So <code>A1&lt;0</code> and therefore the <code>OR</code> function result in an error if <code>A1</code> contains an error.</p> <p>You can try something like that:</p> <pre><code>IF(ISERROR(A1),"Y",IF(A1&lt;0,"Y","N")...
38,953,330
0
TeeChart for Xamarin.Forms with Windows 8 (WinRT) apps <p>We have a Xamarin.Forms app that also supports Windows 8/8.1 as a platform. Xamarin.Forms has support for WinRT and that's how it can be deployed to Windows 8/8.1.</p> <p>We are using TeeCharts for Xamarin.Forms however, it doesn't seem to support WinRT as a pla...
6,520,463
0
<p>You only need virtual functions if you've set up an inheritance chain, and you want to override the default implementation of a function defined in the base class in a derived class.</p> <p>The classic example is something as follows:</p> <pre><code>public class Animal { public virtual void Speak() { Console.WriteL...
11,430,967
0
Strange Javascript Feature: (5,2) == 2 <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/6927685/the-purpose-of-the-comma-operator-in-javascript-x-x1-x2-xn">The purpose of the comma operator in javascript (x, x1, x2, …, xn) </a> </p> </blockquote> <p>In Javascript <cod...
34,460,204
0
<pre><code>import re sample = open ('text_numbers.txt') total =0 dignum = 0 for line in sample: line = line.rstrip() dig= re.findall('[0-9]+', line) if len(dig) &gt;0: dignum += len(dig) linetotal= sum(map(int, dig)) total += linetotal print 'The number of digits are: ' print dignum print 'The sum is: ' print total pr...
17,019,288
0
<p>well for standard HTML such as <code>head</code>,<code>footer</code>,<code>sidebars</code> or whatever .. there is <a href="http://embeddedjs.com/examples/partials.html" rel="nofollow">Partials</a> the example explains everything ..</p>
7,291,047
0
Parsing Google Shopping Json Search Results <p>After a few weeks of trying numerous examples found here and it seems throughout the web, I'm stumped. I can retrieve the desired search results from Google Shopping just fine:</p> <pre><code>{ "items": [ { "product": { "title": "The Doctor's BrushPicks Toothpicks 250 Pack...
12,801,638
0
How to name a column while creating a data frame using a name stored in a variable? <p>Trying to create a data.frame like this:</p> <pre><code>a = "foo" bar = data.frame(a = 1:3) </code></pre> <p>But the name of the column is <code>a</code>, not <code>foo</code>:</p> <pre><code>&gt; bar a 1 1 2 2 3 3 </code></pre> <p>T...
6,257,465
0
<p>If your column is an <code>xml</code> typed column, you can use the <code>delete</code> method on the column to remove the <code>events</code> nodes. See <a href="http://msdn.microsoft.com/en-us/library/ms190254%28v=SQL.90%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms190254(v=SQL.90).aspx</a> f...
38,445,290
0
Copy exact error message from XCODE <p>I wonder How could I copy the exact error message on XCODE.</p> <p><img src="https://i.imgur.com/1A9JliR.png=300x" alt="inline" title="Title"></p> <p><img src="https://i.imgur.com/Zcnt4xC.png=300x" alt="inline" title="Title"></p> <p><img src="https://i.imgur.com/xWsSkQm.png=300x" ...
21,940,386
0
isotope masonry responsive layout not arranging <p>As you can see, the images are behaving rather weird, they do not arrange themselves until the browser width gets rather small. What am i doing wrong ? I notice as the window gets smaller, the items have overlapping dimnesions.</p> <p>HTML</p> <pre><code> &lt;div class...
38,052,792
0
<p>It depends on your CPU architecture how the communication happens, but it is usually via a special place in RAM, flash or the filesystem. No data structures are transferred, they would be meaningless to the kernel and the memory space will be different between the two. Uboot generally passes boot parameters like wh...
5,765,020
0
<p>Mocha is a traditional mocking library very much in the JMock mould. Stubba is a separate part of Mocha that allows mocking and stubbing of methods on real (non-mock) classes. It works by moving the method of interest to one side, adding a new stubbed version of the method which delegates to a traditional mock obje...
12,465,639
0
show progress bar when pushing using git <p>I'm trying to push a large file to a <code>git</code> repository using <code>git push -u origin master</code> but it is failing on the half way. It would be of great help if I can see when it fails. Is there a way to show something like a progress bar in <code>git push</code>...
40,320,668
0
<p>It's not possible to run a web server while your app is in the background (except for the first few minutes at most). See the "GCDWebServer &amp; Background Mode for iOS Apps" section in the GCDWebServer <code>README</code> file for the detailed information:</p> <blockquote> <p>Typically you must stop any network s...
14,770,375
0
CakePHP : paginate not working on search results <p>I have a method, that performs a search and sends the results to its view. The search results are available only on the first page of the pagination results. The subsequent paginated pages do not have data and have warnings/errors about invalid index/variables:</p> <p...
22,303,615
0
android - loading json in expandable list view with scroll <p>i have an application that download's and save the Json database to Storage .</p> <p>i should to view the Json objects in Expandable List View and i have a lot of theme so i must have a scroller too !</p> <p>i want to know how to parse the Json and load it i...
9,390,915
0
How to sort tab delimited out? <p>In linux(Ubuntu), one shell utility will output the following data</p> <pre><code>23827492 name_1 3984989229 name 2 8238937 another name </code></pre> <p>so there are 2 fields, number and name. What I need is to sort this output by the numbers in asc or desc in linux shell. What is the...
18,656,040
0
How to prevent compiler from optimizing a load to variable that is never used <p>Intro: Im trying to quick hack fix old code and use __try MSVC extension to check if some ptr points to some legit memory or if *ptr will cause memory violation(if so I drop processing of this ptr). So I wrote something like:</p> <pre><cod...
33,707,795
0
<p>First, classes, enums, and structs are terminated with ';' following the closing bracket (or scope). i.e.</p> <pre><code>struct St { .... };//&lt;--- end of scope terminator </code></pre> <p>Next, what exactly are you trying to do following this bit? I'm guessing you're trying to define cases of it for use, but you...
9,032,715
0
<p>Try <a href="http://php.net/utf8-decode" rel="nofollow"><code>utf8_decode()</code></a> instead.</p>
1,481,416
0
<p>The play button is the start debugging feature. </p> <p>Yes, Visual Studio will ask every project in the solution to build at that point. But note asking to build and actually building are different things. Asking to build merely says, about to do something build again if you would like. MsBuild will then do a bit ...
8,104,034
0
.htaccess - Virtual Directory for a single predefined file <p>How would be the .htaccess lines to make a Virtual Directory from a single php File?</p> <p>www.domain.de/file.php should go to www.domain.de/file/</p> <p>Not all php files, only a single predefined in this Case the file.php</p> <p>Thanks!</p>
15,766,402
0
Won't recall variable from within boolean expression <p>I'm having trouble finding what exactly java is having trouble with when recalling a variable. I'm creating a simple chatbot and this is what I have so far:</p> <pre><code>public class Chatbot { public static void main(String[] args) { String name = JOptionPane.sh...
23,416,033
0
<p>This seems to be more related to the way I was including Espresso than it is a Dagger issue... </p> <pre><code>androidTestCompile ('com.google.android.apps.common.testing:espresso:1.1' ){ exclude group: 'com.squareup.dagger' } </code></pre> <p>Switching to Jake Wharton's "double-espresso" made the problem go away.<...
28,758,654
0
<p>This is the <strong>correct way</strong> to use <code>$http</code> service and <strong>scope variables</strong>.</p> <pre><code>&lt;html ng-app="people"&gt; &lt;head&gt; &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; va...
1,748,008
0
<p>Yes, that's what affinity masks are for. However you need this very rarely. The only reasonable use case I can imagine is restricting the number of cores depending on the end-user license agreement.</p>
7,216,628
0
<p>You could use a non-correlated subquery to do the work for you:</p> <pre><code>UPDATE tbl_taxclasses c INNER JOIN ( SELECT COUNT(regionsid) AS n FROM tbl_taxclasses_regions GROUP BY classid ) r USING(classid) SET c.regionscount = r.n WHERE c.classid = 1 </code></pre>
27,595,996
0
Changing static content directory <p>I am trying to set the express.static path to something different based on a session variable. The relevant code is below.</p> <pre><code>app.use( '/', function(req, res, next ) { if ( req.session.loggedIn ) { console.log("loggedIn : " + req.session.loggedIn); app.use('/', express.s...
37,531,987
0
<p><strong>Django 1.9</strong> <code>settings.py</code>:</p> <pre><code>INTERNAL_IPS = ( '127.0.0.1', ) </code></pre> <p>Templates:</p> <pre><code>{% if debug %} </code></pre> <p><a href="https://docs.djangoproject.com/en/1.9/ref/settings/#std:setting-INTERNAL_IPS" rel="nofollow">https://docs.djangoproject.com/en/1.9/...
32,118,245
0
<p>Looks like it's searching for a oracle-specific library and you're using open jdk. Switching to Oracle jdk will probably fix your issue.</p> <p>Install Oracle jdk in your Jenkins server and point JAVA_HOME/PATH variables to Oracle jdk.</p>
35,259,544
0
QT5/QSql bindValue query doesn't work <p>I have a query made with QSql </p> <pre><code>query.prepare("SELECT id,title,content FROM posts ORDER BY :field :order LIMIT :limit OFFSET :offset"); query.bindValue(":field",QVariant(field)); query.bindValue(":order",order); query.bindValue(":limit",limit); query.bindValue(":of...
4,460,050
0
<p>Haskell, because once you've learned Haskell, you will love it. And then, you will be able to learn Common LISP. However, if your editor is Emacs, then go start with Lisp.</p>
35,434,134
0
<p>You can extract foder to local storage.</p> <p>Use Storage to take all files from extracted archive:</p> <pre><code>$files = Storage::allFiles($directory); </code></pre> <p>Afterthis upload to S3, like this</p> <pre><code> foreach($files as $file){ $s3-&gt;put($file); } </code></pre> <p>Sorry for code i wite to han...
39,850,264
0
<p>After gathering more information I came accross an interesting architecture (I have found the idea on reddit but could not retrieve the url).</p> <p>Your whole code should be sperated into independent apps (separation of concern) and you need to define 2 "project wide" apps (site and utils): </p> <ul> <li>the site ...
26,747,396
0
<p>You can use the <code>fileuploadprogressall</code> callback function and compare inside the loaded and total data:</p> <pre><code>$('#fileupload').fileupload({ ... }).bind('fileuploadprogressall', function (e, data) { if(data.loaded==data.total) { console.log("All photos have been done"); } }); </code></pre>
11,112,006
0
jQuery Form plugin - how to prevent double submission? <p>There are several threads on this here at SO but I didn't find one that deals specifically with the awesome <a href="http://jquery.malsup.com/form/" rel="nofollow">jQuery Form plugin</a> which I use extensively in my app.</p> <p>I want the user to be able to cli...
36,633,309
0
Error when using eval to execute aasm block <p>We put the whole <code>aasm</code> block in string and eval it in <code>payment_request</code> model. Here is the def:</p> <pre><code>class PaymentRequest &lt; :ActiveRecord::Base include AASM def self.load_wf_spec(wf_spec, wf_def_name) eval("aasm(:#{wf_def_name}) :column ...
4,245,046
0
Change background of title and header in pivot control <p>In my Phone 7 application, I'm using a pivot control. Now I'd like to change the background of its title and header area. How can I achieve this?</p> <p>Is there an overall template for the pivot control that can be customized?</p> <p>I've already tried to set t...
21,611,060
0
<p>You're declaring on the <code>attempt</code> varible inside the <code>Login_Click</code> event handler. Hence, each time the <code>Login_Click</code> event is raised, you are initializing it to 0.</p> <pre><code>Dim attempt As Integer = 0 </code></pre> <p>Try to move it to outer scope, for example make it a member ...
7,786,668
0
<p>To get a dynamic select from the appropriate table, you can use a dynamic SQL finder.</p> <p>In this example, we select from a table named 'albums', and fabricate a column 'name' to hold the values. These will be returned in the 'Album' model object. Change any of these names to suit your needs.</p> <pre><code>Albu...
17,917,378
0
<p>You are settiing it properly ,The problem is </p> <pre><code>[self.tableView reloadData]; </code></pre> <p>as the cell is reloaded it goes to default setting.Remove that line and the code will work fine.If you want to reload at htat time for some other purpose ,Manage the switch state by keeping it state saved in s...
35,176,703
0
<p>I have the same problem. The facebook pixel analytic page shows all traffic, regardless if they clicked an ad link or not. What are we doing wrong.?</p>