pid
int64
2.28k
41.1M
label
int64
0
1
text
stringlengths
1
28.3k
25,899,116
0
Powershell Environment Setup <p>This is a very quick question because I'm nervous to break my batch file/java environment or make my laptop explode.</p> <p>I used to used to execute a .bat file from cmd.exe to set my environment to java which worked and that but now I've upgraded to Windows Powershell.</p> <p>I've crea...
5,480,650
0
<p>Try this:</p> <pre><code>imageView.opaque = NO; imageView.backgroundColor = [UIColor clearColor];</code></pre> <p>Also, the image used to mask should be black and white (not transparent).</p>
12,665,688
0
<p>You are checking for <code>Submit</code> in <code>$_POST</code>, but the method specified in the form is <code>GET</code>.</p> <p>To have it work, change the PHP code to look for <code>$_GET['Submit']</code>.</p> <p>(But I'd move instead everything, form method included, to <code>POST</code>).</p> <p>That said, you...
25,828,708
0
<p>Ok so I fixed the mins subtracting but I am still confused on reporting the ticket. And where do I set pm and pc</p>
24,901,426
0
<h1>PubNub Unsubscribe All Users from a Specific Channel</h1> <p>Use a control channel to specify which channels all users should subscribe to.</p> <pre><code>// Subscribe to 'control' channel pubnub.subscribe({ channel : 'control', message : function(command) { // Unsubscribe Command if (command.type == 'unsubscribe'...
14,197,211
0
<p>Technically, the distinction is not really made between "unrecoverable error" and "recoverable error", but between checked exceptions and unchecked exceptions. Java <em>does</em> distinguish between them as follows:</p> <ul> <li>you <em>must</em> declare a checked exception in your <code>throws</code> clause; if us...
30,327,271
0
<p>Another possible workaround is instead of <code>Visibility</code> property use <code>Opacity</code>. In this case calling <code>Focus()</code> actually sets focus.</p>
4,171,212
0
<p>The result shows that dot is more preferable if there are no variables or $ symbol involved which is around 200% faster. On the other hand, commas will help to increase around 20%-35% efficiency when dealing with $ symbols.</p> <p><a href="http://hungred.com/useful-information/php-micro-optimization-tips/" rel="nof...
2,778,233
0
<p>You should be using <a href="http://ruby-doc.org/core/classes/Kernel.html#M005965" rel="nofollow noreferrer"><code>Kernel::Float</code></a> to convert the number; on invalid input, this will raise an error instead of just "trying" to convert it.</p> <pre><code>&gt;&gt; "10.5".to_f =&gt; 10.5 &gt;&gt; "asdf".to_f # ...
31,303,423
0
<p>You need to quote the string, because your shell is eating the content of the <code>{}</code> as an expansion. So use <code>git stash apply 'stash@{2}'</code>. Alternatively you can use the SHA of the stash, or next time when you apply it, you can name the stash yourself.</p>
28,365,063
0
<p>Two quick thoughts:</p> <ol> <li><p>You can give some threshold for the confidence value you want. For example, mallet is saying that Page 1 belongs to Class A with 90% confidence, accept it. If it is saying that Page 2 belongs to Class C, with 60% confidence, and that is the best value, may be, reject that suggest...
4,074,857
0
merge and match two csv files with .net <p>i've got two csv files that i want to merge. Basically, i've got my source file, and the second file will add information to that file using a primary key that they both share.</p> <p>I've done this using v-lookup but since this will be a weekly process, i want to automate it ...
4,731,341
0
<p>NSOutlineView is an NSTableView subclass. Therefore -rowsInRect: can be combined with -visibleRect (from NSView). Use -levelForRow: to determine the level.</p>
13,308,828
0
<p>Try changing</p> <p>move_uploaded_file($file_tmp, '/members/'); in move_uploaded_file($file_tmp, 'members/' + $filename);</p> <p>And make sure to set permission right with chamod. chmod -R 0755 members. Also make sure that you're app have access at $file_temp location and read/write permision</p>
30,672,381
0
<p>11.2 sums it up for iOS, you must use In-App Purchase for purchase from within the app. You may not direct or link the user to an outside payment option.</p> <p>It is possible to use payments completely outside the app in a similar manner to Amazon Books but there can to be a link or reference to that service. Take...
40,820,693
0
Two different values at the same memory address - assembly <p>I have some code in assembly which behaves a little bit strange. I have a C extern function that calls with <em>asm</em> another function from an .asm file. This C function puts on the stack three addresses used by my function from .asm file. All went well u...
5,323,995
0
how to get the url/xmlhttprequest that loads to get the data from a server? <p>i have this problem that i can't solve for days now...here is my code. i want to get the xmlhttprequest or the url that loads everytime i clicked the $("#btnQuery"). what happened here is when i clicked the button, it will display the data i...
4,867,515
0
<p>This is strange, if I'm reading your code correctly. Is there a reason that you can't maintain the collection and modify it (as opposed to re-creating it) so that you don't need to <code>RaisePropertyChanged</code> at all? That's what <code>ObservableCollection(of T)</code> does, after all. </p> <p>As I'm reading i...
30,308,560
0
<p>This is happening because of less information. I think you want to do this:</p> <pre><code>In [7]: x = Symbol('x', real=True) In [8]: (log(exp(exp(x)))).simplify() Out[8]: exp(x) </code></pre>
36,737,513
0
<p>As you said in the answers above, the field got manually removed from the database, so the migration tries to delete a field that is no longer existing in the database.</p> <p>Normally you should never delete fields directly in the db but use the migrations instead. As the field is already gone you can now only fak...
40,672,286
0
Android show GPS position on "ground" <p>I want to make a GPS application that shows a flat plain as ground and arrow (as user position) in the middle, while it should be possible to move along, the arrow should stay in the middle of screen and the ground should move. Also with a possibility of drawing on this "ground"...
13,792,488
0
<pre><code>CC=gcc CPPFLAGS=-I include VPATH=src include main: main.o method1.o method2.o method3.o method4.o -lm $(CC) $^ -o $@ main.o: main.c main.h $(CC) $(CPPFLAGS) -c $&lt; method1.o: method1.c $(CC) $(CPPFLAGS) -c $&lt; method2.o: method2.c $(CC) $(CPPFLAGS) -c $&lt; method3.o: method3.c $(CC) $(CPPFLAGS) -c $&lt...
20,958,258
0
Is throwing InterruptedException essential when stopping threads? Can I use another exception type? <p>I have tournament code for students' codes. Therefore I have no control over the students' codes.</p> <p>I need to implement timeout for students' code calls (they run in separate threads). So I instrumented their cod...
39,367,174
0
<p>If you want to Read value of PBI Slicer/ Filter and recalculate the Data and Generate Graph accordingly, R Script Visual is the answer.</p> <ul> <li>Create R script using loaded columns and filters, </li> <li>Make sure this generates visual, else ERROR. </li> <li>During calculation Generated DF are not loaded in Da...
24,932,015
0
<p>the empty view positioning in the layout is done 100% by the developer. Yes, that is by design, Android in general favours flexibility than easy of coding.</p> <p>If you look in the <a href="https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/core/java/android/widget/AdapterView.java" rel=...
38,947,552
0
<p><code>hobby</code> is a <code>String</code> and <code>String</code>s don't have a method called <code>add</code> in Java.</p> <p>You should change <code>hobby</code>'s type from <code>String</code> to <code>String[]</code> because there is a <code>hobby[rando]</code> in the code that indicates <code>hobby</code>'s ...
28,779,585
0
What's wrong with gcc version before 4.4 implementation on thread local storage? <p>I saw this, </p> <blockquote> <h1>warning "GCC versions before 4.4 implement thread_local storage incorrectly, so you can not use some parts of Loki."</h1> </blockquote> <p>in the loki library source code. More details on this page:</p>...
11,013,373
0
Backbone error, Cannot read property 'c18' of undefined <p>I'm making a massive multi page backbone site.</p> <p>I'm sometimes re-using collections and views across multiple pages of the site, as if they were controls. I've now done something which is coming up with errors like this,</p> <p>Cannot read property 'c18' o...
9,835,991
0
<p>first, look at this: <a href="http://www.w3schools.com/jsref/jsref_replace.asp" rel="nofollow">http://www.w3schools.com/jsref/jsref_replace.asp</a> and then do not use stackoverflow for questions of this kind</p>
20,365,507
0
<p>Why not just use the array you've created?</p> <pre><code> For(int i = 0; i&lt; sL.length; i++){ String wavFileName = sl[i] + ".wav"; // do whatever you need to do here } </code></pre> <p>For on demand (press a button get a specific sound) then Jeroen's idea of using a map will work.</p>
5,605,359
0
<p>I'm fairly certain that <a href="http://code.google.com/p/wwwsqldesigner/" rel="nofollow"><code>WWWSQLDesigner</code></a> can do it for you. There's a demo <a href="http://ondras.zarovi.cz/sql/demo/" rel="nofollow"><code>here</code></a>. You'll need to download it and install it on a local server.</p>
20,635,273
0
<p>You don't need to set the '!' at all - except you want force your sites to be crawled by search engines (see <a href="https://developers.google.com/webmasters/ajax-crawling/docs/specification?hl=de&amp;csw=1" rel="nofollow">GoogleDevelopers Spec</a>). Some people even say, these hash bangs are <a href="http://danwe...
17,401,981
0
<p>I have made mistake when i add model to collection, I have added a type instead of instance of the type.</p> <pre><code>var backgridModel = Backbone.Model.extend({ }); </code></pre> <p>is the type i should have added </p> <p><code>var row = new backgridModel()</code> instead i have used <code>backgridModel</code> t...
15,320,259
0
<p>Ok i think i understand your problem :</p> <p>The after_destroy method in PictureFileCallbacks will be auto-magically called by rails :</p> <p>When rails destroys your PictureFile object, it will instantiate a PictureFileCallbacks object and try to run an after_destroy method in it.</p> <p>Everything works by conve...
26,380,336
0
<p>This is most optimal way</p> <pre><code>if (is_array($data) &amp;&amp; isset($data['yes'])) { } </code></pre> <p>If you do <code>array_key_exists</code> without checking if <code>$data</code> is array, you will get error, because second parameter for the <code>array_key_exists</code> function must always be type of...
16,194,342
0
<pre><code> describe ArticlesController do let(:user) do user = FactoryGirl.create(:user) user.confirm! user end describe "GET #index" do it "populates an array of articles of the user" do #how can i create an article of the user here sign_in user get :index assigns(:articles).should eq([article]) end it "renders the ...
11,832,795
0
android html links <p>Using this code <code>map.put(TAG_LINK, "" + Html.fromHtml(link));</code> i am able to parse json hyperlinks into my view. But the problem is it will only show me the word and i`m not able to click on it. For example if i have </p> <pre><code>&lt;a href="http://something"&gt; CLICK &lt;/a&gt; </co...
20,960,384
0
<p>A stop-gap measure would be to insert one (or several) line(s) of </p> <p>DoEvents</p> <p>after the change and before ActiveWindow....NextHeaderFooter. That command yields execution to the OS. That may give Word the time it needs to catch up. </p> <p>Of course, you would do better to avoid using ActiveWindow... alt...
36,569,405
0
<p>You can define the content of the <code>onOptionsItemSelected(MenuItem item)</code> method in a helper and then using flavors load the needed helper :</p> <pre><code>@Override public boolean onOptionsItemSelected(MenuItem item) { HelperPart.selectItem(this, item); } // Helper loaded for flavor "part1" static class ...
12,837,275
0
How to stop my Custom Keyboard from 'floating' or being undocked on iPad <p>I have a custom Keyboard that gets displayed for a certain UITextField when I set the textField's inputView to my KeyboardView. The keyboard works fantastically well but it has become apparent that the keyboard will 'float' if the user has prev...
23,888,102
0
<p>The padding is likely part of the font, not the widget. Fonts need space above and below the space for average sized characters to make room for <a href="http://en.wikipedia.org/wiki/Ascender_%28typography%29" rel="nofollow">ascenders</a> and <a href="http://en.wikipedia.org/wiki/Descenders" rel="nofollow">descende...
987,055
0
<p>One of the ways to handle this is to write your DLL to return a SAFEARRAY of type Byte as the function result (VB arrays are OLE SafeArrays).</p> <p>To do this you have to read up on the SafeArray APIs and structures. I don't know of it myself, but the main things you'll need are the SAFEARRAYBOUND structure and th...
16,492,535
0
<p>Why not put the custom tool property back in to be able to rapidly test it? then take it out when you are happy?</p> <p>another option is to write a .tt file that consumes/includes that .tt to operate as your <a href="http://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop" rel="nofollow">REPL</a> harness...
32,523,773
0
<p>Mentioned in Oracles <a href="https://docs.oracle.com/javase/tutorial/reflect/special/arrayComponents.html" rel="nofollow">Tutorial</a> this is easily achievable with <code>array.getClass().getComponentType()</code>. This returns the class of the instances in the array. </p> <p>Afterwards you can check it against t...
9,173,264
0
<p>According to the yaml <a href="http://yaml.org/type/set.html" rel="nofollow">specification</a> the set syntax is the following one : </p> <pre><code>- Person(paul): firstName: Paul lastName: Lumbergh children : !!set ? Person(bill) ? Person(jane) – </code></pre>
37,350,051
0
<p>Well, there is a huge mess here :D</p> <p>First of all, the NullPointerException is thrown because the values are not sent, and the values are not sent because they're not in the form. </p> <p>You should enclose them in the form like this for them to be sent to the <code>ActionSelect</code> action:</p> <pre class="...
37,525,418
0
<p>Normally, when you build your APK, all the libs you have imported (jars) are included and transformed to dex files, as the rest of your code. So, yes all the classes are included, even if you don't use them. You can use Proguard to remove them from the APK. Look at this post : <a href="http://stackoverflow.com/ques...
20,306,465
0
iterating through PictureBoxes in visual c++ <p>I'm programming in visual c++, and i have about 60 pictures (indexed p0...p63), and i want to make a loop that goes through all the pictures and change their <code>ImageLocation</code> under some conditions.</p> <p>I figured the <code>Tag</code> property and one of my att...
39,112,997
0
<p>There are two steps to accomplish this: 1. Change your parent div style to this:</p> <pre><code>#my-projects-section { background-color: black; height: 500px; width:100%; } </code></pre> <p>2. Add this to your child styles:</p> <pre><code>#image-one, #image-two, #image-three { width: 30%; margin: 1.66%; height: 200...
26,658,216
0
Excel Macro - Windows().Activate not taking value <p>The code that works is the following:</p> <pre><code>Windows("Contract Drilldown (3).xls").Activate </code></pre> <p>When I use :</p> <pre><code> Windows(Chr(34) &amp; ddlOpenWorkbooks.Value &amp; Chr(34)).Activate </code></pre> <p>I get:</p> <blockquote> <p>Runtime ...
20,864,408
0
<blockquote> <p>I am trying to obtain a handle on one of the views in the Action Bar</p> </blockquote> <p>I will assume that you mean something established via <code>android:actionLayout</code> in your <code>&lt;item&gt;</code> element of your <code>&lt;menu&gt;</code> resource.</p> <blockquote> <p>I have tried callin...
7,018,235
0
<p>There are 2 things you can do in this instance.</p> <p>First of all you are correct, it is not accepting it because it is now a comma seperated list.</p> <p>Basically what you need to do is parse out that comma seperated list and use a function with an IN clause in your main query. Here's a very good article explai...
25,690,125
0
<p>Why, you use</p> <pre><code>var dropdownlist = $(container.find("#ddlActionType")).data("kendoDropDownList"); </code></pre> <p>instead. </p> <p>You're welcome!</p>
25,304,005
0
<p>The highest available version of GCC in the 12.04 repositories is 4.6. You can use the package manager to install a newer version, but you will have to add a PPA. <a href="http://ubuntuhandbook.org/index.php/2013/08/install-gcc-4-8-via-ppa-in-ubuntu-12-04-13-04/" rel="nofollow">This</a> link should help, although i...
26,501,899
0
jQuery for hiding other columns options(dynamic) except column one. and onClick it shows other <p>I am having a problem regarding jQuery. In my (codeigniter)view file i have created a columns which are fetching data from the database perfectly. All i want is to put a jQuery that shows only column_one(id : col_1) firstl...
16,225,251
0
<p>Get rid of:</p> <pre><code>&lt;uses-library android:name="com.actionbarsherlock" /&gt; </code></pre> <p>as <code>&lt;uses-library&gt;</code> is only for firmware libraries.</p> <p>Also, you appear to be using both Maps V1 and Maps V2, which is possible but unlikely. If you are trying to use Maps V2, get rid of:</p>...
4,892,679
0
<pre><code>var select = document.getElementById('myselect'); var newoption = document.createElement('option'); newoption.value = 0; // or whatever newoption.innerHTML = '0'; // or whatever select.insertBefore(newoption, select.options[0]); </code></pre>
13,816,356
0
<p>To get the aggregate of the whole set you can use an empty <code>OVER</code> clause</p> <pre><code>WITH T(Result) AS (SELECT FloatColumn - Avg(FloatColumn) OVER() - Stdev(FloatColumn) OVER () FROM Data) SELECT Count(*), Result FROM T GROUP BY Result </code></pre>
19,100,930
0
<p>The access token returned in the call to the OAuth2 endpoint identifies the caller and privileges (which api calls you can make). This is required for any of the api calls (REST) to create payments, execute, refunds etc. Some calls require more privileges than others, i.e. you need to have requested more informatio...
1,521,859
0
Nonrepresentable section on output error during linking on linux <p>I get this error at the linker stage when compiling the webkit-1.1.5 package on my Ubuntu 9.04 box:</p> <pre><code>libtool: link: gcc -ansi -fno-strict-aliasing -O2 -Wall -W -Wcast-align -Wchar-subscripts -Wreturn-type -Wformat -Wformat-security -Wno-f...
36,162,322
0
Controlling when participants are added with vanity a/b test <p>Using <a href="https://github.com/assaf/vanity" rel="nofollow">vanity</a> to conduct an A/B test. The test is reliant on a modal that is conditionally shown to certain users. The modal contains different incentives based on which side of the test you see.<...
17,364,133
0
How can I update a file incrementally in iOS. (File patching) <p>I have a huge text file in my application (version 1.0).</p> <p>Lets assume that a new version (2.0) of this file was just released. Most of the file remained the same but the new (2.0) version has a few modifications (some lines removed, others added).</...
18,539,082
0
Struts 2 problem to run the program <p>I am new in Struts 2. I want to create a simple Hello program using struts2 and when I try to run the program, i am getting the following message in the console:</p> <pre class="lang-none prettyprint-override"><code>Aug 30, 2013 11:33:35 AM org.apache.catalina.core.AprLifecycleLis...
18,087,841
0
Microsoft BIDS How to clear table data before new transfer? <p>I have a database from which I am pulling rows from, manipulating the data a bit and then putting into another table. Every time I run the package, it doesnt remove any data from the destination and thus grows by X number of rows each time.</p> <p>Is there ...
35,597,142
0
<p>Do you want to end it with an "and"?</p> <p>For this situation, I created an npm module.</p> <p>Try <a href="https://github.com/dawsonbotsford/arrford" rel="nofollow">arrford</a>:</p> <p><br></p> <h2>Usage</h2> <pre><code>const arrford = require('arrford'); arrford(['run', 'climb', 'jump!']); //=&gt; 'run, climb, a...
19,710,113
0
Hadoop - set reducer number to 0 but write to same file? <p>My job is computational intensive so I am actually only using the distribution function of Hadoop, and I want all my output to be in 1 single file so I have set the number of reducer to 1. My reducer is actually doing nothing...</p> <p>By explicitly setting th...
13,855,764
0
JXL datetime no need the part time <p>Hello i wrote this code to add a Date in excel but when the cell is added he show also the time. I want eliminated the time part. Thank you in advance if someone can help .. </p> <p>Tabla[tabReg][tabCol]); is String Array</p> <pre><code> SimpleDateFormat dateFormat = new SimpleDate...
9,295,118
0
Return distance in elasticsearch results? <p>My question is similar to this <a href="http://stackoverflow.com/questions/9290057/compute-geo-distance-in-elasticsearch">one</a>.</p> <p>Simply, is there a way to return the geo distance when NOT sorting with _geo_distance?</p> <p>Update: To clarify, I want the results in r...
20,258,294
0
How to create human readable time stamp? <p>This is my current PHP program:</p> <pre><code>$dateStamp = $_SERVER['REQUEST_TIME']; </code></pre> <p>which I later log.</p> <p>The result is that the <code>$dateStamp</code> variable contains numbers like: </p> <p>1385615749</p> <p>This is a Unix timestamp, but I want it to...
22,024,213
0
Calling scanf_s() with array of chars <p>I tried this code, but it is not working.</p> <pre><code>char word1[40]; printf("Enter text: \n"); scanf_s("%s", word1); printf("word1 = %s", word1); </code></pre> <p>When I execute it, it shows:</p> <blockquote> <pre><code>word1 = </code></pre> </blockquote>
28,872,797
0
<p>Personally, for the admin account I won't go with the basic Spring Security user service, mainly because it lacks the flexibility of a DB-based user management approach. Indeed, you probably don't want to have your admin credentials established once for all, since they can be guessed or stolen or simply forgotten.<...
29,484,810
0
<p>Simply use the current object <code>this</code> keyword</p> <p><code>var id = $(this).attr('id');</code></p>
27,539,955
0
<p><strong>@chipChocolate.py</strong> gave a brilliant solution! This is an improvement based on his.</p> <ol> <li><p>In Firefox <code>transparent</code> behaves like <code>rgba(0,0,0,0)</code> which leaves a thin gray line at the edge. Change to <code>rgba(255,255,255,0)</code> looks better.</p></li> <li><p>Make the ...
14,931,699
0
<p>This is just something related to the <strong>debugger</strong>, not the CLR or anything else. In any given scope, there is only one accessible variable or object with specified name, so the debugger does not try to distinguish the same names appearing in different palces.</p> <p>Hovering over a <em>name</em> is eq...
4,560,070
0
<p>You can put the image into the checkbox's label, which effectively makes it part of the checkbox (so clicking on it will toggle the checkbox):</p> <pre><code>&lt;label for="moreinfo"&gt; &lt;img src="darkCircle.jpg"/&gt; &lt;input name="moreinfo" type="checkbox" id="moreinfo" style="display:none"&gt; &lt;/label&gt;...
20,671,323
0
find() element based on id starting with... and css property <p>How do I select a descendant of an element based on:</p> <ul> <li>its <code>id</code> <strong>starting</strong> with: foo; and</li> <li>its css <code>visibility</code> set to visible?</li> </ul> <p><code>$('#parentEle')find('id^=foo:visible').css({...});</...
25,402,839
0
<p>Give unique id to your input text</p> <p>for example </p> <p>and in OnClick event function write following line of code</p> <p>$("#1").val('some text');</p>
11,365,653
0
<p>If your string can be ANY length and you want to match the cases when you have 0 to 3 charaters you should use:</p> <pre><code>\d?\d?\d?\d?$ </code></pre> <p>or, if the regex engine understands it: </p> <pre><code>\d{0-4}$ </code></pre>
28,339,893
0
Why is IIS exiting with code 0 whenever I preview in Chrome from Visual Studio? <p>I started on a new <a href="/questions/tagged/asp.net" class="post-tag" title="show questions tagged &#39;asp.net&#39;" rel="tag">asp.net</a> site yesterday with <a href="/questions/tagged/vb.net" class="post-tag" title="show questions t...
6,265,270
0
<p><code>char *str = "foo"</code> gives you a pointer to a string literal (you should really be doing <code>const char *</code>, but C allows non-<code>const</code> for backwards compatiblity reasons).</p> <p>It is undefined behaviour to attempt to modify a string literal. <code>strtok</code> modifies its input.</p>
40,797,343
0
Excel Workbook - Sheet Sync / Version Control <p>Let's say I have a workbook with two sheets: A and B.</p> <p>I'm looking for a simple version control system that would allow two users to work on one workbook and keep it in sync. So,</p> <ul> <li>User 1 works on sheet A</li> <li>User 2 works on sheet B</li> </ul> <p>Wh...
4,246,010
0
<p>Does <code>Status</code> touch the UI? Because it seems like it.</p> <p>I can only guess but I imagine <code>Status</code> changes something on UI which needs to be done through <code>Dispatcher.Invoke()</code>.</p>
38,615,181
0
OnClick in a CardView <include> layout <p>I have a xml that contains some <code>CardView</code> <code>&lt;include&gt;</code>, I want to set <code>onClick</code> in the <code>CardView</code> includes to open an <code>Activity</code> in my project. I tried to set the <code>onClick</code> in the <code>CardView</code> layo...
23,643,308
0
<p>Here are my thoughts. I would NEVER have any replication going on between dev and production. That's just way too risky in my opinion and not a Best Practice. Maybe that's not exactly what you're doing I'm not sure.</p> <p>Here's what I do and as far as I know everyone on my team:</p> <p>Our Dev server has a test d...
1,000,637
0
<p>Try setting the dialog's owner:</p> <pre><code>var uploadWindow = new UploadWindow(); uploadWindow.Owner = this; uploadWindow.ShowDialog(); </code></pre>
10,786,592
0
<p>Not with <code>foreach</code>.</p> <pre><code>for (var i = 0; i &lt; array.length; i += 2) { var name = array[i]; var time = array[i + 1]; // do whatever } </code></pre>
500,006
0
What is the purpose of anonymous { } blocks in C style languages? <p>What is the purpose of anonymous { } blocks in C style languages (C, C++, C#)</p> <p>Example -</p> <pre><code> void function() { { int i = 0; i = i + 1; } { int k = 0; k = k + 1; } } </code></pre> <p><strong>Edit</strong> - Thanks for all of the excel...
35,489,986
0
<p>You're setting the image:</p> <pre><code>if (userGuess == 'r'){ var displayRock = "&lt;img src='images/rock-user.png' alt='User Rock'&gt;"; document.querySelector("#userGuess").innerHTML = displayRock; } </code></pre> <p>And it is immediatelly being replaced a few lines below:</p> <pre><code>document.querySelector(...
4,299,773
0
Post html code to PHP using jQuery <p>I allow users to edit webpages using CKEditor and then save their modified HTML snippets to the server so that I can show them on subsequent page deliveries. </p> <p>I'm using this code to send the HTML and a few IDs to the server:</p> <pre><code>var datatosend = JSON.stringify( { ...
30,779,220
0
<p>Add this </p> <pre><code>@Override public void onBackPressed() { if (getFragmentManager().getBackStackEntryCount() &gt; 0) { getFragmentManager().popBackStack(); } else { super.onBackPressed; } } </code></pre>
2,021,079
0
<p>To answer my own question, following is a complete working Chronology class (for 8 hours days). I am posting it here so it might help other people that trying to solve similar problems.</p> <pre><code> import org.joda.time.Chronology; import org.joda.time.DateTimeZone; import org.joda.time.DurationFieldType; import...
40,266,027
0
<p>You can find the approximate number of active threads in the <code>ThreadPoolExecutor</code> by calling the <code>getActiveCount</code> method on it. However you shouldn't need to.</p> <p>From the <a href="https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Executors.html#newFixedThreadPool-int-" rel="no...
21,447,324
0
switching between divs and iframes <p>I have a main viewing area that I want to be switchable from a menu by clicking on a menu item. </p> <p>In this main viewing area I want to have the flexibility of being able to switch between a <code>div</code> and <code>iframe</code>. I know how to change them separately. </p> <p...
9,833,981
0
<p>See <a href="http://qt-project.org/doc/qt-4.8/qstringlist.html#join" rel="nofollow"><code>QStringList::join</code></a></p>
12,817,268
0
<p>Start your activity B by Activity A</p> <pre><code>Intent intent = new Intent(ActivityA.this,ActivityB.Class); startActivityForResult(intent,0); </code></pre> <p>finish your activity B with </p> <pre><code>Intent intent = new Intent(); setResult(RESULT_OK,intent ); finish(); </code></pre> <p>now in ActivityA</p> <p...
2,708,031
0
<p>You can get the index like so:</p> <pre><code>$("#eq &gt; span").each(function (index, Element) { alert(index); ... </code></pre> <p>see <a href="http://api.jquery.com/each/" rel="nofollow noreferrer">http://api.jquery.com/each/</a></p>
9,103,137
0
<pre><code>$(document).ready(function(){ if($('#contentblock').is(':hidden')) { $('#contentblock').slideDown('slow'); } }); </code></pre> <p>if you have jquery added to your project and your div is display none ... something like this should work.</p>
14,412,135
0
<p>Check this code. Yo have to create a class with any name example conexionDB, and into the class put the next code:</p> <pre><code>import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; /** * * @author programmerhn */ public class ConexionDB { private Connection con; /** * */ public...
7,724,358
0
<p>Based on your requirement(And as you haven't posted XML layout here that you have tried so far), i assume and can suggest the following:</p> <ol> <li>give bottom margin to your listview: <code>android:layout_marginBottom="60dip"</code></li> <li>If you are using RelativeLayout then just give listview as <code>androi...
7,220,921
0
<p>Subscribing to events in VB.NET requires either the AddHandler or Handles keyword. You will also have a problem with the lambda, the Function keyword requires an expression that returns a value. In VS2010 you can write this:</p> <pre><code> AddHandler m_switchImageTimer.Tick, Sub(s, e) LoadNextImage() </code></pre>...