id int64 4 73.8M | title stringlengths 10 150 | body stringlengths 17 50.8k | accepted_answer_id int64 7 73.8M | answer_count int64 1 182 | comment_count int64 0 89 | community_owned_date stringlengths 23 27 ⌀ | creation_date stringlengths 23 27 | favorite_count int64 0 11.6k ⌀ | last_activity_date stringlengths 23 27 | last_edit_date stringlengths 23 27 ⌀ | last_editor_display_name stringlengths 2 29 ⌀ | last_editor_user_id int64 -1 20M ⌀ | owner_display_name stringlengths 1 29 ⌀ | owner_user_id int64 1 20M ⌀ | parent_id null | post_type_id int64 1 1 | score int64 -146 26.6k | tags stringlengths 1 125 | view_count int64 122 11.6M | answer_body stringlengths 19 51k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2,405,343 | Does the .NET CLR Really Optimize for the Current Processor | <p>When I read about the performance of JITted languages like C# or Java, authors usually say that they should/could theoretically outperform many native-compiled applications. The theory being that native applications are usually just compiled for a processor family (like x86), so the compiler cannot make certain opt... | 2,405,530 | 7 | 4 | null | 2010-03-08 22:39:18.31 UTC | 16 | 2010-03-09 15:02:54.17 UTC | 2010-03-08 22:42:50.04 UTC | null | 14,048 | null | 100,398 | null | 1 | 45 | c#|.net|optimization|clr|jit | 3,206 | <p>From back in 2005, David Notario listed several specific targeted optimizations is his blog entry "<a href="http://blogs.msdn.com/davidnotario/archive/2005/08/15/451845.aspx" rel="noreferrer">Does the JIT take advantage of my CPU?</a>". I can't find anything about the new CLR 4, but I imagine several new items are i... |
3,016,683 | The difference between traditional DLL and COM DLL | <p>I am currently studying COM. I found that COM DLL is kind of built upon the traditional DLL infrastructure. When we build COM DLLs, we still rely on the traditional DLL export methods to lead us to the internal COM co-classes. </p>
<p>If COM is for component reusing at the binary level, I think the traditional DLL ... | 3,017,368 | 8 | 2 | null | 2010-06-10 17:07:05.477 UTC | 23 | 2020-05-21 12:52:35.1 UTC | 2010-06-10 17:12:25.12 UTC | null | 264,052 | null | 264,052 | null | 1 | 32 | c++|com | 32,075 | <p>No, there's a Big difference. COM has a well defined protocols for creating objects, exposing methods, managing memory, publishing type information, managing threading. There is practically no language left that doesn't support using a COM server, no matter what language it was written in.</p>
<p>You will not get... |
2,533,972 | android include tag - invalid layout reference | <p>I'm having a problem including a different layout through the include tag in the android layout xml file. When specifing the layout reference ( @layout/... ), i'm getting a InflateException in the Eclipse ADT with the following error:
<strong>InflateException: You must specifiy a valid layout reference. The layout I... | 3,203,327 | 8 | 1 | null | 2010-03-28 18:19:41.8 UTC | 8 | 2014-11-14 21:04:59.55 UTC | 2012-02-29 14:24:35.347 UTC | null | 303,704 | null | 303,704 | null | 1 | 43 | xml|android|layout | 29,815 | <p>I think i should mention how i solved the same problem. Tried cleaning the project and didn't work. I have quite large names for the layout (chrono_first_small_field), and that wasn't the cause either. </p>
<p><strong>Closed Eclipse, and just opened it again, and that worked.</strong></p>
<p>That makes more sense ... |
2,596,862 | How do you make an html page fade out while another fades in? | <p>I have a client with an event planning site asking his pages to fade into one another. I have no idea how I can accomplish this. Any ideas? Is there anyway to do this without flash?</p> | 2,596,933 | 9 | 3 | null | 2010-04-08 00:47:31.953 UTC | 2 | 2010-07-24 23:56:14.537 UTC | null | null | null | null | 270,589 | null | 1 | 11 | html|css | 39,525 | <p>Definitely get hold of a javascript framework. jQuery is popular (because it's ace), but there's Mootools, Prototype, and Dojo to name a few.</p>
<p>I'm not sure if crosssfading can be done reliably across all the browsers without popping / jumping artifacts. Even the example Dancrumb points to is a bit ropey (no i... |
2,758,415 | Swap values for two rows in the same table in SQL Server | <p>I want to swap the values from two rows in a table. I have the rows IDs of the two rows. Is there any query to do that? Here is an example. Before the query I have this:</p>
<pre>
row1 : 1,2,3
row2 : 5,6,7
</pre>
<p>After the swap I want this:</p>
<pre>
row1 : 5,6,7
row2 : 1,2,3
</pre> | 2,758,631 | 9 | 3 | null | 2010-05-03 13:39:11.79 UTC | 3 | 2022-08-01 19:37:25.263 UTC | 2019-02-13 21:11:32.537 UTC | null | 5,405,967 | null | 437,176 | null | 1 | 19 | sql|sql-server | 58,778 | <p>If you want to swap values from one row to the other for two known IDs try something like this:</p>
<pre><code>--need to store the original values
SELECT
*,CASE WHEN id=123 then 987 ELSE 123 END AS JoinId
INTO #Temp
FROM YourTable
WHERE ID in (123,987)
--swap values
UPDATE y
SET col1=t.col1
... |
3,139,879 | How do I get currency exchange rates via an API such as Google Finance? | <p>Now, I did find the <a href="http://code.google.com/apis/finance/" rel="noreferrer">Google Finance API</a> and started looking through that but I found a lot of info about portfolios, transactions, positions & other stuff I know nothing about. </p>
<p>Am I looking at the wrong docs? What do I need to do to get ... | 8,391,430 | 9 | 6 | null | 2010-06-29 10:42:06.227 UTC | 410 | 2021-11-30 19:06:54.91 UTC | 2014-02-27 20:12:26.5 UTC | null | 16,587 | null | 350,722 | null | 1 | 137 | api|google-finance-api | 676,439 | <p>Thanks for all your answers.</p>
<p><strong>Free currencyconverterapi:</strong></p>
<ul>
<li>Rates updated every 30 min</li>
<li>API key is now required for the free server.</li>
</ul>
<p>A sample conversion URL is: <a href="http://free.currencyconverterapi.com/api/v5/convert?q=EUR_USD&compact=y" rel="noreferrer... |
2,719,270 | Video/audio streaming does not stop even if UIWebView is closed - iPad | <p>I see this issue only on the iPad. The same things works as expected on the iPhone.</p>
<p>I am opening the URL from my application in a UIWebView. If the URL is a normal web page, it works fine as expected. But if the URL is that of a remote video/audio file, the UIWebView opens the default player which is again g... | 2,746,967 | 11 | 0 | null | 2010-04-27 06:53:00.483 UTC | 16 | 2019-01-29 08:41:31.373 UTC | null | null | null | null | 46,297 | null | 1 | 33 | uiwebview|video-streaming|ipad | 27,811 | <p>I have the same issue as stated but in this case the video that won't stop playing is a Youtube video embeded using the object/embed method. </p>
<p>I spent a long time trying to figure out how to get the video to stop playing and the only solution I found was to tell the UIWebView to load a blank page before dism... |
2,787,679 | How to reload page every 5 seconds? | <p>I am converting one layout to html; once I make the changes in code/html/css, every time I have to hit F5. Is there any simple javascript/jQuery solution for this? I.e. after I add the script, reload the whole page every 5 seconds (or some other specific time).</p> | 2,787,691 | 11 | 0 | null | 2010-05-07 10:00:34.79 UTC | 63 | 2022-02-15 14:53:03.627 UTC | 2019-04-03 17:52:34.72 UTC | null | 8,112,776 | null | 88,493 | null | 1 | 210 | javascript|jquery | 643,542 | <pre><code> <meta http-equiv="refresh" content="5; URL=http://www.yourdomain.com/yoursite.html">
</code></pre>
<p>If it has to be in the script use <a href="https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout" rel="noreferrer">setTimeout</a> like:</p>
<pre><code>setTimeout(func... |
25,102,593 | Failed to load resource: the server responded with a status of 404 (Not Found) angular js + ionic | <p><img src="https://i.stack.imgur.com/rGa81.jpg" alt="enter image description here"></p>
<p>This is the error im having from Google Devt Tools. Anyone knows the problem? I tried to change in many times including the file structure and the stateProvider (no controllers for that) in app.js file but it does not seem to ... | 25,102,721 | 3 | 0 | null | 2014-08-03 07:32:03.697 UTC | 3 | 2019-09-13 10:54:14.473 UTC | null | null | null | null | 3,395,829 | null | 1 | 6 | javascript|html|angularjs|angular-ui-router|ionic-framework | 98,757 | <p><strong>404</strong> literally means that file was not found. <strong>It's simple as that</strong>. Check if the URL is right, and there are no rediretions being done(use fiddler). Perhaps the protocol should be https:// istead of http://? Perhaps you need "<strong>www</strong>" in url? </p>
<p>Click the url given ... |
50,907,600 | Vue.js - Vuetify how to get rounded corners on cards? | <p>I am trying to get rounded corners on a v-card as I can get on a btn, but it does not seems to be possible ? </p>
<p>I used </p>
<pre><code><v-card round class="elevation-0">
</code></pre>
<p>Here is my template</p>
<pre><code> <template>
<section id="section2">
<v-par... | 50,907,816 | 5 | 0 | null | 2018-06-18 10:36:42.477 UTC | 2 | 2021-09-10 10:01:00.87 UTC | null | null | null | user762579 | null | null | 1 | 15 | vue.js|vuetify.js | 38,585 | <p><code>v-card</code> has rounded corners by default. It does not provide a prop named <code>round</code> to make it have more rounded corners.</p>
<p>If you want to have more rounded corners as compared to the default then add a custom css class to <code>v-card</code></p>
<pre><code><v-card class="rounded-card"&... |
42,379,899 | Use custom setter in Lombok's builder | <p>I have a custom setter in my Lombok-based POJO:</p>
<pre><code>@Data
@Builder
public class User {
private static final PasswordEncoder ENCODER = new BCryptPasswordEncoder();
private String password = null;
public void setPassword(String password) {
Assert.notNull(password);
this.passwo... | 42,380,017 | 5 | 0 | null | 2017-02-21 23:23:11.347 UTC | 7 | 2021-05-19 19:53:21.793 UTC | 2017-02-22 14:07:30.483 UTC | null | 3,342,253 | null | 3,342,253 | null | 1 | 61 | java|lombok | 52,381 | <p>Per <a href="https://projectlombok.org/features/Builder.html" rel="noreferrer">the documentation for <code>@Builder</code></a>: Just define enough skeleton yourself. In particular, Lombok will generate a class <code>UserBuilder</code>, fields mirroring the <code>User</code> fields, and builder methods, and you can p... |
6,097,301 | CallContext.LogicalGetData Vs. CallContext.GetData | <p>The <code>CallContext</code> API has <code>LogicalGetData</code> & <code>GetData</code>, but the MSDN Documentation doesn't do much to explain the difference between the two, and when they differ.</p>
<p>Any ideas?</p> | 6,098,134 | 2 | 0 | null | 2011-05-23 12:38:58.263 UTC | 10 | 2017-03-16 11:17:20.873 UTC | 2017-03-16 11:17:20.873 UTC | null | 4,275,342 | null | 766,006 | null | 1 | 47 | c#|.net | 16,549 | <p><a href="http://msdn.microsoft.com/en-us/library/system.runtime.remoting.messaging.callcontext.aspx#remarksToggle" rel="noreferrer">It appears that this is a subtle difference related to method calls made remotely to another <code>AppDomain</code></a>. In this instance a <code>LogicalCallContext</code> is created an... |
31,655,085 | Database on a personal github page | <p>Is it possible to have some data stored somewhere on your personal github page?</p>
<p>For example a button that triggers a counter. When you click on the button , counter increments by 1. When other user visits that page and clicks the button , counter gets incremented by 1 once again.</p>
<p>So it would be a sum... | 31,655,819 | 4 | 1 | null | 2015-07-27 13:55:51.74 UTC | 32 | 2021-08-18 21:40:46.377 UTC | 2017-02-09 09:03:52.98 UTC | null | 4,403,497 | null | 4,403,497 | null | 1 | 61 | database|github | 76,739 | <p>Github pages only allow for static content, so you'd have to use something like <a href="https://firebase.google.com/" rel="noreferrer">firebase</a> in order to get a database.</p> |
41,213,215 | Webpack dev server not auto-reloading | <p>So I've setup webpack and <code>webpack-dev-server</code>, but <code>webpack-dev-server</code> does not auto-reload. If i modify a file and save it there is no change in the browser until I manually refresh.</p>
<p>Here is my webpack config and my script file that runs <code>webpack-dev-server</code>. Does anyone s... | 41,223,040 | 9 | 0 | null | 2016-12-18 21:45:17.587 UTC | 2 | 2021-08-04 04:08:47.513 UTC | 2016-12-18 21:52:00.14 UTC | null | 2,525,699 | null | 2,525,699 | null | 1 | 20 | javascript|webpack|webpack-dev-server | 40,343 | <p>According to the <a href="https://webpack.github.io/docs/webpack-dev-server.html#inline-mode-with-node-js-api" rel="noreferrer">webpack dev server documentation</a> you should add this entry point to the webpack configuration to support automatic refresh.</p>
<pre><code>config.entry.unshift("webpack-dev-server/clie... |
20,954,944 | Stop LastPass filling out a form | <p>Is there a way to prevent the LastPass browser extension from filling out a HTML-based form with an input field with the name "username"?</p>
<p>This is an hidden field, so I don't want any software to use this field for their purposes:</p>
<pre><code><input type="text" name="username&quo... | 44,984,917 | 16 | 2 | null | 2014-01-06 16:49:41.397 UTC | 28 | 2021-12-16 14:33:45.03 UTC | 2021-12-16 14:33:45.03 UTC | null | 74,089 | null | 2,969,320 | null | 1 | 180 | html|forms|lastpass | 63,507 | <p>Adding</p>
<pre><code>data-lpignore="true"
</code></pre>
<p>to an input field disabled the grey LastPass [...] box for me.</p>
<p>Sourced from <a href="https://support.logmeininc.com/lastpass/help/manage-your-form-fills-lp040002" rel="noreferrer">LastPass.com</a></p> |
35,424,982 | How can I enable the MySQLi extension in PHP 7? | <p>I have installed PHP 7 and MySQL 5.5.47 on Ubuntu 14.04 (Trusty Tahr).</p>
<p>I have checked installed extension using:</p>
<pre><code>sudo apt-cache search php7-*
</code></pre>
<p>It outputs:</p>
<pre><code>php7.0-common - Common files for packages built from the PHP source
libapache2-mod-php7.0 - server-s... | 35,425,511 | 8 | 0 | null | 2016-02-16 06:06:52.473 UTC | 30 | 2021-03-25 12:23:37.413 UTC | 2019-12-30 12:25:48.247 UTC | null | 3,238,278 | null | 3,238,278 | null | 1 | 86 | php|mysql|mysqli|php-7 | 421,583 | <p>I got the solution. I am able to enable MySQLi extension in php.ini. I just uncommented this line in php.ini:</p>
<pre><code>extension=php_mysqli.dll
</code></pre>
<p>Now MySQLi is working well. Here is the <code>php.ini</code> file path in an Apache 2, PHP 7, and Ubuntu 14.04 environment:</p>
<pre><cod... |
18,930,436 | iOS 7 UIImagePickerController Camera No Image | <p>For some reason the first time I open the <code>UIImagePickerController</code> in camera mode on my app it comes up blank. I have to close and reopen that view to get the camera feed to start working. I'm using the standard code that works in iOS 6 perfectly for camera capture. From the sample below I'm firing the <... | 19,073,930 | 4 | 0 | null | 2013-09-21 08:15:07.84 UTC | 11 | 2014-09-14 11:36:56.567 UTC | 2013-09-22 07:29:57.197 UTC | null | 246,589 | null | 246,589 | null | 1 | 8 | ios|ios7 | 12,677 | <p>I'm also using UIImagePickerController and ran into the same issue with a blank screen. I'd like to expand a little on what klaudz mentioned regarding iOS 7 authorization for the camera.</p>
<p>Reference:
<a href="https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVCaptureDevice_Class/Re... |
18,900,249 | google.maps.places and its Autocomplete method are undefined | <p>I'm loading the <a href="https://developers.google.com/maps/documentation/javascript/" rel="noreferrer">Google Maps API</a>, <a href="http://jquery.com/" rel="noreferrer">jQuery</a> and this <a href="http://ubilabs.github.io/geocomplete/" rel="noreferrer">Geocomplete</a> plugin.
Please note that I'm also specifying ... | 18,905,094 | 1 | 0 | null | 2013-09-19 16:30:02.39 UTC | 5 | 2018-11-19 17:30:30.47 UTC | 2018-02-21 10:58:47.387 UTC | null | 1,905,949 | null | 334,210 | null | 1 | 24 | javascript|jquery|google-maps | 50,072 | <blockquote>
<p>I tried to google.maps and it returns a regular object, but places is undefined!</p>
</blockquote>
<p>That means the google.maps.places library is not loading (the line of code that you posted, shown below is either not correct or is not actually on your page):</p>
<pre><code><script src='http://... |
51,791,618 | SQL "with" clause - Error Code: 1046. No database selected Select the default DB to be used by double-clicking its name in the SCHEMAS | <p>I have the following query which works fine:</p>
<pre><code>select a.dataId, a.my_no, b.my_attribute from myDB.table_a a left join myDB.table_b b
on a.my_no = b.my_no order by dataId
</code></pre>
<p>However, if I include the <code>with</code> clause like below:</p>
<pre><code>with my_table as (
select a.d... | 51,791,751 | 6 | 0 | null | 2018-08-10 17:45:23.29 UTC | 3 | 2022-04-22 12:06:58.29 UTC | null | null | null | null | 3,993,270 | null | 1 | 7 | mysql|mariadb | 50,323 | <p>Before a <code>WITH</code> clause, you should specify the database you're using with</p>
<pre><code>USE db_name;
</code></pre>
<p>That should solve the problem.</p> |
8,441,708 | WCF : How to disable WCF Test Client | <p>I created a new WCF Application. It has a svc file & a code behind, When I try to debug (F5) then I see the following.</p>
<ol>
<li>If svc file is open & press F5 then it opens the web browser</li>
<li>If code behind file is currently open & press F5 then WCF Test client opens.</li>
</ol>
<p>Why there ... | 8,441,887 | 8 | 0 | null | 2011-12-09 06:06:33.2 UTC | 11 | 2019-04-01 14:09:14.55 UTC | null | null | null | null | 883,766 | null | 1 | 24 | wcf|wcftestclient | 28,647 | <p>Open your project properties, go to the Debug tab, under <em>start options</em> you will see something like
/client:"WcfTestClient.exe"</p>
<p>delete that line.</p>
<p>For a WCF Service Application and WCF Workflow Service Application you need to modify the .csproj.user file. A full write up <a href="http://blogs.... |
8,626,018 | How to check if file exists in a Windows Store App? | <p>Is there any other way of checking whether a file exists in a Windows Store app?</p>
<pre><code>try
{
var file = await ApplicationData.Current.LocalFolder.GetFileAsync("Test.xml");
//no exception means file exists
}
catch (FileNotFoundException ex)
{
//find out through exception
}
</code></pre> | 8,626,046 | 10 | 0 | null | 2011-12-24 17:51:53.27 UTC | 6 | 2015-08-11 18:00:06.98 UTC | 2014-01-14 08:22:19.14 UTC | null | 53,236 | null | 421,611 | null | 1 | 48 | c#|windows-8|windows-runtime|microsoft-metro|filenotfoundexception | 34,206 | <p>According to the accepted answer in <a href="http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/1eb71a80-c59c-4146-aeb6-fefd69f4b4bb/">this post</a>, there is no other way at the moment. However, the File IO team is considering changing the the api so that it returns null instead of throwing an e... |
27,085,219 | How Can I Disable Authentication in Django REST Framework | <p>I'm working on a store site, where every user is going to be anonymous (well, until it's time to pay at least), and I'm trying to use Django REST Framework to serve the product API, but it keeps complaining about:</p>
<pre><code>"detail": "Authentication credentials were not provided."
</code></pre>
<p>I found som... | 27,086,121 | 8 | 1 | null | 2014-11-23 03:15:31.25 UTC | 13 | 2022-09-19 11:42:36.063 UTC | 2022-04-03 19:02:17.81 UTC | null | 6,562,458 | null | 5,921 | null | 1 | 76 | django|authentication|django-rest-framework | 64,776 | <p>You can give empty defaults for the <a href="http://www.django-rest-framework.org/api-guide/permissions#setting-the-permission-policy">permission</a> and <a href="http://www.django-rest-framework.org/api-guide/authentication#setting-the-authentication-scheme">authentication</a> classes in your settings.</p>
<pre><c... |
27,324,020 | No valid 'aps-environment' entitlement string found for application on app store | <p>So I have this app called Dripper that I put out about a month ago and then an update a couple days ago. The update added push notifications and a few little tweaks. I tested it with the sandbox-apn using the development profile and things worked great. Then I switched things to the production-apn and pushed it to t... | 33,015,254 | 10 | 1 | null | 2014-12-05 20:18:42.953 UTC | 17 | 2021-01-10 12:35:08.967 UTC | 2021-01-10 12:35:08.967 UTC | null | 5,175,709 | null | 2,162,648 | null | 1 | 126 | ios|xcode|apple-push-notifications|app-store|entitlements | 103,324 | <p>I fix this problem by enabling push notification capability.</p>
<p>Click on .xcodeproj -> Capabilities -> Enable Push Notification</p>
<p><a href="https://i.stack.imgur.com/jvRFy.png"><img src="https://i.stack.imgur.com/jvRFy.png" alt=""></a></p> |
26,675,490 | Unexpectedly found nil while unwrapping optional value | <p>In my app I am checking to see whether a post has a picture or not.</p>
<p>For this I am using:</p>
<pre><code>if pictures[string]? != nil {
if var image: NSData? = pictures[string]? {
imageView.image = UIImage(data: image!)
}
}
</code></pre>
<p>However, it still comes up with the error:</p>
<blo... | 26,675,638 | 4 | 0 | null | 2014-10-31 13:08:55.367 UTC | 4 | 2019-02-19 20:50:21.72 UTC | 2016-01-25 22:00:36.94 UTC | null | 1,677,912 | null | 3,941,176 | null | 1 | 8 | ios|iphone|xcode|swift | 41,360 | <p>Try doing it this way:</p>
<pre><code>if let imageData = pictures[string] {
if let image = UIImage(data: imageData) {
imageView.image = image
}
}
</code></pre>
<p>Assuming that <code>string</code> is a valid key.</p>
<p>You are dealing with optionals, so conditionally unwrap each return object bef... |
255,714 | Syntax for putting a block on a single line | <p>So I've got a Ruby method like this:</p>
<pre><code>def something(variable, &block)
....
end
</code></pre>
<p>And I want to call it like this:</p>
<pre><code>something 'hello' { do_it }
</code></pre>
<p>Except that isn't working for me, I'm getting a syntax error. If I do this instead, it works:</p>
<pre>... | 255,791 | 3 | 0 | null | 2008-11-01 16:04:21.37 UTC | 2 | 2008-11-02 19:36:33.92 UTC | 2008-11-02 19:36:33.937 UTC | Romulo A. Ceccon | 23,193 | Cameron Booth | 14,873 | null | 1 | 30 | ruby|syntax | 13,464 | <p>You need to parenthesize your argument:</p>
<pre><code>something('hello') { do_it }
</code></pre>
<p>That should work.</p> |
973,146 | How to include header files in GCC search path? | <p>I have the following code in a sample file:</p>
<pre><code>#include "SkCanvas.h"
#include "SkDevice.h"
#include "SkGLCanvas.h"
#include "SkGraphics.h"
#include "SkImageEncoder.h"
#include "SkPaint.h"
#include "SkPicture.h"
#include "SkStream.h"
#include "SkWindow.h"
</code></pre>
<p>However, this code is located i... | 973,158 | 3 | 2 | null | 2009-06-10 00:20:38.347 UTC | 17 | 2020-11-20 10:10:09.787 UTC | 2011-11-08 12:40:04.42 UTC | null | 11,343 | null | 120,172 | null | 1 | 72 | c++|gcc|header | 186,814 | <p>Try <code>gcc -c -I/home/me/development/skia sample.c</code>.</p> |
39,506,619 | angular2: how to copy object into another object | <p>Please help me in order to copy the object into another object using angular 2?</p>
<p>In angular, I used angular.copy() to copy objects to the loose reference of the old objects. But, when I used the same in angular 2 getting below error:</p>
<blockquote>
<p>Error: angular is not defined.</p>
</blockquote> | 39,506,676 | 10 | 1 | null | 2016-09-15 08:42:31.733 UTC | 16 | 2022-09-08 07:21:46.043 UTC | 2020-08-10 13:22:25.677 UTC | null | 706,020 | null | 6,747,259 | null | 1 | 83 | angular|typescript | 154,420 | <p><strong>Solution</strong></p>
<p>Angular2 developed on the ground of modern technologies like TypeScript and ES6.</p>
<p>So you can just do <code>let copy = Object.assign({}, myObject)</code>.</p>
<p><a href="https://angular-training-guide.rangle.io/immutable/javascript-solutions/object_assign" rel="nofollow norefer... |
56,284,370 | Remove self element onclick | <p>I have an element that is added using javascript to my HTML document. I am trying to remove it when I click on that same element. I do not know the id of the element yet, I have just included a sample id for now.</p>
<p>I have already tried looking at this answer here (<a href="https://stackoverflow.com/questions/1... | 56,284,459 | 9 | 1 | null | 2019-05-24 00:15:11.82 UTC | 3 | 2021-02-03 18:10:03.75 UTC | null | null | null | null | 9,253,840 | null | 1 | 12 | javascript|html | 53,166 | <p>You have to pass <code>this</code> through the function call in html <code>onclick</code> so it could refer to the element then you have to use it as parameter in the function definition, otherwise, if you use <code>this</code> in the function definition, it will just refer to the window object.</p>
<p>This will wo... |
6,158,907 | What does Python treat as reference types? | <p>I assumed sequence types in Python were value types. It turns out they're reference types (Meaning that the value of a variable won't be copied when assigned to a new variable, but referenced). So now I'm wondering, what are the value types in Python? That is, what types in Python can I assign to new variables witho... | 6,158,918 | 3 | 0 | null | 2011-05-28 00:36:43.683 UTC | 13 | 2021-07-05 03:29:09.767 UTC | null | null | null | null | 388,916 | null | 1 | 29 | python|sequences|value-type|reference-type | 19,040 | <p><em>All</em> values in Python are references. What you need to worry about is if a type is <strong>mutable</strong>. The basic numeric and string types, as well as <code>tuple</code> and <code>frozenset</code> are immutable; names that are bound to an object of one of those types can only be rebound, not mutated.</p... |
6,270,354 | How to open warning/information/error dialog in Swing? | <p>How to open warning/information/error dialog in Swing?</p>
<p>I need standard error dialog with "Ok" button and "red cross" image.
I.e. analog of <code>org.eclipse.jface.dialogs.MessageDialog.openError()</code></p> | 6,270,381 | 4 | 0 | null | 2011-06-07 19:10:38.873 UTC | 7 | 2022-07-25 05:51:45.123 UTC | 2021-01-02 08:50:51.823 UTC | null | 213,269 | null | 93,647 | null | 1 | 48 | java|swing | 136,792 | <p>See <a href="http://download.oracle.com/javase/tutorial/uiswing/components/dialog.html" rel="noreferrer">How to Make Dialogs</a>.</p>
<p>You can use:</p>
<pre><code>JOptionPane.showMessageDialog(frame, "Eggs are not supposed to be green.");
</code></pre>
<p>And you can also change the symbol to an error message o... |
52,484,812 | ReactJS: Material ui breakpoints | <p>What is the difference between <code>breakpoints.up</code>, <code>breakpoints.down</code>, <code>breakpoints.between</code> and <code>breakpoints.value</code> ?
And what is meant by this code, how breakpoints value is working here? Is <code>theme.spacing.unit*2*2 = theme.spacing.unit*4</code> or it has some other ... | 52,490,042 | 1 | 2 | null | 2018-09-24 17:51:55.99 UTC | 13 | 2019-10-02 08:19:18.773 UTC | 2018-09-26 07:49:34.13 UTC | null | 8,255,883 | null | 10,379,605 | null | 1 | 29 | reactjs|responsive-design|media-queries|material-ui|breakpoints | 51,997 | <p>Material uses the following set of breakpoints. You can customize the <em>values</em> of this breakpoint in the theme. </p>
<p><a href="https://material-ui.com/customization/breakpoints/" rel="noreferrer">Breakpoint documentation</a></p>
<blockquote>
<p>A breakpoint is the range of predetermined screen sizes tha... |
5,810,635 | Is there a quick way to convert a JavaScript object to valid JSON in the text editor? | <p>I have a big old config object. Something like:</p>
<pre><code>var object = {
item1: 'value1',
item2: 1000,
item3: ['a', 'b', 'c'],
item4: [1, 2, 3],
item5: {
foo: 'bar'
}
};
</code></pre>
<p>... and so on. I want to rewrite it as valid JSON so it can travel through the intertubes, but I don't want... | 5,810,716 | 5 | 2 | null | 2011-04-27 21:10:53.67 UTC | 12 | 2019-02-15 17:38:02.45 UTC | 2011-04-27 21:12:53.07 UTC | null | 68,587 | null | 174,676 | null | 1 | 36 | javascript|json|text-editor | 33,451 | <ol>
<li>Launch Firefox/Chrome/Safari</li>
<li>Open Firebug/developer tools</li>
<li>Copy/paste your code into the console.</li>
<li><p>Then type <code>console.log(JSON.stringify(object))</code> and voila!</p>
<pre><code>{"item1":"value1","item2":1000,"item3":["a","b","c"],
"item4":[1,2,3],"item5":{"foo":"bar"}}
</co... |
6,310,620 | How to get relative path in Javascript? | <p>In my ASP.net web project, I've written the following Javascript code in a .js file:</p>
<pre><code>function getDeviceTypes() {
var deviceTypes;
$.ajax({
async: false,
type: "POST",
url: "Controls/ModelSelectorWebMethods.aspx/getDeviceTypes",
data: '{ }',
contentType:... | 6,310,991 | 6 | 3 | null | 2011-06-10 18:34:30.907 UTC | 4 | 2014-08-20 21:03:14.31 UTC | null | null | null | null | 238,260 | null | 1 | 13 | javascript|jquery|asp.net|ajax | 53,224 | <p>You've got two options:</p>
<ol>
<li><p>Build a configuration/ preferences object in JavaScript which contains all your environment specific settings:</p>
<pre><code> var config = {
base: <% /* however the hell you output stuff in ASPX */ %>,
someOtherPref: 4
};
</code></pre>
<p>and then prefix t... |
6,131,323 | How to select the top n from a union of two queries where the resulting order needs to be ranked by individual query? | <p>Let's say I have a table with usernames:</p>
<pre><code>Id | Name
-----------
1 | Bobby
20 | Bob
90 | Bob
100 | Joe-Bob
630 | Bobberino
820 | Bob Junior
</code></pre>
<p>I want to return a list of <code>n</code> matches on name for 'Bob' where the resulting set first contains exact matches followed by ... | 6,131,353 | 6 | 1 | null | 2011-05-25 21:42:37.68 UTC | 1 | 2014-09-03 03:19:52.427 UTC | null | null | null | null | 9,913 | null | 1 | 14 | sql|tsql|sql-server-2008|sql-server-2008-r2 | 41,136 | <p>You could use a <code>case</code> to place the exact matches on top:</p>
<pre><code>select top 4 *
from Usernames
where Name like '%Bob%'
order by
case when Name = 'Bob' then 1 else 2 end
</code></pre>
<p>Or, if you're worried about performance and have an index on <code>(Name)</code>:</p>
<pre><cod... |
5,734,678 | Custom filtering of intent chooser based on installed Android package name | <p>I'd like to leverage the built-in intent chooser to display a custom filtered list of apps for user to select from and launch. </p>
<p>I know how to get a list of installed packages:</p>
<pre><code>final Intent myIntent = new Intent(android.content.Intent.ACTION_MAIN);
List<ResolveInfo> resInfoList = getP... | 5,735,419 | 6 | 0 | null | 2011-04-20 18:06:39.31 UTC | 49 | 2020-05-26 19:06:19.583 UTC | 2011-04-20 18:17:07.86 UTC | null | 22,303 | null | 22,303 | null | 1 | 59 | android|android-intent | 53,109 | <p>The only one additional parameter for the chooser is <code>Intent.EXTRA_INITIAL_INTENTS</code>. Its description is:</p>
<blockquote>
<p>A <code>Parcelable[]</code> of Intent or <code>LabeledIntent</code> objects as set with <code>putExtra(String, Parcelable[])</code> of additional activities to place a the front ... |
5,610,822 | Convert Enumeration to a Set/List | <p>Is there some one-liner bridge method to dump a given <em>Enumeration</em> to <code>java.util.List</code> or <code>java.util.Set</code>?</p>
<p>Something built-in like <code>Arrays.asList()</code> or <code>Collection.toArray()</code> should exist somewhere, but I'm unable to find that in my IntelliJ debugger's evalu... | 5,610,838 | 6 | 0 | null | 2011-04-10 09:17:52.397 UTC | 10 | 2022-01-17 14:18:36.6 UTC | 2022-01-17 14:18:36.6 UTC | null | 4,294,399 | null | 148,926 | null | 1 | 211 | java|collections|conventions | 130,036 | <p>You can use <a href="http://download.oracle.com/javase/6/docs/api/java/util/Collections.html#list%28java.util.Enumeration%29"><code>Collections.list()</code></a> to convert an <code>Enumeration</code> to a <code>List</code> in one line:</p>
<pre><code>List<T> list = Collections.list(enumeration);
</code></pre... |
5,903,597 | Add new items to top of list view on Android? | <p>Android has the <a href="http://developer.android.com/reference/android/widget/AbsListView.html#setTranscriptMode%28int%29" rel="noreferrer">transcript mode</a> to allow to automatically scroll a list view to the bottom when new data is added to the adapter.</p>
<p>Can this be somehow reversed so that new items are... | 5,903,875 | 7 | 2 | null | 2011-05-05 20:19:47.823 UTC | 11 | 2017-04-22 18:01:05.353 UTC | 2011-05-06 07:24:50.13 UTC | null | 100,957 | null | 100,957 | null | 1 | 33 | android|listview | 62,545 | <p>Hmm, well, if I was going to try this, I'd do something like the following:</p>
<pre><code>List items = new ArrayList();
//some fictitious objectList where we're populating data
for(Object obj : objectList) {
items.add(0, obj);
listAdapter.notifyDataSetChanged();
}
listView.post(new Runnable() {
@Over... |
44,242,068 | What part of Spark SQL parse SQL statements and create execution plan? | <p>Assuming the following query:</p>
<pre><code>select * from my_table
</code></pre>
<p>what part of Spark parses the sql and create the execution plan?</p>
<p>Does Spark SQL execution engine have its own sql parser that translates it to his own execution model? how it works?</p>
<p>I got exception for some functio... | 44,242,242 | 1 | 0 | null | 2017-05-29 12:04:34.883 UTC | 10 | 2017-05-29 12:20:54.717 UTC | 2017-05-29 12:16:13.933 UTC | null | 1,305,344 | null | 2,220,509 | null | 1 | 4 | apache-spark|apache-spark-sql | 5,028 | <p>In Spark SQL it's <a href="https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala#L45-L46" rel="noreferrer">AstBuilder</a> that builds a abstract syntax tree of logical operators and expressions.</p>
<blockquote>
<p>The AstBuilder converts an ... |
4,973,454 | Session management : How to generate Authentication token for REST service ? (Jersey) | <p>I am trying to implement session management in my REST service. I came to know these guidelines while surfing :</p>
<ol>
<li><p>Not using server side sessions - it violates the RESTful principle.</p></li>
<li><p>Using HTTP Basic authentication - Not possible right now, as I am asked not to use SSL/TLS (which is no ... | 4,973,576 | 1 | 0 | null | 2011-02-11 20:00:43.933 UTC | 35 | 2013-03-22 22:13:42.75 UTC | null | null | null | null | 430,720 | null | 1 | 44 | security|session|rest|oauth|jersey | 30,990 | <p>For simplicity sake, I generate my own authentication token using <a href="http://docs.oracle.com/javase/7/docs/api/java/util/UUID.html" rel="noreferrer"><code>UUID</code></a> before encrypting the entire token with <a href="http://www.jasypt.org/" rel="noreferrer">Jasypt</a>:-</p>
<pre class="lang-java prettyprint... |
24,981,333 | iOS check if application has access to microphone | <p>With the introduction of iOS 7, applications have to request microphone access when they want to record audio. </p>
<p>How do I check if the application has access to the microphone?<br>
In the iOS 8 SDK I can use the <code>AVAudioSessionRecordPermission</code> enum, but how do I check this in iOS 7?</p>
<p>Info:... | 24,981,502 | 8 | 1 | null | 2014-07-27 13:16:15.557 UTC | 10 | 2021-10-28 16:18:17.18 UTC | 2018-08-03 13:02:36.673 UTC | null | 4,253,437 | null | 2,513,803 | null | 1 | 36 | ios|objective-c|swift|microphone|avaudiosession | 59,441 | <p>In <code>iOS7</code> there is no way to get the current status of <code>microphone authorization</code>.They have given the enum in <code>iOS8</code> as <a href="https://developer.apple.com/library/prerelease/ios/documentation/AVFoundation/Reference/AVAudioSession_ClassReference/index.html#//apple_ref/c/tdef/AVAudio... |
25,057,182 | How to change panel-body background-color in bootstrap? | <p>I am creating a webpage using twitter bootstrap, here i wanna change panel-body background-color form white to light-pink, but i haven't any idea that how it will be done? So ..... help me
Thank You</p> | 25,133,586 | 1 | 1 | null | 2014-07-31 10:58:47.1 UTC | 3 | 2014-08-05 08:24:48.76 UTC | 2014-08-05 08:24:48.76 UTC | null | 15,541 | null | 3,811,454 | null | 1 | 12 | twitter-bootstrap|panel | 53,638 | <p>The CSS being as follows (as an example) should work fine. If not then you'll need to show your code.</p>
<pre><code>.panel-body {
background:#FFCCFF;}
</code></pre> |
27,796,203 | How to set a driver path of firefoxdriver in selenium | <p>Hi I am very new to selenium . So pardon me for any technical mistakes.
I have a project which works fine for IE. But I need to test using firefox too. Does the project require a pointer towards the driver like IEDriver in case of execution in IE?</p> | 27,802,941 | 7 | 1 | null | 2015-01-06 10:01:07.55 UTC | 1 | 2020-08-04 08:42:46.2 UTC | null | null | null | null | 1,700,354 | null | 1 | 4 | java|firefox|selenium | 54,477 | <p>You don't need to set the driver path for FirefoxDriver.<br>You can directly use <strong><code>WebDriver driver = new FirefoxDriver();</code></strong>.</p>
<p>However, there are other ways to run selenium in Firefox also, as below:</p>
<p>1- <a href="http://www.toolsqa.com/selenium-webdriver/custom-firefox-profile... |
21,842,274 | Cross-browser custom styling for file upload button | <p>I'm trying to style a file upload button to my personal preferences, but I couldn't find any really solid ways to do this without JS. I did find <a href="https://stackoverflow.com/q/3226167/1256925">two</a> <a href="https://stackoverflow.com/q/3606876/1256925">other</a> questions about this subject, but the answers ... | 21,842,275 | 7 | 2 | null | 2014-02-18 00:52:16.607 UTC | 69 | 2018-04-22 21:07:53.927 UTC | 2017-05-23 12:18:20.277 UTC | null | -1 | null | 1,256,925 | null | 1 | 117 | html|css|cross-browser|file-io | 174,639 | <p><em>I'm posting this because (to my surprise) there was no other place I could find that recommended this.</em></p>
<p>There's a really easy way to do this, without restricting you to browser-defined input dimensions. Just use the <code><label></code> tag around a hidden file upload button. This allows for ev... |
33,340,659 | How to auto start an application in openwrt? | <p>I have created a shell with necessary functions such as
start()
stop()
restart()</p>
<p>But my file is not getting started at boot time.</p>
<p>I have used <strong>update-rc.d</strong> command in "ubuntu" to add this file to the list of autostart applications. And it was successfully started at boot ti... | 33,341,189 | 3 | 2 | null | 2015-10-26 07:37:28.783 UTC | 9 | 2020-04-03 05:40:29.58 UTC | 2015-10-26 07:49:39.147 UTC | null | 4,456,198 | null | 4,456,198 | null | 1 | 12 | shell|openwrt|autostart | 36,796 | <p>/etc/init.d/ - directory will by automaticly readed and searching for boot function or START STOP.
Starts at boot time.</p>
<pre><code>boot() {
echo boot
# commands to run on boot
}
</code></pre>
<p>START-Position then to start</p>
<p>STOP-Position then to stop</p>
<pre><code>START=10
STOP=15
... |
9,193,112 | Secure and HttpOnly flags for session cookie Websphere 7 | <p>In Servlet 3.0 complaint application servers I can set the HttpOnly and secure flags for the session cookie (JSESSIONID) by adding the following to the web.xml:</p>
<pre><code><session-config>
<cookie-config>
<secure>true</secure>
<http-only>true</http-only>
</cook... | 9,193,319 | 3 | 0 | null | 2012-02-08 12:14:42.527 UTC | 4 | 2016-01-27 12:04:45.09 UTC | 2016-01-27 12:04:45.09 UTC | null | 157,882 | null | 26,699 | null | 1 | 10 | servlets|cookies|websphere-7|httponly | 47,965 | <p>I think in WebSphere 7 you may have to delve into the administrative console. As ever the WebSphere documentation seems poor but seems to suggest setting the <a href="http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/topic/com.ibm.websphere.express.doc/info/exp/ae/usec_seccustomprop.html" rel="noreferrer">com.i... |
9,033,166 | Multiplayer JavaScript game built with Node.JS - Separating players | <p>I have a question which I cannot find an answer to.</p>
<p>I'm experimenting with building a multiplayer game with Node.JS and Socket.IO. I have built a chat room as my first experiment, so I have broadcasts working etc. Now I'm at the point where I want to get something working with Canvas.</p>
<p>The problem I'm... | 9,035,404 | 3 | 0 | null | 2012-01-27 12:19:46.633 UTC | 26 | 2017-05-23 11:08:40.627 UTC | 2012-01-27 12:21:17.067 UTC | null | 1,044,146 | null | 300,329 | null | 1 | 13 | javascript|node.js|canvas|socket.io | 14,292 | <p>My implementation will be very naive and simplified, no lag compensation, extrapolation and such, but it should point out a general conception of "multiplayering" with node.</p>
<p>I think the simplest approach is to have an associative array containing players(entities) on both client and server. Then from client ... |
9,019,512 | How can I change the touch effect color of the ActionBar in Android 3.0 and higher | <p>I am trying to change the color of the rollover effect when you touch an ActionBar Item.
On my Galaxy Nexus with 4.0.2 it's kind of a turquoise color shading which I want to be in a different color.</p>
<p>To be clear, I am talking about ActionBar items here, not navigation tabs.</p>
<p>I got it working under the ... | 9,019,730 | 1 | 0 | null | 2012-01-26 14:23:39.9 UTC | 15 | 2013-11-19 21:41:28.847 UTC | 2013-11-19 21:41:28.847 UTC | null | 321,731 | null | 709,835 | null | 1 | 23 | android|colors|touch|android-actionbar | 19,580 | <p>The native action bar uses the theme attribute <code>selectableItemBackground</code> for action item background drawing. This should be a state-list drawable.</p>
<p>Here's the declaration in <code>Theme.Holo</code>:</p>
<pre><code><style name="Theme.Holo">
<!-- bunch of things -->
<item nam... |
9,419,207 | Does Tomcat require Apache httpd? | <p>If I am given a war file that contains a Java web application, and I want to run that war locally, then do I just need Tomcat, or do I need Tomcat <strong>and</strong> Apache httpd (or any other web server)? Thanks in advance!</p> | 9,419,248 | 4 | 0 | null | 2012-02-23 18:45:46.86 UTC | 13 | 2016-08-10 03:54:20.97 UTC | null | null | null | null | 892,029 | null | 1 | 39 | java|tomcat|webserver|war|apache | 21,597 | <p>Tomcat is a web server of its own, so a separate web server like Apache is not required. You probably will want to change Tomcat's port though, since it defaults to 8080 and web sites are usually on port 80.</p>
<p>I think people generally put Apache in front of Tomcat so they can do things like:</p>
<ul>
<li>Have... |
10,725,705 | How To Create Table with Identity Column | <p>I have an existing table that I am about to blow away because I did not create it with the <code>ID</code> column set to be the table's Identity column.</p>
<p>Using <strong>SQL Server Management Studio</strong>, I scripted a <em>"Create To..."</em> of the existing table and got this:</p>
<pre><code>CREATE TABLE [... | 10,725,745 | 4 | 1 | null | 2012-05-23 18:24:54.24 UTC | 12 | 2018-03-22 10:46:33.833 UTC | 2018-03-22 10:46:33.833 UTC | null | 153,923 | null | 153,923 | null | 1 | 120 | sql|sql-server|tsql | 386,970 | <pre><code>CREATE TABLE [dbo].[History](
[ID] [int] IDENTITY(1,1) NOT NULL,
[RequestID] [int] NOT NULL,
[EmployeeID] [varchar](50) NOT NULL,
[DateStamp] [datetime] NOT NULL,
CONSTRAINT [PK_History] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_... |
10,591,086 | shell-script headers (#!/bin/sh vs #!/bin/csh) | <p>Why do all script files start with </p>
<pre><code>#!/bin/sh
</code></pre>
<p>or with </p>
<pre><code>#!/bin/csh
</code></pre>
<p>Is that required? What's the purpose of this? And what's the difference between the two?</p> | 10,591,174 | 3 | 1 | null | 2012-05-14 21:08:22.403 UTC | 19 | 2021-06-06 21:09:44.423 UTC | 2014-11-24 10:08:32.32 UTC | null | 1,600,108 | null | 1,293,653 | null | 1 | 124 | shell|unix | 228,632 | <p>This is known as a <code>Shebang</code>:</p>
<p><a href="http://en.wikipedia.org/wiki/Shebang_%28Unix%29">http://en.wikipedia.org/wiki/Shebang_(Unix)</a></p>
<blockquote>
<p>#!interpreter [optional-arg]</p>
</blockquote>
<p>A shebang is only relevant when a script has the execute permission (e.g. chmod u+x scri... |
7,069,176 | How do I setup a private git repository in Ubuntu? | <p>I use a git repository at work on GitHub. I know the basic commands for navigating and editing a repository but I don't know how to set one up from scratch.</p>
<p>I would like to setup my own server for the git repo so my buddies can come help me with the game I'm developing for Android. But I don't know how!</p>
... | 7,070,048 | 2 | 3 | null | 2011-08-15 18:44:16.603 UTC | 9 | 2014-02-10 05:59:28.68 UTC | 2011-08-15 18:54:02.06 UTC | null | 635,608 | null | 625,740 | null | 1 | 9 | git|ubuntu | 16,488 | <p>First, You need to create the repo (easy as <code>git init</code>)<br>
Second, You need to give your buddies access to the repo.</p>
<p>You may use few options which git handles:</p>
<ul>
<li>via <code>file://</code> (direct access on LAN)</li>
<li>via ftp</li>
<li>via git protocol (ssh access)</li>
</ul>
<p>Thir... |
7,208,773 | MySQL "Row 30153 was cut by GROUP_CONCAT()" error | <p>I have a function listed below. When I call it with the LIMIT set at 0,60 as seen below, it works fine. However, whenever I increase that LIMIT to 70 or higher, or even remove the LIMIT, MySQL errors when I call the function with the error: "Row 30153 was cut by GROUP_CONCAT()".</p>
<p>I have tried increasing the v... | 7,208,835 | 2 | 1 | null | 2011-08-26 18:00:41.37 UTC | 12 | 2019-07-31 07:59:18.51 UTC | null | null | null | null | 453,495 | null | 1 | 59 | mysql | 66,626 | <p>You could set the <a href="http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_group_concat_max_len">group_concat_max_len</a> variable to bigger value. Or perhaps use <a href="http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html#function_group-concat"><code>GROUP_CONCAT(DISTINCT ...)... |
23,243,277 | Thymeleaf - How to compare string with request parameter in html in Thymeleaf tag "th:if"? | <p>How to compare string with request parameter in html in Thymeleaf tag "th:if" ?
right now i am using this</p>
<pre><code><div class="error" th:if="${param.error == 'badCredentialsException'}" th:with="errorMsg=#{login.badCredentials}">
<p class="errorMsg"><span th:text="${e... | 23,291,183 | 3 | 1 | null | 2014-04-23 11:43:34.563 UTC | 9 | 2021-08-07 10:13:14.027 UTC | null | null | null | null | 3,515,080 | null | 1 | 14 | html|spring-mvc|thymeleaf | 64,885 | <p>It's not working because <code>param.error</code> is array of strings. You must retrieve first element of array (<code>param.error[0]</code>) to get first value of parameter (see <a href="http://www.thymeleaf.org/doc/html/Using-Thymeleaf.html#web-context-namespaces-for-requestsession-attributes-etc." rel="noreferrer... |
31,615,057 | Refactor menu missing from Visual Studio 2015 | <p>I am having trouble finding the right-click context menu in Visual Studio 2015. I know that nothing is wrong with my project or the file I am working. I can find the right-click context refactor menu in Visual Studio 2013. However, in Visual Studio 2015 there isn't a refactor context menu in the right-click context ... | 31,615,254 | 5 | 4 | null | 2015-07-24 16:04:19 UTC | 8 | 2019-03-18 23:46:24.593 UTC | 2019-02-25 07:57:55.54 UTC | null | 63,550 | null | 682,849 | null | 1 | 89 | visual-studio|refactoring|visual-studio-2015 | 48,520 | <p>Some of the refactoring tools have been relocated or are at least accessible in a different manner than they were previously.</p>
<p>Using the extract method refactor as an example, you can still use this function; it is just not done the same as before:</p>
<p><a href="https://i.stack.imgur.com/02w4A.png" rel="no... |
19,036,033 | Month is not printed from a date - Java DateFormat | <p>How to get month from a date in java : </p>
<pre><code> DateFormat inputDF = new SimpleDateFormat("mm/dd/yy");
Date date1 = inputDF.parse("9/30/11");
Calendar cal = Calendar.getInstance();
cal.setTime(date1);
int month = cal.get(Calendar.MONTH);
int day = cal.get(Ca... | 19,036,073 | 7 | 1 | null | 2013-09-26 18:35:10.98 UTC | 1 | 2018-01-10 11:29:41.25 UTC | 2017-11-28 19:29:33.703 UTC | null | 770,467 | null | 2,536,373 | null | 1 | 10 | java|date|calendar|date-format | 48,207 | <p>This is because your format is incorrect: you need <code>"MM/dd/yy"</code> for the month, because <code>"mm"</code> is for minutes:</p>
<pre><code>DateFormat inputDF = new SimpleDateFormat("MM/dd/yy");
Date date1 = inputDF.parse("9/30/11");
Calendar cal = Calendar.getInstance();
cal.setTime(date1);
int month = c... |
37,814,508 | Order columns through Bootstrap4 | <p>I have 3 columns which I want to order in different ways on desktop and mobile.</p>
<p>Currently, my grid looks like this:</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-html lang-html prettyprint-override"><cod... | 43,069,703 | 6 | 2 | null | 2016-06-14 14:12:12.29 UTC | 24 | 2022-09-20 19:20:36.173 UTC | 2022-09-20 19:20:36.173 UTC | null | 1,264,804 | null | 1,788,961 | null | 1 | 90 | css|twitter-bootstrap|bootstrap-4|grid | 179,228 | <p><strong>2021 - Bootstrap 5</strong></p>
<p>The responsive ordering classes are now <code>order-first</code>, <code>order-last</code> and <code>order-0</code> - <code>order-5</code></p>
<p><a href="https://codeply.com/p/XLuC2eGQND" rel="noreferrer">Demo</a></p>
<p><strong>2018 - Bootstrap 4</strong></p>
<p>The respon... |
18,050,836 | Getting return value from Task.Run | <p>I have the following code:</p>
<pre><code>public static async Task<string> Start(IProgress<ProcessTaskAsyncExProgress> progress)
{
const int total = 10;
for (var i = 0; i <= total; i++)
{
await Task.Run(() => RunLongTask(i.ToString(CultureInfo.InvariantCulture)));
if (p... | 18,050,858 | 2 | 0 | null | 2013-08-05 04:58:23.5 UTC | 8 | 2019-11-20 02:44:12.307 UTC | 2019-11-20 02:44:12.307 UTC | null | 4,404,544 | null | 1,177,278 | null | 1 | 71 | c#|.net|task-parallel-library|async-await | 122,242 | <p>Remove the <code>Result</code> from the end. When you <code>await</code> you will get the <code>Result</code> back from the await-able method.</p>
<pre><code>var val = await Task.Run(() => RunLongTask(i.ToString(CultureInfo.InvariantCulture)));
</code></pre> |
1,867,170 | purpose of webAppRootKey? | <p>Can somebody explain this entry in web.xml ? When it has to be used and why ?</p>
<pre><code><context-param>
<param-name>webAppRootKey</param-name>
<param-value>webapp.root</param-value>
</context-param>
</code></pre>
<p>Is this something related to Spring or general one... | 1,867,197 | 3 | 0 | null | 2009-12-08 14:04:00.93 UTC | 2 | 2017-12-24 05:06:02.75 UTC | null | null | null | null | 136,913 | null | 1 | 29 | spring-mvc|web.xml|servlets | 29,132 | <p>It is both general and Spring Specific. <code>context-param</code> allows you to specify context parameters (that is general) but what you specify is specific to your application, and your application will look for the parameter and use it.</p>
<p>In this case it is the key of the system property that should specif... |
1,537,673 | How do I forward parameters to other command in bash script? | <p>Inside my bash script, I would like to parse zero, one or two parameters (the script can recognize them), then forward the remaining parameters to a command invoked in the script. How can I do that?</p> | 1,537,695 | 3 | 0 | null | 2009-10-08 13:05:15.363 UTC | 35 | 2020-04-07 18:08:26.333 UTC | 2017-03-15 14:41:33.897 UTC | null | 1,486,275 | null | 61,342 | null | 1 | 224 | bash|command-line | 98,071 | <p>Use the <a href="http://www.gnu.org/software/bash/manual/bashref.html#index-shift" rel="noreferrer"><code>shift</code></a> built-in command to "eat" the arguments. Then call the child process and pass it the <a href="http://www.gnu.org/software/bash/manual/bashref.html#index-_0040" rel="noreferrer"><code>"$@"</code>... |
8,509,996 | Is there a way to get the row number in Mysql like the rownum in oracle | <p>Is there a way to get the row number in Mysql like the rownum in oracle, If not then is there any indirect way of doing it?
please suggest.</p> | 8,510,069 | 2 | 1 | null | 2011-12-14 18:47:00.93 UTC | 9 | 2016-06-11 11:54:04.63 UTC | null | null | null | null | 961,125 | null | 1 | 17 | mysql|sql|oracle | 33,663 | <p>Until MySQL finally supports <a href="http://modern-sql.com/slides">modern SQL</a>, the only way to get something similar is this: </p>
<pre><code>SELECT @rownum:=@rownum + 1 as row_number,
t.*
FROM (
< your original query goes here >
) t,
(SELECT @rownum := 0) r
</code></pre> |
19,342,908 | How to create a many-to-many mapping in Entity Framework? | <p>Here is the case, I have 2 entities, such as Contract、Media。 </p>
<pre><code>public class Media : Entity
{
public string Name {get; set;}
public bool Enabled
*//other properties can be ignored..*
}
public class Contract : Entity
{
public string Code {get; set;}
*//other properties can be ignore... | 19,343,047 | 2 | 1 | null | 2013-10-13 07:37:56.197 UTC | 33 | 2021-09-17 22:41:32.243 UTC | 2016-04-22 22:45:34.413 UTC | null | 1,459,996 | null | 2,751,088 | null | 1 | 57 | c#|entity-framework|many-to-many | 75,564 | <p>If you want to create many to many relationship with additional data in association table, you have to make the association table as entity. The pure many to many relationship is only in pure table with entity id's.</p>
<p>In you case it will be:</p>
<pre><code>public class Media // One entity table
{
public i... |
868,407 | Hide an element's next sibling with Javascript | <p>I have an element grabbed from <code>document.getElementById('the_id')</code>. How can I get its next sibling and hide it? I tried this but it didn't work:</p>
<pre><code>elem.nextSibling.style.display = 'none';
</code></pre>
<p>Firebug error was <code>elem.nextSibling.style is undefined</code>.</p> | 868,418 | 4 | 0 | null | 2009-05-15 12:28:05.847 UTC | 6 | 2013-06-05 17:59:23.29 UTC | null | null | null | null | 37,947 | null | 1 | 15 | javascript|element|hide|siblings | 44,363 | <p>it's because Firefox considers the whitespace between element nodes to be text nodes (whereas IE does not) and therefore using <code>.nextSibling</code> on an element gets that text node in Firefox.</p>
<p>It's useful to have a function to use to get the next element node. Something like this</p>
<pre><code>/*
... |
609,937 | What is the benefit of inheriting from std::binary_function (or std::unary function)? | <p>What is the benefit of inheriting from std::binary_function (or std::unary_function)?</p>
<p>For example I have such code:</p>
<pre><code>class Person
{
public:
Person();
Person(int a, std::string n);
Person(const Person& src);
int age;
std::string name;
};
Person::Person()
... | 609,952 | 4 | 6 | null | 2009-03-04 10:03:07.527 UTC | 7 | 2015-02-12 07:27:17.923 UTC | 2015-02-12 07:27:17.923 UTC | dirkgently | 71,910 | Darius Kucinskas | 71,910 | null | 1 | 28 | c++|stl | 9,346 | <p>Inheritance from [unary|binary]_function just gives you an additional typedefs in your class:</p>
<p>For unary_function</p>
<pre><code>argument_type
result_type
</code></pre>
<p>For binary_function</p>
<pre><code>first_argument_type
second_argument_type
result_type
</code></pre>
<p>Which are those types you pa... |
973,916 | LINQ Where in collection clause | <p>I've been looking on google but not finding anything that does the trick for me.</p>
<p>as you know SQL has a "where x in (1,2,3)" clause which allows you to check against multiple values.
I'm using linq but I can't seem to find a piece of syntax that does the same as the above statement.</p>
<p>I have a collecti... | 973,932 | 4 | 0 | null | 2009-06-10 06:03:23.707 UTC | 5 | 2014-11-07 12:06:05.95 UTC | 2012-01-03 14:59:50.063 UTC | user212218 | null | null | 112,406 | null | 1 | 32 | c#|linq-to-sql | 54,398 | <p>You have to use the Contains method on your id list:</p>
<pre><code>var query = from t in db.Table
where idList.Contains(t.Id)
select t;
</code></pre> |
22,239 | Why does int main() {} compile? | <p>(I'm using Visual C++ 2008) I've always heard that main() is <em>required</em> to return an integer, but here I didn't put in <code>return 0;</code> and and it compiled with 0 errors and 0 warnings! In the debug window it says the program has exited with code 0. If this function is named anything other than main()... | 22,262 | 4 | 0 | null | 2008-08-22 12:49:37.213 UTC | 9 | 2015-10-08 15:18:53.373 UTC | 2009-07-17 20:19:31.917 UTC | sparkes | 113,116 | da_code_monkey | 2,222 | null | 1 | 37 | c++|return-value|program-entry-point | 10,218 | <blockquote>
<h1>3.6.1 Main function</h1>
<p>....</p>
<p>2 An implementation shall not predefine the <code>main</code> function. This function shall not be overloaded. It shall have a return type of type <code>int</code>, but otherwise its type is implementation-defined. All implementations shall allow both of the foll... |
1,031,674 | How do I write a jquery function that accepts a callback as a parameter | <p>I Have the following function. </p>
<pre><code>function ChangeDasPanel(controllerPath, postParams) {
$.post(controllerPath, postParams, function(returnValue) {
$('#DasSpace').hide("slide", { direction: "right" }, 1000, function() {
$('#DasSpace').contents().remove();
$('#DasS... | 1,031,709 | 4 | 0 | null | 2009-06-23 10:07:00.207 UTC | 21 | 2014-03-20 05:27:51.88 UTC | null | null | null | null | 77,249 | null | 1 | 49 | javascript|jquery|function|callback | 89,912 | <pre><code>function ChangeDasPanel(controllerPath, postParams, f) {
$.get(
controllerPath,
postParams,
function(returnValue) {
var $DasSpace = $('#DasSpace');
$DasSpace.hide(
"slide", { direction: "right" }, 1000,
function() {
$DasSpace.contents().remove();
... |
195,975 | How to make a char string from a C macro's value? | <p>For example, how to avoid writing the 'func_name' twice?</p>
<pre><code>#ifndef TEST_FUN
# define TEST_FUN func_name
# define TEST_FUN_NAME "func_name"
#endif
</code></pre>
<p>I'd like to follow the <a href="http://en.wikipedia.org/wiki/Single_Point_of_Truth" rel="noreferrer">Single Point of Truth</a> rule.</p>
... | 196,018 | 4 | 1 | null | 2008-10-12 20:16:05.19 UTC | 21 | 2016-02-01 22:01:32.393 UTC | 2016-02-01 22:01:32.393 UTC | Jonathan Leffler | 4,370,109 | J.F. Sebastian | 4,279 | null | 1 | 55 | c|c-preprocessor|dry | 124,993 | <p><a href="https://stackoverflow.com/users/9611/shoosh">He who is Shy</a><sup>*</sup> gave you the germ of an <a href="https://stackoverflow.com/a/195980/15168">answer</a>, but only the germ. The basic technique for converting a value into a string in the C pre-processor is indeed via the '#' operator, but a simple t... |
129,445 | postgreSQL - psql \i : how to execute script in a given path | <p>I'm new to postgreSQL and I have a simple question:</p>
<p>I'm trying to create a simple script that creates a DB so I can later call it like this:</p>
<pre><code>psql -f createDB.sql
</code></pre>
<p>I want the script to call other scripts (separate ones for creating tables, adding constraints, functions etc), l... | 129,496 | 4 | 0 | null | 2008-09-24 19:49:48.807 UTC | 13 | 2017-02-23 07:11:03.93 UTC | 2015-09-11 15:06:18.547 UTC | gizmo | 4,333,555 | null | 21,853 | null | 1 | 80 | postgresql | 179,253 | <p>Postgres started on Linux/Unix. I suspect that reversing the slash with fix it.</p>
<pre><code>\i somedir/script2.sql
</code></pre>
<p>If you need to fully qualify something</p>
<pre><code>\i c:/somedir/script2.sql
</code></pre>
<p>If that doesn't fix it, my next guess would be you need to escape the backslash... |
740,119 | Default passwords of Oracle 11g? | <p>I installed Oracle 11g. I didn't change the passwords for SYSTEM and SYS. However now I find that the default passwords do not work. Please help.</p> | 740,884 | 4 | 0 | null | 2009-04-11 13:52:48.703 UTC | 29 | 2016-07-29 09:39:37.453 UTC | 2009-04-11 14:08:57.417 UTC | null | 60,261 | null | 69,746 | null | 1 | 85 | oracle11g | 447,250 | <p>It is possible to connect to the database without specifying a password. Once you've done that you can then reset the passwords. I'm assuming that you've installed the database on your machine; if not you'll first need to connect to the machine the database is running on.</p>
<ol>
<li><p>Ensure your user account ... |
805,280 | Loading up a web.xml for integration tests with jetty | <p>OK this is kind of related to : <a href="https://stackoverflow.com/questions/728805/using-jetty-to-install-and-run-servlet-tests-programmatically">Using jetty to install and run servlet tests programmatically</a></p>
<p>got great answers there, and have been able to load up servlets programmatically and its all mad... | 1,244,719 | 1 | 2 | null | 2009-04-30 03:51:27.333 UTC | 11 | 2009-08-07 13:34:06.23 UTC | 2017-05-23 12:08:38.51 UTC | null | -1 | null | 699 | null | 1 | 8 | java|jvm|jetty | 8,395 | <p>It sounds like what you want to do is load a proper web application programatically, as opposed to loading individual servlets (and I think you want to do it without having a full WAR file to work from).</p>
<pre><code>Server server = new Server( port );
WebAppContext root = new WebAppContext();
root.setWar("/path... |
39,840,030 | Distance between point and a line (from two points) | <p>I'm using Python+Numpy (can maybe also use Scipy) and have three 2D points </p>
<pre><code>(P1, P2, P3);
</code></pre>
<p>I am trying to get the distance from P3 perpendicular to a line drawn between P1 and P2. Let <code>P1=(x1,y1)</code>, <code>P2=(x2,y2)</code> and <code>P3=(x3,y3)</code></p>
<p>In vector nota... | 39,840,218 | 9 | 0 | null | 2016-10-03 20:40:11.667 UTC | 20 | 2022-01-22 17:27:55.627 UTC | 2017-04-28 19:20:43.29 UTC | null | 4,126,111 | null | 1,185,675 | null | 1 | 41 | python|numpy|vector|scipy|point | 77,582 | <p>Try using the <em>norm</em> function from <code>numpy.linalg</code></p>
<pre><code>d = norm(np.cross(p2-p1, p1-p3))/norm(p2-p1)
</code></pre> |
39,566,952 | Cordova Info.plist NSCameraUsageDescription key is missing | <p>After recent changes Apple requires specific keys if your app attempts to access privacy-sensitive data. So I added NSCameraUsageDescription key in my config.xml like this:</p>
<pre><code><platform name="ios">
<config-file parent="NSCameraUsageDescription" target="*-Info.plist">
<string&g... | 39,571,192 | 8 | 0 | null | 2016-09-19 06:48:53.537 UTC | 6 | 2019-08-13 20:36:33.347 UTC | 2019-08-13 20:36:33.347 UTC | null | 701,869 | null | 701,869 | null | 1 | 31 | ios|cordova|hybrid-mobile-app | 43,834 | <p>NEW ANSWER:</p>
<p>Since Cordova CLI 6.5.0 you can write in the <code>info.plist</code> directly by using the <code>edit-config</code> tag in the <code>config.xml</code> like this:</p>
<pre><code> <string>your usage message</string>
</edit-config>
</code></pre>
<p>But make sure you are using ... |
72,138,080 | Gitlab pipeline - reports config contains unknown keys: cobertura | <p>I'm not able run the gitlab pipeline due to this error</p>
<pre><code>Invalid CI config YAML file
jobs:run tests:artifacts:reports config contains unknown keys: cobertura
</code></pre> | 72,138,320 | 2 | 0 | null | 2022-05-06 08:01:50.047 UTC | null | 2022-05-06 12:28:04.55 UTC | null | null | null | null | 7,081,016 | null | 1 | 36 | gitlab|gitlab-ci|pipeline|cobertura | 11,338 | <p>Check the latest correct doc here: <a href="https://docs.gitlab.com/ee/ci/yaml/artifacts_reports.html#artifactsreportscoverage_report" rel="noreferrer">https://docs.gitlab.com/ee/ci/yaml/artifacts_reports.html#artifactsreportscoverage_report</a></p>
<p>Some of the docs are in somewhat of a messy state right now, due... |
33,209,938 | What is the purpose of angular-sanitize ? | <p>I was just going through the examples for a angular and openlayers directive <strong><a href="https://github.com/tombatossals/angular-openlayers-directive" rel="noreferrer">HERE</a></strong> and came across the following example:</p>
<pre><code><!DOCTYPE html>
<html ng-app="demoapp">
<head>
... | 33,209,988 | 1 | 0 | null | 2015-10-19 08:32:39.387 UTC | 8 | 2019-07-08 19:20:26.953 UTC | null | null | null | null | 4,381,665 | null | 1 | 27 | javascript|angularjs | 44,572 | <p>If you include the <code>angular-sanitize</code> script, inputs are sanitized by parsing the HTML into tokens. All safe tokens (from a whitelist) are then serialized back to properly escaped html string. This means that no unsafe input can make it into the returned string. </p>
<p>I have included a small example be... |
33,315,210 | error: command 'x86_64-linux-gnu-gcc' when installing mysqlclient | <p>I installed django 1.8.5 in virtualenv and using python 3.4.3
the worked displayed the <strong>it works</strong> page when using sqlite</p>
<p>I wanted to use mysql and I'm trying to install mysqlclient using</p>
<p><code>pip install mysqlclient</code></p>
<p>and I'm getting the following message</p>
<pre><code>... | 33,315,233 | 5 | 0 | null | 2015-10-24 06:28:06.42 UTC | 10 | 2020-04-17 21:05:24.59 UTC | 2017-05-23 12:34:24.333 UTC | null | -1 | null | 3,057,648 | null | 1 | 17 | mysql|django|python-3.4 | 19,517 | <p>You need to install python-dev:</p>
<pre><code>sudo apt-get install python-dev
</code></pre>
<p>And, since you are using python3:</p>
<pre><code>sudo apt-get install python3-dev
</code></pre>
<p>This command should help you.</p>
<p>If you are using mac os you might try:</p>
<pre><code>brew update && br... |
47,175,526 | Try with multiple Resource in Java | <p>I am new in <code>Java8</code>, and I want to know if, for the <code>AutoCloseable</code> resource, I have to add a <code>try</code> for each <code>resource</code>, or it will work with the code above</p>
<pre><code>try (Connection conn = getConnection();) {
Statement stmt = conn.createStatement();
... | 47,175,609 | 1 | 0 | null | 2017-11-08 09:06:50.85 UTC | 10 | 2017-12-11 07:35:33.627 UTC | 2017-12-11 07:35:33.627 UTC | null | 3,926,506 | null | 7,661,910 | null | 1 | 41 | java|try-with-resources|autocloseable | 33,819 | <p>Try with resources can be used with multiple resources by declaring them all in the <strong><code>try</code></strong> block and this feature introduced in <strong>java 7</strong> not in <strong>java 8</strong> If you have multiple you can give like below</p>
<pre><code>try (
java.util.zip.ZipFile zf =
... |
20,013,989 | Configure node npm package.json so that "npm test" works on both unix and windows | <p>I have developed a node.js npm module, developing under Windows. Today I wrote some Mocha tests. After many struggles, it seemed that for <code>npm test</code> to work, <code>package.json</code> had to look like this: (there may be other options???)</p>
<pre><code>"scripts": { "test": "node node_modules/mocha/bi... | 20,014,206 | 5 | 0 | null | 2013-11-16 02:43:26.967 UTC | 11 | 2021-02-28 22:56:25.667 UTC | 2017-05-23 12:03:05.75 UTC | null | -1 | null | 949,300 | null | 1 | 31 | windows|node.js|unix|npm | 47,452 | <p>I've always been able to <code>npm install -g mocha</code> or <code>npm install mocha</code> and then just add</p>
<pre><code>"scripts": {
"test": "mocha spec"
}
</code></pre>
<p>to package.json. That may or may not work in EVERY environment. I know, for instance, with lineman, you have to use bin/mocha. Also,... |
21,572,725 | Finding out the installed version of twig | <p>Is there a way to find out my installed version of Twig?</p>
<p>Something like </p>
<pre><code><p>The current version is {% twig.version %}</p>
</code></pre>
<p>(although I know that's not even close to being right).</p> | 21,572,829 | 5 | 0 | null | 2014-02-05 09:04:17.223 UTC | 5 | 2022-04-08 12:58:55.953 UTC | 2014-02-05 09:27:22.15 UTC | null | 457,148 | null | 457,148 | null | 1 | 36 | php|twig | 17,673 | <p>Try it:</p>
<pre><code><p>The current version is {{ constant('Twig_Environment::VERSION') }}</p>
</code></pre> |
20,510,243 | Clear the form field after successful submission of php form | <p>I am making a simple Form the problem i am facing is when i submit the form values still remains in the field. and I want to clear it after SUCCESSFUL submission. Please help.</p>
<p>here is my code for the form..</p>
<pre><code><label class="w">Plan :</label>
<select autofocus="" name="plan" requir... | 20,510,258 | 14 | 0 | null | 2013-12-11 03:59:27.573 UTC | 7 | 2021-09-27 02:45:35.533 UTC | 2017-01-16 14:47:11.18 UTC | null | 6,173,350 | null | 3,077,217 | null | 1 | 7 | php|forms | 182,596 | <p>They remain in the fields because you are explicitly telling PHP to fill the form with the submitted data.</p>
<pre><code><input name="firstname" type="text" placeholder="First Name" required="required"
value="<?php echo $_POST['firstname'];?>">
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ HERE
</code></pr... |
24,180,034 | Authenticated access to WebAPI via Facebook token from Android App | <p>I'm trying to make my Android Application to log into my WebAPI services. I want to share my ideas in order to verify them.</p>
<p>If the access to WebAPI is performed via WebSite the steps are:</p>
<p>1- Call WebAPI method for logging in</p>
<p>2- WebAPI redirect client to facebook</p>
<p>3- Facebook login and ... | 24,181,314 | 1 | 0 | null | 2014-06-12 08:45:12.307 UTC | 10 | 2017-07-07 04:42:46.393 UTC | null | null | null | null | 530,384 | null | 1 | 8 | android|facebook|token|asp.net-web-api | 4,632 | <p>Ok, I think I've got it!</p>
<p>when WebAPI receives the Facebook Token doesn't know anything about user and authorizations. BUT, due to the token, can access to Facebook "as the caller".</p>
<p>By this way the application could perform something like:</p>
<ol>
<li><p>Android -> Facebook Login -> Get FBToken</p><... |
27,850,472 | Html5 video background, keep center of video in center | <p>I am trying to keep a background video centered regardless of how big the user drags the video. It's currently cutting off the right side of the videos when i scroll smaller. Here's what I have:</p>
<pre><code><section id="home">
<div class="video_shader"></div>
<div class="video_c... | 27,850,657 | 10 | 0 | null | 2015-01-08 22:13:00 UTC | 18 | 2020-05-15 00:01:56.297 UTC | null | null | null | null | 3,201,696 | null | 1 | 38 | css|html|video | 73,597 | <p>here's how I typically do background video, and how I did it for the <strong><a href="https://stre.am/" rel="noreferrer">stre.am</a></strong> landing page:</p>
<pre><code>.video_contain {
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
}
video {
position: absolute;
... |
20,945,944 | Jekyll & Liquid: Output category list with post count? | <p>I'm somehow stuck and don't find the right way to do it.</p>
<p>I want to output a category list with the number of posts in each categorie.</p>
<p>I got this far: <a href="https://paste.xinu.at/dOLtod/" rel="nofollow noreferrer">https://paste.xinu.at/dOLtod/</a> </p>
<p>but I never managed to get the real count.... | 21,080,786 | 3 | 0 | null | 2014-01-06 08:35:22.073 UTC | 9 | 2020-04-04 18:56:08.15 UTC | 2018-02-10 18:37:14.977 UTC | null | 472,495 | null | 3,164,650 | null | 1 | 15 | jekyll|liquid | 11,390 | <p>I have written a code snippet that not only shows post count in each category, but also navigates to the posts of a specific category which got clicked. I hope you find it helpful:</p>
<pre><code><ul class="tag-box inline">
{% assign tags_list = site.categories %}
{% if tags_list.first[0] == null %}
{... |
22,886,353 | Printing colors in python terminal | <p>I'd like to make a program that prints colors in the python terminal but I don't know how. I've heard that you can use certain escape sequences to print text in color, but I'm not sure of this. How can I print a string in a specific color using the python terminal?</p>
<p>Side note: I run a version of Linux.</p> | 22,886,382 | 1 | 0 | null | 2014-04-05 20:26:58.137 UTC | 4 | 2016-04-15 17:52:12.897 UTC | 2016-04-15 17:52:12.897 UTC | null | 3,500,191 | null | 3,500,191 | null | 1 | 22 | python|terminal | 75,647 | <p>Try the <a href="https://pypi.python.org/pypi/termcolor" rel="noreferrer"><code>termcolor</code></a> module.</p>
<pre><code>from termcolor import colored
print colored('hello', 'red'), colored('world', 'green')
</code></pre>
<p>See <a href="https://stackoverflow.com/questions/287871/print-in-terminal-with-colors-... |
22,717,586 | Create a Web Worker from a Chrome Extension content script | <p>I'm trying to create a Web Worker from my extension's content script, but it's getting blocked by a SecurityError (same origin policy). What's the best way to do this?</p>
<p>From my content script:</p>
<pre><code>var workerURL = chrome.extension.getURL("js/searchWorker.js");
var lunrWorker = new Worker(workerURL)... | 22,719,772 | 1 | 0 | null | 2014-03-28 15:53:40.937 UTC | 14 | 2016-07-26 20:31:58.573 UTC | 2014-05-03 18:05:15.81 UTC | null | 446,203 | null | 446,203 | null | 1 | 14 | javascript|google-chrome-extension|web-worker | 7,052 | <p><a href="http://crbug.com/357664" rel="noreferrer">http://crbug.com/357664</a> is the bug report about not being able to load extension scripts as a web worker.</p>
<p>The workaround to this problem is to load the worker script using XMLHttpRequest, then <a href="https://stackoverflow.com/questions/10343913/how-to-... |
45,930,750 | How to output per-class accuracy in Keras? | <p>Caffe can not only print overall accuracy, but also per-class accuracy.</p>
<p>In Keras log, there's only overall accuracy. It's hard for me to calculate the separate class accuracy.</p>
<pre><code>Epoch 168/200
0s - loss: 0.0495 - acc: 0.9818 - val_loss: 0.0519 - val_acc: 0.9796
Epoch 169/200
0s - loss: 0.0519 -... | 45,940,876 | 4 | 0 | null | 2017-08-29 04:35:18.7 UTC | 11 | 2022-01-24 17:00:48.843 UTC | 2021-07-19 08:18:01.75 UTC | null | 4,685,471 | null | 8,481,526 | null | 1 | 29 | python|machine-learning|keras|neural-network|conv-neural-network | 25,018 | <p>Precision & recall are more useful measures for multi-class classification (see <a href="https://en.wikipedia.org/wiki/Confusion_matrix" rel="noreferrer">definitions</a>). Following the Keras <a href="https://github.com/fchollet/keras/blob/master/examples/mnist_cnn.py" rel="noreferrer">MNIST CNN</a> example (10-... |
29,162,278 | Benefits of JavaConfig over XML configurations in Spring? | <p>Earlier the configurations used to be in hard coded in the code, later it was externalized to .property files (for sake of avoiding hard coded values, avoiding changing code for the sake of changing configurations..etc) then it moved to XML (for sake of being more standardized, error free..etc)</p>
<p>Now, while re... | 29,162,830 | 2 | 0 | null | 2015-03-20 08:26:10.51 UTC | 14 | 2019-12-08 13:42:08.013 UTC | null | null | null | null | 1,538,815 | null | 1 | 48 | spring|annotations|spring-3|spring-annotations | 30,106 | <p>There are some advantages</p>
<ol>
<li>Java is type safe. Compiler will report issues if you are
configuring right bean class qualifiers. </li>
<li>XML based on configuration can quickly grow big. [Yes we can split
and import but still]</li>
<li>Search is much simpler, refactoring will be bliss. Finding a bean
defi... |
40,066,731 | Node v6 failing on object spread | <p>I had a question about why node v6.7 would be failing to run this code:</p>
<pre><code>var a = {
foo: 'bar'
}
var b = {
...a,
my: 'sharona'
}
console.log(b)
</code></pre>
<p>Anyone have an idea why that would be? I thought v6 supported object spreading..? But I guess not? Here is the error I'm seeing:... | 40,066,802 | 2 | 2 | null | 2016-10-16 04:09:48.277 UTC | 5 | 2018-06-05 03:46:34.23 UTC | null | null | null | null | 2,178,112 | null | 1 | 58 | node.js|ecmascript-6 | 36,872 | <p>Looks like ES6 spread operator only works for arrays and iterables. It is specifically designed to <strong>NOT WORK</strong> for objects: <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Spread_operator" rel="noreferrer">https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/... |
42,802,431 | Angular 2 Load CSS background-image from assets folder | <p>My folder structure looks like</p>
<pre><code>-myapp
-assets
-home-page-img
-header-bg.jpg
-src
-app
-home-page
-home-page.component.css
-home-page.component.html
-home-page.component.ts
</code></pre>
<p>Inside my home-page.component.c... | 42,803,416 | 11 | 5 | null | 2017-03-15 06:22:17.967 UTC | 13 | 2022-08-26 07:59:55.327 UTC | null | null | null | null | 7,528,750 | null | 1 | 67 | html|css|angular | 125,280 | <p>try </p>
<pre><code>background-image: url('../../assets/home-page-img/header-bg.jpg');
</code></pre> |
53,231,667 | Bundler: You must use Bundler 2 or greater with this lockfile | <p>I'm working with heroku and every time I try to push my app this message shows out:</p>
<pre><code>remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected
remote:
remote: !
remote: ! You must use Bundler 2 or greater with this lockfile.
remote: !
remo... | 53,604,505 | 20 | 1 | null | 2018-11-09 18:46:47.223 UTC | 24 | 2022-02-16 23:31:29.05 UTC | 2019-10-12 17:21:39.503 UTC | null | 10,907,864 | null | 7,680,956 | null | 1 | 119 | ruby-on-rails|heroku|ruby-on-rails-5|heroku-cli | 126,654 | <p>I deleted the project and made a git clone from the Heroku app, don´t know if it is a good solution, but it worked for me.</p> |
30,625,280 | How to create a simple divider in the new NavigationView? | <p>Google introduced the <code>NavigationView</code> in the Design Support Library version 22.2.0 with which you can create a drawer very easily using a menu resource.</p>
<p>How can I create a simple divider line between two items? Grouping the items didn't work. Creating a sub items section does create a divider lin... | 30,625,471 | 14 | 1 | null | 2015-06-03 16:06:20.943 UTC | 41 | 2021-01-26 01:35:28.84 UTC | 2015-06-19 12:47:27.61 UTC | null | 4,626,831 | null | 2,968,428 | null | 1 | 163 | android|navigation-drawer|android-support-library|android-design-library|navigationview | 102,622 | <p>All you need to do is define a <code>group</code> with an <strong>unique ID</strong>, I have checked the implementation if group has different id's it will create a divider.</p>
<h2>Example menu, creating the separator:</h2>
<pre><code><menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:a... |
29,681,906 | Python: Pandas dataframe from Series of dict | <p>I have a Pandas dataframe:</p>
<pre><code>type(original)
pandas.core.frame.DataFrame
</code></pre>
<p>which includes the series object <code>original['user']</code>:</p>
<pre><code>type(original['user'])
pandas.core.series.Series
</code></pre>
<p><code>original['user']</code> points to a number of dicts:</p>
<p... | 29,685,357 | 3 | 2 | null | 2015-04-16 17:26:41.993 UTC | 6 | 2022-02-23 00:18:42.26 UTC | 2017-02-08 15:21:23.213 UTC | null | 6,079,108 | null | 3,153,869 | null | 1 | 38 | python|pandas|dataframe | 21,397 | <p>what I would try to do is the following:</p>
<pre><code>new_df = pd.DataFrame(list(original['user']))
</code></pre>
<p>this will convert the series to list then pass it to pandas dataframe and it should take care of the rest.</p> |
4,093,611 | Request method 'POST' not supported | <p>According to the Spring Documentation <a href="http://blog.springsource.com/2009/03/08/rest-in-spring-3-mvc/" rel="noreferrer">here</a>:</p>
<blockquote>
<p>While HTTP defines these four methods, HTML only supports two: GET and POST. Fortunately, there are two possible workarounds: you can either use JavaScript t... | 4,093,704 | 1 | 3 | null | 2010-11-04 03:17:53.75 UTC | 2 | 2015-02-24 20:56:10.45 UTC | null | null | null | null | 392,222 | null | 1 | 8 | java|spring-mvc|url-rewriting | 46,969 | <p>You need to configure HiddenHttpMethodFilter in your web.xml </p>
<p>Details can be found <a href="http://blog.springsource.com/2009/03/08/rest-in-spring-3-mvc/" rel="noreferrer">here</a>:</p> |
6,613,746 | text on left and right side of element | <p>Using CSS what is the best way to have text on both the right and the left side of an element and be in the same spot vertically?</p>
<p>Thus ending up with the following layout:<br/>
<img src="https://i.stack.imgur.com/Rvc7F.png" alt="enter image description here"></p>
<p>The container has a fixed width, so I don... | 6,613,776 | 2 | 0 | null | 2011-07-07 16:15:35.223 UTC | 3 | 2014-01-12 17:43:41.13 UTC | null | null | null | null | 552,067 | null | 1 | 17 | html|css|text | 49,068 | <p>(1) Add two divs within the element that contain each text string</p>
<pre><code><div>
<div class="div1">Left Text</div>
<div class="div2">Right Text</div>
</div>
</code></pre>
<p>(2) Float the two divs next to each other</p>
<pre><code>.div1 {
float: left;
}
.div2... |
7,611,081 | Can I access the skipped "parent" of SelectMany when using dotted syntax in Linq? | <p>In query syntax I can write </p>
<pre><code>var greendoorsWithRooms = from room in house.roooms
from door in room.doors
where door.Color = green
select new {d=door,r=room}
</code></pre>
<p>Is there a way I could achieve the same with dotted syntax?</p>
<pre><code>var greendoorsWithRooms = house.rooms.SelectMany(r... | 7,611,501 | 3 | 0 | null | 2011-09-30 13:28:30.61 UTC | 2 | 2021-05-06 18:10:52.37 UTC | 2016-11-01 10:40:34.587 UTC | null | 80,577 | null | 80,577 | null | 1 | 33 | c#|linq | 10,513 | <p>This is also possible:</p>
<pre><code>house.rooms.SelectMany(room => room.Doors.Where(door => door.Color == green),
(room, door) => new { r = room, d = door })
</code></pre>
<p>It's <a href="http://msdn.microsoft.com/en-us/library/bb534631.aspx" rel="noreferrer">this</a> overload of <code>SelectMany</c... |
7,442,310 | Adding elements to JList in Swing Java | <p>I have a function that executes when a button is clicked. Suppose there is a loop to add 1 to 10 to a <code>JList</code>. I add that data to <code>DefaultListModel</code>. It works perfectly and the numbers get added. Then I added a <code>Thread.sleep(1000)</code> within the loop. But the output is different. I want... | 7,442,516 | 4 | 0 | null | 2011-09-16 08:56:50.063 UTC | 2 | 2013-10-31 15:02:49.42 UTC | 2011-09-16 09:06:51.87 UTC | null | 440,621 | null | 440,621 | null | 1 | 10 | java|swing|jlist | 51,132 | <p>You should update your list in a separate thread otherwise you end up blocking the event dispatch thread.</p>
<p>Try the following:</p>
<pre><code>final DefaultListModel model = new DefaultListModel();
final JList list = new JList(model);
//another thread to update the model
final Thread updater = new Thread() {
... |
21,916,615 | Horizontal timeline in pure css | <p>I'm trying to make a timeline in pure CSS however I seem to be running into some problems.</p>
<p>When I try to set the timeline div as overflow-x: scroll it still scrolls on the y access.</p>
<p>This is what I've got: </p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="f... | 21,920,076 | 2 | 2 | null | 2014-02-20 18:36:20.293 UTC | 3 | 2020-01-05 12:25:03.57 UTC | 2020-01-05 12:25:03.57 UTC | null | 896,358 | null | 2,933,987 | null | 1 | 7 | html|css | 42,426 | <p>I literally JUST had to make one of these. This is what I came up with:</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-css lang-css prettyprint-override"><code>body {
padding: 25px;
font-family: sans-serif;... |
1,389,881 | Transaction in REST WCF service | <p>We are having a REST WCF service.
we want the save operation on this REST service to be in transaction.
Is there a way to pass Transaction object over the wire to REST WCF service?</p> | 1,390,393 | 4 | 0 | null | 2009-09-07 15:26:59.447 UTC | 9 | 2013-11-12 13:11:08.203 UTC | 2009-09-07 18:00:15.25 UTC | null | 6,819 | null | 164,125 | null | 1 | 11 | wcf|rest|transactions|wcf-rest | 5,934 | <p>Here is a quote from Roy Fielding, the guy who invented the term REST</p>
<blockquote>
<p>If you find yourself in need of a
distributed transaction protocol, then
how can you possibly say that your
architecture is based on REST? I
simply cannot see how you can get from
one situation (of using RESTful
... |
1,550,878 | Nearest-neighbor interpolation algorithm in MATLAB | <p>I am trying to write my own function for scaling up an input image by using the Nearest-neighbor interpolation algorithm. The bad part is I am able to see how it works but cannot find the algorithm itself. I will be grateful for any help.</p>
<p>Here's what I tried for scaling up the input image by a factor of 2:</... | 1,551,208 | 4 | 1 | null | 2009-10-11 14:53:56.083 UTC | 11 | 2017-02-27 20:02:09.69 UTC | 2017-05-23 12:32:31.727 UTC | null | -1 | null | 151,937 | null | 1 | 20 | matlab|image-processing|interpolation|nearest-neighbor|resize-image | 59,178 | <p>A while back I went through the code of the <a href="http://www.mathworks.com/help/images/ref/imresize.html" rel="nofollow noreferrer"><code>imresize</code></a> function in the <a href="https://www.mathworks.com/products/image.html" rel="nofollow noreferrer">MATLAB Image Processing Toolbox</a> to create a simplified... |
49,579,282 | Can't find module cPickle using Python 3.5 and Anaconda | <p>I am trying to use cPickle on a windows box, using Anaconda. I am using python 3.5. I am not using a virtualenv (though probably should be).</p>
<p>When I try to import cPickle I get <em>"ImportError: No module named 'cPickle'"</em></p>
<pre><code>Python 3.5.0 |Anaconda custom (64-bit)| (default, Dec 1 2015, 11:4... | 49,579,373 | 2 | 3 | null | 2018-03-30 18:09:09.883 UTC | 3 | 2021-09-28 19:51:10.88 UTC | null | null | null | null | 8,283,463 | null | 1 | 50 | python|anaconda|pickle|versioning | 73,698 | <p>There is no <code>cPickle</code> in Python 3. Just import <code>pickle</code>. <code>pickle</code> will automatically use the C accelerator.</p> |
10,714,911 | AlertDialog's items not displayed | <p>I create an <code>AlertDialog</code> with an <code>AlertDialog.Builder</code> and set some items with <code>setItems()</code>. The dialog is shown but I cannot see any of the items. All I see is the message.</p>
<pre><code>final CharSequence[] items = {"Red", "Green", "Blue"};
AlertDialog.Builder dialogBuilder = n... | 10,715,081 | 7 | 2 | null | 2012-05-23 06:55:24.077 UTC | 12 | 2020-05-05 11:49:29.503 UTC | 2017-04-13 19:25:30.63 UTC | null | 3,711,928 | null | 1,411,864 | null | 1 | 53 | android|android-alertdialog | 21,734 | <p>Use <code>setTitle</code> instead of <code>setMessage</code> which sets message body and overrides the items list.</p> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.