qid int64 1 74.7M | question stringlengths 0 70k | date stringlengths 10 10 | metadata list | response stringlengths 0 115k |
|---|---|---|---|---|
12,529,023 | I have a `<textarea>` in HTML. When I put cursor in it, it's not starting from the beginning, but is blinking in middle.
### HTML
```
<TD width="21%">
<textarea class="txtarea" style="height:30px;" rows="3" name="Text" Id="Text" value=""> </textarea>
</TD>
```
### CSS
```
.txtarea{
border-right: #646464 ;
... | 2012/09/21 | [
"https://Stackoverflow.com/questions/12529023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1495475/"
] | ```
<textarea class="txtarea" style="height:30px;" rows="3" name="Text" Id="Text" value=""> </textarea>
```
What you have is a space between `<textarea>` and `</textarea>` tags. |
17,842,296 | I have the following excel table:
```
StartDate YTDActual
1/1/2013 100
2/1/2013 200
3/1/2013 99
4/1/2013 33
5/1/2013 45
6/1/2013 0
7/1/2013 0
```
Is there a formula that returns, for each StartDate, the associated value in YTDActual, if it is different than 0, otherwise it would return the last YTDAct... | 2013/07/24 | [
"https://Stackoverflow.com/questions/17842296",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/832783/"
] | This would do it:
```
Col A Col B Col C
StartDate YTDActual NewValue
1/1/2013 100 =if(B2<>0,B2,C1)
...
```
Then just drag down the formula in Column C |
7,222,443 | I have a 9 million rows table and I'm struggling to handle all this data because of its sheer size.
What I want to do is add IMPORT a CSV to the table without overwriting data.
Before I would of done something like this; INSERT if not in(select email from tblName where source = "number" and email != "email") INTO (em... | 2011/08/28 | [
"https://Stackoverflow.com/questions/7222443",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/761501/"
] | If you have unique keys on these fields you can use LOAD DATA INFILE with IGNORE option. It's faster then inserting row by row, and is faster then multi-insert as well.
Look at <http://dev.mysql.com/doc/refman/5.1/en/load-data.html> |
39,761,575 | In my app I generate a QR name in Arabic and then scan and I use `zxing` library to generate but it seems that `zxing` library doesn't support Arabic language because when I scan the generated name it gives me `????`. What is the solution?
This is my code to generate:
```
BitMatrix bitMatrix = multiFormatWriter.enco... | 2016/09/29 | [
"https://Stackoverflow.com/questions/39761575",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4347233/"
] | I found solution:
```
MultiFormatWriter multiFormatWriter = new MultiFormatWriter();
Map<EncodeHintType, Object> hintMap = new EnumMap<EncodeHintType, Object>(EncodeHintType.class);
hintMap.put(EncodeHintType.CHARACTER_SET, "UTF-8");
hintMap.put(EncodeHintType.MARGIN, 1); /* default = 4 */
hintMap.put(EncodeHintType.... |
48,243,404 | I'm curious what the design argument for `doParallel:::doParallelSNOW()` giving a warning when globals are explicitly specified in `.export` could be? For example,
```
library("doParallel")
registerDoParallel(cl <- parallel::makeCluster(2L))
a <- 1
y <- foreach(i = 1L, .export = "a") %dopar% { 2 * a }
## Warning in e... | 2018/01/13 | [
"https://Stackoverflow.com/questions/48243404",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1072091/"
] | So it turns out that the solution to this question requires a bit of scripting using `groovy`.
Below is the updated process model diagram, in it I start a new instance of the `Complete Task` process using a script task then if the user wishes to add more tasks the exclusive gateway can return the user to the Create ta... |
72,041,403 | The input boxes move up when the error message appears at the bottom . The error message is enclosed in a span tag
When the input boxes are blank and the user tries to hit enter the error message should appear below the input box asking the user to enter the valid input , however when the input appears it moves the box... | 2022/04/28 | [
"https://Stackoverflow.com/questions/72041403",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12993416/"
] | Update Columns
--------------
```
Option Explicit
Sub UpdateMin()
Const FirstCellAddress As String = "N2"
Const ColumnOffset As Long = 22
Const ColumnsCount As Long = 100
Const MinCriteria As Double = 8
Dim ws As Worksheet: Set ws = ActiveSheet ' improve!
Dim fCell As Range: Set fCell = ws.... |
23,371,582 | I created [this website](http://www.oooysterfestival.com) with the original intention of having it be mobile. However I've had to take that function out and for the time being just wanted to have it so when you visit the site on a mobile device you just see the website as you would see on the screen. Not mobile friendl... | 2014/04/29 | [
"https://Stackoverflow.com/questions/23371582",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1140019/"
] | In your case you should not use any of the suggested meta viewport tags. If you leave the page without any meta viewport tags you should get the desired result in most mobile browsers.
You could add `<meta name="viewport" content="width=980">` to tell the browser that you content is 980 px, if that is the case. You s... |
49,970,283 | Consider this example:
```
import numpy as np
a = np.array(1)
np.save("a.npy", a)
a = np.load("a.npy", mmap_mode='r')
print(type(a))
b = a + 2
print(type(b))
```
which outputs
```
<class 'numpy.core.memmap.memmap'>
<class 'numpy.int32'>
```
So it seems that `b` is not a `memmap` any more, and I assume that this... | 2018/04/22 | [
"https://Stackoverflow.com/questions/49970283",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/880783/"
] | You can use `nextTick` which will call a function after the next DOM update cycle.
```
this.datepicker = true;
Vue.nextTick(function () {
$(".jquery-date-picker").datepicker();
})
```
And here is it's page in the documentation [VueJS Docs](https://v2.vuejs.org/v2/api/#Vue-nextTick) |
383,744 | I am trying print data in rows and columns using bash script as follows.
```
#!/bin/bash
while IFS='' read -r line || [[ -n "$line" ]]; do
echo "$line"
done < "$1"
{
awk 'BEGIN { print "Points"}
/Points/ { id = $1; }'
}
```
My txt file looks like this:
```
Team Played Wins Tied
england 4 ... | 2017/08/03 | [
"https://unix.stackexchange.com/questions/383744",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/244887/"
] | You don't need a shell loop for this, at all:
```
awk '{$(NF+1) = NR==1 ? "Points" : $3*4 + $4*2; print}' OFS='\t' input.txt
Team Played Wins Tied Points
A 2 1 1 6
B 2 0 1 2
``` |
7,998 | I'm replacing the floor in my bathroom, which was previously a vinyl sheet. Prior to that (and I think original to the house, built in early 70's) it was some peel and stick-type tiles, except they're very hard (they remind of me what would be sold as commercial tiles now). There were some tiles left under the old vani... | 2011/08/01 | [
"https://diy.stackexchange.com/questions/7998",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/157/"
] | A 1 1/4" female FIP adapter worked perfectly. As soon as I saw it, I was embarassed for not having thought of it earlier.

