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
33,208,518
Difference between 0x0A and 0x0D
<p>I was studying about bluetooth and I was trying to write the code to keep listening to the input stream while connected and i came across this following code snippet:</p> <pre><code>int data = mmInStream.read(); if(data == 0x0A) { } else if(data == 0x0D) { buffer = new byte[a...
33,208,588
3
1
null
2015-10-19 07:07:58.14 UTC
4
2022-07-01 08:13:28.193 UTC
2015-10-19 07:24:58.59 UTC
null
5,199,989
null
5,350,816
null
1
14
java|bluetooth|hex|character|buffer
61,396
<p>The values starting <code>0x</code> are hexadecimals. <code>0x0A</code> is <code>\n</code> newline character and <code>0x0D</code> is <code>\r</code> return character. You can read more about how to convert them <a href="http://www.javamex.com/tutorials/conversion/decimal_hexadecimal.shtml" rel="noreferrer">here</a>...
9,225,300
denyhosts keeps adding back my IP
<p>I am trying to unblock an IP from which I was doing some tests. I have followed the tutorials on the net:</p> <pre><code>$ sudo /etc/init.d/denyhosts stop $ sudo vim /etc/deny.hosts [remove the last line where I can see my IP to clear] $ cd /var/lib/denyhosts/ $ sudo vim * [remove any occurences of my IP to clear] ...
11,634,558
9
0
null
2012-02-10 09:10:03.177 UTC
16
2020-05-19 23:44:22.543 UTC
null
null
null
null
136,285
null
1
24
ssh
37,275
<p>The instructions to remove an entry for denyhosts can be found here: <a href="http://www.cyberciti.biz/faq/linux-unix-delete-remove-ip-address-that-denyhosts-blocked/">http://www.cyberciti.biz/faq/linux-unix-delete-remove-ip-address-that-denyhosts-blocked/</a>. In Ubuntu the denyhosts data files are located at <code...
9,205,000
bash: defining a file-local variable invisible to sourcing script
<p>Say I have a bash script file <code>config.sh</code>. It's meant to be source'd by other scripts and variables defined is used as customization of the upper-level scripts.</p> <p>The problem is, if <code>config.sh</code> has a temporary variable and its name conflicts with upper-level scripts' variable, it breaks t...
9,205,183
4
0
null
2012-02-09 03:25:38.407 UTC
6
2012-02-09 23:04:09.887 UTC
null
null
null
null
402,996
null
1
33
bash
9,565
<p>A trick I learned from the <a href="http://en.gentoo-wiki.com/wiki/Keychain" rel="noreferrer"><code>keychain</code></a> utility is using one program to build a <code>source</code>-able file containing just the variables that you want to export from your program. You could modify your script to <code>echo</code> the ...
10,694,661
document.getElementById().value return undefined in chrome
<pre><code>&lt;div id="hour" style="display: none"&gt;2&lt;/div&gt; </code></pre> <p>JavaScript code:</p> <pre><code>&lt;script type="text/javascript"&gt; var _h = document.getElementById('hour').value alert(_h); &lt;/script&gt; </code></pre> <p>Chrome returns <code>undefined</code>. What is the problem?</p>
10,694,721
4
1
null
2012-05-22 01:23:02.26 UTC
7
2021-02-05 01:35:09.8 UTC
2015-07-30 13:12:18.39 UTC
null
1,015,495
null
1,368,957
null
1
14
javascript
59,179
<p>The <code>.value</code> property applies to form elements (inputs), not divs. The simplest way to get the contents of your div element is with <code>.innerHTML</code>:</p> <pre><code>document.getElementById('hour').innerHTML; </code></pre>
10,828,863
What is the use of Custom Class Loader
<p>Recently I came accross the java custom class loader api. I found one use over here, <a href="http://kamranzafar.org/weblog/2006/12/25/loading-classes-directly-from-jar-files/" rel="noreferrer">kamranzafar's blog</a> I am a bit new to the class loader concept. Can any one explain in detail, what are the different sc...
10,829,369
3
1
null
2012-05-31 07:02:33.06 UTC
15
2020-06-11 15:29:16.03 UTC
2015-12-21 07:41:14.447 UTC
null
1,207,049
null
1,392,956
null
1
28
java|classloader
15,513
<p>Custom class loaders are useful in larger architectures consisting of several module/applications. Here are the advantages of the custom class loader:</p> <ul> <li><strong>Provides Modular architecture</strong> Allows to define multiple class loader allowing modular architecture.</li> <li><strong>Avoiding conflicts...
22,512,992
How to use the 'main' parameter in package.json?
<p>I have done quite some search already. However, still having doubts about the 'main' parameter in the package.json of a Node project.</p> <ol> <li>How would filling in this field help? Asking in another way, can I start the module in a different style if this field presents?</li> <li>Can I have more than one script ...
22,513,200
8
1
null
2014-03-19 16:59:26.96 UTC
41
2022-08-21 14:14:04.983 UTC
2022-08-21 14:14:04.983 UTC
null
4,344,438
null
2,621,216
null
1
218
javascript|node.js|rest|asynchronous
154,455
<p>From <a href="https://docs.npmjs.com/files/package.json#main">the npm documentation</a>:</p> <blockquote> <p>The main field is a module ID that is the primary entry point to your program. That is, if your package is named foo, and a user installs it, and then does require("foo"), then your main module's expor...
22,621,754
How can I merge two maps in go?
<p>I have a recursive function that creates objects representing file paths (the keys are paths and the values are info about the file). It's recursive as it's only meant to handle files, so if a directory is encountered, the function is recursively called on the directory.</p> <p>All that being said, I'd like to do t...
22,621,838
5
2
null
2014-03-24 22:17:51.03 UTC
12
2022-07-17 13:01:23.257 UTC
2022-05-17 12:55:17.567 UTC
null
2,541,573
null
301,749
null
1
115
dictionary|go|union
112,966
<p>There is no built in way, nor any method in the standard packages to do such a merge.</p> <p>The idomatic way is to simply iterate:</p> <pre><code>for k, v := range b { a[k] = v } </code></pre>
31,790,344
Determine if a point reside inside a leaflet polygon
<p>Suppose I Draw a polygan using leaflet like in the follow demo: <a href="http://leaflet.github.io/Leaflet.draw/" rel="noreferrer">http://leaflet.github.io/Leaflet.draw/</a></p> <p>My question is how I can determine if a given point reside inside the polygon or not.</p>
31,813,714
3
2
null
2015-08-03 14:47:31.583 UTC
14
2019-10-02 17:53:43.017 UTC
2015-08-04 16:25:15.183 UTC
null
725,573
null
5,084,891
null
1
29
leaflet|polygon|point-in-polygon
29,835
<p>Use the Ray Casting algorithm for checking if a point (marker) lies inside of a polygon:</p> <pre><code>function isMarkerInsidePolygon(marker, poly) { var polyPoints = poly.getLatLngs(); var x = marker.getLatLng().lat, y = marker.getLatLng().lng; var inside = false; for (var i = 0, j = polyP...
37,054,469
Nuget Package - feed (VSTS) :Exception 'System.AggregateException' thrown when trying to add source
<p>I have created a new feed with in Package Release hub (VSTS), installed the credentials, then added the package source. </p> <p>Now, I am using Visual Studio 2015 to install Micrososft.Aspnet.mvc to a project, however it gives the following error:</p> <pre><code>Exception 'System.AggregateException' thrown when tr...
37,154,554
13
2
null
2016-05-05 15:29:42.68 UTC
6
2021-12-28 10:58:47.77 UTC
2018-09-11 21:39:08.64 UTC
null
-1
null
1,682,401
null
1
47
visual-studio|nuget|azure-devops|nuget-package|azure-artifacts
41,415
<p>I met this issue today and fix it by following:</p> <p>If you have delete the feed from VSTS, then you need to delete it from VS\Tools\Options\Nuget Package Manager\Package Sources: <a href="https://i.stack.imgur.com/ugH3F.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/ugH3F.jpg" alt="enter image descrip...
17,742,651
Column chart: how to show all labels on horizontal axis
<p>I've been trying to show all labels on the horizonal axis of my chart, but I haven't been able to do that!</p> <p>I tried using <strong>hAxis.showTextEvery=1</strong> but does not work </p> <p>(see <a href="https://developers.google.com/chart/interactive/docs/gallery/columnchart" rel="noreferrer">https://developer...
17,747,324
2
2
null
2013-07-19 09:30:06.587 UTC
5
2016-12-14 09:48:59.523 UTC
2016-12-14 09:48:59.523 UTC
null
2,560,293
null
2,560,293
null
1
15
google-visualization
48,489
<p>Your problem is related to the continuous versus discrete subtleties in <a href="https://developers.google.com/chart/interactive/docs/gallery/columnchart" rel="noreferrer"><code>ColumnChart</code></a>. Basically, you have continuous values for labels on your <code>hAxis</code>, and the <code>showTextEvery</code> onl...
17,710,209
How to run make from Cygwin environment?
<p>I am trying to run linux driver on linux environment .. Following instruction to run winkvm .. stuck on point run make command using cygwin environment .. like </p> <ol> <li><p>Building original KVM drivers using Cygwin environment:</p> <p>cd kvm/kernel ## Do not type configure make ## you will get id...
17,710,292
2
0
null
2013-07-17 21:06:20.17 UTC
1
2018-08-26 13:30:15.977 UTC
2013-07-17 21:12:37.683 UTC
null
827,263
null
2,593,158
null
1
31
cygwin
106,673
<p>You have to install the <code>make</code> command.</p> <p>Run the Cygwin installation/configuration program, <code>setup-x86_64.exe</code> or <code>setup-x86.exe</code> (you should already have it, downloaded from <a href="https://www.cygwin.com/install.html" rel="noreferrer">here</a>). When you get to the screen t...
35,488,717
Confused about conv2d_transpose
<p>I'm getting this error message when using <code>conv2d_transpose</code>:</p> <pre><code>W tensorflow/core/common_runtime/executor.cc:1102] 0x7fc81f0d6250 Compute status: Invalid argument: Conv2DBackpropInput: Number of rows of out_backprop doesn't match computed: actual = 32, computed = 4 [[Node: generator/g_h1/co...
38,059,483
2
1
null
2016-02-18 17:46:09.11 UTC
11
2016-11-08 13:02:36.313 UTC
null
null
null
null
307,401
null
1
22
tensorflow
22,875
<p>Thanks for the question! You're exactly right---the problem is that the input and output dimensions being passed to tf.nn.conv2d_transpose don't agree. (The error may be detected when computing gradients, but the gradient computation isn't the problem.)</p> <p>Let's look at just the first part of your code, and sim...
3,290,283
What is a good way to produce a random "site salt" to be used in creating password retrieval tokens?
<p>I would like to create a site-wide hash to be used as salt in creating password retrieval tokens. I have been bouncing around stackoverflow trying to get a sense of the best way to do this. </p> <p>Here's the reset process:</p> <p>When a user requests a password reset email the code generates a retrieval token:</p...
3,291,689
1
7
null
2010-07-20 13:15:28.183 UTC
17
2013-09-18 19:46:35.33 UTC
2017-05-23 10:31:16.713 UTC
null
-1
null
225,014
null
1
15
php|security|passwords|hash|password-protection
11,222
<p>To start with, your not talking about a salt. You're talking about a <a href="http://en.wikipedia.org/wiki/Cryptographic_nonce" rel="noreferrer">Cryptographic Nonce</a>, and when you salt a password you should use a Cryptographic Nonce. In the case of resetting passwords, it should be a random number that is st...
28,032,092
Shutdown netty programmatically
<p>I'm using netty 4.0.24.Final.</p> <p>I need to start/stop netty server programmatically.<br> On starting the server, the thread gets blocked at </p> <p><code>f.channel().closeFuture().sync()</code> </p> <p>Please help with some hints how to do it correctly. Below is the EchoServer that is called by the Main class...
28,034,689
3
1
null
2015-01-19 19:25:39.413 UTC
11
2020-08-18 12:03:13.987 UTC
2015-01-19 21:21:43.407 UTC
null
2,996,265
null
2,674,027
null
1
17
java|netty|server|shutdown
19,237
<p>One way is to make something like:</p> <pre><code>// once having an event in your handler (EchoServerHandler) // Close the current channel ctx.channel().close(); // Then close the parent channel (the one attached to the bind) ctx.channel().parent().close(); </code></pre> <p>Doing this way will end up the following...
2,054,669
__OBJC__ in Objective-C
<p>What does <code>__OBJC__</code> mean in Objective-C?</p> <pre><code>#import &lt;Availability.h&gt; #ifdef __OBJC__ #import &lt;Foundation/Foundation.h&gt; #import &lt;UIKit/UIKit.h&gt; #endif </code></pre>
2,054,717
3
0
null
2010-01-13 05:33:58.203 UTC
9
2022-04-27 11:10:44.607 UTC
2022-04-27 11:10:44.607 UTC
null
1,033,581
null
165,495
null
1
25
objective-c
14,101
<p>This looks like your precompiled header file.</p> <p>The precompiled header is shared between all C-dialect files in your project. It's as if all your .c, .cpp, .m and .mm files have an invisible #include directive as the first line. But the Cocoa header files are pure Objective C - trying to include them in a C/C+...
2,127,836
Ruby Print Inject Do Syntax
<p>Why is it that the following code runs fine</p> <pre><code>p (1..1000).inject(0) { |sum, i| sum + i } </code></pre> <p>But, the following code gives an error</p> <pre><code>p (1..1000).inject(0) do |sum, i| sum + i end warning: do not use Fixnums as Symbols in `inject': 0 is not a symbol (ArgumentError) ...
2,127,854
3
0
null
2010-01-24 16:42:31.197 UTC
7
2014-06-11 17:13:25.72 UTC
2014-06-11 17:13:25.72 UTC
null
1,227,991
null
84,399
null
1
30
ruby|syntax|inject
2,175
<p>The block written using the curly braces binds to the inject method, which is what your intention is, and it will work fine. </p> <p>However, the block that is encapsulated in the do/end block, will bind to the p-method. Because of this, the inject call does not have an associated block. In this case, inject will i...
8,516,498
Definition of a method signature?
<p>What is the correct definition of a method signature (or a signature of a method)?</p> <p>On google, I find various definitions:</p> <blockquote> <p>It is the combination of the method name and the parameter list</p> </blockquote> <p>Does that mean <code>method signature = method name + argument list</code>? Th...
8,521,944
7
1
null
2011-12-15 07:27:56.56 UTC
10
2016-07-31 06:28:35.893 UTC
2016-07-31 06:28:35.893 UTC
null
3,375,713
null
529,310
null
1
24
c#|method-signature
33,427
<p>There are a number of correct answer here which define the method signature as the method name, generic arity, formal parameter arity and formal parameter types and kinds, but <em>not</em> the return type or "params" modifier.</p> <p>Though that is correct, there are some subtleties here. The way <em>the C# languag...
8,924,896
Java long number too large error?
<p>Why do I get an int number is too large where the long is assigned to min and max?</p> <pre><code>/* long: The long data type is a 64-bit signed two's complement integer. It has a minimum value of -9,223,372,036,854,775,808 and a maximum value of 9,223,372,036,854,775,807 (inclusive). Use this data type whe...
8,924,925
2
1
null
2012-01-19 10:59:20.36 UTC
3
2017-06-25 06:11:14.417 UTC
2012-01-19 11:07:13.537 UTC
null
418,556
null
604,864
null
1
26
java
58,602
<p>All literal numbers in java are by default <code>ints</code>, which has range <code>-2147483648</code> to <code>2147483647</code> inclusive.</p> <p>Your literals are outside this range, so to make this compile you need to indicate they're <code>long</code> literals (ie suffix with <code>L</code>):</p> <pre><code>...
8,399,184
Convert dip to px in Android
<p>I had written method to get the pixels from dip but it is not working. It give me runtime error.</p> <p>Actually I was running this method in separate class and initialized in my Activity class</p> <pre><code>Board board = new Board(this); board.execute(URL); </code></pre> <p>This code runs asynchronously. Please he...
8,399,512
4
1
null
2011-12-06 11:28:58.683 UTC
13
2022-02-11 15:47:40.497 UTC
2022-02-11 15:10:28.79 UTC
null
3,501,958
null
961,524
null
1
53
android|density-independent-pixel
59,652
<p>The formula is: <strong>px = dp * (dpi / 160)</strong>, for having on a 160 dpi screen. See <em><a href="https://developer.android.com/training/multiscreen/screendensities#dips-pels" rel="nofollow noreferrer">Convert dp units to pixel units</a></em> for more information.</p> <p>You could try:</p> <pre><code>public s...
19,785,001
Custom Method Annotation using Jersey's AbstractHttpContextInjectable not Working
<p>I want to restrict some methods if they are being accessed in a non-secure manner. I'm creating a @Secure annotation that checks whether or not the request was sent over secure channels. However, I cannot create a method injectable that captures the HttpContext of the request.</p> <pre><code>@Documented @Retention(...
20,618,954
3
2
null
2013-11-05 08:57:11.87 UTC
10
2015-04-16 15:13:14.067 UTC
2013-12-16 10:57:01.837 UTC
null
320,124
null
320,124
null
1
8
java|annotations|jersey|dropwizard
12,556
<p>If you don't want to use AOP, I think you can do this by implementing ResourceMethodDispatchProvider and ResourceMethodDispatchAdapter. </p> <pre><code>public class CustomDispatchProvider implements ResourceMethodDispatchProvider { ResourceMethodDispatchProvider provider; CustomDispatchProvider(ResourceMethodDis...
1,313,954
plotting two vectors of data on a GGPLOT2 scatter plot using R
<p>I've been experimenting with both <code>ggplot2</code> and <code>lattice</code> to graph panels of data. I'm having a little trouble wrapping my mind around the <code>ggplot2</code> model. In particular, how do I plot a scatter plot with two sets of data on each panel:</p> <p>in <code>lattice</code> I could do this...
1,314,342
4
2
null
2009-08-21 19:58:39.49 UTC
13
2019-04-15 19:48:23.85 UTC
2019-04-15 19:48:17.51 UTC
null
4,751,173
null
37,751
null
1
18
r|plot|ggplot2|lattice
32,735
<p>Just following up on what Ian suggested: for ggplot2 you really want all the y-axis stuff in one column with another column as a factor indicating how you want to decorate it. It is easy to do this with <code>melt</code>. To wit:</p> <pre><code>qplot(x_value, value, data = melt(dd, measure.vars=c("Predicte...
785,945
Problem generating Java SOAP web services client with JDK tool wsimport from a WSDL generated by a .NET 2.0 application
<p>I'm trying to generate a client for some SOAP web services using the JDK 6 tool <code>wsimport</code>. The WSDL was generated by a .NET 2.0 application. For .NET 3.X applications, it works fine.</p> <p>When I run</p> <pre><code>wsimport -keep -p mypackage http://myservice?wsdl </code></pre> <p>it shows several er...
1,434,958
4
0
null
2009-04-24 13:54:37.7 UTC
17
2017-08-13 20:12:12.66 UTC
2009-04-24 14:27:49.057 UTC
null
57,752
null
95,504
null
1
42
java|.net|web-services|axis|wsimport
38,029
<p>I don't know if this was ever solved, but I spent some time googling for a solution to this same problem.</p> <p>I found a fix here - <a href="https://jax-ws.dev.java.net/issues/show_bug.cgi?id=228" rel="noreferrer">https://jax-ws.dev.java.net/issues/show_bug.cgi?id=228</a></p> <p>The solution is to run wsimport w...
25,927,961
Ensure unique field value in loopback model
<p>How to ensure uniqueness of a particular field in loopback model. Like below is the model Post, I have a field genericId in it, I want it to be unique in the database, and loopback to through an error, on duplicate key insertion.</p> <pre><code>{ "name": "Post", "plural": "Post", "base": "PersistedModel", "...
27,149,153
3
2
null
2014-09-19 06:48:51.487 UTC
8
2019-10-09 21:14:39.457 UTC
2014-09-19 07:05:13.897 UTC
null
3,892,259
null
922,933
null
1
21
json|node.js|strongloop|loopbackjs
16,411
<p>Set <a href="https://docs.strongloop.com/display/APIC/Validating+model+data" rel="noreferrer">validation</a> rule in your <code>common/models/post.js</code></p> <pre><code>Post.validatesUniquenessOf('genericId'); </code></pre>
30,747,892
''setup cannot find office.en-us\dwtrig20.exe''
<p>During installation of Microsoft office 2010, I get the following error, which really confuses me:</p> <blockquote> <p>setup cannot find office.en-us\dwtrig20. </p> </blockquote> <p>When I choose the folder that the office.en-us where dwtrig.exe file located it displays invalid destination.</p>
30,748,029
2
1
null
2015-06-10 05:37:44.237 UTC
null
2018-04-30 20:18:47.2 UTC
2015-06-16 13:11:37.283 UTC
null
1,118,488
user4993352
null
null
1
1
office-2010
48,792
<p>the reason that makes such ''setup cannot find office.en-us\dwtrig20.exe'' error is that it may have some some fragments from the previously existing Ms Office. </p> <p>please fix it with Fixer <a href="http://go.microsoft.com/?linkid=9737366" rel="nofollow">click here</a> to download and install. follow the instr...
32,422,593
laravel BelongsTo relationship with different databases not working
<p>I've seen in several places to "stay away" from this, but alas - this is how my DB is built:</p> <pre><code>class Album extends Eloquent { // default connection public function genre() { return $this-&gt;belongsTo('genre'); } </code></pre> <p>and the Genre table:</p> <pre><code>class Genre exten...
33,222,754
12
4
null
2015-09-06 10:33:00.317 UTC
5
2022-06-13 11:01:20.837 UTC
2015-10-19 20:32:27.317 UTC
null
1,503,710
null
1,503,710
null
1
31
laravel
30,214
<p>This is my own solution and it works in general for me but its mega-complicated.</p> <p>I'm using the builder "from" method to set the table and database correctly inside the subquery. I just need to pass the correct information inside.</p> <p>Assume the subquery can be as complicated as "genres.sample" or even de...
36,353,532
Angular2 OPTIONS method sent when asking for http.GET
<p>I'm trying to add <a href="https://en.wikipedia.org/wiki/Basic_access_authentication#Client_side" rel="noreferrer">basic authentification</a> to my angular2 app.</p> <pre><code>public login() { // Set basic auth headers this.defaultHeaders.set('Authorization', 'Basic ' + btoa(this.username + ':' + this.pass...
36,353,822
2
3
null
2016-04-01 10:07:38.237 UTC
20
2016-06-30 03:12:15.573 UTC
2016-04-01 10:41:38.79 UTC
null
3,611,519
null
1,935,318
null
1
53
http|cors|angular
98,174
<p>This is the way CORS works (when using cross domain requests). With CORS, the remote Web application (here the one with domain mydomain.org) chooses if the request can be served thanks to a set of specific headers.</p> <p>The CORS specification distinguishes two distinct use cases:</p> <ul> <li><strong>Simple requ...
4,408,819
Adding words to spellchecker dictionary in NetBeans?
<p>My NetBeans dictionary is kind of... illiterate? It's flagging words like "website" and the "doesn" part of <code>doesn't</code>. I right-clicked expecting to see your standard <code>Add to dictionary...</code> option but found none. I browsed the menus and also found nothing.</p> <p>How do I educate my NetBeans sp...
4,643,437
1
1
null
2010-12-10 12:28:38.273 UTC
4
2012-07-28 00:39:18.403 UTC
null
null
null
null
188,930
null
1
34
netbeans|spell-checking
8,562
<p>It looks like the spell checker is a relatively recent addition. There are basic instructions on how to change the dictionary <a href="http://blogs.oracle.com/netbeansphp/entry/spellchecker" rel="noreferrer">here</a>. </p> <p>Adding an unknown word to the dictionary requires <code>alt + enter</code> while the curso...
25,426,780
How to have stored properties in Swift, the same way I had on Objective-C?
<p>I am switching an application from Objective-C to Swift, which I have a couple of categories with stored properties, for example:</p> <pre><code>@interface UIView (MyCategory) - (void)alignToView:(UIView *)view alignment:(UIViewRelativeAlignment)alignment; - (UIView *)clone; @property (strong) PFObject ...
43,056,053
21
2
null
2014-08-21 12:48:42.887 UTC
55
2022-06-21 10:59:18.747 UTC
2016-10-30 22:33:06.877 UTC
null
189,431
null
1,369,924
null
1
141
ios|swift|associated-object
128,168
<p>Associated objects API is a bit cumbersome to use. You can remove most of the boilerplate with a helper class.</p> <pre><code>public final class ObjectAssociation&lt;T: AnyObject&gt; { private let policy: objc_AssociationPolicy /// - Parameter policy: An association policy that will be used when linking o...
25,194,631
Is it possible to always show up/down arrows for input "number"?
<p>I want to always show up/down arrows for input "number" field. Is this possible? So far I haven't had any luck...<br><br> <a href="http://jsfiddle.net/oneeezy/qunbnL6u/">http://jsfiddle.net/oneeezy/qunbnL6u/</a> </p> <p><strong>HTML:</strong></p> <pre><code>&lt;input type="number" /&gt; </code></pre> <p><strong>C...
25,210,414
5
3
null
2014-08-08 01:06:51.503 UTC
19
2022-05-05 06:00:16.18 UTC
null
null
null
null
301,250
null
1
101
html|css|input|webkit|shadow-dom
115,085
<p>You can achieve this (in Chrome at least) by using the Opacity property:</p> <pre><code>input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { opacity: 1; } </code></pre> <p>As stated above, this will likely only work in Chrome. So be careful using this code in the w...
25,421,479
Clang and undefined symbols when building a library
<p>I'm working on a C++ framework, and there's a few issues when I compile it on OSX with Clang.</p> <p>First of, I'm using some other libraries, such as openssl, and clang complains that some symbols aren't solved when I build the library. They shouldn't be: these libraries will be linked with the final binary, it sh...
25,442,543
3
3
null
2014-08-21 08:19:46.807 UTC
10
2015-06-19 09:13:18.94 UTC
2014-08-21 08:31:43.803 UTC
null
626,921
null
626,921
null
1
15
c++|cmake|clang
20,978
<p>Solved it ! Clang needs to receive the option <code>-undefined dynamic_lookup</code> to ignore missing symbols when compiling a library.</p> <p>Add this to the CMakeFile.txt to produce the expected effect:</p> <pre><code>if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "$...
39,782,418
Remove punctuations in pandas
<pre><code>code: df['review'].head() index review output: 0 These flannel wipes are OK, but in my opinion </code></pre> <p>I want to remove punctuations from the column of the dataframe and create a new column.</p> <pre><code>code: import string def remove_punctuations(text): ret...
39,782,973
3
2
null
2016-09-30 01:39:04.633 UTC
10
2018-05-23 07:06:32.913 UTC
2018-05-23 07:06:32.913 UTC
null
4,909,087
null
5,927,701
null
1
25
python|string|pandas|replace
71,601
<p>Using <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.str.replace.html" rel="noreferrer">Pandas str.replace</a> and regex:</p> <pre><code>df["new_column"] = df['review'].str.replace('[^\w\s]','') </code></pre>
31,243,959
Why doesn't click event always fire?
<p><em>If you're revisiting this question I've moved all the updates to the bottom so it actually reads better as a question.</em></p> <h2>The Problem</h2> <p>I've got a bit of a strange problem handling browser events using <code>D3</code>. Unfortunately this sits in quite a large application, and because I'm comple...
39,410,041
3
31
null
2015-07-06 10:51:05.493 UTC
3
2016-09-09 10:58:29.563 UTC
2015-07-09 08:31:38.207 UTC
null
21,061
null
21,061
null
1
32
javascript|events|d3.js
5,700
<p>I recently came across this again, and fortunately have managed to isolate the problem and work around it.</p> <p>It was actually due to something being registered in the <code>mousedown</code> event, which was moving the DOM element <code>svg:circle</code> to the top based on a z-order. It does this by taking it o...
20,340,268
Get request object in Passport strategy callback
<p>So here is my configuration for passport-facebook strategy:</p> <pre><code> passport.use(new FacebookStrategy({ clientID: ".....", clientSecret: ".....", callbackURL: "http://localhost:1337/register/facebook/callback", }, facebookVerificationHandler )); </code></pre> <p>And h...
20,341,863
3
0
null
2013-12-02 23:57:38.017 UTC
7
2015-11-02 18:27:35.063 UTC
2015-01-06 14:50:10.18 UTC
null
1,266,650
null
365,266
null
1
48
node.js|passport.js|passport-facebook
23,033
<p>For this reason instead of setting up the strategy when the application starts I usually setup the strategy when there is a request. for instance:</p> <pre><code>app.get( '/facebook/login' ,passport_setup_strategy() ,passport.authenticate() ,redirect_home() ); var isStrategySetup = false; var passp...
6,399,924
Getting node's text in PHP DOM
<p>How could I extract the string "text" from this markup using the PHP DOM?</p> <pre><code>&lt;div&gt;&lt;span&gt;notthis&lt;/span&gt;text&lt;/div&gt; </code></pre> <p><code>$div-&gt;nodeValue</code> includes "notthis"</p>
6,399,930
2
0
null
2011-06-19 01:05:12.08 UTC
4
2011-06-19 01:27:10.483 UTC
null
null
null
null
378,622
null
1
35
php|html|xml|dom
44,464
<p>So long as you can affect the DOM, you could remove that <code>span</code>.</p> <pre><code>$span = $div-&gt;getElementsByTagName('span')-&gt;item(0); $div-&gt;removeChild($span); $nodeValue = $div-&gt;nodeValue; </code></pre> <p>Alternatively, just access the text node of <code>$div</code>.</p> <pre><code>foreac...
6,783,365
ASP.NET MVC - how to get a full path to an action
<p>Inside of a View can I get a full route information to an action? </p> <p>If I have an action called DoThis in a controller MyController. Can I get to a path of <code>"/MyController/DoThis/"</code>? </p>
6,783,381
2
0
null
2011-07-21 22:02:06.393 UTC
4
2018-01-10 05:04:48.017 UTC
null
null
null
null
37,759
null
1
38
asp.net-mvc|asp.net-mvc-routing
31,172
<p>You mean like using the <a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.urlhelper.action.aspx">Action</a> method on the Url helper:</p> <pre><code>&lt;%= Url.Action("DoThis", "MyController") %&gt; </code></pre> <p>or in Razor:</p> <pre><code>@Url.Action("DoThis", "MyController") </code></pre> <p>...
14,539,328
How to get a string from another class?
<p>Searched everywhere trying to find how to do this. I want to get a string from one class that i set the variable before going into the second class and allow me to use it as a string in this class. </p> <p>Basically there's a String called LastName that i want to use in another class.</p> <p>Here's my code if need...
14,539,388
3
3
null
2013-01-26 17:07:42.74 UTC
3
2013-01-26 17:28:59.31 UTC
2013-01-26 17:20:01.05 UTC
null
1,888,770
null
1,888,770
null
1
1
java|string|class
41,781
<p>I can see you are probably quite new to Java - so you may be lacking a few fundamentals.</p> <p>Probably best to just pass the string in as a parameter to the method in your case e.g.</p> <pre><code>public void WelcomeAgent(String lastName) { </code></pre> <p>and when you call the method, send that value in e.g.<...
7,480,437
ASP.Net - App_Data & App_Code folders?
<p>What is the point of having <code>App_code</code> &amp; <code>App_data</code> folders?</p> <p>Why doesn't my objectDataSource detect classes unless files are in App_Code?</p> <p>Please provide as much detail as you can, I'm new to ASP.Net</p>
7,480,545
3
0
null
2011-09-20 05:11:58.84 UTC
3
2017-08-24 06:23:26.287 UTC
2011-09-20 05:28:58.067 UTC
null
142,822
null
242,769
null
1
31
asp.net|app-code|app-data
56,441
<p>These folders have special purpose. From this article - <a href="http://msdn.microsoft.com/en-us/library/ex526337.aspx" rel="noreferrer">ASP.NET Web project folder structure.</a> </p> <p>App_Code</p> <hr> <p>App_Code contains source code for shared classes and business objects (for example, ..cs, and .vb files) ...
7,382,149
What's the purpose of Django setting ‘SECRET_KEY’?
<p>I did a few google searches and checked out the docs ( <a href="https://docs.djangoproject.com/en/dev/ref/settings/#secret-key" rel="noreferrer">https://docs.djangoproject.com/en/dev/ref/settings/#secret-key</a> ), but I was looking for a more in-depth explanation of this, and why it is required.</p> <p>For example,...
7,382,198
3
4
null
2011-09-11 23:59:01.74 UTC
26
2020-11-23 06:34:07.63 UTC
2020-11-23 06:34:07.63 UTC
null
1,038,379
null
651,174
null
1
228
python|django|security|encryption
102,067
<p>It is used for making hashes. Look:</p> <pre><code>&gt;grep -Inr SECRET_KEY * conf/global_settings.py:255:SECRET_KEY = '' conf/project_template/settings.py:61:SECRET_KEY = '' contrib/auth/tokens.py:54: hash = sha_constructor(settings.SECRET_KEY + unicode(user.id) + contrib/comments/forms.py:86: info ...
7,336,354
Subtracting n Days from a date using SQL
<p>I am quite a beginner when it comes to Oracle. I am having trouble figuring out how to do something similar to this :</p> <pre><code>SELECT ID, NAME, TO_CHAR(DATEBIRTH, 'DD/MM/YYYY HH24:MI:SS') FROM PEOPLE WHERE DATEBIRTH &gt;= ANOTHERDATE - NDAY </code></pre> <p>To put it short, I want to select everyone who wer...
7,336,402
4
6
null
2011-09-07 15:20:02.64 UTC
1
2016-08-31 06:13:54.387 UTC
2011-09-07 16:36:10.04 UTC
null
146,325
null
932,614
null
1
7
sql|oracle|date-arithmetic|oracle8i
60,510
<p>Your query looks correct to me. That's how you subtract days from dates in Oracle. This link holds some more insight for you, should you want to add months or years:</p> <p><a href="http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1157035034361" rel="noreferrer">http://asktom.oracle.com/pls/askto...
7,799,438
Simple Maths with jQuery - division
<p>I've got two inputs in a div that I want to divide one by the other.</p> <pre><code>&lt;div&gt; &lt;input type="number" id="a"&gt; / &lt;input type="number" id="b"&gt; &lt;input type="submit"&gt; &lt;p class="result"&gt;RESULT HERE&lt;/p&gt; &lt;/div&gt; </code></pre> <p>How can the maths of this be done with...
7,799,465
2
3
null
2011-10-17 20:52:54.783 UTC
null
2011-10-17 21:18:28.203 UTC
2011-10-17 21:01:05.877 UTC
null
137,041
null
137,041
null
1
0
javascript|jquery|math|division
47,091
<p>It really depends when you want the calculation to take place, but the maths itself is incredibly simple. Just use the standard <a href="https://developer.mozilla.org/en/JavaScript/Reference/Operators/Arithmetic_Operators">division operator</a>, <code>/</code>:</p> <pre><code>var num1 = $("input[label='a']").val(),...
2,118,578
Any practical coding dojo/kata ideas?
<p>I've been asked to run a workshop and coding dojo soon for people to try out Scala and try to build something with it. The attendees are all going to be new to Scala, and could come from any of a number of languages (I'm presuming they can code in at least one mainstream language - I'm including syntax comparisons w...
2,118,645
4
2
2010-01-22 17:53:51.057 UTC
2010-01-22 16:08:49.05 UTC
15
2018-03-12 00:41:26.367 UTC
2015-01-23 17:39:56.217 UTC
null
1,014,938
null
167,435
null
1
18
scala
6,522
<p>There is a creative commons licensed introductory training course with hands-on exercises here:</p> <p><a href="http://github.com/javaBin/scala-training-slides" rel="noreferrer">http://github.com/javaBin/scala-training-slides</a></p> <p><a href="http://github.com/javaBin/scala-training-code" rel="noreferrer">http:...
52,689,049
Flutter - Navigate to a new screen, and clear all the previous screens
<p>I used <code>Navigator.push</code> up to 6 screens to get to the payment page. After Payment, I want to push to the "Payment Successful" page then remove all the previous screens i.e using the back button will return to the very first screen.</p> <p>NOTE: I have tried <code>pushReplacementNamed</code> and it doesn...
52,689,158
4
4
null
2018-10-07 13:39:44 UTC
11
2022-04-14 10:47:56.193 UTC
null
null
null
null
4,083,636
null
1
43
android|dart|flutter
48,585
<p>I figured it out. It was the <code>Navigator.pushAndRemoveUntil</code> function. Where i had to pass the <code>PaymentSuccessful</code> widget as the <code>newRoute</code>, and the <code>"/Home"</code> route as the predicate</p> <pre><code> _navPaymentSuccessful(){ Navigator.pushAndRemoveUntil( context, ...
49,482,753
sdl2 - ImportError: DLL load failed: The specified module could not be found and [CRITICAL] [App] Unable to get a Window, abort
<ul> <li>Python: 3.6.4</li> <li>OS: Windows 10</li> <li>Kivy: 1.10.0</li> </ul> <h3>Kivy Installation Method</h3> <pre><code>python -m pip install --upgrade pip wheel setuptools python -m pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew python -m pip install kivy.deps.gstreamer python -m pip inst...
51,241,411
7
4
null
2018-03-26 01:28:39.02 UTC
11
2021-12-15 00:02:48.09 UTC
null
null
null
null
9,550,081
null
1
21
python|dll|kivy|sdl-2
26,114
<p>I had the same problem. I solved this by removing Kivy and its dependencies first.</p> <pre><code>python -m pip uninstall kivy python -m pip uninstall kivy.deps.sdl2 python -m pip uninstall kivy.deps.glew python -m pip uninstall kivy.deps.gstreamer python -m pip uninstall image </code></pre> <p>Now reinstalling ...
49,457,787
How to Export a Multi-line Environment Variable in Bash/Terminal e.g: RSA Private Key
<p>One of our Apps <a href="https://github.com/dwyl/github-backup" rel="noreferrer"><code>github-backup</code></a> requires the use of an RSA Private Key as an Environment Variable.</p> <p>Simply attempting to export the key it in the terminal e.g: <code>text export PRIVATE_KEY=-----BEGIN RSA PRIVATE KEY----- MIIEpAIB...
49,489,260
7
5
null
2018-03-23 20:24:13.643 UTC
16
2021-09-26 12:04:31.84 UTC
2020-08-19 20:07:52.457 UTC
null
9,205,413
null
1,148,249
null
1
84
bash|shell|environment-variables|multiline|private-key
93,516
<p><strong>export the key</strong></p> <pre><code>export PRIVATE_KEY=`cat ./gitbu.2018-03-23.private-key.pem` </code></pre> <p><strong>test.sh</strong></p> <pre><code>#!/bin/bash echo &quot;$PRIVATE_KEY&quot;; </code></pre> <p>If you want to save the key to a <code>.env</code> file with the rest of your environment v...
26,082,444
how to work around Travis CIs 4MB output limit?
<p>I have a Travis CI build that produces more than 4MB of output which exceeds Travis CIs limit.</p> <p>I have tried sending output to /dev/null, but Travis also fails if no output is seen for 10 minutes</p> <p>How can I workaround these constraints? </p>
26,082,445
3
1
null
2014-09-28 06:55:57.1 UTC
10
2019-10-23 11:15:42.62 UTC
null
null
null
null
1,033,422
null
1
21
travis-ci
4,375
<p>The following script sends some dummy output to keep the build alive but also records the build output to a file and displays a tail of the output if the build returns an error:</p> <pre><code>#!/bin/bash # Abort on Error set -e export PING_SLEEP=30s export WORKDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &amp;&a...
26,098,223
AngularJs code to navigate to another page in buttonclick
<p>AngularJs code to navigate to another page on a button click event. I have catch the button click event but cannot navigate to another page. The following is my code: HTML file:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;script src="js/angular.min.js"&gt;&lt;/script&gt; &lt;script src="j...
26,104,602
3
1
null
2014-09-29 10:55:11.333 UTC
null
2014-09-29 16:30:25.283 UTC
2014-09-29 12:06:28.39 UTC
null
403,132
null
3,986,191
null
1
2
angularjs
56,027
<p>Try like as shown below...</p> <p>In html,</p> <pre><code> &lt;button ng-click="clicked()"&gt;Click&lt;/button&gt; </code></pre> <p>In JS,</p> <pre><code> $scope.clicked = function(){ window.location = "#/test.html"; } </code></pre> <p>I hope it helps you...</p>
7,394,748
What's the right way to decode a string that has special HTML entities in it?
<p>Say I get some JSON back from a service request that looks like this:</p> <pre><code>{ "message": "We&amp;#39;re unable to complete your request at this time." } </code></pre> <p>I'm not sure <em>why</em> that apostraphe is encoded like that (<code>&amp;#39;</code>); all I know is that I want to decode it.</p>...
7,394,787
7
1
null
2011-09-12 22:26:30.137 UTC
83
2022-08-25 16:13:52.083 UTC
null
null
null
null
105,570
null
1
266
javascript|jquery|html-entities
328,967
<p>This is my favourite way of decoding HTML characters. The advantage of using this code is that tags are also preserved.</p> <pre><code>function decodeHtml(html) { var txt = document.createElement("textarea"); txt.innerHTML = html; return txt.value; } </code></pre> <p>Example: <a href="http://jsfiddle.n...
14,279,977
How to Casting DataSource to List<T>?
<p>I have the following method that load products on a DataGridView</p> <pre><code>private void LoadProducts(List&lt;Product&gt; products) { Source.DataSource = products; // Source is BindingSource ProductsDataGrid.DataSource = Source; } </code></pre> <p>And now I'm trying to give me back to save them as sho...
14,280,037
4
1
null
2013-01-11 14:16:17.683 UTC
null
2018-10-11 15:50:34.39 UTC
2018-02-13 09:52:38.787 UTC
null
3,467,532
null
1,093,674
null
1
19
c#|winforms|datagridview|casting|datasource
41,424
<p>You can't cast covariantly directly to List;</p> <p>Either:</p> <pre><code>List&lt;Product&gt; products = (List&lt;Product&gt;)Source.DataSource; </code></pre> <p>or:</p> <pre><code>List&lt;Object&gt; products = ((List&lt;Product&gt;)Source.DataSource).Cast&lt;object&gt;().ToList(); </code></pre>
13,993,750
The async and await keywords don't cause additional threads to be created?
<p>I'm confused. How can one or many <code>Task</code> run in parallel on a single thread? My understanding of <em>parallelism</em> is obviously wrong.</p> <p>Bits of MSDN I can't wrap my head around:</p> <blockquote> <p>The async and await keywords don't cause additional threads to be created. Async methods don'...
13,993,802
1
0
null
2012-12-21 16:29:38.377 UTC
11
2014-02-19 18:31:01.727 UTC
2014-02-19 18:31:01.727 UTC
null
79,152
null
79,152
null
1
26
c#|multithreading|task-parallel-library|async-await|conceptual
3,495
<p>They don't run in parallel, they take turns. When progress is blocked for the running Task, it stores its state and yields control to a ready Task. It's cooperative multitasking, not true parallelism.</p> <p>Threads operate on the sample principle. However there are several key differences I'd like to highlight....
13,792,553
Write JavaScript in Chrome developer tools
<p>In Firebug, I can type my own JavaScript in the console tab and execute it. Is there a way to type JavaScript in Chrome Developer Tools and execute it?</p>
13,797,341
4
1
null
2012-12-09 22:31:21.523 UTC
26
2017-11-25 04:51:50.757 UTC
2012-12-14 17:51:21.637 UTC
null
896,886
null
896,886
null
1
28
google-chrome-devtools
45,719
<ol> <li>Go to <code>chrome://flags/</code>, enable the "Enable Developer Tools experiments" flag and restart Chrome (or start it with the <code>--enable-devtools-experiments</code> command-line flag.)</li> <li>Open DevTools, go to the <code>Settings</code> dialog, switch to the <code>Experiments</code> tab.</li> <li>E...
13,960,514
How to adapt my plugin to Multisite?
<p>I have many plugins that I wrote for WordPress, and now I want to adapt them to MU.<br> What are the <em>considerations / best practices / workflow / functions / pitfalls</em> that I have to <em>follow / avoid / adapt</em> in order to 'upgrade' my plugins to support also Multisite installations? </p> <p>For example...
15,940,351
1
0
null
2012-12-19 20:19:31.09 UTC
31
2014-09-18 22:22:14.38 UTC
2013-04-11 05:52:20.45 UTC
null
1,287,812
null
1,244,126
null
1
34
php|wordpress
22,269
<p>As for enqueuing and including, things go as normal. Plugin path and URL are the same.</p> <p>I never dealt with anything related to upload paths in Multisite and I guess normally WP takes care of this.</p> <hr> <h1><code>$wpdb</code></h1> <p>There is a commonly used snippet to iterate through all blogs:</p> <p...
13,996,302
Python - rolling functions for GroupBy object
<p>I have a time series object <code>grouped</code> of the type <code>&lt;pandas.core.groupby.SeriesGroupBy object at 0x03F1A9F0&gt;</code>. <code>grouped.sum()</code> gives the desired result but I cannot get rolling_sum to work with the <code>groupby</code> object. Is there any way to apply rolling functions to <code...
13,998,600
5
4
null
2012-12-21 19:49:00.067 UTC
25
2021-03-18 13:16:59.983 UTC
2019-06-29 03:26:37.933 UTC
user1642513
202,229
user1642513
null
null
1
78
python|pandas|pandas-groupby|rolling-computation|rolling-sum
121,364
<h3>cumulative sum</h3> <p>To answer the question directly, the cumsum method would produced the desired series:</p> <pre><code>In [17]: df Out[17]: id x 0 a 0 1 a 1 2 a 2 3 b 3 4 b 4 5 b 5 In [18]: df.groupby('id').x.cumsum() Out[18]: 0 0 1 1 2 3 3 3 4 7 5 12 Name: x, dtype: int6...
28,937,392
JavaFX Alerts and their size
<p>Recently, JavaFX introduced Alerts (Java 8u40). </p> <p>Consider the code example below. How can I display a full message that is longer than just a few words? My messages (<code>contentText</code> property) get cut at the end with <code>...</code> and the Alert does not adjust its size properly in my opinion.</p> ...
36,938,061
5
3
null
2015-03-09 08:00:30.93 UTC
11
2020-10-02 20:20:57.503 UTC
2015-03-09 12:24:19.61 UTC
null
970,752
null
970,752
null
1
41
java|javafx|dialog|alert
38,214
<p>I have made the following workaround:</p> <pre><code>Alert alert = new Alert(AlertType.INFORMATION, "Content here", ButtonType.OK); alert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE); alert.show(); </code></pre> <p>So the window will resize automatically according to the content.</p>
28,999,906
'require': cannot load such file -- 'nokogiri\nokogiri' (LoadError) when running `rails server`
<p>I'm running a clean install of Ruby 2.2.1 on Windows 8.1 with DevKit. After the installation I run:</p> <pre><code>gem install rails rails new testapp cd testapp rails server </code></pre> <p>leaving everything else at default.</p> <p>The process fails at the last line when, instead of running the server, I get t...
29,007,731
4
3
null
2015-03-12 00:24:40.847 UTC
18
2021-10-08 03:44:05.7 UTC
2015-10-13 19:44:11.867 UTC
null
128,421
null
2,079,775
null
1
68
ruby-on-rails|ruby|nokogiri
73,943
<p>Nokogiri doesn't support Ruby 2.2 on Windows yet. The next release will. See <a href="https://github.com/sparklemotion/nokogiri/issues/1256" rel="noreferrer">https://github.com/sparklemotion/nokogiri/issues/1256</a></p> <p>Nokogiri doesn't support native builds (e.g. with devkit) on Windows. Instead it provides gem...
43,330,915
Could not load file or assembly 'Microsoft.Build.Framework'(VS 2017)
<p>When I try running the command "update-database", I get this exception:</p> <blockquote> <p>Specify the '-Verbose' flag to view the SQL statements being applied to the target database. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Build.Framework, Version=15.1.0.0, Culture=...
43,498,190
23
2
null
2017-04-10 18:55:46.177 UTC
21
2022-09-16 01:35:52.8 UTC
2018-01-29 23:07:12.743 UTC
null
2,718,874
null
5,411,355
null
1
101
c#|msbuild|migration|visual-studio-2017
80,191
<p>I believe I had the same issue as you did. I didn't save the whole error message, but my error message was</p> <blockquote> <p>'<em>Could not load file or assembly 'Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find...
44,636,549
Why is there no support for concatenating std::string and std::string_view?
<p>Since C++17, we have <a href="http://en.cppreference.com/w/cpp/string/basic_string_view" rel="noreferrer"><code>std::string_view</code></a>, a light-weight view into a contiguous sequence of characters that avoids unnecessary copying of data. Instead of having a <code>const std::string&amp;</code> parameter, it is n...
47,735,624
2
6
null
2017-06-19 17:26:55.05 UTC
13
2022-06-02 13:41:51.877 UTC
2020-07-02 23:13:32.18 UTC
null
471,164
null
2,580,955
null
1
115
c++|string|c++17|string-view
18,904
<p>The reason for this is given in <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3512.html" rel="noreferrer">n3512 string_ref: a non-owning reference to a string, revision 2</a> by Jeffrey Yasskin:</p> <blockquote> <p>I also omitted operator+(basic_string, basic_string_ref) because LLVM returns a...
24,573,643
How to generate serial version UID in Intellij
<p>When I used <strong><em>Eclipse</em></strong> it had a nice feature to generate serial version UID.</p> <p>But what to do in IntelliJ? </p> <p><strong><em>How to choose or generate identical serial version UID in IntelliJ?</em></strong></p> <p>And what to do when you modify old class?</p> <p>If you haven't speci...
36,007,392
4
3
null
2014-07-04 11:50:55.73 UTC
35
2022-07-14 07:58:41.473 UTC
2017-11-02 12:13:37.62 UTC
null
5,180,989
null
1,498,427
null
1
207
java|serialization|intellij-idea
193,811
<p>Without any plugins:</p> <p>You just need to enable highlight: (Idea v.2016, 2017 and 2018, previous versions may have same or similar settings)</p> <blockquote> <p>File -&gt; Settings -&gt; Editor -&gt; Inspections -&gt; Java -&gt; Serialization issues -&gt; Serializable class without 'serialVersionUID' - set flag ...
788,786
how to write a complete server client communication using java nio
<p>I am new to java NIO. I have to write a simple server client communication program using Java NIO.</p> <p>Is there any sample programs or any link where can I go for this?</p>
788,879
5
0
null
2009-04-25 12:10:01 UTC
13
2014-10-08 23:01:52.703 UTC
2014-10-08 23:01:23.173 UTC
null
125,389
null
94,352
null
1
7
java|sockets|nio
16,234
<p>You might give a look at <a href="http://mina.apache.org/" rel="nofollow noreferrer">Apache Mina</a>. If you only want to learn java NIO it might me a little to hard to grasp.</p>
85,649
Safely remove a USB drive using the Win32 API?
<p>How do I remove a USB drive using the Win32 API? I do a lot of work on embedded systems and on one of these I have to copy my programs on a USB stick and insert it into the target hardware.</p> <p>Since I mostly work on the console I don't like to use the mouse and click on the small task-bar icon hundred times a d...
85,694
5
2
null
2008-09-17 17:33:07.5 UTC
16
2020-10-16 01:45:45.64 UTC
2014-12-01 12:33:05.777 UTC
monjardin
63,550
Nils
15,955
null
1
31
c|windows|winapi|usb
38,219
<p>You can use the CM_Request_Device_Eject() function as well as some other possibilities. Consult the following projects and articles:</p> <p>DevEject: Straightforward. <a href="http://www.withopf.com/tools/deveject/" rel="noreferrer">http://www.withopf.com/tools/deveject/</a></p> <p>A useful CodeProject article: <a...
122,853
How to get the file size from http headers
<p>I want to get the size of an http:/.../file before I download it. The file can be a webpage, image, or a media file. Can this be done with HTTP headers? How do I download just the file HTTP header?</p>
122,984
5
0
null
2008-09-23 18:31:42.917 UTC
26
2022-03-08 13:21:51.43 UTC
2017-03-23 18:40:45.57 UTC
null
1,664,443
Greg
null
null
1
70
c#|http|download|http-headers
61,368
<p>Yes, assuming the HTTP server you're talking to supports/allows this:</p> <pre><code>public long GetFileSize(string url) { long result = -1; System.Net.WebRequest req = System.Net.WebRequest.Create(url); req.Method = "HEAD"; using (System.Net.WebResponse resp = req.GetResponse()) { if (...
1,298,636
How to set initial size for a dictionary in Python?
<p>I'm putting around 4 million different keys into a Python dictionary. Creating this dictionary takes about 15 minutes and consumes about 4GB of memory on my machine. After the dictionary is fully created, querying the dictionary is fast.</p> <p>I suspect that dictionary creation is so resource consuming because the ...
1,298,905
6
4
null
2009-08-19 09:06:30.4 UTC
13
2021-05-20 04:32:32.627 UTC
2021-05-20 04:32:32.627 UTC
null
3,064,538
null
42,201
null
1
29
python|performance|dictionary
38,845
<p>With performance issues it's always best to measure. Here are some timings:</p> <pre><code> d = {} for i in xrange(4000000): d[i] = None # 722ms d = dict(itertools.izip(xrange(4000000), itertools.repeat(None))) # 634ms dict.fromkeys(xrange(4000000)) # 558ms s = set(xrange(4000000)) dict.fromkeys(s) ...
1,082,311
Why should a .NET struct be less than 16 bytes?
<p>I've read in a few places now that the maximum instance size for a struct should be 16 bytes.</p> <p>But I cannot see where that number (16) comes from.</p> <p>Browsing around the net, I've found some who suggest that it's an approximate number for good performance but Microsoft talk like it is a hard upper limit....
1,082,340
6
0
null
2009-07-04 14:36:47.223 UTC
9
2021-04-12 01:40:00.83 UTC
2009-07-04 14:58:02.733 UTC
null
76,337
null
92,232
null
1
64
c#|.net
15,329
<p>It is just a performance rule of thumb.</p> <p>The point is that because value types are passed by value, the entire size of the struct has to be copied if it is passed to a function, whereas for a reference type, only the reference (4 bytes) has to be copied. A struct might save a bit of time though because you re...
453,372
Writing function definition in header files in C++
<p>I have a class which has many small functions. By small functions, I mean functions that doesn't do any processing but just return a literal value. Something like:</p> <pre><code>string Foo::method() const{ return "A"; } </code></pre> <p>I have created a header file "Foo.h" and source file "Foo.cpp". But since...
453,387
6
0
null
2009-01-17 14:36:22.04 UTC
27
2018-11-01 11:57:11.1 UTC
2017-05-22 07:43:33.52 UTC
Ferruccio
2,291,710
Appu
50,419
null
1
65
c++|performance|header-files
105,357
<p>If the function is small (the chance you would change it often is low), and if the function can be put into the header without including myriads of other headers (because your function depends on them), it is perfectly valid to do so. If you declare them extern inline, then the compiler is required to give it the sa...
978,052
How can I make my local repository available for git-pull?
<p>I have a working copy repository that I've been working in no problem; the origin for this repository is on GitHub. </p> <p>I'd like to make my working copy repository available as the origin for my build machine (a VM on another physical host), so that commits I make to my working copy can be built and tested on ...
978,417
6
1
null
2009-06-10 20:45:41.883 UTC
33
2015-11-11 07:44:36.573 UTC
2015-11-11 07:28:48.507 UTC
null
248,296
null
5,296
null
1
91
git|pull|git-pull|working-copy
81,818
<p>Five possibilities exist to set up a repository for pull from:</p> <ul> <li><strong>local filesystem</strong>: <code>git clone /path/to/repo</code> or <code>git clone file://path/to/repo</code>. Least work if you have networked filesystem, but not very efficient use of network. <em>(This is almost exactly solution ...
609,826
Performance of ThreadLocal variable
<p>How much is read from <code>ThreadLocal</code> variable slower than from regular field?</p> <p>More concretely is simple object creation faster or slower than access to <code>ThreadLocal</code> variable?</p> <p>I assume that it is fast enough so that having <code>ThreadLocal&lt;MessageDigest&gt;</code> instance is...
610,249
6
2
null
2009-03-04 09:22:41.883 UTC
18
2020-12-24 10:49:36.953 UTC
2011-11-20 00:01:20.487 UTC
Sarmun
1,502,059
Sarmun
70,173
null
1
92
java|multithreading|performance|thread-local
32,216
<p>Running unpublished benchmarks, <code>ThreadLocal.get</code> takes around 35 cycle per iteration on my machine. Not a great deal. In Sun's implementation a custom linear probing hash map in <code>Thread</code> maps <code>ThreadLocal</code>s to values. Because it is only ever accessed by a single thread, it can be ve...
357,600
Is const_cast safe?
<p>I can't find much information on <code>const_cast</code>. The only info I could find (on Stack Overflow) is:</p> <blockquote> <p>The <code>const_cast&lt;&gt;()</code> is used to add/remove const(ness) (or volatile-ness) of a variable.</p> </blockquote> <p>This makes me nervous. Could using a <code>const_cast</...
357,607
6
2
null
2008-12-10 21:01:13.417 UTC
40
2017-08-28 11:57:40.377 UTC
2017-08-28 11:57:40.377 UTC
Mag Roader
5,612,562
Mag Roader
10,606
null
1
96
c++|casting|const-cast
50,838
<p><code>const_cast</code> is safe only if you're casting a variable that was originally non-<code>const</code>. For example, if you have a function that takes a parameter of a <code>const char *</code>, and you pass in a modifiable <code>char *</code>, it's safe to <code>const_cast</code> that parameter back to a <co...
37,725,934
ASP.NET Core MVC controllers in separate assembly
<p>I'm using ASP.NET MVC Core RC-2. I have a web project targeting the full .NET framework. I also have a separate class library in the solution, also targeting the full framework.</p> <p>In the class library, I have a controller, marked with a route attribute. I have referenced the class library from the web project....
37,735,487
2
2
null
2016-06-09 12:23:52.46 UTC
6
2018-10-16 15:50:41.223 UTC
2017-05-23 12:03:07.5 UTC
null
-1
null
619,759
null
1
43
asp.net-core-mvc|asp.net-core-1.0
28,919
<p>I believe you are hitting the following known issue in RC2. <a href="https://github.com/aspnet/Mvc/issues/4674" rel="noreferrer">https://github.com/aspnet/Mvc/issues/4674</a> (workaround is mentioned in the bug)</p> <p>This has been fixed since then but will only be available in next release (unless you are ok wit...
38,002,543
apt-get update' returned a non-zero code: 100
<p>I am trying to create a docker image from my docker file which has the following content:</p> <pre><code>FROM ubuntu:14.04.4 RUN echo 'deb http://private-repo-1.hortonworks.com/HDP/ubuntu14/2.x/updates/2.4.2.0 HDP main' &gt;&gt; /etc/apt/sources.list.d/HDP.list RUN echo 'deb http://private-repo-1.hortonworks.com/HDP...
38,004,106
9
3
null
2016-06-23 21:55:45.007 UTC
13
2022-09-20 11:32:57.923 UTC
2021-01-22 22:54:47.127 UTC
null
11,154,841
null
3,579,198
null
1
89
ubuntu|docker|dockerfile
153,787
<p>Because you have an https sources. Install <code>apt-transport-https</code> before executing update.</p> <pre><code>FROM ubuntu:14.04.4 RUN apt-get update &amp;&amp; apt-get install -y apt-transport-https RUN echo 'deb http://private-repo-1.hortonworks.com/HDP/ubuntu14/2.x/updates/2.4.2.0 HDP main' &gt;&gt; /etc/ap...
17,819,710
Is there any way to convert a Map to a JSON representation using Jackson without writing to a file?
<p>I'm trying to use Jackson to convert a HashMap to a JSON representation.</p> <p>However, all the ways I've seen involve writing to a file and then reading it back, which seems really inefficient. I was wondering if there was anyway to do it directly? </p> <p>Here's an example of an instance where I'd like to do it...
17,821,453
2
1
null
2013-07-23 19:49:06.51 UTC
2
2016-04-05 13:04:19.967 UTC
2015-07-31 07:25:18.573 UTC
null
1,082,449
user2494770
null
null
1
33
java|json|jackson
68,350
<p>Pass your Map to <code>ObjectMapper.writeValueAsString(Object value)</code></p> <p>It's more efficient than using <code>StringWriter</code>, <a href="http://jackson.codehaus.org/1.7.9/javadoc/org/codehaus/jackson/map/ObjectMapper.html#writeValueAsString%28java.lang.Object%29">according to the docs</a>:</p> <blockq...
1,389,431
How to check if JSON object is empty in PHP?
<p>I'm reading JSON data with PHP and that data contains empty objects (like <code>{}</code>). So the problem is, I have to handle the case when object is empty in different manner but I can't find good enough way to do the check. <code>empty(get_object_vars(object))</code> looks too scary and very inefficient. Is ther...
1,389,591
5
1
null
2009-09-07 13:28:10.917 UTC
6
2018-01-03 16:30:07.263 UTC
2018-01-03 16:30:07.263 UTC
null
3,995,261
null
6,258
null
1
24
php|json
65,725
<p>How many objects are you unserializing? Unless <code>empty(get_object_vars($object))</code> or casting to array proves to be a major slowdown/bottleneck, I wouldn't worry about it – Greg's solution is just fine.</p> <p>I'd suggest using the the <code>$associative</code> flag when decoding the JSON data, though: </p...
1,615,813
How to use C++ classes with ctypes?
<p>I'm just getting started with ctypes and would like to use a C++ class that I have exported in a dll file from within python using ctypes. So lets say my C++ code looks something like this:</p> <pre class="lang-c++ prettyprint-override"><code>class MyClass { public: int test(); ... </code></pre> <p>I would k...
1,616,143
5
0
null
2009-10-23 20:51:00.747 UTC
28
2022-09-12 06:43:52.683 UTC
2015-01-23 18:57:30.083 UTC
null
3,204,551
null
89,987
null
1
65
c++|python|ctypes
60,400
<p>The short story is that there is no standard binary interface for C++ in the way that there is for C. Different compilers output different binaries for the same C++ dynamic libraries, due to name mangling and different ways to handle the stack between library function calls.</p> <p>So, unfortunately, there really ...
1,775,005
"super star" or find the word under the cursor equivalent in emacs
<p>I'm a vim user and have recently been trying out emacs for fun. I find that the feature I'm missing most so far from vim is the "<a href="http://vim.wikia.com/wiki/VimTip1" rel="noreferrer">super star</a>" (find the word under the cursor by typing *) feature, and I have yet to find the equivalent in emacs. If it's...
1,775,184
6
3
null
2009-11-21 09:16:34.087 UTC
13
2019-02-13 15:45:11.86 UTC
null
null
null
null
214,302
null
1
33
search|vim|emacs|editor
8,447
<p>As <a href="/questions/1775005/super-star-or-find-the-word-under-the-cursor-equivalent-in-emacs#comment54758673_1775184">pointed out</a> by <a href="/users/556072/paldepind">paldepind</a>, <code>isearch-forward-symbol-at-point</code> (<kbd>M-s</kbd><kbd>.</kbd>, by default) is a close equivalent to <kbd>*</kbd> in V...
2,261,480
In Joda-Time, set DateTime to start of month
<p>My API allows library client to pass Date:</p> <pre><code>method(java.util.Date date) </code></pre> <p>Working with <a href="http://www.joda.org/joda-time/" rel="noreferrer">Joda-Time</a>, from this date I would like to extract the month and iterate over all days this month contains.</p> <p>Now, the passed date i...
2,261,547
6
3
null
2010-02-14 14:56:10.023 UTC
6
2020-08-20 12:12:04.443 UTC
2013-11-25 23:34:14.477 UTC
null
642,706
null
48,062
null
1
34
java|date|jodatime
39,190
<p>Midnight at the start of the first day of the current month is given by:</p> <pre><code>// first midnight in this month DateMidnight first = new DateMidnight().withDayOfMonth(1); // last midnight in this month DateMidnight last = first.plusMonths(1).minusDays(1); </code></pre> <p>If starting from a java.util.Date...
1,525,605
Programmatically get parent pid of another process?
<p>I tried google, but found <code>getppid()</code> which gets the parent pid of the <em>current</em> process.</p> <p>I need something like <code>getppid(some_other_pid)</code>, is there such a thing? Basically takes the pid of some process and returns the parent process' pid.</p>
1,525,673
7
2
null
2009-10-06 13:30:10.663 UTC
9
2022-09-12 21:55:43.48 UTC
2022-09-12 18:33:13.613 UTC
null
224,132
null
35,364
null
1
33
linux|process|operating-system|pid
23,570
<p>I think the simplest thing would be to open &quot;/proc&quot; and parse the contents.</p> <p>You'll find the ppid as the 4th parameter of /proc/pid/stat</p> <p>In C, libproc has a <code>get_proc_stats</code> function for parsing that file: see <a href="https://stackoverflow.com/questions/35399271/given-a-child-pid-h...
1,398,664
Enum.GetValues() Return Type
<p>I have read the documentation that states that &quot;given the type of the enum, the GetValues() method of System.Enum will return an array of the given enum's base type&quot; i.e. int, byte, etc.</p> <p>However, I have been using the GetValues() method and all I keep getting back is an array of type Enums. Am I mis...
1,398,668
7
2
null
2009-09-09 09:54:16.51 UTC
6
2022-08-26 01:11:42.37 UTC
2022-08-26 01:11:42.37 UTC
null
1,402,846
null
109,288
null
1
73
c#|enums
80,892
<p>You need to cast the result to the actual array type you want</p> <pre><code>(Response[])Enum.GetValues(typeof(Response)) </code></pre> <p>as GetValues isn't strongly typed</p> <p>EDIT: just re-read the answer. You need to explicitly cast each enum value to the underlying type, as GetValues returns an array of th...
1,666,052
Java HTTPS client certificate authentication
<p>I'm fairly new to <code>HTTPS/SSL/TLS</code> and I'm a bit confused over what exactly the clients are supposed to present when authenticating with certificates.</p> <p>I'm writing a Java client that needs to do a simple <code>POST</code> of data to a particular <code>URL</code>. That part works fine, the only probl...
1,710,543
9
1
null
2009-11-03 08:51:39.66 UTC
195
2022-02-22 11:16:34.087 UTC
2019-02-25 22:28:45.24 UTC
null
9,851,598
null
201,202
null
1
262
java|ssl|https|client-certificates
448,159
<p>Finally managed to solve all the issues, so I'll answer my own question. These are the settings/files I've used to manage to get my particular problem(s) solved;</p> <p>The <strong>client's keystore</strong> is a <strong>PKCS#12 format</strong> file containing</p> <ol> <li>The client's <strong>public</strong> cert...
1,424,276
Ellipsize not working for textView inside custom listView
<p>I have a listView with custom objects defined by the xml-layout below. I want the textView with id "info" to be ellipsized on a single line, and I've tried using the attributes </p> <pre><code>android:singleLine="true" android:ellipsize="end" </code></pre> <p>without success.</p> <p>If I set the layout_width to a...
1,424,686
9
0
null
2009-09-14 22:49:57.747 UTC
15
2017-03-09 06:59:01.437 UTC
null
null
null
null
91,098
null
1
28
xml|android|textview
35,856
<p>Ellipsize is broken (go <a href="http://code.google.com/p/android/issues/detail?id=882" rel="noreferrer">vote on the bug report</a>, especially since they claim it's not reproducible) so you have to use a minor hack. Use:</p> <pre><code>android:inputType="text" android:maxLines="1" </code></pre> <p>on anything you...
1,469,994
Using 'make' on OS X
<p>I have a MacBook Pro that I'm trying to do some development on.</p> <p>I have a program I want to build, and when I went to use <code>make</code> to build it, I got a "command not found" error. I did some googling and Stack&nbsp;Overflow searches and it doesn't look like this is a common problem. Why don't I have <...
1,470,005
11
2
null
2009-09-24 06:07:25.123 UTC
18
2019-07-29 11:11:00.117 UTC
2019-07-29 11:11:00.117 UTC
null
63,550
null
63,791
null
1
73
macos|makefile|terminal
141,759
<p>Have you installed the Apple developer tools? What happens if you type gcc -v ?</p> <p>It look as if you do not have downloaded the development stuff. You can get it for free (after registration) from <a href="http://developer.apple.com/" rel="noreferrer">http://developer.apple.com/</a></p>
1,941,928
How to store data locally in .NET (C#)
<p>I'm writing an application that takes user data and stores it locally for use later. The application will be started and stopped fairly often, and I'd like to make it save/load the data on application start/end.</p> <p>It'd be fairly straightforward if I used flat files, as the data doesn't really need to be secure...
1,942,374
19
2
null
2009-12-21 19:00:40.91 UTC
46
2022-03-15 17:55:07.343 UTC
2022-03-15 17:55:07.343 UTC
null
169,713
null
169,713
null
1
79
c#|.net|xml|data-storage
186,090
<p>I'd store the file as <a href="http://www.json.org/" rel="noreferrer">JSON</a>. Since you're storing a dictionary which is just a name/value pair list then this is pretty much what json was designed for.<br> There a quite a few decent, free .NET json libraries - here's <a href="http://james.newtonking.com/projects/j...
8,642,012
Why should a Comparator implement Serializable?
<p>New to Java. Learning it while working on an Android app. I am implementing a Comparator to sort a list of files and the android docs <a href="http://developer.android.com/reference/java/util/Comparator.html" rel="noreferrer">say</a> that a Comparator should implement Serializable:</p> <blockquote> <p>It is recom...
8,642,040
5
2
null
2011-12-27 07:06:29.953 UTC
8
2016-05-09 15:22:02.797 UTC
2011-12-27 08:09:35.077 UTC
null
66,475
null
66,475
null
1
43
java|android|sorting|serialization|comparator
23,158
<p>This is not just an Android thing, the <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Comparator.html">Java SDK has the same recommendation</a>:</p> <blockquote> <p>Note: It is generally a good idea for comparators to also implement java.io.Serializable, as they may be used as ordering methods in ser...
6,678,756
Get all images from specific Facebook album with Graph API PHP SDK
<p>Hi I'm trying to grab all pictures from a specific album (always the same hardcoded id). I'm using the Graph API PHP SDK from Facebook. This is my code:</p> <pre><code>&lt;?php require 'phpfiles/facebook.php'; $facebook = new Facebook(array( 'appId' =&gt; 'aaaa', 'secret' =&gt; 'bbbb', 'cookie' =&...
6,689,492
3
1
null
2011-07-13 12:22:02.837 UTC
5
2015-08-18 06:22:37.27 UTC
null
null
null
null
229,532
null
1
8
php|facebook|facebook-graph-api
39,177
<p>I got it! It should be: <strike></p> <pre><code>$user_profile = $facebook-&gt;api('/1881235503185/photos', array('access_token' =&gt; 'cccc')); </code></pre> <p></strike></p> <p>With the new Facebook PHP SDK it should be: </p> <pre><code>$albumjson = $facebook-&gt;api('/1881235503185?fields=photos'); </code></pr...
6,918,900
Impersonate tag in Web.Config
<p>I'm using <code>impersonate</code> tag in my web.config in Asp.net 4.0 website.</p> <p><strong>Below is my Web.Config code:</strong></p> <pre><code>&lt;system.web&gt; &lt;authentication mode="Windows"&gt; &lt;identity impersonate="true" userName="Administrator" ...
6,918,964
3
0
null
2011-08-02 21:30:41.79 UTC
11
2018-08-24 12:11:10.7 UTC
2018-08-24 12:11:10.7 UTC
null
107,625
user572844
null
null
1
30
asp.net|web-config|impersonation
148,930
<p>The <code>identity</code> section goes under the <code>system.web</code> section, not under <code>authentication</code>:</p> <pre><code>&lt;system.web&gt; &lt;authentication mode="Windows"/&gt; &lt;identity impersonate="true" userName="foo" password="bar"/&gt; &lt;/system.web&gt; </code></pre>
6,640,640
Check multiple items in ASP.NET CheckboxList
<p>I try to check multiple values in ASP.NET CheckboxList but I couldn't. <br> I Wrote : </p> <pre><code>chkApplications.SelectedValue = 2; chkApplications.SelectedValue = 6; </code></pre> <p>But it just selects item with value '6'<br> What's wrong ?</p>
6,640,677
4
0
null
2011-07-10 10:49:58.747 UTC
3
2016-02-12 15:56:29.67 UTC
null
null
null
null
369,161
null
1
9
c#|asp.net|checkboxlist
42,712
<p>The best technique that will work for you is the following: </p> <pre><code>chkApplications.Items.FindByValue("2").Selected = true; chkApplications.Items.FindByValue("6").Selected = true; </code></pre> <p>OR you can simply do it like...</p> <pre><code> foreach (ListItem item in chkApplications.Items) { ...
15,701,952
Change size of arrows using matplotlib quiver
<p>I am using quiver from matplotlib to plot a vectorial field. I would like to change the size of the thickness of each arrow depending on the number of data which produced a specific arrow of the vector field. Therefore what I am looking for is not a general scale transformation of the arrow size, but the way to ...
15,702,208
2
0
null
2013-03-29 11:02:20.67 UTC
3
2018-05-29 17:48:06.31 UTC
null
null
null
null
1,234,383
null
1
12
python|matplotlib
41,246
<p>The <code>linewidths</code> parameter to <code>plt.quiver</code> controls the thickness of the arrows. If you pass it a 1-dimensional array of values, each arrow gets a different thickness. </p> <p>For example,</p> <pre><code>widths = np.linspace(0, 2, X.size) plt.quiver(X, Y, cos(deg), sin(deg), linewidths=widths...
40,257,968
Slow app compilation with new Sierra update
<p>When I updated my mac to macOS Sierra 10.12.1 time of running application on real device significantly increased. "Run custom script 'Embed Pods Frameworks'" and "Copy Swift standard libraries" take more then 30 minutes to build. </p> <p>Do someone face the same issue?</p>
40,298,722
4
5
null
2016-10-26 09:01:21.383 UTC
19
2017-07-26 14:35:17.427 UTC
2016-10-28 06:29:26.427 UTC
null
932,644
null
932,644
null
1
30
xcode|cocoapods|keychain|macos-sierra
5,467
<p>Check your keychain. After updating to Sierra to 10.12.1, I had over 500 copies one of my certificates, and a few others were duplicated a few hundred times. </p> <p>I removed all the duplicates and kept just one of each, and my code signing time went from 30 seconds per framework down to about 1 second per. </p...
57,650,692
Where to store the refresh token on the Client?
<p>My SPA application uses the following architecture (<a href="https://auth0.com/blog/refresh-tokens-what-are-they-and-when-to-use-them/" rel="noreferrer">source</a>):</p> <p><a href="https://i.stack.imgur.com/BPJjA.png" rel="noreferrer"><img src="https://i.stack.imgur.com/BPJjA.png" alt="enter image description here...
57,826,596
6
3
null
2019-08-26 00:34:31.23 UTC
41
2021-05-04 13:54:53.113 UTC
2019-09-02 01:28:45.373 UTC
null
1,189,762
null
1,189,762
null
1
94
authentication|cookies|oauth|oauth-2.0|token
83,136
<p>You can store encrypted tokens securely in <code>HttpOnly</code> cookies.</p> <p><a href="https://medium.com/@sadnub/simple-and-secure-api-authentication-for-spas-e46bcea592ad" rel="noreferrer">https://medium.com/@sadnub/simple-and-secure-api-authentication-for-spas-e46bcea592ad</a></p> <p>If you worry about long-...
57,305,227
How to use map function for hooks useState properties
<p>I tried to use map function for looping my list data in react-hooks useState but I stuck with an error that "TypeError: Cannot read property 'map' of undefined"</p> <pre><code>//1.Initial declaration const App = props=&gt; { const [state, changeState]= useState ({ name:"", eventTitle:"", details:"", ...
57,310,256
2
7
null
2019-08-01 08:53:16.5 UTC
6
2019-08-01 13:54:42.48 UTC
2019-08-01 08:57:55.32 UTC
null
6,919,895
null
11,457,419
null
1
3
reactjs|react-hooks
48,688
<p>As we suspected you are not setting your state in the right way. I tried to explain in my comment, with hooks when you set your state it does not merge the updated properties with the current one. So, you should think about that. Right now you are setting your state like that:</p> <pre><code>const handleName = name...
27,646,107
How to check if the user gave permission to use the camera?
<p>Trying to write this:</p> <pre><code>if usergavepermissiontousercamera opencamera else showmycustompermissionview </code></pre> <p>Couldn't find a current way to do this simple task.<br> Note: Should also work iOS7 even if it requires a different method</p>
27,646,311
6
3
null
2014-12-25 09:52:00.563 UTC
25
2020-08-28 08:19:24.673 UTC
null
null
null
null
2,589,276
null
1
99
ios|swift
92,125
<p>You can use the following code for doing the same:</p> <pre><code>if AVCaptureDevice.authorizationStatusForMediaType(AVMediaTypeVideo) == AVAuthorizationStatus.Authorized { // Already Authorized } else { AVCaptureDevice.requestAccessForMediaType(AVMediaTypeVideo, completionHandler: { (granted: Bool) -&gt; ...
16,098,362
How to deep copy a Binary Tree?
<p>I would like using my own Node class to implement tree structure in Java. But I'm confused how to do a deep copy to copy a tree.</p> <p>My Node class would be like this:</p> <pre><code>public class Node{ private String value; private Node leftChild; private Node rightChild; .... </code></pre> <p>I'm new to recurs...
16,098,659
7
2
null
2013-04-19 06:12:44.36 UTC
6
2021-12-28 22:59:26.88 UTC
2018-03-14 18:57:08.79 UTC
null
1,727,979
null
1,156,192
null
1
8
java|recursion|tree|treenode
39,172
<p>try</p> <pre><code>class Node { private String value; private Node left; private Node right; public Node(String value, Node left, Node right) { this.value = value; ... } Node copy() { Node left = null; Node right = null; if (this.left != null) { ...
16,262,194
file upload in cakephp 2.3
<p>I'm new in cakephp and i'm trying to create a simple file upload with cakephp 2.3 here is my controller</p> <pre><code>public function add() { if ($this-&gt;request-&gt;is('post')) { $this-&gt;Post-&gt;create(); $filename = WWW_ROOT. DS . 'documents'.DS.$this-&gt;data['posts']['doc_file']['na...
16,277,245
4
0
null
2013-04-28 11:05:05.11 UTC
3
2016-05-05 07:33:56.223 UTC
2013-04-30 23:51:05.397 UTC
null
2,328,858
null
2,328,858
null
1
9
cakephp|file-upload|cakephp-2.3
49,701
<p>You seem to be using the wrong 'key' to access the posted data;</p> <pre><code>$this-&gt;data['posts'][.... </code></pre> <p>Should match the 'alias' of you Model; <em>singular</em> and a <em>captial</em> first letter</p> <pre><code>$this-&gt;data['Post'][.... </code></pre> <p>Also, <code>$this-&gt;data</code> is a ...
410,146
Vector graphics in Javascript?
<p>One of the advantages of Flash/Flex is that you can use vector graphics (SVG), which is nice. I did a bit of searching around and came across this <a href="http://www.walterzorn.com/jsgraphics/jsgraphics_e.htm" rel="noreferrer">Javascript vector graphics library</a>. It's pretty simple stuff but it got me thinking...
410,149
7
1
null
2009-01-04 00:20:40.587 UTC
10
2019-03-02 15:17:40.573 UTC
2009-01-04 00:41:24.82 UTC
cletus
18,393
cletus
18,393
null
1
17
javascript|html|vector-graphics
17,608
<p>I've used <a href="http://raphaeljs.com/" rel="noreferrer">Raphaël Javascript Library</a> and it worked quite well. Currently the library supports Firefox 3.0+, Safari 3.0+, Opera 9.5+ and Internet Explorer 6.0+. </p>
196,754
What does "select((select(s),$|=1)[0])" do in Perl?
<p>I've seen some horrific code written in Perl, but I can't make head nor tail of this one:</p> <pre><code>select((select(s),$|=1)[0]) </code></pre> <p>It's in some networking code that we use to communicate with a server and I assume it's something to do with buffering (since it sets <code>$|</code>).</p> <p>But I...
196,768
7
1
null
2008-10-13 05:00:53.507 UTC
9
2016-10-30 01:21:17.83 UTC
2016-10-30 01:21:17.83 UTC
brian d foy
14,860
Pax Diablo
14,860
null
1
35
perl|select|buffering
11,633
<p>It's a nasty little idiom for setting autoflush on a filehandle other than STDOUT. </p> <p><code>select()</code> takes the supplied filehandle and (basically) replaces STDOUT with it, and it returns the old filehandle when it's done. </p> <p>So <code>(select($s),$|=1)</code> redirects the filehandle (remember <cod...
159,744
Converting MS Word Documents to PDF in ASP.NET
<p>Similar questions have been asked, but nothing exactly like mine, so here goes.</p> <p>We have a collection of Microsoft Word documents on an ASP.NET web server with merge fields whose values are filled in as a result of user form submissions. After the field merge, the server must convert the document to PDF and s...
204,306
8
1
null
2008-10-01 21:05:21.317 UTC
12
2012-03-24 11:51:41.657 UTC
null
null
null
glaxaco
2,144
null
1
20
asp.net|pdf|pdf-generation
52,052
<p>It's not exactly Open Source, but Aspose has a couple products which can do that,</p> <p><a href="http://www.aspose.com/categories/file-format-components/aspose.pdf.kit-for-.net-and-java/default.aspx" rel="noreferrer">Aspose.Pdf.Kit</a></p> <blockquote> <p>Aspose.Pdf.Kit is a non-graphical PDF® document manipula...
61,233
The Best Way to shred XML data into SQL Server database columns
<p>What is the best way to shred XML data into various database columns? So far I have mainly been using the nodes and value functions like so:</p> <pre><code>INSERT INTO some_table (column1, column2, column3) SELECT Rows.n.value('(@column1)[1]', 'varchar(20)'), Rows.n.value('(@column2)[1]', 'nvarchar(100)'), Rows.n.v...
4,671,129
8
2
null
2008-09-14 09:39:29.613 UTC
33
2017-07-03 14:17:37.683 UTC
null
null
null
null
5,769
null
1
28
sql-server|xml
72,311
<p>Stumbled across this question whilst having a very similar problem, I'd been running a query processing a 7.5MB XML file (~approx 10,000 nodes) for around 3.5~4 hours before finally giving up.</p> <p>However, after a little more research I found that having typed the XML using a schema and created an XML Index (I'd...
590,007
Python or IronPython
<p>How does IronPython stack up to the default Windows implementation of Python from python.org? If I am learning Python, will I be learning a subtley different language with IronPython, and what libraries would I be doing without?</p> <p>Are there, alternatively, any pros to IronPython (not including .NET IL compiled...
590,782
8
0
null
2009-02-26 10:41:16.173 UTC
5
2009-02-28 21:04:34.037 UTC
2009-02-28 21:04:34.037 UTC
null
5,302
lagerdalek
5,302
null
1
33
python|ironpython|cpython
14,911
<p>There are a number of important differences:</p> <ol> <li>Interoperability with other .NET languages. You can use other .NET libraries from an IronPython application, or use IronPython from a C# application, for example. This interoperability is increasing, with a movement toward greater support for dynamic types...
189,031
Set same icon for all my Forms
<p>Is there any way to set the same icon to all my forms without having to change one by one? Something like when you setup <code>GlobalAssemblyInfo</code> for all your projects inside your solution.</p>
189,050
8
1
null
2008-10-09 20:16:56.137 UTC
7
2020-03-03 12:51:18.3 UTC
2014-03-05 08:45:01.56 UTC
Matias
505,893
Matias
4,386
null
1
36
c#|.net|winforms|icons
31,725
<p>One option would be to inherit from a common base-Form that sets the Icon in the constructor (presumably from a resx). Another option might be <a href="http://www.postsharp.org/" rel="noreferrer">PostSharp</a> - it seems like it should be possible to do this (set .Icon) via AOP; not trivial, though. Finally, you cou...
60,160
How to escape text for regular expression in Java
<p>Does Java have a built-in way to escape arbitrary text so that it can be included in a regular expression? For example, if my users enter "$5", I'd like to match that exactly rather than a "5" after the end of input.</p>
60,161
8
0
null
2008-09-12 23:36:36.687 UTC
61
2018-11-28 21:30:48.15 UTC
null
null
null
Matt
2,338
null
1
350
java|regex|escaping
233,133
<p>Since <a href="http://download.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html#quote(java.lang.String)" rel="noreferrer">Java 1.5, yes</a>:</p> <pre><code>Pattern.quote("$5"); </code></pre>
224,026
Javascript style dot notation for dictionary keys unpythonic?
<p>I've started to use constructs like these:</p> <pre><code>class DictObj(object): def __init__(self): self.d = {} def __getattr__(self, m): return self.d.get(m, None) def __setattr__(self, m, v): super.__setattr__(self, m, v) </code></pre> <p>Update: based on this thread, I've re...
224,722
12
2
null
2008-10-22 00:08:01.41 UTC
16
2019-10-23 02:14:23.973 UTC
2008-10-24 13:17:12.723 UTC
Parand
13,055
Parand
13,055
null
1
25
python|coding-style
9,411
<p>This is a simpler version of your DictObj class:</p> <pre><code>class DictObj(object): def __getattr__(self, attr): return self.__dict__.get(attr) &gt;&gt;&gt; d = DictObj() &gt;&gt;&gt; d.something = 'one' &gt;&gt;&gt; print d.something one &gt;&gt;&gt; print d.somethingelse None &gt;&gt;&gt; </code>...
441,412
Is there a link to the "latest" jQuery library on Google APIs?
<p>I use the following for a jQuery link in my <code>&lt;script&gt;</code> tags:</p> <pre><code>http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js </code></pre> <p>Is there a link to the "latest" version? Something like the following (which doesn't work):</p> <pre><code>http://ajax.googleapis.com/ajax/libs/...
441,429
12
14
null
2009-01-14 00:08:57.947 UTC
248
2019-07-23 16:13:57.2 UTC
2016-01-22 20:21:37.543 UTC
null
1,946,501
Nick Pierpoint
4,003
null
1
799
javascript|jquery|google-api
1,022,602
<p><strong>Up until jQuery 1.11.1</strong>, you could use the following URLs to get the latest version of jQuery:</p> <ul> <li><a href="https://code.jquery.com/jquery-latest.min.js" rel="noreferrer">https://code.jquery.com/jquery-latest.min.js</a> - jQuery hosted (minified)</li> <li><a href="https://code.jquery.com/jq...
971,249
How to find the cause of a malloc "double free" error?
<p>I'm programming an application in Objective-C and I'm getting this error:</p> <blockquote> <p>MyApp(2121,0xb0185000) malloc: &ast;** error for object 0x1068310: double free<br> *** set a breakpoint in malloc_error_break to debug</p> </blockquote> <p>It is happening when I release an NSAutoreleasePool and I...
971,616
13
7
null
2009-06-09 16:49:50.4 UTC
43
2017-10-13 05:21:51.907 UTC
2017-10-13 05:21:51.907 UTC
null
1,033,581
null
104,291
null
1
82
iphone|objective-c|memory-management|malloc|autorelease
77,888
<p>You'll find out what the object is when you break in the debugger. Just look up the call stack and you will find where you free it. That will tell you which object it is.</p> <p>The easiest way to set the breakpoint is to:</p> <blockquote> <ol> <li>Go to Run -> Show -> Breakpoints (<kbd>ALT</kbd>-<kbd>Command<...