pid
int64
2.28k
41.1M
label
int64
0
1
text
stringlengths
1
28.3k
23,043,066
0
<p>Apple's MapKit only used Google Maps up to iOS 5.1 as stated in the <a href="https://developer.apple.com/library/ios/documentation/MapKit/Reference/MKMapView_Class/MKMapView/MKMapView.html" rel="nofollow">"Important" note in the <code>MKMapView</code> class reference</a>:</p> <blockquote> <p><strong>Important</stro...
8,640,011
0
What does "visibility" refer to in the Activity Lifecycle? onPause vs onStop? <p>The Activity Lifecycle is giving me headaches. The documentation at <a href="http://developer.android.com/reference/android/app/Activity.html" rel="nofollow">http://developer.android.com/reference/android/app/Activity.html</a> is so darn a...
23,336,248
0
<p>It works for me in my app on Jetty:</p> <p></p> <pre><code>&lt;error-page&gt; &lt;error-code&gt;500&lt;/error-code&gt; &lt;location&gt;/WEB-INF/jsp/error.jsp&lt;/location&gt; &lt;/error-page&gt; </code></pre>
19,392,436
0
Updating many-to-many relations in JayData <p>My OData model contains a pair of entities with many-to-many relationship (Parents-Children). I am trying to add a child entity to a parent's Children navigation property, but calling saveChanges() afterwards has no effect at all. The code looks something like:</p> <pre><co...
3,751,827
0
<p>There are probably a lot of ways, but why not treat direction as a optional argument, which when not set indicates a reset condition.</p> <pre><code>function changestart(direction) { var startElement = $("#startID"); if ( direction ) { var rowsElement = $("#maxrows"); var rowsValue = parseInt(rowsElement.val()); va...
39,750,079
0
<p>Process exited with singal 11 (segmentation fault). Typically, it means process unexpectedly crashed because of some error in memory usage, and php just can't handle that error in any way. You will get same error using apache+mod_php, apache+mod_fcgid or any other configuration.</p> <p>In my practice, segfault give...
21,132,305
0
why this message come in php:notice undefined offset:2 <p>I want to use the project PHP Weather 2.2.2 but it has many problems here is a code </p> <pre><code>function get_languages($type) { static $output = array(); if (empty($output)) { /* I use dirname(__FILE__) here instead of PHPWEATHER_BASE_DIR * because one might...
9,903,569
0
<p>You can supply a comparison function to the <code>sort</code> method:</p> <pre><code> theArray.sort(function(a, b){ if (a.Field2 == b.Field2) return 0; if (a.Field2 &lt; b.Field2) return -1; return 1; }); </code></pre>
3,971,782
0
What to use for a datagrid with a lot of data? <p>Found this interesting interview question:</p> <p>You need to display the sales data for your division for the past 5 years in a DataGrid on a Web Form. Performance is very important. What would be the best strategy to use in retrieving the data?</p> <ul> <li>a)Use a Da...
32,319,007
0
Multiple FileUploads with Multiple Submit Buttons <p>I have for example 5 fileupload controls and Also I have a submit button for each of them (in front of each fileupload control) which will upload that fileupload's selected file(s).</p> <p>But There is a problem, when I click on (for example) second submit button to ...
28,660,442
0
<p>Strictly speaking, this is not exacly a Scalding question but you can use something like <a href="http://commons.apache.org/proper/commons-jexl#A_Brief_Example" rel="nofollow">Apache Commons JeXL</a> to execute formulas dynamically. So you would read the formula from the 2nd file, give it first file record object a...
36,961,614
0
<p><strong>UPDATE SOLUTION FOUND!</strong> well the solutionin fact deleted some random files so I have taken it off until I figure out why.</p> <p>I leave this important note from before</p> <p><strong>ANYTIME YOU USE CRON</strong> I cannot emphasize enough the importance of specifying completely the full path of all...
40,682,361
0
TFS access rights for revoking some rights to project collection admins <p>I am using Visual Studio Team Services (VSTS). I have to create some Project Collection Administrators only for administrative purpose. At the same time, there will be few projects where all the administrators will not have all rights to those p...
4,424,235
0
<p>In my case i found out it was division by zero</p>
36,009,744
0
FabricJS export relative to canvas <p>I'm building a authoring tool in FabricJS which is meant to export something for android devices. It's decided that I will support only 6/9 screen ratio (other screens will get black borders). My problem is that I open the page on my pc, add and edit some elements and export ( usin...
5,422,768
0
<pre><code>$catname = str_replace('-', ' ', $catname); </code></pre>
30,551,958
0
<p>This may be further off topic than you want to go but <a href="http://nsubstitute.github.io/" rel="nofollow">NSubstitute</a> is a great mocking library that handles this very well. In NSubstitute it's just:</p> <pre><code> var mock = Substitute.For&lt;IInterface&gt;(); var obj = new MyClass(); await obj.Run(); Rece...
39,796,869
0
<p>Looks like you want the vector product i.e. outer join. But to have a join you need a column with rows matching. A trick here would be to create a new column with just a single value like "1" for all of the rows (use "Insert Calculated Column" - be sure to freeze the column so you can join to it later). Then do a f...
1,561,630
0
Optimizing images in a jar-file <p>Is there an advantages to putting all my small widget graphics in one single png-file, which is loaded once, and then creating ImageIcons for buttons and such from sections of this? (Normally I would just use <code>new ImageIcon(aClass.class.getResource("/path/with/image.png"))</code>...
14,858,674
0
<p>The <code>${userRecords}</code> here</p> <pre><code>${userRecords.user_first_name} ${userRecords.user_middle_name} </code></pre> <p>is a <code>List&lt;User&gt;</code>, however you're attempting to access it as if it's a single <code>User</code>. This is not valid. In EL, a <code>List</code> can only be accessed wit...
38,252,374
0
<p>When used as part of a URL, ? and &amp; represent key value pairs that make up the Query String, which is a set of information sent to the server.</p> <p>The query string starts after the end of the page being requested with a ? and then a key value pair like:</p> <pre><code>?variable1=value1 </code></pre> <p>Any a...
9,401,370
0
<p>It doesn't work because you're trying to replace the ASCII apostrophe (or single-quote) and quote characters with the empty string, when what's actually in your source string aren't ASCII characters.</p> <pre><code>str.replace(/[“”‘’]/g,''); </code></pre> <p>works.</p>
27,721,190
0
<p>Add this to your <code>ApplicationController</code>:</p> <pre><code>def search @search ||= Search.new end def galleries @galleries ||= Gallery.all end </code></pre> <p>You then use the function (<code>search</code>) in your views instead if the instance variable <code>@search</code>); the <code>||=</code> makes sur...
3,723,646
0
How to save data from a DataGridView into database? c# winforms <p>I have this little application, and what it does is a user can add many deductions to a certain employee and save the record.</p> <p><img src="https://i.stack.imgur.com/Y2mVu.png" alt="alt text"></p> <p>What I do in my coding is I pass all the values to...
4,022,463
0
How can I extract non-standard HTTP headers using Perl's LWP? <p>I'm working with a web application that sends some non-standard HTTP headers in its response to a login request. The header in question is:</p> <pre><code>SSO_STATUS: LoginFailed </code></pre> <p>I tried to extract it with LWP::Response as <code>$response...
31,635,874
0
gcc with explicit linking <p>I would like with compile C++ code with GCC using command</p> <pre><code>gcc -lstdc++ hello.cpp -o out.a </code></pre> <p>Code:</p> <pre><code>#include &lt;iostream&gt; int main() { std::cout&lt;&lt;"hello"; return 0; } </code></pre> <p>Got output:</p> <pre><code>/tmp/ccgtX1Xs.o: In functio...
35,503,654
0
<p>Your two larger SELECTS (the first 2) are returning 12 items. The last two SELECTS (the small ones) are returning 13 items. UNION must have matching columns.</p> <p>eg statement should end...</p> <pre><code>SELECT NULL, 0, 'ABC', NULL, NULL, NULL, 'ABC', NULL, NULL, NULL, NULL, NULL FROM DUAL UNION SELECT NULL, 0, ...
39,483,974
0
<p>I'm not sure if I understand your problem correctly, but please check if solution mentioned in <a href="http://stackoverflow.com/questions/4042856/system-out-with-ant">this question</a> suits your needs.</p>
11,638,724
0
<p>As a function:</p> <pre><code>function printYearsBefore(date,num) { var yr = parseInt(date.getFullYear()), i =0; while(++i &lt;= num){ document.write((yr-i)); } } printYearsBefore(new Date(),18); </code></pre>
35,418,633
0
<p>use group by for aggregate function (and for this you don0t need distinct )</p> <pre><code>"SELECT Test_ID AS Tcode, COUNT(*) AS Qcount, User_ID FROM user_answers WHERE User_ID = 1 group by Tcode, User_ID ") </code></pre>
4,881,085
0
php is there a way to transfer Latin letters to english letters? <p>is there a way to transfer Latin letters to english letters with php?</p> <p>Such as: <code>āáǎà</code> transfer to <code>a</code>, </p> <p><code>ēéěè</code> transfer to <code>e</code>,</p> <p><code>īíǐì</code> transfer to <code>i</code>,</p> <p>... //...
27,129,711
0
<p>Well, my recommendation would be twofold. First, just don't use factors when creating the data.frame; you can factor post-hoc if you really need them. So:</p> <pre><code>GammaShape &lt;- data.frame(Format, Shape, stringsAsFactors = FALSE) </code></pre> <p>Second: for loops are a really inefficient way to modify dat...
33,535,056
0
<p>It looks like this has nothing to do with wallet, but instead is an issue with the version of <code>com.balysv:material-ripple</code> you are using as per <a href="https://github.com/balysv/material-ripple/issues/31" rel="nofollow">this issue</a>.</p> <p>The <a href="https://github.com/balysv/material-ripple" rel="...
29,495,239
0
How do you use @Inject with an ejb-jar with (one or more) WAR files? <p>Working with GlassFish, trying to be tidy, I would like to put all of my business logic into a single EJB JAR. I then have 2 WAR files. </p> <ul> <li>app-frontend-war </li> <li>app-backend-war</li> <li>app-logic-ejb</li> </ul> <p>Each of the WAR fi...
33,627,536
0
<p>You have just forgotten the <code>new</code> in this line</p> <pre><code>$someclass = someOtherClass(); </code></pre> <p>It should be </p> <pre><code>$someclass = new someOtherClass(); </code></pre> <p>Then everything works. Although this only applies to the second version of your question, not the first!</p>
39,503,721
0
Perl Regex -?\d+(?:\.\d+)? <p>This regex is supposed to match any numbers (real or integer - no scientific notation). However, I am not sure what is the use of '?:' inside the parentheses. Could anyone explain this along with some examples? Thank you very much.</p>
17,886,893
0
<p>If the query builder is done in house, and if your query builder returns a the SQL statement in a string, you can parse it either looking for Update statements keyworks or with Regex, if you want to spare the users the trouble of creating an update query then realizing that they can't run it, then you should consid...
7,060,185
0
<p>You could break the word into an array of letters, and loop over this using a random number to determining case, after looping the array, simply stick the letters back together using NSMutableString.</p> <p>NSString had a uppercaseString and lowercaseString methods you can use.</p>
22,937,003
0
HTTP Illegal state exception <p>I have the following code, which in general works without problems:</p> <pre><code>HttpPost post = new HttpPost(sendURL); StringEntity se = new StringEntity( postJSON.toString(), "UTF-8"); se.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, "application/json")); post.setEntity(se); resp...
13,781,147
0
<p>You are only catching <code>SQLException</code> objects, and <code>NullPointerException</code> is not a subclass of <code>SQLException</code>. You can insert <code>NullPointerException|</code> to catch those also; see <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/language/catch-multiple.html" rel="...
40,702,416
0
<p>Got it working....had to return promise from child parent which is t.none() without catch()</p>
7,686,048
0
<p>You can use:</p> <pre><code>xhr.timeout = 10000; xhr.ontimeout = timeoutFired; </code></pre> <p>for this purpose</p>
22,619,826
0
Report Pending Payments with mixed Monthly & Weekly intervals <p>We are working with a database that tracks payment plans for patients. Some patients pay monthly, some weekly, and some every other week.</p> <p>The PaymentsSchedule table fields are Patient, Frequency, NextDueDate, PaymentsRemaining, Amount. Once a payme...
20,958,023
0
A simple C# Statement works unexpected <p>I've got this line of code: </p> <pre><code>int WStoneCost = PriceMethod.StoneCost / 100 * AP; </code></pre> <p>While PriceMethod.StoneCost is equal to 25 and AP is equal to 70. I've checked it using breakpoints and I can't understand why do I get zero after I run this line. (W...
25,952,788
0
<p>Try this:</p> <pre><code>var result = list.Select(x =&gt; new[] { x.Key, x.Value }).ToArray(); </code></pre>
30,883,823
0
<p>Partial answer:</p> <p>Try all permutations of all subsets of your digits, probably starting with the largest candidates.</p> <p>If your factors contain <code>5</code> the <em>last</em> digit must be <code>0</code>or <code>5</code></p> <p>If your factors contain <code>3</code> or <code>6</code> or <code>9</code> th...
13,946,115
0
<p>You must add <code>MessageUI.framework</code> to your Xcode project and include a </p> <p><code>#import &lt;MessageUI/MessageUI.h&gt;</code> in your header file.</p> <p>try this code may be its helpful to you..</p> <pre><code>[self presentModalViewController:picker animated:YES]; //[self becomeFirstResponder];//try...
36,910,275
0
<p>Do you need to use reflection? If you have control of the classes that you are iterating over, it would be better to create an interface. Reflection is slow and should be avoided where possible.</p> <pre><code>public interface IDocumentCreator { void GenerateDocument(); } </code></pre> <p>Add this interface to your...
2,053,294
0
<p>If I understand what you're trying to do... you can do something like this:</p> <pre><code>// For my benefit, hide all lists except the root items $('ul, li', $('#lesson-sidebar ul li')).hide(); // Show active parents and their siblings $('li a.active').parents('ul, li').each(function() { $(this).siblings().andSelf...
5,306,229
0
<p>You've set the variable i in the line <code>var i = document.getElementById('i').innerHTML = (document.getElementById("nine").value);</code>. <code>i</code> refers to the variable i, not to the control with id i.</p> <p>You'll have to do</p> <pre><code>var a = document.getElementById('number').value </code></pre> <...
13,754,753
0
<p>If the table data is added by JS then you might want to add an on() handler like:</p> <pre><code>$('#area-work-time').on('change','input[type="checkbox"]',function(){ alert("inside change event"); }); </code></pre> <p>This makes the event trigger for dynamically created elements.</p>
23,725,631
0
C++ inherit template class <p>I've got a peculiar request, hopefully it's not too far fetched and can be done.</p> <p>I've got a template class</p> <pre><code> template&lt;class T&gt; class Packable { public: // Packs a &lt;class T&gt; into a Packet (Packet &lt;&lt; T) virtual sf::Packet&amp; operator &lt;&lt;(sf::Pack...
30,136,090
0
Single <br /> doesn't create a line break instead, requires two <p>I am working on a Wordpress theme and have been using Bootstrap a bit. I put my article excerpt for the homepage in a well, <code>div class='well'</code>. I have edited the well to have straight corners and have changed the border colour. Except those, ...
14,425,763
0
<p>Create: app/code/local/Ffdotcom/Helloworld/etc/config.xml</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;config&gt; &lt;modules&gt; &lt;Ffdotcom_Helloworld&gt; &lt;version&gt;1.0.0&lt;/version&gt; &lt;/Ffdotcom_Helloworld&gt; &lt;/modules&gt; &lt;frontend&gt; &lt;routers&gt; &lt;helloworld&gt; &lt;use&gt;standard&l...
37,524,896
0
<p>Guava Caches store values in RAM. See <a href="https://github.com/google/guava/wiki/CachesExplained#applicability" rel="nofollow">https://github.com/google/guava/wiki/CachesExplained#applicability</a>.</p>
33,539,108
0
<p>... and you could use the OpenNTF Domino API that has functions for exactly this. As far as I remember there is an example of this in the demo database. Not sure if it is also in the <a href="http://www.openntf.org/main.nsf/project.xsp?r=project/OpenNTF%20Domino%20API%20Demo%20Database" rel="nofollow">new version o...
1,680,681
0
<pre><code>string script = string.Format("alert('this is alert');"); ScriptManager.RegisterClientScriptBlock(Page, typeof(System.Web.UI.Page), "redirect", script, true); </code></pre>
668,299
0
<p>Not only are continuations monads, but they are a sort of universal monad, in the sense that if you have continuations and state, you can simulate any functional monad. This impressive but highly technical result comes from the impressive and highly technical mind of <a href="http://www.diku.dk/hjemmesider/ansatte/...
35,860,010
0
<p>I also faced same problem, but when I added a space into the empty div, it started positioning properly. i.e.</p> <pre><code>div.innerHTML = &amp;nbsp;&amp;nbsp; </code></pre>
18,271,791
0
<p>There are many options and they're all very easy to pick up in a couple of days. Which one you choose is completely up to you.</p> <p>Here are a few worth mentioning:</p> <p><strong><a href="http://www.tornadoweb.org/">Tornado</a>: a Python web framework and asynchronous networking library, originally developed at ...
20,709,676
0
Multiple Select Statements <p>I am trying to create a list of items in which every fourth item in the list is an item that is on from New York and On Sale. The rest of the items in the list are the items that are from New York no matter if they are on sale or not. </p> <p>How can I properly use two select statements to...
29,785,839
0
<p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>var url = 'http://website.com/testing/test2/', //URL to convert lastSlash = url.lastIndexOf('/'), //Find the last '/' middleUrl = url.substring(0,lastSlash); //Make a new...
24,574,034
0
<p>You can sort the elements before adding them to the DOM and then add them; that should work.</p> <pre><code>var statecontent = ['&lt;option value="Texas" data-code="TX"&gt;Texas - TX&lt;/option&gt;', '&lt;option value="Washington" data-code="WA"&gt;Washington - WA&lt;/option&gt;', '&lt;option value="Maryland" data-...
12,932,793
0
<blockquote> <p>Why is this the case that an empty class without any values already needs 220 bytes for saving itself?</p> </blockquote> <p>Why ask what you can find out? This code already yields 33 bytes:</p> <pre><code>FileStream fs = new FileStream("Serialized.dat", FileMode.Create); BinaryFormatter formatter = new...
7,456,443
0
<p>No. You'd have to expose the static instance to the caller. Reference equality means that it is exactly the same object. Unless there is a way to access that particular object, you can't have another that references the same memory. If you were to use the equality operator, that would be different as <code>string</...
24,570,351
0
<p>If you declare the variable outside of a method, the state is remembered.</p> <p>A solution could be:</p> <pre><code>public class Test { int count = 0; public static void main(String[] args) { Test test1 = new Test(); test1.doMethod(); test1.doMethod(); test1.doMethod(); } public void doMethod () { count++; System....
9,024,058
0
jQuery time and date <p>I am looking for a time output using jQuery, for example, would be great to know what time it is on the visitor's browser and the current day (friday,saturday,monday, etc...).</p> <p>Is there any way to do it only with jQuery? I don't really like the way javascript handles time issues. </p> <p>I...
27,081,217
0
Comparing values in a stl list<> that is populated with a class <p>I've been playing around with my code, trying to better it and im stuck a this part.</p> <p>I have the following header</p> <p>Funcionario.h</p> <pre><code>class Funcionario { private: std::string Userid; std::string Nome; std::string Sobrenome; std::st...
29,913,138
0
<p>You can use <code>sprintf</code> and then trim the zeros. This is the same idea as @Havenard's answer, but writing spaces over the zeros instead of cutting the string. And my C-style is somewhat different FWIW. My style is that I don't want to count or do any arithmetic in my head; that's what the C optimizer is fo...
23,406,407
0
Regex of path not working <p>I need to create reg-ex for path like aaaa/bbb/ccc or aaa-bbb or aaa_bbb_ccc_ddd etc How should I do that ? It can contain only <strong>alpha numeric with hyphen underscore and slash</strong>. Ive tried something like this which is not working</p> <pre><code>@"^((?:/[a-zA-Z0-9]+)+/?|/?(?:[a...
10,522,260
0
<p>If you want to create a new object from a class of which the name is stored in a string, you can use:</p> <pre><code>$object = new $className(); </code></pre> <p>Or in your case:</p> <pre><code>$option = new $_POST['option_name'](); $option-&gt;calculated(); $option-&gt;create_record_for_database(); </code></pre> <...
35,450,932
0
<p>As you want to avoid recursion, you need to reverse the list first. I see some attempt in the original code but it doesn't look correct. Try the following:</p> <pre><code>node *current = head; if (current != NULL) { node *prev = NULL; for (node *next = current-&gt;next; ; next = (current = next)-&gt;next) { current...
14,184,695
0
<p>This is a by-product of what Visual C++ refers to as <strong>Identical COMDAT Folding</strong> (ICF). It merges identical functions into a single instance. You can disable it by adding the following switch to the linker commandline: <code>/OPT:NOICF</code> (from the Visual Studio UI it is found under <em>Properties...
2,401,438
0
MVC Model Implementation? <p>I am creating a simple application using the MVC design pattern where my model accesses data off the web and makes it available to my controllers for subsequent display. </p> <p>After a little research I have decided that one method would be to implement my model as a singleton so that I ca...
1,777,744
0
<p>Named Pipes can be used for this. It might be the more acceptable method with .net.You can define a service in the main application that accepts a message from the calling application. Here's a sample of the service, in vb. It calls the main app and passes a string to it, in this case, a filename. It also returns a...
28,856,611
1
Set a global variable in other function <p>I am trying to set the value of area and perimeter variable that are calculated in "on_button" function and use those in labels. I am confused with using global in the code, because some says its not good. </p> <pre><code>import Tkinter as tk class SampleApp(tk.Tk): def __init...
30,163,242
0
<p>If you <em>uninstall</em> packages, then you run the risk of removing things that were already there, but happened to be upgraded. As a rule, you should use <code>yum</code> (or equivalent) for managing packages, which allows you to <em>downgrade</em> a package. This would remove new packages, and downgrade existin...
32,893,610
0
<p>To fix the first block issue:</p> <blockquote> <p>Value of type '<code>UIDynamicBehavior</code>' has no member 'items'</p> </blockquote> <pre><code>let attachmentBehavior:UIAttachmentBehavior = behavior as! UIAttachmentBehavior </code></pre> <p>To fix the second issue:</p> <blockquote> <p>Cannot convert return expr...
14,828,872
0
<p>These postfixes commonly says what is the role of the object.</p> <p>For objects intended to transfer data, it is common to add the <strong>TO</strong> suffix, so we have <code>ServerTO</code>, <code>AccountTO</code>, <code>UserTO</code>, <code>CompanyTO</code>, <code>CustomerTO</code>, <code>SaleItemTO</code>, etc...
2,452,771
0
<p>So modify the two lines to:</p> <p>movlps QWORD PTR[rdx], xmm7</p> <p>movss dword ptr [rdx+8], xmm6</p> <p>like here: <a href="http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/4f473acb-7b14-4bf4-bed3-e5e87e1f81e7" rel="nofollow noreferrer">http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread...
39,428,767
0
<p>When</p> <pre class="lang-java prettyprint-override"><code>String sql = "update StudentDatabaseS set RollNo = ?, FullName = ?, FatherName = ?, FatherCNIC = ?, DateOfBirth = ?, Class = ?, Address = ?, City = ?, Province = ? where RollNo = '"+Srollno+"'"; </code></pre> <p>the line</p> <pre class="lang-java prettyprin...
36,900,596
0
<p>I'm struggling with this on IIS right now and in my struggles, stumbled across an excellent guide for Apache: <a href="https://ngmilk.rocks/2015/03/09/angularjs-html5-mode-or-pretty-urls-on-apache-using-htaccess/" rel="nofollow">https://ngmilk.rocks/2015/03/09/angularjs-html5-mode-or-pretty-urls-on-apache-using-hta...
16,982,112
0
jQuery menu acting strangely <p>on click, the div should move up and be mostly hidden, and then on click again, move back down to original position. Yea.... it's so not doing that. I used animate to move the div +100px, and then -100px, but it is not moving up and off the screen to be hidden. Instead, it moves DOWN, an...
33,260,317
0
<p>I finally settled on using a file-based lock to ensure that the task doesn't run twice:</p> <pre><code>def get_lock(name): fd = open('/tmp/' + name, 'w') try: flock(fd, LOCK_EX | LOCK_NB) # open for exclusive locking return fd except IOError as e: logger.warn('Could not get the lock for ' + str(name)) fd.close() re...
30,863,431
0
<p>In oracle, you can use <code>start with connect by</code> to achieve the same result, no need to use nested query</p> <p>Preparation</p> <pre><code>CREATE TABLE EMP ( EMPNO numeric(4,0), ENAME VARCHAR(10 ), JOB VARCHAR(9 ), MGR numeric(4,0), HIREDATE DATE, SAL numeric(7,2), COMM numeric(7,2), DEPTNO numeric(2,0) );...
34,730,662
0
iOS CoreData fails to fetch data <p>I am developing an application for iOS which has .xcdatamodeld file with a couple of entities, one of which is UserInfo with an attribute "name" of type <code>String</code>. Now that I am on stage of developing I don't always get entities fetched (I rarely do) and therefore I've got ...
19,684,732
0
Program of consumer Producer <p>I need to make a consumer producer problem for homework. I am stuck repeating the the thread. Only 1 object is produced and only 1 object is consumed. If object is present in array then producer does not produce and wait till consumer consumes it. </p> <pre><code>class PC extends Thread{...
24,832,063
0
<p>OK So I have fixed whatever issue was causing it to crash, below is what I changed:</p> <p>Step One: Created entirely new project and completed developer console, published just a simple button to login. It works. I now know that my Unity3d, Android APK and Developer Console procedures are all correct.</p> <p>Step ...
13,457,679
0
Mailto link with display name in non-Latin characters doesn't work correctly in Chrome browser <p>I have the following problem in Chrome browser: When I have a mailto link with display name in non-Latin characters and email address the right button->copy email address->paste anywhere doesn’t work correctly. The display...
35,367,363
0
<p>Ok, so I solved it (pretty much). The password and username in my odbc files were being ignored. Because I was calling the DB queries from Asterisk, I was using a file called res_odbc.ini too. This contained my username and password also, and when I run the query from Asterisk, it conencts and returns the correct r...
6,153,297
0
Opening another window in an Appcelerator Titanium-app doesn't work <p>I've got basically 5 windows in my iPad-application (created with Appcelerator Titanium) and want to be able to navigate forth and back (a back and and a next-button for that purpose). The following approach doesn't work. Nothing happens upon clicki...
7,009,813
0
<p>Try by using the <a href="http://silverlight.codeplex.com/" rel="nofollow">Silverlight toolkit for Windows Phone 7</a>. If you need to capture the Tap event on the page, you've to use the services of the GestureListner class. </p> <pre><code>&lt;phone:PhoneApplicationPage xmlns:toolkit="clr-namespace:Microsoft.Phon...
39,862,765
0
How do I get the device given a UUID from libblkid? <p>I know how to get the UUID of a device via libblkid... how do I do the reverse?</p> <p>Given a UUID, I want to find what the device path is.</p>
15,908,210
0
<p>This is probably because your background image doesn't get repeated (as do the corner images) therefore, it will get covered up by one of the corner pictures. Try to set the first background-image to repeat:</p> <pre><code>background-repeat: repeat, no-repeat, no-repeat, no-repeat, no-repeat; </code></pre>
17,371,953
0
<p>I think so yes</p> <pre><code>1.9.3-p392 :002 &gt; DateTime.new =&gt; Mon, 01 Jan -4712 00:00:00 +0000 1.9.3-p392 :003 &gt; _.cwday =&gt; 1 </code></pre>
26,794,670
0
<p>You must call reader.mark() <em>before</em> the first while loop; reader.mark() essentially saves the current position of the reader so that you can go back to that position when you call reader.reset().</p> <p>You will also not want to pass in 0 to reader.mark(). See the java spec for the parameter below:</p> <p>r...
11,446,667
0
<p>Instead of .subproject_thingie1 and .subproject_thingie2 everywhere I usually go for adding a root class or id to differentiate between projects/pages.</p> <p>That way you can have global styling maintained on all pages on the same class names while being able to add specific rules for specific pages.</p> <p>But as...
20,202,989
0
The scientific study of the principles of heredity and the variation of inherited traits among related organisms.
14,334,909
0
Sprite not showing renderToTexture Map / rendertarget map <p>I am working with three.js and I set up a second scene and camera and added a cylinder to it. Now I setup a rendertarget and I wanted to show this renderedScene on a sprite (HUD-Sprite so to say), but the sprite is not showing up. I added a plane into the ori...
38,689,468
0
<p>change the trigger element to button.</p> <pre><code> triggerEl: 'button' </code></pre>