pid
int64
2.28k
41.1M
label
int64
0
1
text
stringlengths
1
28.3k
37,322,582
0
<p>I used some deprecated event detection methods before and when I updated my code, my server did not clear the cache after flushing it 5 times.</p> <p>The code is fine, thus problem solved !</p>
39,620,324
0
<p>Add your forked Sylius repository like this in your composer.json</p> <pre><code>"repositories": [ { "type": "git", "url": "https://github.com/ylastapis/Sylius.git" }], </code></pre> <p>You can either require your master branch or create a custom branch (to merge your code pending that Sylius team accepts your merg...
24,642,324
0
<p>That's one of the downsides of having API's that returns <code>null</code>. The <a href="http://en.wikipedia.org/wiki/Null_Object_pattern" rel="nofollow">Null Object</a> pattern could have been used here to simplify the API, relieving the clients from dealing with null values.</p> <p>".offset() returns an object co...
11,747,206
0
<p>To use this code:</p> <pre><code>(BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text { if([text isEqualToString:"\n"]) { NSString *modifiedString = [textView.text stringByAppendingString:@"\n\u2022"]; [textView setText:modifiedString]; return NO; } return YE...
8,716,830
0
<p>You can parse the parameters of the url with javascript easily, then check if that particular 'nofade' param exists (or any other) and fade your image if it does</p> <pre><code>$(function(){ // Grab our url parameters and split them into groups var hashes = window.location.href.slice(window.location.href.indexOf('?...
30,349,049
0
<p>Use <code>int.TryParse</code> to parse the string to int. You also have some issues like sql injection and not using the <code>using</code>-statement. </p> <pre><code>private void iD_FurnizorComboBox_SelectedIndexChanged_1(object sender, EventArgs e) { int id_furnizor; if(!int.TryParse(iD_FurnizorComboBox.Text, out...
29,775,723
0
<p>I had a bit similar problem. Which was actually being raised due to the duplication of name attribute of the job listener; which should be unique.</p> <p>jobWasExecuted() method of listener gets called after the execute method of the job has finished its work. Roughly the Call hierarchy is like this</p> <ol> <li>Li...
26,189,656
0
How can I set an NSDate object to midnight? <p>I have an <code>NSDate</code> object and I want to set it to an arbitrary time (say, midnight) so that I can use the <code>timeIntervalSince1970</code> function to retrieve data consistently without worrying about the time <em>when</em> the object is created.</p> <p>I've t...
6,376,252
0
<p>COALESCE() function could be your friend here.</p>
16,887,247
0
<p>The std::getline function you're using saves an input to a string (see: <a href="http://www.cplusplus.com/reference/string/string/getline/" rel="nofollow">http://www.cplusplus.com/reference/string/string/getline/</a>). If the argument you pass to the function was a string, it would get the whole line from your file...
36,531,298
0
<p>This should work for you:</p> <pre><code>SELECT * FROM E WHERE EXISTS ( SELECT 1 FROM A JOIN B ON A.B_key = B.B_key JOIN C ON B.C_key = C.C_key JOIN D ON C.D_key = D.D_key WHERE D.E_key = E.E_key AND A.A_key = ? ) </code></pre>
18,673,345
0
<blockquote> <p>I am not sure how to tell regex "look for this in a new line, if it's there, capture the line. if it's not there, just stay on the current line.</p> </blockquote> <p>You could just match the new line as part of an expression repeated multiple times, e.g:</p> <pre><code>\d{3}(\n\d{3})* </code></pre> <p>...
14,557,076
0
<p>Just guessing at what you're trying to do here....</p> <pre><code>Set range1 = wbk1.Worksheets(1).Range("R3:R20") 'are range 2 and 3 on the same row? Set range2 = wbk2.worksheets(2).Range("N" &amp; .Rows.Count).End(xlup).Offset(1,0) Set range3 = wbk2.worksheets(2).Range("O" &amp; .Rows.Count).End(xlup).Offset(1,0) ...
29,308,065
0
MYSQL Query Count in time interval <p>My goal is to be able to graph the number of calls every X (5 minutes, or weekly or monthly) intervals and if there are no calls, indicate that as well. In the following example the interval is every 5 minutes. call_date and called_num are both fields in a mysql table. Call_interva...
32,019,322
0
HOWTO create GoogleCredential by using Service Account JSON <p>I am using the Java SDK for <code>Android Publisher v2</code> and <code>Oauth2 v2</code>. Once I created the service account I was provided with a JSON of <code>Google Play Android Developer</code> service account with client id, email, private key etc. I h...
14,396,233
0
<p>For smaller numbers (counts) you can use <code>stripchart</code> with <code>method="stack"</code> like this:</p> <pre><code>stripchart(c(rep(0.3,10),rep(0.5,70)), pch=19, method="stack", ylim=c(0,100)) </code></pre> <p>But stripchart does not work for 700 dots.</p> <hr> <p><em>Edit:</em></p> <p>The <code>dots()</co...
28,436,502
0
Global data from eloquent in Laravel to be used for layout <p>I am using some variables in the layout which will load data from the eloquent. For this purpose I am using repository pattern which are injected into the controller through constructor. But obviously, I don't want to repeat this logic in every controller I ...
30,324,059
0
Create a Function which returns -1 for empty matrix, 0 for scalar, 1 for vector, 2 for none of these <p>I am not allowed to use <code>isempty</code>, <code>isscalar</code>, or <code>isvector</code>.</p> <p><strong>My code is :</strong></p> <pre><code> function a = classify(x) b = sum(x(:)); c = sum(b); if c == 0 a = -1...
35,407,772
0
HTML2Canvas does not display in new window <p>I have tried to display the contents of the body tag in HTML using the following code</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script src="jspdf.debug.js"&gt;&lt;/script&gt; &lt;script src="//cdn.rawgit.com/niklasvh/html2canvas/0.5.0-alpha2/dist/html2canvas.min.js"&gt;&...
1,358,282
0
<p>As specified on MSDN, </p> <blockquote> <p>A multidimensional array is serialized as a one-dimensional array, and you should use it as a flat array.</p> </blockquote> <p>As specified by Phil.Wheeler, this code does what you want:</p> <pre><code>List&lt;int[]&gt; name = new List&lt;int[]&gt;(){ new int[]{ 23, 21, 10...
37,994,259
0
<p>When a user makes a request using Goutte, a <code>Symfony\Component\DomCrawler</code> instance is returned. The Crawler object provides the <a href="http://symfony.com/doc/current/components/dom_crawler.html#links" rel="nofollow">Crawler::links()</a> utility method, providing all links within the given crawler obje...
21,094,040
0
<p>This issue has been fixed in the latest version of scikit-image.</p>
19,461,888
0
<p>what command are you using to insert below? </p> <p>If you use the standard "o" keystroke while in Navigation mode, it should insert a new line immediately below whatever the cursor is on, and automatically place you into Insert mode, without inserting an extra "</p> <p>Similarly an uppercase "O" will insert a new ...
32,120,721
0
<p>what I am doing right now: forget about <code>gtk.builder.connect_signals</code>.</p> <p>so after your code:</p> <pre><code>ui_builder = gtk.Builder() ui_builder.add_from_file('main.ui') self.win_main = builder.get_object('win_main') </code></pre> <p>I would have something similar to this:</p> <pre><code>list_of_ha...
27,428,376
0
<p>I am 100% agree with nickL you have some formating issue in your query try to replace your search query by this:</p> <p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-override"><code> $firstname=$_POST['firstname']; $surname=$_PO...
35,590,776
0
Can I create and open an HTML file with VBA? <p>I have a function that generates the HTML, CSS, and JS that I want. All the code is stored in a string variable.</p> <p>How would I get VBA to create a .html file and open it in the default web browser?</p>
25,503,137
0
<p><code>btc_usd</code> and <code>btsx_btc</code> are promises, not numbers! You cannot simply multiply them - and you <a href="http://stackoverflow.com/q/14220321/1048572">can't make the asynchronous <code>getJSON</code> return a number</a>. Instead, use <a href="http://api.jquery.com/jQuery.when/" rel="nofollow"><co...
32,066,015
0
<p>So basically you just want to remove all from the first list which appear in the second list and performance is important?</p> <p>I like <a href="http://stackoverflow.com/a/32013973/284240">Georges approach</a> most, it is the most efficient if the list is getting large. But <code>List.RemoveAll</code> is also more...
10,612,401
0
<pre><code>$('div.hide').hide(300,function() { // first hide all `.hide` $('#'+ id +'.hide').show(); // then show the element with id `#1` }); </code></pre> <p><em><strong>NOTE: DON'T USE ONLY NUMERIC ID. NOT PERMITTED. <a href="http://stackoverflow.com/questions/7987636/why-cant-i-have-a-numeric-value-as-the-id-of-an...
39,221,893
0
PHP counting the letters in a word (HANGMAN) <p>I am trying to make a hangman game. I have a few words in an array and when one of them is picked I want to count how many letters are in that word so that it can then make that amount of spaces or dashes. Also I need an efficient way to put each letter of the word onto t...
22,516,992
0
<p>To match a whole string that doesn't contain <code>101</code>:</p> <pre><code>^(?!.*101).*$ </code></pre> <p>Look-ahead are indeed an easy way to check a condition on a string through regex, but your regex will only match alphanumeric words that do not start with <code>101</code>.</p>
37,661,774
0
<p>Change your <code>baseurl: ""</code> in _config.yml to <code>baseurl: "/"</code>.</p> <p>The code in your head.html include is <code>&lt;link rel="stylesheet" href="{{ "css/main.css" | prepend: site.baseurl }}"&gt;</code></p> <p>Jekyll renders this code as <code>&lt;link rel="stylesheet" href="css/main.css"&gt;</co...
21,673,866
0
<p>We managed to find a solution so I'm going to respond to myself just in case someone else has the same problem and is looking for a fix. </p> <p>We created a new page and started copying the code from the page across. We would publish the website after we added some code and tested that we could browse to the page,...
11,327,496
0
Web architecture with c++ backend in Linux best way ? <p>I have php front end that render the GUI ,<br> from there I like to use c++ engine in the backend that gets the users request with data xml structures this c++ engine is responsible to process the data and store it in the DB or files and return the response to th...
40,857,313
0
<p>The problem with:</p> <pre><code>BOOL r = [res isEqualToString:@"\x124Vx\xc3\xaa"]; </code></pre> <p>is with the <code>\x124</code> part. It seems you can only have hex values in the range <code>00</code> - <code>ff</code>. And note the removal of the <code>[ ]</code> around the string.</p> <p>If you don't want the...
13,744,843
0
<p>Above solution gives NaN if any text box is empty. please try this it will give 0. </p> <p>var v1=0; var v2=0;</p> <pre><code>if(!isNaN(parseInt($('input[name=amounty]').val()))){ v1 = parseInt($('input[name=amounty]').val()); } if(!isNaN(parseInt($('input[name=quatity]').val()))){ v2 = parseInt($('input[name=quati...
31,610,124
0
One Button to update GridView <p>I want to update all rows of a GridView one time by clicking one button: aspx:</p> <pre><code>&lt;/asp:ObjectDataSource&gt; &lt;asp:ListBox ID="ListBoxRoles" runat="server" DataSourceID="ObjectDataSourceAllRoles" AutoPostBack="true" DataTextField="RoleName" DataValueField="RoleID" OnSel...
6,728,529
0
<p><a href="https://github.com/TurnWheel/jReject" rel="nofollow">jQuery Browser Rejection Plugin</a> can help you. it supports following browsers disable/enable options:</p> <pre><code> msie: false,msie5: true,msie6: true,msie7: false,msie8: false, // MSIE Flags (Global, 5-8) firefox: false,firefox1: false,firefox2: f...
19,712,488
0
<p>If you could make your <code>IFoo&lt;&gt;</code> interface <strong><em>covariant</em></strong> it would work, that is if you were allowed to change the declaration of it into:</p> <pre><code>public interface IFoo&lt;out T&gt; </code></pre> <p>(note the <code>out</code>). Because with covariance any <code>IFoo&lt;st...
6,625,413
0
<p>Use the attributes:</p> <pre><code>android:paddingTop android:paddingBottom android:paddingLeft android:paddingRight </code></pre> <p>This controls the amount of 'empty' space between the border of the button and the text.</p>
37,487,928
0
<p>Lots of ways to go about this! This is another Vanilla Javascript one, fill free to mix and match according to your actual specs.</p> <pre><code>var fruits = [{ fruit: "apple", selected: false }, { fruit: "pear", selected: false }, { fruit: "orange", selected: false }, { fruit: "pineaple", selected: false }, { frui...
29,935,830
0
How do I destructuring-match syntax::ptr::P? <p>I have a function which tries to match an <code>syntax::ast::ExprBinary(syntax::ast::BinOp, syntax::ptr::P&lt;ast::Expr&gt;, syntax::ptr::P&lt;syntax::ast::Expr&gt;)</code>, but I cannot find the right syntax to match the <code>P</code> so I get the contained expression o...
32,910,458
1
Selecting only updated record in delta <p>Trying to compare 2 tables in the same db. Table 1 is the main historical table, table 2 is the temporary table with new data rcvd from server and used to update table 1. </p> <p>Need to output the items in table 1 that have a change in one of the fields on table 2. </p> <p>i.e...
8,702,630
0
<p>You would access the superglobal <a href="http://php.net/manual/reserved.variables.server.php" rel="nofollow"><code>$_SERVER</code></a> and its key <code>HTTP_HOST</code>:</p> <pre><code>echo 'Hello, and welcome to ' , $_SERVER['HTTP_HOST']; </code></pre>
28,118,598
0
How to change this jquery fiddle to have the first div open/active by default? <p>I found this fiddle (<a href="http://jsfiddle.net/m6aRW/109/" rel="nofollow">http://jsfiddle.net/m6aRW/109/</a>) that does exactly what I need it to do for me. However, how can I alter it so that #div1 is open on page load? Just using dis...
26,824,566
0
how to prevent user response during delay before the AI response <p>I am having trouble with being able to keep activating buttons before my AI response in a Tic Tac Toe game. As you can see I added a delay response, but I am still able to do another turn even before my AI responds. Anyone knows how to disable the firs...
23,087,362
0
<p>The two <code>loaddata</code> are the same thing, but <code>syncdb</code> is a command that creates database tables loads the initial data for that app.</p> <p>You would use <code>loaddata</code> to load a fixture into a database and <code>syncdb</code> to set up your database for a new app.</p> <p><code>manage.py<...
28,810,175
0
<p>The values are posted to the controller, bot the problem is with controller parameter binding, because the names from the parameter and the drop down list is different. If you change the name of the controller parameter list from "SelectedIds" to drop down list name "FuncionarioId" it should work. So change this:</...
18,856,303
0
TeamCity url to view report tab of latest build <p>Here is the url to a custom report tab of a specific build:</p> <p><code>http://teamcity/viewLog.html?buildId=1738&amp;buildTypeId=bt16&amp;tab=report_TODO_items</code></p> <p>What I cannot figure out is how to change that URL to always point to the latest build (finis...
12,970,823
0
<p>Try to execute this first ,and check whether anyone from <code>other session</code> or <code>your session</code> put a lock on that table .If <code>you</code> have put a lock on that table,try to do <code>commit/rollback</code> .If <code>someone else</code> put a lock ,ask <code>him/her</code> or if you have rights...
21,469,296
0
<pre><code>{foreach item="item" from=$root.page.news.item } {foreach from=$item.Tags item=tagitem key=kex} {if !$done.$tagitem} {$done.$tagitem = 1} {$tagitem} {/if} {/foreach} {/foreach} </code></pre> <p>I am not sure it works with all the versions.</p> <p>Maybe it would be a bit cleaner to call an <code>array_unique...
2,651,880
0
<p>Try changing &lt;%= to &lt;%# within your jQuery script. Check out <a href="http://leedumond.com/blog/the-controls-collection-cannot-be-modified-because-the-control-contains-code-blocks/" rel="nofollow noreferrer">this article</a></p>
30,544,445
1
Scrapy pipeline html parsing <p>I have a spider with 3 items: url, title and category. </p> <p>They are loading fine in raw html but now I would like to convert title and category into plain text using html2test in a pipeline..</p> <p>Here is my incorrect pipeline code, could someone help debugging it.</p> <p>Thank you...
7,515,672
0
Modal blocking dialog in Javascript <p>I'm developing Openlayers toolbar in Javascript with jQuery and jQuery UI.</p> <p>One feature that I want to implement is Adding points to the map.</p> <p>In openLayers you have to listen for event called 'sketchcomplete'.</p> <pre><code>layer.events.on({ 'sketchcomplete': onPoint...
12,289,338
0
<p>First - you should be able to just use <a href="http://msdn.microsoft.com/en-us/library/s2tte0y1.aspx" rel="nofollow"><code>File.ReadAllLines</code></a> instead of reading the text and splitting....</p> <p>You may need to trim the results. If there is extra whitespace on the lines, the condition may fail. Try using...
7,732,753
0
<p>Make a shared assembly (.dll) We use that for our products and its working very well. We have like 4-5 WPF based shared assemblies. In Visual Studio we just used the "WPF Custom Control Library" instead of an App.xaml you have a Themes/Generic.xaml which will be loaded automatically if you add the reference to your...
21,121,561
0
<p>Here's a fairly simple algorithm to overlap two strings:</p> <pre><code>#include &lt;string&gt; std::string overlap(std::string first, std::string const &amp; second) { std::size_t pos = 0; for (std::size_t i = 1; i &lt; first.size(); ++i) { if (first.compare(first.size() - i, i, second, 0, i) == 0) { pos = i; } } ...
22,734,771
0
<p>It's because you set the <code>display:block</code> for your <code>a</code>, so the border will be around the box (which has <code>height</code> set to <code>46px</code>). Looks like you explicitly set <code>padding-bottom</code> to <code>0</code> and then it still should work (the bottom border should be close to ...
28,022,789
0
<p>So far by looking at the source of of pysqlite, I can say that it is not possible to share connection or cursor objects (see <code>pysqlite_check_thread</code> function usage) only. </p> <p><code>pysqlite_check_thread</code> function raises <code>ProgrammingError</code> exception with that message </p> <pre><code>S...
4,486,858
0
<p>For simple enumeration, simply using fast enumeration (i.e. a <code>for…in…</code> loop) is the more idiomatic option. The block method might be marginally faster, but that doesn't matter much in most cases — few programs are CPU-bound, and even then it's rare that the loop itself rather than the computation inside...
6,055,087
0
Query expression to dot notation <p>hei, need some help to convert this linq query to dot notation:</p> <pre><code> var productions = from row in data group row by row.PRODUCTION_NAME into gr select new { Group = gr.Key, Jobs = from row in gr orderby row.SortFieldCard group row by row.JOB_NAME into job select new { job...
4,201,502
0
<p>Here is a clearer view of why a clear is needed. <a href="http://www.quirksmode.org/css/clearing.html" rel="nofollow">http://www.quirksmode.org/css/clearing.html</a></p>
11,745,880
0
Accessing objects parent property in django profiles <p>I am using django profiles with having different types of profiles. </p> <p>My Profile Model of Company is similar to:</p> <pre><code>from django.db import models from django.contrib.auth.models import User from accounts.models import UserProfile from jobs.models ...
23,904,128
0
<p>Follow the below link, I think it will help you to find the solution:</p> <p><a href="http://www.codeproject.com/Articles/631683/Standalone-NET-Framework-exe" rel="nofollow">http://www.codeproject.com/Articles/631683/Standalone-NET-Framework-exe</a></p> <p><a href="http://stackoverflow.com/questions/191251/how-to-i...
12,399,958
0
<p>You are right, there's a limit (and a lot of work arounds techniques) in every processor architecture, but you will run into a lot of messy problems before you run out of numbers. Performance issues related to great amounts of data is a problem that you are likely to have.</p>
29,349,710
0
Can HTML <script defer> execute before <script async>? <p>I'm asking a question on a subject that has been well explored and there are many near-answers to what I am asking, but I haven't been able to find the exact answer to what is a simple question.</p> <p>I understand that defer scripts run in the order they appear...
8,773,632
0
Calling javascript function to get offset of an element <p>I have a draggable div of which when you drop it, it gives you its left and top value and if it contains a specific class.</p> <p>Example:</p> <pre><code>$( "div" ).draggable({ cursor:'move', stop: function() { if ($(this).hasClass('cool')) { var state = "Class...
34,544,749
0
<p>For people who need this in <em>Swift</em></p> <pre><code>func searchBar(searchBar: UISearchBar, textDidChange searchText: String) { // to limit network activity, reload half a second after last key press. NSObject.cancelPreviousPerformRequestsWithTarget(self, selector: "reload", object: nil) self.performSelector("...
33,790,526
0
How to place 3 d3.js charts in a row <p>I want to place 3 d3 charts in a row I tried doing it using bootstrap fro html but it does not help id there a better way to do this</p> <p>My current code</p> <pre><code>&lt;div class="row"&gt; &lt;div class="span4" id="chart_1"&gt;23&lt;/div&gt; &lt;div class="span4" id="chart_...
22,399,792
0
<p>The things that could have gone wrong are:</p> <ol> <li>The website is not responding</li> <li>The JSON is invalid</li> <li>There is some error in your code</li> </ol> <p>This code should tell your what is happening:</p> <pre><code>error_reporting(-1); // Turn on error reporting $url = "http://natomilcorp.com/api/g...
26,721,710
0
<p>On Windows you can use the <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa364418(v=vs.85).aspx" rel="nofollow">FindFirstFile</a> / <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa364428(v=vs.85).aspx" rel="nofollow">FindNextFile</a> APIs to search for files in a path. There is...
11,080,746
0
Get an UIImage from URL to iPhone and iPhone retina <p>I'm trying to get an image from a URL to view it on an iPhone and an iPhone Retina. The problem is that iPhone is displayed correctly but Retina is blurred. The image has a size of 100x100 at 326dpi (size retina). </p> <p>I'm doing it correctly? </p> <pre><code> - ...
26,132,204
0
<p>Back to my initial file, I managed to do some progress. Please find my file here: <a href="http://cjoint.com/14oc/DJbb2yqJ5XQ.htm" rel="nofollow">http://cjoint.com/14oc/DJbb2yqJ5XQ.htm</a></p> <p>I managed to be able to apply the PivotItem.Visible property on "(blank)" by adding this to the code:</p> <pre><code>myt...
31,026,117
0
Fails to look up view in Express <p>This is the structure of my project. </p> <p>app <br> &nbsp; -controllers <br> &nbsp; &nbsp; &nbsp; index.server.controller.js <br> &nbsp; -models <br> &nbsp; -routes <br> &nbsp;&nbsp;&nbsp;&nbsp; index.server.routes.js <br> &nbsp;-views <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;index.ejs <...
36,823,379
0
Why is core.js not loaded in Joomla 3? <p>I am migrating my own Joomla component from Joomla 2.5 to Joomla 3. Some of the buttons use javascript <code>Joomla.submitform()</code>, which was defined in \media\system\js\core.js, but somehow this file is not loaded any more now...</p> <p>I could simply add <code>JFactory::...
29,653,579
0
<p>I think by XPath should work to get all items in a List object:</p> <pre><code>List&lt;WebElement&gt; parameters = driver.findElements( By.xpath(".//[local-name()='OBJECT']/[local-name()='PARAM']") ); </code></pre> <p>=== UPDATE ===</p> <blockquote> <p>Try using a CSS locator instead... it will probably be more rel...
760,329
0
Reimplementing the "ToneMatrix" audio toy <p>There is a really cool audio "toy" called <a href="http://lab.andre-michelle.com/tonematrix" rel="nofollow noreferrer">ToneMatrix</a>. I would like to reimplement it as a Java applet. I've tried using <a href="http://www.jfugue.org/" rel="nofollow noreferrer">JFugue</a>'s <c...
9,344,600
0
<p>Does your app have the permission <a href="http://developer.android.com/reference/android/Manifest.permission.html#WRITE_EXTERNAL_STORAGE" rel="nofollow"><code>WRITE_EXTERNAL_STORAGE</code></a> specified in your manifest?</p>
23,395,550
0
<p>Without looking at any source code, I would guess that one way would be to convert a character to its' respective ASCII value, subtract 32 from it and convert the ASCII value back to a char.</p> <p><img src="https://i.stack.imgur.com/x1xKm.png" alt="enter image description here"></p>
6,060,971
0
prevent json_encode adding escape characters <p>Is there a solution to prevent json_encode adding escape characters? I am returning a json obj from an ajax request.</p> <p>Here is what I currently have:</p> <pre><code>foreach ($files as $file) { $inf = getimagesize( $file ); $farr[] = array ( "imgurl" =&gt; "/".str_rep...
8,497,161
0
<p>There are a whole lot of naming conventions advocated by Microsoft for .Net programming. You can read about these <a href="http://msdn.microsoft.com/en-us/library/ms229002.aspx">here</a>.</p> <p>As a rule of thumb, use PascalCase for public property, method and type name.</p> <p>For parameters and local variables, ...
8,040,026
0
<p>I figured it out. I had to change this line in <code>drawRect:</code>:</p> <pre><code>otherPoint.x += dirtyRect.size.width; </code></pre> <p>to</p> <pre><code>otherPoint.x += (stringWidth + 20.0); </code></pre> <p>EDIT: You can change <code>20.0</code> depending on how much of a gap you want before the string repea...
40,143,772
0
docker - build fails when COPYing file to root <p>I'm getting a docker build error when I try to add a shell script to the root directory (/entrypoint.sh)</p> <p>Dockerfile:</p> <pre><code>FROM ubuntu:trusty COPY ./entrypoint.sh / ENTRYPOINT ["/entrypoint.sh"] </code></pre> <p>Output:</p> <pre><code>Sending build conte...
39,190,392
0
<p>There are libraries for testing like those in the <a href="https://docs.python.org/3/library/development.html" rel="nofollow">development-section</a> of the standard library. If you did not use such tools yet, you should start to do so - they help a lot with testing. (especially <code>unittest</code>).</p> <p>Norma...
26,547,142
0
SQL not properly ended? <p>I know i don't have to use SQL but i have other code between declare begin and end . I just extracted this part and everything works except this . I get the following error:</p> <pre><code>Error report: ORA-06550: line 5, column 5: PL/SQL: ORA-00933: SQL command not properly ended ORA-06550: ...
38,596,953
0
IOS Swift- UITbar setting custom tabbar height leaves empty Space above it <p>I would like to know if there is a way to remove the empty space above the tab bar. I using below code in the custom class of UITabBarController. </p> <pre><code>override func viewWillLayoutSubviews() { super.viewWillLayoutSubviews() var tabF...
16,033,257
0
Check remote file existence on multiple Windows servers <p>I need to check a file status (existing? or last modified date) on multiple remote Windows servers (in LAN). The files are accessible via UNC path. The remote PCs need a user name and password. It's best to be some sort of script. </p> <p>I am not system admin,...
1,695,409
0
<p>Make your imageview as big as the image, and put it inside a scrollview. Hide the scrollers if you want. No need for subclassing in this case.</p>
6,730,209
0
<p>You have to read <a href="http://docs.mono-android.net/Android.App.Activity.OnActivityResult%20%28int,%20Android.App.Result,%20Android.Content.Intent%29" rel="nofollow">data</a> parameter of <code>onActivityResult()</code>, in which you can get _id, displayName etc.. </p> <p>Try this code</p> <pre><code>protected v...
19,910,684
0
<p>Assuming "couldn't get it to work" means you didn't know how to loop the six PictureBox controls, try putting them into an array:</p> <pre><code>For Each pb As PictureBox In New PictureBox() {steen1, steen2, steen3, steen4, steen5, steen6} Select Case RandomNumber.Next(1, 7) Case 1 : pb.Image = Game.My.Resources.Ee...
18,009,578
0
<p>You can simply use <code>NSURLCredential</code>, it will save both username and password in the keychain.</p> <p>See my detailed answered on <a href="http://stackoverflow.com/a/17997943/249869">http://stackoverflow.com/a/17997943/249869</a>.</p>
9,278,749
0
<p>I assume that the box opens right as from the link you provided. You can add another class for the box to open left (say boxleft)</p> <pre><code>$('.content_area div').hide(); initwidth = $('.boxleft').width(); initHeight = $('.boxleft').height(); $(function() { $('.boxleft').bind('mouseenter', function() { $(this)...
2,852,961
0
<p>It's identical to commenting out the block, except with one important difference: Nesting is not a problem. Consider this code:</p> <pre><code>foo(); bar(x, y); /* x must not be NULL */ baz(); </code></pre> <p>If I want to comment it out, I might try:</p> <pre><code>/* foo(); bar(x, y); /* x must not be NULL */ baz...
28,602,783
0
ASP.NET mvc validation label on dropdownlist with integer value? <p>I'm working on an ASP.NET MVC 4 project and I have an issue with displaying the right validation label for an integer field. </p> <p>Here is my model properties:</p> <pre><code>[Required(ErrorMessage = "Please enter the title.")] public string Title { ...
4,543,948
1
Python: type() gives blank result <p>What does it mean when I do</p> <pre><code>print type(foo) </code></pre> <p>and get absolutely nothing?</p> <p>foo is the response from an eBay REST search query, and it's supposed to be XML according to the eBay docs. When I</p> <pre><code>print foo </code></pre> <p>I get stuff -- ...
29,695,953
0
<p>Change:</p> <pre><code>from osv import fields, osv </code></pre> <p>to:</p> <pre><code>from openerp.osv import fields, osv </code></pre> <p>That should do it! :]</p>
35,264,429
0
<p>I was given a task to invoke the batch job one by one.Each job depends on another. First job result needs to execute the consequent job program. I was searching how to pass the data after job execution. I found that this ExecutionContextPromotionListener comes in handy.</p> <p>1) I have added a bean for "ExecutionC...
4,033,061
0
<p>The problem is that a <code>RewriteCond</code> only applies to the rule immediately following it, so your second <code>RewriteRule</code> is always run. One solution <a href="http://my.galagzee.com/2009/02/11/mod_rewrite-one-rewritecond-to-many-rewriterules/" rel="nofollow">is to negate the test you are making, the...
26,117,059
0
<p>Here's a unicode aware implementation as a category on <code>NSString</code>:</p> <pre><code>@interface NSString (NRStringFormatting) - (NSString *)stringByFormattingAsCreditCardNumber; @end @implementation NSString (NRStringFormatting) - (NSString *)stringByFormattingAsCreditCardNumber { NSMutableString *result = ...
21,578,803
0
<p>I have now managed to get it working. I have had to set the prefix for the plugins models to "media_" and then have the class names as "Media.Item" and call "$this->Item->find()" to get the containable behaviour to work.</p>