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
41,129,504
PyCharm with Pyenv
<p>How to use Pyenv virtualenv's with Pycharm 2016.3? In the earlier version of Pycharm, I could easily set up local interpreter to point anything installed on my machine. </p> <p>My first idea was to add <code>.python-version</code> file on the root of the project. I Pyenv virtualenv installed so this will activate &...
51,545,578
5
1
null
2016-12-13 19:56:25.327 UTC
13
2022-05-03 13:31:49.143 UTC
null
null
null
null
2,335,820
null
1
82
python|pycharm
54,163
<p>In Pycharm version 2017.3, you can go to <strong>Pycharm -> Preferences -> Project -> Project Interpreter -> <code>&lt;</code>project_name<code>&gt;</code> -> settings button on the right of the python interpreter text box -> Add local</strong></p> <p>This will open a new window with virtualenv Environment as one ...
1,589,977
Linking a shared library against a static library: must the static library be compiled differently than if an application were linking it?
<p>At least on Linux and Solaris, static libraries are really just a bunch of compiled .o's tossed into one big file. When compiling a static library, usually the -fpic flag is ommited, so the generated code is position dependent. </p> <p>Now say my static library is B. I've built it and have the resulting .a file whi...
1,590,050
3
1
null
2009-10-19 17:21:04.2 UTC
11
2012-06-09 19:04:20.213 UTC
2012-04-04 14:51:05.783 UTC
null
50,385
null
50,385
null
1
32
c|linker|shared-libraries|static-libraries|fpic
19,916
<p>You do not have to use PIC code in shared objects (as you have discovered you can use the -mimpure-text option to allow that).</p> <p>That said, non-PIC code in shared objects are more heavyweight. With PIC code, the text pages in memory are just direct memory mappings of the text pages on disk. This means that i...
1,537,951
Generate table DDL via query on MySQL and SQL Server
<p>Is there an easy way to extract table DDL information, via a query, using either Ms or My SQL server? (preferably both?)</p> <p>For example, using MySQL Administrator / Navicat for MySql, there is a "DDL" function, which generates the "create table foo (....)" script.</p> <p>Is there any way to get this informati...
1,538,108
3
0
null
2009-10-08 13:54:30.63 UTC
4
2020-08-14 13:57:29.013 UTC
2017-01-11 16:09:55.723 UTC
null
4,370,109
Bob
null
null
1
40
mysql|database|ddl
40,183
<p>it's mysql-specific, but <code>SHOW CREATE TABLE &lt;table-name&gt;</code> gives you the DDL for a table.</p>
8,755,506
Put checkmark in the left side of UITableViewCell
<p>I want to make something similar to the WiFi settings page: when you tap the table cell, put a checkbox in the left side of the cell, and have a disclosure button accessory view on the right to show more details.</p> <p>My question: is there a way to put the checkmark in the left side of a UITableViewCell without b...
12,664,922
6
1
null
2012-01-06 09:03:36.54 UTC
23
2016-09-27 10:43:11.147 UTC
null
null
null
null
460,750
null
1
30
iphone|objective-c|ios|uitableview
28,529
<p>The answer is YES! You don't have to create a custom cell for that or add image views. To simulate checkboxes you only have to prepend a unicode symbol for a checkbox state to the cell text.</p> <p>The unicode symbols I'm using for checkboxes are <code>\u2705</code> for checked and <code>\u2B1C</code> for unchecked...
8,706,930
Converting nested hash keys from CamelCase to snake_case in Ruby
<p>I'm trying to build an API wrapper gem, and having issues with converting hash keys to a more Rubyish format from the JSON the API returns.</p> <p>The JSON contains multiple layers of nesting, both Hashes and Arrays. What I want to do is to recursively convert all keys to snake_case for easier use.</p> <p>Here's w...
8,707,236
7
1
null
2012-01-03 01:13:02.307 UTC
4
2021-02-12 12:06:40.85 UTC
2012-01-03 02:05:22.027 UTC
null
38,765
null
945,848
null
1
38
ruby|hash|key|camelcasing|hash-of-hashes
31,902
<p>You need to treat Array and Hash separately. And, if you're in Rails, you can use <a href="http://api.rubyonrails.org/classes/String.html#method-i-underscore" rel="noreferrer"><code>underscore</code></a> instead of your homebrew <code>to_snake_case</code>. First a little helper to reduce the noise:</p> <pre><code>d...
27,038,253
Mock AsNoTracking Entity Framework
<p>How do I mock AsNoTracking method? <br>In below example, DbContext has injected to the service class.It works fine if I remove AsNoTracking extension method from GetOrderedProducts method, but with AsNoTracking test fails because it returns null. I've also tried to mock AsNoTracking to return proper value but it di...
27,087,604
3
3
null
2014-11-20 11:17:53.56 UTC
9
2019-04-26 10:15:36.877 UTC
2014-11-23 09:03:13.787 UTC
null
369,161
null
369,161
null
1
33
c#|entity-framework|unit-testing|mocking|moq
9,180
<p>Looking at the <a href="https://github.com/aspnet/EntityFramework6/blob/master/src/EntityFramework/QueryableExtensions.cs#L623" rel="noreferrer">source code</a> of the <code>AsNoTracking()</code> extension method:</p> <pre><code>public static IQueryable AsNoTracking(this IQueryable source) { var asDbQuery = sou...
271,907
How to detect using c# if a pendrive is plugged into a USB port?
<p>Is there a way to find out when in a LAN anyone plugs in a pendrive to the USB port? Programatically (in C# preferably) or through some tool. Basically I'd imagine a client application sits on each terminal and monitors the USB ports and sends the information to the server. </p> <p>a.) Can I get the details of the...
272,005
4
0
null
2008-11-07 12:21:24.923 UTC
15
2011-01-27 20:02:38.047 UTC
2011-01-27 20:02:38.047 UTC
null
28,491
null
20,358
null
1
13
c#|windows|usb|monitoring|usb-flash-drive
22,176
<p>[Assuming Windows, given the C# remark. Please tag accordingly]</p> <p>Yes, this is possible. And it is possible to get the details of the file. It will require programming, though. Watch for <a href="http://msdn.microsoft.com/en-us/library/aa363480(VS.85).aspx" rel="noreferrer">WM_DEVICECHANGE</a> and re-enumerate...
878,330
How to pass in ID with Html.BeginForm()?
<p>In <a href="http://en.wikipedia.org/wiki/ASP.NET_MVC_Framework" rel="noreferrer">ASP.NET MVC</a> I'm using the HTML helper </p> <pre><code>Html.BeginForm("ActionName", "Controller", FormMethod.Post); </code></pre> <p>But I need to post to: /controller/action/23434</p> <p>How do I pass in the ID?</p>
878,408
4
0
null
2009-05-18 15:33:19.113 UTC
7
2021-11-09 07:48:11.683 UTC
2014-03-27 15:35:22.223 UTC
null
444,991
null
68,183
null
1
41
asp.net-mvc
76,626
<p>Matt's should work fine. If you are still passing in <code>FormMethod.Post</code>, though, you need to do it like this:</p> <pre><code>Html.BeginForm("action","controller", new { Id = 12345 }, FormMethod.Post); </code></pre> <p>Reversing the third and fourth parameters will result in the <code>Id</code> being tre...
1,003,358
SQLite problem selecting two columns as one
<p>Basic table with empname and empdpt.<br> In a Sql Server table, I can do <code>Select empname + ' ' + empdpt as expr1</code> no problem.<br> Can't do the same using Sqlite!!<br> When I try to combine two columns [with data], I get back a 0.<br> I've tried in sqliteman and sqliteadmin as well as Server Explorer i...
1,003,385
4
0
null
2009-06-16 19:00:55.493 UTC
10
2020-02-20 13:35:18.783 UTC
null
null
null
name
null
null
1
42
sqlite
31,040
<p>Try using the following:</p> <pre><code>SELECT ("test" || " " || "test2") AS expr1 ; </code></pre> <p><strong>Update</strong></p> <p>If these are columns you can do something similar: SELECT (column1 || " " || column2) AS expr1 FROM your_table;</p>
998,979
Difference between -%> and %> in rails
<p>I have started some rails tutorials and noticed that some of the view code blocks are like </p> <pre><code>&lt;h1&gt;&lt;%= @subject.name -%&gt;&lt;/h1&gt; </code></pre> <p>and other code blocks are like</p> <pre><code>&lt;h1&gt;&lt;%= @subject.name %&gt;&lt;/h1&gt; </code></pre> <p>What is the difference betwee...
999,003
4
1
null
2009-06-15 23:37:44.92 UTC
13
2014-11-13 13:41:25.95 UTC
2009-08-27 14:12:28.153 UTC
null
5,836
null
5,836
null
1
57
ruby-on-rails
7,108
<p>The extra dash makes ERB not output the newline after the closing tag. There's no difference in your example, but if you have something like this:</p> <pre><code>&lt;div&gt; &lt;% if true -%&gt; Hi &lt;% end -%&gt; &lt;/div&gt; </code></pre> <p>It'll produce:</p> <pre><code>&lt;div&gt; Hi &lt;/div&gt; </c...
878,943
Why return NotImplemented instead of raising NotImplementedError
<p>Python has a singleton called <a href="https://docs.python.org/2/library/constants.html#NotImplemented" rel="noreferrer"><code>NotImplemented</code></a>. </p> <p>Why would someone want to ever return <code>NotImplemented</code> instead of raising the <a href="https://docs.python.org/2/library/exceptions.html#excep...
879,005
4
0
null
2009-05-18 17:43:40.817 UTC
67
2020-08-27 06:08:12.783 UTC
2017-06-15 20:23:24.127 UTC
null
515,189
null
573
null
1
383
python|exception
82,427
<p>It's because <code>__lt__()</code> and related comparison methods are quite commonly used indirectly in list sorts and such. Sometimes the algorithm will choose to try another way or pick a default winner. Raising an exception would break out of the sort unless caught, whereas <code>NotImplemented</code> doesn't get...
710,275
How to add/update an attribute to an HTML element using JavaScript?
<p>I'm trying to find a way that will add / update attribute using JavaScript. I know I can do it with <code>setAttribute()</code> function but that doesn't work in IE.</p>
710,347
4
0
null
2009-04-02 15:39:08.127 UTC
21
2017-07-07 09:26:39.967 UTC
2015-02-01 16:43:30.083 UTC
null
3,204,551
dev.e.loper
37,759
null
1
131
javascript|html|cross-browser
327,946
<p>You can read <a href="http://www.quirksmode.org/dom/w3c_core.html#attributes" rel="noreferrer">here</a> about the behaviour of attributes in many different browsers, including IE.</p> <p><code>element.setAttribute()</code> should do the trick, even in IE. Did you try it? If it doesn't work, then maybe <code>element...
40,025,450
Express JS: No 'Access-Control-Allow-Origin' header is present on the requested resource
<p>I have an API running on a server and a front-end client connecting to it to retrieve data. I did some research on the cross domain problem and has it working. However I've not sure what has changed. I am now getting this error in the console:</p> <blockquote> <p>XMLHttpRequest cannot load <a href="https://api.my...
40,026,625
3
1
null
2016-10-13 15:42:16.48 UTC
10
2018-06-19 10:56:09.967 UTC
null
null
null
null
2,865,923
null
1
22
javascript|ajax|node.js|express|cors
52,880
<p>Instead of setting the request headers to your express route, Can you try setting it to express instance itself like this,</p> <pre><code>var express = require('express'); var app = express(); var Assessment = require('../app/models/assessment'); app.use(function(req, res, next) { res.header("Access-Control-Allo...
23,642,950
How to reload/refresh model from database in Laravel?
<p>In some of my tests, I have a user model I have created and I run some methods that need to save certain attributes. In rails, I would typically call something like <code>user.reload</code> which would repopulate the attributes from the database.</p> <p>Is there a way in laravel to do that? I read through the api a...
23,643,081
5
1
null
2014-05-13 22:55:24.753 UTC
12
2021-02-22 17:50:30.257 UTC
2019-09-01 01:28:40.283 UTC
null
4,233,593
null
1,672,400
null
1
69
php|laravel|unit-testing|laravel-4|eloquent
93,213
<p>I can't see it either. Looks like you'll have to:</p> <pre><code>$model = $model-&gt;find($model-&gt;id); </code></pre> <p>You can also create one yourself:</p> <pre><code>public function reload() { $instance = new static; $instance = $instance-&gt;newQuery()-&gt;find($this-&gt;{$this-&gt;primaryKey}); ...
23,648,458
Call angularjs function using jquery/javascript
<p>I am trying to call angular function using javascript/jQuery, following are the link I found</p> <ul> <li><a href="https://stackoverflow.com/questions/18758997/call-angular-function-with-jquery">Call Angular Function with Jquery</a></li> <li><a href="https://stackoverflow.com/questions/16709373/angularjs-how-to-cal...
23,648,641
7
1
null
2014-05-14 07:41:39.553 UTC
18
2020-12-09 20:43:35.67 UTC
2017-05-23 12:18:01.347 UTC
null
-1
null
1,690,588
null
1
47
javascript|jquery|angularjs
112,071
<p><em>Solution provide in the questions which you linked is correct.</em> Problem with your implementation is that You have not specified the <strong>ID</strong> of element correctly. </p> <p>Secondly you need to use <code>load</code> event to execute your code. Currently DOM is not loaded hence element is not found ...
23,605,967
Photo capture on Windows Store App for Windows Phone
<p>Well, my question is simple:<br> How do I capture pictures with a <code>Windows Store App</code> for <code>Windows Phone 8.1</code>, using the camera?<br> The samples on MSDN use <code>Windows.Media.Capture.CameraCaptureUI</code>, which is not usable on Windows Phone, or are for <code>Silverlight</code>.<br> I can't...
23,606,620
3
2
null
2014-05-12 09:55:25.55 UTC
18
2016-04-26 18:29:09.133 UTC
2014-05-12 10:51:31.42 UTC
null
2,681,948
null
3,627,550
null
1
18
c#|windows|xaml|windows-phone-8.1|win-universal-app
13,367
<p>In WP8.1 Runtime (also in Silverlight) you can use <a href="http://msdn.microsoft.com/en-us/library/windows/apps/xaml/windows.media.capture.mediacapture.aspx" rel="noreferrer">MediaCapture</a>. In short:</p> <pre><code>// First you will need to initialize MediaCapture Windows.Media.Capture.MediaCapture takePhotoMa...
38,251,763
Moment.js - How to convert date string into date?
<p>Following up from my previous post: <a href="https://stackoverflow.com/questions/38154441/javascript-safari-new-date-with-strings-returns-invalid-date-when-typed">Javascript Safari: new Date() with strings returns invalid date when typed</a></p> <p>I am using <strong>Moment.js</strong> to convert a date string into...
38,251,825
3
0
null
2016-07-07 17:29:57.98 UTC
11
2020-12-08 11:30:05.103 UTC
2020-06-06 19:38:57.447 UTC
null
13,176,517
null
1,832,405
null
1
38
javascript|date|momentjs
159,135
<p>If you are getting a JS based date <code>String</code> then first use the <code>new Date(String)</code> constructor and then pass the <code>Date</code> object to the <code>moment</code> method. Like:</p> <pre><code>var dateString = 'Thu Jul 15 2016 19:31:44 GMT+0200 (CEST)'; var dateObj = new Date(dateString); var ...
47,392,758
Improving the performance of pandas groupby
<p>I have a machine learning application written in Python which includes a data processing step. When I wrote it, I initially did the data processing on Pandas DataFrames, but when this lead to abysmal performance I eventually rewrote it using vanilla Python, with for loops instead of vectorized operations and lists a...
47,482,207
1
0
null
2017-11-20 13:05:26.23 UTC
15
2019-07-30 04:02:15.963 UTC
2018-12-18 15:05:08.49 UTC
null
4,909,087
null
1,004,065
null
1
37
python|pandas
17,797
<p>No, I don't think you should give up on pandas. There's definitely better ways to do what you're trying to. The trick is to avoid <code>apply</code>/<code>transform</code> in any form as much as possible. Avoid them like the plague. They're basically implemented as for loops, so you might as well directly use python...
55,329,996
How to create color shades using CSS variables similar to darken() of Sass?
<p>I'm looking a way of modifying a CSS variable as you would in SCSS</p> <p>Define a color like primary - and automatically I would get shades for focus and actives states. Basically, would like to change one variable in css variables and get 3 shades of the same color.</p> <p>What Id like to achieve in CSS </p> <...
55,330,103
4
0
null
2019-03-25 00:44:50.213 UTC
5
2022-09-09 10:05:30.087 UTC
2022-04-20 13:41:37.74 UTC
null
8,620,333
null
4,634,990
null
1
37
css|sass|css-variables
39,062
<p>The new <a href="https://www.w3.org/TR/css-color-5/#relative-colors" rel="noreferrer">Specification</a> introduces &quot;relative color syntax&quot; where you can do the following</p> <pre><code>:root { --color-primary: #f00; /* any format you want here */ --color-primary-darker: hsl(from var(--color-primary...
25,697,780
SQL CASE WHEN or IF ELSE IF
<p>I have multiple conditions to meet in a case I would like to Know if I can use > &lt; instead of defining every case</p> <p>In this case when the credit rating is smaller then 3 then, the word "NO TRADE" will be inserted and larger then 3, smaller then 5 would be "POOR", and so on and so on</p> <pre><code>SELECT ...
25,697,806
1
1
null
2014-09-06 07:04:55.8 UTC
null
2019-10-07 15:03:20.943 UTC
null
null
null
null
4,013,983
null
1
9
sql
38,107
<p>Sure it is possible.</p> <pre><code>CASE WHEN CreditRating &lt;= 2 THEN 'NO TRADE' WHEN CreditRating &lt;= 4 THEN 'POOR' WHEN CreditRating &lt;= 6 THEN 'AVARAGE' WHEN CreditRating = 7 THEN 'GOOD' ELSE 'PERFECT' END AS RATING </code></pre>
20,753,550
ENOENT, no such file or directory
<p>I'm getting this error from my node app:</p> <pre><code>ENOENT, no such file or directory '~/Desktop/MyApp/newversion/partials/navigation.jade' </code></pre> <p>I know the file is there because when I try to open the file using the exact copied and pasted path, it works. I also know the application is using the ri...
20,753,566
16
1
null
2013-12-24 01:16:04.25 UTC
20
2022-08-23 13:35:41.463 UTC
null
null
null
null
1,236,793
null
1
78
node.js|express
326,618
<p>Tilde expansion is a shell thing. Write the proper pathname (probably <code>/home/</code>yourusername<code>/Desktop/etcetcetc</code>) or use<br> <code>process.env.HOME + '/Desktop/blahblahblah'</code></p>
4,532,955
What is the advantages of using binding attribute in JSF?
<p>See the following code:</p> <pre><code>&lt;h:inputText id="name" value="#{jsfBean.name}" binding="#{jsfBean.htmlInputText}"/&gt; </code></pre> <p>In the above example we are using the binding attribute to link with the server side bean property. I want to know what is the difference in using this attribute and not...
4,532,971
1
0
null
2010-12-26 06:16:28.78 UTC
10
2010-12-26 06:26:54.637 UTC
null
null
null
null
421,753
null
1
15
jsf
32,252
<p>With binding attribute you are mapping the <strong>actual component and NOT the component's value</strong>. For e.g the property in backing bean for your sample looks like below</p> <pre><code>UIInput htmlInputText= null; ... public void setHtmlInputText(UIInput userNoComponent) { this.userNoComponent = userNoCom...
4,113,299
Ruby on Rails Server options
<p>The whole issue of setting up a development server for my Ruby on Rails application confuses me. There are WEBrick, Mongrel, Passenger, Apache, Nginx and many more I am sure, and I don't really understand the different roles they play.</p> <p>I started off using WEBrick, and now I use Mongrel for development. Are t...
4,113,570
1
3
null
2010-11-06 13:37:52.453 UTC
540
2016-09-19 10:39:38.873 UTC
2016-09-19 10:39:38.873 UTC
null
1,524,624
null
341,878
null
1
594
ruby-on-rails|apache|passenger|mongrel
94,950
<p>The word "deployment" can have two meanings depending on the context. You are also confusing the roles of Apache/Nginx with the roles of other components.</p> <p>Historic note: This article was originally written on November 6, 2010, when the Ruby app server ecosystem was limited. I've updated this article on March...
4,170,978
(![]+[])[+[]]... Explain why this works
<pre class="lang-js prettyprint-override"><code>alert((![]+[])[+[]]+(![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]); </code></pre> <p>The output of this code is: <code>fail</code>. Why?</p>
4,171,028
1
14
null
2010-11-13 04:29:53.717 UTC
66
2021-07-31 22:50:06.247 UTC
2021-07-31 22:50:06.247 UTC
user16442705
null
null
385,335
null
1
123
javascript
14,904
<p>As @Mauricio commented <code>(![]+[])[+[]]</code> is "f" (the first char of "false"), <code>(![]+[])[+!+[]])</code> is "a", etc...</p> <p>How does it work?</p> <p>Let's examine the first character, 'f':</p> <pre><code>(![]+[])[+[]]; // 'f' </code></pre> <p>The first part of the expression—between parentheses—is ...
31,350,957
FBSOpenApplicationErrorDomain error 1
<p>I'm trying to run my iOS app that was migrated from <code>Swift 1.2</code> to <code>Swift 2.0</code> in Xcode 7 using iPhone Simulator (any), I'm getting the following error:</p> <blockquote> <p>The operation couldn’t be completed. (FBSOpenApplicationErrorDomain error 1.)</p> </blockquote> <p>I already tried t...
32,896,457
16
8
null
2015-07-10 21:58:24.313 UTC
13
2021-11-08 18:52:39.567 UTC
2015-07-10 22:21:05.577 UTC
null
1,109,795
null
1,109,795
null
1
53
ios|xcode|ios-simulator|swift2|xcode7
23,514
<p>I had the same error after updating Xcode to v7.0. After few hours struggling, I found that there was some empty environment variable setup to be passed for Run action in my active scheme (have no idea why it was there). Removing this empty environment variable resolved the issue immediately.</p>
6,652,547
How to make a double gradient with XML (iphone like)
<p>How can I make this kind of drawable gradient with XML? </p> <p><img src="https://i.stack.imgur.com/FrgFC.png" alt="Double gradient image"></p> <p>I can do a simple gradient from color A to color B but i don't know how to combine two gradients in the same drawable.</p>
14,018,579
2
2
null
2011-07-11 15:27:36.083 UTC
12
2015-06-29 11:55:34.097 UTC
2015-06-29 11:55:34.097 UTC
null
165,071
null
393,984
null
1
14
android|gradient
15,032
<p>I finally found a solution with a layer-list which is good enough for me : </p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;layer-list xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;!-- First part is a gradient --&gt; &lt;item android:left="0dp" android:right="0dp"&gt; ...
6,515,333
How do I execute a single test using Ruby test/unit?
<p>Instead of running all the test cases automatically, is there any way to execute a single test under ruby test/unit framework. I know I can achieve that by using Rake but I am not ready to switch to rake at this moment. </p> <pre><code>ruby unit_test.rb #this will run all the test case ruby unit_test.rb test1 #thi...
6,515,354
2
0
null
2011-06-29 03:04:47.4 UTC
4
2011-10-11 21:16:15.773 UTC
2011-06-29 12:33:03.233 UTC
null
38,765
null
115,722
null
1
35
ruby|unit-testing|testing|testunit
20,507
<p>you can pass the -n option on the command line to run a single test:</p> <pre><code>ruby my_test.rb -n test_my_method </code></pre> <p>where 'test_my_method' is the name of the test method you would like to run.</p>
7,593,231
How to select default button in wpf dialog?
<p>I am creating a WPF dialog. It is like our normal <code>messagebox</code> with <code>ok</code> and <code>cancel</code> button. How to create such a dialog so that the <code>Ok</code> button is selected when the dialog is opened?</p>
7,593,246
3
2
null
2011-09-29 06:16:02.447 UTC
null
2021-03-23 14:32:59.38 UTC
2013-02-21 22:00:51.853 UTC
null
723,693
null
952,518
null
1
42
c#|wpf|dialog
36,417
<p><strong>To set a Window's Default button</strong></p> <p>Set your default button's <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.button.isdefault.aspx" rel="noreferrer">IsDefault property</a> to true.</p> <p>Note that you can also set a Window's Cancel button by setting a button's <a hre...
7,237,271
Large scale data processing Hbase vs Cassandra
<p>I am nearly landed at Cassandra after my research on large scale data storage solutions. But its generally said that Hbase is better solution for large scale data processing and analysis. </p> <p>While both are same key/value storage and both are/can run (Cassandra recently) Hadoop layer then what makes Hadoop a be...
7,251,868
3
0
null
2011-08-29 23:46:12.31 UTC
53
2011-09-06 06:46:58.187 UTC
2011-09-01 15:28:20.853 UTC
null
130,168
null
848,927
null
1
85
nosql|hadoop|cassandra|hbase|data-processing
37,042
<p>Trying to determine which is best for you really depends on what you are going to use it for, they each have their advantages and without any more details it becomes more of a religious war. That post you referenced is also more than a year old and both have gone through many changes since then. Please also keep in ...
7,451,524
Why aren't ◎ܫ◎ and ☺ valid JavaScript variable names?
<p>I noticed that in Internet Explorer (but, unfortunately, not in the other browsers I tested), you can use some Unicode variable names. This made my day, and I was absolutely delighted that I could write fun Unicode-laden code like this:</p> <pre><code>var ктоείναι草泥马 = "You dirty horse.", happy☺n☺mat☺p☺eia = ":...
7,451,569
4
7
null
2011-09-17 00:05:07.273 UTC
151
2020-04-09 19:14:02.087 UTC
2018-03-21 02:01:54.077 UTC
null
546,661
null
546,661
null
1
743
javascript|naming-conventions|invalid-characters
50,734
<p>ಠ_ಠ and 草泥马 only contain "letters" used in actual alphabets; that is, ಠ is a symbol from the <a href="http://en.wikipedia.org/wiki/Kannada_alphabet">Kannada alphabet</a>, and 草泥马 consists of Chinese characters.</p> <p>◎ and ☺, however, are purely symbols; they are not associated with any alphabet.</p> <p>The <a hr...
1,947,290
Excel formula - auto sum for the same types
<p>I need a quick an simple excel formula to get the sum of values for different types of objects as listed below:</p> <pre><code>Type1 10 Type1 10 Type1 10 Type2 10 Type2 10 Type2 10 Type2 10 Type3 10 Type3 10 </code></pre> <p>Number of items and number of types are unknown (long list), in a differ...
1,947,391
4
1
null
2009-12-22 15:59:54.333 UTC
2
2017-02-08 21:10:04.62 UTC
null
null
null
null
154,522
null
1
11
excel
43,683
<p>I think <a href="http://www.techonthenet.com/excel/formulas/sumif.php" rel="noreferrer">sumif</a> is what you are looking for</p>
10,784,132
Django - No module named _sqlite3
<p>I have django 1.4 installed on my rhel 5. By default rhel 5 has python 2.4 in it but to use django 1.4 I manually installed python 2.7.3 The development server is running fine but when I create a new project and after changing the settings.py file as :</p> <p>'ENGINE': 'django.db.backends.sqlite3', 'NAME': '/home/o...
10,796,995
9
2
null
2012-05-28 11:43:41.907 UTC
3
2020-03-11 08:11:29.01 UTC
2020-03-11 08:11:29.01 UTC
null
6,573,902
null
1,421,567
null
1
21
django|python-2.7|sqlite|django-models|django-admin
38,004
<p>At the <a href="https://github.com/django/django/blob/1.5/django/db/backends/sqlite3/base.py#L27" rel="nofollow">django.db.backends.sqlite3</a>, it tries to</p> <pre><code>try: try: from pysqlite2 import dbapi2 as Database except ImportError: from sqlite3 import dbapi2 as Database except Imp...
26,033,239
List of objects to JSON with Python
<p>I have a problem converting <code>Object</code> instances to JSON:</p> <pre><code>ob = Object() list_name = scaping_myObj(base_url, u, number_page) for ob in list_name: json_string = json.dumps(ob.__dict__) print json_string </code></pre> <p>In <code>list_name</code> I have a list of <code>Object</code> in...
26,033,300
3
2
null
2014-09-25 07:46:20.473 UTC
12
2019-09-19 15:25:00.28 UTC
2014-09-25 07:53:58.153 UTC
null
100,297
null
4,046,638
null
1
54
python|json|object|serialization
116,289
<p>You can use a list comprehension to produce a list of dictionaries, then convert that:</p> <pre><code>json_string = json.dumps([ob.__dict__ for ob in list_name]) </code></pre> <p>or use a <code>default</code> function; <code>json.dumps()</code> will call it for anything it cannot serialise:</p> <pre><code>def obj...
49,019,022
How to check a projects vue.js version?
<p>I use <strong>Ubuntu 16.04</strong> and I'd like to know how I check the <code>vue.js</code> <strong>version</strong> used by my project.</p> <p>How do I do that?</p>
49,020,316
9
6
null
2018-02-27 22:30:15.663 UTC
9
2022-07-15 19:39:32.157 UTC
2020-01-18 08:08:01.293 UTC
null
2,512,022
null
8,824,387
null
1
84
vue.js
156,546
<p>Let's summarize the solutions from @jonrsharpe, @JamesAMohler and @MartinCalvert for friends looking for a quick answer.</p> <ol> <li><p>Run <code>npm list vue</code> (or <code>npm list --depth=0 | grep vue</code> to exclude packages' dependencies). It is <a href="https://docs.npmjs.com/cli/ls" rel="noreferrer">a co...
7,100,243
Finding in elements in a tuple and filtering them
<p>Assuming I have a tuple like:</p> <pre><code>[('text-1','xxx'), ('img-1','iii'), ('img-2','jjj'), ('text-2','xxx')] </code></pre> <p>I want to filter out the list and produce a new one with elements that begin with 'img'. So my new list will look like:</p> <pre><code>[('img-1','iii'), ('img-2','jjj')] </code></pr...
7,100,256
5
0
null
2011-08-17 22:20:36.79 UTC
4
2021-02-02 13:30:42.22 UTC
2015-06-16 16:24:53.267 UTC
null
4,852,410
null
614,954
null
1
21
python
51,223
<p>One way:</p> <pre><code>&gt;&gt;&gt; l = [('text-1','xxx'), ('img-1','iii'), ('img-2','jjj'), ('text-2','xxx')] &gt;&gt;&gt; [t for t in l if t[0].startswith('img')] [('img-1', 'iii'), ('img-2', 'jjj')] </code></pre> <p>Another way:</p> <pre><code>&gt;&gt;&gt; filter(lambda x: x[0].startswith('img'), l) [('img-1'...
7,206,442
Printing all possible subsets of a list
<p>I have a List of elements (1, 2, 3), and I need to get the superset (powerset) of that list (without repeating elements). So basically I need to create a List of Lists that looks like:</p> <pre><code>{1} {2} {3} {1, 2} {1, 3} {2, 3} {1, 2, 3} </code></pre> <p>What is the best (simplicity > efficiency in this case,...
7,206,478
7
4
null
2011-08-26 14:44:04.793 UTC
9
2020-12-21 16:00:34.73 UTC
2011-08-27 01:26:02.533 UTC
null
312,172
null
835,523
null
1
9
java|algorithm|powerset|superset
12,887
<p>Use bitmasks:</p> <pre><code>int allMasks = (1 &lt;&lt; N); for (int i = 1; i &lt; allMasks; i++) { for (int j = 0; j &lt; N; j++) if ((i &amp; (1 &lt;&lt; j)) &gt; 0) //The j-th element is used System.out.print((j + 1) + " "); System.out.println(); } </code></pre> <p>Here are all bitma...
7,068,919
Devise limit one session per user at a time
<p>My app is using Rails 3.0.4 and Devise 1.1.7.</p> <p>I'm looking for a way to prevent users from sharing accounts as the app is a subscription based service. I've been searching for over a week, and I still don't know how to implement a solution. I'm hoping someone has implemented a solution and can point me in t...
7,069,053
7
1
null
2011-08-15 18:23:17.117 UTC
33
2019-01-15 08:54:14.553 UTC
2011-08-16 21:26:19.06 UTC
null
564,761
null
564,761
null
1
54
ruby-on-rails|ruby-on-rails-3|session|devise
24,000
<p>You can't do it.</p> <ul> <li>You can control IP addresses of user, so you can prevent presence of user from two IP at a time. ANd you can bind login and IP. You can try to check cities and other geolocation data through IP to block user.</li> <li>You can set cookies to control something else.</li> </ul> <p>But no...
7,405,740
How can I initialize base class member variables in derived class constructor?
<p>Why can't I do this?</p> <pre><code>class A { public: int a, b; }; class B : public A { B() : A(), a(0), b(0) { } }; </code></pre>
7,405,776
7
3
null
2011-09-13 17:09:51.557 UTC
37
2020-06-04 18:22:30.23 UTC
2018-03-24 06:15:33.22 UTC
null
3,980,929
null
170,120
null
1
160
c++|inheritance
186,437
<p>You can't initialize <code>a</code> and <code>b</code> in <code>B</code> because they are not members of <code>B</code>. They are members of <code>A</code>, therefore only <code>A</code> can initialize them. You can make them public, then do assignment in <code>B</code>, but that is not a recommended option since it...
7,692,161
What is "pom" packaging in maven?
<p>I was given a maven project to compile and get deployed on a tomcat server. I have never used maven before today, but I have been googling quite a bit. It seems like the top level <code>pom.xml</code> files in this project have the packaging type set as <code>pom</code>.</p> <p>What am I supposed to do after <code>...
7,692,214
10
1
null
2011-10-07 19:45:38.4 UTC
49
2021-01-22 14:26:16.193 UTC
2017-11-07 06:25:48.54 UTC
null
5,105,305
null
229,072
null
1
203
java|tomcat|maven
166,085
<p><code>pom</code> is basically a container of submodules, each submodule is represented by a subdirectory in the same directory as <code>pom.xml</code> with <code>pom</code> packaging.</p> <p>Somewhere, nested within the project structure you will find artifacts (modules) with <code>war</code> packaging. Maven gener...
14,084,406
TypeScript and Socket.io
<p>I would like to use socket.io in my Typescript project, but I've only found .d.ts files for server-side typescript.</p> <p>This is a nice example: <a href="https://github.com/soywiz/typescript-node-definitions/blob/master/socket.io.d.ts" rel="noreferrer">https://github.com/soywiz/typescript-node-definitions/blob/ma...
42,222,758
4
0
null
2012-12-29 17:55:42.263 UTC
6
2020-07-15 16:36:14.137 UTC
2014-03-30 19:23:02.227 UTC
null
24,874
null
497,600
null
1
11
javascript|node.js|web|socket.io|typescript
42,859
<p>There is @types/socket.io now, just install it by running:</p> <p><code>npm i --save @types/socket.io</code></p>
13,949,422
jquery html 5 dragstart .on('dragstart',function(e){}) e.dataTransfer.setData() doesn't work
<p>chrome throw err: Cannot call method 'setData' of undefined, I find the e is not equal to window.event(it havn't propert dataTransfer);both has very big different</p> <p>I find both almost equal in the click event.</p> <p>I used <a href="http://code.jquery.com/jquery-latest.js" rel="noreferrer">http://code.jque...
13,950,239
2
1
null
2012-12-19 09:41:00.343 UTC
4
2013-04-22 18:28:14.743 UTC
2012-12-19 09:53:47.883 UTC
null
1,621,519
null
1,621,519
null
1
30
javascript|jquery|html|drag
40,498
<p>In the callback function you get a jQuery wrapper over a native event. Use the <code>originalEvent</code> property of passed argument:</p> <pre><code>$('...').on('dragstart', function (event) { event.originalEvent.dataTransfer.setData('...', '...'); }); </code></pre> <p>P.S. dont' forget to set the <code>dragg...
13,911,468
How do I open the Bluetooth Settings Activity programmatically?
<p>I want to open bluetooth settings on button click like this see image<img src="https://i.stack.imgur.com/PHlob.png" alt="bluetooth image"></p> <p><strong>HomeActivity.java</strong></p> <pre><code>button.setOnClickListener(new OnClickListener() { public void onClick(View v) { final Int...
13,911,556
6
1
null
2012-12-17 09:31:17.963 UTC
3
2022-07-01 07:04:55.823 UTC
2015-06-09 07:50:20.393 UTC
null
304,151
null
1,391,158
null
1
37
android|android-intent|settings
42,975
<p>use</p> <pre><code>ComponentName cn = new ComponentName("com.android.settings", "com.android.settings.bluetooth.BluetoothSettings"); </code></pre> <p>instead of</p> <pre><code>final ComponentName cn = new ComponentName("com.android.settings", "com.android.setting...
9,229,849
Sencha Touch 2.0 MVC tutorial
<p>I am very new to Sencha Touch framework, want to start with Sencha Touch 2.0 but not able to find any tutorial showing an application built using MVC Pattern and specifically in Sencha Touch version 2.0.</p>
9,230,004
3
1
null
2012-02-10 15:08:37 UTC
16
2017-10-22 09:53:05.323 UTC
2017-10-22 09:53:05.323 UTC
null
472,495
null
277,696
null
1
13
sencha-touch|sencha-touch-2
25,503
<p>Here are two videos from the sencha 2011 conference:</p> <p>SenchaCon 2011: MVC in Depth Part 1 <a href="https://vimeo.com/33311074" rel="noreferrer">https://vimeo.com/33311074</a></p> <p>and</p> <p>SenchaCon 2011: MVC in Depth Part 2 <a href="https://vimeo.com/33430731" rel="noreferrer">https://vimeo.com/3343073...
9,232,132
Use of JMX and How to use for existing applications
<p>We have distributed web application developed few years back on JDK 5.</p> <blockquote> <p>How JMX will help this application?</p> </blockquote> <p>1) Will it help me to monitor performance (Memory, CPU and Network &amp; Disk IO)? </p> <p>2) If so then application is deployed in multiple servers,how can I mon...
9,235,042
1
1
null
2012-02-10 17:32:33.48 UTC
9
2016-10-20 17:55:16.033 UTC
2012-02-10 18:49:20.633 UTC
null
327,813
null
327,813
null
1
16
java|jmx|jconsole|performance
11,258
<p>JMX is a standardized way of getting information out of a running system and to invoke operations on it. The JVM gives you a set of MBeans through which you can access runtime data like memory consumption, GC stats and some more data. You can also invoke a number of operations. Your app server will also give you a n...
9,211,208
How to draw border on just one side of a linear layout?
<p>I'm able to draw border to a linear layout, but it is getting drawn on all sides. I want to restrict it to right side only, like you do in CSS (border-right:1px solid red;).</p> <p>I've tried this, but it still draws on all sides:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;layer-list xmlns:and...
9,212,584
11
1
null
2012-02-09 12:54:58.34 UTC
76
2022-01-31 13:16:16.663 UTC
2013-10-22 06:41:55.827 UTC
null
918,472
null
967,062
null
1
213
android
207,436
<p>You can use this to get border on one side</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;layer-list xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;item&gt; &lt;shape android:shape="rectangle"&gt; &lt;solid android:color="#FF0000" /&gt; &lt;/shape&gt; &lt;/item&g...
44,667,242
Python Asyncio in Django View
<p>I would like to make two POST requests from an API on a Django view at the same time.</p> <p>This is how I would do it outside of django.</p> <pre><code>import asyncio import speech_recognition as sr async def main(language1, language2): loop = asyncio.get_event_loop() r = sr.Recognizer() with sr.Audi...
44,683,173
4
3
null
2017-06-21 05:08:23.39 UTC
10
2021-12-13 15:35:18.803 UTC
2017-06-21 18:03:10.083 UTC
null
4,135,058
null
4,135,058
null
1
19
python|django
19,264
<p>Solution was to nest the function inside another one.</p> <pre><code>def djangoview(request, language1, language2): async def main(language1, language2): loop = asyncio.get_event_loop() r = sr.Recognizer() with sr.AudioFile(path.join(os.getcwd(), "audio.wav")) as source: audi...
32,695,991
How to get Last digit of number
<p>How to extract last(end) digit of the Number value using jquery. because i have to check the last digit of number is 0 or 5. so how to get last digit after decimal point</p> <p>For Ex. <code>var test = 2354.55</code> Now how to get 5 from this numeric value using jquery. i tried <strong>substr</strong> but that is...
32,696,112
8
3
null
2015-09-21 13:04:10.89 UTC
6
2021-03-14 12:59:44.793 UTC
null
null
null
null
4,349,267
null
1
37
javascript|jquery
104,624
<p>Try this one:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="true"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>var test = 2354.55; var lastone = +test.toString().split('').pop(); console.log("lastone--&gt;", lastone, "&lt...
32,665,958
Xcode updating is extremely slow
<p>After updating my gadgets with iOS 9 I've tried to update Xcode to Xcode 7 on my Mac through the App Store, but updating is too slow while speedtest.net shows that my download speed is about 30 mbps. What to do?</p>
32,666,283
6
4
null
2015-09-19 08:19:43.95 UTC
6
2019-08-23 01:51:39.86 UTC
2019-05-12 09:46:33.48 UTC
null
1,033,581
null
4,697,508
null
1
39
xcode|app-store|xcode7
44,537
<p>You can always download the <code>dmg</code> for new or earlier versions of <code>Xcode</code> (or any other developer tool for that matter) from <a href="https://developer.apple.com/downloads/">this link</a> provided by Apple for iOS and Mac developers.</p>
32,717,251
How to set project.version by passing version property on gradle command line?
<p>I want to build JAR with self-defined version passed via command line, such as:</p> <p>When I execute gradle build task like this:</p> <pre><code>gradle build -Pversion=1.0 </code></pre> <p>myproject-1.0.jar should be generated. </p> <p>I have tried adding the line below to the <strong><em>build.gradle</em></str...
32,718,189
7
5
null
2015-09-22 12:44:57.873 UTC
20
2021-07-18 02:15:32.75 UTC
null
null
null
null
317,429
null
1
62
java|groovy|gradle
96,549
<p>You are not able to override existing project properties from command line, take a look <a href="https://discuss.gradle.org/t/project-property-command-line-overrides-broken/2330">here</a>. So try to rename a version variable to something differing from version and set it with <code>-P</code> flag before command, lik...
45,789,325
Update some specific field of an entity in android Room
<p>I am using android room persistence library for my new project. I want to update some field of table. I have tried like in my <code>Dao</code> -</p> <pre><code>// Method 1: @Dao public interface TourDao { @Update int updateTour(Tour tour); } </code></pre> <p>But when I try to update using this method the...
45,796,463
9
4
null
2017-08-21 04:29:01.613 UTC
43
2022-02-04 23:59:44.13 UTC
2018-10-24 18:20:18.74 UTC
null
1,687,469
null
3,926,727
null
1
191
android|sql-update|android-room
187,898
<blockquote> <p>I want to know how can I update some field(not all) like method 1 where id = 1</p> </blockquote> <p>Use <code>@Query</code>, as you did in Method 2.</p> <blockquote> <p>is too long query in my case because I have many field in my entity</p> </blockquote> <p>Then have smaller entities. Or, do not update ...
19,495,610
Error executing command 'ant' on Mac OS X 10.9 Mavericks when building for Android with PhoneGap/Cordova
<p>Today I tried PhoneGap/Cordova with <strong>Mac OS X Mavericks</strong>. Building for iOS went just fine, but building for Android wasn't without some guesswork.</p> <p>I installed Android 4.2.2 via the Android SDK Manager (I had to use the older <strong>API v17</strong> since it wasn't compatible with a newer one)...
19,495,611
7
2
null
2013-10-21 13:16:38.463 UTC
32
2014-11-04 11:19:03.673 UTC
2014-11-04 11:19:03.673 UTC
null
3,622,940
null
1,265,240
null
1
139
android|cordova|ant|osx-mavericks
101,519
<p>The error message proved to be true as Apache Ant isn't in the path of Mac OS X Mavericks anymore.</p> <p>Bulletproof solution:</p> <ol> <li><p>Download and install Homebrew by executing following command in terminal:</p> <blockquote> <p>ruby -e "$(curl -fsSL <a href="https://raw.githubusercontent.com/Homebrew/...
19,616,629
CSS Inherit for unknown Background Color is Actually Transparent
<p>I am creating a tab-like functionality with <code>&lt;ul&gt;</code> and <code>&lt;li&gt;</code> elements, and I noticed this kind-of unexpected behavior with CSS <code>background-color: inherit</code>.<br> One would expect that <code>inherit</code> wouldn't actually mean <code>transparent</code>, but rather <code>ch...
19,616,684
2
2
null
2013-10-27 09:40:37.373 UTC
4
2020-12-19 03:19:12.237 UTC
null
null
null
null
1,554,215
null
1
29
html|css|tabs|background-color
61,944
<p>Setting <code>background-color: inherit</code> <strong>does</strong> cause it to take the background colour of the parent element. </p> <p>The reason it is taking <code>transparent</code> is because the background colour of the parent (the <code>li</code>) <strong>is</strong> <code>transparent</code> (the default v...
34,312,252
"exclude" property of tsconfig.json is not being respected
<p>I am working with the excellent Express/Node/Typescript example code found <a href="https://github.com/czechboy0/Express-4x-Typescript-Sample" rel="noreferrer" title="here">here</a>. It transpiles the .ts code with the following command from run.sh:</p> <p><code>./node_modules/.bin/tsc --sourcemap --module commonjs...
34,312,696
9
3
null
2015-12-16 12:36:14.917 UTC
4
2022-03-01 10:02:22.303 UTC
2015-12-16 12:47:30.927 UTC
null
2,760,795
null
2,760,795
null
1
41
node.js|typescript|tsd
40,303
<p>I did:</p> <pre><code>git clone https://github.com/czechboy0/Express-4x-Typescript-Sample.git cd Express-4x-Typescript-Sample/ ./run.sh tsd install # I don't know why, but this helped me. ./run.sh </code></pre> <p>I created <code>Express-4x-Typescript-Sample/tsconfig.json</code> file with content</p> <pre><code>...
34,092,346
Remove key from a Json inside a JsonObject
<p>I have JsonObject like below</p> <pre><code>{"status":"ACTIVE","accounts":{"email":"email@gmail.com","name":"Test"}} </code></pre> <p>How can I remove Json key "email" and its value from the JsonObject by using something like <code>jsonObj.remove("email")</code> in java</p> <p>JsonObj.removev working for me if I ...
34,093,558
4
4
null
2015-12-04 15:59:26.41 UTC
9
2022-09-07 12:05:25.73 UTC
2015-12-04 16:49:44.183 UTC
null
2,604,853
null
2,604,853
null
1
30
java|json
115,608
<p>If Gson is like Jackson (I assume so) you'll have to first get the <code>JsonObject</code> "accounts" from the root object and then remove the member "email", e.g. like this:</p> <pre><code>jsonObj.getAsJsonObject("accounts").remove("email"); </code></pre> <p>Alternatively - and probably the preferred way - you wo...
24,792,638
How can I import data from ASCII (ISO/IEC 8859-1) to my Rails/PGSQL database?
<p>I am trying to use data from the USDA found here: <a href="http://www.ars.usda.gov/Services/docs.htm?docid=23634" rel="noreferrer">http://www.ars.usda.gov/Services/docs.htm?docid=23634</a></p> <blockquote> <p>ASCII (8.6Mb) - This file contains the SR26 data in ASCII (ISO/IEC 8859-1), delimited files. These tables...
24,793,469
3
2
null
2014-07-16 23:41:37.29 UTC
9
2018-04-08 15:23:14.303 UTC
2014-07-17 01:24:32.27 UTC
null
398,670
null
2,842,709
null
1
14
mysql|ruby-on-rails|postgresql|ruby-on-rails-4|import
2,754
<p>The zip contains a number of files:</p> <pre><code> inflating: DATA_SRC.txt inflating: DATSRCLN.txt inflating: DERIV_CD.txt inflating: FD_GROUP.txt inflating: FOOD_DES.txt inflating: FOOTNOTE.txt inflating: LANGDESC.txt ...
201,476
Simple java client code for Web Service - something to do with QName?
<p>I am getting the following error when I get to the line that invokes a REALLY BASIC web service I have running on Tomcat/Axis.</p> <pre><code>Element or attribute do not match QName production: QName::=(NCName':')?NCName </code></pre> <p>Have I got something wrong with QName?- I can't even find any useful informat...
201,508
5
1
null
2008-10-14 14:50:10.103 UTC
1
2012-12-15 00:29:32.98 UTC
2009-03-18 09:56:28.01 UTC
Dreas Grech
44,084
Simon E
5,175
null
1
2
java|web-services|client|rpc
56,470
<p>As the exception says, you call the QName constructor incorrectly:</p> <pre><code>new QName("http://testPackage.fc.com/, doBasicStuff") </code></pre> <p>is incorrect. I think you have to pass two strings, one containing the namespace, one the localname. The documentation will typically contain a description on how...
459,677
C#, a String's Split() method
<p>C#, a String's Split() method, how can I put the resulting string[] into an ArrayList or Stack? </p>
459,680
5
0
null
2009-01-19 23:58:35.003 UTC
7
2015-08-17 06:30:29.87 UTC
2009-01-20 08:39:43.143 UTC
Ed Swangren
1,053
Steve
56,898
null
1
19
c#|arrays|collections|split|arraylist
66,574
<p>You can initialize a <code>List&lt;T&gt;</code> with an array (or any other object that implements <code>IEnumerable</code>). You should prefer the strongly typed <code>List&lt;T&gt;</code> over <code>ArrayList</code>.</p> <pre><code>var myList = new List&lt;string&gt;(myString.Split(',')); </code></pre>
993,124
Does Haskell have variables?
<p>I've frequently heard claims that Haskell doesn't have variables; in particular, <a href="https://stackoverflow.com/questions/333185/what-type-of-scope-does-haskell-use/333219#333219">this answer</a> claims that it doesn't, and it was upvoted at least nine times and accepted.</p> <p>So does it have variables or not...
993,779
5
2
null
2009-06-14 16:15:30.873 UTC
9
2019-05-08 22:05:03.897 UTC
2017-05-23 12:34:30.953 UTC
null
-1
null
107,294
null
1
35
variables|haskell|immutability|monads|referential-transparency
40,548
<p>Haskell has immutable variables (variables in the math sense) by default:</p> <pre><code> foo x y = x + y * 2 </code></pre> <p>By default variables are not <em>mutable cells</em>.</p> <p>Haskell also has mutable cells though, but you enable them explicitly:</p> <pre><code> &gt; import Data.IORef (newIORef, readI...
352,612
How to get Maven to run war:exploded but not war:war
<p>I have a Maven pom that uses <code>&lt;packaging&gt;war&lt;/packaging&gt;</code>. But actually, I don't want build the war-file, I just want all the dependent jars collected and a full deployment directory created.</p> <p>So I'm running the <code>war:exploded</code> goal to generate the deploy directory:</p> <pre...
1,530,489
5
2
null
2008-12-09 12:49:58.933 UTC
15
2016-08-24 05:27:22.293 UTC
2013-12-27 08:08:06.833 UTC
null
451,518
Adrian Pronk
41,861
null
1
60
maven-2
37,895
<p>According <a href="http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Built-in_Lifecycle_Bindings" rel="noreferrer">builtin lifecycle bindings</a> for war packaging in package phase war:war mojo is called.</p> <p>You can call previous 'prepare-package' phase - all actions will be perform...
461,901
ASP.NET Control to HTML tag equivalent
<p>I'm looking for a cheat sheet that will allow me to show an HTML designer the equivalent asp.net controls for standard HTML tags. As an example the &lt;asp:Panel> will render as an HTML &lt;div> and an &lt;asp:Label> will render as an HTML &lt;span>. I've been googling this to no avail. Can someone post a link to...
462,013
5
1
null
2009-01-20 15:59:58.917 UTC
33
2017-06-20 12:36:58.703 UTC
2009-01-20 19:05:16.25 UTC
stephenbayer
18,893
stephenbayer
18,893
null
1
63
asp.net|html|tags|servercontrols
62,314
<p>This isn't a simple question, as it depends on which version of .NEt you're talking about and states of controls sometimes. For example, the PANEL, in 1 &amp; 1.1 render to a TABLE while in later versions it's a DIV.</p> <p>But overall (for 2/3), here goes:</p> <ul> <li><p>Panel - Div</p> </li> <li><p>Panel -- Group...
814,474
JPA not saving foreign key to @OneToMany relation
<p>I'm using Spring with Hibernate as a JPA provider and are trying to get a @OneToMany (a contact having many phonenumbers) to save the foreign key in the phone numbers table. From my form i get a Contact object that have a list of Phone(numbers) in it. The Contact get persisted properly (Hibernate fetches an PK from ...
814,495
6
0
null
2009-05-02 09:09:51.763 UTC
9
2020-04-06 19:59:19.347 UTC
2018-05-04 01:58:26.197 UTC
null
771,217
null
149,374
null
1
22
java|spring|jpa
48,303
<p>You have to manage the Java relationships yourself. For this kind of thing you need something like:</p> <pre><code>@Entity public class Contact { @Id private Long id; @OneToMany(cascade = CascadeType.PERSIST, mappedBy = "contact") private List&lt;Phone&gt; phoneNumbers; public void addPhone(PhoneNumber ...
554,522
Something like inheritance in database design
<p>Suppose you were setting up a database to store crash test data of various vehicles. You want to store data of crash tests for speedboats, cars, and go-karts.</p> <p>You could create three separate tables: SpeedboatTests, CarTests, and GokartTests. But a lot of your columns are going to be the same in each table (f...
554,681
6
1
null
2009-02-16 20:55:44.813 UTC
26
2014-06-18 14:46:20.653 UTC
2014-06-18 14:46:20.653 UTC
null
1,478,085
Daniel Straight
65,393
null
1
24
database-design|polymorphic-associations|class-table-inheritance
12,897
<p>The <code>type</code> and <code>id_in_type</code> design is called <a href="http://en.wikipedia.org/wiki/Polymorphic_association" rel="noreferrer">Polymorphic Associations</a>. This design breaks rules of normalization in multiple ways. If nothing else, it should be a red flag that you <em>can't</em> declare a rea...
395,256
Transparent images with C# WinForms
<p>I am working on a Windows Forms application in VS 2008, and I want to display one image over the top of another, with the top image being a gif or something with transparent parts.</p> <p>Basically I have a big image and I want to put a little image on top if it, so that they kinda appear as one image to the user.<...
434,706
6
2
null
2008-12-27 18:30:58.093 UTC
10
2020-02-06 05:58:55.86 UTC
null
null
null
null
30,025
null
1
25
c#|.net|image|transparency|picturebox
55,686
<p>I was in a similar situation a couple of days ago. You can create a transparent control to host your image.</p> <pre><code>using System; using System.Windows.Forms; using System.Drawing; public class TransparentControl : Control { private readonly Timer refresher; private Image _image; public Transpa...
545,667
How to use Windows login for single-sign-on and for Active Directory entries for Desktop Java application?
<p>I'd like to have my desktop Java application to have single sign on related to Active Directory users. In two steps, I'd like to:</p> <ol> <li>Be sure that the particular user has logged in to Windows with some user entry.</li> <li>Check out some setup information for that user from the Active Directory</li> </ol>...
1,523,296
6
0
null
2009-02-13 11:52:08.54 UTC
11
2019-07-17 19:38:58.743 UTC
2019-07-17 19:38:58.743 UTC
Rich B
2,756,409
Touko
28,482
null
1
30
java|active-directory|single-sign-on|windows-authentication
42,595
<p>It is not supported. Java 6 has improvements, but not enough yet. </p> <p>Java has its own GSS stack. The problem is for single sign-on, you need to get the Kerberos ticket from the OS (not the Java stack). Otherwise the user has to authenticate a second time (defeating the purpose of single sign-on).</p> <p>Look...
1,019,740
Speed of calculating powers (in python)
<p>I'm curious as to why it's so much faster to multiply than to take powers in python (though from what I've read this may well be true in many other languages too). For example it's much faster to do</p> <pre><code>x*x </code></pre> <p>than</p> <pre><code>x**2 </code></pre> <p>I suppose the ** operator is more ge...
1,019,932
6
5
null
2009-06-19 19:46:44.33 UTC
3
2014-07-25 08:25:08.353 UTC
2009-06-19 20:20:02.157 UTC
null
124,780
null
124,780
null
1
41
python|algorithm|performance
40,514
<p>Basically naive multiplication is O(n) with a very low constant factor. Taking the power is O(log n) with a higher constant factor (There are special cases that need to be tested... fractional exponents, negative exponents, etc) . Edit: just to be clear, that's O(n) where n is the exponent.</p> <p>Of course the nai...
31,081,644
How to redirect back to form with input - Laravel 5
<p>How do I redirect back to my form page, with the given <code>POST</code> params, if my form action throws an exception?</p>
31,081,645
10
3
null
2015-06-26 20:29:18.747 UTC
18
2022-02-20 19:47:10.037 UTC
null
null
null
null
385,265
null
1
79
php|forms|laravel|redirect|laravel-5
159,457
<p>You can use the following:</p> <pre class="lang-php prettyprint-override"><code>return Redirect::back()-&gt;withInput(Input::all()); </code></pre> <p>If you're using <a href="http://laravel.com/docs/5.1/validation#form-request-validation" rel="noreferrer">Form Request Validation</a>, this is exactly how Laravel wi...
35,636,739
Kafka Consumer Marking the coordinator 2147483647 dead
<p>I am using Kafka Server 0.9 with consumer kafka-client version 0.9 and kafka-producer 0.8.2.</p> <p>Every thing is working great except i am getting lot of info that the coordinator is dead on the consumer</p> <pre><code>2016-02-25 19:30:45.046 INFO 10263 --- [ cdrServer] o.a.k.c.c.internals.AbstractCoordina...
37,912,724
7
2
null
2016-02-25 19:39:15.607 UTC
6
2022-04-05 21:17:44.623 UTC
2016-03-20 20:53:45.803 UTC
null
3,224,122
null
3,224,122
null
1
23
apache-kafka|kafka-consumer-api
41,198
<p>In my case the message was in logs when I try to assign partitions manually. After I've read in api docs of the new consumer follow notice: </p> <blockquote> <p>It is also possible for the consumer to manually assign specific partitions (similar to the older "simple" consumer) using assign(Collection). In this ca...
21,111,534
Why "long value" equals to null is allowed?
<p>When I was debugging a few lines of code and asking me why on earth it wasn't working I have stumbled on this situation ...</p> <pre><code>if(answer.AnswerID == null) { // do something } </code></pre> <p>When in fact it should be this way:</p> <pre><code>if(answer == null) { // do something } </code></pr...
21,111,655
3
6
null
2014-01-14 10:43:50.387 UTC
3
2014-05-16 14:53:55.48 UTC
2014-05-16 14:53:55.48 UTC
null
437,246
null
437,246
null
1
32
c#|.net
49,711
<p>As <a href="https://stackoverflow.com/questions/21111534/why-long-value-equals-to-null-is-allowed/21111655#comment31762641_21111534">@Tim</a> pointed out, you won't get an error for the following code:</p> <pre><code>long foo = 42; if (foo == null) { } </code></pre> <p>You'll get a warning instead:</p> <blockquo...
68,312,799
Android Studio: "The emulator process for AVD Pixel_2_API_30 has terminated." on MacBook Pro M1 (Apple Silicon)
<p>I have a problem to start an Android Emulator on my MacBook Pro M1 (Apple Silicon). When I try to start an emulator (API 30, CPU/ABI arm64), I get this error: &quot;The emulator process for AVD Pixel_2_API_30 has terminiated.&quot;</p> <p>I'm using 2020.3.1 Beta 5 of Android Studio.</p> <p>Does anyone know how to so...
68,313,121
13
2
null
2021-07-09 07:23:58.053 UTC
4
2022-08-30 13:30:06.51 UTC
null
null
null
null
8,358,501
null
1
38
android|android-studio|android-emulator|apple-silicon
56,371
<p>It would seem due to the fact you are using a beta version of android studio the message &quot;The emulator process for AVD Pixel_2_API_30 was killed.&quot; has been changed to &quot;The emulator process for AVD Pixel_2_API_30 has terminated.&quot; but fundamentally they should still have the same solutions the most...
2,330,157
iPhone : making UIBarButtonItem that is arrow shaped
<p>I have a UIBarButtonItem on a navigation bar. I'd like to make it arrow shaped. By that I mean I want it to be square except for a pointy side. Does anyone know how to do this?</p> <p>Thanks!</p>
2,433,896
6
0
null
2010-02-24 22:33:32.257 UTC
14
2014-03-26 19:53:53.503 UTC
null
null
null
null
2,684,342
null
1
11
iphone|xcode|uinavigationcontroller|uibarbuttonitem
33,786
<p>I wrestled with several approaches on this one and finally figured it out using all the answers from several sources. There are a couple of tricks; this snippet will show it all (I was creating a custom <code>rightNavButton</code>, but you can adapt this easily for any <code>UIBarButtonItem</code>):</p> <pre><code...
1,457,842
Is this good code? (copy constructor and assignment operator )
<p>For one reason or another, I'm forced to provide both a copy constructor and an operator= for my class. I thought I didn't need <code>operator=</code> if I defined a copy ctor, but <code>QList</code> wants one. Putting that aside, I hate code duplication, so is there anything wrong with doing it this way?</p> <pre>...
1,457,873
6
8
null
2009-09-22 02:20:33.43 UTC
9
2015-07-01 08:49:37.85 UTC
2015-07-01 08:49:37.85 UTC
null
1,122,645
null
65,387
null
1
13
c++|operator-overloading|copy-constructor
3,987
<p>This is bad, because the <code>operator=</code> can't rely on a set-up object anymore. You should do it the other way around, and can use the copy-swap idiom. </p> <p>In the case where you just have to copy over all elements, you can use the implicitly generated assignment operator. </p> <p>In other cases, you wil...
2,001,755
Using int as a type parameter for java.util.Dictionary
<p>When I try to declare a Dictionary as such:</p> <pre><code>private Dictionary&lt;String, int&gt; map; </code></pre> <p>The compiler gives me the following error:</p> <blockquote> <p>Syntax error on token "int", Dimensions expected after this token</p> </blockquote> <p>But it works fine with <code>Integer</code...
2,001,777
6
3
null
2010-01-04 19:51:56.373 UTC
4
2011-08-31 20:20:34.117 UTC
2011-08-31 20:20:34.117 UTC
null
561,690
null
3,603
null
1
34
java|dictionary|primitive
41,724
<p>In Java primitives aren't objects, so you can't use them in place of objects. However Java will automatically box/unbox primitives (aka <a href="http://java.sun.com/j2se/1.5.0/docs/guide/language/autoboxing.html" rel="noreferrer">autoboxing</a>) into objects so you can do things like:</p> <pre><code>List&lt;Integer...
2,231,500
Error connecting to all of my SQL servers
<p>I suddenly started getting this error when trying to connect to any of my sql servers (25+) from SSMS on Windows XP. When I left work yesterday everything was working fine, came in this morning, and I started getting this. Tried rebooting my pc but that obviously didn't fix it. My co-workers can all connect just fin...
2,231,739
7
1
null
2010-02-09 18:35:03.347 UTC
1
2022-01-24 18:50:12.393 UTC
null
null
null
null
193,284
null
1
14
sql-server-2005|security|windows-xp|ssms
45,443
<p>Try this...</p> <p>Its gotta be a client issue if you lost connection to all your remote servers and your coworkers are fine. You probably got "clicky" and changed some settings inadvertantly.</p> <p>Open your client network utility (mine is here: C:\WINDOWS\system32\cliconfg.exe). Under the General Tab, check ou...
1,804,991
Remove dom element without knowing its parent?
<p>Is it possible to remove a dom element that has no parent other than the body tag? I know this would be easy with a framework like jquery, but I'm trying to stick to straight javascript.</p> <p>Here's the code I've found to do it otherwise:</p> <pre><code>function removeElement(parentDiv, childDiv){ if (child...
1,805,001
7
5
null
2009-11-26 18:00:34.657 UTC
4
2017-08-14 11:18:59.717 UTC
null
null
null
null
174,621
null
1
45
javascript|removechild
41,317
<p>You should be able to get the parent of the element, then remove the element from that</p> <pre><code>function removeElement(el) { el.parentNode.removeChild(el); } </code></pre> <p><strong>Update</strong></p> <p>You can set this as a new method on the HTMLElement:</p> <pre><code>HTMLElement.prototype.remove = fu...
1,638,834
How to check if a file exists in Documents folder?
<p>I have an application with In-App Purchase, that when the user buy something, download one html file into the Documents folder of my app.</p> <p>Now I must check if this HTML file exists, so if true, load this HTML file, else load my default html page.</p> <p>How I can do that? With <code>NSFileManager</code> I ca...
1,638,853
7
1
null
2009-10-28 17:33:26.82 UTC
60
2020-05-20 11:39:12.897 UTC
2017-05-15 15:04:27.507 UTC
null
2,990,682
null
196,894
null
1
219
ios|iphone|xcode|webview|nsfilemanager
151,926
<h3>Swift 3:</h3> <pre><code>let documentsURL = try! FileManager().url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true) </code></pre> <p>... gives you a file UR...
1,503,959
How to count occurrences of a column value efficiently in SQL?
<p>I have a table of students:</p> <pre><code>id | age -------- 0 | 25 1 | 25 2 | 23 </code></pre> <p>I want to query for all students, and an additional column that counts how many students are of the same age:</p> <pre><code>id | age | count ---------------- 0 | 25 | 2 1 | 25 | 2 2 | 23 | 1 </code></pre> ...
1,503,980
7
0
null
2009-10-01 13:27:26.927 UTC
55
2022-01-30 18:41:13.293 UTC
2009-10-01 13:41:07.443 UTC
null
11,208
null
11,208
null
1
224
sql|performance
548,540
<p>This should work:</p> <pre><code>SELECT age, count(age) FROM Students GROUP by age </code></pre> <p>If you need the id as well you could include the above as a sub query like so:</p> <pre><code>SELECT S.id, S.age, C.cnt FROM Students S INNER JOIN (SELECT age, count(age) as cnt ...
2,259,544
Is wchar_t needed for unicode support?
<p>Is the <code>wchar_t</code> type required for unicode support? If not then what's the point of this multibyte type? Why would you use wchar_t when you could accomplish the same thing with <code>char</code>?</p>
2,259,615
8
1
null
2010-02-13 23:32:01.653 UTC
14
2015-10-21 17:11:03.157 UTC
null
null
null
null
440,093
null
1
38
c++|c|unicode
20,207
<h3>No.</h3> <p>Technically, no. Unicode is a standard that defines code points and it does not require a particular encoding.</p> <p>So, you could use unicode with the UTF-8 encoding and then everything would fit in a one or a short sequence of <code>char</code> objects and it would even still be null-terminated.</p...
2,203,525
Are the x,y and row, col attributes of a two-dimensional array backwards?
<p>If I think of the x,y coordinate plane, x,y is the common notation for an ordered pair, but if I use a two-dime array I have myArray[row][col] and row is the y and col is the x. Is that backwards or am I just thinking about it wrong? I was thinking it would look like myArray[x][y] but that's wrong if I want real r...
2,203,610
8
1
null
2010-02-04 21:54:11.947 UTC
19
2022-09-05 22:33:46.85 UTC
2022-09-05 22:29:50.25 UTC
null
1,459,996
null
28,045
null
1
58
multidimensional-array|coordinate-systems|mathematical-notation
46,630
<p>You have it right, and it does feel a bit backwards. The row number is a y coordinate, and the column number is an x coordinate, and yet we usually write row,col but we also usually write x,y.</p> <p>Whether you want to write your array as [y][x] or [x][y] depends mostly on how much you actually care about the layo...
1,784,132
Intellij Community can't use http proxy for Maven
<p>I have Intellij IDEA Community installed on a Linux box that needs to use an authenticated proxy to get to the Internet. I have a system-wide proxy on the box that works, and I have the proxy configured in ~/.m2/settings.xml. Maven correctly uses the proxy when I run try it from the command-line. </p> <p>I have t...
1,784,459
9
0
null
2009-11-23 16:07:36.083 UTC
17
2022-01-04 09:14:20.157 UTC
2009-11-29 21:45:38.61 UTC
null
112,671
null
39,188
null
1
40
java|maven-2|intellij-idea
82,121
<p>I commented out the proxy config in my ~/.m2/settings.xml file, let the Intellij Proxy info alone, and then supplied the properties in Setting->Maven. Not sure why that worked (nor why the settings.xml wasn't working right) but it's working now.</p>
1,582,383
How can i tell if an object has a key value observer attached
<p>if you tell an objective c object to removeObservers: for a key path and that key path has not been registered, it cracks the sads. like -</p> <p>'Cannot remove an observer for the key path "theKeyPath" from because it is not registered as an observer.'</p> <p>is there a way to determine if an object has a regis...
6,714,561
10
3
null
2009-10-17 15:00:12.677 UTC
35
2017-11-02 14:17:48.253 UTC
2009-10-17 15:10:06.097 UTC
null
12,178
null
100,652
null
1
142
objective-c|cocoa|key|key-value-observing
59,287
<p>Put a try catch around your removeObserver call</p> <pre><code>@try{ [someObject removeObserver:someObserver forKeyPath:somePath]; }@catch(id anException){ //do nothing, obviously it wasn't attached because an exception was thrown } </code></pre>
1,378,133
Why are Oracle table/column/index names limited to 30 characters?
<p>I can understand that many years ago there would be this kind of limitation, but nowadays surely this limit could easily be increased. We have naming conventions for objects, but there is always a case that turns up where we hit this limit - especially in naming foreign keys.</p> <p>Does anybody actually know why t...
1,378,160
10
5
null
2009-09-04 09:20:06.347 UTC
29
2016-12-30 21:14:13.16 UTC
2009-09-07 08:41:34.143 UTC
null
159,226
null
159,226
null
1
160
oracle|oracle10g|size
91,186
<p>I believe it's the ANSI standard.</p> <p><strong>EDIT:</strong></p> <p>Actually, I think it's the SQL-92 standard.</p> <p>A later version of the standard appears to optionally allow for 128 character names, but Oracle doesn't yet support this (or has partial support for it, insofar as it allows 30 characters. Hm...
2,053,245
How can I detect if the user is on localhost in PHP?
<p>In other words, how can I tell if the person using my web application is on the server it resides on? If I remember correctly, PHPMyAdmin does something like this for security reasons.</p>
2,053,295
11
0
null
2010-01-12 23:28:15.18 UTC
27
2022-03-02 18:40:45.407 UTC
null
null
null
null
66,812
null
1
113
php|localhost|detection
103,264
<p>You can also use <code>$_SERVER['REMOTE_ADDR']</code> for which IP address of the client requesting is given by the web server. </p> <pre><code>$whitelist = array( '127.0.0.1', '::1' ); if(!in_array($_SERVER['REMOTE_ADDR'], $whitelist)){ // not valid } </code></pre>
1,854,890
Comparing two NSDates and ignoring the time component
<p>What is the most efficient/recommended way of comparing two NSDates? I would like to be able to see if both dates are on the same day, irrespective of the time and have started writing some code that uses the timeIntervalSinceDate: method within the NSDate class and gets the integer of this value divided by the num...
1,854,919
16
1
null
2009-12-06 09:36:35.273 UTC
32
2018-04-24 11:59:54.367 UTC
2010-09-20 13:56:21.13 UTC
null
218,394
null
218,394
null
1
72
iphone|objective-c|nsdate
38,882
<p>You set the time in the date to 00:00:00 before doing the comparison:</p> <pre><code>unsigned int flags = NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay; NSCalendar* calendar = [NSCalendar currentCalendar]; NSDateComponents* components = [calendar components:flags fromDate:date]; NSDate* dateOnly = ...
1,778,088
How do I clone a single branch in Git?
<p>I have a local Git repository in <code>~/local_repo</code>. It has a few branches:</p> <pre><code>$ git branch * master rails c c++ </code></pre> <p>To clone the local repository, I do:</p> <pre><code>$ git clone ~/local_repo new_repo Initialized empty Git repository in /home/username/new_repo/.git/ </code></p...
9,920,956
26
8
null
2009-11-22 07:21:19.42 UTC
344
2022-07-08 05:40:26.53 UTC
2022-07-08 05:40:26.53 UTC
null
365,102
null
66,450
null
1
962
git|branch|git-clone
884,286
<p>Note: the <strong><a href="https://lkml.org/lkml/2012/3/28/418" rel="noreferrer">git1.7.10</a> (April 2012)</strong> actually allows you to <strong>clone only one branch</strong>:</p> <pre class="lang-bash prettyprint-override"><code># clone only the remote primary HEAD (default: origin/master) git clone &lt;url&gt;...
1,409,649
How to change the height of a <br>?
<p>I have a big paragraph of text that is divided into subparagraphs with <code>&lt;br&gt;</code>'s:</p> <pre><code>&lt;p&gt; Blah blah blah. &lt;br/&gt; Blah blah blah. Blah blah blah. Blah blah blah. &lt;br/&gt; Blah blah blah. &lt;/p&gt; </code></pre> <p>I want to widen the gap between these subparagraph...
1,409,742
34
6
null
2009-09-11 08:14:53.877 UTC
48
2021-06-12 20:24:05.973 UTC
2013-04-30 05:22:22.183 UTC
null
1,563,422
null
155,336
null
1
322
html|css
716,481
<p>Css:</p> <pre><code>br { display: block; margin: 10px 0; } </code></pre> <p>The solution is probably not cross-browser compatible, but it's something at least. Also consider setting <code>line-height</code>:</p> <pre><code>line-height:22px; </code></pre> <p>For Google Chrome, <a href="https://stackoverflow...
33,704,714
Can't require() default export value in Babel 6.x
<p>In Babel 5.x, I can write the following code:</p> <p><strong>app.js</strong></p> <pre><code>export default function (){} </code></pre> <p><strong>index.js</strong></p> <pre><code>require('babel/register'); require('./app')(); </code></pre> <p>Then, I can run <code>node index.js</code> with no errors. However, u...
33,705,077
3
5
null
2015-11-14 03:09:56.373 UTC
24
2021-08-19 14:06:53.563 UTC
2016-03-08 23:44:19.11 UTC
null
1,391,671
null
4,485,565
null
1
98
javascript|ecmascript-6|babeljs
54,160
<p><strong>TL;DR</strong></p> <p>You have to use</p> <pre><code>const app = require('./app').default; app(); </code></pre> <p><strong>Explanation</strong></p> <p>Babel 5 used to have a compatibility hack for <code>export default</code>: if a module contained only one export, and it was a default export, it was assigned...
8,796,747
How to scroll to bottom of ListBox?
<p>I am using a Winforms ListBox as a small list of events, and want to populate it so that the last event (bottom) is visible. The <code>SelectionMode</code> is set to none. The user can scroll the list but I would prefer it start out scrolled to the end.</p> <p>Looking at the lack of support for things like <code>Sc...
8,796,820
4
2
null
2012-01-09 23:40:03.457 UTC
3
2021-03-04 19:02:52.667 UTC
null
null
null
null
161,052
null
1
74
c#|winforms|listbox
83,223
<p>I believe you can do that easily by setting the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.listbox.topindex.aspx" rel="noreferrer"><code>TopIndex</code></a> property appropriately.</p> <p>For example:</p> <pre><code>int visibleItems = listBox.ClientSize.Height / listBox.ItemHeight; listB...
17,821,532
How to open Navigation Drawer with no actionbar, open with just a button
<p>I have a navigation bar without any actionbar (I don't want an actionbar). I'm trying to make it so that I have a button that can open the navigation drawer. </p> <p>I know there's a method called openDrawer for the DrawerLayout <a href="http://developer.android.com/reference/android/support/v4/widget/DrawerLayout...
17,822,591
7
0
null
2013-07-23 21:39:23.51 UTC
20
2020-01-27 15:46:16.813 UTC
2013-07-23 22:06:42.967 UTC
null
2,511,100
null
2,511,100
null
1
42
android|button|navigation-drawer|drawerlayout
83,244
<p>It's giving you a null pointer because you are trying to find the drawer layout in the fragment's view, when it is actually in the activities view.</p> <p>A quick hack to do what you want is to find the view like:</p> <pre><code>getActivity().findViewById(R.id.drawer_layout) </code></pre> <p>That should work. A b...
17,698,434
The requested PHP extension intl is missing from your system (SonataAdminBundle) in Symfony2
<p>I try to install the sandbox but I get the following error from composer:</p> <blockquote> <p>Loading composer repositories with package information Installing dependencies from lock file Your requirements could not be resolved to an installable set of packages.</p> </blockquote> <p>Problem 1</p> <pre><code...
33,857,986
8
3
null
2013-07-17 11:19:45.9 UTC
2
2020-06-30 16:11:10.253 UTC
2013-07-17 13:51:05.837 UTC
null
1,443,490
null
2,361,831
null
1
16
php|symfony|intl
67,215
<p>I had the same problem while I was installing new Magento 2.0, after different hit and trials, I manged to solve it by following these steps:</p> <p>I copied all <strong>icu*</strong> files from php directory to Appache directory, and it worked.</p> <p>Php direcotry: </p> <blockquote> <p>WAMP\bin\php\php5.5.12<...
18,149,601
Go install fails with error: no install location for directory xxx outside GOPATH
<pre><code>~/src/go-statsd-client&gt; echo $GOPATH /Users/me/gopath ~/src/go-statsd-client&gt; echo $GOROOT /usr/local/Cellar/go/1.1.1\ ~/src/go-statsd-client&gt; go install go install: no install location for directory /Users/me/src/go-statsd-client outside GOPATH </code></pre> <p>No matter what structure the project...
18,164,310
12
0
null
2013-08-09 14:52:32.463 UTC
33
2019-07-01 00:12:09.783 UTC
2019-03-03 16:47:28.683 UTC
null
1,103,953
null
41,709
null
1
164
macos|go
130,346
<p>When you provide no arguments to <code>go install</code>, it defaults to attempting to install the package in the current directory. The error message is telling you that it cannot do that, because the current directory isn't part of your <code>$GOPATH</code>.</p> <p>You can either:</p> <ul> <li>Define <code>$GOPA...
6,911,894
Ninject InRequestScope missing
<p>Have a couple of questions regarding the latest version (2.2.1.4) of ninject.</p> <p>Was trying to Bind a Linq2sql <code>DataContext</code> to a concrete implementation <code>InRequestScope</code> (in a class library project)</p> <pre><code>Bind&lt;DataContext&gt;().To&lt;MoneywatchDataContext&gt;() </code></pre> ...
6,912,529
3
0
null
2011-08-02 12:13:42.463 UTC
1
2015-12-01 19:04:28.967 UTC
2013-04-03 12:59:09.237 UTC
null
11,635
null
186,061
null
1
34
c#|binding|ninject|ninject-2
7,952
<p>Most likely you reference a no web version of Ninject. Replace it with the normal version and you will have the InRequestScope extension method.</p>
6,837,543
Show virtual keyboard on mobile phones in javascript
<p>I'm creating a mobile version of my site. There's a part of the site where a dialog pops up with a text input. Normally I would just use jQuery to bring focus to the text input, but that's not working. Here's what I'm trying:</p> <pre><code>$("#textinput").focus(); $("#textinput").click(); $("#textinput").trigger(...
6,837,575
3
0
null
2011-07-26 22:49:24.917 UTC
16
2021-03-05 16:57:31.893 UTC
null
null
null
null
212,188
null
1
42
javascript|jquery|jquery-mobile
80,978
<p>You can't, at least not in iOS (iPhone), and I believe Android as well. It's a usability issue that the keyboard should not be allowed to be triggered except by user input (it's just annoying if it's automatic).</p> <p>There are a couple of ways I know of to get around this:</p> <ul> <li><code>prompt()</code> ope...
6,412,896
Giving application elevated UAC
<p>I have an application which needs the UAC elevation.</p> <p>I have the code which lets me give that but the application opens twice and that's an issue.</p> <p>Here's the code of Form1:</p> <pre><code>public Form1() { InitializeComponent(); WindowsPrincipal pricipal = new WindowsPrincipal(WindowsIdentity.Ge...
6,413,024
4
1
null
2011-06-20 14:35:36.897 UTC
4
2022-08-17 05:42:31.053 UTC
2022-08-17 05:42:31.053 UTC
null
1,879,699
null
175,084
null
1
13
c#|asp.net|winforms|uac
45,972
<p>You don't need to meddle with all that to make sure that your application always runs with elevated privileges. You can simply <a href="http://msdn.microsoft.com/en-us/library/bb756929.aspx" rel="noreferrer">add an application manifest</a> which instructs Windows to run your app elevated, and the UAC prompt will app...
35,844,279
Why does m[1] - m[0] return 3 where m is a 3x3 matrix?
<p>This is my code:</p> <pre><code>int m[][3] = { { 0 , 1 , 2 }, { 10, 11, 12 }, { 20, 21, 22 } }; printf("%d %d\n", m[1] - m[0], m[1][0] - m[0][0]); </code></pre> <p>And why does</p> <pre><code>m[1] - m[0] </code></pre> <p>return <code>3</code>? I know why...
35,844,334
2
3
null
2016-03-07 12:53:46.723 UTC
4
2016-05-12 11:03:58.193 UTC
2016-04-13 17:45:51.063 UTC
null
1,009,479
null
3,680,672
null
1
36
c|arrays|matrix
1,937
<p>In your code:</p> <pre><code> m[1] - m[0] </code></pre> <p>denotes a pointer subtraction which gives you the difference of the two pointers based on the <em>type</em>. In this case, both the pointers are differentiated by 3 elements, so the result is 3.</p> <p>To quote <code>C11</code> standard, chapter §6.5.6</p...
18,959,691
IOS7 (only) stdlibc++ linking issue
<p>I need help. I had a framwork which was using stdc++ like std:string. Now when i have created new app for IOS7 only there is problem with linking this framework because of problems with stdc++ lib:</p> <p>Undefined symbols for architecture armv7 "std::basic_string, std::allocator >::_Rep::_S_empty_rep_storage", ref...
21,206,163
4
3
null
2013-09-23 12:49:26.627 UTC
13
2014-10-08 18:35:35.68 UTC
null
null
null
null
790,873
null
1
28
xcode|ios7|libstdc++
29,060
<p>Just an update on this answer: </p> <p>This step is very important!</p> <p>Ensure that <strong>C++ Standard Library</strong> is set to <strong>libstdc++ (GNU c++ standard library)</strong> in the Apple LLVM 5.0 Compiler Build Settings</p> <p>Background:</p> <p>I have an iOS app that abruptly stopped building for...
34,372,618
npm - "Can't find Python executable "python", you can set the PYTHON env variable."
<p>I'm trying to run the following command: <code>npm install -g bower gulp cordova ionic tsd@next karma-cli protractor node-gyp coffee-script js-beautify typescript npm-check</code></p> <p>I have installed Python, Visual Studio Express and node-gyp so thought I'd be good to go, however I get the following errors:</p>...
34,372,675
15
7
null
2015-12-19 16:01:07.927 UTC
23
2022-09-12 12:23:08.6 UTC
2015-12-19 16:29:03.747 UTC
null
3,330,348
null
124,201
null
1
111
python|node.js|npm|npm-install
384,943
<p>You got to add python to your PATH variable. One thing you can do is Edit your Path variable now and add</p> <p><code>;%PYTHON%;</code></p> <p>Your variable PYTHON should point to the root directory of your python installation.</p>
27,812,098
Graphics driver "hello world" example?
<p>What are the steps necessary to create a GPU driver that render pixels on a display? Basically just the simplest "hello world" example of creating a GPU driver, such as turning the screen red or just showing a single pixel. Where do you start?</p> <p>I would like to hack on the GPU directly, without any C or OpenGL...
27,812,800
1
3
null
2015-01-07 03:44:52.953 UTC
24
2015-01-07 06:05:34.013 UTC
2015-01-07 05:05:24.473 UTC
null
169,992
null
169,992
null
1
29
c|opengl|assembly|graphics
13,309
<ul> <li><strong>Step 1</strong>: Understand the particular GPU you are targetting (Architecture, register and stream details). I am afraid for many of the GPUs these details may be proprietary and you may not get it. (But as you mentioned, in your case specs are available)</li> <li><strong>Step 2</strong>: Add some ca...
5,215,048
javascript checkbox enable/disable
<p>Ok this is very anoying, and it is probably very simple. I want to start my web page with disabled checkboxes, and after particlar line in listbox is selected to enable those boxes. So I put this in onload method</p> <pre><code>onload = function () { for (i = 0; i &lt; document.frmMain.checkgroup.length; i++){ ...
5,215,074
2
0
null
2011-03-07 01:59:31.29 UTC
4
2011-03-07 02:03:39.543 UTC
null
null
null
null
521,683
null
1
5
javascript|html|listbox|checkbox
63,276
<p>Try instead:</p> <pre><code> document.frmMain.checkgroup[i].disabled = false ; </code></pre>
16,332,283
Set permission for getting User's email ID from Facebook Login
<p>I'm using <code>Facebook 3.0 SDK</code> for android. I have to implement <code>Facebook</code> log in. I'm accessing user's basic info like name, userID. But I want to have access to email also of the user. I have gone through many blogs and forum but cannot figure out how to do that.</p> <p>I'm using my own androi...
16,356,911
2
3
null
2013-05-02 07:07:56.747 UTC
10
2017-02-07 15:09:33.047 UTC
2013-05-02 17:21:23.457 UTC
null
1,677,125
null
1,321,290
null
1
11
android|facebook|facebook-login|facebook-android-sdk
41,124
<p>Solved it: Here is what I have done...</p> <pre><code>@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mLogin = (Button) findViewById(R.id.logIn); mLogin.setOnClickListener(this); } @Override public void onC...
158,703
Is it OK to use HttpRuntime.Cache outside ASP.NET applications?
<p>Scott Hanselman <a href="http://www.hanselman.com/blog/UsingTheASPNETCacheOutsideOfASPNET.aspx" rel="noreferrer">says yes</a>.</p> <blockquote> <p>Adding System.Web to your non-web project is a good way to get folks to panic. Another is adding a reference to Microsoft.VisualBasic in a C# application. Both are rea...
2,771,486
8
2
null
2008-10-01 17:17:54.937 UTC
11
2016-12-15 16:56:00.973 UTC
null
null
null
Jakub Šturc
2,361
null
1
39
.net|caching
12,176
<p>I realize this question is old, but in the interest of helping anyone who finds this via search, its worth noting that .net v4 includes a new general purpose cache for this type of scenario. It's in the System.Runtime.Caching namespace:</p> <p><a href="https://msdn.microsoft.com/en-us/library/dd997357(v=vs.110).asp...