pid
int64
2.28k
41.1M
label
int64
0
1
text
stringlengths
1
28.3k
549,202
0
<p>osascript -e "tell application \"Terminal\" to set background color of window 1 to {0,45000,0,0}"</p> <p><a href="http://stackoverflow.com/questions/157959/how-do-i-make-the-apple-terminal-window-auto-change-colour-scheme-when-i-ssh-to-a">(Can't take the credit)</a> </p>
21,462,564
0
<p>Hi in the Facebook SDK for the Android it is only possible to Share something not to Like. if you want to Like page you should use WebView and use Iframe in it to display like button.</p>
10,371,662
0
<p>A generic approach:</p> <pre><code>:%s/\(&lt;string name="\)\(\u\)\([^" ]\+\) \([^" ]\+\)/\1\l\2\e\3_\4/ </code></pre> <p>This replaces every string @name that </p> <ul> <li>starts with an upper case character (<code>\u</code>) and</li> <li>consists of two space-separated words (<code>\([^" ]\+\) \([^" ]\+\)</code>...
20,047,697
0
<p>Problem solved! The issue is never about log4j. It is because WebApplicationInitializer need servlet 3.1 support which is not enabled as default. We have enabled following in the start.ini</p> <pre><code># =========================================================== # Enable additional webapp environment configurato...
20,572,875
0
DataGridView CellContentClick event missed if SelectionChanged event handled? <p>I'm using C++/CLI .NET 4.5 on Win7. I develop a control with a DataGridView. The cells are not editable by the user neither it is possible to add rows manually.</p> <p>I need to catch/handle the <em>SelectionChanged</em> event, so I added ...
37,415,120
0
Okay to use underscores in file and folder names in PHP? <p>For example using <code>&lt;?php include '_blogroll.php'; ?&gt;</code> instead of blogroll.php ? It helps me organize the partial files in cPanel (_header.php, _footer.php, etc.)</p>
11,725,338
0
<p>The my.cnf should not be world-writable (i.e. **6 or **7) permissions.</p> <p>It is a security vulnerability. MySQL will ignore files with this this permission setting.</p>
36,806,353
0
Can object method call be done simultaneously with object instantiation? <p>I'm trying to use java class <code>BitSet</code> as a field for a customized class. And I want the class to use a default BitSet with all bits set.</p> <pre><code>import java.util.BitSet; public class MyClass { private BitSet mask; public MyCla...
16,168,794
0
EF classes don't show up in when adding new API Controller <p>This question has been asked a few times in SO but nothing helped so far in my case.</p> <p>To an existing MVC project I added a model generated from a database (using database first). Now I would like to add a new API controller. However, neither my new mod...
3,320,676
0
<p>I found the answer. I finally broke down and downloaded the ROM and extracted the bitmaps with NAPIT. (btw: staring at extracted ROM bitmaps is really bloody hard on your eyes!)</p> <p>I matched a few bitmaps and end-results <a href="http://img405.imageshack.us/img405/9396/finalfantasy2.gif" rel="nofollow noreferre...
33,494,433
0
specs2 - how to use the same variable inside around and inside the test itself? <p>I am using specs2 as my test framework. I want to generate a uniq key that will be available in the test itself.</p> <pre><code>def around[R: AsResult](r: =&gt; R): Result = { val uniqueToken = before() try AsResult(r)(uniqueToken) final...
20,855,152
0
<p>First get the text length by </p> <pre><code>var get = $("#value").val().length; </code></pre> <p>Then get the max size means width of button before this set a fixed width to button</p> <pre><code>maxScale = $("#value").width(); </code></pre> <p>then just reduce the font size by</p> <p>by comparing the both with if...
1,897,907
0
<p>The Skyhook system seems to work only for mobile devices. It uses either GPS (from the device's own GPS software), knowledge of the location of the WiFi access point in use, or triangulation from the cell towers that are in use.</p> <p>Details are <a href="http://www.skyhookwireless.com/howitworks/" rel="nofollow n...
25,362,820
0
Get build requestor using Groovy script (Jenkins / email-ext) <p>I want to get the username and/or email address of the build requestor in a post-build script.</p> <p><em>Sidenote: I want the requestor so I can set the email sender of the post-build email notification dynamically in the email-ext plugin's pre-send scri...
30,929,519
0
Android: How to find width and height of screen? <p>I am trying to find the width and height of the screen but none of the ways I have tried will work in the class I created, my code is below. </p> <p>Does anyone know how to find it? I cannot use the way I am trying below because .getWidth() is deprecated?</p> <pre><co...
36,742,234
0
<p>The error that you showed is because Twig is trying to execute the <code>getLastname()</code> method in your object and it's not defined.</p> <p>The solution is the one provided by @qooplmao in a previous comment and use the <a href="http://twig.sensiolabs.org/doc/functions/attribute.html" rel="nofollow">attribute(...
22,236,706
0
<p>I figured I'd elaborate on my comment. I'd just have some bitwise fun.</p> <pre><code>char string[] = "123456" byte1 = ((unsigned char)string[0] &lt;&lt; 4) | (unsigned char)string[1]; byte2 = ((unsigned char)string[2] &lt;&lt; 4) | (unsigned char)string[3]; byte3 = ((unsigned char)string[4] &lt;&lt; 4) | (unsigned...
24,532,285
0
Get value if all objects in chain exist, get fallback value if not <p>Feel kind of stupid to ask.. I want to get something like this:</p> <pre><code>var value = $scope.settings.paper.font.color || 0; </code></pre> <p>The problem is that some of the middle objects may not exist. </p> <p>Is there an ultimate way to get <...
21,906,600
0
<pre><code>echo "&lt;meta http-equiv=\"refresh\" content=\"4;URL=inbox.php\"&gt;"; </code></pre> <p>change 0 to 4 can do this</p>
19,342,595
0
<p>I was battling this for a few hours as well and came up with a solution. In my project i am using angular to control the actual view switching. so what i did was to define two separate route groups in L4, one that returns actual pages directly from laravel's routing system and another that returns HTML fragments fo...
34,660,347
0
<p>Assuming <code>(</code> and <code>)</code> are not nested and unescaped. You can use split using:</p> <pre><code>String[] arr = input.split(",(?![^()]*\\))\\s*"); </code></pre> <p><a href="https://regex101.com/r/wK4bC6/1" rel="nofollow">RegEx Demo</a></p> <p><code>,(?![^()]*\))</code> will match a comma if it is NO...
7,137,845
0
<p>As others have pointed out ruby's <code>Symbol#to_proc</code> method is invoked and calls the <code>age</code> method on each hash in the array. The problem here is that the hashes do not respond to an <code>age</code> method.</p> <p>Now we could define one for the Hash class, but we probably don't want it for ever...
23,458,780
0
<p>I know for sure that the C++ version supports merging two channels, so you can use it. Have you tried passing two input images and NULL for the rest?</p>
15,679,897
0
<p>You can use conditional compilation to get only IE10, this is a good way because it does not rely on jQuery or anything that could be spoofed(afaik).</p> <p>Tested it on IE8, IE9, IE10, Chrome and worked as expected in all.</p> <p>Usage:</p> <p><code>if(Function('/*@cc_on return document.documentMode===10@*/')()){ ...
20,808,639
0
javascript check from input if any values are in array of forbidden words <p>I'm having trouble figuring out how to do this. I'm using jQuery and I know the inArray function but I'm stuck. When the user inserts some values in an input field, I want to check if any of the words entered are in an array...if they are then...
23,413,206
0
Add style to link_to <p>I don't get along with the <code>link_to</code> helper and similar stuff. I am trying to add a style to my link but I can't manage to do it, because according to the documentation the parameters are options and html_options, but then some parameters I am using are not even listed in the docs for...
1,645,232
0
<p>Drewamweaver or MS's Visual Studio/Web Developer Express will do the trick. They're both overkill (especially MS's tools). </p> <p>I also think MS has (free) HTMLHelp. It's out there, but I don't know if it'll produce the files you need.</p>
31,856,093
0
<p>Just write <code>import Bolts</code> in you AppDelegate.swift file</p>
7,488,838
0
Gradient Backgrounds in internet explorer version <=8 <p>I need to have gradient backgrounds on my website for internet explorer. I know there is some kind of proprietry way of doing this:</p> <pre><code>filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#20799d', EndColorStr='#5cb9df'); </code></pre> <p...
19,159,958
0
<p>I think its TinyMCE that messes with your markup. You can edit the TinyMCE config file in App_Data\Settings\tinymce-standard.js to suit your needs.</p>
4,519,068
0
<p>It might be quite a late reply, but you could benefit from this lab course written primarily for learning PIC Assembly through applications. </p> <p>Check: <a href="http://embedded-ju.ucoz.com/" rel="nofollow">http://embedded-ju.ucoz.com/</a></p> <p>Check the experiments tab, it includes:</p> <p><strong>Experiment ...
28,223,574
0
Try to move UIImageView in screen with touchesMoved <p>I try to move 2 UIImageView.</p> <p>Only one picture is supposed to move when I drag.</p> <p>What I trying to accomplish is move UIImageView when I touch and drag the UIImageView.</p> <p>This Is my viewDidLoad :</p> <pre><code>-(void)viewDidLoad { [super viewDidLoa...
20,632,342
0
<p>Just change your for loop,</p> <pre><code> for(int row=0; row&lt;1; row++){ for(int column = 0; column&lt;x[row].length; column++){ System.out.println(x[row][column] + "\t"+x[row+1][column] ); } System.out.print("\n"); } </code></pre> <p>into below this will work even you have 5000 rows, </p> <pre><code> for(int ro...
21,748,244
0
<p>You might also consider using <a href="http://packer.io" rel="nofollow">Packer</a> to create VirtualBox images for developers to use. </p> <p>Rather than sharing the Vagrantfile which developers each use to build and run their VM, you would have a packer template (json) which is used to create a VM image. Developer...
40,359,412
0
<p>I used the (penultimate) code in Robert McKee's solution, however, had to adapt it to get it to compile and display correctly in the view:</p> <pre><code>public ActionResult Create() { ViewBag.AllSystems = new MultiSelectList(db.dbSystem.Select(x=&gt;new { Name=x.systemName, Value=x.systemId }),"Value","Name"); ret...
26,905,220
0
<p>Create a <code>List&lt;TextBox&gt;</code> for each group:</p> <pre><code> List&lt;TextBox&gt; list01 = new List&lt;TextBox&gt;() { tbPlay0, tbPlay1, ....}; List&lt;TextBox&gt; list02 = new List&lt;TextBox&gt;() { ..., ... , ....}; // .. } </code></pre> <p>And pass such a group to the function:</p> <pre><code>privat...