pid int64 2.28k 41.1M | label int64 0 1 | text stringlengths 1 28.3k |
|---|---|---|
19,620,613 | 0 | <p>Such error can not be generated by Protector. It probably means that you assign your entity with <code>accept_nested_attributes</code> and it is exactly the instance of UrlType that invalidates, not the assignment of <code>url_type_id</code>.</p> |
1,549,527 | 0 | <pre><code>dups = {} newlist = [] for x in biglist: if x['link'] not in dups: newlist.append(x) dups[x['link']] = None print newlist </code></pre> <p>produces</p> <pre><code>[{'link': 'u2.com', 'title': 'U2 Band'}, {'link': 'abc.com', 'title': 'ABC Station'}] </code></pre> <p>Note that here I used a dictionary. This m... |
2,772,434 | 0 | <p>The first thing that comes to my mind is: cellpadding/cellspacing. Try setting each to 0.</p> |
15,604,707 | 0 | <p>Adapting basic algorithms like this from Flash to Canvas is actually not that difficult. If you need a canvas framework that's close to the AS3/Flash you can take a look at EaselJS: <a href="http://createjs.com/#!/EaselJS" rel="nofollow">http://createjs.com/#!/EaselJS</a></p> <p>Here's an article on Hexagon Tiles: ... |
25,109,460 | 0 | Export strings to email body <p>I have searched and I only found a similar question that was unanswered. I have a final report made of answers that have been input throughout the app. Now I've reached the end and I want to, basically, export the report to the email body.</p> <pre><code>package com.toc.maintenancereport... |
5,126,721 | 0 | Rails not reloading session on ajax post <p>I'm experiencing a very strange problem with Rails and ajax using jQuery (although I don't think it's specific to jQuery).</p> <p>My Rails application uses the cookie session store, and I have a very simple login that sets the user id in the session. If the user_id isn't set ... |
18,079,494 | 0 | <p>First of all, a service does not imply that a separate thread is running, but I guess this is what you want to do. If you run several threads, there is no way of the AndroidOS to terminate them besides killing the whole Dalvik VM. And this means that you have no way of knowing when you are about to be terminated. I... |
28,377,503 | 0 | Why is CoreLocation (Mac OS X) not remembering my choice to allow its use? <p>I'm probably being very stupid, but I can't work out why the following is happening:</p> <p>I have an app on Mac OS X which uses CoreLocation. Below is the the relevant code:</p> <p>It asks for permission to use my location every time it laun... |
13,504,438 | 0 | <p>If you want to install a Chrome extension via other software, <a href="http://developer.chrome.com/extensions/external_extensions.html" rel="nofollow">this might help</a>.</p> <p>However, I believe that the user now has to approve the installation under the Wrench icon.</p> |
14,886,455 | 0 | <p>In PHP, much like HTML, a line-break/carriage return is generally just used to make your text more legible. This is so that future code edits are simple an easy to make. </p> <p>Not sure if this is completely relevant but I've found another post which relates to PHP formatting: <a href="http://stackoverflow.com/que... |
4,467,302 | 0 | <p>You may remove that page with no problems. However, you will have to supply the WSDL to your clients in some other manner. You can simply post the WSDL to some secure area of your web site, or even email it to them.</p> |
621,411 | 0 | Setting maximum number of Columns for ListView <p>How do we fix the maximum number of columns for a particular ListView control? Is there any thing like this:</p> <pre><code>listViewControl.MaximumColumns = 3; </code></pre> |
3,667,781 | 0 | <p>(My second attempt at the answer.)</p> <p>This is rather an elaboration of Anthony Williams's answer.</p> <p>Both iterators that you need are available in the Boost libraries (your own myIter is lacking functionality which may make your code uncompilable with other compilers).</p> <pre><code>#include <set> #i... |
33,817,217 | 0 | Using ffserver to do UDP multicast streaming <p>Here's the deal. I'm working with IPTV hardware and I need to output a bunch of demo streams. These are MPEG2 transport stream that need to be straight up UDP Multicast streams. I have an ffmpeg command that works great:</p> <p><code>ffmpeg -re -i /Volumes/Data/DemoVideos... |
7,159,977 | 0 | <p>No a handler is a separate object class and so one would not need to be defined if you were making an Activity.</p> <p><a href="http://developer.android.com/reference/android/app/Activity.html" rel="nofollow">Activity</a></p> <p>A handler would be used if you wanted to go do something in another thread/class and ca... |
34,277,206 | 0 | <p>kaylum answered perfectly when you split your project in more than a source file (the .c files) you have to compile them all into an object file (the .o files) then the compiler can merge your object file in an exec file.</p> <p>the undefined reference error means that your program use something that has not been c... |
12,801,510 | 0 | <p>It's still a regular many-to-many relationship, and it should get mapped correctly by default. Specific business (validation) rules do not change its nature.</p> <p>You can implement <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.ivalidatableobject.aspx" rel="nofollow">IValid... |
6,114,867 | 0 | <p>For your custom classes to return a stable hash code you should override the GetHashCode() method or else the GetHashCode method of the Object class will be used, which I think can vary a lot. (Might even be instance specific).</p> |
1,919,672 | 0 | <p>If <code>c_str()</code> is returning to you a copy of the string object internal buffer, you can just use <code>const_cast<></code>.</p> <p>However, if <code>c_str()</code> is giving you direct access tot he string object internal buffer, make an explicit copy, instead of removing the const.</p> |
19,119,459 | 0 | <p>Try the following:</p> <pre><code>saySomething | Tee-Object -Variable something </code></pre> <p>This should work exactly as you want.</p> |
23,104,433 | 0 | <p>There is no built in method in pandas I can think of, you would have to save the original df prior to the update and then compare, the trick is to ensure that <code>NaN</code> comparisons are treated the same as non-zero values, here df3 is a copy of df prior to the call to update:</p> <pre><code>In [104]: df.updat... |
30,631,276 | 0 | if ($_server request_method == post ) don't work when form post <p>I have a form for register and I used <code>securimage</code> captcha in my project. When I want echo something after <code>session_start();</code> like <code>print_r($_post)</code> result is <code>array()</code> but when I comment all <code>if</code> c... |
20,440,967 | 0 | <p>If you define your endpoint within a <code>resource</code> block, for example:</p> <pre><code>module MyApiModule class MyApiClass < Grape::API resource :foo do get :time do {epoch_time: Time.now.to_i.to_s} end end resource :bar do get :bar_time do {epoch_bar_time: Time.now.to_i.to_s} end end end end </code></pre... |
23,267,553 | 0 | Keep the code in <# #> bracers <p>My problem is pretty simple but I don't know how to solve it. It happens when XCode suggest me an existing function or code snippet. Some places (where I should place my variables) are surrounded by <code><#</code> and <code>#></code> "bracers". It's very usefull function - I can... |
8,658,079 | 0 | register and login in one page changes my url <p>Im having the following issue.</p> <p>I have a View typed to a class SiteAuthenticationVM.cs.</p> <p>The name of my view is "SiteAuthentication.cshtml" into the folder Views/Users</p> <p>For other hand, i have one controller called UsersController with 4 actions:</p> <pr... |
31,390,532 | 0 | <p>Use <a href="http://developer.android.com/reference/android/content/Context.html#getFileStreamPath(java.lang.String)" rel="nofollow">getFileStreamPath()</a> like this:</p> <pre><code>String fileName = "webImage"; //... Uri uri = Uri.fromFile(getFileStreamPath(fileName)); </code></pre> |
26,386,337 | 0 | <p>There's surprisingly little in the standard about this. About all we hear about redeclaration is:</p> <blockquote> <p><code>[C++11: 3.1/1]:</code> A declaration (Clause 7) may introduce one or more names into a translation unit or redeclare names introduced by previous declarations. <em>[..]</em></p> </blockquote> ... |
20,482,410 | 0 | <p>You never check for 'eof' in your read loop in readInput(). This means you have garbage values (perhaps 0) for these lines after you hit eof:</p> <pre><code> inputFile >> data[i].name; inputFile >> data[i].idNum; inputFile >> data[i].testNum; </code></pre> <p>Then what do you suppose is going to h... |
25,892,363 | 0 | ServiceBus type - queue segregation best practises <p>Let's say there is service bus instance working in one way mode. The service bus generates two kinds of messages: Foo and Bar. Both of these message types are to be saved in database. </p> <p>So I can see two approaches for doing so:</p> <ol> <li><p>Have two queues ... |
21,251,917 | 0 | <p>alter you table so that it is setup as DELETE CASCADE.</p> <p>In hibernate this would be like</p> <pre><code><set name="stockDailyRecords" cascade="delete" table="stock_daily_record" ...> <key> <column name="STOCK_ID" not-null="true" /> </key> <one-to-many class="com.mkyong.common.StockDa... |
9,585,330 | 0 | Cmake with MinGW fails compile test <p>I am trying to compile OpenCV on windows using CMAKE and MinGW on Windows. However, when I try to do that I am getting the following error:</p> <pre><code>The C compiler identification is GNU The CXX compiler identification is GNU Check for working C compiler: C:/MinGW/bin/gcc.exe... |
14,885,667 | 0 | <p>Look at your <a href="https://ccrma.stanford.edu/courses/422/projects/WaveFormat/" rel="nofollow">RIFF header</a>. This will tell you the endianness of the Wav file. </p> <p>Use that endian-ness to read in your 32-bit floats correctly. For example: If your system is little endian (say, based on an x86 processor) an... |
27,164,649 | 0 | <p>if i am getting you right, you can call the following function on your desired event to switch between the markers without clicking.</p> <pre><code>marker1.showInfoWindow(); marker2.showInfoWindow(); marker3.showInfoWindow(); </code></pre> <p>Mark as right if it works for you .:)</p> <p>P.S: An info window can be h... |
7,403,775 | 0 | <p>Because <code>c</code> is a character and not an integer.</p> <p>The ASCII value of '0' is 48 so a '0' would be index 48 in the <code>n[c]</code> statement and the programmer wanted '0' to be index 0 because <code>n</code> was defined <code>n[10]</code>, so the ASCII value is converted to its integer equivalent by ... |
20,108,569 | 0 | <p>You need this in your CSS:</p> <pre><code>#nav-wrap .container .wsite-menu-default { display:table; margin:auto; } </code></pre> <p>Here is your fiddle working <strong><a href="http://jsfiddle.net/58sqQ/2/" rel="nofollow">http://jsfiddle.net/58sqQ/2/</a></strong></p> |
24,837,331 | 0 | <p>you need to add a var as xmlhttp; on starting to get the status result please use below code i modify it,</p> <pre><code><script> //Ajax to send request.. function sendPayment() { var xmlhttp; if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {//... |
33,125,090 | 0 | <p>As you say "correct" to all our assumptions, ...</p> <ul> <li>you only use the time part of rounded_time and we must ignore the date part</li> <li>the batch that shall pick 12:15, 12:30, 12:45, and 13:00 runs after 13:00 and before 14:00</li> </ul> <p>This leads to a WHERE clause like this:</p> <pre><code>where ext... |
2,322,315 | 0 | <p>You might be using too many keys or opening and closing them too many times. Storing all your values under one key and keeping it open until you finish writing to it might improve performance.</p> |
8,241,360 | 0 | <p>Find out the real encoding of the source document. It might be <code>WIN1251</code>. Either transcode it (for instance with <a href="http://en.wikipedia.org/wiki/Iconv" rel="nofollow">iconv</a>) or set the <code>client_encoding</code> of PostgreSQL accordingly.</p> <p>If you don't have a setting in <code>pyodbc</co... |
33,291,992 | 0 | <p>This is because the html that is bound to your knockout observable array is mangled when datatables is initialized... The html is copied and reformatted to be "datatables" after initialization. so the elements that you view after datatables initialization are not the same elements that knockout has bound to. I have... |
455,421 | 0 | <p>Yes, definitely. I use subversion for all my personal projects, for the same reasons you cited above. </p> <p>I wouldn't even consider doing any coding without a VCS, no matter how small the project. I have one big repository that has many folders in it for all of my small projects, and if I am working on a larger ... |
3,468,788 | 0 | <p>The HTML5 spec has an <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#valid-e-mail-address" rel="nofollow noreferrer">interesting take on the issue of valid email addresses</a>:</p> <blockquote> <p>A valid e-mail address is a string that matches the ABNF produc... |
34,702,344 | 0 | Nginx ReWrite Engine - Transform Apache Rules to Nginx <p>I need to transform those Apache rules to Nginx for my MVC. </p> <p>Apache Rules :</p> <pre><code>RewriteEngine on RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f RewriteCond %{SCRIPT_FILENAME} !maintenance.html RewriteRule ^.*$ %{DOCUMENT_ROOT}/system/m... |
27,938,794 | 0 | <p>I haven't used that particular library before, but do you have anything against using the one in Android's support library? Works perfectly for me...</p> <pre><code>import android.support.v4.widget.SwipeRefreshLayout; import android.support.v4.widget.SwipeRefreshLayout.OnRefreshListener; </code></pre> <p>AND</p> <p... |
35,118,493 | 0 | <h2>Methods</h2> <p>You could use one of the following methods:</p> <ul> <li><code>float:left;</code> on <code>.menu</code></li> <li><code>display:inline-block;</code> + <code>vertical-align:top;</code> on <code>.menu</code></li> <li><code>position:absolute;</code> on <code>#changetitle</code></li> </ul> <p>With the <... |
26,563,318 | 0 | <p>The problem is likely to be the <code>ZeroBytePadding</code>. The one of Bouncy always adds/removes at least one byte with value zero (a la PKCS5Padding, 1 to 16 bytes of padding) but the one of PHP only pads until the first block boundary is encountered (0 to 15 bytes of padding). I've discussed this with David of... |
41,074,549 | 0 | <p>I might have understood your problem wrong, but try this.</p> <p>Give your anchor tag an id.</p> <p><code><a id='anchor_sym'></a></code></p> <p>Then, in <code>onClick()</code> method, do on of following:</p> <pre><code>/* Plain Javascript*/ var element = document.getElementById("anchor_sym"); element.cl... |
22,050,031 | 0 | android - Develop apps using Visual Basic <p>is it possible to develop android apps using Visual Basic? if yes, how?</p> <p>i have been working with it for a while and eclipse is quite difficult to use. i'd seriously prefer using VS</p> |
36,968,869 | 0 | Animating SVG rect x property via CSS <p>I have a classic mobile three-bars menu button made with SVG. I would like to animate each bar on click.</p> <p>This is my code:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false"> <div class="snippet-code"> <pre class="snippet-c... |
37,961,592 | 0 | Javascript onclick with img is not working on IE10 with HTML 5 enable <p>We have a legacy HTML+JavaScript code which has been written approx 15 years back. We are enabling some of the feature in the code by using HTML5 like as search box etc.</p> <p>While enabling HTML-5, checkbox stop working on IE-10, same code is wo... |
41,023,575 | 0 | How to design a Snake and Ladder game without using HashMap? <p>I was asked this question once which I replied using a HashMap. But then again I was asked to use another data structure. Can some one think of some other approach</p> |
18,458,439 | 0 | <p>Try to create the table as below:</p> <pre><code>CREATE TABLE t1 (dt DATETIME(6) NOT NULL); </code></pre> <p><strong><a href="http://sqlfiddle.com/#!9/a9086/1/0" rel="nofollow">SQL Fiddle</a></strong></p> |
28,931,812 | 0 | <p>You put everything in a loop. Why? You should use the loop only to check whether the username is taken or not and send your messages outside of it. </p> <p>First of all you'd like to force your loop to work only as long as it should. You can do it by declaring <code>isUsed</code> before it and adding it to the cond... |
27,097,738 | 0 | <p>Your question raises some interesting issues. I will try to explain how you can fix it, but, as @Uri mentions, there may be better ways to address your problem.</p> <p>I've assumed <code>@tranfee</code> is to be set equal to the first value in the hash whose key begins with <code>"tran"</code> and that <code>@rate<... |
19,386,826 | 0 | <p>Unfortunately since UDP has no concept of a "connection", there is no way for the OS (or you) to distinguish between "old" data and "new" data.</p> <p>Specifically on Win32, there's an <code>SIO_FLUSH</code> ioctl which you can pass to <code>WSAIoctl()</code>. I haven't tried this, and it seems that it's only relev... |
24,510,132 | 0 | <p>You don't need a regex for that, you can use <code>encodeURI</code></p> <pre><code>url = url.replace(/null/g, ""); url = encodeURI(url); </code></pre> |
31,966,126 | 1 | what is the difference between x.type and type(x) in Python? <p>Consider the following lines </p> <pre><code>import theano.tensor as T x = T.dscalar('x') y = T.dscalar('y') z = x+y </code></pre> <p>And then,</p> <pre><code>In [15]: type(x) Out[15]: theano.tensor.var.TensorVariable </code></pre> <p>while,</p> <pre><code... |
11,936,550 | 0 | <blockquote> <p>Can i now go and change the position of the characters in the string?</p> </blockquote> <p>No. Strings in .NET are immutable – they cannot be changed. In order to modify a string in VB, you call a function which creates a <em>new</em> string based off the modified contents of the old string. That’s wha... |
5,969,274 | 0 | <p>For others who are in the same requirement, you may consider my columnchooser implementation. My Dialog Form Declaration. (Dialog box which will be shown when columnchooser button is clicked.</p> All required fields will not be allowed to remove.</p> <p>Creating the ColumnChooser Button for my Grid.</p> <pre><code>... |
22,239,624 | 0 | PHP Twitterify function regex doesn't exclude starting numbers <p>I'm using the code</p> <pre><code>function twitterify($ret) { $ret = preg_replace("#(^|[\n ])([\w]+?://[\w]+[^ \"\n\r\t< ]*)#", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret); $ret = preg_replace("#(^|[\n ])((www|ftp)\.[^ \"\t\n\r&l... |
23,273,433 | 0 | javascript/jquery ignore or override :hover style <p><strong>Short Description:</strong> I want to use JS/JQuery to take precedence over the CSS :hover psuedo-class for specific brief moments without removing the CSS rule for the other <em>majority</em> of cases. Since the site is already script-heavy enough I'm trying... |
20,623,296 | 0 | <p>The issue is that the images change the height of the div. You can keep them from doing that by floating them. Also, if you want them to always fit within the container, you'll need to adjust the width of the images. So, something like this might work:</p> <pre><code>#cool img { float:left; width:25%; height: auto;... |
37,824,729 | 1 | How to use random.randint to find random 0 and 1 with not equal propbability <p>I am using <a href="https://pypi.python.org/pypi/deap" rel="nofollow">DEAP</a> toolbox in Python for Genetic Algorithm. </p> <p><code>toolbox.register("attr_bool", random.randint, 0, 1)</code> is a function randomly chooses 0 and 1 for popu... |
26,960,261 | 0 | same method signature in interface and class <pre><code>interface TestInterface { void work(); } class TestClass { public void work(){ System.out.println("Work in CLASS"); } } public class Driver extends TestClass implements TestInterface { public static void main(String[] args) { new TestClass().work(); } } </code></p... |
8,074,650 | 0 | <pre><code>$('#show_existing_suggestions').live('click',function(){}); </code></pre> <p><a href="http://api.jquery.com/live/" rel="nofollow">http://api.jquery.com/live/</a></p> |
7,609,129 | 0 | Custom RouteMap <p>Hi I have to route an old path, that was containing the old webform, to my new controller.</p> <p>I tried this:</p> <pre><code> routes.MapRoute( "DownloadLink", "products/pippo/download/{*catchall}", new { controller = "Downloads", action = "Index"} ); </code></pre> <p>To have my controller called wi... |
15,355,246 | 0 | <p>I would recommend you to use android <a href="http://developer.android.com/reference/android/app/DownloadManager.html" rel="nofollow">DownloadManager package</a>, which takes care of all issues related to huge files download. <br></p> <p>Copied from the Android document site: <br><br> <code>The download manager is ... |
23,604,821 | 0 | <p>If you simply want to squash all commits into a single, initial commit, just reset the repository and amend the first commit:</p> <pre><code>git reset hash-of-first-commit git add -A git commit --amend </code></pre> <p>Git reset will leave the working tree intact, so everything is still there. So just add the files... |
27,137,862 | 0 | DIV is not displaying in IE8 onwards due to CSS class <p>When I create a div like below, it is displaying in IE7, but not displaying on IE8 and later versions. When I view source code, I can see this div in all IE versions, but not displaying in IE8 and plus.</p> <p>My Aspx code:</p> <pre><code><div runat="server" i... |
19,100,513 | 0 | Checking pointer to pointer is not null <p>*A few things to be noted in the code: cfield<b>p</b> is a pointer and cfield<b>pp</b> is a pointer to pointer.</p> <p>I want to know the uses of the new macro (see the code below). We are passing the address of <code>cfieldp</code>,<code>(&cfieldp)</code> instead of <code... |
38,876,686 | 0 | <p>If you want to avoid forwarding landing page then use:</p> <pre><code>RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} !\.(gif|jpg|png|swf|css|html|js|ico|pdf)$ RewriteCond %{REQUEST_URI} !^/app\.php(/.*)?$ [NC] RewriteRule ^(.+)$ app.php/$1 [L] </code></pre> <p><code>.+</code> will match anything but not ... |
34,204,307 | 0 | <p>Just use the built-in <code>isName</code> method:</p> <pre><code>public static boolean isName(CharSequence name) </code></pre> <p>This returns whether or not a name is a syntactically valid qualified name in the latest source version.</p> <p>See the <a href="http://docs.oracle.com/javase/8/docs/api/javax/lang/model... |
7,670,123 | 0 | insert element in every position of nested list <p>In Maple 15, I have a nested list like this one (only 2 levels of nesting):</p> <pre><code>[[a,b],[c],[d,e,f]] </code></pre> <p>I want to create 6 lists from that one (the number of elements..), like these:</p> <pre><code>[[x,a,b],[c],[d,e,f]] [[a,x,b],[c],[d,e,f]] [[a... |
33,903,608 | 0 | <h2><a href="http://jsfiddle.net/adriancarriger/t8Lyarmc/10/" rel="nofollow">Working Fiddle</a></h2> <p>It looks like you're not selecting the current slide's image. I found the current slide by looping through the slides and checking their opacity.</p> <h2>Remove this</h2> <pre><code>var sr = $(this).attr('src'); </c... |
24,610,631 | 0 | <p>This is what the <a href="http://msdn.microsoft.com/en-us/library/vstudio/ms227424.aspx" rel="nofollow"><code>ValidationGroup</code></a> property is for. Suppose you have the following controls:</p> <pre><code><asp:RequiredFieldValidator ID="rfv1" runat="server" ValidationGroup="Group1" /> <asp:RequiredFie... |
3,000,964 | 0 | <p>If you're a registered developer, I would suggest visiting developer.apple.com/iphone and signing in there. Otherwise, we can't really discuss it. </p> |
11,224,332 | 0 | I have to query a MS SQL DB using java <p>I have to query a MS SQL DB using java. I am querying DB using following code</p> <pre><code> Class.forName("net.sourceforge.jtds.jdbc.Driver"); Connection conn = DriverManager.getConnection( "jdbc:jtds:sqlserver://XXX.XX.XX>XX:1433/DBNAME", "USERNAME", "Password"); querystr... |
35,406,936 | 0 | <p>I suggest you to get more information about Data modeling in Cassandra. I've read <a href="http://www.cs.wayne.edu/andrey/papers/TR-BIGDATA-05-2015-CKL.pdf" rel="nofollow">A Big Data Modeling Methodology for Apache Cassandra</a> and <a href="http://www.datastax.com/dev/blog/basic-rules-of-cassandra-data-modeling" r... |
40,020,062 | 0 | <p>Standard method would be to use <a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.eig.html" rel="nofollow">numpy.linalg.eig</a>.</p> <pre><code>from numpy import linalg as LA w, v = LA.eig(np.diag((1, 2, 3))) # w: # array([ 1., 2., 3.]) # v: # array([[ 1., 0., 0.], # [ 0., 1., 0.], # [ 0., 0... |
5,475,890 | 0 | <p>You are using the wrong overload for the <code>.ActionLink</code>. Try this instead...</p> <pre><code><%= Html.ActionLink(item.venue, "Details", "Venues", new { name = item.venue }, new {}) %> </code></pre> <p>It is currently selecting <a href="http://msdn.microsoft.com/en-us/library/dd492124.aspx"><code>stri... |
37,241,002 | 0 | d3 force graph using node names for links <p>I've been at this for a few days now, and I've seen the questions on stackoverflow and other places, but I am missing something.</p> <p>Lets say we have the following JSON:</p> <pre><code>{ "nodes":[ {"name":"node1"}, {"name":"node2"}, {"name":"node3"}, {"name":"node4"} ], "... |
40,294,340 | 1 | taking the product of the elements of tuples based on their sum <p>I would greatly appreciate any feedback regarding the following question. So far I wrote a code on Python that generates the combination of 2 dimensional tuples in which each element is a value from 1 through 4. So for (a1,a2), a1 and a2 can be any valu... |
27,174,953 | 0 | <p>Because that's the easiest way to distribute everything while keeping it up to date. By offloading build costs to the users, library authors only need to provide source code.</p> <p>This can be mitigated in various ways. For example, <a href="https://github.com/bananu7/potato-empires" rel="nofollow">my CI setup</a>... |
20,732,532 | 0 | Why does AngularJS swallow event and cause jQueryUI calendar (of datepicker) to not display? <p>I have a problem where jQuery datepicker fails to display the calendar, because something swallows the event. It seems like it might be AngularJS causing the problem. You can see it at: <a href="http://jsfiddle.net/daylight/... |
18,099,535 | 0 | <pre><code>[WebMethod(Description = "Returns a Fruit XML")] public XmlElement GetALLFruits() { Fruit fruit = new Fruit(); fruit.Name = "Mango La Ka Buma"; fruit.expiryDate = "11/11/1911"; fruit = getFruitCrateDetails(fruit);//This is call to method 1. Don't worry your values will not be lost fruit.Name will remain as ... |
11,086,185 | 0 | <p><strong>Short fix:</strong></p> <p>In the <code>onTabSelected</code> method, before using <code>if (mFragment == null)</code> you need to try to get the fragment (using <code>mFragment = getSupportFragmentManager().findFragmentByTag(mTag)</code>). You can also set this from the outside but I don't see you doing thi... |
29,214,145 | 0 | Sql server display string in when statement <p>I have the following query</p> <pre><code>select (case when object like'%service%' then (object) when class like '%service%' then (class)end) From db group by (case when object like '%service%' then object when object_class like '%service%' then object_class end) </code></... |
13,342,209 | 0 | <p>string myTime = DateTime.Now.ToString("dddd", new System.Globalization.CultureInfo("it-IT"));</p> <p>the example use italian culture code, for a list of available culture codes check out <a href="http://sharpertutorials.com/list-of-culture-codes/" rel="nofollow">this</a></p> |
2,730,117 | 0 | C++ - Efficient container for large amounts of searchable data? <p>I am implementing a text-based version of Scrabble for a College project.</p> <p>My dictionary is quite large, weighing in at around 400.000 words (<code>std::string</code>).</p> <p>Searching for a valid word will suck, big time, in terms of efficiency ... |
33,282,185 | 0 | <p>The first thing to point out is that there is nothing like racing condition. The right terminology is just <strong>race condition</strong>. Keep this in mind for the future ;-)</p> <p>I suppose you are using a BroadcastReceiver to receive messages and that you have created the object and tell it to run in a separat... |
12,804,934 | 0 | <p>from the <a href="http://docs.python.org/tutorial/datastructures.html#dictionaries" rel="nofollow">docs</a>:'</p> <blockquote> <p>It is best to think of a dictionary as an unordered set of key: value pairs, with the requirement that the keys are unique (within one dictionary)</p> </blockquote> |
35,365,216 | 0 | <p>This should work for you.</p> <pre><code>require '/PHPMailer-master/PHPMailerAutoload.php'; require '/PHPMailer-master/class.phpmailer.php'; $mail = new PHPMailer(true); if(isset($_POST['submit'])){ $to = "me@mymail.com"; $from = $_POST['text_96']; $fullname = $_POST['text_95']; $email = $_POST['text_96']; $dob = $... |
6,797,243 | 0 | <p>You should use a webhook, not the email service.</p> <p><a href="http://help.github.com/post-receive-hooks/" rel="nofollow">http://help.github.com/post-receive-hooks/</a></p> |
2,375,126 | 0 | How to programmatically click an element with MooTools? <p>In jQuery, I've done stuff like this in the past:</p> <pre><code>$('#someCheckbox').click(); </code></pre> <p>And everything works as if the user just clicked on the element normally. However the same doesn't work in MooTools:</p> <pre><code>$('someCheckbox').f... |
23,757,900 | 0 | <p>How about something like this:</p> <pre><code>create table #tempTab(Num int,rtype char(1),amount decimal(8,2)); insert into #tempTab values (110200014,'A',19259.00), (110200014,'D',-802.46), (110200014,'D',-1604.92) select * from #tempTab t cross apply (select amount from #tempTab where rtype = 'A' and Num = t.Num)... |
6,289,011 | 0 | <p>Keys inside <code>appSettings</code> are retrieved as <code>NameValueCollection</code> which by definition</p> <blockquote> <p>Represents a collection of associated String keys and String values that can be accessed either with the key or with the index.</p> </blockquote> <p>So you can have only the data type <code... |
6,755,697 | 0 | <pre><code>$result = mysql_query("SELECT * FROM stores where StoreID=$id order by city"); if (!$result) { die('Invalid query: ' . mysql_error()); }else{ while($row = mysql_fetch_assoc($result)){ echo $row['city']." : ".$row['street']."<br />"; } } </code></pre> <p>while() is fetching results step by step, so it ... |
21,499,729 | 0 | jQuery multiple else if statements <p>I am trying to set a padding on a div based on the window height size. I simply couldn't find a better working way to center my content div vertically in another div with unknown dimensions. My code is as it follows:</p> <pre><code><script> $(document).ready(function(){ var w... |
21,928,405 | 0 | <p>the base Docker containers don't start services like cron - they only start what you specify in the ENTRYPOINT/CMD</p> <p>some 'fatter' containers use things like supervisord to start services - but where possible, its more maintainable to separate services into different containers and share data using with volume... |
235,534 | 0 | <p>This creates your typical hierarchical table and uses a CTE to select the hierarchy structure and create a path for each item.</p> <pre><code>CREATE TABLE tblHierarchy (ID int, ParentID int NULL, Name varchar(128)); INSERT INTO tblHierarchy VALUES (1, NULL, '1'); INSERT INTO tblHierarchy VALUES (2, NULL, '2'); INSE... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.