qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
13,383,643 | I'm pulling a file path from a database to use as a file source.
I need to remove the last folder from the source path, so I can then create new folders to use as the destination path.
Example source file path:
`\\\\ServerName\\Documents\\MasterDocumentFolder\\`
I need to remove the last folder from that string and g... | 2012/11/14 | [
"https://Stackoverflow.com/questions/13383643",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1729597/"
] | What you are looking for is the GetParent() method in the Directory class
```
string path = @"C:\Documents\MasterDocumentFolder\";
DirectoryInfo parentDir = Directory.GetParent(path);
// or possibly
DirectoryInfo parentDir = Directory.GetParent(path.EndsWith("\\") ? path : string.Concat(path, "\\"));
// The result is... | With this method you can create dir by dirPath (if dir is not exist) and to create directory from the filePath if needed
```
private void CreateDirIfNotExist(string dirPath, bool removeFilename = false)
{
if (removeFilename)
dirPath = Directory.GetParent(dirPath).FullName;
if (!Directory.Exists(dirPat... |
13,383,643 | I'm pulling a file path from a database to use as a file source.
I need to remove the last folder from the source path, so I can then create new folders to use as the destination path.
Example source file path:
`\\\\ServerName\\Documents\\MasterDocumentFolder\\`
I need to remove the last folder from that string and g... | 2012/11/14 | [
"https://Stackoverflow.com/questions/13383643",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1729597/"
] | With this method you can create dir by dirPath (if dir is not exist) and to create directory from the filePath if needed
```
private void CreateDirIfNotExist(string dirPath, bool removeFilename = false)
{
if (removeFilename)
dirPath = Directory.GetParent(dirPath).FullName;
if (!Directory.Exists(dirPat... | In VB:
```
Dim MyNewPath As String = StrReverse(Strings.Split(StrReverse(MyPath), "\", 2)(1))
```
This works down to the root, eg `C:\MyPath` but fails (without validation) for a bare folder.
Obviously, you need to handle differently if there is a file appended. |
13,383,643 | I'm pulling a file path from a database to use as a file source.
I need to remove the last folder from the source path, so I can then create new folders to use as the destination path.
Example source file path:
`\\\\ServerName\\Documents\\MasterDocumentFolder\\`
I need to remove the last folder from that string and g... | 2012/11/14 | [
"https://Stackoverflow.com/questions/13383643",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1729597/"
] | What you are looking for is the GetParent() method in the Directory class
```
string path = @"C:\Documents\MasterDocumentFolder\";
DirectoryInfo parentDir = Directory.GetParent(path);
// or possibly
DirectoryInfo parentDir = Directory.GetParent(path.EndsWith("\\") ? path : string.Concat(path, "\\"));
// The result is... | In VB:
```
Dim MyNewPath As String = StrReverse(Strings.Split(StrReverse(MyPath), "\", 2)(1))
```
This works down to the root, eg `C:\MyPath` but fails (without validation) for a bare folder.
Obviously, you need to handle differently if there is a file appended. |
13,383,643 | I'm pulling a file path from a database to use as a file source.
I need to remove the last folder from the source path, so I can then create new folders to use as the destination path.
Example source file path:
`\\\\ServerName\\Documents\\MasterDocumentFolder\\`
I need to remove the last folder from that string and g... | 2012/11/14 | [
"https://Stackoverflow.com/questions/13383643",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1729597/"
] | [System.IO.DirectoryInfo](http://msdn.microsoft.com/en-us/library/system.io.directoryinfo%28v=vs.110%29.aspx) is probably the cleanest way to accomplish what you're asking for.
```
var path = "\\\\ServerName\\Documents\\MasterDocumentFolder\\";
string newPath = new DirectoryInfo(path).Parent.CreateSubdirectory("NewDoc... | This should account for the path being either a file or directory
```
DirectoryInfo parent = null;
if (File.Exists(path))
{
parent = new FileInfo(path).Directory.Directory
}
if(Directory.Exists(path))
{
parent = new DirectoryInfo(path).Directory;
}
``` |
45,295,443 | I was having some problem with asynchronous call and for loop. What I am facing now is the for loop never waits for all the promise to complete before execute another round. My code skeleton as such:
```
// removed code
```
Is there any way to do this such that the for loop will wait for all my promises done execu... | 2017/07/25 | [
"https://Stackoverflow.com/questions/45295443",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You can also do it in a function that calls it self:
```
function ramdomMerch (index, maxIndex) {
count = index;
count++;
if (count > maxIndex) {
exit(); //This will end the loop as soon as it hits the maxIndex
}
// random select merchant
let randomMerchantName = new Promise((resolve, reject) => {
... | I write a prototype here, hope that help:
```
var donePromise = 0;
let n = 10;
for(let count = 0; count < n; count++){
DoAPromisse(function() {
donePromise++;
if (donePromise == n) {
//all promisesses done
}
});
}
``` |
45,295,443 | I was having some problem with asynchronous call and for loop. What I am facing now is the for loop never waits for all the promise to complete before execute another round. My code skeleton as such:
```
// removed code
```
Is there any way to do this such that the for loop will wait for all my promises done execu... | 2017/07/25 | [
"https://Stackoverflow.com/questions/45295443",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | What you want is to chain promises. You could do it like so:
```
//Just so we have a promise to start with for the chain.
let promiseMerchantKey = Promose.resolve();
for(let count = 0; count < 10; count++){
// random select category from list
// random select merchant
let randomMerchantName = promiseMerchantKey.then... | I write a prototype here, hope that help:
```
var donePromise = 0;
let n = 10;
for(let count = 0; count < n; count++){
DoAPromisse(function() {
donePromise++;
if (donePromise == n) {
//all promisesses done
}
});
}
``` |
45,295,443 | I was having some problem with asynchronous call and for loop. What I am facing now is the for loop never waits for all the promise to complete before execute another round. My code skeleton as such:
```
// removed code
```
Is there any way to do this such that the for loop will wait for all my promises done execu... | 2017/07/25 | [
"https://Stackoverflow.com/questions/45295443",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You can also do it in a function that calls it self:
```
function ramdomMerch (index, maxIndex) {
count = index;
count++;
if (count > maxIndex) {
exit(); //This will end the loop as soon as it hits the maxIndex
}
// random select merchant
let randomMerchantName = new Promise((resolve, reject) => {
... | What you want is to chain promises. You could do it like so:
```
//Just so we have a promise to start with for the chain.
let promiseMerchantKey = Promose.resolve();
for(let count = 0; count < 10; count++){
// random select category from list
// random select merchant
let randomMerchantName = promiseMerchantKey.then... |
10,407,089 | The following code defines my Bitmap:
```
Resources res = context.getResources();
mBackground = BitmapFactory.decodeResource(res, R.drawable.background);
// scale bitmap
int h = 800; // height in pixels
int w = 480; // width in pixels
// Make sure w and h are in the correct order
Bitmap scaled = Bitmap.createScaledB... | 2012/05/02 | [
"https://Stackoverflow.com/questions/10407089",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1364859/"
] | Define a new class member variable:
`Bitmap mScaledBackground;`
Then, assign your newly created scaled bitmap to it:
`mScaledBackground = scaled;`
Then, call in your draw method:
`canvas.drawBitmap(mScaledBackground, 0, 0, null);`
Note that it is not a good idea to hard-code screen size in the way you did in your snip... | To draw the scaled bitmap you want save your scaled bitmap in a field somewhere (here called `mScaled`) and call:
```
canvas.drawBitmap(mScaled, 0, 0, null);
```
in your draw method (or wherever you call it right now). |
41,645 | If you are heavier you will be stronger wether this is by fat or by muscle I think we can all agree on that. (I'm not talking about overly fat because at that point it would probably not hold true due to health reasons)
So if you have excessive fat, will you gain more muscle because you can lift heavier then the versi... | 2020/02/24 | [
"https://fitness.stackexchange.com/questions/41645",
"https://fitness.stackexchange.com",
"https://fitness.stackexchange.com/users/13435/"
] | It's a somewhat complex question. Let's start with your first sentence:
>
> If you are heavier you will be stronger whether this is by fat or by muscle I think we can all agree on that.
>
>
>
No, I don't agree. What is true is that in martial arts and boxing lighter fighters have a disadvantage, probably even ag... | >
> If you are heavier you will be stronger wether this is by fat or by muscle I think we can all agree on that. (I'm not talking about overly fat because at that point it would probably not hold true due to health reasons)
>
>
>
There is no science which supports this claim.
>
> So if you have excessive fat, wi... |
41,645 | If you are heavier you will be stronger wether this is by fat or by muscle I think we can all agree on that. (I'm not talking about overly fat because at that point it would probably not hold true due to health reasons)
So if you have excessive fat, will you gain more muscle because you can lift heavier then the versi... | 2020/02/24 | [
"https://fitness.stackexchange.com/questions/41645",
"https://fitness.stackexchange.com",
"https://fitness.stackexchange.com/users/13435/"
] | >
> If you are heavier you will be stronger wether this is by fat or by muscle I think we can all agree on that.
>
>
>
On what do you base this? Apart from very few lifts where a bit more body weight helps you, I can't see a scenario that shows having extra fat helps you lift weights.
>
> Say there is a version ... | >
> If you are heavier you will be stronger wether this is by fat or by muscle I think we can all agree on that. (I'm not talking about overly fat because at that point it would probably not hold true due to health reasons)
>
>
>
There is no science which supports this claim.
>
> So if you have excessive fat, wi... |
41,645 | If you are heavier you will be stronger wether this is by fat or by muscle I think we can all agree on that. (I'm not talking about overly fat because at that point it would probably not hold true due to health reasons)
So if you have excessive fat, will you gain more muscle because you can lift heavier then the versi... | 2020/02/24 | [
"https://fitness.stackexchange.com/questions/41645",
"https://fitness.stackexchange.com",
"https://fitness.stackexchange.com/users/13435/"
] | Most sports require lean performance as fat adds nothing but sport baggage. Good 40 yard times and slam dunks require it. IF you push your fat percentage below 5% other organs including the immune system will be compromised. Many Olympic performances have not gone as expected for this reason. Sumo wrestlers, cannon bal... | Muscles make you stronger, not fat, fat will make you slow and lazy because Muscle is more metabolically active than fat. Since muscle is denser, if you compare two equal sizes of fat and muscle, the muscle would weigh more. The density of fat is .9g/ml whereas the density of muscle is 1.1g/ml. these numbers can vary d... |
41,645 | If you are heavier you will be stronger wether this is by fat or by muscle I think we can all agree on that. (I'm not talking about overly fat because at that point it would probably not hold true due to health reasons)
So if you have excessive fat, will you gain more muscle because you can lift heavier then the versi... | 2020/02/24 | [
"https://fitness.stackexchange.com/questions/41645",
"https://fitness.stackexchange.com",
"https://fitness.stackexchange.com/users/13435/"
] | >
> If you are heavier you will be stronger wether this is by fat or by muscle I think we can all agree on that.
>
>
>
On what do you base this? Apart from very few lifts where a bit more body weight helps you, I can't see a scenario that shows having extra fat helps you lift weights.
>
> Say there is a version ... | Muscles make you stronger, not fat, fat will make you slow and lazy because Muscle is more metabolically active than fat. Since muscle is denser, if you compare two equal sizes of fat and muscle, the muscle would weigh more. The density of fat is .9g/ml whereas the density of muscle is 1.1g/ml. these numbers can vary d... |
41,645 | If you are heavier you will be stronger wether this is by fat or by muscle I think we can all agree on that. (I'm not talking about overly fat because at that point it would probably not hold true due to health reasons)
So if you have excessive fat, will you gain more muscle because you can lift heavier then the versi... | 2020/02/24 | [
"https://fitness.stackexchange.com/questions/41645",
"https://fitness.stackexchange.com",
"https://fitness.stackexchange.com/users/13435/"
] | >
> If you are heavier you will be stronger wether this is by fat or by muscle I think we can all agree on that. (I'm not talking about overly fat because at that point it would probably not hold true due to health reasons)
>
>
>
There is no science which supports this claim.
>
> So if you have excessive fat, wi... | Muscles make you stronger, not fat, fat will make you slow and lazy because Muscle is more metabolically active than fat. Since muscle is denser, if you compare two equal sizes of fat and muscle, the muscle would weigh more. The density of fat is .9g/ml whereas the density of muscle is 1.1g/ml. these numbers can vary d... |
41,645 | If you are heavier you will be stronger wether this is by fat or by muscle I think we can all agree on that. (I'm not talking about overly fat because at that point it would probably not hold true due to health reasons)
So if you have excessive fat, will you gain more muscle because you can lift heavier then the versi... | 2020/02/24 | [
"https://fitness.stackexchange.com/questions/41645",
"https://fitness.stackexchange.com",
"https://fitness.stackexchange.com/users/13435/"
] | >
> If you are heavier you will be stronger wether this is by fat or by muscle I think we can all agree on that.
>
>
>
On what do you base this? Apart from very few lifts where a bit more body weight helps you, I can't see a scenario that shows having extra fat helps you lift weights.
>
> Say there is a version ... | Most sports require lean performance as fat adds nothing but sport baggage. Good 40 yard times and slam dunks require it. IF you push your fat percentage below 5% other organs including the immune system will be compromised. Many Olympic performances have not gone as expected for this reason. Sumo wrestlers, cannon bal... |
41,645 | If you are heavier you will be stronger wether this is by fat or by muscle I think we can all agree on that. (I'm not talking about overly fat because at that point it would probably not hold true due to health reasons)
So if you have excessive fat, will you gain more muscle because you can lift heavier then the versi... | 2020/02/24 | [
"https://fitness.stackexchange.com/questions/41645",
"https://fitness.stackexchange.com",
"https://fitness.stackexchange.com/users/13435/"
] | >
> If you are heavier you will be stronger wether this is by fat or by muscle I think we can all agree on that.
>
>
>
On what do you base this? Apart from very few lifts where a bit more body weight helps you, I can't see a scenario that shows having extra fat helps you lift weights.
>
> Say there is a version ... | It's a somewhat complex question. Let's start with your first sentence:
>
> If you are heavier you will be stronger whether this is by fat or by muscle I think we can all agree on that.
>
>
>
No, I don't agree. What is true is that in martial arts and boxing lighter fighters have a disadvantage, probably even ag... |
41,645 | If you are heavier you will be stronger wether this is by fat or by muscle I think we can all agree on that. (I'm not talking about overly fat because at that point it would probably not hold true due to health reasons)
So if you have excessive fat, will you gain more muscle because you can lift heavier then the versi... | 2020/02/24 | [
"https://fitness.stackexchange.com/questions/41645",
"https://fitness.stackexchange.com",
"https://fitness.stackexchange.com/users/13435/"
] | It's a somewhat complex question. Let's start with your first sentence:
>
> If you are heavier you will be stronger whether this is by fat or by muscle I think we can all agree on that.
>
>
>
No, I don't agree. What is true is that in martial arts and boxing lighter fighters have a disadvantage, probably even ag... | Most sports require lean performance as fat adds nothing but sport baggage. Good 40 yard times and slam dunks require it. IF you push your fat percentage below 5% other organs including the immune system will be compromised. Many Olympic performances have not gone as expected for this reason. Sumo wrestlers, cannon bal... |
41,645 | If you are heavier you will be stronger wether this is by fat or by muscle I think we can all agree on that. (I'm not talking about overly fat because at that point it would probably not hold true due to health reasons)
So if you have excessive fat, will you gain more muscle because you can lift heavier then the versi... | 2020/02/24 | [
"https://fitness.stackexchange.com/questions/41645",
"https://fitness.stackexchange.com",
"https://fitness.stackexchange.com/users/13435/"
] | It's a somewhat complex question. Let's start with your first sentence:
>
> If you are heavier you will be stronger whether this is by fat or by muscle I think we can all agree on that.
>
>
>
No, I don't agree. What is true is that in martial arts and boxing lighter fighters have a disadvantage, probably even ag... | Muscles make you stronger, not fat, fat will make you slow and lazy because Muscle is more metabolically active than fat. Since muscle is denser, if you compare two equal sizes of fat and muscle, the muscle would weigh more. The density of fat is .9g/ml whereas the density of muscle is 1.1g/ml. these numbers can vary d... |
41,645 | If you are heavier you will be stronger wether this is by fat or by muscle I think we can all agree on that. (I'm not talking about overly fat because at that point it would probably not hold true due to health reasons)
So if you have excessive fat, will you gain more muscle because you can lift heavier then the versi... | 2020/02/24 | [
"https://fitness.stackexchange.com/questions/41645",
"https://fitness.stackexchange.com",
"https://fitness.stackexchange.com/users/13435/"
] | It's a somewhat complex question. Let's start with your first sentence:
>
> If you are heavier you will be stronger whether this is by fat or by muscle I think we can all agree on that.
>
>
>
No, I don't agree. What is true is that in martial arts and boxing lighter fighters have a disadvantage, probably even ag... | Yes and no, there are some misconceptions, and there is no clear undisputable answer to any such question (as there are three dozen factors playing in, and diagonally opposing goals).
No single thing is always good (or always bad) and no single thing works well for everybody and in every situation. Or, for every goa... |
17,870,193 | I want to serialize an into into a Byte array or array buffer.
I realise that I can use 'java.nio.ByteBuffer' but I am experimenting for fun and trying to do it myself.
The following code works for positive Int but goes wrong when I serialize a negative Int.
Can anyone explain why or show me a correction?
```
import... | 2013/07/25 | [
"https://Stackoverflow.com/questions/17870193",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2056182/"
] | Taking Luigi's advice I hacked up a pimp for Byte that provides a toBinaryString that works properly, in case anyone else is struggling with similar problems here is what I did.
```
object b {
val INTBYTES:Int = 4 // int is 4 bytes
val SIZEBYTE:Short = 8
def toArrayBuf(x:Int): ArrayBuffer[Byte] = {
val buf ... | Scala's `toBinaryString` method defers to the Java one on `Integer`. From those documents:
>
> public static String toBinaryString(int i)
>
>
> Returns a string representation of the integer argument as an unsigned
> integer in base 2. The unsigned integer value is the argument plus
> 2^32 if the argument is nega... |
72,757,066 | My prof instructed as to write an apology string using functions but I don't know how does it works and how I will define the sendApology function so here's my code:
```
#include<stdio.h>
void sendApology(char, int);
int main(void) {
sendApology('s', 2);
sendApology('f', 10);
sendApology('b', 3);
... | 2022/06/25 | [
"https://Stackoverflow.com/questions/72757066",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18639516/"
] | In simple terms, the instruction is saying:
1. Check if the variable `letter` is 's', 'o', 'r', or 'y'.
2. If it is one of these characters, print `letter` `n` times where n is the argument `n`
3. If it is not, do nothing
Some scenarios:
```
sendApology('s', 2); // "ss"
sendApology('f', 10); // nothing
s... | The functions you need is just putc()
Put it in a loop on the count, and test if your character matches before using a loop on the range of accepted character. |
55,446,883 | I have been working on this for too long. It should be simple and I've ran through many different combinations, however, I keep getting the code wrong and have no idea why. It works fine when I have manual input, but when I submit there is an error.
question prompt:
Write a program that keeps a dictionary of names and... | 2019/04/01 | [
"https://Stackoverflow.com/questions/55446883",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11286342/"
] | This is a common situation with *interfaces*. If you have a contract that needs to specify a `task` for the *Async Await Pattern* and we have to implement that `Task` in the *interface*.
Assuming the caller is going to use `await` you can just drop the `async` and return a `Task`.
However, you need to be-careful with... | Usually in these cases, You have something in front of the call that is handling the request and passing it off to the "worker" classes (e.g. TestApp). If this is the case, I don't see why having an "IAsyncable" interface where you could test if the class was async capable would not work.
```
if(thisObject is IAscyncA... |
55,446,883 | I have been working on this for too long. It should be simple and I've ran through many different combinations, however, I keep getting the code wrong and have no idea why. It works fine when I have manual input, but when I submit there is an error.
question prompt:
Write a program that keeps a dictionary of names and... | 2019/04/01 | [
"https://Stackoverflow.com/questions/55446883",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11286342/"
] | Usually in these cases, You have something in front of the call that is handling the request and passing it off to the "worker" classes (e.g. TestApp). If this is the case, I don't see why having an "IAsyncable" interface where you could test if the class was async capable would not work.
```
if(thisObject is IAscyncA... | I ended up using the following code:
```
using System.IO;
using System.Threading.Tasks;
namespace TestApp
{
interface IBlackBox // interface for both sync and async execution
{
Task<string> PullText();
}
sealed class MyAsyncBlackBox : IBlackBox
{
public async Task<string> PullText... |
55,446,883 | I have been working on this for too long. It should be simple and I've ran through many different combinations, however, I keep getting the code wrong and have no idea why. It works fine when I have manual input, but when I submit there is an error.
question prompt:
Write a program that keeps a dictionary of names and... | 2019/04/01 | [
"https://Stackoverflow.com/questions/55446883",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11286342/"
] | This is a common situation with *interfaces*. If you have a contract that needs to specify a `task` for the *Async Await Pattern* and we have to implement that `Task` in the *interface*.
Assuming the caller is going to use `await` you can just drop the `async` and return a `Task`.
However, you need to be-careful with... | I ended up using the following code:
```
using System.IO;
using System.Threading.Tasks;
namespace TestApp
{
interface IBlackBox // interface for both sync and async execution
{
Task<string> PullText();
}
sealed class MyAsyncBlackBox : IBlackBox
{
public async Task<string> PullText... |
56,529,487 | I'm struggling to understand the cause of the issue that I'm facing.
I have a module with Contracts and module with Validators. Some of the Validators are being used in Contracts' module. For example:
```
override fun verify(tx: LedgerTransaction){
validator.validate(tx.outputs)
}
```
I start my flow and during... | 2019/06/10 | [
"https://Stackoverflow.com/questions/56529487",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2099110/"
] | No, and any actions relying on the remote branch (such as `push` and `pull`) will error out with a message about a missing upstream branch.
`status` will report a message as follows:
>
> Your branch is based on 'origin/branch', but the upstream is gone.
>
>
>
---
The answer above is accurate to the best of my k... | No, it will not delete your local branch if you delete the remote branch. You won't be able to push your local changes on this branch to the remote repository though, until and unless you create this branch again on remote server or you push using `git push --set-upstream origin <branch-name>` |
56,529,487 | I'm struggling to understand the cause of the issue that I'm facing.
I have a module with Contracts and module with Validators. Some of the Validators are being used in Contracts' module. For example:
```
override fun verify(tx: LedgerTransaction){
validator.validate(tx.outputs)
}
```
I start my flow and during... | 2019/06/10 | [
"https://Stackoverflow.com/questions/56529487",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2099110/"
] | No, and any actions relying on the remote branch (such as `push` and `pull`) will error out with a message about a missing upstream branch.
`status` will report a message as follows:
>
> Your branch is based on 'origin/branch', but the upstream is gone.
>
>
>
---
The answer above is accurate to the best of my k... | In case you want to delete remote and still continue working on local branch.
You can try with below commands -
1. Delete the remote branch -
>
> `git branch -rd origin/<branch-name>`
>
>
>
2. Update remote repo with deleted branch to remove from server -
>
>
> ```
> `git push origin :<branch-name>`
>
> ```
... |
57,387,459 | Is there a library for icons in Android such as font awesome is in web development and how is it used? | 2019/08/07 | [
"https://Stackoverflow.com/questions/57387459",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11257434/"
] | 1. From material.io you can use it's icon library:
<https://material.io/resources/icons/?style=baseline>
2. Right click on `res\drawable` resource folder and select `New\Vector Asset` to add vector icons. | You can use below library for Icons It will mostly use font-awesome icons.
[Here is font icon library for native android click here for more detail](https://github.com/mikepenz/Android-Iconics)
Import library from above link and used like below.
```
<ImageView
android:layout_width="48dp"
android:layout_heigh... |
499,209 | This should be fairly simple, but I am not sure what i'm missing.
I'd like to **recursively** delete empty directories, and get an output for what's being deleted, this command works for sure, but I just can't print the actions of -excec verbosely.
`while [ -n "$(find . -depth -type d -empty -exec rm -v -rf {} +)" ]... | 2013/04/14 | [
"https://serverfault.com/questions/499209",
"https://serverfault.com",
"https://serverfault.com/users/128156/"
] | You don't need the while loop and you should use rmdir -p to remove the empty parents
```
find . -depth -type d -empty -exec rmdir -v -p {} +
rmdir: removing directory, `./1/3'
rmdir: removing directory, `./1'
rmdir: removing directory, `.'
rmdir: failed to remove directory `.': Invalid argument
rmdir: removing direc... | With `find`, on both Linux and MacOS, you have the `-delete` option. It already implies `-depth`. And for verbose output, you can add `-print`. So it's just :
```
find . -type d -empty -delete -print
``` |
11,435,105 | I want to have same shader source for OpenGL ES and OpenGL (Windows). To do this I want to define custom data types and use only OpenGL ES functions.
One approach is to define:
```
#define highp
#define mediump
#define lowp
```
for Windows shader and write the shader as it is for OpenGL ES.
Other approach is to d... | 2012/07/11 | [
"https://Stackoverflow.com/questions/11435105",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/336578/"
] | My solution has been to write shader code that is compatible with both APIs, and then when uploading the fragment shader source code to OpenGL ES just prepend the following line:
```
precision mediump float;
```
That sets the default floating point precision to medium. In OpenGL ES fragment shaders there is no defau... | You could use <http://www.opengl.org/registry/specs/ARB/ES2_compatibility.txt>
>
> This extension adds support for features of OpenGL ES 2.0 that are missing from OpenGL 3.x. Enabling these features will ease the process of porting applications from OpenGL ES 2.0 to OpenGL.
>
>
> |
11,435,105 | I want to have same shader source for OpenGL ES and OpenGL (Windows). To do this I want to define custom data types and use only OpenGL ES functions.
One approach is to define:
```
#define highp
#define mediump
#define lowp
```
for Windows shader and write the shader as it is for OpenGL ES.
Other approach is to d... | 2012/07/11 | [
"https://Stackoverflow.com/questions/11435105",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/336578/"
] | You could use <http://www.opengl.org/registry/specs/ARB/ES2_compatibility.txt>
>
> This extension adds support for features of OpenGL ES 2.0 that are missing from OpenGL 3.x. Enabling these features will ease the process of porting applications from OpenGL ES 2.0 to OpenGL.
>
>
> | I managed it by just defining the following at the begin of each shader when the shader runs on windows:
```
#define lowp
#define mediump
#define highp
```
Additional i give the shader the information which plattform is used ( WINDOWS, MOBILE, IOS ) which can be used this way:
```
#ifdef WINDOWS
precision mediump f... |
11,435,105 | I want to have same shader source for OpenGL ES and OpenGL (Windows). To do this I want to define custom data types and use only OpenGL ES functions.
One approach is to define:
```
#define highp
#define mediump
#define lowp
```
for Windows shader and write the shader as it is for OpenGL ES.
Other approach is to d... | 2012/07/11 | [
"https://Stackoverflow.com/questions/11435105",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/336578/"
] | My solution has been to write shader code that is compatible with both APIs, and then when uploading the fragment shader source code to OpenGL ES just prepend the following line:
```
precision mediump float;
```
That sets the default floating point precision to medium. In OpenGL ES fragment shaders there is no defau... | I managed it by just defining the following at the begin of each shader when the shader runs on windows:
```
#define lowp
#define mediump
#define highp
```
Additional i give the shader the information which plattform is used ( WINDOWS, MOBILE, IOS ) which can be used this way:
```
#ifdef WINDOWS
precision mediump f... |
41,942,675 | I have a huge (and growing) MyISAM table (700millions rows = 140Gb).
```
CREATE TABLE `keypairs` (
`ID` char(60) NOT NULL,
`pair` char(60) NOT NULL,
PRIMARY KEY (`ID`)
) ENGINE=MyISAM
```
The table option was changed to `ROW_FORMAT=FIXED`, cause both columns are always fixed length to max (60). And yes yes, `I... | 2017/01/30 | [
"https://Stackoverflow.com/questions/41942675",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3916429/"
] | Optimizing a table requires that you optimize for specific queries. You can't determine the best optimization strategy unless you have specific queries in mind. Any optimization improves one type of query at the expense of other types of queries.
For example, if your query is `SELECT SUM(pair) FROM keypairs` (a query ... | First, your primary key is not incrementable.
Which means, roughly: at every insert the index have to be rebalanced.
No wonder it goes slowpoke at the table of such a size.
And such an engine...
So, to the second: what's the point of keeping that MyISAM old junk?
Like, for example, you don't mind to loose row or t... |
41,942,675 | I have a huge (and growing) MyISAM table (700millions rows = 140Gb).
```
CREATE TABLE `keypairs` (
`ID` char(60) NOT NULL,
`pair` char(60) NOT NULL,
PRIMARY KEY (`ID`)
) ENGINE=MyISAM
```
The table option was changed to `ROW_FORMAT=FIXED`, cause both columns are always fixed length to max (60). And yes yes, `I... | 2017/01/30 | [
"https://Stackoverflow.com/questions/41942675",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3916429/"
] | * Sort the incoming data before doing the `LOAD`. This will improve the cacheability of the `PRIMARY KEY(id)`.
* `PARTITIONing` is unlikely to help, unless there is some useful pattern to `ID`.
* `PARTITIONing` will *not* help for single-row insert nor for single-row fetch by `ID`.
* If the strings are not a constant w... | First, your primary key is not incrementable.
Which means, roughly: at every insert the index have to be rebalanced.
No wonder it goes slowpoke at the table of such a size.
And such an engine...
So, to the second: what's the point of keeping that MyISAM old junk?
Like, for example, you don't mind to loose row or t... |
41,942,675 | I have a huge (and growing) MyISAM table (700millions rows = 140Gb).
```
CREATE TABLE `keypairs` (
`ID` char(60) NOT NULL,
`pair` char(60) NOT NULL,
PRIMARY KEY (`ID`)
) ENGINE=MyISAM
```
The table option was changed to `ROW_FORMAT=FIXED`, cause both columns are always fixed length to max (60). And yes yes, `I... | 2017/01/30 | [
"https://Stackoverflow.com/questions/41942675",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3916429/"
] | * Sort the incoming data before doing the `LOAD`. This will improve the cacheability of the `PRIMARY KEY(id)`.
* `PARTITIONing` is unlikely to help, unless there is some useful pattern to `ID`.
* `PARTITIONing` will *not* help for single-row insert nor for single-row fetch by `ID`.
* If the strings are not a constant w... | Optimizing a table requires that you optimize for specific queries. You can't determine the best optimization strategy unless you have specific queries in mind. Any optimization improves one type of query at the expense of other types of queries.
For example, if your query is `SELECT SUM(pair) FROM keypairs` (a query ... |
38,475,648 | I have strings in an array:
```
["foo","bar","foo"bar"baz"]
```
I am using `eval` method to form an array with this string, but the inner double quotes are not escaped:
```
eval('["foo","bar","foo"bar"baz"]') # => SyntaxError
```
Is there a way to escape only the ones inside an array element? | 2016/07/20 | [
"https://Stackoverflow.com/questions/38475648",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/902991/"
] | I think you can try something like
```
eval('["foo","bar","foo"bar"baz"]'.gsub(/(\w)\"(\w)/, '\1\"\2'))
```
if I got what you have meant | This might work for all possible variants. This would fix all quotes except of appearing near commas and brackets
```
.gsub(/(?<!\,)(?<!\[)(?<!\])\"(?!\,)(?!\[)(?!\])/, '\"')
``` |
35,624,876 | I see other discussion like these, hovewer i can't figure out how to get the email address from linkedin API, i enabled r\_emailaddress in my app, here what i have done:
index.html:
```
<!-- Linkedin login -->
<script type="text/javascript" src="http://platform.linkedin.com/in.js">
api_key: myapikey
scop... | 2016/02/25 | [
"https://Stackoverflow.com/questions/35624876",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5366858/"
] | I got it at least!
```
IN.API.Raw("/people/~:(id,firstName,lastName,emailAddress)?format=json")
.result(onSuccess)
.error(onError);
``` | Aya Magdy provided an answer to this question on the following SO Question page:
[How do I get email address field using the LinkedIn Javascript API?](https://stackoverflow.com/questions/19843698/how-do-i-get-email-address-field-using-the-linkedin-javascript-api)
In your case all you have to do is ensure you checked ... |
46,028,779 | Just looking for some advice on doing CodeDeploy on Windows. I've used it for a year on Linux boxes, this is my first Windows Server on EC2 and I can't seem to get past "Permission Denied" errors.
I've changed the permissions in Windows on the folders, but the Deploy is failing on the Install step on CodeDeploy.
```
... | 2017/09/03 | [
"https://Stackoverflow.com/questions/46028779",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1588677/"
] | In my case the "Permission denied @ unlink\_internal" was caused by dotnet.exe process locking one of the dll's. You can find out what locks your file using Microsoft [Process Explorer](https://learn.microsoft.com/en-us/sysinternals/downloads/process-explorer). You can then update your appspec.yml BeforeInstall hook to... | The error "Permision Denied" on a Windows Instance while using CodeDeploy is usually because one or more files that you are trying to depoloy is already in use. (May be a .exe already running, A file open in notepad etc.).
Please see if this is the case and if so either manually stop the process that are using these f... |
69,984,389 | I have a table,
```
runs opposition date
10 team A 01 aug 2020
23 team B 13 sep 1975
76 team C 03 Jan 1999
92 team A 01 aug 1982
12 team C 01 aug 2020
100 team B 01 aug 2008
83 team A 01 aug 2005
93 team B 01 aug 2006
23 team B 01 aug 2011
11 team A 01 aug 2019
```
I want to plot a an... | 2021/11/16 | [
"https://Stackoverflow.com/questions/69984389",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/778942/"
] | well i don't know about x and y but what you can do is screen shot of specific widgets with package `screenshot`, [link](https://pub.dev/packages/screenshot)
this package capture widgets as Images, even if they are not rendered on screen.
Step 1: create a controller
```
ScreenshotController screenshotController = Sc... | Through RepaintBoundary widget you can take screenshot of specific area which you want. I put one example at here which I performed in my project. Please go with it. I hope it will helpful to you surely.
Declare globalkey first...
```
GlobalKey globalKey = GlobalKey();
```
Then wrap your widget with RepaintBoundar... |
10,381,810 | I have tried this way to get the binary representation in C#
```
int i = 1;
string binary = Convert.ToString(i, 2);
```
it returns a single char string "1"
i need a n digit string suppose the number is 8 n i want a 5 digit binary representation,
i need it to be "01000"
number of digits (n) is the input.
Thanks | 2012/04/30 | [
"https://Stackoverflow.com/questions/10381810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1124913/"
] | ```
string binary = Convert.ToString(i, 2).PadLeft(5, '0');
``` | Rolling your own, you could use something like this (not tested, but I think this should work):
```
int i = 8; // your number
int noZeros = 5;
StringBuilder sb = new StringBuilder();
while(i != 0 && noZeros > 0){
if(i & 1 != 0){ sb.Insert(0, "1"); }
else { sb.Insert(0, "0"); }
i = i >> 1;
noZeros --;
}... |
10,381,810 | I have tried this way to get the binary representation in C#
```
int i = 1;
string binary = Convert.ToString(i, 2);
```
it returns a single char string "1"
i need a n digit string suppose the number is 8 n i want a 5 digit binary representation,
i need it to be "01000"
number of digits (n) is the input.
Thanks | 2012/04/30 | [
"https://Stackoverflow.com/questions/10381810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1124913/"
] | You can do it by this.
```
string str = Convert.ToString(8, 2).PadLeft(5, '0');
```
PadLeft is used to put the 0 on left of expression here we have given 5 is totol width of number. and second parament is character to put on left when number is less then 5 characters | Rolling your own, you could use something like this (not tested, but I think this should work):
```
int i = 8; // your number
int noZeros = 5;
StringBuilder sb = new StringBuilder();
while(i != 0 && noZeros > 0){
if(i & 1 != 0){ sb.Insert(0, "1"); }
else { sb.Insert(0, "0"); }
i = i >> 1;
noZeros --;
}... |
20,729,704 | whenever I restart my one and only Elastic Search node I keep just getting the red status and having to delete my data directory and lose all my data...
Here is the log from a restart of the node:
```
[2013-12-22 12:44:24,257][INFO ][node ] [Dominic Fortune] version[0.90.8], pid[1494], build[909b0... | 2013/12/22 | [
"https://Stackoverflow.com/questions/20729704",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/383478/"
] | Ok I actually have been able to trial and error a fix.
The problem is that there was no data in the indexes when I restarted the node.
For some odd reason this makes Elastic Search explode as though it cannot find all the documents when in fact there are no documents to be found.
### Edit
After posting on the Googl... | Generally **RED/Yellow** statuses(after a restart) occur if the shutdown is not done properly,
do not `cntrl + c` to stop elastic search, use a rest call mentioned [here](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-nodes-shutdown.html)
In dev mode I generally use
```
curl -XPOST 'ht... |
3,360,842 | So I'm learning python so I'm going through some project euler problems. And I'm not sure if this is a python problem I'm having, or just me being retarded, but I seem to be getting the wrong answer for problem 53. Here's a link to the problem <http://projecteuler.net/index.php?section=problems&id=53>
and this is my c... | 2010/07/29 | [
"https://Stackoverflow.com/questions/3360842",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/375874/"
] | `range( a, b)` does not include `b`. | I think your code is correct, however, you should iterate x to 100 inclusive, so you should use
```
for x in range(1,101):
```
Hope that helps. Euler rocks! |
3,360,842 | So I'm learning python so I'm going through some project euler problems. And I'm not sure if this is a python problem I'm having, or just me being retarded, but I seem to be getting the wrong answer for problem 53. Here's a link to the problem <http://projecteuler.net/index.php?section=problems&id=53>
and this is my c... | 2010/07/29 | [
"https://Stackoverflow.com/questions/3360842",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/375874/"
] | `range( a, b)` does not include `b`. | Note that n is greater than or equal to 1 **AND** smaller than or equal to 100. Currently your n goes from 1 to 99. You can use [xrange](http://docs.python.org/library/stdtypes.html#xrange-type) too.
```
from math import factorial
def ncr(n,r):
return (factorial(n)/(factorial(r)*factorial(n-r)))
i = 0
for x in ... |
3,360,842 | So I'm learning python so I'm going through some project euler problems. And I'm not sure if this is a python problem I'm having, or just me being retarded, but I seem to be getting the wrong answer for problem 53. Here's a link to the problem <http://projecteuler.net/index.php?section=problems&id=53>
and this is my c... | 2010/07/29 | [
"https://Stackoverflow.com/questions/3360842",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/375874/"
] | `range( a, b)` does not include `b`. | If you are beginner I use this opportunity, considering project Euler's nature, to give coding alternative, which is self-contained and demonstrates lookup table approach to speed up recursive functions and saving the answers to dictionary and using the len as count.
Hope the 4075 is the right answer!
```
from __futu... |
3,360,842 | So I'm learning python so I'm going through some project euler problems. And I'm not sure if this is a python problem I'm having, or just me being retarded, but I seem to be getting the wrong answer for problem 53. Here's a link to the problem <http://projecteuler.net/index.php?section=problems&id=53>
and this is my c... | 2010/07/29 | [
"https://Stackoverflow.com/questions/3360842",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/375874/"
] | `range( a, b)` does not include `b`. | Considering the input from the [problem specification](http://projecteuler.net/index.php?section=problems&id=53):
"*It is not until n = 23, that a value exceeds one-million*",
you can make the range for the outer from 23 to 101:
```
for x in range(23,101):
...
```
Furthermore, n over k can be calculated faster wi... |
3,360,842 | So I'm learning python so I'm going through some project euler problems. And I'm not sure if this is a python problem I'm having, or just me being retarded, but I seem to be getting the wrong answer for problem 53. Here's a link to the problem <http://projecteuler.net/index.php?section=problems&id=53>
and this is my c... | 2010/07/29 | [
"https://Stackoverflow.com/questions/3360842",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/375874/"
] | I think your code is correct, however, you should iterate x to 100 inclusive, so you should use
```
for x in range(1,101):
```
Hope that helps. Euler rocks! | If you are beginner I use this opportunity, considering project Euler's nature, to give coding alternative, which is self-contained and demonstrates lookup table approach to speed up recursive functions and saving the answers to dictionary and using the len as count.
Hope the 4075 is the right answer!
```
from __futu... |
3,360,842 | So I'm learning python so I'm going through some project euler problems. And I'm not sure if this is a python problem I'm having, or just me being retarded, but I seem to be getting the wrong answer for problem 53. Here's a link to the problem <http://projecteuler.net/index.php?section=problems&id=53>
and this is my c... | 2010/07/29 | [
"https://Stackoverflow.com/questions/3360842",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/375874/"
] | I think your code is correct, however, you should iterate x to 100 inclusive, so you should use
```
for x in range(1,101):
```
Hope that helps. Euler rocks! | Considering the input from the [problem specification](http://projecteuler.net/index.php?section=problems&id=53):
"*It is not until n = 23, that a value exceeds one-million*",
you can make the range for the outer from 23 to 101:
```
for x in range(23,101):
...
```
Furthermore, n over k can be calculated faster wi... |
3,360,842 | So I'm learning python so I'm going through some project euler problems. And I'm not sure if this is a python problem I'm having, or just me being retarded, but I seem to be getting the wrong answer for problem 53. Here's a link to the problem <http://projecteuler.net/index.php?section=problems&id=53>
and this is my c... | 2010/07/29 | [
"https://Stackoverflow.com/questions/3360842",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/375874/"
] | Note that n is greater than or equal to 1 **AND** smaller than or equal to 100. Currently your n goes from 1 to 99. You can use [xrange](http://docs.python.org/library/stdtypes.html#xrange-type) too.
```
from math import factorial
def ncr(n,r):
return (factorial(n)/(factorial(r)*factorial(n-r)))
i = 0
for x in ... | If you are beginner I use this opportunity, considering project Euler's nature, to give coding alternative, which is self-contained and demonstrates lookup table approach to speed up recursive functions and saving the answers to dictionary and using the len as count.
Hope the 4075 is the right answer!
```
from __futu... |
3,360,842 | So I'm learning python so I'm going through some project euler problems. And I'm not sure if this is a python problem I'm having, or just me being retarded, but I seem to be getting the wrong answer for problem 53. Here's a link to the problem <http://projecteuler.net/index.php?section=problems&id=53>
and this is my c... | 2010/07/29 | [
"https://Stackoverflow.com/questions/3360842",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/375874/"
] | Note that n is greater than or equal to 1 **AND** smaller than or equal to 100. Currently your n goes from 1 to 99. You can use [xrange](http://docs.python.org/library/stdtypes.html#xrange-type) too.
```
from math import factorial
def ncr(n,r):
return (factorial(n)/(factorial(r)*factorial(n-r)))
i = 0
for x in ... | Considering the input from the [problem specification](http://projecteuler.net/index.php?section=problems&id=53):
"*It is not until n = 23, that a value exceeds one-million*",
you can make the range for the outer from 23 to 101:
```
for x in range(23,101):
...
```
Furthermore, n over k can be calculated faster wi... |
59,840 | I believe I.M. Gelfand said that when beginning to learn a new subject, one should learn it like a physicist.
In this spirit, what are some helpful and surprising physical intuitions accompanying mathematical objects?
I especially am interested in intuitions that suggest nice proofs...and helpful new ways of thinking... | 2011/03/28 | [
"https://mathoverflow.net/questions/59840",
"https://mathoverflow.net",
"https://mathoverflow.net/users/6269/"
] | Kirillov's [orbit method](http://en.wikipedia.org/wiki/Orbit_method) in representation theory establishes a correspondence (which is not exact in general) between irreducible unitary representations of a Lie group $G$ and orbits of the action of $G$ on the dual of its Lie algebra $\mathfrak{g}^{\ast}$. The physical int... | The Hilbert method for linear elliptic boundary-value problems start from the physical intuition that a steady system in stable configuration minimizes its energy. |
59,840 | I believe I.M. Gelfand said that when beginning to learn a new subject, one should learn it like a physicist.
In this spirit, what are some helpful and surprising physical intuitions accompanying mathematical objects?
I especially am interested in intuitions that suggest nice proofs...and helpful new ways of thinking... | 2011/03/28 | [
"https://mathoverflow.net/questions/59840",
"https://mathoverflow.net",
"https://mathoverflow.net/users/6269/"
] | Well, there are of course many examples but perhaps the Dirac $\delta$-function is the most striking one. With quite some violence to the math of usual calculus, Dirac's idea turned out to be exremely useful: the "function" everywhere zero and very high at $0$ so that the integral is $1$. Applications are ranging from ... | My favourite example is that of braided fusion categories (a fusion category has finitely many equivalence classes of irreducible objects, but that is not essential here). This is basically the idea behind topological quantum computing. Without going into details, a nice interpretation of the equivalence classes of irr... |
59,840 | I believe I.M. Gelfand said that when beginning to learn a new subject, one should learn it like a physicist.
In this spirit, what are some helpful and surprising physical intuitions accompanying mathematical objects?
I especially am interested in intuitions that suggest nice proofs...and helpful new ways of thinking... | 2011/03/28 | [
"https://mathoverflow.net/questions/59840",
"https://mathoverflow.net",
"https://mathoverflow.net/users/6269/"
] | My favourite example is that of braided fusion categories (a fusion category has finitely many equivalence classes of irreducible objects, but that is not essential here). This is basically the idea behind topological quantum computing. Without going into details, a nice interpretation of the equivalence classes of irr... | For beginners, Polya's Induction and Plausible Reasoning has some nice examples of physical reasoning. For example he has a chapter on a shortest path problem that is solved mechanically and optically. |
59,840 | I believe I.M. Gelfand said that when beginning to learn a new subject, one should learn it like a physicist.
In this spirit, what are some helpful and surprising physical intuitions accompanying mathematical objects?
I especially am interested in intuitions that suggest nice proofs...and helpful new ways of thinking... | 2011/03/28 | [
"https://mathoverflow.net/questions/59840",
"https://mathoverflow.net",
"https://mathoverflow.net/users/6269/"
] | I view the [Gauss-Bonnet theorem](http://en.wikipedia.org/wiki/Gauss-Bonnet_theorem) for a surface without boundary
via the physical analogy that if you push a dent into a maleable surface, or squeeze it,
the surface must compensate by curving elsewhere
to maintain $2 \pi \chi$.
 for a surface without boundary
via the physical analogy that if you push a dent into a maleable surface, or squeeze it,
the surface must compensate by curving elsewhere
to maintain $2 \pi \chi$.
. To get you started let me mention the [statistical-mechanical interpretation of the Riemann zeta function](http://empslocal.ex.ac.uk/people/staff/mrwatkin//zeta/physics2.htm#partitio... |
59,840 | I believe I.M. Gelfand said that when beginning to learn a new subject, one should learn it like a physicist.
In this spirit, what are some helpful and surprising physical intuitions accompanying mathematical objects?
I especially am interested in intuitions that suggest nice proofs...and helpful new ways of thinking... | 2011/03/28 | [
"https://mathoverflow.net/questions/59840",
"https://mathoverflow.net",
"https://mathoverflow.net/users/6269/"
] | Well, there are of course many examples but perhaps the Dirac $\delta$-function is the most striking one. With quite some violence to the math of usual calculus, Dirac's idea turned out to be exremely useful: the "function" everywhere zero and very high at $0$ so that the integral is $1$. Applications are ranging from ... | For beginners, Polya's Induction and Plausible Reasoning has some nice examples of physical reasoning. For example he has a chapter on a shortest path problem that is solved mechanically and optically. |
59,840 | I believe I.M. Gelfand said that when beginning to learn a new subject, one should learn it like a physicist.
In this spirit, what are some helpful and surprising physical intuitions accompanying mathematical objects?
I especially am interested in intuitions that suggest nice proofs...and helpful new ways of thinking... | 2011/03/28 | [
"https://mathoverflow.net/questions/59840",
"https://mathoverflow.net",
"https://mathoverflow.net/users/6269/"
] | Well, there are of course many examples but perhaps the Dirac $\delta$-function is the most striking one. With quite some violence to the math of usual calculus, Dirac's idea turned out to be exremely useful: the "function" everywhere zero and very high at $0$ so that the integral is $1$. Applications are ranging from ... | Archimedes figured out the area of a parabolic section by slicing it into pieces and moving the pieces to the other side of an imaginary lever and observing that they balance a certain triangle. |
59,840 | I believe I.M. Gelfand said that when beginning to learn a new subject, one should learn it like a physicist.
In this spirit, what are some helpful and surprising physical intuitions accompanying mathematical objects?
I especially am interested in intuitions that suggest nice proofs...and helpful new ways of thinking... | 2011/03/28 | [
"https://mathoverflow.net/questions/59840",
"https://mathoverflow.net",
"https://mathoverflow.net/users/6269/"
] | Kirillov's [orbit method](http://en.wikipedia.org/wiki/Orbit_method) in representation theory establishes a correspondence (which is not exact in general) between irreducible unitary representations of a Lie group $G$ and orbits of the action of $G$ on the dual of its Lie algebra $\mathfrak{g}^{\ast}$. The physical int... | There are several examples at the [number theory and physics archive](http://empslocal.ex.ac.uk/people/staff/mrwatkin//zeta/physics.htm). To get you started let me mention the [statistical-mechanical interpretation of the Riemann zeta function](http://empslocal.ex.ac.uk/people/staff/mrwatkin//zeta/physics2.htm#partitio... |
59,840 | I believe I.M. Gelfand said that when beginning to learn a new subject, one should learn it like a physicist.
In this spirit, what are some helpful and surprising physical intuitions accompanying mathematical objects?
I especially am interested in intuitions that suggest nice proofs...and helpful new ways of thinking... | 2011/03/28 | [
"https://mathoverflow.net/questions/59840",
"https://mathoverflow.net",
"https://mathoverflow.net/users/6269/"
] | I don't know if you've heard of this before, but there is an extremely elegant physical proof of the existence and properties of the Fermat point. It even illustrates the degeneracy that starts to occur for largest angle at least $2\pi/3$.
Consider your desired triangle as a flat, sturdy, sheet. Make very small notche... | I think, Elliott Sober gives a nice example (cf. Elliott Sober
`Quine's Two Dogmas', Proceedings of the Aristotelian Society,
Supplementary Volumes, Vol. 74 (2000), pp. 268-269):
For logic and mathematics to be tested empirically, one logical or
mathematical statement would have to be pitted against an alternative
and... |
66,563,768 | I would like to know what is the difference between these two three pieces of code:
```
underlyingConnectors.values().stream().forEach(connector -> connector.start());
underlyingConnectors.values().forEach(connector -> connector.start());
underlyingConnectors.values().forEach(Connector::start);
```
The second line... | 2021/03/10 | [
"https://Stackoverflow.com/questions/66563768",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10250306/"
] | The first line contains an unnecessary call to `stream()` and the two latter ones are a matter of opinion. If you want to write the shortest and most succinct code, you would use the last one. All of them work in an equivalent way and it's mainly about style.
The `stream()` is unnecessary since `values()` returns a `C... | Both lines are correct. It is just a warning of sonar lint. The method reference is a simple form of lambda, in case you are returning just a method. |
66,563,768 | I would like to know what is the difference between these two three pieces of code:
```
underlyingConnectors.values().stream().forEach(connector -> connector.start());
underlyingConnectors.values().forEach(connector -> connector.start());
underlyingConnectors.values().forEach(Connector::start);
```
The second line... | 2021/03/10 | [
"https://Stackoverflow.com/questions/66563768",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10250306/"
] | You can ommit the `.stream()` if you're just doing one operation with every element through `.forEach()`. Calling `.stream()` is redundant.
```
underlyingConnectors.values().stream().forEach(connector -> connector.start());
underlyingConnectors.values().forEach(connector -> connector.start());
```
Line 2 is correct.... | Both lines are correct. It is just a warning of sonar lint. The method reference is a simple form of lambda, in case you are returning just a method. |
66,563,768 | I would like to know what is the difference between these two three pieces of code:
```
underlyingConnectors.values().stream().forEach(connector -> connector.start());
underlyingConnectors.values().forEach(connector -> connector.start());
underlyingConnectors.values().forEach(Connector::start);
```
The second line... | 2021/03/10 | [
"https://Stackoverflow.com/questions/66563768",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10250306/"
] | The second one is simply a shorthand notation for the first one and the third one for the second one. A rule of thumb is that if a method has no parameters like the second one you can simply replace it with a notation like the third one.
More generally, if the expression on the right-hand side (RHS) of a lambda expres... | Both lines are correct. It is just a warning of sonar lint. The method reference is a simple form of lambda, in case you are returning just a method. |
66,563,768 | I would like to know what is the difference between these two three pieces of code:
```
underlyingConnectors.values().stream().forEach(connector -> connector.start());
underlyingConnectors.values().forEach(connector -> connector.start());
underlyingConnectors.values().forEach(Connector::start);
```
The second line... | 2021/03/10 | [
"https://Stackoverflow.com/questions/66563768",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10250306/"
] | The second one is simply a shorthand notation for the first one and the third one for the second one. A rule of thumb is that if a method has no parameters like the second one you can simply replace it with a notation like the third one.
More generally, if the expression on the right-hand side (RHS) of a lambda expres... | The first line contains an unnecessary call to `stream()` and the two latter ones are a matter of opinion. If you want to write the shortest and most succinct code, you would use the last one. All of them work in an equivalent way and it's mainly about style.
The `stream()` is unnecessary since `values()` returns a `C... |
66,563,768 | I would like to know what is the difference between these two three pieces of code:
```
underlyingConnectors.values().stream().forEach(connector -> connector.start());
underlyingConnectors.values().forEach(connector -> connector.start());
underlyingConnectors.values().forEach(Connector::start);
```
The second line... | 2021/03/10 | [
"https://Stackoverflow.com/questions/66563768",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10250306/"
] | The second one is simply a shorthand notation for the first one and the third one for the second one. A rule of thumb is that if a method has no parameters like the second one you can simply replace it with a notation like the third one.
More generally, if the expression on the right-hand side (RHS) of a lambda expres... | You can ommit the `.stream()` if you're just doing one operation with every element through `.forEach()`. Calling `.stream()` is redundant.
```
underlyingConnectors.values().stream().forEach(connector -> connector.start());
underlyingConnectors.values().forEach(connector -> connector.start());
```
Line 2 is correct.... |
7,241,524 | I'm building a Rails app that uses MongoDB as the backend, with Mongoid as the ODM. I've found it very useful, but I'm looking for a good way to keep track of the following:
* Updating objects (Mike changed the price from 50 to 75)
* Creating objects (Dan added a comment on Mike's post)
* Basic stats (Mike's post was ... | 2011/08/30 | [
"https://Stackoverflow.com/questions/7241524",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/76735/"
] | Try the mongoid-history and trackoid gems. The first allows you to track changes and the latter allows you to track activity.
<https://github.com/aq1018/mongoid-history>
<https://github.com/twoixter/trackoid> | There are several options you have. Here are a couple things to keep in mind:
* Mongoid has a versioning plugin where you can keep track of versions of a document
* You can create an embedded document to store notes/changes on a model. Use an observer to add a note when certain things happen. You can tie this note to ... |
7,241,524 | I'm building a Rails app that uses MongoDB as the backend, with Mongoid as the ODM. I've found it very useful, but I'm looking for a good way to keep track of the following:
* Updating objects (Mike changed the price from 50 to 75)
* Creating objects (Dan added a comment on Mike's post)
* Basic stats (Mike's post was ... | 2011/08/30 | [
"https://Stackoverflow.com/questions/7241524",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/76735/"
] | Try the mongoid-history and trackoid gems. The first allows you to track changes and the latter allows you to track activity.
<https://github.com/aq1018/mongoid-history>
<https://github.com/twoixter/trackoid> | just use public activity gem. It supports rails 3 and 4 and mongoid embedded documents |
22,416,569 | I am trying to build an ORM around GlideRecords. GlideRecords have a format similar to
```
var inc = new GlideRecord('incident');
inc.addQuery("foo", "1");
inc.addQuery("bar", "1");
inc.query();
```
The orm is intended to look like this:
`var inc = new ORM().foo("1").bar("1").query();`
My immediate decision was to... | 2014/03/14 | [
"https://Stackoverflow.com/questions/22416569",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2458372/"
] | Attribute routing is a bit trickier in ASP.NET MVC than traditional convention based. You can start review from `System.Web.Mvc.Controller.ExecuteCore()` where `GetActionName()` returns null for attribute routing and let action selector choose which action to execute. Then you can jump to `System.Web.Mvc.ControllerActi... | @Anthony, if you only want to see which routes are followed with any given URL, then load the [Cobisi Routing Assistant](http://cobisi.com/routing-assistant) extension.
In the Visual Studio IDE, go to Tools->Extension Manager.... Then, make sure you have the Online Gallery tab selected and type "cobisi" in the search ... |
664,074 | I have HP ELiteBook , this problem has become a routine headache for me (after every 20, 25 minutes\_ - While using, suddenly everything hangs and black out goes around and then a message pop at the task bar below that display driver stopped ...and successfully recovered but the hangs and black screen continues and the... | 2013/10/23 | [
"https://superuser.com/questions/664074",
"https://superuser.com",
"https://superuser.com/users/256777/"
] | I had the same issue with mine, so I contacted apple support. when you are in System Preferences>Displays - hold the option key while clicking on scaled, all the resolutions will appear again. I hope this helps! | I had the same problem on my 3840x1024 Matrox TripleHead2Go display. After upgrading to Mavericks, it detected the display as 1280x1024 with no option in Display Preference to select my previous resolution.
I solved the problem by installing "[SwitchResX](https://www.macupdate.com/app/iphone/8355/switchresx)" which al... |
28,688,926 | I recently came across an article detailing how to create **responsive triangles** with pure *CSS*. I was wanting to take this a step further to incorporate it into a current design.
I was able to get four triangles placed within a square div perfectly (creating an origami-type effect) and they are responsive.
Howev... | 2015/02/24 | [
"https://Stackoverflow.com/questions/28688926",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3662875/"
] | You can achieve the hover effect (background-color change and outside box-shadow) by making the [triangles with transform-rotate](https://stackoverflow.com/questions/7073484/how-does-this-css-triangle-shape-work/24808936#24808936).
This will allow you to triger the hover event only when the shape is actualy hovered :... | This will work try this
Here is the Html
```
<div class="arrow-up"></div>
<div class="arrow-down"></div>
<div class="arrow-left"></div>
<div class="arrow-right"></div>
```
Here is the CSS
```
.arrow-up {
width: 0;
height: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent... |
59,644,328 | Purchases table
```
create table purchase (
id integer primary key,
purchasedate date not null,
purchasesum numeric(12,2) not null )
```
contains purchase sums. How to find change percent from previos year:
```
select
extract( year from purchasedate ),
sum( purchasesum),
( sum( purchasesum) - previous row ... | 2020/01/08 | [
"https://Stackoverflow.com/questions/59644328",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/742402/"
] | From the error and the way you've included the dependency (in package.json), it seems you are not passing authentication credentials (token, ssh.
Refer to this documentation for specifics on [Git URLs as Dependencies](https://docs.npmjs.com/files/package.json#git-urls-as-dependencies)
It can be done via https and oa... | You should edit your `.npmrc` file.
You can also use `npm config`
`npm config set @myco:registry http://reg.example.com`
Please see the following thread for more information:
[Is there any way to configure multiple registries in a single npmrc file](https://stackoverflow.com/questions/32633678/is-there-any-way-to-con... |
59,644,328 | Purchases table
```
create table purchase (
id integer primary key,
purchasedate date not null,
purchasesum numeric(12,2) not null )
```
contains purchase sums. How to find change percent from previos year:
```
select
extract( year from purchasedate ),
sum( purchasesum),
( sum( purchasesum) - previous row ... | 2020/01/08 | [
"https://Stackoverflow.com/questions/59644328",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/742402/"
] | This is how I have managed to install dependencies from private GitHub repositories.
Dependencies in package.json can be added as follows. The `github:` prefix is optional. Specifying the `#branch` or `#tag` is also optional.
```
"dependencies": {
...
"myrepo": "username/myrepo#master",
"m... | You should edit your `.npmrc` file.
You can also use `npm config`
`npm config set @myco:registry http://reg.example.com`
Please see the following thread for more information:
[Is there any way to configure multiple registries in a single npmrc file](https://stackoverflow.com/questions/32633678/is-there-any-way-to-con... |
59,644,328 | Purchases table
```
create table purchase (
id integer primary key,
purchasedate date not null,
purchasesum numeric(12,2) not null )
```
contains purchase sums. How to find change percent from previos year:
```
select
extract( year from purchasedate ),
sum( purchasesum),
( sum( purchasesum) - previous row ... | 2020/01/08 | [
"https://Stackoverflow.com/questions/59644328",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/742402/"
] | A very straightforward solution that requires only **read-only** access to the repo. Uses GitHub's Deploy Keys and the following action <https://github.com/webfactory/ssh-agent>
#### 1. Provide a private repo in `package.json` in the following format:
```
"dependencies": {
"repo": "git+ssh://git@github.com:user/p... | You should edit your `.npmrc` file.
You can also use `npm config`
`npm config set @myco:registry http://reg.example.com`
Please see the following thread for more information:
[Is there any way to configure multiple registries in a single npmrc file](https://stackoverflow.com/questions/32633678/is-there-any-way-to-con... |
59,644,328 | Purchases table
```
create table purchase (
id integer primary key,
purchasedate date not null,
purchasesum numeric(12,2) not null )
```
contains purchase sums. How to find change percent from previos year:
```
select
extract( year from purchasedate ),
sum( purchasesum),
( sum( purchasesum) - previous row ... | 2020/01/08 | [
"https://Stackoverflow.com/questions/59644328",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/742402/"
] | This is how I have managed to install dependencies from private GitHub repositories.
Dependencies in package.json can be added as follows. The `github:` prefix is optional. Specifying the `#branch` or `#tag` is also optional.
```
"dependencies": {
...
"myrepo": "username/myrepo#master",
"m... | From the error and the way you've included the dependency (in package.json), it seems you are not passing authentication credentials (token, ssh.
Refer to this documentation for specifics on [Git URLs as Dependencies](https://docs.npmjs.com/files/package.json#git-urls-as-dependencies)
It can be done via https and oa... |
59,644,328 | Purchases table
```
create table purchase (
id integer primary key,
purchasedate date not null,
purchasesum numeric(12,2) not null )
```
contains purchase sums. How to find change percent from previos year:
```
select
extract( year from purchasedate ),
sum( purchasesum),
( sum( purchasesum) - previous row ... | 2020/01/08 | [
"https://Stackoverflow.com/questions/59644328",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/742402/"
] | A very straightforward solution that requires only **read-only** access to the repo. Uses GitHub's Deploy Keys and the following action <https://github.com/webfactory/ssh-agent>
#### 1. Provide a private repo in `package.json` in the following format:
```
"dependencies": {
"repo": "git+ssh://git@github.com:user/p... | From the error and the way you've included the dependency (in package.json), it seems you are not passing authentication credentials (token, ssh.
Refer to this documentation for specifics on [Git URLs as Dependencies](https://docs.npmjs.com/files/package.json#git-urls-as-dependencies)
It can be done via https and oa... |
59,644,328 | Purchases table
```
create table purchase (
id integer primary key,
purchasedate date not null,
purchasesum numeric(12,2) not null )
```
contains purchase sums. How to find change percent from previos year:
```
select
extract( year from purchasedate ),
sum( purchasesum),
( sum( purchasesum) - previous row ... | 2020/01/08 | [
"https://Stackoverflow.com/questions/59644328",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/742402/"
] | This is how I have managed to install dependencies from private GitHub repositories.
Dependencies in package.json can be added as follows. The `github:` prefix is optional. Specifying the `#branch` or `#tag` is also optional.
```
"dependencies": {
...
"myrepo": "username/myrepo#master",
"m... | A very straightforward solution that requires only **read-only** access to the repo. Uses GitHub's Deploy Keys and the following action <https://github.com/webfactory/ssh-agent>
#### 1. Provide a private repo in `package.json` in the following format:
```
"dependencies": {
"repo": "git+ssh://git@github.com:user/p... |
47,994,931 | Sorry, if it is a really stupid question, but I cannot understand why `person.Cars` property is not populated. :
```
var persons = db.Persons.AsNoTracking()
.Select(person => new PersonDto
{
ID = person.ID,
Name = person.SP_Status.Name
});
//The following code where person.Cars is not popul... | 2017/12/27 | [
"https://Stackoverflow.com/questions/47994931",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1646240/"
] | The issue in dateFormat item. Use below code this will work for you.
```
<column name="created_at" class="Magento\Ui\Component\Listing\Columns\Date">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="timezone" xsi:type="boolean">false</item>
<... | Use this one instead
```
<column name="created_at" class="Magento\Ui\Component\Listing\Columns\Date" component="Magento_Ui/js/grid/columns/date">
<settings>
<filter>dateRange</filter>
<dataType>date</dataType>
<label translate="true">Created</label>
</settings>
</column>
``` |
25,483,735 | In my current application i need to maintain one `config.properties` file and from this properties file i need to get the data in my java file. I have placed the properties file and `ConfigUtil.java` which is accessing those properties files values are in the same location. But when i am running the application it's gi... | 2014/08/25 | [
"https://Stackoverflow.com/questions/25483735",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2775139/"
] | **Step 1**
Create a .properties file in assets folder, if you don’t have assets folder please create one under main
[](https://i.stack.imgur.com/U8uSR.jpg)
[](https://i.stack.imgur.... | You should either specify the full path to the file (because the root working directory is not the directory where `ConfigUtil` is located) :
```
inputStream = new FileInputStream("src/main/java/config.properties");
```
or use the following (which is using the directory `ConfigUtil` was loaded from):
```
inputStrea... |
40,259,225 | Okay probbaly my question is very common, and so many aks this question and answer this. But i have (kinda) have another problem. Usually is work if i text it into vendor, text cgame will follow what i text on vendor (keyup on real time), and i can change it on cgname (not affect to text vendor). But this is my problem... | 2016/10/26 | [
"https://Stackoverflow.com/questions/40259225",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6354497/"
] | Based on AHJeebon's answer I think you are looking for this :
```js
$("#vendor").keyup(function() {
$("#cgname").val( $(this).val());
});
$("#cgname").keyup(function() {
var val = $(this).val();
if(!val || val.length === 0 )
$(this).val($('#vendor').val());
});
```
```html
<script src="https://aj... | This is:
>
> Edited: I took some code from **@cpaulus**
>
>
>
```js
$("#vendor").keyup(function() {
$("#cgname").val( $(this).val());
});
$("#cgname").keyup(function() {
var val = $(this).val();
if(!val || val.length === 0 ){
$(this).val($('#vendor').val());
}
});
```
```html
<script sr... |
40,259,225 | Okay probbaly my question is very common, and so many aks this question and answer this. But i have (kinda) have another problem. Usually is work if i text it into vendor, text cgame will follow what i text on vendor (keyup on real time), and i can change it on cgname (not affect to text vendor). But this is my problem... | 2016/10/26 | [
"https://Stackoverflow.com/questions/40259225",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6354497/"
] | This is:
>
> Edited: I took some code from **@cpaulus**
>
>
>
```js
$("#vendor").keyup(function() {
$("#cgname").val( $(this).val());
});
$("#cgname").keyup(function() {
var val = $(this).val();
if(!val || val.length === 0 ){
$(this).val($('#vendor').val());
}
});
```
```html
<script sr... | ```html
<!doctype html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<style>
div:not([class]){ color: red; }
</style>
<script>
$(document).on('keyup','#cgname',function() {
vendor = $(this).val();
console.log(vendor)
$(... |
40,259,225 | Okay probbaly my question is very common, and so many aks this question and answer this. But i have (kinda) have another problem. Usually is work if i text it into vendor, text cgame will follow what i text on vendor (keyup on real time), and i can change it on cgname (not affect to text vendor). But this is my problem... | 2016/10/26 | [
"https://Stackoverflow.com/questions/40259225",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6354497/"
] | Based on AHJeebon's answer I think you are looking for this :
```js
$("#vendor").keyup(function() {
$("#cgname").val( $(this).val());
});
$("#cgname").keyup(function() {
var val = $(this).val();
if(!val || val.length === 0 )
$(this).val($('#vendor').val());
});
```
```html
<script src="https://aj... | ```html
<!doctype html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<style>
div:not([class]){ color: red; }
</style>
<script>
$(document).on('keyup','#cgname',function() {
vendor = $(this).val();
console.log(vendor)
$(... |
70,140,982 | need help with a problem with Github.
I have been using jenkins to deloy my code automatically from Github. in which I've been using SSH for the authentication.
it works great until recently my company network dept decide to close port 22 for SSH,
which made my connection to Github failed in timeout.
[![port 22 connect... | 2021/11/28 | [
"https://Stackoverflow.com/questions/70140982",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10152920/"
] | I tried using https URL just like @VonC recommended.
it works on my server but not on my jenkins.
so I use personal access code instead, you can found the tutorial on how to create a personal access token [personal access token tutorial](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/cr... | >
> I tried it but it doesn't work
>
>
>
It depends what you have added.
Try and add the output of `ssh-keyscan ssh.github.com` |
70,963,478 | Overriding background-color of the .gantt-row class below is easily done by adding a style attribute to the DIV:
```
<div style="background-color: blue" class="gantt-row">
```
Is it also possible to override the background-color of the gantt-row:nth-child selectors from within the markup? Or is it necessary to use j... | 2022/02/02 | [
"https://Stackoverflow.com/questions/70963478",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11376662/"
] | Please find below two solutions you can use.
* First is to set the css for the nth-child again, so that the previous css, the bottom css will override the initially set styling.
* Another way is to use [specificity](https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity) which will override the previous css, the... | ```
<div class="wrapper">
<div class="gantt-row check checker">
<div class="gantt-row-name">North Quay 1</div>
<ul style="grid-template-columns: repeat(28, 1fr)" class="gantt-bars">
<li style="grid-column: 8/16;" class="tooltip">
<a href="https://www.marine.com">World Navigator</a>
<span class="tool... |
70,963,478 | Overriding background-color of the .gantt-row class below is easily done by adding a style attribute to the DIV:
```
<div style="background-color: blue" class="gantt-row">
```
Is it also possible to override the background-color of the gantt-row:nth-child selectors from within the markup? Or is it necessary to use j... | 2022/02/02 | [
"https://Stackoverflow.com/questions/70963478",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11376662/"
] | You can't directly affect the style of the nth-child element like that, but you can set CSS variables which can be picked up when styling a property.
In this snippet a parent container can be styled inline with a --bg variable setting and this can be picked up by the settings for the nth-child(even).
```css
.gantt-ro... | Please find below two solutions you can use.
* First is to set the css for the nth-child again, so that the previous css, the bottom css will override the initially set styling.
* Another way is to use [specificity](https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity) which will override the previous css, the... |
70,963,478 | Overriding background-color of the .gantt-row class below is easily done by adding a style attribute to the DIV:
```
<div style="background-color: blue" class="gantt-row">
```
Is it also possible to override the background-color of the gantt-row:nth-child selectors from within the markup? Or is it necessary to use j... | 2022/02/02 | [
"https://Stackoverflow.com/questions/70963478",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11376662/"
] | You can't directly affect the style of the nth-child element like that, but you can set CSS variables which can be picked up when styling a property.
In this snippet a parent container can be styled inline with a --bg variable setting and this can be picked up by the settings for the nth-child(even).
```css
.gantt-ro... | ```
<div class="wrapper">
<div class="gantt-row check checker">
<div class="gantt-row-name">North Quay 1</div>
<ul style="grid-template-columns: repeat(28, 1fr)" class="gantt-bars">
<li style="grid-column: 8/16;" class="tooltip">
<a href="https://www.marine.com">World Navigator</a>
<span class="tool... |
63,688 | I'm considering a passive solar radiant heating installation in the Chicago area and was wondering if it would be feasible to store enough water/energy to support heating for most of the night. The house already has a gas central furnace, and can serve as backup, but the winter bills have been as high as $300-400 (for ... | 2015/04/15 | [
"https://diy.stackexchange.com/questions/63688",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/9750/"
] | You could use a plug cutter to remove the screw and surrounding wood.
 | Grip Pliers (Vice Grip) to clamp the tip of the screw and unscrew. Thats what I would do. unless the head will get stuck as its going out the other end.
You will need to clamp the head parallel to the board so that you can get maximum torque.
 |
63,688 | I'm considering a passive solar radiant heating installation in the Chicago area and was wondering if it would be feasible to store enough water/energy to support heating for most of the night. The house already has a gas central furnace, and can serve as backup, but the winter bills have been as high as $300-400 (for ... | 2015/04/15 | [
"https://diy.stackexchange.com/questions/63688",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/9750/"
] | If I were doing this, I'd use a hole saw with a portable drill press.


If the hole saw leaves a rough hole, you can follow up with a larger forstner bit.
 to clamp the tip of the screw and unscrew. Thats what I would do. unless the head will get stuck as its going out the other end.
You will need to clamp the head parallel to the board so that you can get maximum torque.
 |
63,688 | I'm considering a passive solar radiant heating installation in the Chicago area and was wondering if it would be feasible to store enough water/energy to support heating for most of the night. The house already has a gas central furnace, and can serve as backup, but the winter bills have been as high as $300-400 (for ... | 2015/04/15 | [
"https://diy.stackexchange.com/questions/63688",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/9750/"
] | Replying to this tread with my experience based upon the hole-saw recommendation above. First of all, this sucks. What would be a 3-second step to remove the spindle turns into a 3 minute step per spindle, after a run to the hardware store for a 5/8" holesaw bit you likely don't just have laying around. Remove the pilo... | Grip Pliers (Vice Grip) to clamp the tip of the screw and unscrew. Thats what I would do. unless the head will get stuck as its going out the other end.
You will need to clamp the head parallel to the board so that you can get maximum torque.
 |
58,047,999 | I want to
SELECT events.id = scan.event\_id IF Scan.student\_id MATCH user.student\_id SHOW events.id and events.name
But my code dint work, it blank screen nothing happen to show
so blind :|
Controller
```php
public function pdftranscript($id)
{
$users = DB::table('users')
->join('scan... | 2019/09/22 | [
"https://Stackoverflow.com/questions/58047999",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12100305/"
] | There are two places you can use variables here: inside the compose file itself, and inside the containers created by`docker-compose`.
The `.env` file will be used by `docker-compose` to adjust the environment of the `docker-compose` command itself. This is useful for variable inside the yaml file that need to be expa... | Docker-compose need to be defined everything explicitly, consider it as a `docker run parameter`, it only applies those configurations or parameter on each container that is defined in the docker-compose file.
So one should avoid overriding ENV if they are already declared in Dockerfile so that is the why you need to ... |
360,758 | Is there a way to make the Apple Watch display a 24-hour single-hand watch face? Preferably with midnight on the bottom, and noon at the top?
Something like this:
 | 2019/05/23 | [
"https://apple.stackexchange.com/questions/360758",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/17907/"
] | When it comes to Apple Watch faces, one is limited to [customizations](https://support.apple.com/guide/watch/customize-the-watch-face-apdb0c5fb937/watchos) as per what Apple allows.
App Store Review Guidelines restrict app developers from creating custom watch faces.
* <https://developer.apple.com/app-store/review/gu... | Apple has a Solar Dial face that is practically the same as a single arm 24 hr. face.
[](https://i.stack.imgur.com/o5QFG.png)
[![Solar Dial. This watch face features a 24-hour, circular dial that tracks the sun as well as an analog or dig... |
25,795,363 | Is it possible to avoid having full class definition visible when using it in standard container of smart pointers? For example I can't get the following to compile:
```
#include <memory>
#include <map>
class Foo;
class Bar {
public:
Bar();
std::map<int, std::unique_ptr<Foo>> myMap;
};
```
The Clang compil... | 2014/09/11 | [
"https://Stackoverflow.com/questions/25795363",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/483756/"
] | Even though strict forward declaration would not compile a container of smart pointers, it is still possible to solve most practical needs and avoid exposing a complete class when defining a user class with a container. Just introduce a base class with public virtual distractor and have it visible.
in fooBase.h
```
c... | You have yo make the Foo destructor and constructors public. IF you are having othe errors please post them, since it is hard to tel from your initial post. The following code compiles:
```
#include <memory>
#include <map>
class Foo;
class Bar {
public:
Bar () {};
std::map<int, std::unique_ptr<Fo... |
32,923,343 | I have some JSON that I have specifically put inside a variable for this question.
Here is my json:
```
{"json":{"-K-dxZZVLv4N11BQ-tEJ":{"AssetID":1},"-K-dxwm5y1hVS68GyMhN":{"AssetID":2}}}
```
Here is what I tried:
```
var url = "https://rbxjson.firebaseio.com/catalog.json";
var recent;
$.getJSON(url, function (js... | 2015/10/03 | [
"https://Stackoverflow.com/questions/32923343",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I had also thought the [`seaborn` documentation](https://stanford.edu/~mwaskom/software/seaborn/generated/seaborn.distplot.html#seaborn.distplot) mentioned that multiple columns could be plotted simultaneously, and highlighted by color by default.
But upon re-reading, I did not see anything. Instead, I think I inferre... | Let's assume I have the excerpt from the data you have showed above (with only difference that on my machine `NAN` is `NaN`).
Then, the best graphical representation I can think of is grouped barplot: one group for every sample, within every group there are gene bars (some people call this histogram occasionally)
In ... |
32,923,343 | I have some JSON that I have specifically put inside a variable for this question.
Here is my json:
```
{"json":{"-K-dxZZVLv4N11BQ-tEJ":{"AssetID":1},"-K-dxwm5y1hVS68GyMhN":{"AssetID":2}}}
```
Here is what I tried:
```
var url = "https://rbxjson.firebaseio.com/catalog.json";
var recent;
$.getJSON(url, function (js... | 2015/10/03 | [
"https://Stackoverflow.com/questions/32923343",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I had similar problem because my *pandas.DataFrame* had elements of type *Object* in a column I wanted to plot (*my\_column*). So that the command:
```
print(df[my_column])
```
gave me:
```
Length: 150, dtype: object
```
The solution was
```
sns.distplot(df[my_column].astype(float))
```
As the datatype of *my... | Let's assume I have the excerpt from the data you have showed above (with only difference that on my machine `NAN` is `NaN`).
Then, the best graphical representation I can think of is grouped barplot: one group for every sample, within every group there are gene bars (some people call this histogram occasionally)
In ... |
32,923,343 | I have some JSON that I have specifically put inside a variable for this question.
Here is my json:
```
{"json":{"-K-dxZZVLv4N11BQ-tEJ":{"AssetID":1},"-K-dxwm5y1hVS68GyMhN":{"AssetID":2}}}
```
Here is what I tried:
```
var url = "https://rbxjson.firebaseio.com/catalog.json";
var recent;
$.getJSON(url, function (js... | 2015/10/03 | [
"https://Stackoverflow.com/questions/32923343",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I had also thought the [`seaborn` documentation](https://stanford.edu/~mwaskom/software/seaborn/generated/seaborn.distplot.html#seaborn.distplot) mentioned that multiple columns could be plotted simultaneously, and highlighted by color by default.
But upon re-reading, I did not see anything. Instead, I think I inferre... | I had similar problem because my *pandas.DataFrame* had elements of type *Object* in a column I wanted to plot (*my\_column*). So that the command:
```
print(df[my_column])
```
gave me:
```
Length: 150, dtype: object
```
The solution was
```
sns.distplot(df[my_column].astype(float))
```
As the datatype of *my... |
33,404,708 | **Question 1:**
I cloned latest mean.js package from the official Github repository, and went through the official document step by step. Now I am able to run the mean.js with grunt command on my machine. However, the application is running in development model. Even I run it with this command:
```
NODE_ENV=producti... | 2015/10/29 | [
"https://Stackoverflow.com/questions/33404708",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1895314/"
] | **Answer 1:** I have found the way to run an application in production mode. The command is
```
grunt prod
```
**Answer 2:** The official Mean.js repository added public/dist folder in .gitignore file. That's why the compiled JS files were not uploaded to Github, and so Heroku cannot get them from my repo. After del... | Regarding Answer 2:
I had this same issue. Your solution will work great, however if you have to deploy frequently (as I do), it becomes tiresome to remember to constantly rebuild your compiled JS files. Instead, you can set it up as a build script post install hook, which heroku will read as part of the normal build p... |
275,208 | Going off this question [here](https://stackoverflow.com/questions/26537486/radio-button-clears-text-boxes)...
Is it ok to give a jQuery answer if the OP has tagged jQuery, but does not use it in their code? It screams "mis-tag" to me, versus "gimme dat jQuery".
More or less, should jQuery answers be valid on a mis-t... | 2014/10/23 | [
"https://meta.stackoverflow.com/questions/275208",
"https://meta.stackoverflow.com",
"https://meta.stackoverflow.com/users/774078/"
] | To me it depends on the question. If the question is
>
> "How do I do X in JavaScript"
>
>
>
where X is something that's not really doable in regular javascript, but has a reasonably simple solution in jQuery, then it seems like it's a fine thing to answer with a jQuery answer regardless of whether it's tagged th... | If you feel that the answer isn't helpful, you're more than welcome to downvote it. If others feel that it is a helpful answer, despite using a tool not mentioned in the question, they may upvote it. Everyone is free to provide the feedback they feel is most appropriate.
Your first comment certainly isn't inappropriat... |
275,208 | Going off this question [here](https://stackoverflow.com/questions/26537486/radio-button-clears-text-boxes)...
Is it ok to give a jQuery answer if the OP has tagged jQuery, but does not use it in their code? It screams "mis-tag" to me, versus "gimme dat jQuery".
More or less, should jQuery answers be valid on a mis-t... | 2014/10/23 | [
"https://meta.stackoverflow.com/questions/275208",
"https://meta.stackoverflow.com",
"https://meta.stackoverflow.com/users/774078/"
] | I tend to agree with this author's rationale [expressed in his comment in a discussion on this subject:](https://stackoverflow.com/questions/30896297/onclick-function-in-javascript/30896696#30896696)
>
> The only person here that should have issues with my answer is the poster then. Not you. I told him/her how to do ... | To me it depends on the question. If the question is
>
> "How do I do X in JavaScript"
>
>
>
where X is something that's not really doable in regular javascript, but has a reasonably simple solution in jQuery, then it seems like it's a fine thing to answer with a jQuery answer regardless of whether it's tagged th... |
275,208 | Going off this question [here](https://stackoverflow.com/questions/26537486/radio-button-clears-text-boxes)...
Is it ok to give a jQuery answer if the OP has tagged jQuery, but does not use it in their code? It screams "mis-tag" to me, versus "gimme dat jQuery".
More or less, should jQuery answers be valid on a mis-t... | 2014/10/23 | [
"https://meta.stackoverflow.com/questions/275208",
"https://meta.stackoverflow.com",
"https://meta.stackoverflow.com/users/774078/"
] | Sometimes it can be hard to make grand statements about how much jQuery to use. None? Martijn's classic link depicting "needs more jQuery"?
I think each instance is kind of different and here is my take on this one.
Based on looking at this user's past history of posts they are attempting to integrate jQuery but do n... | If you feel that the answer isn't helpful, you're more than welcome to downvote it. If others feel that it is a helpful answer, despite using a tool not mentioned in the question, they may upvote it. Everyone is free to provide the feedback they feel is most appropriate.
Your first comment certainly isn't inappropriat... |
275,208 | Going off this question [here](https://stackoverflow.com/questions/26537486/radio-button-clears-text-boxes)...
Is it ok to give a jQuery answer if the OP has tagged jQuery, but does not use it in their code? It screams "mis-tag" to me, versus "gimme dat jQuery".
More or less, should jQuery answers be valid on a mis-t... | 2014/10/23 | [
"https://meta.stackoverflow.com/questions/275208",
"https://meta.stackoverflow.com",
"https://meta.stackoverflow.com/users/774078/"
] | I tend to agree with this author's rationale [expressed in his comment in a discussion on this subject:](https://stackoverflow.com/questions/30896297/onclick-function-in-javascript/30896696#30896696)
>
> The only person here that should have issues with my answer is the poster then. Not you. I told him/her how to do ... | Sometimes it can be hard to make grand statements about how much jQuery to use. None? Martijn's classic link depicting "needs more jQuery"?
I think each instance is kind of different and here is my take on this one.
Based on looking at this user's past history of posts they are attempting to integrate jQuery but do n... |
275,208 | Going off this question [here](https://stackoverflow.com/questions/26537486/radio-button-clears-text-boxes)...
Is it ok to give a jQuery answer if the OP has tagged jQuery, but does not use it in their code? It screams "mis-tag" to me, versus "gimme dat jQuery".
More or less, should jQuery answers be valid on a mis-t... | 2014/10/23 | [
"https://meta.stackoverflow.com/questions/275208",
"https://meta.stackoverflow.com",
"https://meta.stackoverflow.com/users/774078/"
] | I tend to agree with this author's rationale [expressed in his comment in a discussion on this subject:](https://stackoverflow.com/questions/30896297/onclick-function-in-javascript/30896696#30896696)
>
> The only person here that should have issues with my answer is the poster then. Not you. I told him/her how to do ... | If you feel that the answer isn't helpful, you're more than welcome to downvote it. If others feel that it is a helpful answer, despite using a tool not mentioned in the question, they may upvote it. Everyone is free to provide the feedback they feel is most appropriate.
Your first comment certainly isn't inappropriat... |
50,438 | I have a Macbook Pro with an OWC DataDoubler drive caddy replacing the Superdrive (installed at an Apple premium reseller, when I bought it, so I can still have my warranty).
The main drive slot has an SSD, and the Superdrive slot has the original 750GB hard drive. It all works great, and I have Lion installed on the ... | 2012/05/04 | [
"https://apple.stackexchange.com/questions/50438",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/22431/"
] | Look here:
* [How can I install boot camp off a Windows 7 USB flash drive?](https://apple.stackexchange.com/q/8044/14994)
and here:
* [Install Bootcamp Windows7 off external USB optical drive on Lion system](https://apple.stackexchange.com/q/22890/14994)
Maybe rEFIt will work for you too, but be aware of this:
*... | I have solved this myself on a Mac Pro with 6 internal disks, where I wanted to install BootCamp on a already partitioned disk which isn't the primary disk.
I've made a few notes about it here, but it's rather technical and incomplete: [Install Windows without BootCamp Assistant](http://www.tempel.org/WindowsWithoutBo... |
50,438 | I have a Macbook Pro with an OWC DataDoubler drive caddy replacing the Superdrive (installed at an Apple premium reseller, when I bought it, so I can still have my warranty).
The main drive slot has an SSD, and the Superdrive slot has the original 750GB hard drive. It all works great, and I have Lion installed on the ... | 2012/05/04 | [
"https://apple.stackexchange.com/questions/50438",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/22431/"
] | Look here:
* [How can I install boot camp off a Windows 7 USB flash drive?](https://apple.stackexchange.com/q/8044/14994)
and here:
* [Install Bootcamp Windows7 off external USB optical drive on Lion system](https://apple.stackexchange.com/q/22890/14994)
Maybe rEFIt will work for you too, but be aware of this:
*... | I had this same problem. I used Daemon tools Lite for mac (free) to mount the .iso file and bootcamp let me create the partition, Then I used Winclone 3.5 (not free) to restore an old image I made.
If you don't have an image, you'll have to find a friend with the same model macbook pro you have and see if they will d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.