pid
int64
2.28k
41.1M
label
int64
0
1
text
stringlengths
1
28.3k
7,406,247
0
<p><code>Too much recursion</code> means that something is looping over and over again, possibly infinitely. The reason that's happening with your current code is because <code>&lt;a&gt;</code> is a parent of <code>&lt;img&gt;</code>, so any click event on <code>&lt;img&gt;</code> bubble up to the parent <code>&lt;a&g...
17,517,466
0
Visual Studio 2013 Preview Native C++ Edit and Continue <p>Has anyone been able to use <a href="http://msdn.microsoft.com/en-us/library/esaeyddf(v=vs.120).aspx" rel="nofollow">Edit and Continue</a> with Visual Studio 2013 Preview and a C++ native application (either 32 or 64 bit)?</p> <p>After making a simple console a...
41,041,344
0
Retrieve Google Analytics quotas consumption via API <p>i want to be able to fetch all the quotas status related to the google analytics API consumption. One part of it seems to be available via IAM:</p> <p><a href="https://i.stack.imgur.com/7TGr2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7TGr2...
10,820,054
0
<p>I found the answer -</p> <pre><code>xrLabelGoal.Text = ((DataRowView)GetCurrentRow()).Row["goalnumber"].ToString(); </code></pre> <p>Turns out I was missing the System.Data which allowed me to use the DataRowView. This fixed it. </p>
36,033,771
0
Adaptive size classes weired issue <p>My app is universal. I have different constraints for iphone and ipad. Using adaptive size classes, Particularly i am assigning label leading margin to superview = 390, for ipad only. As you can see in attached image. <a href="https://i.stack.imgur.com/J2mcg.png" rel="nofollow nore...
10,634,536
0
<p>Here is the code I'm using. Change BUFFER_SIZE for your needs.</p> <pre><code>import java.io.BufferedOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; public class ZipUti...
18,169,735
0
<p>The input method framework is based upon the idea of an input connection. The framework instantiates one between the keyboard and the EditText. If you want to accept text from the keyboard you need to implement that side of the interface yourself, then get the framework to use your interface as the other half of th...
6,394,860
0
<p>@Maz - thank you for that. I'm learning at the moment and need to look at <code>service_set</code>.</p> <p>@arustgi - that worked perfectly. For the benefit of fellow novices stumbling over this, I pass in <code>'queryset': Service.objects.all()</code> and use:</p> <pre><code> {% regroup object_list by area as area...
8,835,956
0
Make CVDisplayLink + Automatic Reference Counting play well together <p>I recently switched from using NSTimer to CVDisplayLink to redraw my OpenGL animation, but i've got a little problem making it work with ARC switched on:</p> <pre><code>/* * This is the renderer output callback function. */ static CVReturn displayL...
27,251,414
0
java.util.concurrent.TimeoutException: Request timed out to in gatling <p>Hi i'm running concurrent users 200 over 200 seconds, when I execute same script after 2-3 sets I'm getting this error do i need to do some settings in gatling for example shareConnections in conf file or its because server is not able to respond...
38,972,851
0
<p>If you are using a version of .net less than 4.5, manual collection may be inevitable (especially if you are dealing with many 'large objects'). </p> <p>this link describes why:</p> <p><a href="https://blogs.msdn.microsoft.com/dotnet/2011/10/03/large-object-heap-improvements-in-net-4-5/" rel="nofollow">https://blog...
12,789,997
0
<pre><code>set.intersection(*map(set,d3)) </code></pre> <p><em>Will</em> actually work, though because <code>d3</code> already contains sets you can just do:</p> <pre><code>set.intersection(*d3) </code></pre> <p>And, in fact, only the first one needs to be a <code>set</code> - the others can be any iterable, and <code...
17,611,242
0
<p>First of all, C++ is not designed to work like that. So it is not a surprise that this is happening.</p> <p>But, since you're using Visual Studio, you could take advantage of <a href="http://en.wikipedia.org/wiki/C%2B%2B/CX#Partial_classes" rel="nofollow">partial classes</a>. Unfortunately, it seems this characteri...
20,594,029
1
How do you order what websites reply in Skype4Py? <p>I use Skype4Py for my Skype Bot I've been working on. <br> I was wondering how I could order what the APIs respond.<br> For example, if I wanted to get the weather, I'd type !weather<br> and it would respond with: </p> <blockquote> <p>Gathering weather information. P...
27,324,005
0
<p>The jar may be in your deployed folder, but is the jar (or your deployed folder with a wildcard) in the CLASSPATH?</p>
36,256,638
0
<p>First you read a byte from <code>pFile1</code> with <code>fgetc()</code> so the file pointer has moved one step ahead, then you do a <code>fread()</code> so the first byte will never land in <code>buffer</code></p> <pre><code> for(counter=0; counter&lt;fileLen; counter++) { fputc(fgetc(pFile1),pFile2); ch = fread(b...
12,987,229
0
<p>Yes <a href="http://docs.python.org/library/stdtypes.html#dict.get" rel="nofollow">dict.get</a> is the correct (or at least, the simplest) way:</p> <pre><code>sorted(trial_list, key=trial_dict.get) </code></pre> <p>As Mark Amery commented, the equivalent explicit lambda:</p> <pre><code>sorted(trial_list, key=lambda...
27,912,810
0
Change turtle size keeping lower point position constant <p>I have distributed turtles on the world having size <code>x</code> and I wish to increase their size to <code>y</code> but the I want to keep their location of their lower further point same (Check figure below). How can one accomplish this? </p> <p>EDIT: I wi...
1,481,039
0
Show certain InfoWindow in Google Map API V3 <p>I wrote the following code to display markers. There are 2 buttons which show Next or Previous Infowindow for markers. But problem is that InfoWindows are not shown using google.maps.event.trigger Can someone help me with this problem. Thank you. Here is code:</p> <pre><c...
35,069,505
0
<p>If you want to test just the logic (and not that <code>date</code> is working correctly), then allow your script to accept <code>CUR_DAY</code> and <code>CUR_HOUR</code> as arguments or via the environment, instead of always running <code>date</code>.</p> <p>Via the environment (<code>CUR_DAY=9 CUR_HOUR=22 myscript...
972,282
0
<p><strong>Regarding #9:</strong></p> <p>When you provide a context to your selector queries you limit the size of the tree being traversed to find the elements matching your selector, especially if you're using selectors that use tag names like: $('div > span').</p> <p>Performance depends on the type of selector and ...
6,048,553
0
<p>Is your project configured as a console application? It needs to be built with different switches in order to set the flags in the exe file so that the OS loader will know that it needs to create a console window for the process. GUI apps don't set that flag, and don't get a console window.</p> <p>In VS2010, right ...
12,453,586
0
what is the usage of HTML5 figure with img <p>Is there any specific advantage/usage of using HTML5 <a href="https://developer.mozilla.org/en-US/docs/HTML/Element/figure"><code>&lt;figure&gt;</code></a> over <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img"><code>&lt;img&gt;</code></a>?</p> <p>I th...
29,751,046
0
Is it possible to apply DDD with generic classes and dynamic queries retrieval? <p>I´m wondering if it´s possible to use DDD without using EF's stuff, cause in my project the classes are generic complex types with generic inheritance that may vary from time to time, also the DB tables and fields may vary from one clien...
19,421,659
0
VS 2012 Plugin to make working with Classic ASP Easier <p>I am currently working with a Classic ASP project that grabs some data from the database, creates a bunch of HTML and embeds the data into it, then emails that to people.</p> <p>I want to know where this HTML body is being generated (company wants to make a chan...
30,710,709
0
<p>Use the <code>ng-click</code> directive:</p> <pre><code>&lt;div class="item" ng-click="clicked(d)" ng-class="{ active: d.selected }"&gt; &lt;h3 class="spaceWrap"&gt;&lt;b&gt;{{d.Name}}&lt;/b&gt;&lt;/h3&gt; &lt;/div&gt; </code></pre> <p>controller:</p> <pre><code>var selected = []; $scope.clicked = function (member)...
14,626,462
0
Highchart renderer path issue in IE8 <p>I have been using </p> <pre><code>chart.renderer.path(['M', 12, 0, 'L', 6, 12, 'L', 18, 12, 'Z']).attr({ 'stroke-width' : 2, 'fill' : 'black', 'transform' : "translate(" + x + "," + y + ")" }).add(); </code></pre> <p>to draw triangle path over the chart and move to require positi...
1,935,509
0
How to set the message of the NotEmpty validator on a Zend_Form_Element? <p>I have a form element that I'm setting as required:</p> <pre><code>$this-&gt;addElement('text', 'email', array( 'label' =&gt; 'Email address:', 'required' =&gt; true )); </code></pre> <p>Since I'm setting required to true, it makes sure that it...
36,555,645
0
The most correct implementation with regards to OOP design? <p>Right now I have a subclass of <code>UICollectionViewCell</code> called <code>MyCollectionViewCell</code> and this class has a few <code>UITextViews</code> and as a result implements its own <code>UITextFieldDelegate</code> methods. I also have a subclass o...
14,386,487
0
Bootstrap progress bar using $.get <p>I realize there are a good number of progress bar related questions already present on SO. I browsed through many of them and was unable to get things working.</p> <p>Simply put, I am developing a page in JSP and I want to use an animated progress bar within bootstrap to display wh...
37,204,549
0
<p>it's working properly here. Make sure you're using returns inside a function.</p> <p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>function test(a, b){ var dateFrom = Date.parse(a); var dateTo = Date.parse(b); if ( d...
30,522,654
0
<p>First <a href="http://www.1001freefonts.com/" rel="nofollow">download</a> the .ttf file of the font you need (arial.ttf). Place it in the assets folder(Inside assest folder create new folder named "fonts" and place it inside it). If "txtyour" is the textvies you want to apply the font , use the following piece of c...
23,019,653
0
<p>Thanks for responding Ali. I figured it out. Here is what I am doing: </p> <p>Sender: I am sending the ID as the "contentId" (instead of a video url) in the loadMedia method.</p> <p>Receiver: I added the ansynchronous call to the beginning of the "onLoad" event and then overwrite the data['media']['contentId'] valu...
3,920,557
0
<p>Look at <a href="http://msdn.microsoft.com/en-us/library/ms536914%28v=vs.85%29.aspx" rel="nofollow"><code>oncontextmenu()</code></a>.</p> <p>Careful though, users expect the default when they right click. It may annoy some power users.</p> <p><a href="http://luke.breuer.com/tutorial/javascript-context-menu-tutorial...
13,567,122
0
How to parse text in Groovy <p>I need to parse a text (output from a svn command) in order to retrieve a number (svn revision). This is my code. Note that I need to retrieve all the output stream as a text to do other operations.</p> <pre><code>def proc = cmdLine.execute() // Call *execute* on the strin proc.waitFor() ...
11,809,126
1
Cannot determine vowels from consonants <p>With the code below, no matter what the first letter of the input is, it is always determined as a vowel:</p> <pre><code>original = raw_input("Please type in a word: ") firstLetter = original[0] print firstLetter if firstLetter == "a" or "e" or "i" or "o" or "u": print "vowel"...
26,009,819
0
<p>Qt does not include a compiler. On Windows you're probably either compiling with mingw or Visual C++. Either way, the issue is that you're calling a function that expects a wide character string but you're trying to hand it an 8-bit character string.</p> <p>For compatibility reasons, <a href="http://msdn.microsoft....
27,584,059
0
<p>Update:</p> <p>Use the <a href="http://api.jquery.com/replacewith/" rel="nofollow">replaceWith</a> jquery for this, for example:</p> <pre><code>&lt;!doctype html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;title&gt;find demo&lt;/title&gt; &lt;script src="//code.jquery.com/jquery-1.10.2....
39,814,785
0
Acknowledgements in socket.io when using mongoose <p>I use <code>socket.io</code> to communicate between server and client.</p> <p>On the server, I have</p> <pre><code>socket.on('new object', (id, object) =&gt; { Model.findByIdAndUpdate(id, { $addToSet: { objects: object } }, { new: true }).then(model =&gt; { io.socket...
28,067,925
0
<p>You could do something like this:</p> <pre><code>Dim sLowerCase As String = "qwertyuiopasdfghjklzxcvbnm" Dim sUpperCase As String = "MNBVCXZLKJHGFDSAPOIUYTREWQ" Dim sNumbers As String = "1234567890" Dim x = New Random(Now.GetHashCode) Dim y = {sLowerCase, sUpperCase, sNumbers} Dim z = y(x.Next(0, y.Length)) Debug.P...
23,827,108
0
SQL Server transactional replication performance <p>I have an issue with SQL Server transactional replication performance. The published articles are on a database which is being used quite heavily however i am not convinced the replication is should be going this slow and I could use some advice on interpreting the in...
20,097,995
0
Referencing Databases In SQL 2008 Mirrored Reporting <p>I have 2 databases.</p> <p>1 is a mirror of the other, <strong>EXCEPT</strong>, 1 has a table called <strong>DOG</strong> and the other has the same table but it is called <strong>DOG2</strong>.</p> <p>I have an ssrs report that references DOG..DOGID. </p> <p>Now ...
9,330,629
0
<p>I have same problem I solved so:</p> <p>first create a class KeyBoardManager:</p> <pre><code>import android.content.Context; import android.os.Handler; import android.view.inputmethod.InputMethodManager; public class KeyBoardManager { public KeyBoardManager(Context context) { final Handler handler = new Handler(); ...
7,694,627
0
<p>this should explain it:</p> <p><a href="http://mobile.tutsplus.com/tutorials/android/android-application-preferences/" rel="nofollow">http://mobile.tutsplus.com/tutorials/android/android-application-preferences/</a></p>
28,868,396
0
<p>You need to use a string rather than a variable:</p> <pre><code>if user_seating == 'economy': </code></pre> <p>The way you have it, Python is looking for an actual variable named <code>economy</code> declared in your code (which there isn't as the <code>NameError</code> tells you).</p>
16,830,269
0
<pre><code>// You may use FormClosing Event of Form private void yourForm_FormClosing(object sender, FormClosingEventArgs e) { if (MessageBox.Show("Want to exit from Application ?", MessageBoxButtons.YesNo) == DialogResult.Yes) { Environment.Exit(0); } else { // your Code for Changes or anything you want to allow user...
20,903,795
0
<p>I think the basic recipe to do this without tabindex (why do you want to do this btw?) would be something like:</p> <pre><code>$(document).on('keypress',function(e) { var keyCode = e.keyCode || e.which; if (keyCode == 9) { //if the key pressed was 'tab'... e.preventDefault(); //put code here to focus on the next ta...
14,001,367
0
<p>What you might be seeing is that until the alert box is dismissed, the code afterwards is not executed. The alert command is a blocking one.</p> <p>Perhaps you can use <code>console.log()</code> for debugging purposes of this feature. This will not block your code and it will be executed on the <code>keydown</code>...
3,269,538
0
<p>I think it will be very useful to you to look at the code of the validator of <a href="http://trac.symfony-project.org/browser/plugins/sfDoctrineGuardPlugin/trunk/lib/validator/sfGuardValidatorUser.class.php" rel="nofollow noreferrer">sfDoctrineGuardPlugin</a>. They create that post validator, and <a href="http://t...
28,971,935
0
<p>The only version of OneNote that is available for Mac OSX is available through the app store.</p> <p>There is no version of OneNote 2010 that works on Mac.</p>
5,063,262
0
<p>Sounds like your rendering thread is just sat there waiting for the update thread to finish what its doing which causes the "jitter". Perhaps put in some code that logs how long a thread has to wait for before being allowed access to the other thread to find out if this really is the issue.</p>
20,621,434
0
<p>Try the jQuery function <code>val()</code> instead of the non-existant property <code>.value</code>:</p> <pre><code>$('#postcode_entry').val() </code></pre>
21,289,705
0
<p>You do not need the <code>'</code> surrounding the <code>?</code>'s.</p> <pre><code>PreparedStatement st = connection.prepareStatement("INSERT INTO Members VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?"); </code></pre> <p><code>BUT</code> the real problem here is you double single quoted one of the <code>?</code> t...
35,583,765
0
<p>You could possibly INNER JOIN the two result sets</p> <pre><code>select from test1 AS T1 INNER JOIN (select * from test1 where head_Id_Head = 5 and detail_Id_Detail = 4) AS T2 ON T2.company_Id_Company = T1.company_Id_Company where T1.head_Id_Head = 1 and T1.detail_Id_Detail = 7 </code></pre> <p>Or even simpler</p> ...
26,270,537
0
<p>Your id is null when you submit the form that's why you are getting this error.</p> <p>Either specify the the id parameter nullable as you have done in the get method or </p> <p>store the id in a hidden field to pass it automatically with the model like this</p> <pre><code>@HTML.HiddenFor(Model.id) </code></pre> <p...
3,537,191
0
<p>Dependency Injection implies you get properly initialized references appearing "by magic".</p> <p>You call the setRequest() method with the request object, but DI frequently also allows for setting the fields without invoking methods.</p> <p>Guice does not as such require a container, but uses class loader magic st...
24,914,251
0
how can i detect if JS parameters have extra text? <p>If I have a function with parameters (or argument) like this:</p> <pre><code>check('red', 'blue', 'arial') </code></pre> <p>What i would like to know is can you have text like this:</p> <pre><code>check(background:'red', color:'blue', font:'arial') </code></pre> <p>...
7,301,549
0
<p>The browser <em>sends</em> the value of radio buttons only when they are checked.</p> <p>Also, each radio button must have the same name (if you want to user to be able to check only one of them). Only the value changes:</p> <pre><code>print '&lt;input type=checkbox checked value="'.htmlspecialchars($element).'" na...
40,723,751
0
Why and I getting: "Invalid regular expression. Uncaught SyntaxError. Invalid escape."? <p>Im trying to create an html input tag that accepts only numbers entered in 1 of 2 formats, and reject all other input. </p> <p>I want to accept numbers in these formats only, including requiring the dashes:</p> <pre><code>1234-12...
27,493,621
0
<p>You've reached the end of the file. You should be able to do this to go back to the beginning:</p> <pre><code>searchFile.seek(0) </code></pre>
35,250,889
1
Python uiautomator doesn't works on MacOS <p>I wanna use uiautomator on Python to test some android apps. </p> <p>When I run this single code:</p> <pre><code>from uiautomator import device as d d.screen.on() </code></pre> <p>that show me the error below:</p> <pre><code>Traceback (most recent call last): File "cerrar.py...
10,918,758
0
<p>I assume this causes the problems in your code within the onItemSelected()-method:</p> <pre><code>player1.findViewById(R.id.editTextPlayer1); player2.findViewById(R.id.editTextPlayer2); //... </code></pre> <p>The method findViewById() returns a sub view of another view or of the main view of the activity. In your c...
11,119,015
0
Rearrange table row in basis of class using javascript <p>For example, I have this code:</p> <pre><code>&lt;table&gt; &lt;tr&gt; &lt;td class="last"&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="last"&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="another"&gt;&lt;/...
27,707,260
0
<p>To create just the strings you need, you could also do:</p> <pre><code> x &lt;- rep(seq(2002, 2014, 1), 4) x &lt;- sort(x) y &lt;- rep(seq(1, 4, 1), 12) rows &lt;- paste(x, y, sep = ".") &gt; rows [1] "2002.1" "2002.2" "2002.3" "2002.4" "2003.1" "2003.2" "2003.3" "2003.4" [9] "2004.1" "2004.2" "2004.3" "2004.4" "20...
16,310,139
0
<pre><code>CREATE LOGIN [IIS APPPOOL\MyAppPool] FROM WINDOWS; CREATE USER MyAppPoolUser FOR LOGIN [IIS APPPOOL\MyAppPool]; </code></pre>
24,392,234
0
Memory leak when manually compiling directives in Angular <p>I'm trying to manually compile a directive and add it to the DOM via JQuery. The directive is a simple div with an ngClick handler. No JQuery plugins are used in the directive itself (which seems to be the focus of many of the other memory leak threads).</p> ...
34,991,354
0
<p>Django's <a href="https://docs.djangoproject.com/en/1.9/topics/auth/default/#django.contrib.auth.authenticate" rel="nofollow"><code>authenticate</code></a> method checks against a <code>username</code>, not an email.</p> <blockquote> <p>It takes credentials in the form of keyword arguments, for the default configur...
16,740,797
0
<p>In case (a), What do you expect to happen if the pattern occurs within the 10 lines?</p> <p>Anyway, here are some awk scripts which should work (untested, though; I don't have Solaris):</p> <pre><code># pattern plus 10 lines awk 'n{--n;print}/PATTERN/{if(n==0)print;n=10}' # between two patterns awk '/PATTERN1/,/PAT...
40,997,469
0
<p>Check again into your <code>package.json</code> file their is available <code>node-gyp</code> module or not with version ID if there is not available then add and again install from <code>npm</code>.</p>
38,342,349
0
<p>Have you looked into the Comparable interface? You will need to wrap the Map&lt;String,String> inside a new class that has a comparable() method in order to make it sortable. More info here: <a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_comparable.htm" rel="nofollow">https:/...
9,205,542
0
<p>After you initialize the PDO object try setting the <a href="http://php.net/manual/en/pdo.setattribute.php" rel="nofollow">error mode</a> higher.</p> <p><code>$db-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);</code></p> <p>The default is <code>PDO::ERRMODE_SILENT</code> which will output no warnings/...
27,286,288
0
UINavigationBar barButtonItem change back button image and title <p>Is it possible to change the back button on a UINavigationBar and change the title?</p> <p>When I try to set the customView property, I get an image right next to the default button.</p> <p>I use this code</p> <pre><code>self.navigationItem.backBarButt...
3,528,311
0
Simple Transactions <p>I have 2 linq 2 SQL statements I'd like to be in a transaction (the SQL server is remote, outside firewalls etc) all other communication works but when I wrap these 2 statements in a TransactionScope() I begin having to configure MSDTC which we did, but then there are firewall issues (I think) is...
15,670,439
0
<p>I think,better option is <strong>Universal App</strong>.</p> <blockquote> <p>The app is large and contains a lot of images. The main drawback of a universal app is that I'm capped at 50MB over-air download, and that the single binary means iPhones get all the iPad images and vice versa.</p> </blockquote> <p>Yes. Th...
30,518,201
0
No space between tabpanel and a form element <p>I have a tabPanel where I put a form. There is no space between the tabPanel and the first element of the form. Is there a class in tbs to fix that?</p> <pre><code>&lt;div class="row"&gt; &lt;div class="span12"&gt; &lt;ul class="nav nav-tabs" role="tablist"&gt; &lt;li rol...
23,020,697
0
<p>From the Flask <code>Request</code> class documentation:</p> <blockquote> <p><strong>json</strong></p> <p>If the mimetype is application/json this will contain the parsed JSON data. Otherwise this will be None.</p> <p>The get_json() method should be used instead.</p> </blockquote> <p>I think your problem appears be...
32,275,703
0
<p>Personally I would have a count that tracks the current 'click' that the user is on, like so:</p> <pre><code>protected void btnPrevious_Click1(object sender, EventArgs e) { if(stepCount == 0) //Ensuring that we never get into minus numbers stepCount = 0; stepCount--; DAL.TicketsDataSetTableAdapters.TicketDetailsTab...
6,634,493
0
Can I save flash game and play it without being connected to the Internet? <p>Not sure if this question belongs on SO but ...</p> <p>Can I play <a href="http://www.flashtowerdefence.com/flash/145/Desktop_Tower_Defense_1_9.html" rel="nofollow">Desktop Tower Defense</a> without being connected to the Internet?</p> <p>I c...
28,623,723
0
<p>If you just want to reverse string, then use:</p> <pre><code>DECLARE @string VARCHAR(10) = 'mystring' SELECT REVERSE(@string) </code></pre>
28,869,430
0
<p>Here's my solution:</p> <pre><code>var items = [ { id: 1, name: 'bill' }, { id: 2, name: 'sam' }, { id: 3, name: 'mary' }, { id: 4, name: 'jane' } ]; var order = [ { id: 1, sortindex: 4 }, { id: 2, sortindex: 2 }, { id: 3, sortindex: 1 }, { id: 4, sortindex: 3 } ]; _(items) .indexBy('id') .at(_.pluck(_.sortBy(order...
35,066,320
0
What is groupId and artifactId of jar built by Intellij Idea? <p>I built <code>jar</code> of project in <code>Intellij Idea</code>(<code>Build</code>-<code>Build Artifact</code>), and I'm trying to add it to another project that uses <code>Maven</code>. I have to add it to <code>pom.xml</code>, but I need to know group...
32,377,786
0
<p>If you're gathering facts, you can access hostvars via the normal jinja2 + variable lookup:</p> <p>e.g. </p> <pre><code>- hosts: serverA.example.org gather_facts: True ... tasks: - set_fact: taco_tuesday: False </code></pre> <p>and then, if this has run, on another host:</p> <pre><code>- hosts: serverB.example.org ...
35,820,286
0
<p>I think the issue is about images color profiling which can lead to different rendering on different browsers.</p> <p>You can read more about it here: <a href="https://css-tricks.com/color-rendering-difference-firefox-vs-safari/" rel="nofollow">https://css-tricks.com/color-rendering-difference-firefox-vs-safari/</a...
34,935,044
0
<p>Your solution will almost definitely end up involving <code>ssh</code> in some capacity.</p> <p>You may want something to help manage the execution of commands on multiple servers; <a href="http://www.ansible.com/" rel="nofollow">ansible</a> is a great choice for something like this.</p> <p>For example, if I want t...
25,741,535
0
<p>Single product is displayed from wp-content\plugins\woocommerce\templates\single-product.php </p> <p>This file (wp-content\plugins\woocommerce\templates\content-single-product.php) is called from single-product.php for adding content and add-to-cart button on single product page. </p>
34,795,069
0
<p>This is <strong>placement new</strong> syntax. It constructs an object of type <code>FBatchedLine</code> at the memory pointed to by <code>BatchedLines</code> with the constructor arguments <code>(Start, End, Color, LifeTime, Thickness, DepthPriority)</code>. After the call, <code>BatchedLines</code> can be used to...
2,248,138
0
How to expose xaml properties? <p>I created a ComboBox subclass and added my functionality.</p> <p>Now I want to expose external properties of the TextBox for example:</p> <pre><code>&lt;a:MyComboBox SpellCheck.IsEnabled="True" TextBox.SelectedText="{Binding X}" /&gt; </code></pre> <p>Is this possible, I maybe didn't c...
3,261,708
0
Vim (MacVim) backword key problem under insert mode <p>Look, this is driving me crazy. Under insert mode, when I select a word with mouse (vim shows: --insert(visual)..), and when I press backword key, the cursor would always delete the selected word AND move to one extra word backword. e.g. "a fox jumps". When I tried...
11,157,108
1
OpenCL delete data from RAM <p>I'm coping data in python using OpenCL onto my graphic card. There I've a kernel processing the data with n threads. After this step I copy the result back to python and in a new kernel. (The data is very big 900MB and the result is 100MB) With the result I need to calculate triangles whi...
4,203,615
0
<p>While this is hardly an easy solution to implement quickly, I find that running Netbeans 6.9 on a multi-core processor works. While it might ramp up on one core, the other (3 in my case) are still free for other tasks. Given that you're on a Mac, YMMV. </p> <p>Of course, it would be better to avoid the CPU hog in t...
6,893,005
0
<p>Think outside the box. Which application of the ones you use regularly does this? A debugger of course! But, how can you achieve such a behavior, to emulate a low cpu?</p> <p>The secret to your question is <code>asm _int 3</code>. This is the assembly "pause me" command that is send from the attached debugger to th...
2,286,013
0
<pre><code>$('#myElement').is(':visible'); </code></pre> <p>Will return <code>true</code> or <code>false</code></p>
18,686,413
0
Get data from Cursor: null pointer exception <p>I've this two classes:</p> <pre><code>public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); DatabaseHelper helper = new DatabaseHelper(this); ...
16,591,239
0
Is this the true difference between using PhoneGap and simply opening a WebView in my application? <p>I was lately assigned to create a PhoneGap application for 4 different mobile platforms. After playing around with PhoneGap for a while , i decided it wasnt good to serve my purposes as there were no push-notification ...
30,253,046
0
<p>There are a few opportunities for speedup, but my first concern is <em>vector</em>. Where is it initialized? In the code posted, it gets n^2 entries and sorted n times! That seems unintentional. Should it be cleared? Should final be outside the loop?</p> <p>final=sorted(vector, key=lambda vector: vector[2],reverse ...
37,939,273
0
<p>According to the <a href="http://www-12.lotus.com/ldd/doc/lotusscript/lotusscript.nsf/1efb1287fc7c27388525642e0074f2b6/3c567087099f80948525642e0075cddc?OpenDocument" rel="nofollow">Lotus Note documentation</a>, <code>GetItemValue()</code> returns either a String, an array of String, or an array of Doubles, none of ...
11,900,001
0
Default parameter template vs variadic template : what is the last template parameter? <p>I'm a little confused because both a default parameter template and a variadic template parameter have to be the last parameter of a template. So what is the good official syntax for my function ?</p> <pre><code>template&lt;typena...
4,531,499
0
<p>Might want to tell "left" what measure your statement is in (px, %, etc)</p>
17,884,176
0
Apache: Could not initialize random number generator <p>I'm really frustrated, my apache server doesn't start, my error.log is this:</p> <pre><code>[Fri Jul 26 16:26:20.211050 2013] [core:notice] [pid 32240:tid 268] AH00094: Command line: 'c:\\users\\mrvisiont\\desktop\\xampp\\apache\\bin\\httpd.exe -d C:/Users/MrViSiO...
28,853,600
0
<p>You can do this without regex using <code>awk</code> (on this simple example):</p> <pre><code>awk -F":|/" '{print $2}' file 192.1.1.128 192.1.1.11 </code></pre> <hr> <p>To test if its IP contains three <code>.</code>:</p> <pre><code>awk -F":|/" '{n=split($2,a,".");if (n=4) print $2}' file 192.1.1.128 192.1.1.11 </c...