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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
38,639,769 | Print a pdf without visually opening it | <p>The thing I want to build is that by clicking a button I want to trigger the print of a PDF file, but without opening it.</p>
<pre><code>+-----------+
| Print PDF |
+-----------+
^ Click *---------> printPdf(pdfUrl)
</code></pre>
<p>The way how I first tried it is to use an iframe:</p>
<pre><code>var $ifr... | 38,814,826 | 3 | 8 | null | 2016-07-28 14:46:58.683 UTC | 15 | 2021-03-08 16:21:22.93 UTC | null | null | null | null | 1,420,197 | null | 1 | 34 | javascript|jquery|pdf|printing | 69,336 | <p><strong>UPDATE</strong>: This <a href="http://nvision.co/blog/tips-and-tricks/auto-print-pdf-file-open/" rel="noreferrer">link</a> details an elegant solution that involves editing the page properties for the first page and adding an action on Page Open. Works across all browsers (as browsers will execute the JavaSc... |
46,102,428 | Get orders shipping items details in WooCommerce 3 | <p>How can I get the <strong>order shipping method id</strong>.?</p>
<p>For example 'flate_rate'.</p>
<p>Since WooCommerce 3 it is now complicated as everything has changed.</p>
<p>I have tried it with <strong><code>$order->get_data()</code></strong> in a foreach loop but the data is protected.</p> | 46,106,700 | 1 | 0 | null | 2017-09-07 17:51:54.127 UTC | 11 | 2021-03-26 14:18:50.797 UTC | 2021-03-26 14:18:50.797 UTC | null | 3,730,754 | null | 5,358,573 | null | 1 | 13 | php|woocommerce|orders|shipping|shipping-method | 36,339 | <p>If you want to get the Order Items Shipping data, you need first to get them in a foreach loop (for <strong><code>'shipping'</code></strong> item type) and to use <a href="https://docs.woocommerce.com/wc-apidocs/class-WC_Order_Item_Shipping.html" rel="noreferrer">WC_Order_Item_Shipping</a> methods to access data</p>... |
2,633,272 | Using Hadoop, are my reducers guaranteed to get all the records with the same key? | <p>I'm running a Hadoop job using Hive actually that is supposed to <code>uniq</code> lines in many text files. In the reduce step, it chooses the most recently timestamped record for each key.</p>
<p><strong>Does Hadoop guarantee that every record with the same key, output by the map step, will go to a single reducer... | 2,633,746 | 3 | 0 | null | 2010-04-13 21:16:17.853 UTC | 9 | 2015-07-19 17:27:16.89 UTC | 2015-05-05 21:33:39.337 UTC | null | 2,932,774 | null | 211,136 | null | 1 | 14 | hadoop|mapreduce|hive|uniq | 6,234 | <p>All values for a key are sent to the same reducer. See this <a href="http://developer.yahoo.com/hadoop/tutorial/module4.html" rel="noreferrer">Yahoo! tutorial</a> for more discussion.</p>
<p>This behavior is determined by the partitioner, and might not be true if you use a partitioner other than the default.</p> |
3,165,449 | Confusing behaviour of const_get in Ruby? | <p>According to the documentation <code>mod.const_get(sym)</code> "Returns the value of the named constant in mod."</p>
<p>I also know that <code>const_get</code> by default may look up the inheritance chain of the receiver. So the following works:</p>
<pre><code>class A; HELLO = :hello; end
class B < A; end
B.con... | 3,167,977 | 3 | 1 | null | 2010-07-02 12:01:57.443 UTC | 9 | 2014-11-10 19:45:50.1 UTC | 2010-07-02 12:19:42.27 UTC | null | 66,725 | null | 66,725 | null | 1 | 20 | ruby | 9,981 | <p>You are correct to be confused... The doc didn't state that Ruby makes a special case for lookup of constants in <code>Modules</code> and has been modified <a href="http://ruby-doc.org/core-1.9.3/Module.html#const_get-method" rel="noreferrer">to state this explicitly</a>. If the constant has not been found in the no... |
1,102,485 | Tables and charts using PDFsharp | <p>I just started with a project that requires me to write to PDF file. After some googling I decided on using PDFsharp which looks simple enough, however I have a few questions regarding drawing tables and charts.</p>
<p>Is PDFsharp a good choice for writing PDF files that contain tables and charts? If no, can you re... | 1,327,257 | 2 | 1 | null | 2009-07-09 08:10:43.113 UTC | 2 | 2016-09-29 21:09:27.883 UTC | 2016-09-29 21:09:27.883 UTC | null | 4,370,109 | null | 55,377 | null | 1 | 13 | c#|charts|pdf-generation|pdfsharp | 41,892 | <p>PDFsharp is a "low level" PDF generator, while MigraDoc is a "high level" document generator that uses PDFsharp to create PDF files, but can also create e. g. RTF.</p>
<p>Visit the PDFsharp/MigraDoc Foundation Website for further information:<br />
<a href="http://www.pdfsharp.net/" rel="noreferrer">http://www.pdfs... |
1,275,633 | Elegantly replace iPhone keyboard with UIPickerView | <p>I have a table view that has embedded UITextFields for entering some data. It also has two other fields that popup a UIPickerView and a UIDatePicker - as demonstrated in the DateCell example from Apple.</p>
<p>Mostly it works but I can't figure out how to cleanly transition from the text field keyboard to the othe... | 1,990,319 | 2 | 0 | null | 2009-08-14 01:41:18.47 UTC | 20 | 2012-11-05 05:25:09.537 UTC | null | null | null | null | 77,002 | null | 1 | 14 | iphone|uitextfield|uipickerview|uidatepicker | 26,932 | <p>First, here is a <a href="http://screencast.com/t/NDViMjYxZGEt" rel="noreferrer">screencapture showing how this looks</a>.</p>
<p>Implement UITextFieldDelegate and display a "popup" containing a UIPickerView.</p>
<pre><code>- (void)textFieldDidEndEditing:(UITextField *)textField {
UIPickerView *picker = [[UIP... |
618,618 | How to create an ArrayList from an Array in PowerShell? | <p>I've got a list of files in an array. I want to enumerate those files, and remove specific files from it. Obviously I can't remove items from an array, so I want to use an <code>ArrayList</code>.
But the following doesn't work for me:</p>
<pre><code>$temp = Get-ResourceFiles
$resourceFiles = New-Object System.Colle... | 618,675 | 2 | 0 | null | 2009-03-06 12:04:09.107 UTC | 10 | 2016-01-05 01:23:47.193 UTC | 2015-02-05 00:40:06.417 UTC | null | 3,829,407 | Mark Ingram | 986 | null | 1 | 24 | powershell | 107,555 | <p>I can't get that constructor to work either. This however seems to work:</p>
<pre><code># $temp = Get-ResourceFiles
$resourceFiles = New-Object System.Collections.ArrayList($null)
$resourceFiles.AddRange($temp)
</code></pre>
<p>You can also pass an integer in the constructor to set an initial capacity.</p>
<p>Wha... |
3,135,112 | android nested listview | <p>is it possible/advisable to have a nested listview?</p>
<p>i.e. a listView that's contained within a row of another listview?</p>
<p>an example would be where my main list is displaying blog posts, and then in each row, you'd have another list view for the comments for each post (that would be collapsible) </p> | 5,983,743 | 5 | 0 | null | 2010-06-28 18:31:17.103 UTC | 10 | 2017-02-22 12:48:31.653 UTC | null | null | null | null | 372,405 | null | 1 | 28 | android|listview|nested | 32,429 | <p>I had the same problem today, so this is what I did to solve it:</p>
<p>I have a ListView, with a CustomAdapter, and on the getView of the customAdapter, I have something like this:</p>
<pre><code>LinearLayout list = (LinearLayout) myView.findViewById(R.id.list_musics);
list.removeAllViews();
for (Music music : a... |
2,700,039 | How to collect all files in a Folder and its Subfolders that match a string | <p>In C# how can I search through a Folder and its Subfolders to find files that match a string value. My string value could be "ABC123" and a matching file might be ABC123_200522.tif. Can an Array collect these?</p> | 2,700,090 | 6 | 0 | null | 2010-04-23 15:59:37.733 UTC | 3 | 2022-01-26 17:33:53.517 UTC | 2022-01-26 17:33:53.517 UTC | null | 107,625 | null | 316,824 | null | 1 | 21 | c#|.net | 42,520 | <pre><code>void DirSearch(string sDir)
{
try
{
foreach (string d in Directory.GetDirectories(sDir))
{
foreach (string f in Directory.GetFiles(d, sMatch))
{
lstFilesFound.Add(f);
... |
2,624,159 | Centering a percent-based div | <p>Recently, a client asked that his site be percent-based rather than pixel-based. The percent was to be set to 80%. As you guys know, it is very easy to center the container if it is pixel-based but how do you center a percent-based main container?</p>
<pre><code>#container
{
width:80%;
margin:0px auto;
}
</code... | 2,624,193 | 6 | 6 | null | 2010-04-12 17:53:12.523 UTC | 10 | 2016-02-24 21:27:48.28 UTC | 2010-04-12 17:54:33.917 UTC | null | 43,089 | null | 139,459 | null | 1 | 38 | css|html | 42,394 | <p>The margin property supports percentage values:</p>
<pre><code>margin-left: 10%;
margin-right: 10%;
</code></pre> |
2,809,366 | Changing java platform on which netbeans runs | <p>I am using Netbeans 6.7. I had first installed Java 1.5 before installing Netbeans. When i installed Netbeans it took Java 1.5 as the default version. Then i installed Java 1.6 on my machine. I need to change the default JDK of my netbeans to 1.6 not only to a specific project but to the whole Netbeans application.<... | 2,809,447 | 7 | 0 | null | 2010-05-11 09:14:29.943 UTC | 27 | 2022-06-11 23:12:50.31 UTC | 2014-10-15 10:26:46.377 UTC | null | 1,528,262 | null | 322,897 | null | 1 | 114 | java|netbeans | 160,102 | <p>You can change the JDK for Netbeans by modifying the config file:</p>
<ol>
<li>Open <code>netbeans.conf</code> file available under <code>etc</code> folder inside the NetBeans installation. </li>
<li>Modify the <code>netbeans_jdkhome</code> variable to point to new JDK path, and then </li>
<li>Restart your Netbeans... |
2,693,021 | How to count JavaScript array objects? | <p>When I have a JavaScript object like this:</p>
<pre><code>var member = {
"mother": {
"name" : "Mary",
"age" : "48"
},
"father": {
"name" : "Bill",
"age" : "50"
},
"brother": {
"name" : "Alex",
"age" : "28"
}
}
</code></pre>
<p><strong>How to c... | 2,693,037 | 8 | 2 | null | 2010-04-22 17:24:35.303 UTC | 10 | 2020-04-13 05:48:57.893 UTC | 2020-04-13 05:48:57.893 UTC | null | 1,446,177 | null | 309,031 | null | 1 | 18 | javascript|oop|object | 103,485 | <p>That's not an array, is an object literal, you should iterate over the own properties of the object and count them, e.g.:</p>
<pre><code>function objectLength(obj) {
var result = 0;
for(var prop in obj) {
if (obj.hasOwnProperty(prop)) {
// or Object.prototype.hasOwnProperty.call(obj, prop)
result+... |
2,749,441 | Fastest way possible to read contents of a file | <p>Ok, I'm looking for the fastest possible way to read all of the contents of a file via php with a filepath on the server, also these files can be huge. So it's very important that it does a READ ONLY to it as fast as possible.</p>
<p>Is reading it line by line faster than reading the entire contents? Though, I re... | 2,749,458 | 9 | 3 | null | 2010-05-01 09:36:00.533 UTC | 13 | 2015-07-07 13:21:44.723 UTC | 2014-01-22 09:25:38.257 UTC | null | 321,731 | null | 304,853 | null | 1 | 31 | php|file-io | 57,541 | <p>If you want to load the full-content of a file to a PHP variable, the easiest <em>(and, probably fastest)</em> way would be <a href="http://fr.php.net/file_get_contents" rel="noreferrer"><strong><code>file_get_contents</code></strong></a>.</p>
<p>But, if you are working with big files, loading the whole file into m... |
2,664,740 | Extract file basename without path and extension in bash | <p>Given file names like these:</p>
<pre><code>/the/path/foo.txt
bar.txt
</code></pre>
<p>I hope to get:</p>
<pre><code>foo
bar
</code></pre>
<p>Why this doesn't work?</p>
<pre><code>#!/bin/bash
fullfile=$1
fname=$(basename $fullfile)
fbname=${fname%.*}
echo $fbname
</code></pre>
<p>What's the right way to do it... | 2,664,746 | 9 | 6 | null | 2010-04-19 01:25:28.833 UTC | 147 | 2020-01-10 07:52:19.657 UTC | 2017-11-16 20:02:02.613 UTC | null | 3,474,146 | null | 67,405 | null | 1 | 418 | linux|bash|unix|filenames | 603,874 | <p>You don't have to call the external <code>basename</code> command. Instead, you could use the following commands:</p>
<pre><code>$ s=/the/path/foo.txt
$ echo "${s##*/}"
foo.txt
$ s=${s##*/}
$ echo "${s%.txt}"
foo
$ echo "${s%.*}"
foo
</code></pre>
<p>Note that this solution should work in all recent (<em>post 2004... |
2,661,764 | How to check if a socket is connected/disconnected in C#? | <p>How can you check if a network socket (System.Net.Sockets.Socket) is still connected if the other host doesn't send you a packet when it disconnects (e.g. because it disconnected ungracefully)?</p> | 2,661,876 | 11 | 0 | null | 2010-04-18 09:35:52.443 UTC | 49 | 2020-10-17 12:50:39.557 UTC | 2013-02-12 18:16:01.693 UTC | null | 319,611 | null | 319,611 | null | 1 | 77 | c#|sockets|connection | 165,027 | <p>As <a href="https://stackoverflow.com/users/138578/programming-hero">Paul Turner</a> answered <code>Socket.Connected</code> cannot be used in this situation. You need to poll connection every time to see if connection is still active. This is code I used:</p>
<pre><code>bool SocketConnected(Socket s)
{
bool pa... |
2,437,452 | How to get the list of files in a directory in a shell script? | <p>I'm trying to get the contents of a directory using shell script.</p>
<p>My script is:</p>
<pre><code>for entry in `ls $search_dir`; do
echo $entry
done
</code></pre>
<p>where <code>$search_dir</code> is a relative path. However, <code>$search_dir</code> contains many files with whitespaces in their names. In... | 2,437,466 | 11 | 0 | null | 2010-03-13 06:03:45.363 UTC | 56 | 2022-07-19 23:49:52.227 UTC | 2010-03-13 06:18:52.627 UTC | null | 275,737 | null | 2,119,053 | null | 1 | 246 | bash|shell|directory-listing | 833,434 | <pre><code>search_dir=/the/path/to/base/dir/
for entry in "$search_dir"/*
do
echo "$entry"
done
</code></pre> |
2,573,521 | How do I output an ISO 8601 formatted string in JavaScript? | <p>I have a <code>Date</code> object. <strong>How do I render the <code>title</code> portion of the following snippet?</strong></p>
<pre><code><abbr title="2010-04-02T14:12:07">A couple days ago</abbr>
</code></pre>
<p><em>I have the "relative time in words" portion from another library.</em></p>
<p>I've... | 8,563,517 | 14 | 0 | null | 2010-04-04 04:04:13.217 UTC | 65 | 2022-03-01 11:29:41.437 UTC | 2016-03-25 19:26:03.247 UTC | null | 293,280 | null | 1,190 | null | 1 | 307 | javascript|datetime|iso8601 | 344,682 | <p>There is already a function called <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString" rel="noreferrer"><code>toISOString()</code></a>:</p>
<pre><code>var date = new Date();
date.toISOString(); //"2011-12-19T15:28:46.493Z"
</code></pre>
<p>If, somehow... |
2,709,253 | Converting a string to an integer on Android | <p>How do I convert a string into an integer?</p>
<p>I have a textbox I have the user enter a number into:</p>
<pre><code>EditText et = (EditText) findViewById(R.id.entry1);
String hello = et.getText().toString();
</code></pre>
<p>And the value is assigned to the string <code>hello</code>.</p>
<p>I want to convert ... | 2,709,269 | 14 | 1 | null | 2010-04-25 17:57:55.373 UTC | 36 | 2022-04-20 06:00:51.547 UTC | 2015-01-16 08:33:22.103 UTC | null | 972,684 | null | 321,763 | null | 1 | 204 | java|android|string|integer|android-edittext | 640,937 | <p>See the Integer class and the static <code>parseInt()</code> method:</p>
<p><a href="http://developer.android.com/reference/java/lang/Integer.html" rel="noreferrer">http://developer.android.com/reference/java/lang/Integer.html</a></p>
<pre><code>Integer.parseInt(et.getText().toString());
</code></pre>
<p>You will... |
2,785,755 | How to split but ignore separators in quoted strings, in python? | <p>I need to split a string like this, on semicolons. But I don't want to split on semicolons that are inside of a string (' or "). I'm not parsing a file; just a simple string with no line breaks.</p>
<p><code>part 1;"this is ; part 2;";'this is ; part 3';part 4;this "is ; part" 5</code></p>
<p>Result should be:</p>... | 2,787,064 | 17 | 6 | null | 2010-05-07 02:13:05.663 UTC | 24 | 2021-03-18 01:48:07.283 UTC | 2012-02-09 01:03:26.973 UTC | null | 121,445 | null | 121,445 | null | 1 | 73 | python|regex | 70,689 | <p>Most of the answers seem massively over complicated. You <strong>don't</strong> need back references. You <strong>don't</strong> need to depend on whether or not re.findall gives overlapping matches. Given that the input cannot be parsed with the csv module so a regular expression is pretty well the only way to go,... |
10,650,645 | Python: Calculate Voronoi Tesselation from Scipy's Delaunay Triangulation in 3D | <p>I have about 50,000 data points in 3D on which I have run scipy.spatial.Delaunay from the new scipy (I'm using 0.10) which gives me a very useful triangulation.</p>
<p>Based on: <a href="http://en.wikipedia.org/wiki/Delaunay_triangulation">http://en.wikipedia.org/wiki/Delaunay_triangulation</a> (section "Relationsh... | 10,657,011 | 4 | 0 | null | 2012-05-18 10:08:15.647 UTC | 18 | 2017-08-09 08:59:12.163 UTC | null | null | null | null | 1,243,969 | null | 1 | 19 | python|3d|scipy|delaunay|voronoi | 19,752 | <p>The adjacency information can be found in the <code>neighbors</code> attribute of the Delaunay object. Unfortunately, the code does not expose the circumcenters to the user at the moment, so you'll have to recompute those yourself.</p>
<p>Also, the Voronoi edges that extend to infinity are not directly obtained in ... |
10,648,828 | see values of chart points when the mouse is on points | <p>I have a chart and I want the user to see the values when the pointer is on the points.
By using digEmAll's help in the page <a href="https://stackoverflow.com/questions/9647666/finding-the-value-of-the-points-in-a-chart">finding the value of the points in a chart</a> ,I could write the following code:</p>
<pre><co... | 10,649,892 | 3 | 0 | null | 2012-05-18 07:55:52.6 UTC | 9 | 2018-07-27 18:44:53.4 UTC | 2017-05-23 12:26:37.537 UTC | null | -1 | null | 973,562 | null | 1 | 21 | c#|winforms|mschart | 56,852 | <p>You should modify the code in this way:</p>
<pre><code>Point? prevPosition = null;
ToolTip tooltip = new ToolTip();
void chart1_MouseMove(object sender, MouseEventArgs e)
{
var pos = e.Location;
if (prevPosition.HasValue && pos == prevPosition.Value)
return;
tooltip.RemoveAll();
pre... |
10,807,765 | node.js sequelize: multiple 'where' query conditions | <p>How do i query a table with multiple conditions?
Here are the examples both working:</p>
<pre><code>Post.findAll({ where: ['deletedAt IS NULL'] }).success()
</code></pre>
<p>and</p>
<pre><code>Post.findAll({ where: {topicId: req.params.id} }).success()
</code></pre>
<p>Then, if i need conditions combined, i feel... | 29,952,146 | 5 | 0 | null | 2012-05-29 22:42:56.43 UTC | 7 | 2021-07-09 08:21:42.8 UTC | null | null | null | null | 1,389,265 | null | 1 | 24 | node.js|sequelize.js | 64,597 | <p>Please note that as of this posting and the 2015 version of sequelize, the above answers are out of date. I am posting the solution that I got working in hopes of saving someone some time.</p>
<pre><code>filters["State"] = {$and: [filters["State"], {$not: this.filterSBM()}] };
</code></pre>
<p>No... |
10,839,151 | Convert mysql DATETIME column to epoch seconds | <p>I have a column mysql <code>datetime</code> that is in DATETIME format. </p>
<p>Is there a way to <code>SELECT</code> this column in epoch seconds? If not, what would be the best way of converting the datetime format to epoch seconds? What type of field would be the best to capture this?</p> | 10,839,181 | 2 | 0 | null | 2012-05-31 18:27:19.767 UTC | null | 2018-11-27 01:53:00.343 UTC | 2018-11-27 01:53:00.343 UTC | null | 6,862,601 | null | 651,174 | null | 1 | 27 | mysql|sql|datetime|epoch | 48,210 | <p>Use MySQL's <a href="http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_unix-timestamp"><code>UNIX_TIMESTAMP</code></a> function</p> |
10,806,790 | Generating Symmetric Matrices in Numpy | <p>I am trying to generate symmetric matrices in numpy. Specifically, these matrices are to have random places entries, and in each entry the contents can be random. Along the main diagonal we are not concerned with what entries are in there, so I have randomized those as well.</p>
<p>The approach I have taken is to fi... | 10,806,947 | 7 | 0 | null | 2012-05-29 21:12:11.593 UTC | 12 | 2022-04-22 10:56:07.667 UTC | 2022-04-22 10:56:07.667 UTC | null | 365,102 | null | 1,424,707 | null | 1 | 39 | python|random|matrix|numpy|adjacency-matrix | 52,296 | <p>You could just do something like:</p>
<pre><code>import numpy as np
N = 100
b = np.random.random_integers(-2000,2000,size=(N,N))
b_symm = (b + b.T)/2
</code></pre>
<p>Where you can choose from whatever distribution you want in the <code>np.random</code> or equivalent scipy module.</p>
<p><strong>Update:</strong>... |
10,559,275 | How is -march different from -mtune? | <p>I tried to scrub the GCC man page for this, but still don't get it, really.</p>
<p>What's the difference between <code>-march</code> and <code>-mtune</code>?</p>
<p>When does one use just <code>-march</code>, vs. both? Is it ever possible to just <code>-mtune</code>?</p> | 10,559,360 | 2 | 0 | null | 2012-05-11 22:12:18.843 UTC | 22 | 2022-07-17 20:36:00.397 UTC | 2022-07-17 20:36:00.397 UTC | null | 1,161,484 | null | 695,787 | null | 1 | 97 | gcc|optimization|compiler-construction|flags | 35,991 | <p>If you use <code>-march</code> then GCC will be free to generate instructions that work on the specified CPU, but (typically) not on earlier CPUs in the architecture family.</p>
<p>If you just use <code>-mtune</code>, then the compiler will generate code that works on any of them, but will favour instruction sequenc... |
10,394,857 | How to use @Transactional with Spring Data? | <p>I just started working on a Spring-data, Hibernate, MySQL, JPA project. I switched to spring-data so that I wouldn't have to worry about creating queries by hand.</p>
<p>I noticed that the use of <code>@Transactional</code> isn't required when you're using spring-data since I also tried my queries without the annot... | 10,466,591 | 5 | 0 | null | 2012-05-01 07:33:58.38 UTC | 56 | 2022-06-07 22:58:15.163 UTC | 2022-06-07 22:58:15.163 UTC | null | 1,839,439 | null | 1,244,652 | null | 1 | 102 | java|spring|jpa|spring-data|spring-data-jpa | 112,879 | <p>What is your question actually about? The usage of the <code>@Repository</code> annotation or <code>@Transactional</code>.</p>
<p><code>@Repository</code> is not needed at all as the interface you declare will be backed by a proxy the Spring Data infrastructure creates and activates exception translation for anyway... |
5,739,830 | Simple Log to File example for django 1.3+ | <p>The release notes say:</p>
<blockquote>
<p>Django 1.3 adds framework-level
support for Python’s logging module.</p>
</blockquote>
<p>That's nice. I'd like to take advantage of that. Unfortunately <a href="http://docs.djangoproject.com/en/1.11/topics/logging/" rel="noreferrer">the documentation</a> doesn't han... | 7,045,981 | 2 | 0 | null | 2011-04-21 05:12:07.733 UTC | 60 | 2017-12-03 10:25:12.997 UTC | 2017-12-03 10:25:12.997 UTC | null | 1,705,829 | null | 75,033 | null | 1 | 102 | django|django-settings | 53,336 | <p>I truly love this so much here is your working example! Seriously this is awesome!</p>
<p>Start by putting this in your <code>settings.py</code></p>
<pre><code>LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'standard': {
'format' : "[%(asctime)s] %(level... |
6,181,464 | Do c++11 lambdas capture variables they don't use? | <p>When I use <code>[=]</code> to indicate that I would like all local variables to be captured by value in a lambda, will that result in <em>all</em> local variables in the function being copied, or just all local variables <em>that are used by the lambda</em>?</p>
<p>So, for example, if i I have:</p>
<pre><code>vec... | 6,181,507 | 2 | 0 | null | 2011-05-30 23:02:44.607 UTC | 20 | 2014-02-19 23:16:24.557 UTC | 2014-02-19 23:16:24.557 UTC | null | 24,874 | null | 141,719 | null | 1 | 136 | c++|lambda|c++11 | 25,904 | <p>Each variable expressly named in the capture list is captured. The default capture will only capture variables that are both (a) not expressly named in the capture list and (b) <em>used</em> in the body of the lambda expression. If a variable is not expressly named and you don't use the variable in the lambda expr... |
30,802,595 | How Do I Create Sub-Sub-Domain on Cloudflare DNS? | <p>I've let cloudflare manage the DNS of my <code>example.com</code></p>
<p>I have created <code>id.example.com</code> for country's specific customer. I've done it by created cname <code>id</code> with alias <code>example.com</code></p>
<p>I need to create customer portal: <code>my.id.example.com</code>. How?</p> | 31,362,889 | 4 | 0 | null | 2015-06-12 12:01:44.527 UTC | 9 | 2022-07-05 15:14:04.24 UTC | 2022-07-05 15:14:04.24 UTC | null | 1,145,388 | user4804299 | null | null | 1 | 36 | cloudflare | 38,127 | <ul>
<li>In Cloudflare, open the DNS records for <code>domain.example</code></li>
<li>Create a A record for <code>example.id</code> and enter the IP where <code>my.id.domain.example</code> will be hosted, and add record <img src="https://i.stack.imgur.com/5ekPk.jpg" alt="" /></li>
<li>Setup the site <code>my.id.domain.... |
34,001,751 | How to increase/reduce the fontsize of x and y tick labels | <p>I seem to have a problem in figuring out how to increase or decrease the <code>fontsize</code> of both the x and y tick labels while using <code>matplotlib</code>.</p>
<p>I am aware that there is the <code>set_xticklabels(labels, fontdict=None, minor=False, **kwargs)</code> function, but I failed to understand how ... | 34,004,236 | 4 | 0 | null | 2015-11-30 15:10:41.727 UTC | 21 | 2022-08-02 21:31:10.033 UTC | 2022-08-02 21:31:10.033 UTC | null | 7,758,804 | null | 5,110,870 | null | 1 | 46 | python|text|matplotlib|axis-labels|keyword-argument | 141,453 | <p>You can set the fontsize directly in the call to <a href="https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.set_xticklabels.html#matplotlib.axes.Axes.set_xticklabels" rel="noreferrer"><code>set_xticklabels</code></a> and <a href="https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.set_ytickla... |
53,238,230 | How to update globally installed npm packages | <p>Command: <code>npm outdated -g</code></p>
<p>Output: </p>
<pre><code>Package Current Wanted Latest Location
@angular/cli 1.3.1 1.7.4 7.0.5
create-react-app 1.5.2 1.5.2 2.1.1
eslint 5.6.0 5.9.0 5.9.0
expo-cli 2.2.0 2.3.8 2.3.8
gulp-cli 1.4.... | 53,238,253 | 3 | 0 | null | 2018-11-10 10:54:35.94 UTC | 9 | 2021-06-01 13:21:08.14 UTC | 2020-03-24 14:20:25.153 UTC | null | 124,946 | null | 5,048,891 | null | 1 | 105 | npm|npm-install|npm-start | 38,910 | <p>If you want to update all global packages</p>
<pre><code>npm update -g
</code></pre>
<p>If you want to update specific global package</p>
<pre><code>npm update -g <package_name>
</code></pre> |
43,333,542 | What is video timescale, timebase, or timestamp in ffmpeg? | <p>There does not seem to be any explanation online as to what these are. People talk about them a lot. I just want to know what they are and why they are significant. Using -video_track_timescale, how would I determine a number for it? Is it random? Should it be 0?</p> | 43,337,235 | 1 | 0 | null | 2017-04-10 21:58:34.083 UTC | 42 | 2020-02-28 20:08:46.31 UTC | 2017-04-11 05:28:29.733 UTC | null | 1,109,017 | null | 7,835,200 | null | 1 | 72 | video|ffmpeg|codec | 38,371 | <p>Modern containers govern the time component of presentation of video (and audio) frames using timestamps, rather than framerate. So, instead of recording a video as 25 fps, and thus implying that each frame should be drawn 0.04 seconds apart, they store a timestamp for each frame e.g.</p>
<pre><code> Frame pts... |
8,632,705 | How to close a GUI when I push a JButton? | <p>Does anyone know how to make a jbutton close a gui? I think it is like <code>System.CLOSE(0);</code> but that didnt work. it also could be <code>exitActionPerformed(evt);</code>, but that didn't work either. just the line of code will work.</p>
<p>EDIT: never mind guys. the answer was <code>System.exit(0);</code>. ... | 8,632,722 | 7 | 0 | null | 2011-12-26 03:14:49.407 UTC | 2 | 2020-12-15 11:06:38.947 UTC | 2020-12-15 11:06:38.947 UTC | null | 1,783,163 | null | 1,102,109 | null | 1 | 18 | java|swing|user-interface|jbutton | 191,068 | <p>Add your button:</p>
<pre><code>JButton close = new JButton("Close");
</code></pre>
<p>Add an ActionListener:</p>
<pre><code>close.addActionListner(new CloseListener());
</code></pre>
<p>Add a class for the Listener implementing the ActionListener interface and override its main function:</p>
<pre><code>private... |
8,820,553 | How can I do a SQL UPDATE in batches, like an Update Top? | <p>Is it possible to add a TOP or some sort of paging to a SQL Update statement?</p>
<p>I have an <code>UPDATE</code> query, that comes down to something like this:</p>
<pre><code>UPDATE XXX SET XXX.YYY = #TempTable.ZZZ
FROM XXX
INNER JOIN (SELECT SomeFields ... ) #TempTable ON XXX.SomeId=#TempTable.SomeId
WHERE Some... | 8,820,594 | 5 | 0 | null | 2012-01-11 14:01:33.647 UTC | 4 | 2020-09-03 14:20:39.517 UTC | null | null | null | null | 579,690 | null | 1 | 18 | sql|sql-server-2008|tsql | 54,740 | <p>Yes, I believe you can use TOP in an update statement, like so:</p>
<pre><code>UPDATE TOP (10000) XXX SET XXX.YYY = #TempTable.ZZZ
FROM XXX
INNER JOIN (SELECT SomeFields ... ) #TempTable ON XXX.SomeId=#TempTable.SomeId
WHERE SomeConditions
</code></pre> |
8,742,249 | How to set prefixed CSS3 transitions using JavaScript? | <p>How can I set CSS using javascript (I don't have access to the CSS file)?</p>
<pre><code>#fade div {
-webkit-transition: opacity 1s;
-moz-transition: opacity 1s;
-o-transition: opacity 1s;
-ms-transition: opacity 1s;
transition: opacity 1s;
opacity: 0;
position: absolute;
height: 500px;
widt... | 8,742,302 | 6 | 0 | null | 2012-01-05 12:08:16.163 UTC | 10 | 2022-05-09 20:12:43.463 UTC | 2022-05-09 20:12:43.463 UTC | null | 1,264,804 | null | 673,108 | null | 1 | 36 | javascript|css | 81,817 | <p>You should look here: <a href="http://www.javascriptkit.com/javatutors/setcss3properties.shtml" rel="noreferrer">http://www.javascriptkit.com/javatutors/setcss3properties.shtml</a></p>
<p>As you can see setting CSS Properties with "-" just results in the next character to be capital:</p>
<pre><code>document.getEle... |
8,647,024 | How to apply a disc shaped mask to a NumPy array? | <p>I have an array like this:</p>
<pre><code>>>> np.ones((8,8))
array([[ 1., 1., 1., 1., 1., 1., 1., 1.],
[ 1., 1., 1., 1., 1., 1., 1., 1.],
[ 1., 1., 1., 1., 1., 1., 1., 1.],
[ 1., 1., 1., 1., 1., 1., 1., 1.],
[ 1., 1., 1., 1., 1., 1., 1., 1.],
... | 8,650,741 | 7 | 0 | null | 2011-12-27 16:44:38.333 UTC | 21 | 2021-05-03 21:53:28.09 UTC | 2019-07-17 14:15:58.957 UTC | null | 7,851,470 | null | 816,555 | null | 1 | 38 | python|arrays|numpy|mask | 37,426 | <p>I would do it like this, where (a, b) is the center of your mask:</p>
<pre><code>import numpy as np
a, b = 1, 1
n = 7
r = 3
y,x = np.ogrid[-a:n-a, -b:n-b]
mask = x*x + y*y <= r*r
array = np.ones((n, n))
array[mask] = 255
</code></pre> |
8,575,281 | Regex plus vs star difference? | <p>What is the difference between:</p>
<pre><code>(.+?)
</code></pre>
<p>and</p>
<pre><code>(.*?)
</code></pre>
<p>when I use it in my php <code>preg_match</code> regex?</p> | 8,575,344 | 9 | 0 | null | 2011-12-20 12:14:02.957 UTC | 28 | 2020-09-16 02:21:03.367 UTC | null | null | null | null | 533,617 | null | 1 | 122 | php|regex | 117,808 | <p>They are called quantifiers.</p>
<p><code>*</code> 0 or more of the preceding expression</p>
<p><code>+</code> 1 or more of the preceding expression</p>
<p>Per default a quantifier is greedy, that means it matches as many characters as possible.</p>
<p>The <code>?</code> after a quantifier changes the behaviour ... |
8,388,537 | twig: IF with multiple conditions | <p>It seem I have problem with a twig if statement.</p>
<pre><code>{%if fields | length > 0 || trans_fields | length > 0 -%}
</code></pre>
<p>The error is:</p>
<pre><code>Unexpected token "punctuation" of value "|" ("name" expected) in
</code></pre>
<p>I can't understand why this doesn't work, it's like if t... | 8,388,696 | 2 | 0 | null | 2011-12-05 16:33:41.52 UTC | 26 | 2021-11-24 21:21:49.79 UTC | 2017-10-05 00:43:12.95 UTC | null | 42,223 | null | 613,365 | null | 1 | 140 | php|twig|conditional-operator | 260,009 | <p>If I recall correctly Twig doesn't support <code>||</code> and <code>&&</code> operators, but requires <code>or</code> and <code>and</code> to be used respectively. I'd also use parentheses to denote the two statements more clearly although this isn't technically a requirement.</p>
<pre><code>{%if ( fields ... |
55,262,996 | Does awaiting a non-Promise have any detectable effect? | <p>One can <code>await</code> a non-Promise and <a href="https://github.com/Microsoft/TypeScript/issues/8310" rel="noreferrer">that's good so</a>.</p>
<p>All these expressions are valid and cause no error:</p>
<pre><code>await 5
await 'A'
await {}
await null
await undefined
</code></pre>
<p>Is there any <strong>det... | 55,263,084 | 2 | 0 | null | 2019-03-20 14:19:47.373 UTC | 16 | 2019-03-21 08:49:28.157 UTC | 2019-03-20 14:25:18.74 UTC | null | 2,190,498 | null | 2,190,498 | null | 1 | 83 | javascript|ecmascript-2017 | 18,832 | <p><code>await</code> is not a no-op. If the awaited thing is not a promise, it is wrapped in a promise, that promise is awaited. Therefore <code>await</code> changes the execution order (but you should not rely on it nevertheless):</p>
<pre><code>console.log(1);
(async function() {
var x = await 5; // remove await ... |
1,016,749 | How can I concatinate a subquery result field into the parent query? | <p>DB: Sql Server 2008.</p>
<p>I have a really (fake) groovy query like this:-</p>
<pre><code>SELECT CarId, NumberPlate
(SELECT Owner
FROM Owners b
WHERE b.CarId = a.CarId) AS Owners
FROM Cars a
ORDER BY NumberPlate
</code></pre>
<p>And this is what I'm trying to get...</p>
<pre><code>=> 1 ABC12... | 1,016,775 | 3 | 0 | null | 2009-06-19 07:27:41.63 UTC | 1 | 2022-09-23 20:24:16.727 UTC | 2010-05-12 04:28:48.883 UTC | null | 2,391 | null | 30,674 | null | 1 | 4 | sql-server|sql-server-2008|subquery|concatenation | 53,993 | <p>Try the solution to this question:</p>
<p><a href="https://stackoverflow.com/questions/6899/is-there-a-way-to-create-a-mssql-function-to-join-multiple-rows-from-a-subquery">How to create a SQL Server function to "join" multiple rows from a subquery into a single delimited field?</a> </p>
<p>:)</p> |
397,257 | Force TextBlock to wrap in WPF ListBox | <p>I have a WPF listbox which displays messages. It contains an avatar on the left side and the username and message stacked vertically to the right of the avatar. The layout is fine until the message text should word wrap, but instead I get a horizontal scroll bar on the listbox. </p>
<p>I've Googled and found soluti... | 397,287 | 3 | 0 | null | 2008-12-29 07:01:49.45 UTC | 12 | 2017-01-11 15:21:10.327 UTC | 2015-09-23 05:46:05.57 UTC | null | 490,018 | EHaskins | 100 | null | 1 | 96 | wpf|listbox|word-wrap|textblock | 54,683 | <p>Contents of the <code>TextBlock</code> can be wrapped using property <code>TextWrapping</code>.
Instead of <code>StackPanel</code>, use <code>DockPanel</code>/<code>Grid</code>.
One more thing - set <code>ScrollViewer.HorizontalScrollBarVisibility</code> property to <code>Disabled</code> value for the <code>ListBo... |
22,143,881 | How to exclude a file extension from IntelliJ IDEA search? | <p>Is there a way to exclude particular file extension from the results in IntelliJ IDEA's "<em>Find in Path</em>" dialog (invoked by <kbd>CTRL</kbd> + <kbd>SHIFT</kbd> + <kbd>F</kbd>)? I want to exclude all <code>.css</code> files.</p> | 37,781,104 | 7 | 0 | null | 2014-03-03 10:13:28.457 UTC | 35 | 2022-03-04 13:20:39.523 UTC | 2017-12-18 10:50:44.063 UTC | null | 479,156 | null | 3,355,252 | null | 1 | 208 | intellij-idea | 59,801 | <p>In intellij 16 there is a section "File name Filter" to exclude an extension use <code>!*.java</code>. You can give more detailed patterns as well for example I use the pattern below to only return .java files except those with a name starting or ending with test.
Pattern: <code>!*test.java,*.java,!Test*.java</code>... |
6,479,999 | Django admin ManyToMany inline "has no ForeignKey to" error | <p>I'm setting up the Django admin to the following models:</p>
<pre class="lang-py prettyprint-override"><code>class Tag(models.Model):
name = models.CharField(max_length=100)
class Quote(models.Model): ... | 6,480,089 | 1 | 1 | null | 2011-06-25 19:23:23.987 UTC | 17 | 2022-03-25 22:30:06.337 UTC | 2022-03-25 22:30:06.337 UTC | null | 8,172,439 | null | 92,272 | null | 1 | 118 | django|django-models | 54,071 | <p><a href="https://docs.djangoproject.com/en/dev/ref/contrib/admin/#working-with-many-to-many-models" rel="noreferrer">Admin documentation</a> has a section dedicated to inlining with many-to-many relationships. You should use <code>Quote.tags.through</code> as a model for <code>TagInline</code>, instead of <code>Tag<... |
14,556,121 | Java: Print Array: IndexOutOfBoundsException: Index: 2, Size: 2 | <p>I am trying to print the contents of an array using System.out.print() but I encounter this error: </p>
<pre><code>Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 2, Size: 2
at java.util.ArrayList.rangeCheck(ArrayList.java:604)
at java.util.ArrayList.get(ArrayList.java:382)
at Pol... | 14,556,170 | 7 | 2 | null | 2013-01-28 05:46:07.817 UTC | null | 2018-10-23 14:14:21.387 UTC | null | null | null | null | 2,017,027 | null | 1 | 0 | java|arrays|indexoutofboundsexception | 40,845 | <p>Change to <strong>.get(j)</strong> as Renjith says and you can also make sure to never end up in the situation you're in</p>
<p>instead of</p>
<pre><code>for (int q=0; q<j; q++) {
</code></pre>
<p>do</p>
<pre><code>for (int q=0; q<itemList.size(); q++) {
</code></pre>
<p>This way you cannot .get from anyt... |
20,667,473 | Hive Explode / Lateral View multiple arrays | <p>I have a hive table with the following schema: </p>
<pre><code>COOKIE | PRODUCT_ID | CAT_ID | QTY
1234123 [1,2,3] [r,t,null] [2,1,null]
</code></pre>
<p>How can I normalize the arrays so I get the following result </p>
<pre><code>COOKIE | PRODUCT_ID | CAT_ID | QTY
1234123 [1] [r] ... | 20,668,900 | 5 | 0 | null | 2013-12-18 20:11:45.77 UTC | 15 | 2020-06-25 13:00:30.723 UTC | 2018-05-22 12:00:09.203 UTC | null | 119,775 | null | 2,726,995 | null | 1 | 22 | hive|explode|hiveql | 53,224 | <p>You can use the <code>numeric_range</code> and <code>array_index</code> UDFs from Brickhouse ( <a href="http://github.com/klout/brickhouse" rel="noreferrer">http://github.com/klout/brickhouse</a> ) to solve this problem. There is an informative blog posting describing in detail over at <a href="http://brickhouseconf... |
56,298,481 | how to fix [Object: null prototype] { title: 'product' } | <p>I've started learning <code>node.js</code> with <code>express</code> framework , when I post a form like this :</p>
<pre class="lang-js prettyprint-override"><code>router.get('/add-product',(req,res,next)=>{
res.send('<form action="/product" method="POST" ><input type="text&... | 56,298,574 | 11 | 2 | null | 2019-05-24 19:19:21.083 UTC | 14 | 2021-12-07 09:55:35.873 UTC | 2021-02-21 14:17:02.8 UTC | null | 7,619,808 | null | 9,727,465 | null | 1 | 64 | angular|javascript|node.js|express | 80,334 | <p>That’s actually good design. Objects by default inherit the <code>Object.prototype</code> that contains some helper functions (<code>.toString()</code>, <code>.valueOf()</code>). Now if you use <code>req.body</code> and you pass no parameters to the HTTP request, then you'd expect <code>req.body</code> to be empty. ... |
36,026,424 | what is equivalent of a windows service on azure? | <p>what is the way to have an always running process on azure? on windows it is windows service, but do i have to get a virtual machine just to have a single running process? I have looked at various compute options but none of them seems to match what a windows service does. Is there a different way to achieve what a ... | 36,026,596 | 3 | 1 | null | 2016-03-16 03:45:52.603 UTC | 4 | 2019-12-25 07:16:51.767 UTC | null | null | null | null | 404,160 | null | 1 | 46 | azure | 36,544 | <p>You should look at continuously-running web jobs.
See <a href="https://azure.microsoft.com/en-us/documentation/articles/web-sites-create-web-jobs/#CreateContinuous" rel="noreferrer">Running Background tasks with WebJobs on Microsoft Azure</a>.</p>
<p>Other choices are PaaS cloud services worker roles and Azure Ser... |
36,198,278 | Why does the JVM require warmup? | <p>I understand that in the Java virtual machine (JVM), warmup is potentially required as Java loads classes using a lazy loading process and as such you want to ensure that the objects are initialized before you start the main transactions. I am a C++ developer and have not had to deal with similar requirements.</p>
... | 36,206,246 | 7 | 2 | null | 2016-03-24 10:43:04.15 UTC | 24 | 2016-07-11 15:19:57.603 UTC | 2016-07-11 15:19:57.603 UTC | null | 57,695 | null | 6,108,910 | null | 1 | 54 | java|garbage-collection|jvm|low-latency|hft | 19,776 | <blockquote>
<p>Which parts of the code should you warm up?</p>
</blockquote>
<p>Usually, you don't have to do anything. However for a low latency application, you should warmup the critical path in your system. You should have unit tests, so I suggest you run those on start up to warmup up the code.</p>
<p>Even o... |
66,410,115 | Difference between Variance, Covariance, Contravariance and Bivariance in TypeScript | <p>Could you please explain using small and simple TypeScript examples what is Variance, Covariance, Contravariance and Bivariance?</p>
<p><strong>[CONTINUOUS UPDATE]</strong></p>
<p><strong>Useful links:</strong></p>
<ol>
<li><p><a href="https://stackoverflow.com/questions/67482793/typescript-narrowing-type-with-gener... | 66,411,491 | 1 | 0 | null | 2021-02-28 14:30:51.763 UTC | 15 | 2022-08-02 22:06:11.877 UTC | 2022-06-14 19:45:27.957 UTC | null | 1,801,403 | null | 8,495,254 | null | 1 | 11 | typescript|covariance|variance|contravariance|invariance | 1,761 | <p><strong>Variance</strong> has to do with how a generic type <code>F<T></code> <em>varies</em> with respect to its type parameter <code>T</code>. If you know that <code>T extends U</code>, then variance will tell you whether you can conclude that <code>F<T> extends F<U></code>, conclude that <code>... |
20,099,669 | Sort multidimensional array based on 2nd element of the subarray | <p>I have an array like this:</p>
<pre><code>[['G', 10], ['A', 22], ['S', 1], ['P', 14], ['V', 13], ['T', 7], ['C', 0], ['I', 219]]
</code></pre>
<p>I'd like to sort it based on the 2nd element in descending order.
An ideal output would be:</p>
<pre><code>[['I', 219], ['A', 22], ['P', 14], ... ]
</code></pre> | 20,099,713 | 4 | 0 | null | 2013-11-20 15:13:29.56 UTC | 21 | 2021-03-05 03:38:23.46 UTC | 2021-03-05 03:38:23.46 UTC | null | 11,573,842 | null | 2,211,874 | null | 1 | 52 | python|arrays|list|sorting|multidimensional-array | 98,947 | <p><code>list.sort</code>, <a href="http://docs.python.org/2/library/functions.html#sorted" rel="noreferrer"><code>sorted</code></a> accept optional <code>key</code> parameter. <code>key</code> function is used to generate comparison key.</p>
<pre><code>>>> sorted(lst, key=lambda x: x[1], reverse=True)
[['I'... |
5,909,578 | Rounded corner & elliptical shape button in HTML | <p>I want to create a HTML button with rounded corner and elliptical shape without image.
What is the way to do it?</p> | 5,909,668 | 4 | 1 | null | 2011-05-06 09:43:43.387 UTC | 3 | 2015-07-25 08:37:36.057 UTC | null | null | null | null | 739,268 | null | 1 | 5 | html | 40,845 | <p>This makes all sides rounded:</p>
<pre><code>border-radius:40px;
</code></pre>
<p>This makes them elliptical:</p>
<pre><code>border-radius:40px/24px;
</code></pre>
<p>Have a look here to see:</p>
<p><a href="http://jsfiddle.net/xnTZq/" rel="noreferrer">http://jsfiddle.net/xnTZq/</a></p>
<p>Or with some extra u... |
6,119,373 | no implicit conversion from nil to integer - when trying to add anything to array | <p>I'm trying to build a fairly complex hash and I am strangely getting the error</p>
<pre><code>no implicit conversion from nil to integer
</code></pre>
<p>when I use the line</p>
<pre><code>manufacturer_cols << {:field => 'test'}
</code></pre>
<p>I use the same line later in the same loop, and it works n... | 6,120,326 | 4 | 9 | null | 2011-05-25 03:57:41.98 UTC | 2 | 2015-08-12 18:43:46.15 UTC | 2011-05-25 16:52:19.757 UTC | null | 48,067 | null | 48,067 | null | 1 | 15 | ruby|hash | 55,780 | <h3>Implicit Conversion Errors Explained</h3>
<p>I'm not sure precisely why your code is getting this error but I can tell you exactly what the error means, and perhaps that will help.</p>
<p>There are two kinds of conversions in Ruby: <em>explicit</em> and <em>implicit.</em></p>
<p>Explicit conversions use the shor... |
1,606,320 | Android: custom separator (or even item) in ListView depening on content of item | <p>I've a ListView with items containing information about places with a <strong>rating</strong> and the <strong>distance</strong> to the current location.</p>
<p>The items are sorted into groups:</p>
<ul>
<li>Group 1: within 500m</li>
<li>Group 2: 500m - 1km</li>
<li>Group 3: 1km - 1.5km</li>
<li>...</li>
</ul>
<p>... | 1,606,642 | 2 | 0 | null | 2009-10-22 10:26:25.253 UTC | 17 | 2012-06-09 19:52:45.903 UTC | null | null | null | null | 184,367 | null | 1 | 11 | android|listview|separator | 24,581 | <p><a href="http://github.com/commonsguy/cw-advandroid/tree/master/ListView/Sections/" rel="noreferrer">Here is one implementation</a> that does exactly what you describe.</p>
<p>That one is GPLv3, because it is derived from <a href="http://jsharkey.org/blog/2008/08/18/separating-lists-with-headers-in-android-09/" rel... |
1,405,656 | Apache's mod_php OR FastCGI? Which is good for Wordpress? | <p>I have basic idea about running PHP in different configurations like mod_php, cgi, FastCGI, etc.</p>
<p>In my findings and test I found FastCGI is slightly better. I like FastCGI's support for SuEXEC most. Wait I do not want to get into benchmarking business here again. If you surf web, you will find people proving... | 1,943,706 | 2 | 2 | null | 2009-09-10 14:34:08.713 UTC | 12 | 2015-03-12 08:08:12.713 UTC | 2011-10-21 15:28:56.093 UTC | null | 229,044 | null | 156,336 | null | 1 | 20 | php|apache|wordpress|fastcgi|mod-php | 18,947 | <blockquote>
<p>Which method of running PHP consumes less memory?</p>
</blockquote>
<p>I assume that per PHP-processed request they are more or less the same. But if you have mod_php loaded into apache serving images too, then I assume your memory footprint will be higher due to serving static files.</p>
<blockquot... |
2,263,404 | What package I should install for 'pcre-devel'? | <p>I need to install the <code>pcre-devel</code> package to compile <code>lighttpd</code> on Ubuntu:</p>
<blockquote>
<p>configure: error: pcre-config not found, install the pcre-devel package or build with --without-pcre</p>
</blockquote>
<p>Can you please tell me how to do that?</p> | 2,263,433 | 2 | 0 | null | 2010-02-15 00:10:20.927 UTC | 2 | 2021-04-21 12:53:26.323 UTC | 2017-05-02 22:19:19.483 UTC | null | 3,266,847 | null | 114,970 | null | 1 | 35 | ubuntu | 62,644 | <p>Try using <code>apt-cache search</code>, e.g.,</p>
<pre><code>apt-cache search pcre
</code></pre>
<p>For me this turns up a lot so I grep for the keyword <code>dev</code>.</p>
<p>This turns up <code>libpcre3-dev</code> and <code>libpcre++-dev</code>.</p>
<p><code>lighttpd</code> will use one of those no doubt.</p>
<... |
45,807,049 | How to run Vue.js dev serve with https? | <p>I'm using Vue-cli to create vue project with webpack template. how to run it with https in development using: <code>npm run dev</code>?</p> | 45,808,037 | 9 | 1 | null | 2017-08-21 23:57:01.223 UTC | 27 | 2022-07-09 21:01:17.79 UTC | null | null | null | null | 5,297,029 | null | 1 | 89 | https|webpack|vue.js | 88,022 | <p>Webpack template uses <a href="http://expressjs.com/en/api.html" rel="noreferrer"><code>express</code></a> as the server for development. So just replace </p>
<pre><code>var server = app.listen(port)
</code></pre>
<p>with following code in <code>build/dev-server.js</code></p>
<pre><code>var https = require('http... |
68,481,686 | type 'typeof globalThis' has no index signature | <p>i get this error whenever i try to add a function to the global nodejs global namsepace in a TypeScript environment.</p>
<blockquote>
<p>Element implicitly has an 'any' type because type 'typeof globalThis'
has no index signature</p>
</blockquote>
<p>declaring the global namespace</p>
<pre><code>declare global {
n... | 69,241,623 | 8 | 3 | null | 2021-07-22 08:36:18.24 UTC | 8 | 2022-08-26 15:26:16.443 UTC | 2021-09-13 12:51:53.473 UTC | null | 270,274 | null | 11,730,825 | null | 1 | 32 | node.js|typescript|microservices | 18,732 | <p>in my own case i didn't quite realize until later that the global namespace i declared was case sensitive.</p>
<p>instead of this. before my question was edited it was <code>namespace NODEJS</code></p>
<pre><code>declare global {
namespace NODEJS {
interface Global {
signin(): string[]
}
}
}
</code... |
29,329,662 | Are ES6 module imports hoisted? | <p>I know that in the new ES6 module syntax, the JavaScript engine will not have to <strong>evaluate</strong> the code to know about all the imports/exports, it will only <strong>parse</strong> it and “know” what to load.</p>
<p>This sounds like hoisting. Are the ES6 modules hoisted? And if so, will they all be loaded... | 29,334,761 | 3 | 1 | null | 2015-03-29 13:26:00.807 UTC | 6 | 2017-05-06 05:52:07.847 UTC | 2016-11-26 22:33:09.527 UTC | null | 3,853,934 | null | 1,075,401 | null | 1 | 43 | javascript|ecmascript-6|hoisting|es6-modules | 20,123 | <p>After doing some more research, I've found:</p>
<ul>
<li>Imports ARE hoisted! according to the <a href="https://people.mozilla.org/~jorendorff/es6-draft.html#sec-abstract-module-records" rel="noreferrer">spec</a> of <strong><em>ModuleDeclarationInstantiation</em></strong></li>
<li>ALL the dependent Modules will be ... |
29,245,848 | what are all the dtypes that pandas recognizes? | <p>For pandas, would anyone know, if any datatype apart from</p>
<p>(i) <code>float64</code>, <code>int64</code> (and other variants of <code>np.number</code> like <code>float32</code>, <code>int8</code> etc.)</p>
<p>(ii) <code>bool</code></p>
<p>(iii) <code>datetime64</code>, <code>timedelta64</code></p>
<p>such... | 29,246,498 | 3 | 2 | null | 2015-03-25 01:14:35.177 UTC | 22 | 2020-12-22 23:39:24.35 UTC | null | null | null | null | 2,526,657 | null | 1 | 86 | python|python-3.x|pandas | 118,863 | <p><strong>EDIT Feb 2020 following pandas 1.0.0 release</strong></p>
<p>Pandas mostly uses NumPy arrays and dtypes for each Series (a dataframe is a collection of Series, each which can have its own dtype). NumPy's documentation further explains <a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.dtype... |
50,609,417 | Elasticsearch error: cluster_block_exception [FORBIDDEN/12/index read-only / allow delete (api)], flood stage disk watermark exceeded | <p>When trying to post documents to Elasticsearch as normal I'm getting this error:</p>
<pre><code>cluster_block_exception [FORBIDDEN/12/index read-only / allow delete (api)];
</code></pre>
<p>I also see this message on the Elasticsearch logs:</p>
<pre><code>flood stage disk watermark [95%] exceeded ... all indices ... | 50,609,418 | 8 | 1 | null | 2018-05-30 16:21:40.16 UTC | 87 | 2022-09-22 09:21:19.183 UTC | null | null | null | null | 1,175,266 | null | 1 | 292 | elasticsearch | 227,469 | <p>This happens when Elasticsearch thinks the disk is running low on space so it puts itself into read-only mode.</p>
<p>By default Elasticsearch's decision is based on the <strong>percentage</strong> of disk space that's free, so on big disks this can happen even if you have many gigabytes of free space.</p>
<p>The ... |
32,244,774 | What is the Android Studio Terminal Pane? | <p>This may seem trivial, but I really can`t find anything with Google, so I ask here: What is the "Android Studio Terminal pane" mentioned here (under "Add the configuration file to your project"),
<a href="https://developers.google.com/cloud-messaging/android/client" rel="noreferrer">https://developers.google.com/clo... | 32,244,927 | 5 | 1 | null | 2015-08-27 08:51:57.207 UTC | 3 | 2020-05-11 20:26:57.18 UTC | null | null | null | null | 3,869,448 | null | 1 | 17 | android|android-studio | 50,510 | <p>Here it is! Bottom of your Android Studio, select Terminal.
<a href="https://i.stack.imgur.com/s74dI.png"><img src="https://i.stack.imgur.com/s74dI.png" alt="enter image description here"></a></p>
<p>You can also go to: Tools -> Open Terminal</p>
<p><strong>Hint for Android Studio</strong>: Menu Help -> Find Actio... |
6,312,484 | UITableView delete all rows at once | <p>How is it possible to delete all rows from UITableView at once?
Because when I reload table view with new data, I am still inserting new rows:</p>
<pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
C... | 6,312,682 | 5 | 1 | null | 2011-06-10 21:56:44.977 UTC | 7 | 2014-11-18 20:51:12.25 UTC | 2012-04-27 22:16:59.483 UTC | null | 227,532 | null | 329,242 | null | 1 | 18 | objective-c|uitableview|uikit | 45,654 | <p>Do this.</p>
<p>Before you are reloading the table with</p>
<pre><code>[tableView reloadData];
</code></pre>
<p>Remove all objects from your tableView array (The array which populated your tableView)
For example.</p>
<pre><code>[myArray removeAllObjects];
[tableView reloadData];
</code></pre> |
6,124,523 | Linking a static library to an iOS project in Xcode 4 | <p>I have a project (<code>AQGridView</code>) that compiles to a static library, but I can't seem to add it to my project.</p>
<p>Dragging in the project to my project creates a workspace, and if I try to link the <code>libAQGridView.a</code> file from the <code>DerivedData</code> directory it doesn't recognize it as ... | 6,124,872 | 6 | 3 | null | 2011-05-25 12:35:22.52 UTC | 38 | 2022-04-18 05:16:03.273 UTC | 2019-07-09 08:01:04.787 UTC | null | 1,033,581 | null | 443,554 | null | 1 | 76 | iphone|objective-c|ios|xcode4 | 77,648 | <p>I do this as follows:</p>
<ol>
<li>Drag in the static library project. If you have the static library project open in Xcode, close it now.</li>
<li>Select the main project in the project navigator (the project I'm adding the static library to) and in the editor, under the header TARGETS in the left-hand column, sel... |
39,027,204 | Regex get domain name from email | <p>I am learning regex and am having trouble getting <code>google</code> from email address</p>
<p>String</p>
<pre><code>first.name@google.com
</code></pre>
<p>I just want to get google, not google.com</p>
<p>Regex:</p>
<pre><code>[^@].+(?=\.)
</code></pre>
<p>Result: <a href="https://regex101.com/r/wA5eX5/1" rel... | 39,027,263 | 9 | 1 | null | 2016-08-18 20:46:08.45 UTC | 3 | 2022-09-08 22:41:08.863 UTC | null | null | null | null | 791,022 | null | 1 | 25 | regex | 39,128 | <p><code>[^@]</code> means "match one symbol that is <em>not</em> an <code>@</code> sign. That is not what you are looking for - use lookbehind <code>(?<=@)</code> for <code>@</code> and your <code>(?=\.)</code> lookahead for <code>\.</code> to extract server name in the middle:</p>
<pre><code>(?<=@)[^.]+(?=\.)
... |
25,187,048 | Run Executable from Powershell script with parameters | <p>So I have a powershell script that is supposed to run an executable with an argument to pass to set which method I want to run, and I need to pass a parameter, which is a directory to a config file. So this is what I have</p>
<pre><code>Start-Process -FilePath "C:\Program Files\MSBuild\test.exe" -ArgumentList /genm... | 25,494,058 | 4 | 1 | null | 2014-08-07 15:58:08.08 UTC | 14 | 2016-08-25 16:16:55.153 UTC | null | null | null | null | 674,896 | null | 1 | 47 | powershell|command-line | 230,538 | <p>I was able to get this to work by using the <code>Invoke-Expression</code> cmdlet.</p>
<pre><code>Invoke-Expression "& `"$scriptPath`" test -r $number -b $testNumber -f $FileVersion -a $ApplicationID"
</code></pre> |
25,131,484 | Rundll32.exe javascript | <p>I've just (August 2014) seen a report of a program that uses the command line</p>
<pre><code>rundll32.exe javascript:"\..\mshtml,RunHTMLApplication"
</code></pre>
<p>How does that work? I thought the first parameter was supposed to be the name of a DLL (mshtml), but how does rundll32 parse that command line?</p>
... | 25,427,342 | 1 | 1 | null | 2014-08-05 05:00:34.583 UTC | 9 | 2018-02-08 05:00:26.567 UTC | null | null | null | null | 1,335,492 | null | 1 | 9 | javascript|mshtml|rundll32 | 10,462 | <p>There's a great explanation of this here: <a href="http://thisissecurity.net/2014/08/20/poweliks-command-line-confusion/">http://thisissecurity.net/2014/08/20/poweliks-command-line-confusion/</a></p>
<p>To summarize using the same example of:</p>
<pre><code>rundll32.exe javascript:"\..\mshtml,RunHTMLApplication ";... |
33,108,326 | How to pass client-side parameters to the server-side in Angular/Node.js/Express | <p>Probably a very basic question, but I cannot seem to find a simple answer. </p>
<p>I have a GET method leveraging Angular's <code>$http</code> that is requesting a promise from a particular url (<code>URL_OF_INTEREST</code>).</p>
<p>On this server, I run an express script <code>server.js</code> script that can han... | 33,108,469 | 4 | 0 | null | 2015-10-13 16:53:01.803 UTC | 4 | 2016-06-14 03:39:23.577 UTC | null | null | null | null | 4,262,057 | null | 1 | 7 | javascript|angularjs|node.js|express|angularjs-http | 37,996 | <p>You need to pass the data in your get call as folow:</p>
<pre><code>var data = {
amount: 3,
currency: 2,
source: 3,
description: 4
};
$http.get('URL_OF_INTEREST', data) // PASS THE DATA AS THE SECOND PARAMETER
.success(
function(success){
console.log(success)
})
... |
33,878,825 | How to permanently redirect `http://` and `www.` URLs to `https://`? | <p>I have a Google App Engine project. On this project I have setup a custom domain and an SSL certificate. Therefore, I can use <code>https://www.mysite.xxx</code>, <code>http://www.mysite.xxx</code> and just the naked domain <code>mysite.xxx</code>.</p>
<p>Is it possible to permanently redirect the last two to alway... | 33,880,474 | 7 | 0 | null | 2015-11-23 19:16:48.373 UTC | 10 | 2021-04-15 20:48:55.243 UTC | 2018-08-18 00:34:50.017 UTC | null | 4,642,212 | null | 430,861 | null | 1 | 42 | google-app-engine|https|url-redirection | 17,078 | <p>So you can add "secure: always" to your yaml file</p>
<p><a href="https://cloud.google.com/appengine/docs/python/config/appconfig?hl=en#Python_app_yaml_Secure_URLs" rel="noreferrer">https://cloud.google.com/appengine/docs/python/config/appconfig?hl=en#Python_app_yaml_Secure_URLs</a></p> |
19,001,450 | AFNetworking 2.0 cancel specific task | <p>I am trying out afnetworking 2.0 and just trying to figure out how to cancel specific tasks.
The old way would be to use something like</p>
<pre><code>[self cancelAllHTTPOperationsWithMethod:@"POST" path:@"user/receipts"]
</code></pre>
<p>but I dont see anything like this in 2.0</p>
<p>I created a sub class of <c... | 19,004,345 | 3 | 0 | null | 2013-09-25 09:44:16.793 UTC | 8 | 2014-04-08 19:51:00.74 UTC | 2013-09-27 22:57:12.78 UTC | null | 412,916 | null | 408,947 | null | 1 | 17 | ios|afnetworking|afnetworking-2 | 9,793 | <p>You can store the task in a variable so you can access it later:</p>
<pre><code>NSURLSessionDataTask* task = [self GET:path parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
completionBlock(responseObject);
} failure:^(NSURLSessionDataTask *task, NSError *error) {
... |
24,427,056 | What is an operand stack? | <p>I am reading about JVM architecture. Today I read about the concept of the Operand Stack. According to an article:</p>
<blockquote>
<p>The operand stack is used during the execution of byte code instructions
in a similar way that general-purpose registers are used in a native CPU.</p>
</blockquote>
<p>I can't ... | 24,427,197 | 3 | 0 | null | 2014-06-26 09:35:07.183 UTC | 14 | 2020-04-01 07:11:19.587 UTC | 2014-06-26 14:21:33.34 UTC | null | 1,464,444 | null | 3,713,995 | null | 1 | 46 | java|jvm | 13,844 | <p>It's how the various individual bytecode operations get their input, and how they provide their output.</p>
<p>For instance, consider the <code>iadd</code> operation, which adds two <code>int</code>s together. To use it, you push two values on the stack and then use it:</p>
<pre><code>iload_0 # Push the value ... |
49,599,274 | How to submit a form in Vue, redirect to a new route and pass the parameters? | <p>I am using Nuxt and Vue and I am trying to submit a form, redirect the user to a new route including the submitted params, send an API request to get some data and then render that data.</p>
<p>I achieved this by simply setting the form action to the new path and manually adding all the URL parameters to the API re... | 49,609,883 | 3 | 0 | null | 2018-04-01 14:50:53.017 UTC | 7 | 2022-05-12 12:22:09.2 UTC | null | null | null | null | 1,032,472 | null | 1 | 29 | javascript|node.js|vue.js|nuxt.js | 41,661 | <p>The default behavior of <code><form></code> is to reload the page <code>onsubmit</code>. When implementing SPA's it would be better to avoid invoking default behavior of <code><form></code>.</p>
<p>Making use of <code>router module</code> which is available out-of-box in nuxtjs will enable all the redire... |
44,099,594 | How to make a tkinter canvas rectangle with rounded corners? | <p>I would like to create a rectangle with rounded corners. I'm using canvas from tkinter. </p> | 44,100,075 | 3 | 0 | null | 2017-05-21 17:08:20.77 UTC | 9 | 2021-04-12 14:42:44.953 UTC | null | null | null | null | 7,173,551 | null | 1 | 14 | python|python-3.x|canvas|tkinter|tkinter-canvas | 26,392 | <p>Offering an alternate approach to tobias's method would be to indeed do it with one polygon.</p>
<p>This would have the advantage of being one canvas object if you are worried about optimization, or not having to worry about a tag system for referring to a single object.</p>
<p>The code is a bit longer, but very bas... |
31,718,637 | Determine optimization level in preprocessor? | <p><code>-Og</code> is a relatively new optimization option that is intended to improve the debugging experience while apply optimizations. If a user selects <code>-Og</code>, then I'd like my source files to activate alternate code paths to enhance the debugging experience. GCC offers the <a href="https://gcc.gnu.org/... | 31,718,804 | 3 | 0 | null | 2015-07-30 08:22:31.91 UTC | 2 | 2021-03-24 20:47:03.193 UTC | null | null | null | null | 608,639 | null | 1 | 28 | c|gcc|gdb|compiler-optimization|c-preprocessor | 5,011 | <p>I believe this is not possible to know directly the optimization level used to compile the software as this is not in <a href="https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html" rel="noreferrer">the list of defined preprocessor symbols</a></p>
<p>You could rely on <code>-DNDEBUG</code> (no debug) whi... |
30,215,830 | Dockerfile copy keep subdirectory structure | <p>I'm trying to copy a number of files and folders to a docker image build from my localhost.</p>
<p>The files are like this:</p>
<pre><code>folder1/
file1
file2
folder2/
file1
file2
</code></pre>
<p>I'm trying to make the copy like this:</p>
<pre><code>COPY files/* /files/
</code></pre>
<p>However, al... | 30,220,096 | 5 | 3 | null | 2015-05-13 13:09:42.62 UTC | 47 | 2022-08-18 17:11:58.103 UTC | 2022-05-24 18:41:43.747 UTC | null | 5,223,757 | null | 1,220,022 | null | 1 | 445 | copy|docker|dockerfile | 417,089 | <p>Remove star from COPY, with this Dockerfile:</p>
<pre><code>FROM ubuntu
COPY files/ /files/
RUN ls -la /files/*
</code></pre>
<p>Structure is there:</p>
<pre class="lang-sh prettyprint-override"><code>$ docker build .
Sending build context to Docker daemon 5.632 kB
Sending build context to Docker daemon
Step 0 : FR... |
34,012,775 | pyspark and HDFS commands | <p>I would like to do some cleanup at the start of my Spark program (Pyspark). For example, I would like to delete data from previous HDFS run. In pig this can be done using commands such as </p>
<pre><code>fs -copyFromLocal ....
rmf /path/to-/hdfs
</code></pre>
<p>or locally using sh command.</p>
<p>I was wonderin... | 34,019,256 | 4 | 1 | null | 2015-12-01 04:45:55.457 UTC | 13 | 2021-04-12 02:35:17.123 UTC | 2015-12-01 11:27:19.787 UTC | null | 1,560,062 | null | 3,803,714 | null | 1 | 12 | python|apache-spark|hdfs|pyspark | 31,589 | <p>You can execute arbitrary shell command using form example <a href="https://docs.python.org/3.5/library/subprocess.html#subprocess.call" rel="noreferrer"><code>subprocess.call</code></a> or <a href="https://pypi.python.org/pypi/sh" rel="noreferrer"><code>sh</code> library</a> so something like this should work just ... |
22,918,517 | NPM/Bower/Composer - differences? | <p>Can someone explain to me the difference between <code>NPM</code>, <code>Bower</code> and <code>Composer</code>.</p>
<p>They are all package managers - correct?</p>
<p>But when should each one be used?</p>
<p>Also, each one appears to have a json file that accompanies it, does this store all the packages you requ... | 22,920,758 | 1 | 1 | null | 2014-04-07 16:53:34.23 UTC | 37 | 2021-12-18 14:25:41.73 UTC | 2015-12-02 20:44:31.373 UTC | null | 5,493,302 | null | 1,013,512 | null | 1 | 113 | npm|composer-php|bower | 44,821 | <h2>[<strong>update, four years later</strong>]</h2>
<ul>
<li><code>bower</code> is deprecated, and should not be used anymore for new projects. To a large extent, it has been subsumed into node dependency management (from their website: "While Bower is maintained, we recommend using Yarn and Webpack or Parcel for... |
7,309,110 | CSS3 transition on a background image | <p>I want to do an CSS3 transform: rotate(360deg); in a transition 1s;
on a background image instead of a seperate image(element)..
Is this possible? I have searched the hell out of Google but no succes!
What I am trying to achieve is something like: </p>
<pre><code>#footerLogo {
background: url('ster.png'),
-m... | 7,310,379 | 2 | 1 | null | 2011-09-05 13:55:59.703 UTC | 2 | 2015-02-19 20:15:03.447 UTC | 2012-07-28 18:43:40.59 UTC | null | 16,511 | null | 798,022 | null | 1 | 11 | html|css|background|css-transitions | 38,338 | <p>Sure you can, try something like this:</p>
<p><strong>HTML</strong></p>
<pre><code><div id="planet">
</div>
</code></pre>
<p><strong>CSS</strong></p>
<pre><code>#planet {
width:200px;
height:200px;
background: transparent url(http://cdn3.iconfinder.com/data/icons/nx11/Internet%20-%20Real... |
7,635,593 | How to do a second transform on the output of an XSLT template | <p>I have only basic XSLT skills so apologies if this is either basic or impossible.</p>
<p>I have a paginator template which is used everywhere on the site I'm looking at. There's a bug where one particular search needs to have a categoryId parameter appended to the href of the page links. <em>I can't alter the pagin... | 7,637,740 | 2 | 0 | null | 2011-10-03 13:24:23.853 UTC | 10 | 2016-06-09 14:00:42.647 UTC | 2011-10-06 10:57:51.483 UTC | null | 111,082 | null | 111,082 | null | 1 | 17 | xslt | 9,681 | <p>It's possible in XSLT 2; you can store data in a variable and call apply-templates on that.</p>
<p>Basic example:</p>
<pre><code><xsl:variable name="MyVar">
<xsl:element name="Elem"/> <!-- Or anything that creates some output -->
</xsl:variable>
<xsl:apply-templates select="$MyVar"/&g... |
19,066,140 | Doctrine error: "Failed opening required '/tmp/__CG__Source.php' " | <p>I am trying to migrate my PHP application to an Ubuntu server, but without succes. Any help would be appreciated.</p>
<p>First I installed Doctrine successfully into /jorrit/myapp, following the first part of Doctrine's <a href="http://docs.doctrine-project.org/en/latest/tutorials/getting-started.html" rel="noreferr... | 20,231,349 | 3 | 1 | null | 2013-09-28 10:53:37.473 UTC | 11 | 2015-12-15 00:13:34.663 UTC | 2020-06-20 09:12:55.06 UTC | null | -1 | null | 2,366,136 | null | 1 | 35 | php|symfony|doctrine-orm | 25,258 | <p>TL;DR You'll just need to generate your proxy classes manually</p>
<pre><code>vendor/bin/doctrine orm:generate-proxies
</code></pre>
<p>Doctrine uses Proxies to connect the to database. Proxies are generated from the the Entity classes.</p>
<p>In development mode, it generates a Proxies on every request because y... |
38,051,977 | what does populate in mongoose mean? | <p>I came across the following line of code which I couldn't understand ,although there are lot of tutorials that gives information related to examples of <code>populate</code> but there is none that explains what exactly it means.Here is a example </p>
<pre><code>var mongoose = require('mongoose'), Schema = mongoose.... | 38,140,808 | 5 | 2 | null | 2016-06-27 10:46:29.043 UTC | 32 | 2021-04-10 12:45:41.063 UTC | 2016-06-27 11:40:30.85 UTC | null | 4,221,420 | null | 4,221,420 | null | 1 | 49 | mongoose|mongoose-populate | 74,563 | <p><code>populate()</code> function in mongoose is used for populating the data inside the reference. In your example <code>StorySchema</code> is having <code>_creator</code> field which will reference to the <code>_id</code> field which is basically the <code>ObjectId</code> of the mongodb document.</p>
<blockquote>
... |
37,033,129 | spring yml file for specific environment | <p>I have 3 <code>yml</code> files namely </p>
<ul>
<li><code>application-default.yml</code> -> default properties, should be available
in all profiles</li>
<li><code>application-dev.yml</code> -> properties only for dev
profile</li>
<li><code>application-prod.yml</code> -> properties only for prod profile</li>
</ul>
... | 37,043,216 | 3 | 2 | null | 2016-05-04 16:21:00.087 UTC | 9 | 2018-07-03 10:52:36.04 UTC | 2016-05-05 06:31:20.28 UTC | null | 4,414,557 | null | 5,873,698 | null | 1 | 18 | java|spring|spring-boot|yaml | 32,032 | <p>I was able to solve my problem, here is what I did.</p>
<p>Created a file application-common.yml, put the common properties there.
Then in the application-{env}.yml files I put this on the top.</p>
<pre><code>spring:
profiles:
include: default
</code></pre>
<p>Since I dont need to ever load the default profile... |
35,461,203 | Angular 2. How to apply orderBy? | <p>I have a piece of code.</p>
<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code><table class="table table-bordered table-condensed" cellpadding="0" cellspacing="0">
<thead>
<tr>
... | 35,465,976 | 4 | 1 | null | 2016-02-17 15:39:44.95 UTC | 7 | 2020-07-07 01:16:28.063 UTC | null | null | null | null | 5,930,884 | null | 1 | 9 | javascript|angular | 53,836 | <p>You need to implement a custom pipe for this. This corresponds to create a class decorated by @Pipe. Here is a sample. Its transform method will actually handle the list and you will be able to sort it as you want:</p>
<pre><code>import { Pipe } from "angular2/core";
@Pipe({
name: "orderby"
})
export class Order... |
3,657,953 | How do I get the jQuery-UI version? | <p>This should be an easy question, but how do I detect the jQuery-UI version?</p>
<p>This is for a Greasemonkey script and the (current) target page appears to be running jQuery-UI, 1.5.2. But, different target pages may run different versions.</p>
<p><code>console.log ($.ui);</code> did not show anything useful/ob... | 3,658,001 | 1 | 0 | null | 2010-09-07 10:51:04.447 UTC | 10 | 2016-01-01 04:07:21.36 UTC | null | null | null | null | 331,508 | null | 1 | 71 | jquery|jquery-ui|greasemonkey | 42,040 | <p>You can use <a href="http://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.core.js#L21" rel="noreferrer"><code>$.ui.version</code></a>, it's actually the property jQuery UI looks for when determining if it should load itself (if it's already there, abort).</p>
<p>For example <a href="http://jsfiddle.net/nick_... |
47,619,229 | Google sign in failed com.google.android.gms.common.api.ApiException: 10: | <p>So I'm Stuck on this frustrating issue.
I am quite new to Google Auth on Firebase but I done everything the firebase docs instructed in how to integrate the Google SignIn Auth, yet I'm still receiving this weird Error in the console consisted of two parts:</p>
<pre><code>12-03 11:07:40.090 2574-3478/com.google.andr... | 47,620,437 | 25 | 5 | null | 2017-12-03 14:12:27.1 UTC | 15 | 2022-07-11 10:13:37.887 UTC | null | null | null | null | 5,136,577 | null | 1 | 86 | android|firebase|google-authentication | 111,759 | <p>Basically problem is in the <code>SHA1</code> key put on console please regenerate it and put again properly same project.</p>
<p>1)As the answers, make sure that your actual signed Android <code>apk</code> has the same <code>SHA1</code> fingerprint as what you specified in the console of your Firebase project's An... |
1,377,037 | How to set a default tab with Jquery UI | <p>I'm using Jquery and Jquery UI with the following:</p>
<pre><code>$(document).ready(function() {
$('#tabvanilla > ul').tabs({ fx: { height: 'toggle', opacity: 'toggle' } });
});
</code></pre>
<p>Right now it automatically sets the first tabs as the default tab that is selected when the document loads. How d... | 1,377,045 | 3 | 0 | null | 2009-09-04 03:15:27.273 UTC | 3 | 2013-02-11 04:37:44.363 UTC | 2013-01-04 15:53:45.42 UTC | null | 122,139 | null | 168,286 | null | 1 | 13 | jquery|jquery-ui|tabs | 44,573 | <pre><code>$('#tabvanilla > ul').tabs({ selected: 1 });
</code></pre>
<p>More details on the <a href="http://jqueryui.com/demos/tabs/#option-selected" rel="noreferrer">specifications page</a>.</p> |
1,792,763 | With Maven, how can I build a distributable that has my project's jar and all of the dependent jars? | <p>I have a project (of type 'jar') that (obviously) builds a jar. But that project has many dependencies. I'd like Maven to build a "package" or "assembly" that contains my jar, all the dependent jars, and some scripts (to launch the application, etc.)</p>
<p>What's the best way to go about this? Specifically, wh... | 1,793,017 | 3 | 0 | null | 2009-11-24 20:36:21.257 UTC | 14 | 2015-09-25 13:55:44.87 UTC | 2009-11-24 20:37:21.24 UTC | null | 21,234 | null | 44,757 | null | 1 | 28 | java|maven-2 | 6,279 | <p>For a single module, I'd use an assembly looking like the following one (<code>src/assembly/bin.xml</code>):</p>
<pre><code><assembly>
<id>bin</id>
<formats>
<format>tar.gz</format>
<format>tar.bz2</format>
<format>zip</format>
</forma... |
8,403,866 | Values in a pie chart | <p>How do you display the values of each pie in a pie chart using ChartHelper? I am using MVC3/Razor syntax.</p>
<p>Trying to do something like this:</p>
<p><img src="https://i.stack.imgur.com/J8vKu.jpg" alt="Pie"></p>
<p>The image is from <a href="http://www.asp.net/web-pages/tutorials/data/7-displaying-data-in-a-... | 8,403,930 | 3 | 1 | null | 2011-12-06 17:08:56.97 UTC | 2 | 2016-03-15 06:23:35.057 UTC | 2011-12-06 17:11:01.47 UTC | null | 383,710 | null | 463,469 | null | 1 | 3 | c#|asp.net-mvc|asp.net-mvc-3|mschart | 45,008 | <p>I did it by using the <code>System.Web.UI.DataVisualization.Charting.Chart</code> class.</p>
<p>Here is the code in my Controller:</p>
<pre><code>public ActionResult Chart()
{
Chart chart = new Chart();
chart.ChartAreas.Add(new ChartArea());
chart.Series.Add(new Series("Data"));
chart.Series["Data... |
8,763,869 | Append input text field with value of a div | <p>I'm trying to append an input text field and its value to be the value of a div.</p>
<p>Here is what I came up so far:</p>
<pre><code>$(this).append('<input type="text" value=' $('#div1').val() '>');
</code></pre> | 8,763,885 | 4 | 1 | null | 2012-01-06 20:13:28.517 UTC | 1 | 2019-08-06 05:16:48.073 UTC | null | null | null | null | 701,363 | null | 1 | 10 | jquery|append | 44,629 | <p>Don't use HTML strings for everything!</p>
<pre><code>$(this).append(
$('<input>', {
type: 'text',
val: $('#div1').text()
})
);
</code></pre> |
8,772,585 | spring bean with dynamic constructor value | <p>I need to create an Object which is in-complete without the constructor argument. Something like this</p>
<pre><code>Class A {
private final int timeOut
public A(int timeout)
{
this.timeOut = timeout;
}
//...
}
</code></pre>
<p>I would like this Bean to be spring managed, so that I can use Spring A... | 8,773,187 | 3 | 1 | null | 2012-01-07 19:54:18.677 UTC | 11 | 2013-10-29 06:37:26.05 UTC | 2012-01-07 21:17:43.773 UTC | null | 21,234 | null | 61,395 | null | 1 | 17 | java|spring | 20,562 | <p><code>BeanFactory</code> has a <code>getBean(String name, Object... args)</code> method which, according to the <a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/beans/factory/BeanFactory.html#getBean%28java.lang.String,%20java.lang.Object...%29">javadoc</a>, allows you to spe... |
19,373,081 | How to use the Implements in Excel VBA | <p>I'm trying to implement some shapes for an engineering project and abstract it out for some common functions so that I can have a generalized program.</p>
<p>What I'm trying to do is have an interface called <code>cShape</code> and have <code>cRectangle</code> and <code>cCircle</code> implement <code>cShape</code></... | 19,379,641 | 6 | 1 | null | 2013-10-15 04:01:20.683 UTC | 72 | 2021-10-27 07:41:29.143 UTC | 2020-07-08 09:19:37.487 UTC | user2140173 | 11,636,588 | null | 174,634 | null | 1 | 67 | excel|vba|interface | 48,751 | <p>This is an esoteric OOP concept and there's a little more you need to do and understand to use a custom collection of shapes.</p>
<p>You may first want to go through <a href="https://stackoverflow.com/questions/19881863/vba-classes-interfaces-implements-and-adequate-comparison-methods/19908375#19908375"><strong><co... |
956,451 | TFS: Labels vs Changesets | <p>I am trying to come up with best practices regarding use of TFS source control. Right now, anytime we do a build, we label the files that are checked into the TFS with the version number. Is this approach better or worse than simply checking the files in and having the version number in the comments?
Can you then us... | 956,524 | 4 | 0 | null | 2009-06-05 15:21:36.473 UTC | 12 | 2017-08-04 11:21:00.793 UTC | null | null | null | null | 29,726 | null | 1 | 34 | tfs|label|changeset | 46,548 | <p>They have two different purposes, ChangeSets are when the files have actually changed and you wish to keep a permanent record of that change. Labels mark a certain version of the files so that you can easily go back to that point. Unless your build actually changes files under source control and you wish to record t... |
1,005,479 | View classes dependency graph plugin? | <p>Is there any plugins I can use for Eclipse that will show graphical view of classes dependencies? </p> | 1,005,592 | 4 | 2 | null | 2009-06-17 06:59:25.45 UTC | 9 | 2016-05-12 17:42:55.107 UTC | 2016-05-12 17:42:55.107 UTC | null | 452,775 | null | 108,869 | null | 1 | 37 | java|eclipse|eclipse-plugin|eclipse-rcp|eclipse-3.4 | 37,251 | <p><strong><a href="http://classycleplugin.graf-tec.ch/index.html" rel="nofollow noreferrer">Classycle</a></strong> can be a good start (for static dependencies between classes at least)</p>
<p>(I find their graph a bit complicated to follow though : <a href="https://stackoverflow.com/questions/62276/java-package-cycl... |
493,376 | Why does WCF return myObject[] instead of List<T> like I was expecting? | <p>I am returning a List from my WCF method. In my client code, it's return type shows as MyObject[]. I have to either use MyObject[], or IList, or IEnumerable... </p>
<pre><code>WCFClient myClient = new WCFClient();
MyObject[] list = myClient.GetMyStuff();
or
IList<MyObject> list = myClient.GetMyStuf... | 493,405 | 4 | 0 | null | 2009-01-29 20:56:03.247 UTC | 19 | 2016-09-29 10:40:57.82 UTC | 2010-09-19 07:50:58.403 UTC | null | 57,787 | Scott | 3,047 | null | 1 | 63 | c#|wcf|collections | 30,247 | <p>You can specify that you want to use a generic list instead of an array by clicking the advanced button when you add a reference, or you can right click on the service reference and choose configure to change it in place.</p>
<p>The reason is that WCF serializes Generic lists as arrays to send across the wire. The ... |
924,551 | Difference between XPath, XQuery and XPointer | <p>What is the difference between <code>XPath</code>, <code>XQuery</code> and <code>XPointer</code>? As far as I know, <code>XQuery</code> is an extended version of <code>XPath</code>. I have some basic knowledge of <code>XPath</code>. Is there any feature available in <code>XPath</code> which is not in <code>XQuery</c... | 924,594 | 4 | 0 | null | 2009-05-29 05:42:22.29 UTC | 18 | 2016-07-08 06:06:58.873 UTC | 2016-07-07 20:11:42.653 UTC | null | 659,732 | null | 112,500 | null | 1 | 68 | xml|xpath|xquery | 44,913 | <p>Wikipedia is a good place to start for questions like this. Generally, <a href="http://en.wikipedia.org/wiki/XPath" rel="noreferrer">XPath</a> is a language used to succinctly pinpoint exact XML nodes in a DOM. <a href="http://en.wikipedia.org/wiki/XQuery" rel="noreferrer">XQuery</a> is a superset of XPath that al... |
4,101,863 | SQL Server - current user name | <p>Which one should I use to record update made by users?</p>
<ol>
<li><code>SYSTEM_USER</code>, or</li>
<li><code>ORIGINAL_LOGIN()</code>, or</li>
<li><code>SUSER_SNAME()</code></li>
</ol> | 4,102,013 | 1 | 0 | null | 2010-11-04 22:08:53.74 UTC | 17 | 2015-07-27 15:22:27.403 UTC | 2015-07-27 15:22:27.403 UTC | null | 74,757 | null | 85,952 | null | 1 | 62 | sql-server|tsql | 73,421 | <p><code>SYSTEM_USER</code> returns the current executing context, so this can return an impersonated context</p>
<p><code>ORIGINAL_LOGIN()</code> returns the identity of the user that initially connected to the instance, so regardless whether the context is impersonated or not it will yield the original user that log... |
34,727,989 | Why doesn't std::bitset come with iterators? | <p>It appears that <a href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a> does not come with STL iterators.<br>
Therefore, I cannot do the following: </p>
<pre><code>std::bitset<8> bs;
for (auto it: bs) {
std::cout << "this can not be done out of the box\n";
}
</code></pre>
<p>Inst... | 34,728,458 | 2 | 3 | null | 2016-01-11 17:53:48.527 UTC | 3 | 2019-01-24 08:15:24.18 UTC | null | null | null | null | 908,939 | null | 1 | 37 | c++|stl|iterator|bitset|std-bitset | 12,958 | <p>I don't think there was ever an actual decision to exclude iterators from bitset.</p>
<p>Rather, bitset is one of the classes that predates the proposal to add the original Standard Template Library to the C++ standard. When it was designed, essentially <em>none</em> of the standard library included iterators.</p>
... |
31,424,561 | Wait until all promises complete even if some rejected | <p>Let's say I have a set of <code>Promise</code>s that are making network requests, of which one will fail:</p>
<pre><code>// http://does-not-exist will throw a TypeError
var arr = [ fetch('index.html'), fetch('http://does-not-exist') ]
Promise.all(arr)
.then(res => console.log('success', res))
.catch(err =>... | 31,524,969 | 20 | 9 | null | 2015-07-15 07:53:55.82 UTC | 161 | 2022-01-18 09:34:47.077 UTC | 2021-05-06 10:01:46.42 UTC | null | 227,613 | null | 1,751,810 | null | 1 | 543 | javascript|promise|es6-promise | 248,846 | <p>Benjamin's answer offers a great abstraction for solving this issue, but I was hoping for a less abstracted solution. The explicit way to to resolve this issue is to simply call <code>.catch</code> on the internal promises, and return the error from their callback.</p>
<pre><code>let a = new Promise((res, rej) =>... |
26,863,407 | AspectJ Maven Plugin cannot compile my project | <p>I try to use aspectj maven plugin for compile project with aspectj compiler and then I try to package classes into "war" file. Unfortunately, it doesn't work with following configuration (pom.xml):</p>
<pre><code><build>
<plugins>
<plugin>
<groupId>org.apache.maven.pl... | 26,866,775 | 5 | 1 | null | 2014-11-11 11:05:41.01 UTC | 1 | 2020-09-15 08:43:35.03 UTC | 2020-09-15 08:43:35.03 UTC | null | 1,082,681 | null | 980,776 | null | 1 | 21 | java|maven|jakarta-ee|aspectj|aspectj-maven-plugin | 51,304 | <p><strong>Update:</strong> While the things I said about AspectJ Maven configuration in this answer are all correct, the root cause of the concrete problem at hand - bad Maven dependency management - is described in my <a href="https://stackoverflow.com/a/26887224/1082681">other answer</a>. It would be better if that ... |
57,326,789 | How to save enum field in the database room? | <p>I must write the value from the <code>enum</code> enumeration to the database. An error occurs during compilation. What am I doing wrong?</p>
<blockquote>
<p>Cannot figure out how to save this field into database. You can consider adding a type converter for it.</p>
</blockquote>
<pre><code>@ColumnInfo(name = "s... | 60,079,133 | 6 | 2 | null | 2019-08-02 12:46:51.973 UTC | 8 | 2021-05-15 11:57:03.94 UTC | null | null | null | null | 5,894,542 | null | 1 | 46 | android|kotlin|enums|android-room|converters | 24,837 | <p>You can make a convert to each enum, like this:</p>
<pre><code>class Converters {
@TypeConverter
fun toHealth(value: String) = enumValueOf<Health>(value)
@TypeConverter
fun fromHealth(value: Health) = value.name
}
</code></pre>
<p>Or if you prefer store it as SQL <code>integer</code>, you... |
7,389,687 | Operand type clash: uniqueidentifier is incompatible with int | <p>When I attempt to create the stored procedure below I get the following error:</p>
<blockquote>
<p>Operand type clash: uniqueidentifier is incompatible with int</p>
</blockquote>
<p>It's not clear to me what is causing this error. UserID is in fact an int in all of my tables. Can someone tell me what I've done w... | 7,389,771 | 3 | 1 | null | 2011-09-12 14:45:36.35 UTC | 5 | 2019-10-18 02:23:10.263 UTC | 2011-09-12 14:54:46.697 UTC | null | 41,956 | null | 549,273 | null | 1 | 27 | sql|sql-server|tsql|asp.net-membership | 160,718 | <p>Sounds to me like at least one of those tables has defined <code>UserID</code> as a <code>uniqueidentifier</code>, not an <code>int</code>. Did you check the data in each table? What does <code>SELECT TOP 1 UserID FROM</code> each table yield? An <code>int</code> or a <code>GUID</code>?</p>
<p><strong>EDIT</strong>... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.