pid
int64
2.28k
41.1M
label
int64
0
1
text
stringlengths
1
28.3k
19,619,850
0
<p>You could use a dictionary with a key that indicates your command and an anonymous method that holds the to be executed command. For performance you better refactor the Dictionary to be static and only instantiated once but this gives you the general idea.</p> <pre><code>void Engine_SpeechRecognized (object sender,...
35,416,133
0
<p>Change the module script to remove the reference to material.svgAssetsCache and the demo will run but without the final row of buttons - which reference "local" image resources.</p> <p>If you grab a copy of the icons(<strong>bower install material-design-icons</strong>) and locate the relevant 24px .svg files and p...
8,447,944
0
How can you universally override the get and post methods in RSpec? <p>I'd like to override the <code>get</code> and <code>post</code> methods in RSpec. </p> <p>I want to do this in order to deal with subdomains in my tests. As far as I can tell, the only way to deal with subdomains is to alter the <code>@request</code...
14,593,400
0
9,274,522
0
animate to light yellow then back to white? jQUery <p>i am trying to make my ul li's background color to turn yellow then back to white . i use the code below but it's not working.</p> <pre><code>$('#items ul li.test').animate({ 'background-color' : '#FFFEBC' }, 3000, function(){ $('#items ul li.test').animate({ 'backg...
36,232,930
0
C# saved folder downloaded from Google drive cannot access in visual studio <p>Good day. After i finished my practical class in school, i will upload the whole saved folder to google drive for me to revise at home. However, when i re-download the whole file from google drive at home, i couldn't open it on visual studio...
25,134,439
0
<p>No , dont do that . loading remote website will not able to intract with your plugins . and the app will get rejected on istore too</p>
5,493,291
0
<p>You can't directly call <code>click</code> on something in the control. However, you can register some JavaScript into the control and perform the click that way.</p> <p>See <a href="http://stackoverflow.com/questions/153748/how-to-inject-javascript-in-webbrowser-control">How to inject Javascript in WebBrowser cont...
39,763,927
0
<p>Instead of using the style attribute as mentioned by RaMeSh, I would use a css attribute. That's simply cleaner.</p> <pre><code>if(logged_in === true) { echo '&lt;a class="hidden" href="/login"&gt;&lt;img style="margin-top:1px;" src="/template/img/sits_01.png"&gt;&lt;/a&gt;' } else { echo '&lt;a href="/login"&gt;&l...
28,469,210
0
<p>You can use the <code>Windows.Web.Http.HttpClient</code> instead of <code>System.Net.Http.HttpClient</code>, i.e.:</p> <pre><code>HttpClient _httpClient = new HttpClient(); bool result = _httpClient.DefaultRequestHeaders.TryAppendWithoutValidation("Accept", "vnd.servicehost.v1+json"); var response = await _httpClie...
834,973
0
<p>Help -> About Microsoft Visual Studio</p>
21,450,810
0
<p>Try to define outputRowId as ParameterDirection.InputOutput</p>
18,923,384
0
<p>The cause of the problem is twofold:</p> <ol> <li>In your module you have a behaviour declaration <code>-behaviour(cowboy_http_handler).</code>. This is perfectly correct.</li> <li>When you compile the file the compiler can't find the <code>cowboy_http_handler</code> module in its search path</li> </ol> <p>This cau...
12,340,411
0
Vibrate iphone when phone is silent <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/11770566/vibrate-command-only-works-when-settings-sounds-vibrate-switch-is-on">Vibrate command only works when Settings &gt; Sounds &gt; Vibrate switch is on</a> </p> </blockquote> <p...
5,178,286
0
<p>I guess that's pretty much PHP syntax question rather than PDO one.</p> <pre><code>$params = is_array($params) ? $params : array($params); </code></pre> <p>is a shortland (called <em>ternary operator</em>)) for </p> <pre><code>if (is_array($params)) { $params = $params; } else { $params = array($params); } </code><...
29,887,810
0
<p>In case somebody is facing a similar problem: I was finally able to overcome the issue described above by setting the <code>android:launchMode</code> property for the <code>MainActivity</code> to <code>singleInstance</code>.</p>
1,225,465
0
Callbacks in Linq-to-SQL/ASP.NET MVC <p>After using .NET for several years, I've spent the last few months in the far off land of Ruby on Rails. While I can clearly see where much of Microsoft's MVC framework got it's influence, one of the things that I find myself suddenly missing when development in .NET are the Rail...
39,136,166
0
<p>Did you try this?</p> <pre><code>console.log(recordsets[0][0][" "]) </code></pre> <p>Or maybe another way if you know for sure that the stored procedure will give you only one result is converting the object into an array and checking first element:</p> <pre><code>var raw = recordsets[0][0] var result = Object.keys...
32,109,187
0
<pre><code> &lt;form ng-submit="search()" name="searchSideNav"&gt; &lt;div layout="column" layout-align="center"&gt; &lt;md-input-container flex&gt; &lt;label&gt;{{::labels.documentName}}&lt;/label&gt; &lt;input ng-model="searchItems.sDocumentName" ng-required="" name="sDocumentName"&gt; &lt;div ng-show="searchSideNav...
12,990,449
0
Binding to DependencyProperty with no result <p>I have problem with binding to dependency property of my new control.<br> I decided to write some tests to examine this issue.<br></p> <p><strong>Binding from TextBox.Text to another TextBox.Text</strong></p> <p>XAML code:</p> <pre><code>&lt;TextBox Name="Test" Text="{Bin...
31,763,006
0
Moving whole row between two tables <p>I have to tables with identical structure, client_data, new_client_data. Now I want to move whole one row from one table to another. I've found a way to do it, it`s working fine, but I'm wondering if there is more elegant and clean way to do it.</p> <p>new_client_data / controller...
6,305,270
0
DevExpress ASPxComboBox not filtering <p>I have an ASPxComboBox from the DevExpress suite and am trying to get it filtered. If I click on the dropdown button of the combo box it will show the first few of the query as if the filter is empty.</p> <p>If I try to populate the filter, or scroll down to see more, it will ju...
27,512,372
0
<p>Since the library I wanted to use was not written as a PHP extension, I had to write a wrapper extension in C, creating a PHP method which takes PHP arguments and calls the library function using the arguments after they are transformed (e.g. using a pointer for the memory address).</p>
14,916,588
0
<p>Here's how I would do it:</p> <pre><code>#!/bin/bash readonly Directory="$1" shift git --git-dir="$Directory/.git" "$@" </code></pre> <p>First, this copies the repository location (<code>$1</code>) to another variable (<code>$Directory</code>). Then it uses <a href="http://ss64.com/bash/shift.html" rel="nofollow"><...
12,572,089
0
to create a gallery in asp.net by iterating through the folders <p>I want to create a gallery in asp.net the way it should work is as follows:</p> <ul> <li>iterate through gallery folder</li> <li>select all the folder and show them as albums with cover pic as thumbnail.jpg in that folder</li> <li>when clicked on the al...
7,267,162
0
How do I sort this multiple queried result table in PHP using a drop down? <p>I got a code which generate a table like this</p> <p><img src="https://i.stack.imgur.com/VQYa0.jpg" alt="table"></p> <p>and the code is here</p> <pre><code>$num1 = mysql_query("SELECT * FROM mtable WHERE DataVersionDate='$datav' &amp;&amp; Pa...
15,166,079
0
mysql workbench load data local infile cannot find file or directory <p>Anyone else having problem using:</p> <pre><code>LOAD DATA LOCAL INFILE 'c:/PRODUCT_GROUP_UPLOAD.CSV' into TABLE ats_store.product_group FIELDS TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '"' LINES TERMINATED BY '\r\n' (product_group_id,name,price...
29,057,730
0
Rails-jQuery Why do I have to click twice for jQuery effect to show? <p>I am using Rails 4.1.1 Why do I have to click twice for jQuery effect to show? I have been Googling but I cannot find any solutions, not sure if there's something wrong with my jQuery code or....</p> <p>When I click "Submit" for the first time, the...
5,162,764
0
<p>There are some logic errors in your original code (i.e. infinite loop). Fix:</p> <pre> function joinParameters(target, paramName) { var count = 1; var array = []; var name = paramName.concat(count); var value = target[name]; while (value != undefined) { /* typeof value will return "undefined". */ array.push(value);...
14,064,579
0
<p>Pagenation problem was solved</p> <pre><code>.pager ul.yiiPager li.page:after{display: inline-block !important} </code></pre> <p>But still am getting image problem... Help please...</p>
6,386,147
0
<p>You will get the source code for any gateway for any platform in the help/documentation/ download sections of the payment gateway/payment processor website. Compile these codes and host it on codeplex.com. This will be the open source project you want...</p> <p>And do remember to upgrade the code regularly, since t...
29,971,477
0
Reading information from Memory array into excel sheet formula <p>I'd like to use data from an array that I've got stored in my VBA memory directly into a formula in my sheet. As an example, I'd like to avoid using Application.vlookup() to print to each cell individually as this is slow. And instead do something like t...
20,900,966
0
Magento Price Formatting - 2 or 3 decimal places <p>I have a requirement to set prices on certain items to 3 decimal places. I have achieved this by changing the 'precision' variable to 3, however this now means that every price on the site is displayed to 3 decimal places (ie: an empty shopping cart shows as £0.000). ...
6,291,754
0
<p>Here is some code I used to this a while back, it's not perfect but it should get you started:</p> <p>EDIT: Still ugly but output is better: <code>ajax-json-html5-the-future-of-web-</code></p> <pre><code>string title = "AJAX, JSON &amp; HTML5! The future of web?"; title = Regex.Replace(title, @"&amp;amp;|&amp;", "-...
33,136,982
0
Is it necessary to use document.getElementById() to access a specific DOM object, or can its Id be used directly? <p>In a lot of what I'm reading about Javascript the examples show how to edit a given element by first getting its object using document.getElementById(). However I've seen other code where this isn't used...
3,123,532
0
<p>You can in upload script use a temportantly file (in temportantly directory) and if upload was finished you can simple move file to your final location with good filename.</p> <p>This is a common solution for this problem.</p> <p>For get temportantly file (enviroment independent) use PHP function:</p> <pre><code>re...
24,154,162
0
<p>Make sure your Class name field is actually <strong>Module</strong>.Task, where <strong>Module</strong> is the name of your app. CoreData classes in Swift are namespaced. Right now, your object is being pulled out of the context as an NSManagedObject, not as a Task, so the as-cast is failing.</p>
5,402,066
0
<p><a href="http://msdn.microsoft.com/en-us/library/system.stathreadattribute.aspx" rel="nofollow">MSDN answers your questions</a></p> <p>It has no effect on other functions. It only has effect if your program uses COM interop.</p>
9,809,351
0
IE8 CSS @font-face fonts only working for :before content on over and sometimes on refresh/hard refresh <p>UPDATE: I've written a blog post about what I've learned about this issue. I still don't fully understand it, but hopefully someone will read this and shed some light on my issue: <a href="http://andymcfee.com/201...
31,724,454
0
Will new local class instance be garbage collected if I return an array it creates? <p>Let's say a class instance will build arrays:</p> <pre><code>class FooArrBuilder { public Foo[] FinalResult { get { return arr; } } Foo[] arr; public void BuildArr(); ... } </code></pre> <p>Then it's used like this:</p> <pre><code>Fo...
35,031,713
0
<p>Have you tried with "before"?</p> <pre><code>$args = array( 'post_type' =&gt; 'epl_registration', 'post_status' =&gt; 'publish', 'fields' =&gt; 'ids', 'date_query' =&gt; array( array( 'column' =&gt; 'post_date_gmt', 'before' =&gt; '6 hours ago' ) ) ); $the_query = new WP_Query($args); </code></pre>
23,239,260
0
<pre><code>Use this class package com.diluo.http; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.URL; import java.util.ArrayList; import java.util.List; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; impo...
26,597,271
0
sparse indexing in matlab <p>I have a very long code which is full of the following "if"s and matlab editor gives me a suggestion as follow:</p> <p><strong>this sparse indexing expression is likely to be slow</strong></p> <pre><code>mt = rand(200,200); [c r] = size(mt); T = sparse(r*c,2); for i = 1:c for j = 1:r if(ind...
23,583,368
0
<p>First, a capitalization typo: </p> <pre><code>stage.find // not stage.Find </code></pre> <p>When you use the hashtag (#) within a .find key, KineticJS searches for a node <code>id</code>. </p> <p>So when you create each path (room) you should assign it a node id (eg "Room1"):</p> <pre><code>var path = new Kinetic.P...
37,806,419
0
<p>I have found the solution. The problem is with setting the contentScaleFactor of UIView. By default, it is 2.0 for retina displays. So, it should be set to 1.0. Here is the link for more details: <a href="http://stackoverflow.com/a/7130677/5814521">UIView ContentScaleFactor</a></p>
5,762,453
0
<p><a href="http://php.net/manual/en/function.array-map.php"><strong>array_map</strong></a> and <a href="http://php.net/manual/en/function.trim.php"><strong>trim</strong></a> can do the job</p> <pre><code>$trimmed_array=array_map('trim',$fruit); print_r($trimmed_array); </code></pre>
22,469,393
0
<p>It is possible to do bulk inserts in MongoDB. Check out the <a href="http://docs.mongodb.org/manual/core/bulk-inserts/" rel="nofollow">documentation</a> for details.</p> <p>Quoting from the documentation:</p> <blockquote> <p>The insert() method, when passed an array of documents, performs a bulk insert, and inserts...
37,734,931
0
<p>As far as the rest of your program is aware your <code>wait_queue</code> is just a <code>Collection</code>, it doesn't have <code>get</code> or <code>remove</code> methods.</p> <p>You're correct in that you don't want to couple your implementation to the variable's type, however you shouldn't use <code>Collection</...
5,852,295
0
xQuery return all values but one <p>Here is my xml:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;library xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="library.xsd"&gt; &lt;items&gt; &lt;book asin="0201100886" created="128135928" lastLookupTime="128135928"&gt; &l...
39,505,739
0
OpenCV floodfill while maintaining intensity of objects takes too long to run <p>I am using OpenCV 3.1.0 to change the color of certain areas in an image. OpenCV's floodfill is doing an excellent job of selecting the area and changing the color to a solid new value. But the output image pixels lose their intensity and ...
12,391,404
0
android align View programmatically <p>I have a LinearLayout that comprises some number of TextViews. I set </p> <pre><code>android:gravity="center_horizontal" </code></pre> <p>for the parent Layout and result looks as below (for N=2):</p> <p><img src="https://i.stack.imgur.com/0OeOg.png" alt="enter image description h...
22,553,160
0
<p>You can consider to check the number of displayed elements in the <code>open</code> event, if the <code>len</code> is 0 you can display another element accordingly.</p> <p>Other solutions are to use a custom <code>_renderItem</code> function or a custom extended widget, but in this case this can be a simpler soluti...
38,156,993
0
How to use for in loop decrement condition in swift? <p>I can use the for in loop in Swift through this code</p> <pre><code> for i in 0..&lt;5 { print ("Four multiplied by \(i) results in \(i*4)" ) } </code></pre> <p>But how do i use the for with less than ">" condition.</p> <pre><code> for i in 10&gt;..5 { print ("Fou...
32,674,086
0
<p>The <code>&lt;html&gt;</code> background is "behind" the <code>&lt;body&gt;</code> background. Try this to see what I mean:</p> <pre><code>html{ background-color:blue; } body{ background-color:white; max-width:400px; margin:0 auto; } </code></pre>
13,729,706
0
<p>If you want to copy the item from index 0 in the first list to index 0 in the second, and so on for all of the other indexes you can do this:</p> <pre><code>var pairs = members.Zip(divisions, (a, b) =&gt; new { Member = a, Division = b, }); foreach (var pair in pairs) { Copy(pair.Member, pair.Division); } </code></...
16,526,029
0
<p>Your OS will buffer a certain amount of incoming TCP data. For example on Solaris this defaults to 56K but can be reasonably configured for up to several MB if heavy bursts are expected. Linux appears to default to much smaller values, but you can see instructions on this web page for increasing those defaults: <a ...
14,388,250
0
Android : Network on main Thread with a Widget <p>I made a simple widget (<code>AppWidgetProvider</code>). To load its content, it needs to connect to the internet (<code>JSoup</code> is amazing). Obviously, I've got a wonderful <code>NetworkOnMainThreadException</code>. I tried to do an <code>AsyncTask</code> but Ecli...
36,142,507
0
Php AJAX search with external JSON file <p>So Im trying to create an input field that displays results without the need of a refresh from an external JSON file. My current code works fine, however how would I achieve checking for results in an external JSON file instead of directly in the php file?</p> <p>My JSON file:...
1,182,395
0
<p>As a bug-tracker, I am using <a href="http://www.mantisbt.org/" rel="nofollow noreferrer">Mantis</a> :</p> <ul> <li>it is not too hard to use (our clients are using it OK, even if they are not programmers) </li> <li>it does the job ; tracking bugs, at least, with what functionnalities you could expect</li> <li>it i...
15,485,149
0
<p>It will help you. <a href="http://css-tricks.com/snippets/css/media-queries-for-standard-devices/" rel="nofollow">Media Queries for standard devices.</a></p> <p>And use it as your meta tag.</p> <pre><code>&lt;meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; ...
17,502,294
0
What is the proper way to submit data from Parent form with partial view MVC 4? <p>The Main Controller</p> <pre><code>public class TestPartialController : Controller { // // GET: /TestPartial/ public ActionResult Index() { return View(); } [HttpPost] public ActionResult Index(Main model) { HttpContext.Items.Add("MainMo...
9,483,876
0
<p>Apparently the VCSCommand plugin has a setting called <code>VCSCommandDeleteOnHide</code> which when set to non zero will <code>:bdelete</code> the buffer on a hide which this includes <code>:q</code>. Note: this will apply to all VCSCommand buffers.</p> <pre><code>let g:VCSCommandDeleteOnHide = 1 </code></pre> <p>...
32,672,383
0
Swift use of unresolved identifier 'webView' <p>I want to add a webview to my application, but i keep getting this freaking error for webview. Please help!</p> <pre><code>import UIKit class Browse: UIViewController { @IBOutlet weak var browseweb: UIWebView! let browseurl = "http://google.com" override func viewDidLoad(...
21,746,286
0
<p><code>gsl_ran_binomial</code> should be declared with the <code>random</code> attribute, because it is a random number generator:</p> <pre><code>function gsl_ran_binomial random; </code></pre>
33,506,495
0
<p>If you can wait a month Postgres 9.5 will be out and has Row Security. Oracle has it now if you have ten million bucks kicking around. </p> <p>For now, or in other dbs, you can mimic row security:</p> <ol> <li><p>Each protected table gets an "owner" column. By default only the owner can select, update, or delete th...
11,628,374
0
<p>The reason to use a double here is the attempt to provide enough accuracy. </p> <p>In detail: The systems interrupt time slices are given by <em>ActualResolution</em> which is returned by <code>NtQueryTimerResolution()</code>. NtQueryTimerResolution is exported by the native Windows NT library NTDLL.DLL. The System...
7,950,654
0
<p>Try this, while calling your <strong>MainMenu</strong> activity from <strong>Game</strong> activity:</p> <pre><code>Intent intent = new Intent(this, MainMenu.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); this.startActivity(intent); </code></pre> <p>Hope this would help.</p>
37,975,201
0
<p>I was able to resolve it by replacing <code>'</code> with <code>%27</code>.</p> <pre><code>data-path="@file.Replace("'","%27")" </code></pre>
8,794,634
0
<p>MySQL has an <code>UNSIGNED</code> qualifier for integer types.</p> <p>Negative values will be clamped to zero, but will generate a warning:</p> <pre><code>mysql&gt; create table test ( id int(5) unsigned not null ); Query OK, 0 rows affected (0.05 sec) mysql&gt; insert into test values (-1), (5), (10); Query OK, 3...
27,937,346
0
<p>I have used this snippet on my ios app project:</p> <pre><code> window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem; window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, success, fail); var target_directory=""; function fail() { //alert("failed to get filesystem"); } function do...
31,439,918
0
<pre><code>with x as (select *, row_number() over(order by SYS_CREAT_TS desc) as rn from DATA_STUS) SELECT RVSN FROM x WHERE rn =1 and DATA_STUS_CD = 2 </code></pre> <p>If the data needs partitioning by a column, add it to the <code>over</code> clause so you get the desired results.</p>
27,625,987
0
<p>try</p> <pre><code>moveResult.MoveParts.map(function (movePart) { console.log(movePart.From); }; </code></pre>
32,811,935
0
<p>If you want to add five hours to <code>startTimePoint</code>, it's boringly simple:</p> <pre><code>startTimePoint += hours(5); // from the alias std::chrono::hours </code></pre> <p><a href="http://coliru.stacked-crooked.com/a/58b599e11f0bc13e" rel="nofollow">Live example</a>.</p> <p>By the way, you're trying to con...
19,669,246
0
<p>In the code you have posted above, there is no retain cycle.</p> <p>A retain cycle would be <code>self.A = self;</code> or more likely, <code>self.A.someStrongProperty = self</code>.</p> <p><strong>Edit:</strong> In the case you have edited above, assuming <code>self</code> is a view controller, it would not deallo...
10,798,274
0
Opening a database connection in a constructor, when should I close it? <p>well, I've been thinking of making database requests a little faster by keeping the connection to the database open as long as the object is being used. So I was thinking of opening the connection in the constructor of that class. Now the questi...
33,335,890
0
<p>Just plot each segment separately. This also allows for more flexibility as you can independently change the colors, add direction arrows, etc, for each connection.</p> <p>Here, I used a Python dictionary to hold your connectivity info.</p> <pre><code>import matplotlib.pyplot as plt coords = [(0.0, 0.0), (1.0, 1.0)...
24,630,478
0
<p>If you are using .Net 4.5 you can save yourself some key strokes and use the TPL</p> <pre><code>for (int i = 0; i &lt; count; i++) { Task.Run(() =&gt; cl.Print("id","password")); } </code></pre>
11,516,282
0
<p>If rob's post did not work, then i would try typing in bt (for backtrace) in the console</p>
39,067,961
0
My imported eclipse project gives error the project was not build since the build path is incomplete. Cannot find the class file for java.lang.object <p>i have imported a existing project to eclipse but it gives errors for java files only i have set libraries i have also set window>preferences>installed jres.BUt the pr...
35,065,788
0
How to determine the vendor/bin directory of Composer in a library? <p>Is there a reliable way to determine the local <code>vendor/bin</code> directory of an application from within a library? What I really want is the following:</p> <p>I am writing a library that depends on a third library. This third library ships wi...
16,402,013
0
Select all records of a type <p>I'm trying to get all records of specific type from RavenDB with C#.</p> <p>When I'm using Lucene:</p> <pre><code> var serviceTraces = session.Advanced.LuceneQuery&lt;ServiceTrace&gt;("IDLoadDateIndex").Take(50); </code></pre> <p>I'm getting the results in: </p> <p>serviceTraces.QueryRes...
646,295
0
<p>This is what I do for MVC + AJAX...</p> <p>Really simple implementation, if you were to ask me.</p> <p><a href="http://jarrettatwork.blogspot.com/2009/02/aspnet-mvc-ajax-brief-introduction.html" rel="nofollow noreferrer">http://jarrettatwork.blogspot.com/2009/02/aspnet-mvc-ajax-brief-introduction.html</a></p>
22,126,424
0
<p>I don't have access handy, but I'll give it a shot "free hand" and see how it goes :)<br> Since Access does not (afaik) have <code>CASE</code>, the trick would seem to be to use <code>IIF</code>;</p> <pre class="lang-sql prettyprint-override"><code>SELECT SUM(Total) as RoomRevenue, SUM(ExtraCharges) AS Extra, SUM(D...
13,109,827
0
<p>if you have exact the format <code>+Z (YYY) XXX-XX-XX</code>:</p> <pre><code>var num = input.replace( '/^\+\S+\s\((\d{3})\)\s(\d{3})-(\d{2})-(\d{2})$/', '\1\2\3\4' ); </code></pre> <p>but a more tolerant variant would be</p> <pre><code>var num = input.replace( '/^(\+\S+|\D/', '' ); </code></pre>
5,932,874
0
How can I use Visual basic to download the file I want in URl? <p>I'd like to downlowd one file chosen form this url</p> <blockquote> <p><a href="http://www.senao.com.tw/download.aspx" rel="nofollow">http://www.senao.com.tw/download.aspx</a></p> </blockquote> <p>But I need to use Visual Basic to autodownload form this ...
18,835,256
0
<p>I realized I can just add the icons as background images using the menu-item classes. Inelegant, but functional.</p>
9,499,804
0
<p>The PHP driver just returns the fields from MongoDB in whatever order MongoDB sends them. So, regardless of how you select the fields you wish to return, the data sent back won't change (unless you alter the fields list of course). Why don't you just order the results yourself after they are returned?</p>
33,747,893
0
Visual Studio 2015 "non-standard syntax; use '&' to create pointer for member" <p>I'm creating a quick game and I used a different class file for inputting player names. I keep getting the specified error :</p> <blockquote> <p>use '&amp;' to create pointer for member</p> </blockquote> <p>when I am trying to call the fu...
25,552,137
0
<p>I'll copy paste my answer from <a href="http://stackoverflow.com/a/25552002/3987202">http://stackoverflow.com/a/25552002/3987202</a><br><br> Another solution for those of us who can't make the jump to Hibernate 4.1.3.<br> Simply use <code>/*'*/:=/*'*/</code> inside the query. Hibernate code treats everything betwee...
24,254,845
0
<p>Finally, I find there's a lock when compiling prepared statements. I was compiling a new prepared statement whenever a new request come in, after I changed to reuse it I got my app server scale. However, I still don't know why cross-region case can scale.</p>
16,943,441
0
Safari crashes instantly when trying to debug iPad Simulator app <p>I realize that this is a long-shot... but I'm looking for tips or advice on how to prevent or debug this issue.</p> <p>If I start my app in the iPad simulator (webapp using phonegap), then start Safari and select Develope->iPad Simulator->index.html - ...
4,205,321
0
<p>I had this problem and it took me forever to figure out. The Child table has to allow nulls on it's parent foreign key. NHibernate likes to save the children with NULL in the foreign key column and then go back and update with the correct ParentId.</p>
20,559,968
0
<p>We can use another approach without bit shift to convert <code>bytes</code> to <code>short</code> without shift by using <code>java.nio.ByteBuffer</code></p> <pre><code>ByteBuffer bb = ByteBuffer.allocate(2); bb.order(ByteOrder.LITTLE_ENDIAN); bb.put(nTempByteArr[1]); bb.put(nTempByteArr[0]); short shortVal = bb.ge...
15,945,306
0
<p>From your code and exception actually you have an Object[] at pos[targetPos3].</p> <p>You cannot cast that to HashSet.</p>
17,169,661
0
How to unselect the parent checkbox when their child checkbox is unchecked using Jquery? <p>I am using asp.net tree view control. And using Jquery to select all the corresponding child check box when its parent is checked. The working Jquery and the rendered HTML is in here...<a href="http://jsfiddle.net/srk1982/Gak2h/...
27,017,971
0
Changing an unhandled exception to a handled one in a finally block <p>Consider this program:</p> <pre><code>using System; static class Program { static void Main(string[] args) { try { try { throw new A(); } finally { throw new B(); } } catch (B) { } Console.WriteLine("All done!"); } } class A : Exception { } class B ...
27,536,672
1
A dict-like class that uses transformed keys <p>I'd like a dict-like class that transparently uses transformed keys on lookup, so that I can write</p> <pre><code>k in d # instead of f(k) in d d[k] # instead of d[f(k)] d.get(k, v) # instead of d.get(f(k), v) </code></pre> <p>etc. (Imagine for example that <code>f</code>...
32,568,700
0
Install Old XML R Package From Source On Windows <p>I'm trying to install this package from source on Windows and cannot work out what is going on and what I need to do in order to get this working.</p> <p>I have the tar-gz file from CRAN, I have R-3.1.2 installed and RTools installed. </p> <p>When I try to install thi...
27,132,432
0
How to debug %post with rpmbuild <p>I'm building an RPM that needs to run a number of scripts to configure it after it's been installed to complete the installation. I have to run the scripts in the %post section because the configuration is dependent upon the type of host. All this is fairly easy and well, but every t...
2,185,287
0
<p>Yes, as long as your controller inherits from Controller (which it must in order to work as an MVC controller), you can use the same syntax without the &lt;%= %>.</p> <pre><code>Dim url = Url.Action("myAction", "myController", New With { ... }) </code></pre> <p>alternatively if you reference the MVCContrib DLL, you...