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
40,470,895
PhpStorm saving with Linux line ending on Windows
<p><em>Environment: Windows + PhpStorm</em></p> <p><strong>Issue</strong>: PhpStorm saves file with Windows line endings - and for shell script it's issue so there is need to always convert after copying to server.</p> <p><strong>Question</strong>: Is possible to configure <strong>PhpStorm</strong> to save file with ...
40,472,391
1
0
null
2016-11-07 17:20:29.553 UTC
9
2020-06-22 12:00:24.75 UTC
2016-11-07 18:33:04.39 UTC
null
783,119
null
1,571,491
null
1
45
windows|phpstorm|line-endings
50,087
<p>You can safely use <code>\n</code> line ending for <code>.php</code> and most of other files as well -- PHP on Windows will read such files just fine.</p> <hr /> <p><strong>To set default line ending</strong> for all <strong>new</strong> files: go to <code>Settings/Preferences | Editor | Code Style</code> and change...
33,575,563
C++ lambda capture this vs capture by reference
<p>If I need to generate a lambda that calls a member function, should I capture by reference or capture 'this'? My understanding is that '&amp;' captures only the variables used, but 'this' captures all member variable. So better to use '&amp;'?</p> <pre><code>class MyClass { public: int mFunc() { // acce...
33,576,211
4
0
null
2015-11-06 20:55:46.373 UTC
8
2020-07-30 07:10:04.4 UTC
null
null
null
null
1,262,000
null
1
39
c++|c++11|lambda|std-function
57,410
<p>For the specific example you've provided, capturing by <code>this</code> is what you want. Conceptually, capturing <code>this</code> by reference doesn't make a whole lot of sense, since you can't change the value of <code>this</code>, you can only use it as a pointer to access members of the class or to get the add...
36,077,266
How do I raise a FileNotFoundError properly?
<p>I use a third-party library that's fine but does not handle inexistant files the way I would like. When giving it a non-existant file, instead of raising the good old </p> <pre><code>FileNotFoundError: [Errno 2] No such file or directory: 'nothing.txt' </code></pre> <p>it raises some obscure message:</p> <pre><co...
36,077,407
1
0
null
2016-03-18 06:06:00.903 UTC
17
2016-03-18 06:34:43.223 UTC
null
null
null
null
3,926,735
null
1
90
python|python-3.x|file-not-found
83,995
<p>Pass in arguments:</p> <pre><code>import errno import os raise FileNotFoundError( errno.ENOENT, os.strerror(errno.ENOENT), filename) </code></pre> <p><code>FileNotFoundError</code> is a subclass of <a href="https://docs.python.org/3/library/exceptions.html#OSError" rel="noreferrer"><code>OSError</code></a>, w...
34,751,794
Displaying EC2 Instance name using Boto 3
<p>I'm not sure how to display the name of my instance in AWS EC2 using <code>boto3</code></p> <p>This is some of the code I have:</p> <pre><code>import boto3 ec2 = boto3.resource('ec2', region_name='us-west-2') vpc = ec2.Vpc("vpc-21c15555") for i in vpc.instances.all(): print(i) </code></pre> <p>What I get in ...
34,752,072
2
0
null
2016-01-12 19:02:43.617 UTC
4
2018-10-03 07:29:49.117 UTC
2016-01-12 19:52:20.067 UTC
null
5,451,492
null
1,815,710
null
1
27
python|python-3.x|amazon-web-services|amazon-ec2|boto3
43,134
<p>There may be other ways. But from your code point of view, the following should work.</p> <pre><code>&gt;&gt;&gt; for i in vpc.instances.all(): ... for tag in i.tags: ... if tag['Key'] == 'Name': ... print tag['Value'] </code></pre> <p>One liner solution if you want to use Python's powerful list compre...
32,109,319
How to implement the ReLU function in Numpy
<p>I want to make a simple neural network which uses the ReLU function. Can someone give me a clue of how can I implement the function using numpy.</p>
32,109,519
9
0
null
2015-08-20 03:58:56.267 UTC
27
2022-03-27 15:16:47.027 UTC
2020-07-20 01:06:41.103 UTC
null
1,079,075
null
4,467,507
null
1
93
python|numpy|machine-learning|neural-network
171,266
<p>There are a couple of ways.</p> <pre><code>&gt;&gt;&gt; x = np.random.random((3, 2)) - 0.5 &gt;&gt;&gt; x array([[-0.00590765, 0.18932873], [-0.32396051, 0.25586596], [ 0.22358098, 0.02217555]]) &gt;&gt;&gt; np.maximum(x, 0) array([[ 0. , 0.18932873], [ 0. , 0.25586596], ...
31,874,670
Merge parent branch into child branch
<p>I'm using bitbucket and sourcetree and I've done this:</p> <p>I have a develop branch. From this branch I have created a feature branch.</p> <p>After creating I have fix some errors on develop branch and push it to this branch only.</p> <p>How can I have these fixes in the feature branch? I think I have to merge ...
31,884,954
2
0
null
2015-08-07 09:45:28.48 UTC
8
2015-08-07 19:06:34.393 UTC
null
null
null
null
68,571
null
1
22
git|merge|branch|atlassian-sourcetree
38,967
<p>You want to bring changes from development branch to feature branch. So first switch to feature branch and merge development branch into it. In case you want the commits from develop branch too, use the non fast forward merge <code>--no-ff</code> approach. Else do not use <code>--no-ff</code>.</p> <pre><code>git ch...
22,749,570
Wildfly configuration with DataSource
<p>this is the first time I am trying to setup datasource in my Wildfly server. I tried to follow some tutorials which I found on Google but it still doesn't work.</p> <p>I am working on a web service but I keep getting some errors when I deploy my .war file.</p> <p>Here is the latest log when app is deployed:</p> <...
22,764,683
6
0
null
2014-03-30 20:40:23.927 UTC
2
2021-06-05 01:12:51.957 UTC
null
null
null
null
3,342,117
null
1
9
java|web-services|dependencies|jndi|wildfly
64,838
<p>can you post your datasource definition?</p> <p>I think it would be the best to test the datasource deployment 'standalone'. I mean separated from an actual application deployment, just to test whether your datasource works or not. You can test this f.i. using the web console (localhost:9990/console).</p> <p>It al...
2,723,803
Hibernate criteria query using Max() projection on key field and group by foreign primary key
<p>I'm having difficulty representing this query (which works on the database directly) as a criteria query in Hibernate (version 3.2.5):</p> <pre><code>SELECT s.* FROM ftp_status s WHERE (s.datetime,s.connectionid) IN (SELECT MAX(f.datetime), f.connectionid ...
8,358,721
1
0
null
2010-04-27 18:15:24.053 UTC
1
2017-11-08 14:40:18.737 UTC
2010-04-27 19:38:20.387 UTC
null
231,627
null
231,627
null
1
7
hibernate|group-by|projection|foreign-keys|many-to-one
49,471
<p>The <code>Criteria</code> you supplied seems to generate only the inner query part. You can combine the inner query e.g. by using <code>DetachedCriteria</code>:</p> <pre><code>DetachedCriteria maxDateQuery = DetachedCriteria.forClass(FtpStatus.class); ProjectionList proj = Projections.projectionList(); proj.add(Pro...
46,478,708
Angular reactive form hidden input not binding?
<p>I have a reactive form where I create the controls from my data model. Initially, everything is sorted by a datapoint called the "processingOrder" in numerical order.</p> <p>Within my form array, I am using <code>*ngFor</code> to iterate over controls and store the index in a hidden <code>form control</code>. If I ...
46,479,703
2
0
null
2017-09-28 21:38:34.6 UTC
4
2021-10-04 20:00:11.637 UTC
null
null
null
null
2,628,921
null
1
12
angular
44,859
<p><a href="https://angular.io/api/forms/FormControlName" rel="noreferrer"><code>formControlName</code></a> directive has <a href="https://angular.io/api/forms/FormControlName#inputs" rel="noreferrer"><code>ngModel</code></a> input which is bound to control's model and when changed from the code will update all its ins...
50,766,461
What's the difference between namedtuple and NamedTuple?
<p>The <a href="https://docs.python.org/3/library/typing.html#typing.NamedTuple" rel="noreferrer"><code>typing</code> module documentation</a> says that the two code snippets below are equivalent.</p> <pre class="lang-py prettyprint-override"><code>from typing import NamedTuple class Employee(NamedTuple): name: s...
50,767,206
1
0
null
2018-06-08 18:25:21.167 UTC
8
2022-07-28 06:38:36.79 UTC
2018-06-08 19:15:11.623 UTC
null
7,386,332
null
1,452,488
null
1
83
python|python-3.x
9,480
<p>The type generated by subclassing <code>typing.NamedTuple</code> is equivalent to a <code>collections.namedtuple</code>, but with <code>__annotations__</code>, <code>_field_types</code> and <code>_field_defaults</code> attributes added. The generated code will behave the same, for all practical purposes, since nothi...
38,665,741
Why is EPPlus telling me that I "Can't set color when patterntype is not set" when I have set PatternType?
<p>I've got this code to try to style a header row: </p> <pre><code>worksheet.Cells["A32:D32"].Style.Font.Name = "Georgia"; worksheet.Cells["A32:D32"].Style.Font.Bold = true; worksheet.Cells["A32:D32"].Style.Font.Size = 16; worksheet.Cells["A32:D32"].Style.Fill.PatternType = ExcelFillStyle.Solid; worksheet....
38,702,798
1
1
null
2016-07-29 18:52:56.78 UTC
2
2016-08-01 15:34:39.71 UTC
null
null
null
null
875,317
null
1
29
c#|excel|epplus|epplus-4
24,005
<p>Look closely at the two lines:</p> <pre><code>worksheet.Cells["A32:D32"].Style.Fill.PatternType = ExcelFillStyle.Solid; worksheet.Cells["A32:D33"].Style.Fill.BackgroundColor.SetColor(Color.CornflowerBlue); </code></pre> <p>The second line has <strong>D33</strong> instead of <strong>D32</strong> so if D33 is not se...
32,554,624
Casting a number to a string in TypeScript
<p>Which is the the best way (if there is one) to cast from number to string in Typescript?</p> <pre><code>var page_number:number = 3; window.location.hash = page_number; </code></pre> <p>In this case the compiler throws the error:</p> <blockquote> <p>Type 'number' is not assignable to type 'string'</p> </blockqu...
32,607,656
7
0
null
2015-09-13 21:15:48.703 UTC
21
2022-05-20 06:00:19.54 UTC
2015-09-13 21:46:52.527 UTC
null
419,956
null
1,316,510
null
1
248
javascript|casting|typescript
459,789
<p>"Casting" is different than conversion. In this case, <code>window.location.hash</code> will auto-convert a number to a string. But to avoid a TypeScript compile error, you can do the string conversion yourself:</p> <pre><code>window.location.hash = ""+page_number; window.location.hash = String(page_number); </co...
5,716,804
Can/Does WPF have multiple GUI threads?
<p>Can/Does WPF have multiple GUI threads? Or does it always only have one GUI thread (even if I have multiple windows/dialogs)?</p> <p>I'm asking because I have events coming from other threads and I'd like to handle them in the GUI thread (because I need to modify the controls of my main window accordings to the eve...
5,818,728
1
1
null
2011-04-19 13:06:32.697 UTC
22
2012-06-30 02:15:24.72 UTC
2012-06-30 02:15:24.72 UTC
null
918,414
null
614,177
null
1
37
.net|wpf|multithreading|user-interface
16,626
<p>Based on the link in the first answer I did some verification on my own. I'd like to share the results here. First of all:</p> <p><strong>There can be multiple GUI threads (and therefor multiple <code>Dispatcher</code> instances).</strong></p> <p>However:</p> <p><strong>Simply creating a new window (modal or not)...
25,078,452
How to send data using redirect with Laravel
<p>I developed an API to show a pop up message when the page loaded.</p> <p>Not all the pages use the pop up API. For example, if the user go to the <code>show($id)</code> page, that doesn't required the pop up api to fire. but in some special cases, I need the pop up to be fired.</p> <p>Here is my code, ** this code...
25,078,560
4
0
null
2014-08-01 10:41:48.74 UTC
7
2022-02-25 11:19:05.78 UTC
2017-11-29 13:58:51.757 UTC
null
199,700
null
3,802,174
null
1
39
php|laravel|laravel-4|laravel-blade
109,112
<p>In store()</p> <pre><code>return Redirect::route('clients.show, $id')-&gt;with( ['data' =&gt; $data] ); </code></pre> <p>and in <code>show()</code> read it with </p> <pre><code>Session::get('data'); </code></pre>
25,409,175
Declare a Range relative to the Active Cell with VBA
<p>I need to declare a range object relative to the Active Cell. The problem is, the number of rows and columns I want to select is different each time the macro runs.</p> <p>For example, I have two variables: <code>numRows</code> and <code>numCols</code>.</p> <p>I want to select a range that has the ActiveCell in t...
25,409,205
2
0
null
2014-08-20 15:50:51.483 UTC
2
2019-10-27 07:30:30.713 UTC
2015-01-30 14:29:30.763 UTC
null
1,505,120
null
3,960,972
null
1
10
vba|excel
109,371
<p>There is an <a href="http://msdn.microsoft.com/en-us/library/office/ff840060(v=office.15).aspx" rel="noreferrer"><strong>.Offset</strong> property</a> on a Range class which allows you to do just what you need</p> <p><code>ActiveCell.Offset(numRows, numCols)</code></p> <p>follow up on a comment:</p> <pre><code>Di...
30,291,607
Get Javascript console when emulating WebView app
<p>I'm pretty new to Android Dev, I'm trying to create a WebView based app. I got the basics, I emulate the app directly on my phone and wanted to know if there is a way to get a <code>Javascript console</code> like in Chrome PC version.</p> <p>My device is running Android 4.2.1 API Level 17. I can't emulate app on my...
30,294,054
1
0
null
2015-05-17 20:07:14.657 UTC
3
2015-05-18 01:55:55.55 UTC
2017-05-23 11:47:21.15 UTC
null
-1
null
3,669,565
null
1
35
android|webview
24,425
<p>The answer you a referring to is for Android Browser app, not for WebView component.</p> <p>In order to get output from <code>console.log()</code> family of functions, you need to set a <code>WebChromeClient</code> for your WebView and override <code>onConsoleMessage()</code> <a href="http://developer.android.com/r...
57,043,414
How to update Formik Field from external actions
<p>I am trying to update a Formik field from a modal screen. The modal returns the data and set them into the pageState. Considering that my Fomik Form has "enableReinitialize", the field update works fine. However, if the form is in "dirty" state, which means, some other fields in the form were updated, this process t...
57,045,785
2
0
null
2019-07-15 15:59:11.673 UTC
3
2021-12-19 11:23:19.81 UTC
2019-07-15 16:05:18.067 UTC
null
11,375,160
null
11,375,160
null
1
31
formik
37,346
<p>I solved my problem rendering my modal component inside my Fomik functional component. And then, for the callBack of my modal component I just wrote a method that will receive the Formiks setFieldValue reference. Then was possible to manually set the data into Formik's state:</p> <p>My Modal Component inside Formik...
42,779,871
Angular core/feature/shared modules: what goes where
<p>First of all, it's not a duplicate of any other question and I've read the angular guide on that. However I still have several questions.</p> <p>The feature module is the easiest one - you have a feature - group it into feature module. Let's say that in addition to obvious feature I have the pages which every appli...
42,781,220
1
0
null
2017-03-14 07:18:11.48 UTC
24
2018-08-21 08:57:01.457 UTC
null
null
null
null
2,728,956
null
1
38
angular
21,404
<p>The answers to your question are subjective, however there are some recommendations from official docs you can follow: <a href="https://angular.io/guide/ngmodule-faq#what-kinds-of-modules-should-i-have-and-how-should-i-use-them" rel="noreferrer">What kinds of modules should I have and how should I use them?</a>. If ...
38,627,259
How to make a callback to Google Maps init in separate files of a web app
<p>When I had my Google Maps API snippet:</p> <pre class="lang-html prettyprint-override"><code>&lt;script async defer src=&quot;https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&amp;callback=initMap&quot;&gt;&lt;/script&gt; </code></pre> <p>in <code>index.html</code>, I got the error:</p> <blockquote> <p>Uncau...
38,627,705
3
5
null
2016-07-28 04:43:04.03 UTC
4
2022-06-15 01:53:49.17 UTC
2020-10-17 19:57:37.9 UTC
null
863,110
null
1,923,016
null
1
11
javascript|html|angularjs|google-maps|google-maps-api-3
44,960
<p>Since the Google Maps SDK script load a synchronic (due the <code>async</code> attribute), there is the <code>callback</code> parameter in the URL.</p> <p>To solve the problem, you need to understand the <code>async</code> mechanism in google sdk</p> <blockquote> <p>The async attribute lets the browser render th...
26,108,214
What does `Chef::Config[:file_cache_path]` do exactly?
<p>First off, I apologize for asking such a dumb question. But the reason I ask is because I'm having a hard time finding an answer. I've tried searching Chef's docs, but I have not found a clear explanation.</p> <p>So what exactly does<code>Chef::Config[:file_cache_path]</code> provide? I've read that its better to u...
26,108,265
1
0
null
2014-09-29 20:23:15.067 UTC
6
2014-09-29 20:26:24.25 UTC
null
null
null
null
2,177,668
null
1
29
chef-infra
26,290
<p>The specific value varies by platform and method of install, but that config value defaults to somewhere you can write out temp files. Generally it will be something like <code>/var/chef/cache</code>. This is used for caching cookbooks and files in them, but as you noted you can also use it from your own code for th...
55,017,476
Android/Kotlin: Error: "Expecting a top level declaration > Task :app:buildInfoGeneratorDebug"
<p>I try to write a class to manage a SQLite DB, but I have the error message "Expecting a top level declaration > Task :app:buildInfoGeneratorDebug".</p> <pre><code> package com.xexxxwxxxxs.GMP import android.database.sqlite.SQLiteDatabase import android.database.sqlite.SQLiteOpenHelper import android....
55,017,803
4
0
null
2019-03-06 07:09:19.163 UTC
2
2022-07-02 19:13:52.65 UTC
null
null
null
null
3,581,620
null
1
17
android|sqlite|kotlin|companion-object
49,101
<p>I just delete the last curly brace and write it again. It's working :)</p>
44,955,463
Creating a promise chain in a for loop
<p>I would expect the code below to print one number on the console, then wait a second and then print another number. Instead, it prints all 10 numbers immediately and then waits ten seconds. What is the correct way to create a promise chain that behaves as described?</p> <pre><code>function getProm(v) { return n...
44,955,506
3
0
null
2017-07-06 17:27:49.537 UTC
11
2022-04-18 09:25:55.393 UTC
null
null
null
null
8,266,512
null
1
35
javascript|es6-promise
17,089
<p>You have to assign the return value of <code>.then</code> back to <code>chain</code>:</p> <pre><code>chain = chain.then(()=&gt;getProm(i)) .then(Wait) </code></pre> <p>Now you will basically be doing </p> <pre><code>chain .then(()=&gt;getProm(1)) .then(Wait) .then(()=&gt;getProm(2)) .then(Wait) ...
38,836,690
C++ function argument safety
<p>In a function that takes several arguments of the same type, how can we guarantee that the caller doesn't mess up the ordering?</p> <p>For example</p> <pre><code>void allocate_things(int num_buffers, int pages_per_buffer, int default_value ... </code></pre> <p>and later</p> <pre><code>// uhmm.. lets see which wa...
38,836,803
7
13
null
2016-08-08 19:03:04.65 UTC
8
2016-08-30 21:47:12.9 UTC
2016-08-08 19:37:59.03 UTC
null
1,413,395
null
1,583,225
null
1
58
c++|c++14
3,839
<p>A typical solution is to put the parameters in a structure, with named fields.</p> <pre><code>AllocateParams p; p.num_buffers = 1; p.pages_per_buffer = 10; p.default_value = 93; allocate_things(p); </code></pre> <p>You don't have to use fields, of course. You can use member functions or whatever you like.</p>
2,366,921
Reflection.Emit vs CodeDOM
<p><strong>What are some pros/cons for using the Reflection.Emit library versus CodeDOM for dynamically generating code at runtime?</strong></p> <p>I am trying to generate some (relatively complicated) dynamic classes in a system based on metadata available at runtime in XML form. I will be generating classes that ext...
2,367,507
3
3
null
2010-03-02 21:29:16.427 UTC
19
2013-04-12 12:58:30.817 UTC
null
null
null
null
91,671
null
1
53
c#|.net|code-generation|reflection.emit|codedom
15,150
<p>I think the key points about CodeDOM and Reflection.Emit are following:</p> <ul> <li><p><strong>CodeDom</strong> generates C# source code and is usually used when generating code to be included as part of a solution and compiled in the IDE (for example, LINQ to SQL classes, WSDL, XSD all work this way). In this sce...
2,421,388
Using group by on multiple columns
<p>I understand the point of <code>GROUP BY x</code>.</p> <p>But how does <code>GROUP BY x, y</code> work, and what does it mean?</p>
2,421,441
3
1
null
2010-03-10 23:11:23.113 UTC
401
2021-09-23 19:02:10.66 UTC
2020-07-22 14:47:34.607 UTC
null
8,528,014
null
117,700
null
1
1,411
sql|group-by|multiple-columns
1,847,201
<p><code>Group By X</code> means <strong>put all those with the same value for X in the one group</strong>.</p> <p><code>Group By X, Y</code> means <strong>put all those with the same values for both X and Y in the one group</strong>.</p> <p>To illustrate using an example, let's say we have the following table, to do w...
2,462,170
C#: Get IP Address from Domain Name?
<p>How can I get an IP address, given a domain name? For example: <code>www.test.com</code> </p>
2,462,183
4
2
null
2010-03-17 12:32:18.787 UTC
4
2021-12-13 10:57:25.127 UTC
2010-04-26 22:59:51.333 UTC
null
164,901
null
283,405
null
1
36
c#|ip-address
37,153
<p>You can use the <code>System.Net.Dns</code> class:</p> <pre class="lang-csharp prettyprint-override"><code>Dns.GetHostAddresses(&quot;www.test.com&quot;); </code></pre>
28,988,627
Pandas Correlation Groupby
<p>Assuming I have a dataframe similar to the below, how would I get the correlation between 2 specific columns and then group by the 'ID' column? I believe the Pandas 'corr' method finds the correlation between all columns. If possible I would also like to know how I could find the 'groupby' correlation using the .a...
28,990,872
4
0
null
2015-03-11 14:00:43.383 UTC
19
2022-07-14 19:27:58.623 UTC
2022-05-05 23:13:55.973 UTC
null
4,685,471
null
4,643,220
null
1
38
python|pandas|group-by|correlation
46,846
<p>You pretty much figured out all the pieces, just need to combine them:</p> <pre><code>&gt;&gt;&gt; df.groupby('ID')[['Val1','Val2']].corr() Val1 Val2 ID A Val1 1.000000 0.500000 Val2 0.500000 1.000000 B Val1 1.000000 0.385727 Val2 0.385727 1.000000 </code>...
49,142,401
How to scroll without moving my cursor in Visual Studio Code from the Keyboard
<p>I used to be able to scroll in <code>Visual Studio 2015</code> using some keyboard shortcuts in Windows doing something like <kbd>ctrl</kbd><kbd>shift</kbd><kbd>down</kbd>. It would effectively behave like a line by line viewport bump that did not modify where my cursor was inserted at. This is much like how scrolli...
51,139,853
8
0
null
2018-03-07 00:50:33.747 UTC
4
2022-03-07 08:06:14.617 UTC
null
null
null
null
1,330,381
null
1
40
visual-studio-code
14,210
<p>On my Mac <kbd>Ctrl</kbd>+<kbd>Page Up/Down </kbd> works similar to mouse scroll. This doesn't affect the cursor position. </p>
49,007,357
How to make the whole Card component clickable in Material UI using React JS?
<p>Im using <a href="https://material-ui-next.com/demos/cards/" rel="noreferrer">Material UI Next</a> in a React project. I have the Card component which has an image(Card Media) and text(Card Text) inside it. I also have a button underneath the text. My question is..how to make the whole card clickable? ie. Whether a ...
49,014,926
10
0
null
2018-02-27 11:14:13.25 UTC
20
2022-06-23 15:39:52.823 UTC
null
null
null
null
5,898,523
null
1
45
javascript|css|reactjs|material-design|material-ui
84,729
<blockquote> <p><strong>Update for v3 — 29 of August 2018</strong></p> <p>A specific <a href="https://material-ui.com/api/card-action-area/" rel="noreferrer"><em>CardActionArea</em> component</a> has been added to cover specifically this case in <strong>version 3.0.0 of Material UI</strong>.</p> <p>Please u...
1,315,924
jQuery - Calling a function inline
<p>I am trying to pass one variable to a jQuery function inline (i.e.: using an <code>onMouseOver=&quot;function();&quot;</code> within the actual link (which is an area tag from an image map)).</p> <p>The function is only being called if I place it before the <code>$(document).ready(function(){</code> line, but doing ...
1,315,934
2
0
null
2009-08-22 12:57:01.22 UTC
1
2021-12-27 09:22:03.623 UTC
2021-12-27 09:22:03.623 UTC
null
4,370,109
null
160,793
null
1
6
javascript|jquery|inline|jquery-events
55,736
<p>In your second example, you've declared <code>myfunction</code> <em>inside</em> the anonymous function you're passing to <code>.ready()</code>. That means <code>myfunction</code> is a local variable, which is only in scope inside that anonymous function, and you cannot call it from anywhere else.</p> <p>There are ...
710,596
How do I backup a nexus repository manager
<p>The nexus book: <a href="http://www.sonatype.com/books/nexus-book/reference/" rel="noreferrer">http://www.sonatype.com/books/nexus-book/reference/</a>. Does not seem to spend any time on how one should go about backing up a nexus repository. If I am installing my snapshot and releases into this local repository, i...
711,198
2
0
null
2009-04-02 16:50:01.497 UTC
14
2016-02-24 06:35:42.573 UTC
2009-07-30 20:17:03.597 UTC
null
123,582
Nathan Feger
8,563
null
1
25
maven-2|backup|nexus
12,254
<p>When you install Nexus, you'll end up with two directories:</p> <pre><code>nexus-webapp-1.3.1.1/ sonatype-work/ </code></pre> <p>We've separated the application from the data and configuration. The Nexus application is in <code>nexus-webapp-1.3.1.1/</code> and the data and configuration is in <code>sonatype-work/...
1,120,448
Refresh environment variables for open VS solution
<p>Using visual studio 2008, I had a solution open and realized I need to install another program that the project I was working on used. I did this with visual studio open and attempted to debug the program, however the environment variables added by the program I installed were not visible. I could not get them to re...
1,120,463
2
1
null
2009-07-13 16:12:35.35 UTC
5
2009-07-13 16:14:51.43 UTC
null
null
null
null
4,660
null
1
30
visual-studio|visual-studio-2008
14,799
<p>Nope. Environment variable changes on Windows only take effect for new processes. You'll have to exit Visual Studio and restart it.</p>
162,497
Spring MVC Form tags: Is there a standard way to add "No selection" item?
<p>There is a select dropdown and I want to add &quot;No selection&quot; item to the list which should give me 'null' when submitted. I'm using SimpleFormController derived controller.</p> <pre><code>protected Map referenceData(HttpServletRequest httpServletRequest, Object o, Errors errors) throws Exception { Map&l...
171,260
2
0
null
2008-10-02 14:13:18.85 UTC
4
2020-07-31 04:32:29.06 UTC
2020-07-31 04:32:29.06 UTC
skaffman
214,143
Aleksey Kudryavtsev
578
null
1
31
java|forms|spring|spring-mvc
16,118
<p>One option:</p> <pre class="lang-html prettyprint-override"><code>&lt;form:select path="country" title="country" &gt; &lt;form:option value=""&gt;&amp;nbsp;&lt;/form:option&gt; &lt;form:options items="${countryList}" /&gt; &lt;/form:select&gt; </code></pre>
493,490
Converting a string to a class name
<p>I have a string variable that represents the name of a custom class. Example: </p> <pre><code>string s = "Customer"; </code></pre> <p>I will need to create an arraylist of customers. So, the syntax needed is:</p> <pre><code>List&lt;Customer&gt; cust = new .. </code></pre> <p>How do I convert the string s to be ...
493,517
2
1
null
2009-01-29 21:21:18.373 UTC
16
2021-05-02 19:22:02.507 UTC
2015-01-06 12:16:51.903 UTC
Jon Skeet
469,319
Bob Smith
58,348
null
1
51
c#|.net
91,214
<p>Well, for one thing <code>ArrayList</code> isn't generic... did you mean <code>List&lt;Customer&gt;</code>?</p> <p>You can use <code>Type.GetType(string)</code> to get the <code>Type</code> object associated with a type by its name. If the assembly isn't either mscorlib or the currently executing type, you'll need ...
2,594,799
C# float to decimal conversion
<p>Any smart way to convert a float like this:</p> <pre><code>float f = 711989.98f; </code></pre> <p>into a decimal (or double) without losing precision?</p> <p>I've tried:</p> <pre><code>decimal d = (decimal)f; decimal d1 = (decimal)(Math.Round(f,2)); decimal d2 = Convert.ToDecimal(f); </code></pre>
2,594,878
5
2
null
2010-04-07 18:12:13.37 UTC
0
2022-07-26 03:14:03.497 UTC
2017-03-01 02:48:48.347 UTC
null
173,467
null
311,245
null
1
21
c#|floating-point|precision
69,770
<p>It's too late, the 8th digit was lost in the compiler. The float type can store only 7 significant digits. You'll have to rewrite the code, assigning to double or decimal will of course solve the problem.</p>
2,902,621
Fetching custom Authorization header from incoming PHP request
<p>So I'm trying to parse an incoming request in PHP which has the following header set:</p> <pre><code>Authorization: Custom Username </code></pre> <p>Simple question: how on earth do I get my hands on it? If it was <code>Authorization: Basic</code>, I could get the username from <code>$_SERVER["PHP_AUTH_USER"]</co...
2,902,713
5
0
null
2010-05-25 07:00:09.2 UTC
18
2020-09-14 12:54:58.333 UTC
null
null
null
null
218,340
null
1
45
php|http-headers|authorization
106,267
<p>If you're only going to use Apache you might want to have a look at <a href="http://php.net/apache_request_headers" rel="noreferrer"><code>apache_request_headers()</code></a>.</p>
2,378,069
DDD with Grails
<p>I cannot find any info about doing <a href="http://domaindrivendesign.org/" rel="noreferrer">Domain Driven Design</a> (DDD) with Grails. </p> <p>I'm looking for any best practices, experience notes or even open source projects that are good examples of DDD with Grails.</p>
7,100,122
7
0
2010-04-06 15:08:02.523 UTC
2010-03-04 09:25:16.82 UTC
14
2012-01-10 16:49:53.307 UTC
2010-03-06 09:55:36.727 UTC
null
36,746
null
36,746
null
1
14
grails|domain-driven-design
4,873
<p>Grails is <strong>par-excellence</strong> platform for implementing applications in Domain Driven Design style . At the center of Grails approach are Domain Classes that drive the whole development process. As you are probably guessing, the choice of word domain in Grails is not just a coincidence.</p> <p>You star...
2,589,736
fast way to check if an array of chars is zero
<p>I have an array of bytes, in memory. What's the fastest way to see if all the bytes in the array are zero?</p>
2,589,876
7
1
null
2010-04-07 02:59:47.62 UTC
10
2018-02-12 12:53:11.47 UTC
null
null
null
null
15,055
null
1
21
c|optimization|memory|performance|32-bit
33,673
<p>Nowadays, <strong>short of using <a href="http://en.wikipedia.org/wiki/SIMD" rel="noreferrer">SIMD</a> extensions</strong> (such as <a href="http://en.wikipedia.org/wiki/Streaming_SIMD_Extensions" rel="noreferrer">SSE</a> on x86 processors), you might as well <strong>iterate over the array</strong> and compare each ...
2,726,920
C# XOR on two byte variables will not compile without a cast
<p>Why does the following raise a compile time error: 'Cannot implicitly convert type 'int' to 'byte':</p> <pre><code> byte a = 25; byte b = 60; byte c = a ^ b; </code></pre> <p>This would make sense if I were using an arithmentic operator because the result of a + b could be larger than can b...
2,727,077
7
2
null
2010-04-28 04:57:09.487 UTC
9
2022-06-20 08:21:38.763 UTC
null
null
null
null
5,023
null
1
33
c#|operators
42,343
<p>I can't give you the rationale, but I can tell why the compiler has that behavior from the stand point of the rules the compiler has to follow (which might not really be what you're interesting in knowing).</p> <p>From an old copy of the C# spec (I should probably download a newer version), emphasis added:</p> <bl...
2,516,448
strtolower() for unicode/multibyte strings
<p>I have some text in a non-English/foreign language in my page, but when I try to make it lowercase, it characters are converted into black diamonds containing question marks.</p> <pre><code>$a = &quot;Երկիր Ավելացնել&quot;; echo $b = strtolower($a); //returns ����� ��������� </code></pre> <p>I've set my charset in ...
2,516,460
8
3
null
2010-03-25 14:46:15.923 UTC
3
2022-08-02 17:13:30.087 UTC
2021-08-13 22:48:41.027 UTC
null
2,943,403
null
291,772
null
1
34
php|unicode|utf-8|lowercase|multibyte
26,266
<p>Have you tried using <a href="https://www.php.net/manual/en/function.mb-strtolower.php" rel="nofollow noreferrer"><code>mb_strtolower()</code></a>?</p>
3,155,461
How to delete multiple buffers in Vim?
<p>Assuming I have multiple files opened as buffers in Vim. The files have <code>*.cpp</code>, <code>*.h</code> and some are <code>*.xml</code>. I want to close all the XML files with <code>:bd *.xml</code>. However, Vim does not allow this (E93: More than one match...).</p> <p>Is there any way to do this?</p> <p>P.S...
9,499,234
8
0
null
2010-07-01 06:16:06.51 UTC
41
2017-09-17 04:11:39.99 UTC
2013-01-23 14:56:31.783 UTC
null
225,037
null
264,936
null
1
139
vim|buffer
22,008
<p>You can use <code>&lt;C-a&gt;</code> to complete all matches. So if you type <code>:bd *.xml</code> and then hit <code>&lt;C-a&gt;</code>, vim will complete the command to <code>:bd file1.xml file2.xml file3.xml</code>.</p>
2,890,773
System.EnterpriseServices.Wrapper.dll error
<hr> <blockquote> <p>Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. </p> <p>Parser Error Message: Could not load file or assembly 'System.E...
3,672,702
10
0
null
2010-05-23 05:44:11.893 UTC
3
2021-08-13 20:07:08.603 UTC
2017-04-25 14:31:43.233 UTC
null
2,622,612
null
343,117
null
1
15
asp.net|global-asax
40,480
<p>Copy the file <code>System.EnterpriseServices.Wrapper.dll</code></p> <p>from</p> <p><code>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727</code></p> <p>to</p> <p><code>C:\WINDOWS\WinSxS\x86_System.EnterpriseServices_b03f5f7f11d50a3a_2.0.0.0_x-ww_7d5f3790\</code></p>
2,504,411
Proper indentation for multiline strings?
<p>What is the proper indentation for Python multiline strings within a function?</p> <pre><code> def method(): string = """line one line two line three""" </code></pre> <p>or</p> <pre><code> def method(): string = """line one line two line three""" </code></pre> <p>or somethin...
2,504,457
12
2
null
2010-03-23 23:35:28.27 UTC
109
2022-03-23 21:31:28.533 UTC
2021-12-31 22:53:12.843 UTC
null
355,230
null
216,605
null
1
560
python|string
388,147
<p>You probably want to line up with the <code>"""</code></p> <pre><code>def foo(): string = """line one line two line three""" </code></pre> <p>Since the newlines and spaces are included in the string itself, you will have to postprocess it. If you don't want to do that and you have a w...
2,897,619
Using HTML5/JavaScript to generate and save a file
<p>I've been fiddling with WebGL lately, and have gotten a Collada reader working. Problem is it's pretty slow (Collada is a very verbose format), so I'm going to start converting files to a easier to use format (probably JSON). I already have the code to parse the file in JavaScript, so I may as well use it as my expo...
4,551,467
19
1
null
2010-05-24 14:16:34.777 UTC
196
2022-04-04 22:24:29.68 UTC
2019-04-21 16:18:51.16 UTC
null
860,099
null
25,968
null
1
360
javascript|html|download
473,675
<p>OK, creating a data:URI definitely does the trick for me, thanks to Matthew and Dennkster pointing that option out! Here is basically how I do it:</p> <p>1) get all the content into a string called "content" (e.g. by creating it there initially or by reading innerHTML of the tag of an already built page).</p> <p>...
25,024,797
Max and Min date in pandas groupby
<p>I have a dataframe that looks like:</p> <pre><code>data = {'index': ['2014-06-22 10:46:00', '2014-06-24 19:52:00', '2014-06-25 17:02:00', '2014-06-25 17:55:00', '2014-07-02 11:36:00', '2014-07-06 12:40:00', '2014-07-05 12:46:00', '2014-07-27 15:12:00'], 'type': ['A', 'B', 'C', 'A', 'B', 'C', 'A', 'C'], 'sum...
25,025,065
3
0
null
2014-07-29 20:52:45.057 UTC
12
2022-06-17 14:22:09.283 UTC
null
null
null
null
3,325,052
null
1
51
python|pandas|dataframe
97,255
<p>You need to combine the functions that apply to the same column, like this:</p> <pre><code>In [116]: gb.agg({'sum_col' : np.sum, ...: 'date' : [np.min, np.max]}) Out[116]: date sum_col amin amax sum type weekofyear ...
45,721,213
How to specify working directory for ENTRYPOINT in Dockerfile
<p>The Docker image (Windows-based) includes an application directory at <code>C:\App</code>. Inside that directory reside several sub-folders and files, including a batch file called <code>process.bat</code>. The Dockerfile (used to build the image) ends like this:</p> <pre><code>ENTRYPOINT [ "C:\\App\\process.bat" ]...
45,721,476
2
0
null
2017-08-16 19:07:43.99 UTC
6
2018-02-12 10:44:14.957 UTC
null
null
null
null
371,392
null
1
41
docker|dockerfile
61,351
<p><code>WORKDIR /App</code> is a command you can use in your dockerfile to change the working directory.</p>
45,379,121
How to access elements on external website using Espresso
<p>Using espresso, we click a Login button which launches an external website (Chrome Custom Tab) where you can login and then it redirects back to our android application. </p> <p>Is there a way in Espresso to:<br> 1) Verify the correct URL is being launched<br> 2) Access the elements on the website so that I can en...
45,467,933
2
1
null
2017-07-28 17:18:53.393 UTC
8
2022-07-27 10:13:38.943 UTC
2017-11-15 08:16:17.57 UTC
null
1,000,551
null
4,713,905
null
1
11
android|android-espresso|android-uiautomator|chrome-custom-tabs|android-espresso-recorder
4,908
<p>I was able to resolve this issue using both Espresso and UI Automator. You are able to combine the two. The selection of the login button I used Espresso (and the rest of the app, I will use Espresso). To handle the Chrome Custom tab for logging in, I used UIAutomator:</p> <p><a href="https://i.stack.imgur.com/S...
10,260,291
Installing Core-Plot in Xcode 4.2 for iOS project
<p>I am trying to install Core Plot into my iOS app. I have followed the instructions on the Core Plot website but they are very brief and have no screenshots. I have pasted the instructions below and explained where I am stuck...</p> <blockquote> <p>First, drag the CorePlot-CocoaTouch.xcodeproj file into your iPhon...
10,261,140
2
0
null
2012-04-21 15:25:34.38 UTC
9
2014-05-28 03:45:23.377 UTC
2012-04-21 16:46:27.957 UTC
null
19,679
null
1,190,768
null
1
10
iphone|objective-c|ios|xcode4.2|core-plot
7,259
<p>Seeing as how I wrote those instructions, I can take a stab at clarifying the part you're having trouble with.</p> <p>You'll need to set the header search path so that when you include <code>CorePlot-CocoaTouch.h</code>, Xcode knows where to pull that from. This is located within the Build Settings for your applica...
19,537,645
Get environment variable value in Dockerfile
<p>I'm building a container for a ruby app. My app's configuration is contained within environment variables (loaded inside the app with <a href="http://github.com/bkeepers/dotenv">dotenv</a>).</p> <p>One of those configuration variables is the public ip of the app, which is used internally to make links. I need to ad...
34,600,106
8
0
null
2013-10-23 09:16:03.447 UTC
67
2022-09-07 11:11:25.177 UTC
null
null
null
null
122,080
null
1
335
docker
359,607
<p>You should use the <a href="https://docs.docker.com/engine/reference/builder/#arg" rel="noreferrer"><code>ARG</code> directive</a> in your Dockerfile which is meant for this purpose.</p> <blockquote> <p>The <code>ARG</code> instruction defines a variable that users can pass at build-time to the builder with the d...
19,417,246
How can I style the ProgressBar component in JavaFX
<p>I am trying to add custom css styling to the JavaFX ProgressBar component but I couldn't find any information on the topic. I am looking for the css class names and the css commands that are required to: </p> <ul> <li>set the color of the progress bar itself </li> <li>set the background color of the progress bar (...
19,418,709
3
0
null
2013-10-17 02:28:07.87 UTC
18
2021-11-04 16:58:46.713 UTC
2013-10-17 02:33:52.143 UTC
null
1,096,470
null
1,096,470
null
1
18
java|css|javafx-2
41,440
<p>I have marked this answer as <a href="https://meta.stackexchange.com/questions/11740/what-are-community-wiki-posts">community wiki</a>. </p> <p>If you have ideas for JavaFX ProgressBar styling outside of the original initial styling queries, please edit this post to add your styling ideas (or to link to them).</p>...
40,876,478
how do you add a property to an existing type in typescript?
<p> I'm trying to add a property to the javascript 'Date' prototype.</p> <p>in javascript, i'd just do this:</p> <pre><code>Object.defineProperty(Date.prototype, "fullYearUTC", { get: function () { return this.getUTCFullYear(); }, enumerable: true, configurable: true }); </code></pre> <p>I thought I'd ju...
40,876,614
2
0
null
2016-11-29 21:55:15.123 UTC
4
2021-01-23 23:29:22.767 UTC
2017-02-08 12:14:22.74 UTC
null
4,886,740
null
204,555
null
1
29
typescript
31,696
<p>You can not create a class named <code>Date</code>, you can have your own date object which extends it:</p> <pre><code>class MyDate extends Date { get fullYearUTC(): number { return this.getUTCFullYear(); } } </code></pre> <p>But if you want to modify the existing <code>Date</code> you need to keep...
40,789,120
Angular2 cast string to JSON
<p>What is the right syntax to cast a string to JSON in Angular2? I tried:</p> <pre><code>var someString; someString.toJSON(); //or someString.toJson(); </code></pre> <p>it says: <code>someString.toJSON is not a function</code></p> <p>I'm lost because it was working with Angular1.</p> <hr> <p>If I try to add an at...
40,789,285
2
0
null
2016-11-24 14:39:08.66 UTC
null
2016-11-24 14:47:24.313 UTC
null
null
null
null
3,933,603
null
1
15
json|angular
64,231
<p>Angular2 uses JavaScript functions unlike Angular1.</p> <p>Angular1 implements its own functions which is a bad thing.</p> <p>In Angular2 just use pure JavaScript.</p> <pre><code>var json = JSON.parse(string); </code></pre>
47,113,948
java.lang.NoSuchMethodError: No static method getFont(Landroid/content/Context;ILandroid/util/TypedValue;ILandroid/widget/TextView;)
<p>After I updated my Android Studio to 3.0 I am getting <code>No static method getFont()</code> error. The project on which I am working is on github, <a href="https://github.com/ik024/GithubBrowser" rel="noreferrer">https://github.com/ik024/GithubBrowser</a></p> <pre><code>// Top-level build file where you can add c...
47,126,127
16
0
null
2017-11-04 18:13:35.603 UTC
14
2021-12-14 14:50:46.533 UTC
2018-02-27 07:24:30.437 UTC
null
4,443,323
null
3,064,175
null
1
59
android|android-studio-3.0|android-gradle-3.0
57,487
<p>Fix <strong><em>res/values/styles.xml</em></strong> and <strong><em>Manifest.xml</em></strong> like so:This solution is tested and don't forget to clean and build :</p> <p><strong><em>1.Manifest.xml</em></strong></p> <p>change the theme of HomeActivity to :</p> <pre><code> &lt;activity android:name...
47,505,778
Wrapping blocking I/O in project reactor
<p>I have a spring-webflux API which, at a service layer, needs to read from an existing repository which uses JDBC.</p> <p>Having done some reading on the subject, I would like to keep the execution of the blocking database call separate from the rest of my non-blocking async code.</p> <p>I have defined a dedicated ...
47,529,124
1
0
null
2017-11-27 07:28:39.43 UTC
8
2017-11-28 10:22:31.497 UTC
2017-11-27 09:02:28.137 UTC
null
22,982
null
676,424
null
1
11
java|project-reactor
7,643
<p>1) Use of <code>subscribeOn</code> is correctly putting the JDBC work on the <code>jdbcScheduler</code></p> <p>2) Neither, the results of the <code>Callable</code> - while computed on the jdbcScheduler, are <code>publishOn</code> the <code>parallel</code> Scheduler, so your <code>map</code> will be executed on a th...
46,955,197
Package management initialization failed: Access Denied Error when opening Visual Studio 2017
<p>I'm getting the following error when opening VS 2017 on Windows 7 64-bit:</p> <blockquote> <p>Package management initialization failed: Access Denied.</p> <p>You can get more information by examining the file: <br> C:\Users\&lt;username&gt;\AppData\Roaming\Microsoft\VisualStudio\15.&lt;version&gt;\Activity...
46,956,050
5
0
null
2017-10-26 13:07:36.753 UTC
7
2021-12-10 12:54:45.617 UTC
2018-06-07 07:18:51.627 UTC
null
1,393,400
null
1,393,400
null
1
40
visual-studio|visual-studio-2017
15,290
<p>It turns out that this is a <a href="https://social.msdn.microsoft.com/Forums/sqlserver/en-US/ac06667a-56e6-4f95-9926-413a2d949f76/vs-2017-package-management-initialization-failed?forum=vssetup#answersList" rel="noreferrer">bug</a>, that hasn't yet been resolved. This error also occurs when <a href="https://develope...
8,858,598
How to install PHP extensions on nginx?
<p>I recently discovered NginX, and decided to try it out on my server. I have NginX running and able to serve PHP and HTML files. But now I want to try to install drupal. When trying to install it and check the requirements, I am stopped by one requirement.</p> <blockquote> <p>PHP extensions Disabled</p> <p>Drupal ...
8,858,703
6
0
null
2012-01-13 23:23:08.637 UTC
5
2017-04-11 08:02:23.183 UTC
2020-06-20 09:12:55.06 UTC
null
-1
null
830,545
null
1
15
php|drupal|nginx|php-gd
53,891
<p>Since you are using Nginx - that must mean you are running PHP with PHP-FPM. </p> <p>After you install stuff you need to: </p> <pre><code>sudo /etc/init.d/php-fpm restart </code></pre> <p>or </p> <pre><code>service php5-fpm restart </code></pre> <p>in newer ubuntu versions</p> <p>so that PHP will pickup the n...
8,561,983
Retrieving command line history
<p>I use ubuntu 11.04, and the question must be common to any bash shell. Pressing the up arrow key on your terminal will retrieve the previous command you had executed at your terminal.</p> <p>My question is where(in which file) will all these command history be stored? Can I read that file?</p>
8,562,145
2
0
null
2011-12-19 13:23:34.627 UTC
11
2016-07-11 11:07:34.057 UTC
null
null
null
null
236,188
null
1
27
linux|bash|ubuntu-11.04
57,241
<p>the history filename was stored in variable : $HISTFILE </p> <pre><code>echo $HISTFILE </code></pre> <p>will give you the right file.</p> <p><strong>Usually</strong> in bash it would be ~/.bash_history, however it could be changed by configuration. </p> <p>also notice that sometimes the very last commands ...
8,684,551
Generate a UUID string with ARC enabled
<p>I need to generate a UUID string in some code with ARC enabled.</p> <p>After doing some research, this is what I came up with:</p> <pre><code>CFUUIDRef uuid = CFUUIDCreate(NULL); NSString *uuidStr = (__bridge_transfer NSString *)CFUUIDCreateString(NULL, uuid); CFRelease(uuid); </code></pre> <p>Am I correctly usin...
10,469,233
3
0
null
2011-12-30 22:11:39.6 UTC
24
2013-11-28 10:58:40.777 UTC
2012-05-06 07:50:57.61 UTC
null
151,019
null
19,851
null
1
71
objective-c|automatic-ref-counting
28,342
<p>Looks fine to me. This is what I use (available as a <a href="https://gist.github.com/1501325">gist</a>)</p> <pre><code>- (NSString *)uuidString { // Returns a UUID CFUUIDRef uuid = CFUUIDCreate(kCFAllocatorDefault); NSString *uuidString = (__bridge_transfer NSString *)CFUUIDCreateString(kCFAllocatorDe...
8,708,342
Redirect console output to string in Java
<p>I have one method whose <strong>return type is <code>void</code></strong> and it prints directly on console.</p> <p>However I need that output in a String so that I can work on it.</p> <p>As I can't make any changes to the method with return type <code>void</code> I have to redirect that output to a String.</p> <p>H...
8,708,357
4
0
null
2012-01-03 05:34:43.237 UTC
38
2021-09-23 14:00:01.467 UTC
2020-10-16 08:01:50.037 UTC
null
40,342
null
985,319
null
1
81
java|string|redirect|console|stdout
116,849
<p>If the function is printing to <code>System.out</code>, you can capture that output by using the <code>System.setOut</code> method to change <code>System.out</code> to go to a <code>PrintStream</code> provided by you. If you create a <code>PrintStream</code> connected to a <code>ByteArrayOutputStream</code>, then yo...
55,271,798
Browserslist: caniuse-lite is outdated. Please run next command `npm update caniuse-lite browserslist`
<p>Recently, when I compile my scss files I get an error. The error message says:</p> <blockquote> <p>Browserslist: caniuse-lite is outdated. Please run next command <code>npm update caniuse-lite browserslist</code></p> </blockquote> <p>First, as the message says, I ran <code>npm update caniuse-lite browserslist</code>...
55,283,201
23
0
null
2019-03-20 23:49:44.05 UTC
31
2022-09-12 14:36:05.89 UTC
2022-09-12 14:36:05.89 UTC
null
2,884,291
null
2,989,995
null
1
204
npm|sass|autoprefixer|web-compiler
335,868
<p>It sounds like you are using Visual Studio's Web Compiler extension. There is an open issue for this found here: <a href="https://github.com/madskristensen/WebCompiler/issues/413" rel="noreferrer">https://github.com/madskristensen/WebCompiler/issues/413</a></p> <p>There is a workaround posted in that issue:</p> <...
946,114
How to use IDispatch in plain C to call a COM object
<p>I need to compile some code of mine using the gcc compiler included in the R tools (R the statistical program for windows), the problem is that I need to use IDispatch in my code to create an access the methods of a COM object, and the gcc compiler doesn't support much of the code that I'm using to do so, which is b...
946,294
3
0
null
2009-06-03 17:42:23.32 UTC
15
2009-06-04 11:57:52.41 UTC
2009-06-03 18:08:59.413 UTC
null
16,794
null
58,434
null
1
16
c|com|gcc|activex|idispatch
7,416
<p>There is a great article on CodeProject entitled "COM in plain C".</p> <p>Here is <a href="http://www.codeproject.com/KB/COM/com_in_c1.aspx" rel="noreferrer">the link to Part 1</a>.</p> <p>There is a lot of very good info on working with COM in C in that article and the author's subsequent follow-ups (I think ther...
477,820
What's the idiomatic Python equivalent to Django's 'regroup' template tag?
<p><a href="http://docs.djangoproject.com/en/dev/ref/templates/builtins/#regroup" rel="noreferrer">http://docs.djangoproject.com/en/dev/ref/templates/builtins/#regroup</a></p> <p>I can think of a few ways of doing it with loops but I'd particularly like to know if there is a neat one-liner.</p>
477,839
3
0
null
2009-01-25 15:29:44.457 UTC
12
2015-06-08 04:34:08.243 UTC
null
null
null
andybak
45,955
null
1
20
python|django|django-templates
4,640
<p>Combine <a href="http://docs.python.org/library/itertools.html#itertools.groupby" rel="noreferrer"><code>itertools.groupby</code></a> with <a href="http://docs.python.org/library/operator.html#operator.itemgetter" rel="noreferrer"><code>operator.itemgetter</code></a> to get a pretty nice solution:</p> <pre><code>fr...
17,612
How do you place a file in recycle bin instead of delete?
<p>Programmatic solution of course...</p>
17,620
3
1
null
2008-08-20 08:43:00.393 UTC
8
2013-04-28 03:27:06.143 UTC
2013-04-28 03:27:06.143 UTC
Brian Leahy
1,012,641
Brian Leahy
580
null
1
29
c#|.net|c++|windows|io
10,832
<p><a href="http://www.daveamenta.com/2008-05/c-delete-a-file-to-the-recycle-bin/" rel="noreferrer">http://www.daveamenta.com/2008-05/c-delete-a-file-to-the-recycle-bin/</a></p> <p>From above:</p> <pre><code>using Microsoft.VisualBasic; string path = @"c:\myfile.txt"; FileIO.FileSystem.DeleteDirectory(path, Fil...
35,261,567
How to solve error: ';' expected in Java?
<p>I have a <code>error: ';' expected</code> issue with my Java code below. I don't know how to solve it?</p> <p><code>SortThread</code> and <code>MergeThread</code> have been created as a class, and compiled well.</p> <p>The only problem is </p> <pre><code>SortThread t1.join() = new SortThread(a); SortThread t2.j...
35,261,574
1
2
null
2016-02-08 02:22:00.927 UTC
1
2016-02-08 02:24:13.553 UTC
2016-02-08 02:24:13.553 UTC
null
3,763,242
null
3,763,242
null
1
1
java
56,421
<p>You can't call the methods before you finish initializing the variables you're calling.</p> <pre><code>SortThread t1.join() = new SortThread(a); SortThread t2.join() = new SortThread(b); MergeThread m.start() = new MergeThread(t1.get(),t2.get()); </code></pre> <p>should be something like</p> <pre><code>SortT...
24,176,605
Using Predicate in Swift
<p>I'm working through the tutorial here (learning Swift) for my first app: <a href="http://www.appcoda.com/search-bar-tutorial-ios7/">http://www.appcoda.com/search-bar-tutorial-ios7/</a></p> <p>I'm stuck on this part (Objective-C code):</p> <pre><code>- (void)filterContentForSearchText:(NSString*)searchText scope:(N...
24,177,043
8
0
null
2014-06-12 04:47:19.47 UTC
24
2018-04-09 06:44:30.62 UTC
2015-08-11 14:44:44.513 UTC
null
295,027
null
2,813,723
null
1
98
ios|objective-c|swift|ios7|predicate
142,537
<p>This is really just a syntax switch. OK, so we have this method call:</p> <pre><code>[NSPredicate predicateWithFormat:@"name contains[c] %@", searchText]; </code></pre> <p>In Swift, constructors skip the "blahWith…" part and just use the class name as a function and then go straight to the arguments, so <code>[NSP...
6,065,140
jquery click change class
<p>I am studying jquery, I want make a effection as: first click, slider down the div#ccc and change the link class to 'aaa'; click again, slider up the div#ccc and change the link class back to 'bbb'. now slider down can work, but removeClass, addClass not work. how to modify so that two effection work perfect? thanks...
6,065,174
3
0
null
2011-05-19 21:35:27.117 UTC
null
2011-05-19 22:06:11.543 UTC
null
null
null
null
547,726
null
1
6
jquery|click|addclass|removeclass
41,824
<p>You need to use a single toggle event. You are setting the click event twice and that won't work.</p> <p><a href="http://jsfiddle.net/jesus_tesh/2m9mx/" rel="noreferrer">jsfiddle</a></p>
6,011,636
403 - Forbidden on basic MVC 3 deploy on iis7.5
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/2374957/asp-net-mvc-on-iis-7-5">ASP.NET MVC on IIS 7.5</a> </p> </blockquote> <p>I am trying to deploy a basic MVC 3 application to my 2008 R2 Server running iis 7.5 but receive a "403 - Forbidden" error trying...
6,011,811
3
1
null
2011-05-15 22:17:24.743 UTC
9
2012-06-11 10:51:49.06 UTC
2017-05-23 12:08:41.553 UTC
null
-1
null
708,430
null
1
27
asp.net|asp.net-mvc-3|iis-7.5
25,141
<p>Run <code>aspnet_regiis -i</code>. Often I've found you need to do that to get 4.0 apps to work. Open a command prompt:</p> <pre><code>cd \ cd Windows\Microsoft .NET\Framework\v4.xxx.xxx aspnet_regiis -i </code></pre> <p>Once it has installed and registered, make sure you application is using an application poo...
45,785,898
How to use the code returned from Cognito to get AWS credentials?
<p>Right now, I'm struggling to understand AWS Cognito so maybe someone could help me out. I set a domain to serve Cognito's hosted UI for my User Pool like what's described <a href="http://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-ux.html" rel="noreferrer">here</a>. So when I go to <code>htt...
63,096,171
6
2
null
2017-08-20 19:12:51.523 UTC
17
2022-05-07 15:55:16.907 UTC
2022-03-25 13:34:12.657 UTC
null
1,461,269
null
1,461,269
null
1
43
javascript|amazon-web-services|amazon-cognito|aws-sdk
20,811
<p><em>First off, screw authentication a thousand times. No one deserves to spend half a day looking at this shit.</em></p> <p>Authentication for API Gateway Authorized with Cognito</p> <p><strong>Ingredients</strong></p> <ol> <li><p><code>client_id</code> and <code>client_secret</code>: In Cognito &gt; General Setting...
46,041,811
Performance of various numpy fancy indexing methods, also with numba
<p>Since for my program fast indexing of <code>Numpy</code> arrays is quite necessary and fancy indexing doesn't have a good reputation considering performance, I decided to make a few tests. Especially since <code>Numba</code> is developing quite fast, I tried which methods work well with numba.</p> <p>As inputs I've...
46,043,964
1
3
null
2017-09-04 17:29:35.63 UTC
13
2019-12-09 19:03:46.377 UTC
2017-09-07 14:49:36.947 UTC
null
6,345,518
null
6,345,518
null
1
27
python|performance|numpy|indexing|numba
8,209
<p>Your summary isn't completely correct, you already did tests with differently sized arrays but one thing that you didn't do was to change the number of elements indexed.</p> <p>I restricted it to pure indexing and omitted <code>take</code> (which effectively is integer array indexing) and <code>compress</code> and ...
6,265,024
Function Returning Boolean?
<p>I have simple function in VBA and I would need to check whether or not it has been successfully performed. I do not know VBA much, so I have no idea whether or not its possible. I want to do something like this: <code>bool X=MyFunction()</code>. </p> <p>I am using VBA in the <a href="http://en.wikipedia.org/wiki/HP...
6,265,063
5
0
null
2011-06-07 12:19:02.907 UTC
0
2012-08-28 14:45:01.05 UTC
2012-08-28 14:45:01.05 UTC
null
1,146,308
null
787,426
null
1
16
function|vba
107,070
<pre><code>function MyFunction() as Boolean ..... ..... MyFunction = True 'worked end function dim a as boolean = MyFunction() </code></pre>
6,202,074
Convert string to int if string is a number
<p>I need to convert a string, obtained from excel, in VBA to an interger. To do so I'm using <code>CInt()</code> which works well. However there is a chance that the string could be something other than a number, in this case I need to set the integer to 0. Currently I have:</p> <pre><code>If oXLSheet2.Cells(4, 6)...
6,202,469
6
0
null
2011-06-01 13:38:15.617 UTC
8
2020-04-02 18:21:05.98 UTC
2020-03-20 19:40:52.277 UTC
null
11,636,588
null
779,501
null
1
72
excel|vba
651,141
<p>Use <code>IsNumeric</code>. It returns true if it's a number or false otherwise.</p> <pre><code>Public Sub NumTest() On Error GoTo MyErrorHandler Dim myVar As Variant myVar = 11.2 'Or whatever Dim finalNumber As Integer If IsNumeric(myVar) Then finalNumber = CInt(myVar) Else ...
6,072,197
Mysql:Trim all fields in database
<pre><code>UPDATE mytable SET mycolumn= LTRIM(RTRIM(mycolumn)); </code></pre> <p>works fine on trimming columns removing trailer spaces, but how can i adjust it to trim all columns <strong>without having to write each column name</strong> in table ?? cause i kind have a huge database.</p>
28,275,037
7
0
null
2011-05-20 12:56:10.997 UTC
3
2021-02-19 23:47:54.28 UTC
2011-05-20 13:23:11.193 UTC
null
741,156
null
741,156
null
1
28
mysql|trim
16,833
<p>Some years late, but might help others: This code trims <strong>all</strong> fields of a the table <code>your_table</code>. Could be expanded to work on the whole database in the same way....</p> <pre><code>SET SESSION group_concat_max_len = 1000000; SELECT concat('update your_table set ', group_concat(concat('`...
5,929,878
Why is the size 127 (prime) better than 128 for a hash-table?
<p>Supposing simple uniform hashing, that being, any given value is equally like to hash into any of the slots of the hash. Why is it better to use a table of size 127 and not 128? I really don't understand what's the problem with the power of 2 numbers. Or how it actually makes any difference at all.</p> <blockquote>...
5,930,358
9
8
null
2011-05-08 19:47:48.72 UTC
17
2017-06-01 09:01:22.01 UTC
2017-05-23 12:18:06.173 UTC
null
-1
null
234,167
null
1
55
algorithm|hash|primes
13,203
<blockquote> <p>All numbers (when hashed) are still going to be the p lowest-order bits of k for 127 too. </p> </blockquote> <p>That is wrong (or I misunderstood..). <code>k % 127</code> depends on all bits of k. <code>k % 128</code> only depends on the 7 lowest bits. </p> <hr> <p>EDIT:</p> <p>If you have a perfe...
5,924,777
How to get last day of last week in sql?
<p>How to get last date of the lastweek in sql? I mean last sunday date using query? </p>
5,925,176
10
0
null
2011-05-07 23:54:37 UTC
7
2016-10-27 12:09:47.877 UTC
null
null
null
null
158,008
null
1
37
sql|sql-server|tsql
89,853
<p>Regardless of the actual DATEFIRST setting, the last Sunday could be found like this:</p> <pre><code>SELECT DATEADD(day, -1 - (DATEPART(weekday, GETDATE()) + @@DATEFIRST - 2) % 7, GETDATE() ) AS LastSunday </code></pre> <p>Replace <code>GETDATE()</code> with a parameter ...
25,075,683
Spring MVC validator annotation + custom validation
<p>I'm working on spring mvc application, where I should aplly validation based on Spring MVC validator. I first step for that I added annotation for class and setup controller and it works fine. And now I need to implement custom validator for perform complex logic, but i want to use existing annotation and just add a...
32,066,557
3
1
null
2014-08-01 08:10:03.117 UTC
10
2015-08-18 07:56:17.99 UTC
null
null
null
null
1,646,082
null
1
32
java|spring|validation|spring-mvc
34,717
<p>I know this is a kind of old question but, for googlers...</p> <p>you should use <code>addValidators</code> instead of <code>setValidator</code>. Like following:</p> <pre><code>@InitBinder protected void initBinder(final WebDataBinder binder) { binder.addValidators(yourCustomValidator, anotherValidatorOfYours)...
19,793,738
Joining two datasets to create a single tablix in report builder 3
<p>I am attempting to join two datasets in to one tablix for a report. The second dataset requires a personID from the first dataset as its parameter.</p> <p>If i preview this report only the first dataset is shown. but for my final result what i would like to happen is for each row of a student there is a rowgroupin...
19,798,563
2
0
null
2013-11-05 16:21:21.817 UTC
4
2018-06-21 10:17:03.48 UTC
null
null
null
null
1,395,607
null
1
16
ssrs-2008|reportbuilder3.0
107,346
<p>The best practice here is to do the join within one dataset (i.e. joining in SQL) </p> <hr> <p>But in cases that you need data from two separate cubes(SSAS) the only way is the following:</p> <ol> <li>Select the main dataset for the Tablix</li> <li><p>Use the <a href="http://technet.microsoft.com/en-us/library/ee...
52,551,718
What use is @TestInstance annotation in JUnit 5?
<p>Can you give a simple explanation of <code>@TestInstance</code> annotation and how it is useful in JUnit 5?</p> <p>I think we can achieve the same effect probably by <strong>making our fields <em><code>static</code></em></strong>.</p>
52,552,268
5
0
null
2018-09-28 08:55:25.63 UTC
11
2022-09-20 16:27:33.6 UTC
2020-09-27 09:35:33.49 UTC
null
8,583,692
null
8,583,692
null
1
54
java|unit-testing|testing|junit|junit5
34,892
<p>I think <a href="https://junit.org/junit5/docs/current/user-guide/#writing-tests-test-instance-lifecycle" rel="noreferrer">the docs</a> provide a useful summary:</p> <blockquote> <p>If you would prefer that JUnit Jupiter execute all test methods on the same test instance, simply annotate your test class with @TestIn...
41,666,130
export default vs module.exports differences
<p>This works:</p> <pre><code>import {bar} from './foo'; bar(); // foo.js module.exports = { bar() {} } </code></pre> <p>And this works:</p> <pre><code>import foo from './foo'; foo.bar(); // foo.js export default { bar() {} } </code></pre> <p>So why doesn't this work?</p> <pre><code>import {bar} from './foo'; ...
41,666,401
3
0
null
2017-01-15 20:46:53.873 UTC
24
2022-02-20 22:17:40.863 UTC
null
null
null
null
29,493
null
1
37
javascript|ecmascript-6
40,480
<p>When you have</p> <pre><code>export default { bar() {} } </code></pre> <p>The actual object exported is of the following form:</p> <pre><code>exports: { default: { bar() {} } } </code></pre> <p>When you do a simple import (e.g., <code>import foo from './foo';</code>) you are actually getting the defaul...
21,760,762
asp.net Web Api routing not working
<p>Here is my routing configuration:</p> <pre><code>config.Routes.MapHttpRoute( name: "ActionApi", routeTemplate: "api/{controller}/{action}/{id}", defaults: new { id = RouteParameter.Optional } ); </code></pre> <p>And, here is my controller:</p> <pre><code>public class ProductsController : ApiController...
21,761,061
3
0
null
2014-02-13 17:05:35.783 UTC
6
2014-02-13 18:59:50.393 UTC
2014-02-13 17:17:36.847 UTC
null
781,366
null
781,366
null
1
12
asp.net|asp.net-web-api|routing
40,734
<p>This is because of your routing settings and its default values. You have two choices.</p> <p>1) By changing the route settings to match the Product() parameter to match the URI.</p> <pre><code>config.Routes.MapHttpRoute( name: "ActionApi", routeTemplate: "api/{controller}/{action}/{name}", // removed id a...
39,939,143
Parse JSON response with Swift 3
<p>I have JSON looking like this:</p> <pre><code>{"posts": [ { "id":"1","title":"title 1" }, { "id":"2","title":"title 2" }, { "id":"3","title":"title 3" }, { "id":"4","title":"title 4" }, { "id":"5","title":"title 5" } ], "text":"Some text", ...
39,939,465
4
0
null
2016-10-09 01:46:41.84 UTC
3
2019-11-26 20:59:40.13 UTC
2016-10-09 01:58:09.5 UTC
null
5,644,794
null
3,051,755
null
1
13
ios|json|swift|swift3
53,273
<p>Use this to parse your data:</p> <pre><code>let url = URL(string: "http://example.com/file.php") URLSession.shared.dataTask(with:url!, completionHandler: {(data, response, error) in guard let data = data, error == nil else { return } do { let json = try JSONSerialization.jsonObject(with: data, opti...
36,977,735
Display Gradle output in console in Intellij IDEA 2016.1.1
<p>When running Gradle task from IDEA:</p> <p><a href="https://i.stack.imgur.com/gDzFW.png" rel="noreferrer"><img src="https://i.stack.imgur.com/gDzFW.png" alt="IDEA Gradle window" /></a></p> <p>console output looks like:</p> <p><a href="https://i.stack.imgur.com/89cMd.png" rel="noreferrer"><img src="https://i.stack.im...
37,002,644
3
0
null
2016-05-02 08:01:51.317 UTC
10
2022-02-22 06:06:16.49 UTC
2020-06-20 09:12:55.06 UTC
null
-1
null
4,423,968
null
1
112
intellij-idea|gradle
28,193
<p>You can click the icon marked in the image bellow</p> <blockquote> <p>Toggle tasks executions/text mode</p> </blockquote> <p>That will switch to the console log of your build and you can see what went wrong.</p> <p><a href="https://i.stack.imgur.com/jRaqN.png" rel="nofollow noreferrer"><img src="https://i.stack...
24,057,040
Content-Security-Policy Spring Security
<p>assuming a working hello world example of spring security and spring mvc.</p> <p>when i take a trace with wireshark i see the following flags on the http request</p> <pre><code>X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block Cache-Control: no-cache, no-store, max-age=0, must-revalidate Pragma: n...
24,102,032
3
0
null
2014-06-05 09:55:54.46 UTC
6
2018-05-23 07:30:16.36 UTC
2017-09-21 16:56:57.533 UTC
null
352,708
null
1,816,260
null
1
22
spring|security|spring-security|content-security-policy
55,354
<p>Simply use the addHeaderWriter method like this: </p> <pre><code>@EnableWebSecurity @Configuration public class WebSecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http // ... .headers() .addHeaderWriter(ne...
21,809,749
Drop Column with foreign key in MySQL
<p>I have the following 2 tables:</p> <pre><code>CREATE TABLE `personal_info` ( `p_id` int(11) NOT NULL AUTO_INCREMENT, `name` text NOT NULL, `initials` text NOT NULL, `surname` text NOT NULL, `home_lang` int(11) NOT NULL, PRIMARY KEY (`p_id`), KEY `home_lang` (`home_lang`), CONSTRAINT `personal_info_ibfk_1` F...
21,809,780
3
1
null
2014-02-16 10:01:40.5 UTC
2
2019-11-18 09:34:06.093 UTC
null
null
null
null
1,759,954
null
1
21
mysql|sql|database|database-design
55,039
<p>Your <code>DROP FOREIGN KEY</code> syntax is using the wrong key name. It's trying to drop your "plain" index on the <code>home_lang</code> field. It's NOT the foreign key itself.</p> <pre><code>CONSTRAINT `personal_info_ibfk_1` FOREIGN KEY (`home_lang`) REFERENCES `language_list` (`ll_id`) ^^^^^^^^^^^^...
33,078,003
Android 6.0 Permission Error
<p>I'm getting this error:</p> <pre><code>getDeviceId: Neither user 10111 nor current process has android.permission.READ_PHONE_STATE. at android.os.Parcel.readException(Parcel.java:1599) at android.os.Parcel.readException(Parcel.java:1552) </code></pre> <p>I had given it in manifest though. Is there any change...
33,078,679
5
1
null
2015-10-12 09:44:36.027 UTC
9
2018-11-08 05:02:10.703 UTC
2015-10-16 10:14:46.297 UTC
null
2,527,204
null
3,500,742
null
1
21
android
45,714
<p>Yes permissions have changed on Android M. Permissions are now requested at runtime as opposed to install time previous to Android M.</p> <p>You can check out the docs <a href="https://developer.android.com/training/permissions/index.html" rel="noreferrer">here</a></p> <blockquote> <p>This release introduces a n...
9,530,493
how to create pinterest style hiding/unhiding nav/tab bar?
<p>How do I create a hiding/unhiding nav bar like what pinterest and many other apps is doing? I know the basic idea is to use the UIScrollView delegate and detect whether I am scrolling up or down and show the nav bar based on that. So should I also adjust the navcontroller view height if the nav bar is hidden? How do...
9,545,487
3
0
null
2012-03-02 09:00:57.02 UTC
9
2013-06-05 22:20:22.803 UTC
null
null
null
null
721,937
null
1
12
iphone|objective-c|ios|ipad|uinavigationcontroller
13,179
<p>I have a sample project located on github that does exactly the pinterest/piictu style 'hide the UINavigationController / UITabBarController stuff'</p> <p><a href="https://github.com/tonymillion/ExpandingView" rel="noreferrer">https://github.com/tonymillion/ExpandingView</a></p>
9,100,606
Cannot read configuration file due to insufficient permissions
<p>I am trying to test my Web Service on an IIS instance on my local machine before I promote to a windows server 2008 environment. I get this when I attempt to browse to the service. I have created a custom application pool that this service will run under btw. So I am guessing that that application ID does not hav...
9,766,024
9
0
null
2012-02-01 17:45:53.263 UTC
4
2022-08-30 09:47:03.62 UTC
null
null
null
null
729,820
null
1
31
iis|applicationpoolidentity
100,930
<p>Not sure whether this is too late for you.</p> <p>The <strong>IIS</strong> website is run by either <strong>USERS</strong> or <strong>IIS_IUSRS</strong>.</p> <p>Try to do following:</p> <ul> <li>From Windows Explorer</li> <li>Right click on the folder pointed by the web</li> <li>Go to security tab</li> <li>Add <stro...
9,133,024
www-data permissions?
<p>So I have a directory in /var/www (called cake) and I need to allow www-data to write to it, but I also want to write to it (without having to use sudo). I'm afraid to change the permissions to 777 in case some other user on my machine (or a hacker) attempts to modify files in that directory. How do I only allow acc...
9,133,067
3
0
null
2012-02-03 17:43:02.97 UTC
98
2021-03-01 07:56:20.16 UTC
null
null
null
null
1,015,599
null
1
122
apache|permissions|sudo
254,531
<pre><code>sudo chown -R yourname:www-data cake </code></pre> <p>then</p> <pre><code>sudo chmod -R g+s cake </code></pre> <p>First command changes owner and group.</p> <p>Second command adds s attribute which will keep new files and directories within cake having the same group permissions.</p>
34,211,131
New React Native project with old version of react native
<p>I am trying to create a new react native project which should utilize an older version of react-native.</p> <p>The result I would like would be to do something like: <code>react-native init MyProject</code> but have the version of react-native it uses be <code>0.13.2</code>.</p> <p>However, there doesn't seem to b...
41,526,461
9
1
null
2015-12-10 20:28:46.433 UTC
16
2022-04-22 03:26:22.757 UTC
null
null
null
null
1,617,560
null
1
62
ios|xcode|reactjs|react-native
38,901
<p>There is a new parameter in <code>react-native init</code> that allows just this. Try: </p> <pre><code>react-native init --version="react-native@0.36.0" MyNewApp </code></pre> <p>Here my <a href="https://github.com/facebook/react-native/issues/4723" rel="noreferrer">source</a>. I have successfully tested it with <...
10,339,930
Why can I edit the contents of a final array in Java?
<p>The following code in Java uses a <code>final</code> array of <code>String</code>.</p> <pre><code>final public class Main { public static final String[] CONSTANT_ARRAY = {&quot;I&quot;, &quot;can&quot;, &quot;never&quot;, &quot;change&quot;}; public static void main(String[] args) { for (int x = 0; x &lt; C...
10,340,003
9
1
null
2012-04-26 19:18:48.9 UTC
20
2022-08-19 18:24:58.063 UTC
2022-08-19 18:24:58.063 UTC
null
2,756,409
null
1,037,210
null
1
64
java|arrays|final
72,829
<p><code>final</code> in Java affects the <em>variable</em>, it has nothing to do with the object you are assigning to it.</p> <pre><code>final String[] myArray = { "hi", "there" }; myArray = anotherArray; // Error, you can't do that. myArray is final myArray[0] = "over"; // perfectly fine, final has nothing to do wi...
10,521,061
How to get an MD5 checksum in PowerShell
<p>I would like to calculate an <a href="http://en.wikipedia.org/wiki/MD5">MD5</a> checksum of some content. How do I do this in PowerShell?</p>
10,521,162
19
1
null
2012-05-09 17:24:26.913 UTC
63
2022-01-14 07:41:27.777 UTC
2014-07-05 09:20:35.1 UTC
null
63,550
null
184,773
null
1
214
powershell|powershell-2.0
353,743
<p>Starting in PowerShell version 4, this is easy to do for files out of the box with the <a href="https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Utility/Get-FileHash?view=powershell-4.0" rel="noreferrer"><code>Get-FileHash</code></a> cmdlet:</p> <pre><code>Get-FileHash &lt;filepath&gt; -Algori...
18,919,845
How to Set up PHP Test Server in Dreamweaver?
<p>I am trying to setup a PHP server so that I could use the "Live" feature in Dreamweaver, in addition to being able to preview in my browser without having to upload the .php file via an FTP application every time, which is not efficient when I want to do quick small previews.</p> <p>I have setup a new website and s...
19,004,953
2
2
null
2013-09-20 14:55:42.66 UTC
2
2015-04-26 10:29:53.77 UTC
null
null
null
null
2,431,040
null
1
4
php|mysql|sql-server|testing|dreamweaver
44,824
<p>To set up PHP server with dreamweaver follow the following steps</p> <p>Step 1. </p> <p>Make Sure you have MAMA(For MAC OX) or WAMP (Window OS) install. If you dont know where to get then click this link <a href="http://www.mamp.info/en/downloads/" rel="noreferrer">http://www.mamp.info/en/downloads/</a> and insta...
36,748,923
How to escape a backslash in Powershell
<p>I'm writing a powershell program to replace strings using</p> <pre><code>-replace "$in", "$out" </code></pre> <p>It doesn't work for strings containing a backslash, how can I do to escape it?</p>
36,749,463
2
1
null
2016-04-20 15:45:08.153 UTC
1
2017-07-29 02:19:52.78 UTC
null
null
null
null
4,472,146
null
1
13
windows|powershell
40,562
<p>The <code>-replace</code> operator uses regular expressions, which treat backslash as a special character. You can use double backslash to get a literal single backslash.</p> <p>In your case, since you're using variables, I assume that you won't know the contents at design time. In this case, you should run it thro...
18,191,779
HTML5/JS - Start several webworkers
<p>I'm currently writing on a program, where I have to deal with huge arrays. I can however split those arrays. My plan now is, to process the arrays in different web workers. I have however never worked with them and do have several questions:</p> <p><strong>1.</strong> How would I run several web workers? I tried a ...
18,192,122
2
4
null
2013-08-12 16:11:54.807 UTC
11
2016-06-30 15:49:27.617 UTC
null
null
null
null
1,994,642
null
1
9
javascript|arrays|html|performance|web-worker
13,669
<blockquote> <p>1. How would I run several web workers? I tried a for-loop looking like that:</p> </blockquote> <p>There's no problem with creating more than one worker, even if you don't keep track of them in an array. See below.</p> <blockquote> <p>2. How would I control that all have finished their work? (I ne...
18,216,291
Jquery "if this and if that" then do this
<p>This should be so simple, but it's not working for me. I want to say:</p> <p>If this doesn't have the class "current" AND if the body class does not equal "home", then do this....</p> <p>Here is what I'm trying (among other things) to no avail. Only the first conditional works.</p> <pre><code>$(".nav1 &gt; ul &gt...
18,216,326
2
3
null
2013-08-13 18:16:09.023 UTC
3
2013-08-13 18:28:56.743 UTC
2013-08-13 18:28:56.743 UTC
null
2,274,595
null
2,274,595
null
1
17
jquery|conditional-statements
92,263
<p>Try <code>$("body")</code> and <code>&amp;&amp;</code>:</p> <pre><code> if ( (!$(this).hasClass("current")) &amp;&amp; (!$("body").hasClass("home")) ){ //... </code></pre> <p>Or this way , it is shorter:</p> <pre><code> if ( !$(this).is(".current") &amp;&amp; !$("body").is(".home") ){ //... </code>...
35,525,574
How to use database connections pool in Sequelize.js
<p>I need some clarification about what the pool is and what it does. The docs say Sequelize will setup a connection pool on initialization so you should ideally only ever create one instance per database.</p> <pre><code>var sequelize = new Sequelize('database', 'username', 'password', { host: 'localhost', dialect...
44,193,117
3
1
null
2016-02-20 16:02:19.363 UTC
10
2018-11-05 19:34:58.463 UTC
2016-02-20 16:35:41.077 UTC
null
405,623
null
5,508,854
null
1
34
node.js|sequelize.js
48,330
<p>When your application needs to retrieve data from the database, it creates a database connection. Creating this connection involves some overhead of time and machine resources for both your application and the database. Many database libraries and ORM's will try to reuse connections when possible, so that they do no...
35,364,214
Does MySQL overwrite a column of same value on update?
<p>When updating a table in MySQL, for example:</p> <blockquote> <p><strong>Table</strong> <code>user</code></p> </blockquote> <pre><code>user_id | user_name 1 John 2 Joseph 3 Juan </code></pre> <p>If I run the query</p> <pre><code>UPDATE `user` SET user_name = 'John' WHERE user_id = 1 </code><...
35,364,215
1
2
null
2016-02-12 13:47:52.913 UTC
3
2020-07-28 17:35:08.783 UTC
2020-07-28 17:34:15.757 UTC
null
63,550
null
4,802,649
null
1
30
mysql|sql-update
15,675
<p>As the <a href="http://dev.mysql.com/doc/refman/5.7/en/update.html" rel="noreferrer">MySQL manual for the UPDATE statement</a> implies,</p> <blockquote> <p>If you set a column to the value it currently has, MySQL notices this and does not update it.</p> </blockquote> <p>So, if you run this query, MySQL will understa...
28,276,706
PostgreSQL error Fatal: role “username” does not exist
<p>I'm setting up my PostgreSQL 9.1 in windows.</p> <p>I can't do anything with PostgreSQL: can't createdb, can't createuser; all operations return the error message</p> <p>Fatal: role root does not exist<br> root is my account name, which I created while installing <code>Postgresql</code></p> <p>But I am able to co...
28,276,875
3
1
null
2015-02-02 11:26:51.943 UTC
9
2022-04-14 08:38:35.093 UTC
2017-05-23 12:17:23.06 UTC
null
-1
null
1,355,500
null
1
23
postgresql|windows-7|windows-7-x64|roles
61,803
<p>If you want to login to Postgres using the username <code>root</code> you need to first create such a user.</p> <p>You first need to login as the Postgres super user. This is typically <code>postgres</code> (and is specified during installation):</p> <pre><code>psql -U postgres &lt;user-name&gt; </code></pre> <p>The...
2,324,089
Can someone explain what a wire-level protocol is?
<p>I am not very clear about the idea of wire-level protocols. I heard BitTorrent uses it and read that a wirelevel protocol can be considered an opposite of API. I read RMI calls can be considered wirelevel protocols but am still a little confused. Can someone explain this in a better way?</p>
2,324,113
3
1
null
2010-02-24 06:23:15.86 UTC
9
2018-01-16 06:12:01.367 UTC
null
null
null
null
184,046
null
1
37
networking|terminology|protocols|p2p|bittorrent
15,194
<p>I wouldn't say that something uses a wire-level protocol or doesn't - I'd talk about <em>which</em> wire-level protocol it uses.</p> <p>Basically, if something's communicating with a remote machine (even conceptually) then there's some data going across the network connection (the wire). The description of that dat...
8,476,103
Accessing database connection string using app.config in C# winform
<p>I can't seem to be able to access the app.config database connection string in my c# winforms app. </p> <p>app.config code</p> <pre><code> &lt;connectionStrings&gt; &lt;add name="MyDBConnectionString" providerName="System.Data.SqlClient" connectionString="Data Source=localhost;Initial Catalog=...
8,476,144
10
1
null
2011-12-12 14:48:50.787 UTC
4
2022-07-12 20:45:12.943 UTC
null
null
null
null
371,267
null
1
20
c#|sql|winforms|database-connection|app-config
106,898
<p>This is all you need:</p> <pre><code>System.Configuration.ConfigurationManager.ConnectionStrings["MyDBConnectionString"].ConnectionString; </code></pre>
8,694,871
node.js store objects in redis
<p>Here is the thing - I want to store native JS (node.js) objects (flash sockets references) in redis under a certain key. When I do that with simple <code>client.set()</code> it's stored as a string. When I try to get value I get <code>[object Object]</code> - just a string.</p> <p>Any chance to get this working? He...
8,694,891
8
1
null
2012-01-01 19:05:50.057 UTC
11
2022-02-14 06:10:22.797 UTC
null
null
null
null
591,939
null
1
68
object|node.js|redis
86,047
<p><em>Downvoters: the context here is SET command and ability to store arbitrary objects.</em></p> <p>No, you can't do that. You should accept the fact that Redis stores everything as a string (the protocol is text-based, after all). Redis may perform some optimizations and convert some values to integers, but that's...