pid int64 2.28k 41.1M | label int64 0 1 | text stringlengths 1 28.3k |
|---|---|---|
23,008,642 | 0 | How to use jQuery with phantomjs <p>I'm trying to do a simple test of jQuery with phantomjs:</p> <pre><code>var url = 'http://www.google.com/'; var page = require('webpage').create(); page.open(url, function () { page.injectJs('jquery.min.js'); page.evaluate(function () { console.log($('title').text()); }); phantom.exi... |
19,369,315 | 0 | |
5,861,584 | 0 | <p>It is possible with TPC inheritance but it will include a lot of complication to your design. For example: </p> <ul> <li>you will have to move shared properties to the base class</li> <li>you will probably have to maintain some mappings manually in EDMX (at least I had when I did the sample on screenshot)</li> <li>... |
35,923,144 | 0 | Test CharSequences for equality in JUnit <p>The following test runs successfully:</p> <pre><code>assertEquals(a.toString(), b.toString()); </code></pre> <p>The following does not:</p> <pre><code>assertEquals(a, b); </code></pre> <p><code>a</code> is a <code>StringBuilder</code>, while <code>b</code> is a <code>CharSequ... |
24,722,323 | 0 | Using gif image and saving <p>I tried to add gif image into a canvas and after adding, gif was static but when I change some other object property, i.e. <code>Kinetic.Text();</code>s <code>setY()</code> property, gif image moved to another step of an animation.</p> <p>Is any way, how to to add <strong>gif image</strong... |
4,429,759 | 0 | <p>Try changing the order of the handlers (remove then add). In this example I have removed all but the AJAX/script handler.</p> <pre><code><system.webServer> <modules runAllManagedModulesForAllRequests="true" /> <handlers> <remove name="WebServiceHandlerFactory-Integrated"/> <remove name="W... |
29,332,446 | 0 | MongoDB PHP Limit the returning values of a field <pre><code>{ name : "name 1", field : [ { random:"value 1", random2:"second value" } { random:"value 2", random2:"second value 2" } { random:"value 3", random2:"second value 3" } { random:"value 4", random2:"second value 4" } ] } { name : "name 2", field : [ { random:"v... |
30,182,767 | 0 | <p>When using <code>get_template_part</code>, the first parameter defines the base template name (e.g. <code>content</code>, which loads <code>content.php</code>) and the second parameter loads a suffixed version if available. Therefore your call</p> <pre><code>get_template_part('content', 'single-ourNews'); </code></... |
11,778,961 | 0 | <p><a href="http://docs.python.org/library/functions.html#zip" rel="nofollow"><code>zip</code></a> will stop as soon as <em>any</em> of its iterables stop (because otherwise it wouldn't know what to fill in the blanks with!):</p> <blockquote> <p>The returned list is truncated in length to the length of the shortest ar... |
23,020,467 | 0 | <p>For amd64, you need to use "syscall" - and use different registers - instead of "int 0x80":</p> <p><a href="http://cs.lmu.edu/~ray/notes/linuxsyscalls/">http://cs.lmu.edu/~ray/notes/linuxsyscalls/</a></p> <p><a href="http://blog.rchapman.org/post/36801038863/linux-system-call-table-for-x86-64">http://blog.rchapman.... |
8,427,895 | 0 | Is there .net implementation of TeX <p>T<sub>E</sub>X is a typesetting system written by Donald E. Knuth. <a href="http://miktex.org/about" rel="nofollow">MiKT<sub>E</sub>X</a> is an up-to-date implementation of T<sub>E</sub>X and related programs for Windows (all current variants).</p> <p>Is there .NET implementation ... |
34,870,744 | 0 | <p>Based on the example from the <a href="http://rssphp.net/examples/" rel="nofollow">RSS parser</a>, each <code>$item</code> is an associative array with keys such as <code>title</code> and <code>description</code>. <code>['title']</code> is an array literal containing one string, <code>'title'</code>, if you want to... |
13,358,921 | 0 | How do I create this layout in android <p>How do I create this layout in android </p> <pre><code>--------------------- |col1 | col2 | col3 | | col1 | col2 | --------------------- </code></pre> <p>The first row is 3 columns equal width, and the second row is 2 row equal width. Is it possible to create this in TableLayou... |
28,249,410 | 0 | How can I access my php file from javascript in my directory structure? <p>I have the following directory structure in my PHP project (framework: <a href="https://github.com/panique/mini" rel="nofollow">https://github.com/panique/mini</a>)</p> <pre><code>application --controller ----album.php --libs ----s3demo.php --mo... |
40,130,528 | 0 | <p>To upload large binary files using CURL you'll need to use <code>--data-binary</code> flag. </p> <p>In my case it was: </p> <pre><code> curl -X PUT --data-binary @big-file.iso https://example.com </code></pre> <p><strong>Note:</strong> this is really an extended version of @KarlC comment, which actually is the prop... |
29,646,395 | 0 | <p>Your problem is you lack any form or execution in the given example.</p> <p>You can use PDO start with this tutorial: <a href="http://www.mysqltutorial.org/php-querying-data-from-mysql-table/" rel="nofollow">http://www.mysqltutorial.org/php-querying-data-from-mysql-table/</a></p> <p>I would also look up, PHP Classe... |
6,267,383 | 0 | UIPickerView: numberOfRowsInComponent is being called twice for same component and is not displaying row titles <p>I'm trying to setup a login form for my application and it is the UIPickerView is not showing the row data. What I am seeing is that the numberOfRowsInComponent is being called twice? But titleForRow is on... |
9,268,642 | 0 | <p>My guess, you need to add i=0; at the beginning.</p> |
40,889,214 | 0 | Upload file with carrierwave without name <p>It's me again. I try to upload some yaml files with carrierwave. Everything works fine till now. </p> <p>So, as you know for carrierwave the forms looks like the follow:</p> <pre><code><%= form_for @resume, html: { multipart: true } do |f| %> <%= f.label :name %>... |
21,011,149 | 0 | <p>Do you have the methods for it? If you don't try get the methods out first by using:</p> <pre><code>print server.system.listMethods() </code></pre> <p>After you found out your method, get the signature so it's easier for you to do a search on it.</p> |
7,662,456 | 0 | <p>From the <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf" rel="nofollow">C++ Standard ( Working Draft )</a>, section 5 on binary operators</p> <blockquote> <p>Many binary operators that expect operands of arithmetic or enumeration type cause conversions and yield result types in a similar... |
24,390,366 | 0 | ravendb linq query does not use overriden equals method? <p>This works :</p> <pre><code>IQueryable<Record> query = _db.Query<Record>() .Statistics(out stats) .Where(r => r.Keywords.Any( k => k.Value.Equals(searchInputModel.Keyword.Value))); </code></pre> <p>but this doesn't</p> <pre><code> IQueryable&... |
9,180,820 | 0 | <p>A more jqueryish way than using just regular expressions: </p> <pre><code>var path = $('<a>', {href: 'http://google.com/foo/bar.py'})[0].pathname.replace(/\.(.+)$/,'') </code></pre> |
30,217,582 | 0 | <p>Look at this post here: <a href="http://blogs.msdn.com/b/pfxteam/archive/2009/02/19/9434171.aspx" rel="nofollow">Thread safe random number generation</a></p> <p>In short: Random() is not thread safe, nor was it designed to be.</p> |
25,869,285 | 0 | Can Anyone tell me how can i solve this Exception <pre><code>class Revers { static void temp(String k) { int x; char ch[]= k.toCharArray(); //Convert String into character char p[]=k.toCharArray(); //Convert String into character x=k.length(); System.out.println(x); for(int i=0;i<x;x--,i++) { p[i]=ch[x]; `/*Exceptio... |
1,216,211 | 0 | <p>Before you get started, do not use macro names that begin with an underscore - these are reserved for compiler and standard library writers, and must not be used in your own code.</p> <p>Additionally, I would say that the macros you suggest are all ver bad ideas, because they hide from the reader what is going on. ... |
12,271,011 | 0 | <p>1) please read tutorial about <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/table.html#sorting" rel="nofollow noreferrer">JTable that's contains TableRowSorter example</a>, issue about RowSorter must be in your code</p> <p>2) by default you can to use follows definition for ColumnClass, </p> <p... |
17,380,924 | 0 | <p>Session data is stored server-side.</p> <p>Cookie data is stored client-side.</p> |
32,960,039 | 0 | <p><code>success</code> and <code>error</code> are <strong>never</strong> <code>set</code>, actually, unless your server is configured to execute <code>html</code> files as <code>php</code>, you won't be able to retrieve <strong>anything</strong> inside <code>contact.html</code>.</p> <p>rename <code>contact.html</code... |
7,370,935 | 1 | Django:Map urls to class like in web.py <p>i am learning django but gave web.py a try first. while reading django's documentation i found that in i need to check for the request type in each method.. like:</p> <pre><code>def myview(): if request.method == "POST": #blah balh #ke$ha (jst kiddn) else: #(balh)x2 </code></p... |
12,299,901 | 0 | Changing XML to JSON in PHP <p>My site was pulling in a shopping API, using XML, and I'd like to switch it to the Google Shopping API, which uses JSON or Atom.</p> <p>I can't seem to work out how to get the following to work in JSON or Atom, any help much appreciated.</p> <pre><code>$query = str_replace(' ', '%', $row[... |
14,034,468 | 0 | <p>OK using </p> <pre><code>$(".fb-recommendations-bar").data("href", href); </code></pre> <p>instead of</p> <pre><code>$(".fb-recommendations-bar").attr("data-href", href); </code></pre> <p>and</p> <pre><code>FB.XFBML.parse(); </code></pre> <p>or</p> <pre><code>FB.XFBML.parse(document.getElementById('.fb-recommendati... |
20,975,390 | 0 | <pre><code> In the PHP part you need add two more headers : header("Access-Control-Allow-Origin: *"); header('Access-Control-Allow-Methods: GET, POST'); Add the two line of coding with the: header('Content-Type: application/json'); change the: echo (json_encode($data)); to: print $my_json = json_encode($data); or: pri... |
12,667,002 | 0 | C++ "Cannot declare parameter to be of abstract type <p>I'm trying to implement generic wrapper in C++ that will be able to compare two things. I've done it as follows:</p> <pre><code>template <class T> class GameNode { public: //constructor GameNode( T value ) : myValue( value ) { } //return this node's value T ... |
29,877,161 | 0 | <p>In your <code>onCreate()</code> after drawer layout and list are found call:</p> <pre><code>mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED, mDrawerList); drawerToggle.setDrawerIndicatorEnabled(false); </code></pre> <p>From the <a href="https://developer.android.com/reference/android/support/v4... |
38,435,463 | 0 | <p>Try to use this </p> <pre><code>[self.tableView scrollToRowAtIndexPath:YOUR_INDEX_PATH_OF_SECTION atScrollPosition:UITableViewScrollPositionTop animated:YES] </code></pre> |
20,503,856 | 0 | SQL query: for each state with specific number of sailors <p>I'm starting to learn to write SQL queries. However, I'm still struggling with that. I had to write a query that gives back for each state that has more than 5 sailors the sailor id and the total number of reservations that he has made. The schemas are as fol... |
28,695,664 | 0 | <p>For those early adapting people on the CofeeScript era, here's another equivalent for it.</p> <pre><code>val for key,val of objects </code></pre> <p>Which may be better than this because the <code>objects</code> can be reduced to be typed again and decreased readability.</p> <pre><code>objects[key] for key of objec... |
15,305,083 | 0 | View disappears when I set `translatesAutoresizingMaskIntoConstraints` to `NO` <p>I don't know if this is a bug or I'm doing something wrong:</p> <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { UIWindow *window = [self window]; UIViewController *... |
21,951,353 | 0 | <blockquote> <p>Is it possible in Z's constructor to put Z at the end of X's list</p> </blockquote> <p>Yes, if Z has access to X's list.</p> <blockquote> <p>Which way is better?</p> </blockquote> <p>This depends on the semantics. Is the list something closely related with Z's responsibilities or more with Y's?</p> |
950,003 | 0 | <p>Change:</p> <pre><code>$('.removeitem').click(function(){ $(this).prev().parent().remove(); return false; }); </code></pre> <p>to:</p> <pre><code>$('.removeitem').live("click", function(){ $(this).prev().parent().remove(); return false; }); </code></pre> |
4,383,846 | 0 | <p>Quite a few systems have a function <code>asprintf</code> in their standard C libraries that does exactly what you do here: allocate and <code>sprintf</code>.</p> |
25,340,351 | 0 | <p>Whatever <code>JOIN</code> syntax you've used there, I'm not familiar with it. You also had the following, which is incorrect:</p> <pre><code>`j`.`user_id=$user_id` </code></pre> <p>If you're going to use the backticks, it would be this:</p> <pre><code>`j`.`user_id` = $user_id </code></pre> <p>Assuming <code>$user_... |
9,952,633 | 0 | <p><a href="http://docs.python.org/py3k/library/collections.html#counter-objects" rel="nofollow"><code>collections.Counter</code></a> exists for precisely this kind of work:</p> <pre><code>>>> collections.Counter(i[1] for i in L).most_common() [(2, 2), (1, 1), (5, 1)] </code></pre> |
38,075,266 | 0 | <p>This is example from "CLR via C#" book:</p> <pre><code>private static async Task<String> IssueClientRequestAsync(String serverName, String message) { using (var pipe = new NamedPipeClientStream(serverName, "PipeName", PipeDirection.InOut, PipeOptions.Asynchronous | PipeOptions.WriteThrough)) { pipe.Connect();... |
37,307,025 | 0 | <p>Definitely. Best practice is a separate file for each View Controller or other major class.</p> <p>Refer to this <a href="https://itunes.apple.com/us/course/developing-ios-8-apps-swift/id961180099" rel="nofollow">awesome free course from Stanford</a> for a very nice introduction on MVC (Model-View-Controller).</p> |
36,934,200 | 0 | <p>This? It should work if there are more than 2 rows.</p> <pre><code>WITH NotesWithId AS ( SELECT ID = ROW_NUMBER() OVER (ORDER BY (SELECT NULL)), note FROM Notes ) SELECT [note1] = CASE WHEN [ID] % 2 <> 0 THEN [note] ELSE NULL END, [note2] = CASE WHEN [ID] % 2 = 0 THEN [note] ELSE NULL END FROM NotesWithId; </... |
24,676,805 | 0 | sans-serif-light with "fake bold" <p>I have set up the following theme for my app:</p> <pre><code><style name="AppTheme" parent="Theme.Sherlock.Light"> <item name="android:textViewStyle">@style/RobotoTextViewStyle</item> </style> <style name="RobotoTextViewStyle" parent="android:Widget.TextVi... |
6,616,498 | 0 | I want my app to be spreadable easily <p>How can I communicate the download link from one user who has it to one who does not? If all they have are their android phones. Bluetooth? Would I send a contact card. </p> <p>Are there less cumbersome ways that pairing? </p> |
35,451,042 | 0 | Byte code version mismatch when using subset <p>I have been working on the same R script now for 5 months, had some minor coding problems, but this morning I got a problem that makes me unable to run the whole script. To clean my imported data I use a lot of subset(), but this morning when running the code I got the Wa... |
31,668,833 | 0 | remove unused/bad index to speed up response from table <p>Hi I have table with stat below</p> <pre><code>Rows : 4,639,162 Reserved : 7,183,216 KB Data : 5,978,536 KB Index Size : 1,199,840 KB Unused : 4,840 KB </code></pre> <p>I have used <code>sp_spaceused 'TableName'</code> for this stat.</p> <p>And table informatio... |
6,627,981 | 0 | <p>Redis is fast, but it can't be as fast as a direct memory access. It requires constructing a request, posting it, waiting for a response, decoding that response, and returning that value to your application. Redis runs as a separate process, so you will have to pay this price for inter-process communication even wh... |
12,476,551 | 0 | <p>In order to move from one page to another, you need to use a variable to show what page the user is currently reading. Previous and Next would then update the page number and display the appropriate page:</p> <pre><code>file = ['page1.txt', 'page2.txt', 'page3.txt', 'page4.txt'] pagecount = len(file) page = 1 # ini... |
3,314,587 | 0 | <p>You need this:</p> <pre><code>#menuBar #test2 a:hover{ background:url("../images/btTest.jpg") no-repeat top; } </code></pre> <p>To be this:</p> <pre><code>#menuBar #test2:hover a { background:url("../images/btTest.jpg") no-repeat top; } </code></pre> <p>To get it to stick when you move to the <code>.subMenu</code>.... |
2,723,779 | 0 | <p>If you want the file and line numbers, you do not need to parse the StackTrace string. You can use System.Diagnostics.StackTrace to create a stack trace from an exception, with this you can enumerate the stack frames and get the filename, line number and column that the exception was raised. Here is a quick and dir... |
30,321,914 | 0 | Callout click is not working in iPhone simulator 4s in iOS <p>I have created annotation view over current latitude and longitude and used image over it using custom annotation. It works fine and created custom callout using Apple example MapCallout <a href="https://developer.apple.com/library/ios/samplecode/MapCallouts... |
11,233,344 | 0 | <p>A few suggestions:</p> <h2>ADJACENCY TEST</h2> <p>The test in FindAdjacent will only find diagonal neighbours at the moment</p> <pre><code> if (i != 0 && j != 0) </code></pre> <p>If you also want to find left/right/up/down neighbours you would want to use</p> <pre><code> if (i != 0 || j != 0) </code></pre> ... |
25,695,837 | 0 | Setting up PHPMyAdmin on Amazon EC2 <p>I've installed PHPMyAdmin on my Amazon EC2 instance using the following:</p> <pre><code>yum --enablerepo=epel install phpmyadmin </code></pre> <p>Then symlinked it to /var/www/html with</p> <pre><code>ln -s /usr/share/phpmyadmin /var/www/html </code></pre> <p>When I navigate to /p... |
26,790,091 | 0 | <p>I solved and I'm writing for the user having the same problem:</p> <p>Insert the option <code>cache:false</code> in the $.ajax method as below:</p> <pre><code>$.ajax({ url: options.path, data: options.data, method: options.method, success: options.success, cache: false, error: options.error && function(){ l... |
36,822,396 | 0 | <p>Make a parent Component whose child will be <code>MyComponent</code></p> <pre><code>class ParentComponent extends React.Component { componentDidMount() { // make api call apiCall.then((data) => { this.setState({ reqData : data, }) }) } getComponentToRender() { if(typeof this.state.reqData === 'undefined') { retu... |
10,399,248 | 0 | MYSQL accepts only root accounts <p>I've got a real big problem. I have LAMP on my computer. When I try to connect to mysql not with root account (via phpmyadmin) - phpmyadmin says that it cannot connect to mysql. So, I can connect to mysql only via root.</p> |
14,562,537 | 0 | <p><code>this</code> is always a local variable and therefore it is overwritten in every function.</p> <p>What you might do is pointing to your class e.g. <code>var myClass = this;</code> and use <code>myClass</code> instead of <code>this</code>.</p> <pre><code> this.checkSections = function(){ var myClass = this; jQu... |
18,109,716 | 0 | Avoid default activerecord primary index creation <p>I am trying to workout how to advise/tell activerecord not to create it's primary index by default.</p> <p>Anyone know how i can achieve this ?</p> <pre><code>class CreateHouse < ActiveRecord::Migration def change create_table :houses do |table| table.string :name... |
25,491,750 | 0 | removing commas from numbers in CSV file <p>I have a file that has many columns and I only need two of those columns. I am getting the columns I need using </p> <pre><code>cut -f 2-3 -d, file1.csv > file2.csv </code></pre> <p>The issue I am having is that the first column is ID and once it gets past <code>999</code>... |
26,505,054 | 0 | <p>When compiling project A maven will first try to look-up the project dependencies B, C, D, E. He will look at the local repository (usually a hidden directory .m2 under user’s home directory) or a remote repository. </p> <p>In your case B, C, D, E are your local projects and not third-party so executing maven insta... |
3,894,219 | 0 | <p>Solution:</p> <pre><code>SELECT tag, COUNT(*)AS tags_count FROM ( SELECT post_n, tag FROM tags ORDER BY post_n DESC LIMIT 20 ) AS temp GROUP BY tag HAVING tags_count>=2 ORDER BY post_n DESC LIMIT 5 </code></pre> <p>Of course need to change limit in the first selection, otherwise there will be plenty to choose fr... |
22,923,884 | 0 | <p>To understand why these kind of operations seem non-trivial in NoSQL implementations, it's good to think about why NoSQL exists (and has become very popular) at all.</p> <p>When you look at an early NoSQL implementation like memcached, the first use case was very simple, but very important: a blazingly fast cache f... |
1,000,153 | 0 | <p>You could also use this to check if the Visual Studio Designer is running the code: </p> <pre><code>public static bool DesignMode { get { return (System.Diagnostics.Process.GetCurrentProcess().ProcessName == "devenv"); } } </code></pre> <p>Then in Form_Load: </p> <pre><code>if (!DesignMode) { // Run code that break... |
36,200,498 | 0 | <p>here is a slightly better solution that would still allow you to have nil values </p> <p>(please note that nil.to_i is 0 as well as any "text".to_i is also 0)</p> <pre><code>def my_method(str) Integer(str.gsub(/\s/, '')) rescue ArgumentError => e nil end </code></pre> <p>Example of use:</p> <pre><code>my_method(... |
36,737,499 | 0 | <p>You may want to draw a white rectangle the size of the entire canvas, beneath the actual content of the canvas.</p> <pre><code>// get the canvas 2d context var ctx = canvas.getContext('2d'); // set the ctx to draw beneath your current content ctx.globalCompositeOperation = 'destination-over'; // set the fill color ... |
39,379,716 | 0 | <p>You might be able to do this using a Base model such as:</p> <pre><code>@GET("mypath") Call<MyBaseModel<List<MyModel>>> getData(); </code></pre> <p>implement the Callback in the fragment as</p> <pre><code>Callback<MyBaseModel<List<?>>> </code></pre> <p>An example of an MyBaseMode... |
23,989,913 | 0 | <p>Calculating the length of a floating-point number decimal representation doesn't make much sense, as its underlying representation is binary. For example 0.1 in decimal form yields an infinite number of digits in binary.</p> <p>C has no intrinsic decimal type, so you will have to represent your number with some ad-... |
6,426,802 | 0 | <p>You want a modal <strong>view</strong>. All <code>UIViewControllers</code> are able to present a modal view by using the following method:</p> <pre><code>[self presentModalViewController:yourViewController animated:YES]; </code></pre> <p>Check the Apple reference guides for more information and samples.</p> |
30,853,179 | 0 | <p>Script <strong>program</strong>:</p> <pre><code>#!/bin/bash for file in "$@";do echo "$file" done </code></pre> <p>Run program:</p> <pre><code>path/to/program filename1.* path/to/program filename1.* filename2.* path/to/program filename1.ext1 filename1.ext2 etc... </code></pre> |
15,089,599 | 0 | Callback function issue jquery <p>I have an issue with an if in a callback function and I don't understand why.</p> <p>After clicking on a div, the text is changing as I would like, but after the first shot it doesn't work anymore.</p> <p>My code is :</p> <pre><code><div id="2">message</div> <div id="1"&... |
26,988,098 | 0 | how to adjust div width based on other div postion <p>I have two div's one is <code>div-content</code>(red color) and second is <code>div-content2</code>(yellow color).<code>div-content</code> size is 0 to 50% and <code>div-content2</code> size 50% to 100%.</p> <p>Now In my screen 50% <code>div-content</code> and 50% <... |
10,640,235 | 0 | Sending email directly from my OSX app <p>I'm working on an OSX app which will handle an opt-in mailing list. I have a database containing opt-in email addresses, and the goal is for the user to click one button and have the app build a custom email update, then send out an email update to all members of the mailing li... |
31,661,277 | 0 | <p>At the end of the code you missed one )</p> <pre><code>else { console.log("I'll keep practicing coding and racing.") } </code></pre> |
27,086,850 | 0 | <p>The problem is that when you try to <code>getWidth</code>, your <code>ImageView</code> have not been appeared on the screen, so it always returns 0. So there are two ways, you can get the width:</p> <p><strong><em>First way</em></strong></p> <p>You need to <code>measure</code> your <code>ImageView</code> and then g... |
33,179,790 | 0 | <p>I use to think about a reference as an alias for another object. If you apply this to people, the alias is a nickname.</p> <p>For example, if you have:</p> <pre><code>Person Robert; Person& Bob = Robert; </code></pre> <p>you only have one person, but you sometimes call him Robert and sometimes call him Bob. But... |
13,727,723 | 0 | <p><strong>val</strong> and <strong>text</strong> are functions, you must add () to call them and get their results. If you juste write <strong>val</strong> or <strong>text</strong>, it's the reference to the function itself (and in js, a function is an object).</p> <pre><code>myfield.val( mytext.text() ); </code></pr... |
3,804,134 | 0 | <p>Here's an alternative for you:</p> <pre><code>DateTime.Now.ToString("d", new CultureInfo("de-DE")) </code></pre> <p>German's use <code>.</code> as the date separator.</p> |
29,297,508 | 0 | <p>Don't panic, the World has been saved. The solution is to wrap Airborne and whatever else in a module:</p> <pre><code>module MyHelpers include Airborne include Capybara::DSL end </code></pre> <p>Then pass that:</p> <pre><code>World(MyHelpers) </code></pre> |
3,428,771 | 0 | <blockquote> <p>3: Lastly he asked if it is possible to used Singleton Object with Clusters with explanation and is there any way to have Spring not implement Singleton Design Pattern when we make a call to Bean Factory to get the objects ?</p> </blockquote> <p>The first part of this question is hard to answer without... |
32,368,621 | 0 | <p>Try this</p> <pre><code> DataTable dt1 = new DataTable(); dt1.Columns.Add("Name", typeof(string)); dt1.Rows.Add(new string[] {"Mani"}); dt1.Rows.Add(new string[] {"Ram"}); dt1.Rows.Add(new string[] {"Guna"}); dt1.Rows.Add(new string[] {"Praveen"}); dt1.Rows.Add(new string[] {"Jai"}); DataTable dt2 = new DataTable()... |
14,486,647 | 0 | Google map does not load when load inline content using jquery load <p>I have an issue with google map. I load inline content (including content map) with jquery .load() and the map is doesn't load or it won't show. it just display blank.</p> <p>My code to load inline content with jquery load()</p> <pre><code>$('#conte... |
34,606,142 | 0 | use panGestureRecognizer or touch events to drag and move an item ios <p>I am moving items in the view by touching them to the place where i leave it i am using touch events <code>touchesBegin</code> , <code>touchesMoved</code> , <code>touchesEnd</code><br> and in <code>touchesMoved</code> i move the item.frame to the ... |
6,721,447 | 0 | <p>I notice the first URL shows the location "houston" in the description text. The second URL attempts to show location in the title, showing Location Unknown instead. The second URL <strong>does</strong> show a location "NYC" in the description text. </p> <p>It may be your framework/library does not have the 'city' ... |
35,914,341 | 0 | <h2>UPDATE</h2> <p>When the device is stationary again, with screen off and on battery for a period of time, Doze applies the full CPU and network restrictions on <strong>PowerManager.WakeLock, AlarmManager alarms, and GPS/Wi-Fi scans</strong>.</p> <p>Visit <a href="http://developer.android.com/intl/in/training/monito... |
2,691,167 | 0 | <p>A C# null is not the same as a database NULL.</p> <p>In your insertion code you probably need to pick up that the value is "N/A"/null and then insert a DBNull instead. What does your DB insertion code look like?</p> |
11,442,677 | 0 | <p><a href="http://developer.android.com/guide/topics/data/data-storage.html#filesInternal" rel="nofollow">The documentation</a> has a pretty decent guide on how to best access the filesystem.</p> |
38,160,571 | 0 | Using PHP to Search and Replace POST vars in docx document <p>I am trying to do a search and replace on a Microsoft Word docx document. The odd problem I am having is that, of the 7 posted vars, 1 and 5 do not replace. In checking Chrome Tools, they all appear in the posted form data. The names are all spelled correctl... |
24,219,696 | 0 | drawstring bold and normal text <p>have code:</p> <pre><code>using (Graphics g = Graphics.FromImage(pictureBox1.Image)) { Font drawFont = new Font("Arial", 12); Font drawFontBold = new Font("Arial", 12, FontStyle.Bold); SolidBrush drawBrush = new SolidBrush(Color.Black); g.DrawString("this is normal", drawFont, drawBru... |
13,032,782 | 0 | <p>It seems that my question was nonsence. Here's my code:</p> <pre><code>PreparedStatement stmt = con.prepareStatement(query); stmt.setLong(1, key); stmt.execute(query); </code></pre> <p><code>query</code> is (obiously) String. What fixed the problem is removing <code>query</code> from <code>stmt.execute(query)</code... |
1,684,823 | 0 | <p>Also check to make sure the intermediate directories are also permissioned as 755, as all the directories in the path need to be executable to be traversed.</p> |
13,336,467 | 0 | .NET CLR / Framework detection at runtime <p>Is it possible to determine at runtime:</p> <ol> <li><p>Which version of the .NET framework the application is targeting?</p></li> <li><p>If the application is targeting a full or client profile of the framework?</p></li> </ol> <p>I have tried using <code>Environment.Version... |
24,203,376 | 0 | <p>The commands are not described in Part 2 of the Specification but rather in <strong><a href="http://www.trustedcomputinggroup.org/files/static_page_files/72C33D71-1A4B-B294-D02C7DF86630BE7C/TPM%20Main-Part%203%20Commands_v1.2_rev116_01032011.pdf" rel="nofollow">Part 3 - Commands</a></strong>. </p> <p>The <code>TPM_... |
10,227,882 | 0 | <p>Since <code>friend</code> relationships aren't inherited, you need to declare <code>convertF</code> as a friend of both classes. But you need this only if the function needs access the internals of these classes - are you sure the public interface of the classes doesn't suffice?</p> <p>One further reason to try to ... |
40,977,608 | 0 | <p>The error you are receiving in your code is due to the following line <code>if (character.ToString() = "space")</code></p> <p>You are attempting to assign the string literal "space" to <code>character.ToString()</code>, I also have this error in my comment which I can't edit anymore.</p> <p>Here's a snippet that wi... |
34,208,877 | 0 | Erlang's FSM code_change function usage <p>I'm learning Erlang and I've learned about hot code loading, but I don't know how the gen_fst behavior's code_change function works. I also can't find any example of it.</p> <p>Should I create an action like so:</p> <pre><code>upgrade() -> gen_fsm:send_event(machine_name, u... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.