pid
int64
2.28k
41.1M
label
int64
0
1
text
stringlengths
1
28.3k
9,704,131
0
<p>You can make new union case values based on existing value of the same union case using Reflection. In order to achieve this just add instance member <code>Same</code> to your discriminated union, which first derives specific union case from the instance <code>self</code> and then constructs a new instance by the s...
31,280,140
0
<p>As @CBroe points out, this isn't supported by the Facebook Graph API. (It can be done using <a href="https://developers.facebook.com/docs/reference/fql/" rel="nofollow">FQL</a>, but that's deprecated and won't be supported for much longer).</p> <p>That said, with some creativity (and a bit extra code) a similar eff...
34,850,189
0
Kendo Sort not working <p>i have implemented a kendo grid as shown below , paging works without any issues but sort not work. Could you please help</p> <p>CSHTML</p> <pre><code>&lt;div class="panel"&gt; &lt;div id="CsHistory" class="row"&gt; &lt;div class="col-lg-12 col-md-12 col-sm-12" style="float:none; margin-left:a...
35,113,212
0
<p>It means that header "header.h" is included in more than one compilation unit.</p> <p>In this case variable GAMESTATE is defined in each module that includes the header.</p> <p>You should declare the variable without its definition in the header the following way</p> <pre><code>extern Gamestate GAMESTATE; </code></...
9,879,479
0
Optimization stops prematurely (MATLAB) <p>I'm trying my best to work it out with fmincon in MATLAB. When I call the function, I get one of the two following errors:</p> <p>Number of function evaluation exceeded, or</p> <p>Number of iteration exceeded.</p> <p>And when I look at the solution so far, it is way off the on...
11,983,857
0
SQL query to select max value of a varchar field <p>I want to select the max value of a varchar field and increment its value by 1 retaining its original format .. </p> <p>Customer ID for ex. : <code>CUS0000001</code> is the value </p> <p>add 1 to it and then enter it into the database along with other details.</p> <p>...
11,251,170
0
<p>What user is your ssh daemon running as? Presumably System. That user doesn't have authority to map network drives, as far as I recall. Can you not just do this on the Linux box directly using samba?</p>
3,769,939
0
<p>It is necessary to call ActionBarAdvisor.register() to make the save action available. For example:</p> <pre><code>public class MyActionBarAdvisor extends ActionBarAdvisor { public MyActionBarAdvisor(IActionBarConfigurer configurer) { super(configurer); } protected void makeActions(final IWorkbenchWindow window) { ...
25,546,637
0
ldap ObjectSID string to hex <p>I can't figure out how to search in an ldap directory by objectsid string:</p> <pre><code>$string = 'S-0-1-23-4567890123-4567890123-456789012-3456' $ds = ldap_connect('xxxx', xxx); ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); $r = ldap_bind($ds, $bind_rdn, $bind_password); $filter...
19,487,550
0
<p>You can force a numerical sorting when converting your text data type to a numeric one. Use an explicit or this implicit cast</p> <pre><code> ORDER BY cnumber * 1 ASC </code></pre>
1,470,983
0
PDF ZOOMING is fading the text <p>i successfully download the pdf file and it's working fine. But the problem is zooming . when i m zooming the clarity is not as clear as originally. need help..</p> <p>thanks in advance.</p> <p>--- goeff. </p>
4,083,966
0
ASP.NET pages never stop loading <p>We have a problem with many of our website written C# ASP.NET. The problem is that often a C# page will never fully load from the server. The page content itself load fine but Images but more annoying Scripts (Javascript) seam to hang and never come down and depending on the content ...
11,884,852
0
<p>Do something like that in a method, perhaps initDatabase or something: (the reason is the answer of trojanfoe, I just want to add some code snippets)</p> <pre><code>NSString *databaseName = @"bd_MyObjects.sqlite"; // Get the path to the documents directory and append the databaseName NSArray *documentPaths = NSSear...
28,946,463
0
Counters do not update <p>This is a first for me. I have started using GUIDE and after mild cussing I have hit rock bottom. I have setup a counter in a m-file but for some reason it does not update. Could you please help me. The counter is called num.</p> <pre><code>function ack = streamSensor_1_2_3(hObject, handles) i...
38,042,222
0
How to accelerate PHP execution by using cached result? <p>I'm using PHP-FPM 5.6 version.</p> <p>php -v shows there's OPcache in place.</p> <p>I have a PHP script that's accepting parameters and giving me same <code>2.2k</code> HTML output all the time.</p> <p>The script execution does not involve any connectivity to M...
32,534,703
0
<p>You can store then wherever makes sense. The catch is that when you <code>source</code> them, you need to either already be in that directory before running the initial <code>mysql</code> command, because <code>source</code> only looks in the current directory -- that's why they aren't found, not because you put th...
30,531,592
0
<p>You can use parameters only once in a query</p> <pre><code>$sql1="SELECT @rownum := @rownum + 1 Rank, q.* FROM (SELECT @rownum:=0) r,(SELECT * ,sum(`number of cases`) as tot, sum(`number of cases`) * 100 / t.s AS `% of total` FROM `myTable` CROSS JOIN (SELECT SUM(`number of cases`) AS s FROM `myTable` where `type`=...
9,473,326
0
<p>I personally verified that for domain classes there is a big hit in terms of performances.</p> <p>While trying to solve a performance issue, I found this blog entry <a href="http://blog.oio.de/2010/08/05/updated-grails-domain-class-creation-performance-avoid-named-parameters-in-loops-with-many-iterations/" rel="nof...
20,093,495
0
<p>The following can work. You can google for them and see how they work.</p> <pre><code>driver.findElement(By.id("id")); driver.findElement(By.cssSelector("cssSelector")); driver.findElement(By.name("name")); driver.findElement(By.linkText("linkText")); driver.findElement(By.partialLinkText("partialLinkText")); drive...
25,749,239
0
<p>You have created list of exceptions, i.e. list that can hold instances of exceptions. But you try to add there <code>class</code> instead. </p> <p>the following will work </p> <pre><code>List&lt;Exception&gt; ex = new ArrayList&lt;Exception&gt;(); ex.add(new NotFoundException()); </code></pre> <p>(obvioously if you...
32,058,169
0
<p>One is to INNER JOIN Table B onto Table A by ID's. You will have 3 records returned from Table B. If you ORDER those records by the COLX</p> <pre><code>SELECT ,a.ID ,a.Col1 ,a.Col2 ,a.Col3 ,b.COLX FROM TableA AS a INNER JOIN TABLE_B AS b on b.A_ID = a.id ORDER BY b.COLX DESC </code></pre> <p>Then another way is joi...
41,018,667
0
<p>You can use HttpClient class to create an object and make <code>get</code> or <code>put</code> requests for your restful API. You may need to pass the API key or secret in the get parameters in the request or add these as Http headers for your HttpClient object.</p>
1,263,878
0
<p>If your regex engine has lookbehind assertions then you can just add a "(?&lt;!\.)" before the "@".</p>
37,947,315
0
<pre><code> ((MainActivity)getActivity()).mDrawerToggle.setDrawerIndicatorEnabled(false); ((MainActivity)getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true); getActivity().getSupportFragmentManager().beginTransaction() .add(R.id.frame, new DetailFragment())//here add add fragment on stack .addToBackSt...
22,792,860
0
<pre><code>&lt;?php if ( get_query_var('paged') ) { $paged = get_query_var('paged'); } elseif ( get_query_var('page') ) { $paged = get_query_var('page'); } else { $paged = 1; } $q_cat = get_query_var('cat'); $cat = get_category($q_cat); $catName = $cat-&gt;cat_ID; $category = new WP_Query(); query_posts( array( 'post_...
9,910,853
0
<p>Android reserves the right to kill any application or component that isn't visible to the user (even those can be killed, but it's a rare occurrence). Most often, this is due to memory pressure, and the system kills applications to free up resources.</p> <p>If you have a long-running process that runs in the backgr...
18,028,548
0
<p>Just put that in your hosts file and you won't have to worry about DNS.</p> <p>But really, doesn't it make more sense to use an ENV var?</p>
13,659,262
0
<p><code>CR</code> represents the regular Viginere ciphertext, <code>CM</code> the modified Viginere ciphertext</p> <pre><code>CR[i] = (P[i] + K[i]) mod 26 CM[i] = (P[i] + K[i] + CM[i-1]) mod 26 = (CR[i] + CM[i-1]) mod 26 </code></pre> <p>Now simply solve for the original ciphertext <code>CR</code></p> <pre><code>CR[i...
8,593,533
0
<p>This is a fairly common problem.</p> <p>One often used solution is to have pipes as a communication mechanism from worker threads back to the I/O thread. Having completed its task a worker thread writes the pointer to the result into the pipe. The I/O thread waits on the read end of the pipe along with other socket...
6,860,743
0
<p>Why not store the values in the list and in the map the key -> index mapping?</p> <p>so for getEntry you only need on lookup (in the list which should be anyway faster than a map) and for remove you do not have to travers the whole list. Syhnronization happens so.</p>
866,626
0
<p>For UNIX, <code>man setitimer</code>.</p>
30,010,264
0
<p>I'm just messing around with the Gdriv.es service and the link you posted. Thanks for sending me down the rabbit-hole... </p> <p>Google Drive folders seem to either have 28 or 72 character long ids. Most of your product subfolders have the 28 character id format. Interestingly, there are some other folders that sho...
12,942,911
0
Octopress, github pages, CNAME domain and google website search <p>My <a href="http://www.convalesco.org" rel="nofollow">blog</a> was successfully transferred to <a href="http://octopress.org" rel="nofollow">octopress</a> and github-pages. My problem though is that website's search uses <a href="https://encrypted.googl...
25,455,197
0
<pre><code>mysql_insert_id(); </code></pre> <p>That's it :)</p>
9,473,396
0
<p>Well, there are <code>splay trees</code> and <code>AVL Trees</code> that does what you are asking for but those are limited to a max of 2 children per node. You could try modifying them. The problem could be <code>Form a tree which is as wide as possible</code>.</p>
22,470,118
0
<p>You are not passing any parameters to the query.</p> <p>Instead of:</p> <pre><code>cur.execute('INSERT INTO report_table (id, date, time, status) VALUES (id, date, time, status)') </code></pre> <p>create a parameterized query:</p> <pre><code>cur.execute("""INSERT INTO report_table (id, date, time, status) VALUES (%...
5,448,806
0
Syntax for naming foreign keys <p>Using:</p> <pre><code>ALTER TABLE dbo.Table1Name ADD FOREIGN KEY (colname) REFERENCES dbo.Table2Name (colname) </code></pre> <p>I get a foreign key with a name like: FK&#95;&#95;_colname&#95;&#95;673F4B05</p> <p>I want it to be named: FK_Tabl1Name_Table2Name, </p> <p>...so that it will...
29,281,643
0
<pre><code>DataTable dttable = new DataTable(); dttable = gettable(dtgreater, dtcurrentdate); public DataTable gettable(List&lt;DateTime&gt; objct1, DateTime objct2) { DataTable data=null; sql = "select library_issue.STUDENTCODE,library_issue.studentname,library_book.bookname,library_issue.issuedate,library_issue.retu...
24,512,566
0
<p>I recommend looking over this documentation for the <a href="https://developer.apple.com/library/ios/documentation/AddressBookUI/Reference/ABNewPersonViewController_Class/Reference/Reference.html" rel="nofollow">ABNewPersonViewController</a> class. </p> <p>The setup I would use is to setup an IBAction to your "Add ...
19,410,010
0
<p>Yes, of course this is possible. You can either use a 3D array:</p> <pre><code>byte[][][] array = new byte[w][h][3]; array[0][0][0] = 123; array[0][0][1] = 234; array[0][0][2] = 125; </code></pre> <p>Or use a 2D array of ints. ints are 4 bytes, which is enough for your requirements:</p> <pre><code>int[][] array = n...
13,353,544
0
Ruby, Tor and Net::HTTP::Proxy <p>My apologies in advance if this is a noobish doubt: I want to use a proxy in my Ruby code to fetch a few web pages. And I want to be sneaky about it! So I am using Tor.</p> <p>I have Tor running, and I am able to use Net::HTTP.get(uri) as usual. But I can't figure out how to use Net::H...
27,939,800
0
<p>Try attribute <code>colorControlActivated</code>:</p> <p>themes.xml</p> <p></p> <pre><code>&lt;style name="CET" parent="Theme.AppCompat.Light.NoActionBar"&gt; &lt;item name="windowActionBar"&gt;false&lt;/item&gt; &lt;item name="colorPrimary"&gt;@color/primary&lt;/item&gt; &lt;item name="colorPrimaryDark"&gt;@color/...
39,626,771
0
Batch file not keeping variables <p>Why doesn't the below batch file keep variables when CMD.exe terminates</p> <pre><code>@echo off cmd /c "set var=hi" if defined var (echo var is defined ("var=%var%")) else (echo var isn't defined) pause exit </code></pre> <p>Is there any way to use CMD /c, whilst keeping variables? ...
20,534,760
0
<p>You can use Householder elimination to get the QR decomposition of <code>delta0</code>. Then the determinant of the Q part is +/-1 (depending on whether you did an even or odd number of reflections) and the determinant of the R part is the product of the diagonal elements. Both of these are easy to compute without ...
7,245,634
0
Deactivate line feed with css of tag p <p>Hello I'm defining a css style and I have a problem with the tag p. I am defining a style p tag and I get a line feed but I would like to deactivate its Line feed instead. How to do that?</p>
18,784,882
0
<p>A similar problem and its solution is <a href="http://stackoverflow.com/questions/12920225/text-selection-in-divcontenteditable-when-double-click">here</a>, I am surprised for finding it in the second day of search considering my offensive search yesterday. Any better solution is welcomed, since even this one canno...
30,224,228
0
<p>The wiki page says to use a "Java source files", not "Interface Builder Storyboard files" as your screen capture shows. You also need to define an output file, or Xcode ignores the rule (since it doesn't generate anything).</p> <p>I just verified that adding a Java source file to a 6.3.1 project works with the wiki...
23,733,985
0
<p>Use ng-class and call a function on your controller that does the check:</p> <pre><code>$scope.getClass = function(text) { return text.slice(-1) === '!' ? 'error':''; } </code></pre> <p><a href="http://jsfiddle.net/hHdfF/" rel="nofollow"><h2>Fiddle</h2></a></p> <p>Update: </p> <pre><code>&lt;div ng-class="(message....
34,999,434
0
maven-release-plugin deploying SNAPSHOT <p>I have a Maven project and now want to release it with the maven-release-plugin. Unfortunately after executing <code>mvn release:prepare</code> the git tag contains the old version number (1.0-SNAPSHOT) and when deploying to artifactory the SNAPSHOT version is used instead of ...
13,252,265
0
<p>You could animate the footer with <a href="http://api.jquery.com/fadeIn/" rel="nofollow">fadeIn()</a> and <a href="http://api.jquery.com/fadeOut/" rel="nofollow">fadeOut()</a> jQuery effects.</p> <pre><code>$(window).scroll(function() { if($(document).scrollTop() &gt; 100) $('#footer').fadeIn(); else $('#footer').f...
20,703,092
0
<p>Look for sources titled "C for Scientists" or "C for engineers". The first google hit contains answers to your questions: (<a href="http://www2.warwick.ac.uk/fac/sci/physics/current/teach/module_home/px270/week2/week_2a.pdf" rel="nofollow">http://www2.warwick.ac.uk/fac/sci/physics/current/teach/module_home/px270/we...
25,404,286
0
<p>use the <a href="https://metacpan.org/pod/Time::Moment" rel="nofollow">Time::Moment</a> CPAN module:</p> <pre><code>use Time::Moment; my $data = 0x0FA89EEB0F; my $seconds = $data &gt;&gt; 8; # Right shift to remove fractional second. my $milliseconds = 10 * ( $data &amp; 0xff ); # Hundredths to Milli my $tm = Time:...
1,102,547
0
Working with Dreamweaver and ASP.NET - is this recommended? <p>I am a ASP.NET 3.5 web developer using VS 2008. I just started at a new company and there are alot of Web Designers here (never worked with Web Designers before). They all use Dreamweaver CS3 and PhotoShop (something i know nothing about).</p> <p><strong>Wh...
4,402,288
0
<p>I'm not an expert in hard real-time scheduling, but this is what your algorithm sounds like to me.</p> <p>It bears very strong resemblance with what happens in aerospace systems. Your system looks more flexible, but basically it all grinds down to knowing in advance that you have the resources to run the tasks that...
6,699,850
0
<p>maybe you think about such declaration (I think this is it):</p> <pre><code>public abstract class AbstractEventBuffer&lt;E extends BufferedEvent&lt;?&gt;&gt; </code></pre> <p>or:</p> <pre><code>public abstract class AbstractEventBuffer&lt;T, E extends BufferedEvent&lt;T&gt;&gt; </code></pre> <p>or</p> <pre><code>pu...
11,890,124
0
Java nio server client asynchonous <p>I made a server myself using java nio and a selector. I can receive the data and answer directly from the client if needed.</p> <p>But now I want a thread that will process data, and anytime it will send data to each client.</p> <p>So how can I do that? Also how to keep in memory a...
21,586,688
0
callback function with underscore _.each() <p>I'm trying to implement an _.each() (that I wrote) inside another function and I keep getting "undefined" returned to me. I'm trying to use _.each() to apply a test function to an array. I know this a simple callback syntax issue, but its perplexing me. </p> <p>thanks in ad...
15,665,391
0
<p>Unescaped quotes inside quotes</p> <p>This</p> <pre><code>$sql = pg_query("SELECT title FROM books WHERE ownedby=("$user_id")"); </code></pre> <p>Should be</p> <pre><code>$sql = pg_query("SELECT title FROM books WHERE ownedby='$user_id'"); </code></pre> <p>Or</p> <pre><code>$sql = pg_query("SELECT title FROM books ...
36,397,864
0
<p>A claim from website A will not be sent to website B.</p> <p>This could work this way: </p> <ol> <li>A users logs on to site A (using credentials from B2C)</li> <li>User saves info into B2C (using Graph API)</li> <li>Redirect to Site B</li> <li>User logs on to site B (this can occur without prompting the user, same...
23,625,044
0
<p>It is a package to be able to use <code>async</code> and <code>await</code> in .NET 4.0 projects.</p> <p>But be aware. I encountered the problem where these libraries cannot be used in .NET 4.5 projects. But this was before the initial release of .NET 4.5. Therefore this problem might be resolved.</p>
17,667,578
0
<p>you're not using Stage3D. If you use Starling, ND2D or write your own Stage3D wrapper you'll be able to get better performance.</p> <p>You can also take a look at Jackson Dunstan's blog, this post is especially helpful: <a href="http://jacksondunstan.com/articles/2279" rel="nofollow">http://jacksondunstan.com/artic...
30,768,030
0
minecraft forge doesnt seem to call postInit <p>I am writing an addon to the minecraft mod Thaumcraft, specifically one that adds aspects to blocks based on the contents of a file. This is for Minecraft 1.7.10</p> <p>The code runs the preInit method, everything goes fine. However, the game crashes on the postInit metho...
9,786,736
1
How to read through collection in chunks by 1000? <p>I need to read whole collection from MongoDB ( collection name is "test" ) in Python code. I tried like </p> <pre><code> self.__connection__ = Connection('localhost',27017) dbh = self.__connection__['test_db'] collection = dbh['test'] </code></pre> <p>How to read thr...
23,207,215
0
Free scrolling and parallax issue (jQuery Scroll Path + Parallax) <p>in a project where I need to build something like the famous parallax-powered Mario Kart Wii Experience site, which also comes with horizontal and vertical scroll (if you haven't seen it, here it is: <a href="http://www.nintendo.com.au/gamesites/mario...
8,981,820
0
clueTip is a jQuery plugin for displaying stylized tooltips
36,665,346
0
<p>Two notes: such more complex query conditions cannot be written using symbols, you have to use string notation instead. And, secondly, a scope does not need to have a parameter, your <code>latest</code> scope is one of them, as you simply compare the <em>database</em> <code>created_at</code> time with the current t...
8,923,120
0
<p><a href="https://github.com/codegram/rack-webconsole" rel="nofollow">https://github.com/codegram/rack-webconsole</a></p> <p>Or you could simply pass the Ruby code to the server via post and call <a href="http://www.ruby-doc.org/core-1.9.2/Kernel.html#method-i-eval" rel="nofollow">eval</a> <code>eval(CODE)</code>.</...
21,677,171
0
<p>If you're using 11g or later version of Oracle, the easiest way to transpose rows into columns is PIVOT operator (<a href="http://www.oracle-base.com/articles/11g/pivot-and-unpivot-operators-11gr1.php" rel="nofollow">documentation</a>). For example, consider this query - it'll give you the table of all roles and pr...
34,641,471
0
How can I assign int values to const char array in my blackjack game, C <p>I'm working on a blackjack game in C. I have three functions, one to fill the deck, one for shuffling the cards and one for dealing the cards. My problem is that I don't know how to give my cards an integer value, I need that to see who wins. I ...
2,869,472
0
<p>As long as you are inside the <code>EnumTest</code> class, you can access the <code>LEN</code> field by simply writing:</p> <pre><code>int len = RecordType1.LEN; </code></pre> <p>From the outside, it's still difficult.</p>
7,842,194
0
<p><a href="http://pubs.opengroup.org/onlinepubs/007904975/functions/atoi.html" rel="nofollow"><code>atoi()</code></a> should do what you want to, although a more robust implementation would use <a href="http://pubs.opengroup.org/onlinepubs/007904975/functions/strtol.html" rel="nofollow"><code>strtol()</code></a>.</p>
482,882
0
<p>Another potential problem is where your databinding is happening - I don't see a DataSource in your code-in-front, so I guess you're databinding in the code-behind.</p> <p>If you are doing the databind on postback, and after the first onChange event has fired, it's quite likely that the databind event is reseting t...
1,071,106
0
Do web apps encrypt passwords during login when integrated security is enabled within IIS? <p>I have always enabled integrated security on my web apps inside IIS with the assumption that the passwords that are requested on the client end will always be transmitted securely (encrypted) to my authentication server (AD/LS...
11,741,777
0
<p>If you are using a BroadcastReceiver to receive incoming calls, you have to use <code>SipManager.getCallId(incomingCallIntent)</code> inside your 'onReceive()' method.</p>
16,210,560
0
<p><a href="https://pypi.python.org/pypi/xlrd" rel="nofollow">xlrd</a> has support for .xlsx files, and this <a href="http://stackoverflow.com/a/9897909/1452002">answer</a> suggests that at least the beta version of xlrd with .xlsx support was quicker than openpyxl. </p> <p>The current stable version of Pandas (11.0) ...
37,493,136
0
I am currently developing a script in PERL it works but I would like to append the contents to the CSV file whenever the script is executed <pre><code>print "Enter number of days: "; my $var = &lt;STDIN&gt;; my $SQL = "COPY (SELECT * FROM Parent WHERE StartDate &lt; NOW() - INTERVAL '$var days') TO '/home/username/Desk...
24,941,367
0
<blockquote> <p>however I'm trying to deduce whether or not there is something interfering with the response in between the client an server.</p> </blockquote> <p>So you want to take a look what headers etc were sent even though the server is not sending the required <em>Access-Control-Allow-Origin</em> header along w...
33,332,700
0
<p>If you look at Pascal's triangle as a matrix, and you want to find the complexity of building that matrix up to size <code>n x k</code>, then the big-oh of that will be <code>O(n*k)</code>. Obviously you can't get better than that, because that's the size of the matrix.</p> <p>How do we get that? Use the following ...
1,636,474
0
How to use shared array between function calls in objective C <p>I have one array. I want that array to retain its value between function calls of from single class function.</p> <p>I have function that is called every time page is loaded. </p> <p>This function displays all the data stored in array right from applicati...
38,510,941
0
<p>You can loop through your array elements and add <code>&lt;tr&gt;</code> to them for each row.</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>var arr = ["&lt;td&gt;200&lt;...
38,721,983
0
<p>Assuming you want the 10 most recent eve_Dates for each customer.</p> <p><strong>untested</strong> I'm thinking the correlated subquery will generate a result set for each customer, but I'm not positive about that.</p> <p>I don't think you were limiting to the 10 records because you had no join on date.</p> <pre><c...
38,014,372
0
<p>Try This code </p> <pre><code> #include &lt;stdio.h&gt; int main() { int i, repeatName; // ints char firstName[50]; // array to store users name // get first name from user printf("Please enter your first name: "); scanf("%s", firstName); // get amount of times user would like to repeat name printf("How many times ...
10,420,354
0
<p>You're confused about what first and second mean. In this expression:</p> <pre><code>"([^$]*(\\$[A-Za-z][A-Za-z0-9_]*))+" ^_______________________________^ this part </code></pre> <p>is the first parenthesizes subexpression and </p> <pre><code>"([^$]*(\\$[A-Za-z][A-Za-z0-9_]*))+" ^________________________^ this par...
22,090,033
0
Link on my website to facebook message a page <p>I would like to embed a link that will open site visitor's browser with their facebook account in "New Message" writing mode with the "to:" field already pointing to my Facebook page.</p> <p>Is there a way to do this?</p> <p>It's a wordpress site, so if there is already ...
39,505,018
0
<p>Its not an error, It is a warning.</p> <p>It means that you have called the method <code>calculateTip()</code> which return Bool value. But you have not used this result anywhere.</p> <p>To suppress this warning just to this:</p> <pre><code>print(calculateTip()) </code></pre> <p>Now you are printing the output of t...
3,609,408
0
<p>Why would you want to create a Collection but then specify that it should be empty?</p> <p>You can just instantiate the PriorityQueue with <code>Math.max(1, data.size())</code></p>
8,632,267
0
accessing data of a GridView on button click <p>I am having a gridview with some columns and a template field column that contains a button and I want to call a procedure on button click, however I want to pass a value of a column to the procedure but I am getting an error, here is the action listener of the button: (c...
16,549,700
0
<p>Just add the <code>focus()</code> trigger after the value is set, like so:</p> <pre><code>$('#social-url').val("http://www.twitter.com/").focus(); </code></pre> <p>Here's how I'd do it:</p> <pre><code>$(document).ready(function() { $('select').on('change', function() { $('#social-url').val("http://www." + this.valu...
15,835,080
0
Chrome Extension - Run content script only when button is clicked <p>I've had a good look, but I can't seem to find and answer to this question (well, one that works for me anyway).</p> <p>I've made a Chrome extension that should run the code that's in my content script on click of the icon only, but it always runs as ...
6,423,121
0
<p>simply you can do this --</p> <p>there are so many option or answer available for this. one of these is as follow--</p> <pre><code>select case when b.c_1 = 1 then b.col1 else null end col1, b.col2 col2, b.col3 col3 from ( select distinct col1,col2,col3, rownum() over(partition by col1) c_1 from table_name )b </code...
17,751,637
0
Dynamic Dropdown menu - PHP <p>First of all, I am new to mysqli and prepare statements so please let me know if you see any error. I have this static drop down menu : <img src="https://i.stack.imgur.com/BJwtZ.png" alt="enter image description here"></p> <p>HTML code:</p> <pre><code>&lt;ul class="menu sgray fade" id="me...
1,398,344
0
<p>Aside from changing your entity name, your options are really limited to name-aliasing and/or fully-qualifying the two colliding names, as you are already doing.</p> <p>My personal preference would be fully-qualifying both type names throughout the source. Your current approach is a mix of both aliasing and qualify...
23,097,162
0
<p>As suggested in the comments, the Array <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter" rel="nofollow">filter</a> method should give you what you want. Here's a start:</p> <pre><code>var filteredFilms = films.filter(function(film) { return parseInt(film.durati...
1,725,514
0
Help me remove a Singleton: looking for an alternative <p>Background: I have some classes implementing a subject/observer design pattern that I've made thread-safe. A <code>subject</code> will notify it's <code>observers</code> by a simple method call <code>observer-&gt;Notified( this )</code> if the <code>observer</co...
32,433,237
0
<p>If you have associative array than You can use php built in function <code>extract()</code>. </p> <p>Example:</p> <pre><code>$abc = array('var1'=&gt;2, 'var2'=&gt;4, 'var3'=&gt;6); extract($abc); echo $var1.$var2.$var3; //Outputs 246 </code></pre>
36,406,419
0
<p>u can use isEnabled() to verify whether it is enabled or disable.it returns boolean .if it returns true the element is enabled if it returns false the element is disabled.</p>
40,701,314
0
<p>You called a method that basically calls another method of the same signature </p> <pre><code>@Override public String userSignIn(String email, String password, String authType) throws Exception { login(email, password, authType, new OnLoginResponseCallback() { @Override </code></pre> <p>Instead, wherever you would ...
33,371,936
0
<p>No, a static method cannot call a non-static method.</p> <p>Consider that you have objects <code>a</code> and <code>b</code>, both instances of <code>Currency</code>. <code>currencyValidator</code> exists on those two objects. Now <code>store()</code> belongs to the class <code>Currency</code> itself, not one of th...
1,195,551
0
<p>I understand your concern. Even for trusted sources, PHP provides more access than is necessary to the whole environment of the web request. Even if the scripters are trusted and even if they can only harm themselves with a scripting error, a more constrained scripting environment would be easier for them to use an...
364,590
0
<p>Of additional interest is probably how good of a fit the line is. For that, use the Pearson correlation, here in a PHP function:</p> <pre><code>/** * returns the pearson correlation coefficient (least squares best fit line) * * @param array $x array of all x vals * @param array $y array of all y vals */ function pe...