pid
int64
2.28k
41.1M
label
int64
0
1
text
stringlengths
1
28.3k
5,511,715
1
Python - Understanding error: IndexError: list index out of range <p>I'm fairly new to python. I have an error that I need to understand.</p> <p>The code:</p> <p>config.py:</p> <pre><code># Vou definir os feeds feeds_updates = [{"feedurl": "http://aaa1.com/rss/punch.rss", "linktoourpage": "http://www.ha.com/fun.htm"}, ...
9,897,440
0
<p>As suggested, I have tried this and the fork is private</p>
37,353,452
0
<p>I'd like to help, but I'm not quite sure I understand your question. Given the information you have here, that code should work. The only unknown is the actual datatype of the value of the combo, but unless the <code>.Field(Of T)</code> is throwing an InvalidCastException, you should be good there. I wrote the foll...
29,533,891
0
google-apps-script multiple criteria writing over headers <p>I have taken a bit of script from Serge which is great (original <a href="http://stackoverflow.com/questions/25038715/google-apps-script-copy-row-from-table-if-value-in-table-meets-condition">link here</a>. I have added in a second criteria to exclude certain...
20,022,466
0
<p>You need to initialise the <code>dwSize</code> member of <code>CONSOLE_CURSOR_INFO</code>:</p> <pre><code>CONSOLE_CURSOR_INFO CURSOR; CURSOR.dwSize = 1; CURSOR.bVisible = FALSE; </code></pre> <p>From the docs for <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms686019%28v=vs.85%29.aspx" rel="nofol...
19,006,197
0
IIS NullReferenceException when deployed but not in Dev Server <p>I have developed an IIS Application using C# code behind ASPX pages with entity framework for database access. When I run it in the Visual Studio Development Server it works fine but if I either Publish it to IIS or run it on the Local IIS Web Server fro...
465,726
0
<p>Here's a solution for php:</p> <pre><code>function make_uri($input, $max_length) { if (function_exists('iconv')) { $input = @iconv('UTF-8', 'ASCII//TRANSLIT', $input); } $lower = strtolower($input); $without_special = preg_replace_all('/[^a-z0-9 ]/', '', $input); $tokens = preg_split('/ +/', $without_special); $res...
16,343,319
0
<p>Thank you! I have an embedded TextEdit in the last row of ListView embedded in the alert dialog fragment. I used your solution of clearing the flags as a post runnable and now it works perfectly.</p> <pre><code> @Override public Dialog onCreateDialog(Bundle savedInstanceState) { AlertDialog.Builder builder = new Al...
3,860,789
0
<p>How about watching for if/when the <code>/usr/sbin/spindump</code> process starts up?</p>
11,861,168
0
<p><code>extern</code> declares a variable, but does not define it. It basically tells the compiler there is a definition for <code>x</code> somewhere else. To fix add the following to <code>header.c</code> (or some other <code>.c</code> file but <em>only</em> one <code>.c</code> file):</p> <pre><code>int x; </code></...
21,319,479
0
<p>I did something like this years ago in VB6. Copied below is the code. As you can see, the code just steps through the HTML character-by-character and removes everything between (and including) the &lt; and > tags. Hopefully you can do something similar in whatever tool you are using.</p> <pre><code>Function CleanTa...
32,928,102
0
<ol> <li><p>This is <code>C</code> not <code>C++</code> (eventhough C++ brings enough <code>C</code> compatibility to make that code valid using a conforming C++ compiler with <code>#include &lt;stdio.h&gt;</code>).</p></li> <li><p>The specifier <code>%c</code> is for characters. You're reading and writing <code>int</...
6,165,249
0
<p>You have to loop, or use a library call.</p> <p>One option would be <code>memcpy(kk, k, sizeof(k));</code>. For this you must <code>#include &lt;string.h&gt;</code>.</p>
17,955,241
0
<p>Because you are using strings rather than parameters, your example is vulnerable to SQL injection. It's best to avoid <code>pg_</code> functions. In your case there are two things you need to take into account:</p> <ul> <li>Learn the Drupal API (considering you are using Drupal this would be the best for code consi...
20,735,476
0
Send a bean with html:link tag <p>I wanna send an object(bean) using the tag as follows:</p> <p>JSP:</p> <pre><code> &lt;logic:iterate id="demande" name="demandes"&gt; &lt;html:link page ="/show.do" paramId="demande" paramName="demande"&gt; &lt;bean:write name="demande" property="demandeId" /&gt;&lt;br&gt; &lt;/html:li...
36,856,137
0
where can Find sqlite databases in spip? <p>I would like to recover the SQLite database directories in the framework spip order after applying a script that will give me the equivalent mysql but I do not know the name of the file containing the data base sqlite Can you help me ?</p>
29,290,611
0
<p><code>ans += s;</code> create a new string and assigns it back to <code>ans</code> so it could be the garbage collector.</p>
15,043,393
0
Unexplained heroku timeouts <p>I have a rails 3.2.11 app deployed on Heroku that has been fairly stable over time. In the last 24 hours, pingdom has been reporting Timeouts which I can't find any "H1X" related errors in the logs at the same time.</p> <p>I am occassionally able to reproduce the timeouts in google chrome...
35,587,438
0
SSRS Render Multiple Pages from Report in C# <p>I have a service that renders a report from SSRS which works perfectly fine with one page, however when I tried to change the code to render multiple pages separately I can't seem to get it to work as expected.</p> <p>I used a guide on the MSDN blogs (<a href="http://blog...
26,924,153
0
MeasureString does not return exact width after rotation <p>I'm using <code>MeasureString</code> method to calculate the width of text but the returned value is not exact. I'm using the following code for calculating text width</p> <pre><code>Size sz = g.MeasureString(text, font); g.DrawString(text, font, brush, new Re...
8,849,483
0
<p>That is not allowed operation. If you removed channel and you want to add it again you mustn't create a new instance. You must use the old one and only change its state. The main rule is that each entity with unique key must be declared only once. Your code results in two instances with the same key = error. </p>
25,674,559
0
<p>you could also add it directly in your page-template (this is called 'inline styling'):</p> <p>a couple of lines below your opening body tag you'll find </p> <pre><code>&lt;div&gt; &lt;a href="http://forum.banaisbul.com"&gt;&lt;img src="http://forum.banaisbul.com/wp-content/uploads/2014/09/banaisbulsiyah.jpg" borde...
3,488,058
0
<p>&lt;Edit> Although one object can access private properties of all objects of the same class, you cannot access protected methods of an object from other class even if the protected method is defined in a common super class.</p> <p>So while this code compiles:</p> <pre><code>public class Test { private int x; priva...
34,849,535
0
<p>For these kind of errors, right click on the error word and say 'Resolve'. All the errors will be if defining assembly is referenced in your project.</p>
1,708,874
0
<p>Use <code>numpy.hstack()</code>:</p> <pre><code>&gt;&gt;&gt; import numpy &gt;&gt;&gt; desc = {'names': ('gender','age','weight'), 'formats': ('S1', 'f4', 'f4')} &gt;&gt;&gt; a = numpy.array([('M',64.0,75.0),('F',25.0,60.0)], dtype=desc) &gt;&gt;&gt; numpy.hstack((a,a)) array([('M', 64.0, 75.0), ('F', 25.0, 60.0), ...
27,521,919
0
How to convert dropdown value to array jquery <p>this way i was trying to convert dropdown value to array by jquery but routine is not working.</p> <pre><code>&lt;select name="DropDownList1" id="DropDownList1"&gt; &lt;option value="00"&gt;00&lt;/option&gt; &lt;option value="05"&gt;05&lt;/option&gt; &lt;option value="10...
18,372,384
0
<p>Hide the Prelude's <code>(!!)</code> operator and you can define your own <code>(!!)</code> operator:</p> <pre><code>import Prelude hiding ((!!)) (!!) :: MyType1 -&gt; MyType2 -&gt; MyType3 x !! i = ... -- Go wild! </code></pre> <p>You can even make a type class for your new <code>(!!)</code> operator if you prefer...
6,234,021
0
Reflection and Private Native Methods <p>I am using reflection to dynamically call some methods from extended class. Unfortunately one of these methods is declared as private native and as soon as I make the call... I receive the following exception:</p> <pre><code>java.lang.IllegalAccessException: Class com.something....
3,688,164
0
<p>I don't have any trouble getting a connection using</p> <pre><code>C:\Program Files\PuTTY&gt; putty -ssh -l &lt;username&gt; &lt;hostname or host ip&gt; </code></pre> <p>The only things that leap to mind are either 1) a problem with the script used as part of the <code>-m</code> argument, or 2) an incorrect use of ...
23,105,566
0
JQuery button click function not working <p>I'm new to JQuery and my problem is that I have a button in a modal such that when I click it, a JQuery script is run. Pieces of code so far:</p> <pre><code>&lt;a id="submitMe" class="btn btn-default btn-primary"&gt;Submit&lt;/a&gt; $(document).ready(function (){ $("#submitMe...
30,132,971
0
<blockquote> <p>Is it possible to insert a character to the left of text</p> </blockquote> <p>You did so, in your code snippet in your question.</p> <blockquote> <p>I can change color/size of that character?</p> </blockquote> <p>You are welcome to wrap that character in <code>ForegroundColorSpan</code>, <code>Relative...
858,207
0
<p>If you can modify the configuration file on the server here's what you can do to get the exception information through the service.</p> <p>You need to add a service behavior section to the server's config.</p> <pre><code>&lt;behaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior name="serviceNameBehavior"&gt; &lt;serv...
9,824,833
0
<p>The problem is that you are loading the lang file from inside a function, which means that <code>$lang</code> does not get placed into the global scope but rather the local function scope.</p> <p><strong>Minimum required change to make it work (but not a good idea)</strong></p> <p>Assuming you <em>want</em> <code>$...
26,229,122
0
<p>In Eclipse's do following steps </p> <p>Step 1. Project → Clean</p> <p>Step 2. Build and Run your Application. </p>
37,785,931
0
store array data retrieved from forms to database <p>I have a form. And there is add button to add more forms according to requirement. The Working demo is in JSFiddle. <a href="https://jsfiddle.net/szn0007/eanhpLkg/" rel="nofollow">https://jsfiddle.net/szn0007/eanhpLkg/</a></p> <p>My PHP code is :</p> <pre><code>$data...
14,191,644
0
Simple meteor insert not working <p>I am just getting started messing around with Meteor and can't get the following code for a simple Collection.insert to update the database when the event is triggered. I can even see the page update with the value of the text field for a split-second before disappearing (presumably ...
36,876,055
0
CentOS 7, what happened to DNAT? <p>I am doing some firewall work on CentOS 7. My end goal is to essentially make the server's internal ip address is the same as the floating ip address assigned to it. I disabled firewalld and installed iptables-services.</p> <p>/etc/redhat-release</p> <pre><code>CentOS Linux release 7...
38,532,122
0
<p>Maybe:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>alert(/^\{{2}[\w|\s]+\}{2}$/.test('{{FirstName}}'))</code></pre> </div> </div> </p> <p><code>^</code>: In the beginni...
261,667
0
<p>You can find the error codes <a href="http://vista.intersystems.com/csp/docbook/DocBook.UI.Page.cls?KEY=RSQL_sqlerrors" rel="nofollow noreferrer">here</a></p>
13,669,241
0
<p>Will this work for you?</p> <pre><code>String.prototype.regexIndexOf = function(regex, startpos) { var indexOf = this.substring(startpos || 0).search(regex); return (indexOf &gt;= 0) ? (indexOf + (startpos || 0)) : indexOf; } </code></pre> <p>See <a href="http://jsfiddle.net/rCn3Q/2/" rel="nofollow">JSfiddle</a></p...
32,201,061
0
Google Pie Chart Using Array <p>I have tried to implement the following code using an array of two sets of values but the line graph does not show:</p> <pre><code>function drawChart() { var lineTotalDistance = &lt;?php echo json_encode($DistanceTotalArray) ?&gt;; var lineSpeed = &lt;?php echo json_encode($SpeedArray) ?...
16,002,871
0
<p>I have been unable to get the <code>itemStyle</code> property of <code>credits</code> to work. </p> <p>Instead, taking inspiration from <a href="http://stackoverflow.com/questions/9732205/place-text-in-center-of-pie-chart-highcharts">Place text in center of pie chart - Highcharts</a>, I have come up with this littl...
4,993,145
0
<pre><code>$sql = "SELECT * FROM my_table"; $ressource_sql = execute_sql($sql); while ($row = mysql_fetch_assoc($ressource_sql)) { $ligne_hve.=$row['id'] . ';'; $ligne_hve.= iconv(input charset, 'windows-1252//TRANSLIT', $row['name']) . ';'; $ligne_hve.= iconv(input charset, 'windows-1252//TRANSLIT', $row['products'])...
14,491,532
0
<p>If you want to use Base still then you are going to have to do this to use those functions:</p> <pre><code>if (Button1) { dynamic_cast&lt;Client*&gt;(connection)-&gt;A(); } else { dynamic_cast&lt;Host*&gt;(connection)-&gt;B(); } </code></pre> <p>And you will need to make connection a pointer. <code>Base * connectio...
26,321,084
0
<p>My <a href="http://stackoverflow.com/a/26320857/642706">other answer</a> correctly solves the direct problem raised in the Question. This answer is a bonus, an alternate avenue to accomplish the goal of calculating and applying elapsed time.</p> <p>Doing this kind of date-time work is much easier if using either of...
23,333,081
0
<p>If the contents of the iframe is from the same domain you can access it by:</p> <pre><code>$('#edit-resp398__ifr').contents().find(selector)... </code></pre>
31,834,593
0
Target framework dnx451 or net451 in class library projects <p>From what I understand, the target frameworks <code>dnx451</code> and <code>net451</code> both use the desktop .NET Framework 4.5.1. <code>dnx451</code> is especially intended for DNX runtime application and supports ASP.NET 5.</p> <p>If we have a solution ...
28,548,533
0
Using JSON object using Angular and rest service <p>I have this service method</p> <pre><code>public object Get(EmployeeAccountsRequest request) { var list=userList.ToList(); var jsonSerialiser = new JavaScriptSerializer(); var json = jsonSerialiser.Serialize(list); return json; } </code></pre> <p>Definition of Employe...
17,429,964
0
<p>There is never a guarantee that you will not get stuck in a local optimum, sadly. Unless you can prove certain properties about the function you are trying to optimize, local optima exist and hill-climbing methods will fall prey to them. (And typically, if you can prove the things you need to prove, you can also se...
27,951,964
0
<p>In order to put the result from your <code>apply()</code> call into a data frame, you could do</p> <pre><code>df &lt;- data.frame(id=data$id, largest_value_var=apply(data[,-1], 1, function(x) names(x)[which.max(x)])) </code></pre> <p>Note that <code>c(names(x))</code> is the same as <code>names(x)</code>, so I omit...
18,634,136
1
Why do I get IndexError: list index out of range? <p>I keep getting the <code>IndexError</code> with a list. My code looks like this:</p> <pre><code>for x in range(len(MAIN_list[0])): print(x) print(MAIN_list[9][x]) print(MAIN_list[10][x]) print(MAIN_list[0][x] + "; " + MAIN_list[1][x] + \ "; " + MAIN_list[2][x] + "; "...
3,081,292
0
<p><strike>I'm assuming this doesn't happen the first run through, but after some time. Is this correct?</strike></p> <p><strong>edit</strong>: <em>removed incorrect assumption, but there's still an issue with <code>IDisposable</code></em></p> <hr> <p>You're not disposing of NewImage, and this will cause you issues in...
39,181,025
0
<p>It looks like that xine is not working correctly because <code>Das Netzwerk ist nicht erreichbar</code>. This stops vdr:</p> <pre><code>[2461] [xine..put] cXinelibServer: bind error 192.168.2.51 port 37890: Die angeforderte Adresse kann nicht zugewiesen werden [2461] [xine..put] (ERROR (frontend_svr.c,860): Die ang...
39,829,468
0
What is Web API and why to use it in .net? <p>Why to choose Web API ? It supports convention-based CRUD Actions since it works with HTTP verbs GET,POST,PUT and DELETE. Responses have an Accept header and HTTP status code. Responses are formatted by Web API’s MediaTypeFormatter into JSON, XML or whatever format you want...
11,585,253
0
<p><code>background-size: 100%</code> should do the trick.</p> <p>Here, <a href="http://jsfiddle.net/xGQtF/6/" rel="nofollow">http://jsfiddle.net/xGQtF/6/</a></p>
27,273,825
0
<p>Can you please share which upload type you require? It seems that this code has a mix of both signed and unsigned uploads. For example, you use the <code>unsigned_upload_tag</code> method while also passing the <code>timestamp</code>, <code>api_key</code> and <code>signature</code> which are required only for signe...
12,502,879
0
<p>I actually traced this back to an error in labeling the login button. The session was always open even when the button said 'log in'. I managed to correct this issue, but now I am discovering that indeed the app will not stay logged in across launches, but at least the login/logout button is always correct!</p>
10,531,745
0
<p>(1) I always add this as you suggested</p> <pre><code>config.assets.initialize_on_precompile = false </code></pre> <p>(2) But also, if using ActiveAdmin and/or Devise, exclude their routes when precompiling assets by coding routes.rb as follows</p> <pre><code> unless ARGV.join.include?('assets:precompile') ActiveAd...
36,841,914
0
How do I get the column count of a table when there are cells with rowspan/colspan? <p>How do I get the column count of a table when there are cells with rowspan/colspan?</p> <p><strong>UPDATE:</strong> In this question I mean the classical (as far as I know) use of tables, when it's necessary to use the <code>colspan<...
18,587,889
0
<p>Try following:</p> <pre><code>import re lines = [ 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)', 'Mozilla/5.0 (compatible; AhrefsBot/4.0; +http://ahrefs.com/robot/)', 'msnbot/2.0b (+http://search.msn.com/msnbot.htm)' ] botname = re.compile('\w+bot/[.\w]+', flags=re.IGNORECASE) for line ...
24,069,868
0
<p>The problem is that your test does a poor job to migrate some factors in the hardware that make benchmarking hard. To test this, i've made my own test case. Something like this:</p> <pre><code>for blah blah: sleep(500ms) std::copy sse axv </code></pre> <p>output:</p> <pre><code>SSE: 1.11753x faster than std::copy A...
11,448,616
0
Netgem n5200 (or other) - How to get into linux operating system layer? <p>After logging by PuTTY to Netgem n5200 device I have open in terminal kind of shell with about 40 commends, but no information about way how to close it and work directly on Linux. </p> <p>Device has for 99% installed HardHat Linux distribution ...
26,489,068
0
<p>"Exception: The null object does not have a method 'querySelector'."</p> <p>Could that error possibly be because the <code>&lt;polymer-element&gt;</code> definition has no <code>&lt;template&gt;</code>? Perhaps a shadow DOM is never created in that instance, so <code>shadowRoot</code> is <code>null</code>. Just gue...
16,638,560
0
<p>Consider the same functions in a module (lets not think of shell right now)</p> <pre><code>-module(fun_test). -export([test/0]). test() -&gt; F1 = fun() -&gt; timer:sleep(1000) end, F2 = fun() -&gt; io:format("hello world~n", []) end, {F1,F2}. </code></pre> <p>Output is as follows</p> <pre><code>1&gt; fun_test:test...
8,588,759
0
<p>There has been filebrowser demos out there written in Silverlight but they would run with elevated trust.</p> <p>That means that you would have to make the user immediately suspicious of your application when they first run it.</p> <p>It's probably a better user experience to just have a well worded error message f...
848,615
0
<p>Parameteric types ( the word 'generics' is usually used in ECMAScript for <a href="https://developer.mozilla.org/en/New_in_JavaScript_1.6#Array_and_String_generics" rel="nofollow noreferrer">generic methods</a>, rather than the combination of parametric types and runtime polymorphism used in Java ) were <a href="ht...
5,505,662
0
<p>if in the plugin they do:</p> <pre><code>return this; //&lt;--jquery object </code></pre> <p>at the end then u can change it with other plugins :-)</p>
20,319,643
0
<p>The functionality available in <code>IOUtils</code> is all you need. This code (tested on my Nexus 7) populates a <code>TMemo</code> with the files in your folder (if there are any):</p> <pre><code>uses IOUtils; procedure THeaderFooterForm.SpeedButton1Click(Sender: TObject); var DirList: TStringDynArray; DirPath: s...
31,126,964
0
<p>There's no "one way", but the common approach is to make your top-level repo your library - i.e. <code>github.com/you/somelib</code> and then have a <code>cmd</code> directory underneath that contains your CLI (package mains) - there may even be many.</p> <p>e.g.</p> <pre><code>yourlib/ api.go api_test.go handler.g...
29,544,702
0
<p>Like this:</p> <pre><code>private let phoneLabels = [ kABPersonPhoneMobileLabel, kABPersonPhoneIPhoneLabel, kABWorkLabel, kABHomeLabel, kABPersonPhoneMainLabel, kABPersonPhoneHomeFAXLabel, kABPersonPhoneWorkFAXLabel, kABPersonPhonePagerLabel, kABOtherLabel ] as [AnyObject] as! [String] </code></pre>
30,763,362
0
Get list of process <p>I need to get the list of process with their PID. I know how to get the PID by its handle and viceversa, but the problem is that I'm not the one who create the process, so I don't have the handle nor the PID. I didn't find exactly information on how to do it on Internet.</p> <p>Is there some func...
38,630,923
0
<p>Use:</p> <pre><code>Ext.Date.format(timestampDate ,'Y-m-d H:i:s') </code></pre> <ul> <li><code>Y</code> - A full numeric representation of a year, 4 digits.</li> <li><code>m</code> - Numeric representation of a month, with leading zeros.</li> <li><code>H</code> - 24-hour format of an hour with leading zeros.</li> <...
22,833,197
0
<pre><code>&lt;?php $classreport = array( array( 'name' =&gt; 'Vick', 'std' =&gt; 'A', 'marks' =&gt; array(10, 20, 30, 40) ), array( 'name' =&gt; 'Josh', 'std' =&gt; 'B', 'marks' =&gt; array(20, 40) ), ); $csv = 'name, std, mark'."\r\n"; foreach($classreport as $student) { $markrows = 0; foreach ($student['marks'] as ...
5,192,448
0
<p>As many as you want. After one commits the file and a second updates the changes the file gets merged. If the first user altered something that the second also altered, the update will result in a conflict and the user will have see what's different from the local file to the one the first user altered and has to m...
16,760,650
0
<p>Elements lose their <em>flex item</em> status if they are absolutely positioned. In order to do what you're suggesting, you need to absolutely position the flex container:</p> <p><a href="http://codepen.io/cimmanon/pen/prFdm" rel="nofollow">http://codepen.io/cimmanon/pen/prFdm</a></p> <pre><code>.foo { display: -we...
13,839,187
0
<p>you forgot the 3th argument in your the IF function and other syntax stuff :-)</p> <p>why you make you script not with where? like this:</p> <pre><code>UPDATE saving s INNER JOIN time t ON t.ID = 'input' AND t.User = s.User SET s.balance = s.balance + t.balance * t.interest WHERE t.currency_TYPE = 'RMB'; </code></p...
39,857,165
0
F5 responsive tables: horizontal scroll is not visible <p>I used <a href="http://foundation.zurb.com/responsive-tables.html" rel="nofollow noreferrer">Foundation 5 Responsive Table</a>. But I have this:</p> <p><a href="https://i.stack.imgur.com/PIdBB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PI...
10,347,265
0
HTML5 local storage JSON multiple objects <p>Does anyone know, if it's possible to make a local storage with multiple objects in it when I'm doing a loop in javascript?</p> <p>At the moment my code looks like this: </p> <pre><code>var albums = ''; var album_list = ''; $.each(data, function(i,item){ var name = item.name...
25,993,553
0
<p>You should use DateTime class method Subtract as:</p> <pre><code>var date2 = DateTime.Parse(DateTime.Now.ToShortDateString() + " 10:00"); System.TimeSpan diff1 = date2.Subtract(DateTime.Now); </code></pre>
24,332,673
0
<p>Try increasing the "outer_window" option in config/initializers/kaminari_config.rb. Example:</p> <pre><code>Kaminari.configure do |config| config.outer_window = 12 end </code></pre>
40,596,737
0
<p>If I understand your desired output correctly, you can use <a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.reshape.html" rel="nofollow noreferrer"><code>numpy.reshape</code></a></p> <pre><code>&gt;&gt;&gt; spp = np.asarray(splist, dt) &gt;&gt;&gt; spp array([(2002, 10.502535211267606), (2003, 10...
11,695,710
0
How to copy namespace and attributes of root node with XSLT? <p>I'm new to XSL/XML and I need help with XSL transformation.</p> <p>I have XML which starts like this</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:xsi="http://ww...
37,307,891
0
<p>Just wanted to add, the fiddle, and code from the question worked almost perfectly for me, you have to make sure you take into account any padding though when resetting width/height.</p> <pre><code>el.css({ ... width: (el.width()+LEFT_PADDING+RIGHT_PADDING)/parent.width()*100+"%", height: (el.height()+TOP_PADDING+B...
1,828,093
0
<p>forget skype api, send the sms to directly to the sms email address of the phone, most/all carriars provide 2125551212@cingularme.com, or @vtext.com (those two domains are AT&amp;T and verizon)</p>
8,851,373
0
<p>Yes, I think your thoughts are wrong. Your method signature for an event handler includes arguments that you would not need in other contexts. Why not structure as follows:</p> <pre><code>private void ToggleSwitch_Unchecked(object sender, RoutedEventArgs e) { DoSomething() } private void DoSomething() { // ... } </...
26,381,925
0
<p>'12.10.13_file' as a filename, does have '13_file' as it's file extension. At least regarding the file system. </p> <p>But, instead of finding the last . yourself, use <a href="http://docs.python.org/library/os.path.html#os.path.splitext" rel="nofollow">os.path.splitext</a>:</p> <pre><code>import os fileName, fileE...
39,247,334
0
<p>This is <strong>not</strong> officially supported but...</p> <p>What about using <code>aync</code>/<code>await</code> if you are feeling adventurous and happy to use babel.</p> <pre><code>async function foo() { const res1 = await Redis.getAsync("boo") const res2 = await Redis.getAsync(res1) } </code></pre>
11,377,776
0
<p>If you looking for some copy - paste solution, i foudn this code :</p> <pre><code> function countryCityFromIP($ipAddr) { //function to find country and city from IP address //Developed by Roshan Bhattarai http://roshanbh.com.np //verify the IP address for the ip2long($ipAddr)== -1 || ip2long($ipAddr) === false ? tr...
17,754,899
0
<p>Its been some time since I 've last worked with Hibernate and the problem is of a difficult nature so I will just describe various options:</p> <ul> <li><p>Since your <code>Trace</code> object has a <code>Cascade.All</code> option shouldn't it be enough to just add the <code>TraceEvent</code> on the set and call <c...
10,675,573
0
Executing interactive shell commands in Java <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/10407308/redirect-stdin-and-stdout-in-java">Redirect stdin and stdout in Java</a> </p> </blockquote> <p>I know how to execute shell commands in Java but how to do it so my ap...
5,991,414
0
<pre><code>output = rs.getString("column");// if data is null `output` would be null, so there is no chance of NPE unless `rs` is `null` if(output == null){// if you fetched null value then initialize output with blank string output= ""; } </code></pre>
39,848,380
0
Composer won't run globally <p>Using macOS Sierra and trying to install Composer globally.</p> <p>I've followed all these instructions: <a href="http://stackoverflow.com/questions/11333230/how-to-run-composer-from-anywhere">How to run composer from anywhere?</a> and none of them work.</p> <p>Starting afresh I've done t...
3,035,191
0
<p>One thing to note is that you can do <code>sizeof</code> on the type itself and not just on a variable:</p> <pre><code>// Check if the pointer size of a generic data pointer is different // than the pointer size of a function if (sizeof(void *) != sizeof(int (*)())) { ... } </code></pre>
16,933,647
0
Pausing CSS Slide with -webkit-animation-play-state:paused; not working <p>I have the following code:</p> <pre><code> .picTransition .item { position: absolute; left: 0; right: 0; opacity: 0; -webkit-animation: picTransition 56s linear infinite; -moz-animation: picTransition 56s linear infinite; -ms-animation: picTrans...
26,935,923
0
<p>Merge the two insert into single insert like this</p> <pre><code>INSERT INTO @EventValueResultSet(....) SELECT .... .... FROM dbo.EventValue EV WITH (NOLOCK)) INNER JOIN dbo.DataRun_ DR WITH (NOLOCK) ON EV.dataRunId = DR.Id AND DR.PersonId = @PersonId WHERE PhysioCurrentDataTime BETWEEN @blockStartTime AND @endTime...
5,018,958
0
<p>I don't have a real answer myself, but your question reminded me of this post:</p> <blockquote> <p><a href="http://stackoverflow.com/questions/4964344/selenium-doesnt-work-with-cucumber-capybara-out-of-the-box-macosx">Selenium doesn't work with Cucumber/Capybara (out of the box) - MacOSX</a></p> </blockquote> <p>Wh...
22,771,957
1
python subprocess sends backslash before a quote <p>I have a string, which is a framed command that should be executed by in command line</p> <p>cmdToExecute = "TRAPTOOL -a STRING "ABC" -o STRING 'XYZ'"</p> <p>I am considering the string to have the entire command that should be triggered from command prompt. If you ta...
1,328,739
0
<p>There are examples of usage Openlayers in Wicket. Did you try this: <a href="https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-core/openlayers-parent/openlayers-examples/src/main/java/org/wicketstuff/openlayers/MapUsingWFSGetFeaturePage.java" rel="nofollow noreferrer">https://wicket-st...
14,548,106
0
Using the file name captured with the html browse button in javascript <p>I am trying to create a form where I can upload demographic information such as name, etc. as well as upload jpg image files. I cannot figure out how to catch the file the user chooses from the browse button. Where is the file name stored? How ca...
28,686,099
0
Why NOP/few extra lines of code/optimization of pointer aliasing helps? [Fujitsu MB90F543 MCU C code] <p>I am trying to fix an bug found in a mature program for Fujitsu MB90F543. The program works for nearly 10 years so far, but it was discovered, that under some special circumstances it fails to do two things at it's ...