I used some teflon tape, screwed the FIP adapter onto the adapter coming out of the wall, then just glued my 1 1/4" pipe direc... |
14,064,932 | I wrote this piece of code but not sure why it doesn't print the second sentence, it just prints the first part of it which is "Some string concat is like".
I was expecting to see the rest of the sentence from TalkToMe method too.
```
object1 = Object.new
def object1.TalkToMe
puts ("Depending on the time, they may... | 2012/12/28 | [
"https://Stackoverflow.com/questions/14064932",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/320724/"
] | `AccessLevel` is meant to represent a set of individual access rights. To check for specific right you should use something like this:
```
(object.getAccessAllowed() & AccessRight.DELETE_AS_INT) == AccessRight.DELETE_AS_INT
``` |
42,449,250 | I am working on a class assignment (which is why only relevant code is being displayed). I have assigned an array of pointers to an array of random numbers and have to use the bubble sort technique.
The array is set up as follows:
```
int array[DATASIZE] = {71, 1899, 272, 1694, 1697, 296, 722, 12, 2726, 1899};
int *... | 2017/02/24 | [
"https://Stackoverflow.com/questions/42449250",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5553114/"
] | In the call:
```
pointerSwap(toStore[j],toStore[j+1]);
```
you are passing an `int` (`toStore[j]` is equivelent to `*(toStore + j)`) to a function that expects a pointer. You need to pass a pointer, namely:
```
pointerSwap(toStore + j, toStore + j + 1);
```
The second question pertains to sorting out of place. Yo... |
47,656,329 | I created a react component that I want to use twice(or more) inside my page, and I need to load a script tag for it inside the head of my page but just once! I mean even if I use the component twice or more in the page it should add the script tag just once in the head.
The Problem is that this script tag should be a... | 2017/12/05 | [
"https://Stackoverflow.com/questions/47656329",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9056870/"
] | Here what I did to fix my issue:
In Git Settings, Global Settings in Team Explorer, there is an option to choose between OpenSSL and Secure Channel.
Starting with Visual Studio 2017 (version 15.7 preview 3) use of SChannel in Git Global settings fixed my issue. |
60,980,163 | This is very simple example of what I want to get. My question is about @returns tag. What should I write there?
```js
class Base{
/**
* @returns {QUESTION: WHAT SHOUL BE HIRE??}
*/
static method(){
return new this()
}
}
class Sub extends Base{
}
let base= Base.method() // IDE should understand that b... | 2020/04/01 | [
"https://Stackoverflow.com/questions/60980163",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3011740/"
] | I did it for you with MU Grids and media queries, if you have questions, ask. I am always ready to help. This is codesandbox link. Let me know if it help you.
<https://codesandbox.io/s/charming-shirley-oq6l5> |
92,235 | I've been taught that a carbocation mainly rearranges because of:
* increasing degree (1 to 2, 1 to 3, or 2 to 3)
* +M stabilization
* ring expansion (in an exceptional case, ring contraction as well).
However, I've never been taught whether the following carbocation **A** would rearrange:
[![enter image description... | 2018/03/13 | [
"https://chemistry.stackexchange.com/questions/92235",
"https://chemistry.stackexchange.com",
"https://chemistry.stackexchange.com/users/5026/"
] | The answer to this question is quite difficult to deduce logically. In the first place, the carbocation that is formed is secondary. Rearranging will only change the position of the carbocation, but it will be still secondary. But then there is also a stabilising +I effect.
Instead, if we take into account that that t... |
30,354,168 | I have an HTML page (`courses.html`) that shows a list of courses. These courses are loaded from a database by an AJAX call into the array "courses" defined as global variable in `script_1.js`. Once I go to the page of a specific course in `course.html` I want to be able to pass this array to `script_2.js` to mantain t... | 2015/05/20 | [
"https://Stackoverflow.com/questions/30354168",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4347551/"
] | You have the following option for passing data from one page to the next:
1. **Cookie.** Store some data in a cookie in page1. When page2 loads, it can read the value from the cookie.
2. **Local Storage.** Store some data in Local Storage in page1. When page2 loads, it can read the value from the Local Storage.
3. **S... |
64,600,292 | I'm trying to build a new WebApi secured using access tokens from azure active directory.
I'm using .net core v3.1 and visual studio 2019.
I created a new project using the "Asp.net core web application" template and picked an "API" project and changed the authentication type to "Work or School Accounts" and set the ... | 2020/10/29 | [
"https://Stackoverflow.com/questions/64600292",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/428280/"
] | You missed some important steps, your access token is also wrong, it lacks the necessary permissions. You can try to follow my method:
You need to create 2 applications, one representing the client application and the other representing the api application, and then use the client application to call the Web api appli... |
38,473,994 | I am using webapi-avplay to play video on samsung tizen tv web app.
Video starts buffering when I am forwarding the video and after the completion of buffering, video starts playing.
At the time when buffering in progress, I am trying to forward/backward video but unfortunately unable to forward/backward video.
So I wa... | 2016/07/20 | [
"https://Stackoverflow.com/questions/38473994",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4264085/"
] | Have you tried coding inside **onbufferingprogress** method. Like:
```
var listener = {
onbufferingprogress: function(percent) {
console.log("Buffering in progress");
loadingObj.setPercent(percent);
/* Move 5 seconds back */
var back_button = document.getElementById("v-back"); /... |
47,965,975 | While using google map activity in my android application I get this error.
**"Could not resolve com.google.android.gms:play-services:11.8.0."**
**Project level** Gradle file:
```
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// NO... | 2017/12/25 | [
"https://Stackoverflow.com/questions/47965975",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4601864/"
] | So, finally I got the answer,
I've turned on gradle offline mode that's why it could not find out cached files for that version play-service.
I turned it off (under File-Settings-Build,Execution,Deployment-Gradle) and again sync project and some files have been downloaded then it works now. |
1,578,322 | I am so confused that I thought to ask you for your opinion.
I have written few jquery code with asp.net. But there is group of developer in my company who think that javascript/jquery can be turned off and is insecure
* if javascript is insecure, why to use it at the first place
* what are the advantages of using jq... | 2009/10/16 | [
"https://Stackoverflow.com/questions/1578322",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/84950/"
] | >
> if javascript is insecure, why to use it at the first place
>
>
>
To provide advanced browsing experience to those who have it on.
>
> what are the advantages of using jquery with asp.net apart from cross-browser. why not use javascript?
>
>
>
Rapid development. If you're not comfortable with jQuery, cod... |
66,067,834 | I am using this template:
<https://codepen.io/xweronika/pen/abBdXGp>
I created several components like this, in which instead of text there are also tables, buttons and many elements. When it's full screen everything looks fine:
[](https://i.stack.im... | 2021/02/05 | [
"https://Stackoverflow.com/questions/66067834",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12933680/"
] | Remove the `d-none` class from `<div class="carousel-caption d-none d-md-block">`
Check the example [here](https://codepen.io/gionic/pen/yLVewXg)
Display property bootstrap 4 doc [here](https://getbootstrap.com/docs/4.0/utilities/display/) |
39,164,187 | I have two columns which I want to combine and show the data, I tried like below
```
select
case
when status = 'R'
then 'Resign'
when status = 'A'
then 'Active'
end as status1,
Program_name + ' ' + emp_card_no as program_details,
*
from
GetEmployeeDetails
w... | 2016/08/26 | [
"https://Stackoverflow.com/questions/39164187",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1216804/"
] | Try this :
```
select
case when status='R' then 'Resign'
when status='A' then 'Active'
end as status1,
Program_name + ' (' + convert(varchar, emp_card_no) + ') ' as program_details,
*
from GetEmployeeDetails
Where emp_name ='ABHAY ASHOK MANE'and STATUS= 'A' ORDER BY EMP_NAME
``` |
11,851,938 | So I have a page with about 60 of links on it, with random URL's, each one needs to be clicked and downloaded individually.
I'm working on the fundamental script to tab over to the next link, hit enter, and then 'ok' to download to desktop.
I'm new, but I cannot seem to get the 'floating' window which pops up, to let... | 2012/08/07 | [
"https://Stackoverflow.com/questions/11851938",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1169758/"
] | Try passing `fastIframe: false` in the colorbox configuration. It makes colorbox wait until all contents of the iframe are loaded before attempting to show anything.
```
$('a').colorbox({ iframe: true, fastIframe: false });
``` |
17,702,895 | I have the following code in a batch file:
```
set /p user="Enter username: " %=%
cd w:\Files
@echo off
setLocal EnableDelayedExpansion
set /a value=0
set /a sum=0
set /a valA=0
FOR /R %1 %%I IN (*) DO (
set /a value=%%~zI/1024
set /a sum=!sum!+!value!
set /a sum=!sum... | 2013/07/17 | [
"https://Stackoverflow.com/questions/17702895",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2252537/"
] | try to remove the `for /r` parameter `%1`:
```
FOR /R %%I IN (*) DO (
```
---
Try this code:
```
@ECHO OFF &SETLOCAL
FOR /R "w:\Files" %%I IN (*) DO set /a asum+=%%~zI
SET /a sum=asum/1048576
echo Size of "FILES" is: %sum% MB
set /a sum=asum/1073741824
echo Size of "FILES" is: %sum% GB
FOR /R "W:\Documents and Set... |
24,809,965 | I noticed a weird thing when I was writing an angular directive. In the isolated scope of the directive, if I bind an attribute using `myAttr: '@'` to the parent scope variable with the same name, and then use that attribute in the html template, there will be an extra space trailing the attribute value. If the attribu... | 2014/07/17 | [
"https://Stackoverflow.com/questions/24809965",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1264587/"
] | [Known bug](https://github.com/angular/angular.js/issues/8132) in Angular, likely will not be fixed |
9,675 | I am starting some tests for building a game on the Android program.
So far everything is working and seems nice.
However I do not understand how to make sure my game looks correct on all phones as they all will have slightly different screen ratios (and even very different on some odd phones)
What I am doing right n... | 2011/03/12 | [
"https://gamedev.stackexchange.com/questions/9675",
"https://gamedev.stackexchange.com",
"https://gamedev.stackexchange.com/users/6053/"
] | From a high-level perspective there's only a handful of options, depending on which is more important, maintaining a consistent aspect ratio, or ensuring that no one to see more than someone else just because they have a wider or taller screen.
Your options are:
1. Cropping the parts that don't fit.
2. Stretching the... |
52,443,412 | i have to insert data with ajax into database, now it insert data in to database,but not upload the image.
**ajax Code**
```
$(document).on("click","#save", function(){
jQuery.ajax({
method :'post',
url:''+APP_URL+'/products/add_product',
data:$("#product_form").serialize(... | 2018/09/21 | [
"https://Stackoverflow.com/questions/52443412",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8648172/"
] | ```
Try below code to upload image:
`$(document).on("click","#save", function(){
var fd = new FormData();
fd.append('product_photo',$('#id_of_image_uploader').prop('files')[0]);
fd.append('item_name', $('#id_of_item_name').val());
fd.append('barcode', $('#id_of_barcode').val());
jQuery.ajax({
method ... |
73,750,583 | Here's what i have at the moment:
```
let userTeams = ['Liverpool', 'Manchester City', 'Manchester United'];
let object = {
teams: {
'Liverpool': {
player:
['Salah',
'Nunez']
},
'Manchester United': {
player:
['Ronaldo',
... | 2022/09/16 | [
"https://Stackoverflow.com/questions/73750583",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17265256/"
] | I'm guessing that the OP really aims to get a random team name (key) and that team's data (value) in an object. Abstractly, in a few steps:
Here's how to get a random element from an array:
```
const randomElement = array => array[Math.floor(Math.random()*array.length)];
```
That can be used to get a random key fro... |
33,973,634 | I am getting some peculiar behavior in Firefox with localForage. I set up a page to load two arrays using the standard 'setItem' form:
```
<script src="localforage.js"></script>
<body>
<script>
var data = [1,2,3,4,5];
localforage.setItem("saveData", data, function(err, value) {
if (err) {
console.error('error: ', e... | 2015/11/28 | [
"https://Stackoverflow.com/questions/33973634",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4370702/"
] | I also had the same issue but solved it after some researching, trials and discussions. Extensions like FireStorage Plus! and simple session storage do not work flawlessly for detecting this data, especially if it is being performed on a page/file other than the original root page/file.
The solution for me was to use ... |
18,125 | When you gain five pounds in one day people always say "water retention from sodium" and undigested food. To see if this is plausible, I want to get a sense for the scale of the effect. Suppose you consumed an additional 2300 mg of sodium (one US RDA, also the amount of sodium in one 11-ounce bag of Doritos, so it's a ... | 2014/07/09 | [
"https://fitness.stackexchange.com/questions/18125",
"https://fitness.stackexchange.com",
"https://fitness.stackexchange.com/users/8332/"
] | While I agree with Greg, I did some digging and came up with this information:
[An extra 400 milligrams of sodium in your body results in a 2-pound weight increase.](http://healthyeating.sfgate.com/much-sodium-per-day-lose-weight-7850.html) Now, to me, this statistic is questionable, as the author does not site a sourc... |
279,840 | Let's consider a function with evaluated and unevaluated arguments inside:
```
list1 = {1,2,3}
list2 = {x,y,z}
fun[list_]:={list,ToString@Unevaluated@list}
```
When I use Map over `fun` I expect to get result like this:
```
{fun[list1],fun[list2]}
(*{{{1, 2, 3}, "list1"}, {{x, y, z}, "list2"}}*)
```
But instead ... | 2023/02/11 | [
"https://mathematica.stackexchange.com/questions/279840",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/72560/"
] | ```
sol1 = {#[[1]] - 172, #[[2]]} & /@ points ;
sol2 = points - Threaded[{172, 0}];
sol3 = MapAt[Subtract[#, 172] &, points, {All, 1}];
sol4 = {#1 - 172, #2} & @@@ points;
sol1 == sol2 == sol3 == sol4
(* True *)
``` |
236,424 | I have the data stored in the textfile like this:
0.5 0.5 -0.7 -0.8
0.51 0.51 -0.75 -0.85
0.6 0.1 0.1 1.00
and so on
4 numbers in each row.
Two first numbers means coordinates (x0,y0), two last - (x1,y1). This determines the coordinates of a line. So, the first row tells, that I have a line starting from (0.5, 0.5... | 2020/12/12 | [
"https://mathematica.stackexchange.com/questions/236424",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/76234/"
] | ```
data = Import["/Users/roberthanlon/Downloads/lines.txt", "Data"]
(* {{0.5, 0.5, -0.7, -0.8}, {0.51, 0.51, -0.75, -0.85}, {0.6, 0.1, 0.1, 1.}} *)
Graphics[Line /@ (Partition[#, 2] & /@ data), Axes -> True]
```
[](https://i.stack.imgur.com/vTHRm.... |
272,779 | I wrote an answer to this question on [Distinct States](https://physics.stackexchange.com/questions/272556/schroeders-thermal-physics-multiplicity-of-a-single-ideal-gas-molecule/272585#272585), but I am not happy with the answer I gave to the short question at the end.
Hopefully this question is self contained, but pl... | 2016/08/05 | [
"https://physics.stackexchange.com/questions/272779",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/-1/"
] | **OBJECTIVE:** **how to Wick rotate a path integral using Cauchy's theorem**. I like the approach of using Cauchy's theorem and I must admit I haven't seen the finite-time problem approached from this viewpoint before, so it seemed like a fun thing to think about (on this rainy Sunday afternoon!).
When I started thin... |
63,419,309 | MISRA c++:2008 was published in 2008. It was written for C++03.
Does this refer to just the syntax of C++2003 standard or do have to use the compiler as well.
We have written our code base in VS2017 and we only have available for the Language Standard:
* ISO C++14 Standard
* ISO C++17 Standard
* ISO C++ Latest Dra... | 2020/08/14 | [
"https://Stackoverflow.com/questions/63419309",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/767829/"
] | It will be very hard to argue and say that you are MISRA-C++ compliant when not even compiling in C++03 mode. MISRA-C++ is a safe subset of C++03, so it bans a lot of things from that standard. If you run off and compile for C++11 or later, all bets are off.
Visual Studio is not suitable for the kind of mission-critic... |
969,986 | Okay, this is an example from *Challenge and Trill of Pre-college Mathematics* by Krishnamurthy et al.
>
> In how many ways can we form a committee of three from a group of 10 men and 8 women, so that our committee consists of at least one woman?
>
>
>
I know howit usualy goes: let the answer be *$N$*. The number... | 2014/10/12 | [
"https://math.stackexchange.com/questions/969986",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/42814/"
] | Your first way is absolutely correct, and the easiest way to do it.
Another, more cumbersome, way, is to consider cases:
1. exactly one woman: ${8 \choose 1}{10 \choose 2} = 8 \times 45 = 360$ ways.
2. exactly two women: ${8 \choose 2}{10 \choose 1} = 28 \times 10 = 280$ ways.
3. exactly three women: ${8 \choose 3} ... |
126,659 | The $10$ generators of the Poincare group $P(1;3)$ are $M^{\mu\nu}$ and $P^\mu$. These generators can be determined explicitly in the matrix form. However, I have found that $M^{\mu\nu}$ and $P^\mu$ are often written in terms of position $x^\mu$ and momentum $p^\mu$ as
$$ M^{\mu\nu} = x^\mu p^\nu - x^\nu p^\mu $$
and
... | 2014/07/15 | [
"https://physics.stackexchange.com/questions/126659",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/21270/"
] | One obtains those expressions by considering a particular action of the Poincare group on fields.
Consider, for example, a single real scalar field $\phi:\mathbb R^{3,1}\to\mathbb R$. Let $\mathcal F$ denote the space of such fields. Define an action $\rho\_\mathcal F$ of $P(3,1)$ acting on $\mathcal F$ as follows
\be... |
43,242,076 | I am quite new to MySQL. I have data in more than 2000 text files that I need to import into a table. I have created the table as follow:
```
CREATE TABLE test1
(
Month TINYINT UNSIGNED,
Day TINYINT UNSIGNED,
Year TINYINT UNSIGNED,
Weight FLOAT UNSIGNED,
length FLOAT UNSIGNED,
Site_Number C... | 2017/04/05 | [
"https://Stackoverflow.com/questions/43242076",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7821588/"
] | Pattern match is performed linearly as it appears in the sources, so, this line:
```
case Row(t1: Seq[String], t2: Seq[String]) => Some((t1 zip t2).toMap)
```
Which doesn't have any restrictions on the values of t1 and t2 never matter match with the null value.
Effectively, put the null check before and it should w... |
26,137,413 | I have an old website, and I would like to add a glyphicons to a page of this site.
I cannot install bootstrap (link bootstrap.js and bootstrap.css to this page) because it will change all styled elements on the page.
Is there a way to add only "glyphicons functionality"? | 2014/10/01 | [
"https://Stackoverflow.com/questions/26137413",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1049569/"
] | You can build your bootstrap to components, which you need, on
<http://getbootstrap.com/customize/>
For example for **only glyphicon**, you can check only glyphicon checkbox and download.
Direct url for this setting is
**<http://getbootstrap.com/customize/?id=428c81f3f639eb0564a5>**
Scroll down and download it.
Yo... |
50,027,919 | I can trigger my AWS pipeline from jenkins but I don't want to create buildspec.yaml and instead use the pipeline script which already works for jenkins. | 2018/04/25 | [
"https://Stackoverflow.com/questions/50027919",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7372933/"
] | In order to user Codebuild you need to provide the Codebuild project with a buildspec.yaml file along with your source code or incorporate the commands into the actual project.
However, I think you are interested in having the creation of the buildspec.yaml file done within the Jenkins pipeline.
Below is a snippet of... |
22,820,666 | I have a string like this and I want to convert it to DateTime format(MM/dd/yyyyTHH:mm:ss).
but it fails, Please let me know where I'm wrong.
```
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
string stime = "4/17/2014T12:00:00";
DateTime dt = DateTime.ParseExact(stime, "MM/dd/yyyyTHH:mm:ss", Culture... | 2014/04/02 | [
"https://Stackoverflow.com/questions/22820666",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3475314/"
] | You wrote `MM` in your format string, which means that you need a two digit month. If you want a one digit month, just use `M`.
```
DateTime dt = DateTime.ParseExact(stime, "M/dd/yyyyTHH:mm:ss", CultureInfo.InvariantCulture);
```
The other solution is to change your string to match your format.
```
string stime = "... |
8,256,104 | I have a sliding section set up as below. I was wondering if I can somehow add `easeIn` and `easeOut` when the slide goes up and down.
```
$('a#slide-up').click(function () {
$('.slide-container').slideUp(400, function(){
$('#slide-toggle').removeClass('active');
});
return false;
});
$('a#slide-t... | 2011/11/24 | [
"https://Stackoverflow.com/questions/8256104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/893654/"
] | You can. Please check the documentation of [slideDown](http://api.jquery.com/slideDown/) at jQuery docs;.
By default jQUery implements only linear and swing easing functions. For additional easing functions you have to user jQUery UI
---
UPDATE:
Acoording to the doc, the second optional argument is a string indicat... |
41,099 | I have a tentative understanding of modal logic. Can anyone explain modal logic as it is used in computer science? | 2015/04/07 | [
"https://cs.stackexchange.com/questions/41099",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/30383/"
] | I think you can find many good examples if you search a bit online. Some very-easy-to-find examples are in the following list:
From [Stanford Encyclopedia](http://plato.stanford.edu/entries/logic-modal/)
>
> In computer science, labeled transition systems (LTSs) are commonly used to represent possible computation pa... |
30,332,197 | I am working with learning SQL, I have taken the basics course on pluralsight, and now I am using MySQL through Treehouse, with dummy databases they've set up, through the MySQL server. Once my training is complete I will be using SQLServer daily at work.
I ran into a two-part challenge yesterday that I had some troub... | 2015/05/19 | [
"https://Stackoverflow.com/questions/30332197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4611445/"
] | Remove `float:left` from `.menu` and `.menu a` and just add
```
margin: 0 auto;
```
to `.menu` to make the links centered.
Also, change your `display` from `block` to `inline-block` for `.menu a`
Remember to give a width for `.menu`. I just tried a width of `61%` via Inspect Element and it got right.
**OR**
Add... |
48,185,675 | I´ve been searching for a solution to create a dropdownlist in ColumnC (with start from row 2) if there is value in ColumnA same row.
But all I was able to find is how to create one dropdownlist using VBA.
```
Sub DVraschwab()
Dim myList$, i%
myList = ""
For i = 1 To 7
myList = myList & "ListItem" & i &... | 2018/01/10 | [
"https://Stackoverflow.com/questions/48185675",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7888468/"
] | Do you mean like this? You basically just need a loop added to your code to check column A.
```
Sub DVraschwab()
Dim myList As String, r As Range
myList = "Yes,No"
For Each r In Range("A2", Range("A" & Rows.Count).End(xlUp))
If r.Value <> vbNullString Then
With r.Offset(, 2).Vali... |
7,811,268 | I have recently started going through sound card drivers in Linux[ALSA].
Can a link or reference be suggested where I can get good basics of Audio like :
Sampling rate,bit size etc.
I want to know exactly how samples are stored in Audio files on a computer and reverse of this which is how samples(numbers) are played... | 2011/10/18 | [
"https://Stackoverflow.com/questions/7811268",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/993969/"
] | The [Audacity](http://audacity.sourceforge.net/) [tutorial](http://audacity.sourceforge.net/manual-1.2/tutorial_basics_1.html) is a good place to start. Another [introduction](http://www.pgmusic.com/tutorial_digitalaudio.htm) that covers similar ground. The [PureData](http://puredata.info/) [tutorial at flossmanuals](h... |
3,800,925 | What are some of the better libraries for image generation in Python? If I were to implement a GOTCHA (for example's sake), thereby having to manipulate an image on the pixel level, what would my options be? Ideally I would like to save resulting image as a low-resolution jpeg, but this is mere wishing, I'll settle for... | 2010/09/27 | [
"https://Stackoverflow.com/questions/3800925",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/181165/"
] | The Python Imaging Library (PIL) is the *de facto* image manipulation library on Python. You can find it [here](http://www.pythonware.com/products/pil/), or through **easy\_install** or **pip** if you have them.
Edit: PIL has not been updated in a while, but it has been forked and maintained under the name **[pillow](... |
3,013,831 | I have an existing database design that stores Job Vacancies.
The "Vacancy" table has a number of fixed fields across all clients, such as "Title", "Description", "Salary range".
There is an EAV design for "Custom" fields that the Clients can setup themselves, such as, "Manager Name", "Working Hours". The field names... | 2010/06/10 | [
"https://Stackoverflow.com/questions/3013831",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40655/"
] | Have you thought about using an XML column? You can enforce all your constraints declaratively through XSL.
Instead of EAV, have a single column with XML data validated by a schema (or a collection of schemas). |
87,929 | I'm reading a paper on jet engines that repeatedly mentions the stagnation pressure and temperature. What does this mean? Is it the point where the jet engine stalls in performance/efficiency/thrust, etc?
I'm a bit confused. 99% of the information on stagnation pressure is the static pressure, or the about stagnation ... | 2021/06/25 | [
"https://aviation.stackexchange.com/questions/87929",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/44452/"
] | [](https://i.stack.imgur.com/RtPh1.png)[Image source](https://www.researchgate.net/figure/Smoke-visualisation-and-flow-topology-of-the-airflow-around-a-cylinder_fig7_260045652)
Stagnation pressure is used as a synonym for total pressure. An object in ... |
25,688,287 | How can I execute a calculation in python (2.7) and capture the output in the variable 'results'?
**Input:**
```
let calculation = '(3*15)/5'
let formatting = '\\%2d'
let grouping = '0'
exe "python -c \"import math, locale; locale.format(formatting, calculation, grouping)\""
```
and capture the output in a varia... | 2014/09/05 | [
"https://Stackoverflow.com/questions/25688287",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/662967/"
] | Hmm… `:let foo = (3*15)/15`.
Anyway, you can capture the output of an external command with `:let foo = system('mycommand')`:
```
:let foo = system("python -c 'print (15*3)/5'")
```
It's up to you to put the string together. |
59,287,801 | need help
I have a task count of 250.
I want all these tasks to be done via a fixed no of threads. ex 10
so, I want to feed each thread one task
```
t1 =1
t2=2
.
.
.
```
currently I have written the code in such a way that, among those 10 threads each thread picks one task.
and I will wait till all the 10 threads a... | 2019/12/11 | [
"https://Stackoverflow.com/questions/59287801",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12518808/"
] | You're reinventing the wheel; this is not neccessary. Java already contains functionality to have a fixed number of threads plus a number of tasks, and then having this fixed number of threads process all the tasks: [Executors](https://docs.oracle.com/en/java/javase/13/docs/api/java.base/java/util/concurrent/Executors.... |
57,304,522 | I got an upload file functionality in my application and this is working perfectly fine on `localhost`. However, when will run `firebase deploy` and the application is deployed I got the following error with lack of permissions.
Edit: I can deploy, there's no problem with the CLI, just on deployment it doesn't work a... | 2019/08/01 | [
"https://Stackoverflow.com/questions/57304522",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11127383/"
] | Due to the message you're getting, your issue is related to [IAM roles in Firebase](https://firebase.google.com/docs/projects/iam/roles).
Here a [Quick overview](https://firebase.google.com/docs/projects/iam/overview) of those.
Check the Error message you are getting and make sure that the instance you're deploying ... |
5,279,503 | Looking for some help with my bash script. I am trying to write this shell script to do the following:
1. find files in a dir named:
`server1-date.done`
`server2-date.done`
`server3-date.done`
`...`
`server10-date.done`
2. print to a `listA`
3. find files in a dir (\*.gz) and print to a `listB`
4. if `listA` has a co... | 2011/03/11 | [
"https://Stackoverflow.com/questions/5279503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/374916/"
] | I do not know if this will work, but it will fix all the obvious problems:
```
#!/bin/sh
#Directories
GZDIR=/mydumps/mytest
FINALDIR=/mydumps/mytest/final
FLGDIR=/backup/mytest/flags
export GZDIR FINALDIR FLGDIR
#lists
FLGLIST="/mydumps/mytest/lists/userflgs.lst"
GZLIST="/mydumps/mytest/lists/gzfiles.lst"
#Find file... |
16,781 | I am trying to design a filter whose magnitude is the same as that of a given signal. The given signal is wind turbine noise, so it has significant low-frequency content. After designing the filter, I want to filter white Gaussian noise so as to create a model of wind turbine noise. The two signals, that is the origina... | 2014/06/10 | [
"https://dsp.stackexchange.com/questions/16781",
"https://dsp.stackexchange.com",
"https://dsp.stackexchange.com/users/10166/"
] | if you are only interested in designing a signal representing the wind turbine noise, you could just generate it from your magnitude. E.g., with your magnitude $A$ over frequency $f$ you can generate a random phase $\phi$ for each frequency and over a time $t$ and then add all together. Here a small code for illustrati... |
33,554,536 | I want to create a string array between From and To input.
like From = 2000 To = 2003
I want to create a string[] as below:
>
>
> ```
> string[] arrayYear = new string[]{"2000","2001","2002","2003"};
>
> ```
>
>
Is there any easy way of building it dynamically for any range of year?
Please suggest me. | 2015/11/05 | [
"https://Stackoverflow.com/questions/33554536",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1893874/"
] | You can use `Enumerable.Range`
```
int startYear = 2000, endYear = 2004;
string[] arrayYear = Enumerable.Range(startYear, endYear - startYear + 1).Select(i => i.ToString()).ToArray();
``` |
35,840 | I am using Cucumber through IntelliJ and am working on fixing a broken test. I was wondering when debugging, is there a way to save the state of the system up to a certain step in the feature file, if they all pass. For example, take this exaggerated example below
```
Given I am a New User
And There is an Event ... | 2018/09/28 | [
"https://sqa.stackexchange.com/questions/35840",
"https://sqa.stackexchange.com",
"https://sqa.stackexchange.com/users/29912/"
] | Cucumber executes the step definitions glue that you provide it with, so it can't in any way control the state of your system. If you need to save snapshots of the system after each step, call a function that would do that for you at the end of every step. |
45,767 | Every now and then, I find myself reading papers/text talking about how *this* equation is a constraint but *that* equation is an equation of motion which satisfies *this* constraint.
For example, in the Hamiltonian formulation of Maxwell's theory, Gauss' law $\nabla\cdot\mathbf{E}=0$ is a constraint, whereas $\partia... | 2012/12/03 | [
"https://physics.stackexchange.com/questions/45767",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/10456/"
] | In general, a dynamical equation of motion or evolution equation is a (hyperbolic) second order in time differential equation. They determine the evolution of the system.
$\partial\_{\mu}F^{i\mu}$ is a dynamical equation.
However, a constraint is a condition that must be verified at *every* time and, in particular, t... |
17,228 | I'm working with the following op-amps:
LM308AN
LM358P
UA741CP
I want to make a small box that will control the power to any string of christmas lights based off of music that is playing. I would like it to pulse with the base. I want the input to be the signal from the headphone jack of my computer and I want the ou... | 2011/07/22 | [
"https://electronics.stackexchange.com/questions/17228",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/5100/"
] | Sometimes, simply stating what you're trying to accomplish is better than asking the question you *think* you want to ask. This could very well be the case here. So, indulge me as I try to restate your situation and provide some sort of answer.
You have a headphone jack with some music on it, and you want that music t... |
7,809,215 | I have a project of business objects and a data layer that could potentially be implemented in multiple interfaces (web site, web services, console app, etc).
My question deals with how to properly implement caching in the methods dealing with data retrieval. I'll be using SqlCacheDependency to determine when the cach... | 2011/10/18 | [
"https://Stackoverflow.com/questions/7809215",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30006/"
] | You can use "-sync y" on your qsub to cause the qsub to wait until the job(s) are finished. |
161,751 | I've created a custom user role and am attempting to change the users role from CUSTOMER to ADVOCATE on purchase of a particular product (using WooCommerce). I'm really close but struggling to get the correctly serialized data into my table:
```
$order = new WC_Order( $order_id );
$items = $order->get_items();
$new_... | 2014/09/17 | [
"https://wordpress.stackexchange.com/questions/161751",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/45504/"
] | I think you are not handling the array part correctly.
The right syntax is -
```
$new_role = array("advocate" => 1);
```
The syntax that you have used is shown when you print some array on your screen but it should be written in above format in your PHP code. Currently, you are capturing it as a string and not an a... |
37,826,786 | I need to create ordered lists for a specific type of genealogy report called a register. In a register, all children are numbered with lower-case Roman numerals, and those with descendants also get an Arabic numeral, like this:
```
First Generation
1. Joe Smith
2 i. Joe Smith Jr.
ii. Fred Smith
3 iii... | 2016/06/15 | [
"https://Stackoverflow.com/questions/37826786",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5559646/"
] | The problem in that query is the semicolon, which is the default query delimiter.
In order to change the delimiter in HeidiSQL, add the DELIMITER client command above the `CREATE PROCEDURE` query:
```
DELIMITER \\
SELECT 1\\
CREATE PROCEDURE ...\\
DELIMITER ;
```
HeidiSQL also has a procedure designer, with no need... |
3,151,938 | I want to create a site using a cms, but I want to use my own look and feel. I want to be able to upload downloadable content such as mp3 files with a flash player. I also want users to sign up and login. I want to be able to track and log downloads and uploads done by users. Any suggestions? | 2010/06/30 | [
"https://Stackoverflow.com/questions/3151938",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/220007/"
] | There are dozens of different CMS systems and each works slightly different and is geared for a specific use case. Some of the most popular PHP CMS systems are:
[Drupal](http://drupal.org) - One of my favorites. Very powerful and extensible but a large learning curve and for most projects it can be overkill.
[Joomla]... |
5,476,647 | I'm running into a problem submitting my application through the Application Loader. I'm receiving the message "This bundle is invalid. Apple is not currently accepting applications built with this version of the SDK."
I've installed Xcode 4.0.1 w/SDK 4.3 ("4A1006", March 24), and I've reinstalled both MonoDevelop an... | 2011/03/29 | [
"https://Stackoverflow.com/questions/5476647",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/29152/"
] | Apple changed the keys required in the application manifest in iOS SDK 4.3.1. We've released a new MonoDevelop build to track this. |
74,640,272 | I am at the verge of loosing my mind over trying to fix an Email Regex i built:
It is almost perfect for what i need. It works in 99.9% of all cases.
But there is one case which causes a catastrophic backtracking error and i cannot fix my regex for it.
The "Email" causing a catastrophic backtrack error:
`jasmin.mar... | 2022/12/01 | [
"https://Stackoverflow.com/questions/74640272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3564869/"
] | You can use
```none
^(?!_)\w+(?:[.-]\w+)*(?<!_)@[^\W_]+(?>[.-]?\w*[^\W_])*\.[^\W_]{2,}$
```
See the [regex demo](https://regex101.com/r/kJdWYO/5).
The main idea is introducing an [atomic group](https://www.regular-expressions.info/atomic.html), `(?>[.-]?\w*[^\W_])*` where backtracking is not allowed into the group ... |
13,594,537 | what does the "overused deferral" warning mean in iced coffeescript? It seems to happen when I throw an uncaught error in the code. How can I let the error bubble up as I need it be an uncaught error for unit testing. For instance, if my getByName method throws an error it bubbles up that iced coffeescript warning rath... | 2012/11/27 | [
"https://Stackoverflow.com/questions/13594537",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/611750/"
] | This error is generated when a callback generated by `defer` is called more than once. In your case, it could be that `Profile.getByName` is calling its callback twice (or more). This warning almost always indicates an error in my experience.
You can disable this warning if you create a callback from a Rendezvous and ... |
107,653 | In legal texts, at least in Sweden and Germany, it is common to print some parts of the body text in a smaller font. Is there a name for this typographic convention?
Examples:
[](https://i.stack.imgur.com/sLyzz.jpg)
[![Schmitt 2... | 2018/04/05 | [
"https://graphicdesign.stackexchange.com/questions/107653",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/12723/"
] | I believe it is called an "Inline Citation" or "In-Text Citation"
<https://owl.english.purdue.edu/owl/resource/560/02/>
Here: <http://www.easybib.com/guides/citation-guides/chicago-turabian/notes/> I believe they could be referring to the "same thing" but lacking an actual citation (as in your example) simply as a "n... |
22,348,782 | I'm using Json.Net to DeserializeObject Json data.
This is my Json
```
string datosContratos = {"Total":1,"Contrato":[{"Numero":1818,"CUPS":"ES003L0P","Direccion":"C. O ","TextoCiudad":"MADRID","Tarifa":"2"}]}
```
My classes are:
```
public class Contrato
{
public int Numero;
public String Cups;
publi... | 2014/03/12 | [
"https://Stackoverflow.com/questions/22348782",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/979048/"
] | Just `IF(@CustomerID IS NULL)` is enough
```
IF(@CustomerID IS NULL)
BEGIN
--insert here..
INSERT INTO [tblCustomerMaster]
([CustomerName]
VALUES
(CustomerName)
SET @CustomerID = Scope_Identity() -- sql server syntax to get the ID after insert..
END
ELSE
BEGIN
-- update perhaps..
END... |
22,340,864 | I am a VHDL coder, and haven't coded much with Verilog. I am going through someone else's code, and I came across this:
```
always@(posedge asix_clk_bufg or negedge pll_asix_locked)
begin
if (~pll_asix_locked)
asix_rst <= 0;
else if (timer[5]) // 355us between asix_clk and asix_rst (min is 200us)
... | 2014/03/12 | [
"https://Stackoverflow.com/questions/22340864",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2002041/"
] | This is the way to infer a flip-flop with a positive edge clock (asix\_clk\_bufg) an asynchronous active low reset (pll\_asix\_locked) and a clock enable (timer[5]). There is a D input (tied to 1) and a Q output (asix\_rst).
I assume that the PLL starts off not locked so `asix_rst` is 0 until the first clock edge whe... |
25,291,730 | I have and 3 images that I need to change like so:
Image 1 > Image 2 > Image 3 > Image 1 and so on in that loop.
**JavaScript**
```
function changeImage() {
if (document.getElementById("imgClickAndChange").src = "Webfiles/SUB15_15A.bmp")
{
document.getElementById("imgClickAndChange").src = "Webfiles... | 2014/08/13 | [
"https://Stackoverflow.com/questions/25291730",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3854096/"
] | On *img* click change the *src* attribute of the img tag and using a counter would help more rather checking the previous image source.
HTML :
```
<img src="http://www.clipartbest.com/cliparts/RiA/66K/RiA66KbMT.png" id="imgClickAndChange" onclick="changeImage()" usemap="#SUB15" />
```
JS :
```
var counter = 1;
im... |
63,844,611 | In most recent django documentation "Overriding from the project’s templates directory"
<https://docs.djangoproject.com/en/3.1/howto/overriding-templates/>
it shows that you can use the following path for templates:
```
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'... | 2020/09/11 | [
"https://Stackoverflow.com/questions/63844611",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5934625/"
] | In order to use `BASE_DIR / 'templates'`, you need `BASE_DIR` to be a [`Path()`](https://docs.python.org/3/library/pathlib.html#pathlib.Path).
```
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
```
I suspect that your settings.py was created with an earlier version of Django, and therefo... |
3,486,881 | Group $G$ is abelian and finite. $\langle g\rangle = G$. $p$ is order of $G$ (and $\langle g\rangle$). $p=mn$, $m > 1$, $n > 1$. Why $\langle g^m\rangle < G$ (not $\langle g^m\rangle \le G$)? | 2019/12/25 | [
"https://math.stackexchange.com/questions/3486881",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/736839/"
] | Basic result in theory of cyclic groups: $\langle g\rangle =G\implies |g^m|=\dfrac n{\operatorname {gcd}(n,m)}$, where $n=|G|$. |
45,724 | I just made the switch from Windows to Mac, and one thing that's been bothering me is that on a Mac, I can't see multiple Word documents that I have open. On Windows, they all appear in the taskbar (after checking the option to not collapse instances of the same program) and I can quickly switch between them, which is ... | 2012/03/24 | [
"https://apple.stackexchange.com/questions/45724",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/20621/"
] | * [Hyperdock](http://hyperdock.bahoom.com/) will give you window previews of each open window
belonging to an application by hovering over the dock icon, which you
can then click to activate.

* [Witch](http://manytricks.com/witch/) has a popup panel ... |
26,683,840 | I am trying to create a ListView inside a ListFragment. My list is customize, so it has been created with an adapter. But the aplication crass and give me this error *your content must have a listview whose id attribute is 'android.r.id.list*
This is the ListFragment class:
```
public static class DummySectionFragmen... | 2014/10/31 | [
"https://Stackoverflow.com/questions/26683840",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3507510/"
] | Ignoring the issue of non-linear state machines, I've found the following to work well for my needs on a few projects with simple state machines:
```
# Check if the stage is in or before the supplied stage (stage_to_check).
def in_or_before_stage?(stage_to_check)
if stage_to_check.present? && self.stage.present?
... |
34,051,203 | I had a question about the return statement that is by itself in the control flow.
```
var rockPaperScissors = function(n) {
var rounds = n;
var results = [];
var weapons = ['rock', 'paper', 'scissors'];
var recurse = function(roundsLeft, played) {
if( roundsLeft === 0) {
result... | 2015/12/02 | [
"https://Stackoverflow.com/questions/34051203",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4785557/"
] | You don't need to find the item, you can use `wxMenuBar::IsChecked()`, which will do it for you, directly. And you can either just store the menu bar in `self.menuBar` or retrieve it from the frame using its `GetMenuBar()` method. |
73,752,793 | We are using ObjectMapper. When using ObjectMapper with RowMapper, should it be declared inside each mapRow (seen below), or outside of mapRow as a class public member? I assume it should be outside as a public class member per this article. [Should I declare Jackson's ObjectMapper as a static field?](https://stackover... | 2022/09/17 | [
"https://Stackoverflow.com/questions/73752793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15435022/"
] | An [`ObjectMapper`](https://fasterxml.github.io/jackson-databind/javadoc/2.7/com/fasterxml/jackson/databind/ObjectMapper.html) instance is not immutable but, as stated in the documentation:
>
> Mapper instances are fully thread-safe provided that ALL configuration of the instance occurs before ANY
> read or write cal... |
19,666,102 | >
> A certain string-processing language offers a primitive operation which splits a string into two pieces. Since this operation involves copying the original string, it takes n units of time for a string of length n, regardless of the location of the cut. Suppose, now, that you want to break a string into many piece... | 2013/10/29 | [
"https://Stackoverflow.com/questions/19666102",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2925372/"
] | I think your recurrence relation can become more better. Here's what I came up with, define cost(i,j) to be the cost of cutting the string from index i to j. Then,
```
cost(i,j) = min {length of substring + cost(i,k) + cost(k,j) where i < k < j}
``` |
54,794,538 | I have two dataframes
**df1**
```
+----+-------+
| | Key |
|----+-------|
| 0 | 30 |
| 1 | 31 |
| 2 | 32 |
| 3 | 33 |
| 4 | 34 |
| 5 | 35 |
+----+-------+
```
**df2**
```
+----+-------+--------+
| | Key | Test |
|----+-------+--------|
| 0 | 30 | Test4 |
| 1 | 30 | Test... | 2019/02/20 | [
"https://Stackoverflow.com/questions/54794538",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10540565/"
] | Check with `crosstab`
```
pd.crosstab(df2.Key,df2.Test).reindex(df1.Key).replace({0:''})
``` |
4,712,335 | I want to convert a string which contains the date in `yyyyMMdd` format to `mm-dd-yyyy` DateTime format. How do I get it? | 2011/01/17 | [
"https://Stackoverflow.com/questions/4712335",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/578083/"
] | ```
var dateString = "20050802";
var date = myDate = DateTime.ParseExact(dateString,
"yyyyMMdd",
System.Globalization.CultureInfo.InvariantCulture);
``` |
75,038 | I want it to perform good enough as a multimedia machine. Should I get one that is fan cooled or passively cooled? I think I want one with an HDMI port.
What chipset should I look for? | 2009/11/25 | [
"https://superuser.com/questions/75038",
"https://superuser.com",
"https://superuser.com/users/-1/"
] | I agree with an Ion chipset, there's really no competition in the quiet/ITX space. I've got one of [these](http://www.newegg.com/Product/Product.aspx?Item=N82E16813500035&cm_re=zotac-_-13-500-035-_-Product) powering a secondary HTPC for my bedroom. It has a [Celeron 430](http://www.newegg.com/Product/Product.aspx?Item=... |
2,305 | Over on Twitter, @kelvinfichter [gave an analysis](https://twitter.com/kelvinfichter/status/1425217046636371969) (included below) of the recent Poly Network hack.
***Without any of the benefits of hindsight, are there reasons why the exploit would have been less likely to occur in Plutus on Cardano?***
>
> Poly has ... | 2021/08/11 | [
"https://cardano.stackexchange.com/questions/2305",
"https://cardano.stackexchange.com",
"https://cardano.stackexchange.com/users/1903/"
] | This one is a bit technical it has to do with looking up and updating the constraints of an already existing transaction (that belongs to the script address). See Case ii) to skip my synopsis.
Just a little synopsis for future readers: The [`Core.hs`](https://github.com/input-output-hk/plutus-pioneer-program/blob/main... |
72,528,078 | I have a csv file that looks like:
```
,,,,,,,,
,,,,a,b,c,d,e
,,,"01.01.2022, 00:00 - 01:00",82.7,57.98,0.0,0.0,0.0
,,,"01.01.2022, 01:00 - 02:00",87.6,50.05,15.0,25.570000000000004,383.55000000000007
,,,"01.01.2022, 02:00 - 03:00",87.6,41.33,0.0,0.0,0.0
```
And I want to import headers first and then the data, and ... | 2022/06/07 | [
"https://Stackoverflow.com/questions/72528078",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15184843/"
] | like this?
```
data.table::fread(',,,,,,,,
,,,,a,b,c,d,e
,,,"01.01.2022, 00:00 - 01:00",82.7,57.98,0.0,0.0,0.0
,,,"01.01.2022, 01:00 - 02:00",87.6,50.05,15.0,25.570000000000004,383.55000000000007
,,,"01.01.2022, 02:00 - 03:00",87.6,41.33,0.0,0.0,0... |
3,349,400 | I have a question, which might also fit on stackoverflow, but due to I think I made some mistake in my mathematical considerations I think math.stackexchange is more proper for my question.
Currently I'm writing a (python) program, where a small part of it deals with matrix logarithms. Due to I'm looking for a mistake... | 2019/09/09 | [
"https://math.stackexchange.com/questions/3349400",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/432130/"
] | Well, a quick search revealed the following answer (from [Wikipedia](https://en.wikipedia.org/wiki/Logarithm_of_a_matrix)):
>
> The answer is more involved in the real setting. **A real matrix has a real logarithm if and only if it is invertible and each Jordan block belonging to a negative eigenvalue occurs an even ... |
66,025,267 | On Qt Creator `Tools`>`Options`>`Build & Run`>`Default Build Properties` the `Default build directory`
has the value defined in terms of variables
```
../%{JS: Util.asciify("_build-%{CurrentProject:Name}-%{CurrentKit:FileSystemName}-%{CurrentBuild:Name}")}
```
which result in something like
```
_build-Project1-Desk... | 2021/02/03 | [
"https://Stackoverflow.com/questions/66025267",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5082463/"
] | This worked for me.
```
:host ::ng-deep .multiselect-dropdown .dropdown-btn {
padding: 6px 24px 6px 12px !important;
}
``` |
29,413,180 | I have a multiple select option that display the result in a div container, when click on ctrl+"orange""apple""banana" the result display: "orange, apple, banana" in one line, but i want to display each result in a new single line with a link that goes to different page like this:
Orange - "goes to a link"
Apple -... | 2015/04/02 | [
"https://Stackoverflow.com/questions/29413180",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4742303/"
] | You can try adding `<br/>` element after every selected option. I have used `<label>` element but you can add link or any other element you want
```
$(document).ready( function ()
{
$('#select-custom-19').change(function(){
$('#yourfruit').empty();
var values = $(this).val();
for(v... |
85,177 | im quite new in music theory and i really dont understand what he is doing here.
is he changing the key after every chord?
he talks about c minor being the root note. after that he switches to c# which would be off the key?
what kind of chord progession is this? does it have a name? i have a really hard time figuring o... | 2019/05/24 | [
"https://music.stackexchange.com/questions/85177",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/59146/"
] | He is doing this:
`Cm Db => Fm Gb => Bbm Cb => Ebm Fb => ...`
What I hear is a continuous modulation up in perfect fourths. The chords `Cm Db Fm` can be heard in the key of F minor. The F minor chord is then re-interpreted as the Vm chord of the next key (Bbm) etc. So what you have is
```
key
Fm: Cm Db Fm
Bbm: ... |
72,889,130 | I am currently doing the US Medical Insurance Cost Portfolio Project through Code Academy and am having trouble combining two lists into a single dictionary. I created two new lists (`smoking_status` and `insurance_costs`) in hope of investigating how insurance costs differ between smokers and non-smokers. When I try t... | 2022/07/06 | [
"https://Stackoverflow.com/questions/72889130",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19497618/"
] | >
> Is there a way to update Progressbar from another thread
>
>
>
Short answer: No. A control can only be updated on the thread on which it was originally created.
What you can do is to display the `ProgressBar` in another window that runs on another thread and then close this window when the `RichTextBox` on th... |
26,480,683 | I used code for sum cells of `datagridview1` like below
```
private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e)
{
int sum = 0;
for (i = 0; i < dataGridView1.Rows.Count - 1; i++)
{
if (dataGridView1.Rows[i].Cells[0].Value != null)
{
sum += Con... | 2014/10/21 | [
"https://Stackoverflow.com/questions/26480683",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4085654/"
] | Try this solution:
```
int sum = 0;
for (int i = 0; i < dataGridView1.Rows.Count - 1; i++)
{
//for 1st column
if (dataGridView1.Rows[i].Cells[0].Value != null && !String.IsNullOrEmpty(dataGridView1.Rows[i].Cells[0].Value.ToString()))
sum += Convert.ToInt32(dataGridView1.Rows[i].Cells[0].Value.ToString(... |
49,646,601 | So I've literally copy-pasted the code from <https://codepen.io/hellokatili/pen/rVvMZb> (HTML in a template, CSS in styles.css and JS using this plugin <https://wordpress.org/plugins/header-and-footer-scripts/>)
I added the JS script within tags.
Here is the above code from codepen (after converting from HAML to HTML... | 2018/04/04 | [
"https://Stackoverflow.com/questions/49646601",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1889865/"
] | You can also try the code by writing inside **jquery** ready :
```
(function($){
'use strict';
var prevButton = '<button type="button" data-role="none" class="slick-prev" aria-label="prev"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" version="1.1"><path fill="#FFFFFF" d="M 16,16.46 11.415,11.875... |
32,933,106 | **My onClick() method:**
```
public void onClick(View v) {
String Adm = ((Button)v).getText().toString();
EditText t1 = (EditText) findViewById(R.id.editText);
EditText t2 = (EditText) findViewById(R.id.editText2);
if (Adm.equals("Administrator")){
t1.setVisibility(View.VISI... | 2015/10/04 | [
"https://Stackoverflow.com/questions/32933106",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3360710/"
] | If I understand correctly the directory structure of your project, you have the routes directory next to the models directory, right?
if this is the case, you need to change the require in routes/index.js to use ../, so it will get to the right location:
```
var User = require('../models/User');
``` |
53,111,297 | My function is given a 'to\_find\_value' then I have 2 lists which are the same in length and index values. Once I find the index value in list 1 that 'to\_find\_value' is in, I want to take that index of list 2 and return the value found at list 2.
Ex:
```
function_name('tree', ['bush', 'tree', 'shrub'], ['red', '... | 2018/11/02 | [
"https://Stackoverflow.com/questions/53111297",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10438529/"
] | Something like:
```
def f(a,b,c):
return c[b.index(a)]
```
Then call it like:
```
print(f('tree', ['bush', 'tree', 'shrub'], ['red', 'green', 'yellow']))
```
Output is:
```
green
``` |
19,166,342 | I am using a list view in which I have an xml referencing drawable/list as follows:
```
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
//For the borders
<item>
<shape android:shape="rectangle">
<solid android:color="@color/white" />
<corners android:radius... | 2013/10/03 | [
"https://Stackoverflow.com/questions/19166342",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I dont think you would like to use Regex for this. You may try simply like this:-
```
<a id="myLink" href="http://www.google.com">Google</a>
var anchor = document.getElementById("myLink");
alert(anchor.getAttribute("href")); // Extract link
alert(anchor.innerHTML); // Extract Text
```
[Sample DEMO](ht... |
31,355 | In my world human(oid)s are not born anymore, they are grown in pods which mirror the conditions of a natural womb.
Children are educated before birth and are "born" as fully mature adults with a standard education ready to join society.
How long would this process take? I assume that artificial growth could be much ... | 2015/12/12 | [
"https://worldbuilding.stackexchange.com/questions/31355",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/18/"
] | A year? No. Babies already require 9 months in the womb to get to where they get. You're limited because many processes in growth require chemical processes that simply take time. Humans simply aren't cars to be manufactured.
A decade? Now its getting interesting. It is reasonable to assume that a human could grow fas... |
23,775,272 | I'm new to Modals, I have a Form and when the user clicks submit, It will show a Modal confirming if the user wants to submit, the modal also contains the user input from the form fields. I searched all over the internet but can't find the right one on my needs. And all I see is that they tag the click event to open mo... | 2014/05/21 | [
"https://Stackoverflow.com/questions/23775272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3651491/"
] | So if I get it right, on click of a button, you want to open up a modal that lists the values entered by the users followed by submitting it.
For this, you first change your `input type="submit"` to `input type="button"` and add `data-toggle="modal" data-target="#confirm-submit"` so that the modal gets triggered when ... |
22,168,437 | We have a Java project that we wish to distribute to users. It does not use any Java features beyond Java 1.5, so we wish it to run on Java 1.5 and above.
At this point, you might rightfully note that Java 1.6 is the oldest available currently, so why target Java 1.5? However, that does not change the generic nature o... | 2014/03/04 | [
"https://Stackoverflow.com/questions/22168437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1307749/"
] | The rt.jar is included with the JRE. You will be able to perform the cross compilation if you have, say, JDK 1.6 and JRE 1.5.
Using your JDK 1.6:
```
$ javac -source 1.5 -target 1.5 -bootclasspath jre1.5.0/lib/rt.jar Test.java
```
The advantage here is that the JRE can be as little as 1/3 the size of a full JDK. Yo... |
38,470,462 | I have the following:
```
public class Car{
public Car()
{//some stuff
}
private Car [] carmodels ;
public Car [] getCarModel() {
return this.carmodels;
}
public void setcarModel(Car [] carmodels ) {
this.carmodels = carmodels;
}
```
Now on my test class, I have something like this
```
public void main (String ... | 2016/07/20 | [
"https://Stackoverflow.com/questions/38470462",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3841581/"
] | If you insist on not using a temp value in the for loop you could use an [ArrayList](https://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html) instead of an array for the carmodels.
than add a method
```
public void addCar(Car toadd)
{
carmodels.add(toadd);
}
```
than in your foor loop just call
```... |
10,424,848 | I have installed all the necessary files from android site, but when I run my emulator it just displays "ANDROID" and nothing else. I am using Intel Dual core (2.20GHz), ASUS motherboard and 3gb of RAM. Whats the prob I couldnt understand.. Even one of my friend using Intel Dual core(1.80GHz) with 1gb of RAM running sm... | 2012/05/03 | [
"https://Stackoverflow.com/questions/10424848",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1349138/"
] | The emulator is slow becasue it is, of all things, emulating a completely different architecture (arm), and if it's the first time you've started it it has to create the memory file toi emulate the SD card you told it was there.
My bet would be that you simply didn't wait long enough for it to boot up.
You can save ... |
8,324,359 | I am a beginner in Java programming. Using JavaMail API, I wrote a program to send emails. Now I need to create a front end and connect those. I use only Notepad to write programs, I don't use any IDE. How to create front end easily and connect to my program?
My program is:
```java
import javax.mail.*;
import javax.m... | 2011/11/30 | [
"https://Stackoverflow.com/questions/8324359",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1073084/"
] | 1. Factor out a method which takes parameters and do the email sending.
No system.out and system.in allowed in this method.
2. For a test, you can drive this method with your existing code parts
which reads parameters from console.
3. Make a GUI form which contains all input fields and probably some
button. Your code w... |
1,644,694 | $$a^2+ab+b^2\ge 3(a+b-1)$$
$a,b$ are real numbers
using $AM\ge GM$
I proved that
$$a^2+b^2+ab\ge 3ab$$
$$(a^2+b^2+ab)/3\ge 3ab$$
how do I prove that $$3ab\ge 3(a+b-1)$$
if I'm able to prove the above inequality then i'll be done | 2016/02/07 | [
"https://math.stackexchange.com/questions/1644694",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/300970/"
] | **Hint**: Let $a=x+1$ and $b=y+1$ (in the original inequality). |
55,577,262 | Using `@WebMvcTest` will auto-configure all web layer beans by looking for a `@SpringBootConfiguration` class (such as `@SpringBootApplication`).
If the configuration class is in a different package and can't be found by scanning, can I provide it directly to `@WebMvcTest`? | 2019/04/08 | [
"https://Stackoverflow.com/questions/55577262",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9773274/"
] | The following will point to the correct `@SpringBootApplication` class:
```
@RunWith(SpringJUnit4ClassRunner.class)
@WebMvcTest(controllers = {MyController.class})
@ContextConfiguration(classes={MySpringBootApplicationClass.class})
public class MyControllerTest {
//...
}
``` |
10,537,897 | How can I override spring messages like 'Bad Credentials'?
I've configured my servlet context file with following beans
```
<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basename" value="WEB-INF/messages" />
<property name="de... | 2012/05/10 | [
"https://Stackoverflow.com/questions/10537897",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/547750/"
] | It turns out that these beans should be defined in general application context and not in myservlet-servlet.xml file. Once I moved the definitions from servlet context it started to work as expected. |
54,908,164 | jQuery newbie. My goal is to loop through each article and append the img to the div with the class body. The problem is its taking every image and appending to the div with the class body. Thanks!
My Script
```
jQuery('article .date').each(function() {
jQuery(this).closest('article').find('img').after(this);
});... | 2019/02/27 | [
"https://Stackoverflow.com/questions/54908164",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10529685/"
] | You could slice a given array and take only five elements for getting an average.
```js
function standardDeviation(array) {
const arrAvg = tempArray => tempArray.reduce((a, b) => a + b, 0) / tempArray.length;
return array.map((_, i, a) => arrAvg(a.slice(i, i + 5)));
}
var arr = [1, 2, 3, 4, 5, 6, 7, 8, 9]... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.