qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
21,878,924 | I have DB in assets folder i want to copy it in database folder during the installation,
Is there any way to do that?
OR if there aren't way to do that is there a way to make progress bar while the app coping the database after the app launched ?
Edit:
I have problem with database
logcat "shows cannot open file at ... | 2014/02/19 | [
"https://Stackoverflow.com/questions/21878924",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2624525/"
] | This is my DataBaseHelper.java
```
public class DataBaseHelper extends SQLiteOpenHelper {
private static String DB_PATH="data/data/yourPackageName/databases/";
private static final String DB_NAME="yourDbName.db";
private SQLiteDatabase myDatabase;
private final Context myContext;
public DataBaseHelper(Context contex... | >
> it's not my code work fine but i want to coping the database before the app launched not after
>
>
>
That's not possible. None of your code runs before the app is launched for the first time.
>
> OR if there aren't way to do that is there a way to make progress bar while the app coping the database after the... |
38,838,689 | I am trying to learn Node.js. When I download Node.js for Windows, I get the command prompt version for Windows, and I am wondering if there is a way to get a UNIX environment for Node.js in Windows. Most of the tutorials I read and watched just skip over this and I can't find anything on this.
Also, I am having a pro... | 2016/08/08 | [
"https://Stackoverflow.com/questions/38838689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5369935/"
] | I figured it out. I had to use Cygwin for a UNIX environment while using Node.js. Download Cygwin here: <https://www.cygwin.com/>
I didn't have to mess with Environment Variables. | As of the Summer 2016 update to Windows 10, [a Linux shell environment for Windows is available](http://www.zdnet.com/article/ubuntu-and-bash-arrive-on-windows-10/).
* Install Windows 10 version 14316 via Windows Update
* Go to Updates & Security > For Developers > Developer Mode
* Go to Control Panel > Programs and F... |
6,822 | So, when biking, I noticed that when going up hills, it was less tiring if I went up them more quickly. This is not total Work done as is Force \* Distance, as that should be the same.
But the longer one is going uphill, the longer gravity is pulling you backwards. And if you only are providing enough force to counter... | 2011/03/13 | [
"https://physics.stackexchange.com/questions/6822",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/274/"
] | When your going up a hill at a high rate of speed chances are that you started on a horizontal surface going at a high speed and made your way up the hill at a quicker rate so while you are actually going up the hill you are useing the momentum that you got from the above mentioned horizontal surface so it definitely i... | In can help to consider power, the rate of energy use which is not the same in your two cases. This can lead to an understanding of how the same total energy use can result in different levels of 'tiredness'. But as above you also need to take into account biomechanics and recovery time to properly understand the *phys... |
502,214 | We are providing a bulk mail system for a couple of our CRM/B2B customers,
But on one of our smaller runs we got back a number of spam related bounce backs.
I have read that we would need to set up a PTR record on the clients website DNS to point to our server in order to help this, Is there anything else that i can ... | 2013/04/24 | [
"https://serverfault.com/questions/502214",
"https://serverfault.com",
"https://serverfault.com/users/170958/"
] | I lucked out in the case. Upon writing this, the main disk was locked. I removed the VM from inventory and readded it - no good. I vMotioned the VM between hosts and noticed now the main vmdk (OS Drive) wasn't locked, but the ancillary swap drive. I disconnected that and started the VM - good to go. Powered down the VM... | I'm sure this document should be allow you to work through and unlock the file:
<http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=10051>
I'd normally copy and paste relevant parts, but it's a substantial process to go through and diagnose what the issue is and unlock the f... |
9,841,441 | Currently I have this:
```
[SomeCustomAttribute]
public string Name { get; set; }
```
However, I want this attribute to decorate only the setter, not the getter. Is there a way to do that? | 2012/03/23 | [
"https://Stackoverflow.com/questions/9841441",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/328193/"
] | Syntactically, the following is allowed:
```
public string Name { get; [SomeCustomAttribute] set; }
```
The rest is up to (your?) `SomeCustom` Attribute.
It would of course have to be a method attribute, not a property attribute. | ```
public string Name
{
get;
[SomeCustomAttribute]
set;
}
``` |
365,986 | My friend just told me that his teacher, a native speaker, taught him - that *many* and *much* are mainly used in negative sentences and not commonly in affirmative sentences; furthermore, I happened to read [an article](http://www.grammar.cl/Notes/Much_Many_Lot_Few.htm) concerning that matter while searching about it.... | 2016/12/31 | [
"https://english.stackexchange.com/questions/365986",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/91977/"
] | I think your friend forgot to mention that his teacher was probably referring to **much and many VERSUS declarative sentence with LOTS OF and a lot of**. This is what is missing from your context. I am guessing this was what your friend's teacher meant.
Consider these utterances: ***1) I have lots of money but don't h... | In formal affirmative sentences it is quite legitimate to use 'many'.
<http://www.myenglishpages.com/site_php_files/grammar-lesson-many-much.php> |
24,068,609 | I read an answer to a question on SO and someone suggested writing directly into the console. I thought, that sounds cool let's give it a go. I proceeded to make an attempt, but I couldn't figure it out. How do I write/run code directly in the console? I tried in Firebug & Firefox's inspector and I did a little Google ... | 2014/06/05 | [
"https://Stackoverflow.com/questions/24068609",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/731934/"
] | Firebug has two ways to execute some code (and write to the console). These are the [Command Line](https://getfirebug.com/wiki/index.php/Command_Line) at the bottom of the [*Console* panel](https://getfirebug.com/wiki/index.php/Console_Panel):

and the [Comm... | MDN has some example about [Outputting text to the console](https://developer.mozilla.org/en-US/docs/Web/API/console#Outputting_text_to_the_console).
The most simple example is:
`console.log("Hello World!");` Which should show up in the Firefox Console. (There might be some issue if you use Firebug at the same time) |
1,951 | Recently I've seen a couple of questions, specifically [this one](https://math.stackexchange.com/questions/32495/whats-the-answer-to-this-skill-testing-question) and [this one](https://math.stackexchange.com/questions/32549/geometric-series-simple-question), that were relatively low level for what I've seen up to now i... | 2011/04/12 | [
"https://math.meta.stackexchange.com/questions/1951",
"https://math.meta.stackexchange.com",
"https://math.meta.stackexchange.com/users/900/"
] | Mathematics has a reputation of being unwelcoming, unforgiving, hard, and scary among most people. (Especially where I live, the USA.) I find this very unfortunate. On the one hand, laziness is to blame, students, even individuals sometimes don't put in enough time or effort to even come close to understanding even bas... | I agree that we should discourage such questions.
Such questions are actually adding noise to the content we have here. Allowing those would only be detrimental to this site (imagine hundreds of such questions asking to compute an expression which can easily be fed to a calculator).
If they rephrase the question as, ... |
1,951 | Recently I've seen a couple of questions, specifically [this one](https://math.stackexchange.com/questions/32495/whats-the-answer-to-this-skill-testing-question) and [this one](https://math.stackexchange.com/questions/32549/geometric-series-simple-question), that were relatively low level for what I've seen up to now i... | 2011/04/12 | [
"https://math.meta.stackexchange.com/questions/1951",
"https://math.meta.stackexchange.com",
"https://math.meta.stackexchange.com/users/900/"
] | As you say, since its inception, the stated purpose of the site has been "Mathematics - Stack Exchange is for people studying mathematics at any level and professionals in related fields." I don't see any ambiguity or room for interpretation here: to me it seems pretty clear that a question cannot be of too low a level... | I agree that we should discourage such questions.
Such questions are actually adding noise to the content we have here. Allowing those would only be detrimental to this site (imagine hundreds of such questions asking to compute an expression which can easily be fed to a calculator).
If they rephrase the question as, ... |
1,951 | Recently I've seen a couple of questions, specifically [this one](https://math.stackexchange.com/questions/32495/whats-the-answer-to-this-skill-testing-question) and [this one](https://math.stackexchange.com/questions/32549/geometric-series-simple-question), that were relatively low level for what I've seen up to now i... | 2011/04/12 | [
"https://math.meta.stackexchange.com/questions/1951",
"https://math.meta.stackexchange.com",
"https://math.meta.stackexchange.com/users/900/"
] | As you say, since its inception, the stated purpose of the site has been "Mathematics - Stack Exchange is for people studying mathematics at any level and professionals in related fields." I don't see any ambiguity or room for interpretation here: to me it seems pretty clear that a question cannot be of too low a level... | Mathematics has a reputation of being unwelcoming, unforgiving, hard, and scary among most people. (Especially where I live, the USA.) I find this very unfortunate. On the one hand, laziness is to blame, students, even individuals sometimes don't put in enough time or effort to even come close to understanding even bas... |
1,951 | Recently I've seen a couple of questions, specifically [this one](https://math.stackexchange.com/questions/32495/whats-the-answer-to-this-skill-testing-question) and [this one](https://math.stackexchange.com/questions/32549/geometric-series-simple-question), that were relatively low level for what I've seen up to now i... | 2011/04/12 | [
"https://math.meta.stackexchange.com/questions/1951",
"https://math.meta.stackexchange.com",
"https://math.meta.stackexchange.com/users/900/"
] | Mathematics has a reputation of being unwelcoming, unforgiving, hard, and scary among most people. (Especially where I live, the USA.) I find this very unfortunate. On the one hand, laziness is to blame, students, even individuals sometimes don't put in enough time or effort to even come close to understanding even bas... | I'm a computer science undergraduate but I've always found mathematics to be difficult. This year I had a lot more free time (year abroad) and so I've seized the chance go back and study all the way from elementary mathematics up to university-level mathematics. Currently I'm at UK A-level standard, which is just under... |
1,951 | Recently I've seen a couple of questions, specifically [this one](https://math.stackexchange.com/questions/32495/whats-the-answer-to-this-skill-testing-question) and [this one](https://math.stackexchange.com/questions/32549/geometric-series-simple-question), that were relatively low level for what I've seen up to now i... | 2011/04/12 | [
"https://math.meta.stackexchange.com/questions/1951",
"https://math.meta.stackexchange.com",
"https://math.meta.stackexchange.com/users/900/"
] | As you say, since its inception, the stated purpose of the site has been "Mathematics - Stack Exchange is for people studying mathematics at any level and professionals in related fields." I don't see any ambiguity or room for interpretation here: to me it seems pretty clear that a question cannot be of too low a level... | I'm a computer science undergraduate but I've always found mathematics to be difficult. This year I had a lot more free time (year abroad) and so I've seized the chance go back and study all the way from elementary mathematics up to university-level mathematics. Currently I'm at UK A-level standard, which is just under... |
549,020 | I just discovered the imagemap control in Visual Studio 2008.
I'm familiar with the imagemap concept from HTML, I'm just used to having editors that allow you to select areas visually, like drawing a hotspot on the image itself, and the software generates the HTML itself.
But I can't do that in Visual Studio, and I hav... | 2009/02/14 | [
"https://Stackoverflow.com/questions/549020",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/63831/"
] | No, AFAIK there is no designer support for hotspots - I use a piece of paper.
Concerning the code, you'll have to set HotSpotMode="PostBack" PostBackValue="HS1" for each hotspot and use a switch statement in ImageMap1\_Click to react to the different Postback values. | You can capture mouse clicks on the imagemap using jQuery, then pass the `x, y` coordinates of mouseposition to textbox. At the end you can add captured areas to your imagemap. |
56,319,829 | I'm implementing a simple WebAPI in Firebase cloud functions with express by TypeScript.
My code is following.
```
import * as functions from 'firebase-functions';
import * as express from 'express';
const app = express()
app.post('/', (req, res) => {
var resText: string = "NotEmpty"
const text: string = req... | 2019/05/27 | [
"https://Stackoverflow.com/questions/56319829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6458354/"
] | First thing you need to see why req.body.text is null or undefined, then you do the empty check like below.
```
const isEmpty = (str: string): boolean => {
console.log("str: ", str, "+++")
const result = (!str || str.toString().trim() === ""); // converting toString because there chance body.text can be a num... | Just check is `str` is actually empty in `isEmpty`
Add `if(!str) return true` to it.
It will look like this:
```
const isEmpty = (str: string): boolean => {
console.log("str: ", str, "+++")
if(!str) return true;
const trimedStr = str.trim()
const result = (trimedStr === null || trimedStr === "")
co... |
56,319,829 | I'm implementing a simple WebAPI in Firebase cloud functions with express by TypeScript.
My code is following.
```
import * as functions from 'firebase-functions';
import * as express from 'express';
const app = express()
app.post('/', (req, res) => {
var resText: string = "NotEmpty"
const text: string = req... | 2019/05/27 | [
"https://Stackoverflow.com/questions/56319829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6458354/"
] | Your problem is that `isEmpty` is not prepared to receive things that are not a string.
**Quick fix:** set a default value
```js
const isEmpty = (str=''): boolean => {
// code...
}
```
**Better solution**: Validate your data.
While developing any API, you need to validate the entry data to your request.
>
>... | Just check is `str` is actually empty in `isEmpty`
Add `if(!str) return true` to it.
It will look like this:
```
const isEmpty = (str: string): boolean => {
console.log("str: ", str, "+++")
if(!str) return true;
const trimedStr = str.trim()
const result = (trimedStr === null || trimedStr === "")
co... |
56,319,829 | I'm implementing a simple WebAPI in Firebase cloud functions with express by TypeScript.
My code is following.
```
import * as functions from 'firebase-functions';
import * as express from 'express';
const app = express()
app.post('/', (req, res) => {
var resText: string = "NotEmpty"
const text: string = req... | 2019/05/27 | [
"https://Stackoverflow.com/questions/56319829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6458354/"
] | First thing you need to see why req.body.text is null or undefined, then you do the empty check like below.
```
const isEmpty = (str: string): boolean => {
console.log("str: ", str, "+++")
const result = (!str || str.toString().trim() === ""); // converting toString because there chance body.text can be a num... | In JavaScript, a truthy value is a value that is considered true when encountered in a Boolean context. All values are truthy unless they are defined as falsy (i.e., except for false, 0, "", null, undefined, and NaN).
so why can't you use like below ?
```
if (!text) {
resText = "Empty"
}
``` |
56,319,829 | I'm implementing a simple WebAPI in Firebase cloud functions with express by TypeScript.
My code is following.
```
import * as functions from 'firebase-functions';
import * as express from 'express';
const app = express()
app.post('/', (req, res) => {
var resText: string = "NotEmpty"
const text: string = req... | 2019/05/27 | [
"https://Stackoverflow.com/questions/56319829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6458354/"
] | Your problem is that `isEmpty` is not prepared to receive things that are not a string.
**Quick fix:** set a default value
```js
const isEmpty = (str=''): boolean => {
// code...
}
```
**Better solution**: Validate your data.
While developing any API, you need to validate the entry data to your request.
>
>... | In JavaScript, a truthy value is a value that is considered true when encountered in a Boolean context. All values are truthy unless they are defined as falsy (i.e., except for false, 0, "", null, undefined, and NaN).
so why can't you use like below ?
```
if (!text) {
resText = "Empty"
}
``` |
56,319,829 | I'm implementing a simple WebAPI in Firebase cloud functions with express by TypeScript.
My code is following.
```
import * as functions from 'firebase-functions';
import * as express from 'express';
const app = express()
app.post('/', (req, res) => {
var resText: string = "NotEmpty"
const text: string = req... | 2019/05/27 | [
"https://Stackoverflow.com/questions/56319829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6458354/"
] | Your problem is that `isEmpty` is not prepared to receive things that are not a string.
**Quick fix:** set a default value
```js
const isEmpty = (str=''): boolean => {
// code...
}
```
**Better solution**: Validate your data.
While developing any API, you need to validate the entry data to your request.
>
>... | First thing you need to see why req.body.text is null or undefined, then you do the empty check like below.
```
const isEmpty = (str: string): boolean => {
console.log("str: ", str, "+++")
const result = (!str || str.toString().trim() === ""); // converting toString because there chance body.text can be a num... |
16,597,173 | I am using jquery.datetime that inputs a date as a string into simpleform. It is supplying the date as %d %m %Y which is what I want but I am getting %m %d %Y because that is apparently the default for Simple Form:
The solution which is the same as for jquery datepicker is to add a custom input:
```
class DatePickerI... | 2013/05/16 | [
"https://Stackoverflow.com/questions/16597173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/434502/"
] | Assuming you want to find out whether an object is an instance of a custom constructor function, you can just compare its prototype against `Object.prototype`:
```
function hasUserPrototype(obj) {
return Object.getPrototypeOf(obj) !== Object.prototype;
}
```
Or if you maintain the `constructor` property properly... | For A object prototype will be undefined:
```
typeof A.prototype == "undefined" // true
typeof B.prototype == "undefined" // false
``` |
16,597,173 | I am using jquery.datetime that inputs a date as a string into simpleform. It is supplying the date as %d %m %Y which is what I want but I am getting %m %d %Y because that is apparently the default for Simple Form:
The solution which is the same as for jquery datepicker is to add a custom input:
```
class DatePickerI... | 2013/05/16 | [
"https://Stackoverflow.com/questions/16597173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/434502/"
] | Felix King accurately addressed the issue of inheritance, so I will address the concept of existing properties instead
If you're simply trying to check for the presence of a property named `prototype` on an object, you can use:
```
a.hasOwnProperty('prototype')
```
This will return true for:
```
a = {
//the ob... | For A object prototype will be undefined:
```
typeof A.prototype == "undefined" // true
typeof B.prototype == "undefined" // false
``` |
16,597,173 | I am using jquery.datetime that inputs a date as a string into simpleform. It is supplying the date as %d %m %Y which is what I want but I am getting %m %d %Y because that is apparently the default for Simple Form:
The solution which is the same as for jquery datepicker is to add a custom input:
```
class DatePickerI... | 2013/05/16 | [
"https://Stackoverflow.com/questions/16597173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/434502/"
] | Assuming you want to find out whether an object is an instance of a custom constructor function, you can just compare its prototype against `Object.prototype`:
```
function hasUserPrototype(obj) {
return Object.getPrototypeOf(obj) !== Object.prototype;
}
```
Or if you maintain the `constructor` property properly... | Felix King accurately addressed the issue of inheritance, so I will address the concept of existing properties instead
If you're simply trying to check for the presence of a property named `prototype` on an object, you can use:
```
a.hasOwnProperty('prototype')
```
This will return true for:
```
a = {
//the ob... |
20,377,917 | I have a problem understanding this piece of code:
```
int[] it = new int[][]{{1}}[0];
```
Why is it compileable, and how can I understand such a declaration? | 2013/12/04 | [
"https://Stackoverflow.com/questions/20377917",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2654250/"
] | What you are doing here is:
1. Declaring a new variable `int[] it` (which is a one-dimensional array)
2. Assigning its value from the first element `[0]`
3. of the two-dimensional array `new int[][]`
4. which is initialized to be `{{1}}`
So you create a two-dimensional array which you initialize to contain an array w... | The `new int[][]{{1}}` allocates a new 1x1 2D array. The (only) element is set to 1.
The `[0]` returns a reference to the first (and the only) row, which is of type `int[]`.
The `int[] it = ...` declares a variable and initializes it with the above reference.
The end result is equivalent to `int[] it = new int[]{1}`... |
20,377,917 | I have a problem understanding this piece of code:
```
int[] it = new int[][]{{1}}[0];
```
Why is it compileable, and how can I understand such a declaration? | 2013/12/04 | [
"https://Stackoverflow.com/questions/20377917",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2654250/"
] | What you are doing here is:
1. Declaring a new variable `int[] it` (which is a one-dimensional array)
2. Assigning its value from the first element `[0]`
3. of the two-dimensional array `new int[][]`
4. which is initialized to be `{{1}}`
So you create a two-dimensional array which you initialize to contain an array w... | ```
int[] it = new int[][]{{1}}[0];
```
The integer array `it` gets assigned the following:
```
new int[][] // A new 2D array is created
{{1}} // This is an initializer. The first array in the first array gets an array of 1 item: '1'
[0] // Take the first array from the 2D array
``` |
20,377,917 | I have a problem understanding this piece of code:
```
int[] it = new int[][]{{1}}[0];
```
Why is it compileable, and how can I understand such a declaration? | 2013/12/04 | [
"https://Stackoverflow.com/questions/20377917",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2654250/"
] | What you are doing here is:
1. Declaring a new variable `int[] it` (which is a one-dimensional array)
2. Assigning its value from the first element `[0]`
3. of the two-dimensional array `new int[][]`
4. which is initialized to be `{{1}}`
So you create a two-dimensional array which you initialize to contain an array w... | ```
int[] it = new int[][]{{1}}[0];
```
Let's break this one down into each stage, and what it means.
```
new int[][]
```
This is a new multidimensional array.
```
{{1}}
```
This is a multidimensional array literal. It makes an array that looks like this:
```
[0] = [1]
[1] = []
[2] = []
...
[N] = []
```
So... |
20,377,917 | I have a problem understanding this piece of code:
```
int[] it = new int[][]{{1}}[0];
```
Why is it compileable, and how can I understand such a declaration? | 2013/12/04 | [
"https://Stackoverflow.com/questions/20377917",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2654250/"
] | What you are doing here is:
1. Declaring a new variable `int[] it` (which is a one-dimensional array)
2. Assigning its value from the first element `[0]`
3. of the two-dimensional array `new int[][]`
4. which is initialized to be `{{1}}`
So you create a two-dimensional array which you initialize to contain an array w... | Essentially, you are creating an anonymous two-dimensional array (`new int[][]{{1}}`) and then taking the first element of that two-dimensional array (`{1}`) and assigning it to the variable `it`.
Let's go step-by-step, because this actually is kind of confusing.
`new int[][]{{1}}`: This creates a two-dimensional arr... |
20,377,917 | I have a problem understanding this piece of code:
```
int[] it = new int[][]{{1}}[0];
```
Why is it compileable, and how can I understand such a declaration? | 2013/12/04 | [
"https://Stackoverflow.com/questions/20377917",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2654250/"
] | What you are doing here is:
1. Declaring a new variable `int[] it` (which is a one-dimensional array)
2. Assigning its value from the first element `[0]`
3. of the two-dimensional array `new int[][]`
4. which is initialized to be `{{1}}`
So you create a two-dimensional array which you initialize to contain an array w... | I will try to break it down
```
new int[][] // an array of arrays (or 2-dimensional array)
{1} // an array instance with a single element: 1
{{1}} // an array instance with a single element: above array instance
[0] // the first element of an array
```
So it is roughly equivalent to the following code:
```
int[] in... |
20,377,917 | I have a problem understanding this piece of code:
```
int[] it = new int[][]{{1}}[0];
```
Why is it compileable, and how can I understand such a declaration? | 2013/12/04 | [
"https://Stackoverflow.com/questions/20377917",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2654250/"
] | ```
int[] it = new int[][]{{1}}[0];
```
Let's break this one down into each stage, and what it means.
```
new int[][]
```
This is a new multidimensional array.
```
{{1}}
```
This is a multidimensional array literal. It makes an array that looks like this:
```
[0] = [1]
[1] = []
[2] = []
...
[N] = []
```
So... | The `new int[][]{{1}}` allocates a new 1x1 2D array. The (only) element is set to 1.
The `[0]` returns a reference to the first (and the only) row, which is of type `int[]`.
The `int[] it = ...` declares a variable and initializes it with the above reference.
The end result is equivalent to `int[] it = new int[]{1}`... |
20,377,917 | I have a problem understanding this piece of code:
```
int[] it = new int[][]{{1}}[0];
```
Why is it compileable, and how can I understand such a declaration? | 2013/12/04 | [
"https://Stackoverflow.com/questions/20377917",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2654250/"
] | ```
int[] it = new int[][]{{1}}[0];
```
Let's break this one down into each stage, and what it means.
```
new int[][]
```
This is a new multidimensional array.
```
{{1}}
```
This is a multidimensional array literal. It makes an array that looks like this:
```
[0] = [1]
[1] = []
[2] = []
...
[N] = []
```
So... | ```
int[] it = new int[][]{{1}}[0];
```
The integer array `it` gets assigned the following:
```
new int[][] // A new 2D array is created
{{1}} // This is an initializer. The first array in the first array gets an array of 1 item: '1'
[0] // Take the first array from the 2D array
``` |
20,377,917 | I have a problem understanding this piece of code:
```
int[] it = new int[][]{{1}}[0];
```
Why is it compileable, and how can I understand such a declaration? | 2013/12/04 | [
"https://Stackoverflow.com/questions/20377917",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2654250/"
] | ```
int[] it = new int[][]{{1}}[0];
```
Let's break this one down into each stage, and what it means.
```
new int[][]
```
This is a new multidimensional array.
```
{{1}}
```
This is a multidimensional array literal. It makes an array that looks like this:
```
[0] = [1]
[1] = []
[2] = []
...
[N] = []
```
So... | Essentially, you are creating an anonymous two-dimensional array (`new int[][]{{1}}`) and then taking the first element of that two-dimensional array (`{1}`) and assigning it to the variable `it`.
Let's go step-by-step, because this actually is kind of confusing.
`new int[][]{{1}}`: This creates a two-dimensional arr... |
20,377,917 | I have a problem understanding this piece of code:
```
int[] it = new int[][]{{1}}[0];
```
Why is it compileable, and how can I understand such a declaration? | 2013/12/04 | [
"https://Stackoverflow.com/questions/20377917",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2654250/"
] | ```
int[] it = new int[][]{{1}}[0];
```
Let's break this one down into each stage, and what it means.
```
new int[][]
```
This is a new multidimensional array.
```
{{1}}
```
This is a multidimensional array literal. It makes an array that looks like this:
```
[0] = [1]
[1] = []
[2] = []
...
[N] = []
```
So... | I will try to break it down
```
new int[][] // an array of arrays (or 2-dimensional array)
{1} // an array instance with a single element: 1
{{1}} // an array instance with a single element: above array instance
[0] // the first element of an array
```
So it is roughly equivalent to the following code:
```
int[] in... |
27,744 | How can I show the Users Profile Picture on a Civicrm Form please (in joomla)?
Thanks a lot,
Sri | 2018/12/17 | [
"https://civicrm.stackexchange.com/questions/27744",
"https://civicrm.stackexchange.com",
"https://civicrm.stackexchange.com/users/5859/"
] | Jonathan, Welcome to CiviCRM stackexchange.
Sometimes its not possible to change custom group's used for since the CiviCRM creates a separate table for this with a Foreign key. However its possible to update if the 'Used for' share the same table.
In your case you want to make it visible for Individual subtype then... | I don't think you can change what the field is "used for" but you could use search builder to find all individuals where the field is non-null and then export these records. Then you can import the data for those contacts mapping to the new field that is "used for" a contact. Be careful not to overwrite any other data! |
6,880,485 | I am developing a Rails web application and am confused about how to utilize the lookup table values in my models. Here is an example model from my app:
```
table name: donations
id
amount
note
user_id
appeal_id
donation_status_id
donation_type_id
is_anonymous
created_at
updated_at
```
The fields \*donation\_status... | 2011/07/30 | [
"https://Stackoverflow.com/questions/6880485",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/63/"
] | How about putting it in a constant? For example, something like this:
```
class DonationStatus < ActiveRecord::Base
COMPLETED_DONATION_ID = DonationStatus.find_by_name("completed").id
PENDING_DONATION_ID = DonationStatus.find_by_name("pending").id
# ...
end
class DonationsController < ApplicationController
... | What you could do is add this method to `Donation`:
```
# Donation.rb
def completed?
self.donation_status.name == 'completed' ? true : false
end
```
And then just do `my_donation.completed?`. If this is called a second time, Rails will look to cache instead of going to the DB.
You could add memcached if you wan... |
6,880,485 | I am developing a Rails web application and am confused about how to utilize the lookup table values in my models. Here is an example model from my app:
```
table name: donations
id
amount
note
user_id
appeal_id
donation_status_id
donation_type_id
is_anonymous
created_at
updated_at
```
The fields \*donation\_status... | 2011/07/30 | [
"https://Stackoverflow.com/questions/6880485",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/63/"
] | Since you have two models, you should use ActiveRecord Model Associations when building the models.
```
class Donation
has_one :donation_status
end
class DonationStatus
belongs_to :donation
end
```
Then when you do
```
my_donation = Donation.find(params[:id])
if my_donation.donation_status.status_name == 'comp... | What you could do is add this method to `Donation`:
```
# Donation.rb
def completed?
self.donation_status.name == 'completed' ? true : false
end
```
And then just do `my_donation.completed?`. If this is called a second time, Rails will look to cache instead of going to the DB.
You could add memcached if you wan... |
6,880,485 | I am developing a Rails web application and am confused about how to utilize the lookup table values in my models. Here is an example model from my app:
```
table name: donations
id
amount
note
user_id
appeal_id
donation_status_id
donation_type_id
is_anonymous
created_at
updated_at
```
The fields \*donation\_status... | 2011/07/30 | [
"https://Stackoverflow.com/questions/6880485",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/63/"
] | Since you have two models, you should use ActiveRecord Model Associations when building the models.
```
class Donation
has_one :donation_status
end
class DonationStatus
belongs_to :donation
end
```
Then when you do
```
my_donation = Donation.find(params[:id])
if my_donation.donation_status.status_name == 'comp... | How about putting it in a constant? For example, something like this:
```
class DonationStatus < ActiveRecord::Base
COMPLETED_DONATION_ID = DonationStatus.find_by_name("completed").id
PENDING_DONATION_ID = DonationStatus.find_by_name("pending").id
# ...
end
class DonationsController < ApplicationController
... |
42,532,857 | I would like to have all numbers in a macro displayed with point and not coma
For Instance This display "0,03" but I would like "0.03":
```
Dim MyNumber As Single
MyNumber = 0.03
MsgBox (MyNumber)
```
I have tried a set of codes that does ***not*** work:
* this still displays the Coma:
```
Application.DecimalSepa... | 2017/03/01 | [
"https://Stackoverflow.com/questions/42532857",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7430332/"
] | This is easier said than done. In the VBA editor, the decimal separator is the dot. However, the MsgBox function (and the Format function) will use the windows regional settings, and not the Excel settings, to format its results.
In order to have the MsgBox display a number using format settings of your choice, you ne... | Most likely your Excel settings are causing a conflict.
```
1. On the File tab, click the Options button
2. Click the Advanced tab
3. Clear/Uncheck the "Use system separators" option.
```
Then try your code. |
42,532,857 | I would like to have all numbers in a macro displayed with point and not coma
For Instance This display "0,03" but I would like "0.03":
```
Dim MyNumber As Single
MyNumber = 0.03
MsgBox (MyNumber)
```
I have tried a set of codes that does ***not*** work:
* this still displays the Coma:
```
Application.DecimalSepa... | 2017/03/01 | [
"https://Stackoverflow.com/questions/42532857",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7430332/"
] | As a first step, the three functions bellows from Kernel32 Dynamic-link library have to be declared:
```
Private Declare Function GetUserDefaultLCID% Lib "kernel32" ()
Private Declare Function GetLocaleInfoA Lib "kernel32" (ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String, ByVal cchData As Long) As... | Most likely your Excel settings are causing a conflict.
```
1. On the File tab, click the Options button
2. Click the Advanced tab
3. Clear/Uncheck the "Use system separators" option.
```
Then try your code. |
42,532,857 | I would like to have all numbers in a macro displayed with point and not coma
For Instance This display "0,03" but I would like "0.03":
```
Dim MyNumber As Single
MyNumber = 0.03
MsgBox (MyNumber)
```
I have tried a set of codes that does ***not*** work:
* this still displays the Coma:
```
Application.DecimalSepa... | 2017/03/01 | [
"https://Stackoverflow.com/questions/42532857",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7430332/"
] | I noticed this today, too.
Specifically, with the `FormatNumber` function.
Because I don't want to take @Jonathan's (very interesting) approach and change my f[lipp]ing system settings just to have power over how numbers are displayed (Seriously, Office, what is wrong with you??), I wrote a wrapper function to make ... | Most likely your Excel settings are causing a conflict.
```
1. On the File tab, click the Options button
2. Click the Advanced tab
3. Clear/Uncheck the "Use system separators" option.
```
Then try your code. |
42,532,857 | I would like to have all numbers in a macro displayed with point and not coma
For Instance This display "0,03" but I would like "0.03":
```
Dim MyNumber As Single
MyNumber = 0.03
MsgBox (MyNumber)
```
I have tried a set of codes that does ***not*** work:
* this still displays the Coma:
```
Application.DecimalSepa... | 2017/03/01 | [
"https://Stackoverflow.com/questions/42532857",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7430332/"
] | This is easier said than done. In the VBA editor, the decimal separator is the dot. However, the MsgBox function (and the Format function) will use the windows regional settings, and not the Excel settings, to format its results.
In order to have the MsgBox display a number using format settings of your choice, you ne... | As a first step, the three functions bellows from Kernel32 Dynamic-link library have to be declared:
```
Private Declare Function GetUserDefaultLCID% Lib "kernel32" ()
Private Declare Function GetLocaleInfoA Lib "kernel32" (ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String, ByVal cchData As Long) As... |
42,532,857 | I would like to have all numbers in a macro displayed with point and not coma
For Instance This display "0,03" but I would like "0.03":
```
Dim MyNumber As Single
MyNumber = 0.03
MsgBox (MyNumber)
```
I have tried a set of codes that does ***not*** work:
* this still displays the Coma:
```
Application.DecimalSepa... | 2017/03/01 | [
"https://Stackoverflow.com/questions/42532857",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7430332/"
] | This is easier said than done. In the VBA editor, the decimal separator is the dot. However, the MsgBox function (and the Format function) will use the windows regional settings, and not the Excel settings, to format its results.
In order to have the MsgBox display a number using format settings of your choice, you ne... | I noticed this today, too.
Specifically, with the `FormatNumber` function.
Because I don't want to take @Jonathan's (very interesting) approach and change my f[lipp]ing system settings just to have power over how numbers are displayed (Seriously, Office, what is wrong with you??), I wrote a wrapper function to make ... |
42,532,857 | I would like to have all numbers in a macro displayed with point and not coma
For Instance This display "0,03" but I would like "0.03":
```
Dim MyNumber As Single
MyNumber = 0.03
MsgBox (MyNumber)
```
I have tried a set of codes that does ***not*** work:
* this still displays the Coma:
```
Application.DecimalSepa... | 2017/03/01 | [
"https://Stackoverflow.com/questions/42532857",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7430332/"
] | As a first step, the three functions bellows from Kernel32 Dynamic-link library have to be declared:
```
Private Declare Function GetUserDefaultLCID% Lib "kernel32" ()
Private Declare Function GetLocaleInfoA Lib "kernel32" (ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String, ByVal cchData As Long) As... | I noticed this today, too.
Specifically, with the `FormatNumber` function.
Because I don't want to take @Jonathan's (very interesting) approach and change my f[lipp]ing system settings just to have power over how numbers are displayed (Seriously, Office, what is wrong with you??), I wrote a wrapper function to make ... |
55,522,508 | I am new to XML. I am trying to read an XML node that has an unknown number of children, all with the same name. The parent and children each have a value. I want to place the value in to a list of strings, in the same order as the nodes.
Reading the data reads all of the nodes, including the childrens, inner text and... | 2019/04/04 | [
"https://Stackoverflow.com/questions/55522508",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | If you want to create a unique version for each combination of three, the simplest way is to explicitly show each component:
```
a - 1.0.3
b - 2.1.0
c - 1.1.1
mainprog-a1.0.3-b2.1.0-c1.1.1
```
This helps you identify each individual component that make up the whole. That's a bit long, so alternative you could hash ... | The numbers would become quite large, but one solution is to sum the individual components:
```
a - 1.0.3
b - 2.1.0
c - 1.1.1
result - (1+2+1).(0+1+1).(3+0+1)
result - 4.2.4
``` |
250,008 | We recently encountered PFS page corruption in our production DB. We are in the process of checking old backups to find which ones are clean, but I was wondering if a different process would work to shorten the time needed to fix this issue. So far we have not encountered any client issues, and the DB remains usable,... | 2019/10/01 | [
"https://dba.stackexchange.com/questions/250008",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/123982/"
] | It appears that your database data file has empty space.
If you know for sure that the data file will **not** grow out again, you could shrink the file.
If you have to shrink, the cleanest way is doing this with `TRUNCATEONLY` so you don't move any data pages and only release the space back to the OS **if** it is p... | You can use a script something like this to find tables and their sizes:
```
SELECT name = OBJECT_SCHEMA_NAME(object_id) + '.' + OBJECT_NAME(object_id),
rows = SUM(CASE
WHEN index_id < 2
THEN row_count
ELSE 0
END),
re... |
250,008 | We recently encountered PFS page corruption in our production DB. We are in the process of checking old backups to find which ones are clean, but I was wondering if a different process would work to shorten the time needed to fix this issue. So far we have not encountered any client issues, and the DB remains usable,... | 2019/10/01 | [
"https://dba.stackexchange.com/questions/250008",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/123982/"
] | It appears that your database data file has empty space.
If you know for sure that the data file will **not** grow out again, you could shrink the file.
If you have to shrink, the cleanest way is doing this with `TRUNCATEONLY` so you don't move any data pages and only release the space back to the OS **if** it is p... | The fastest and simplest way is using a standard report.
Right click on the database:
[](https://i.stack.imgur.com/B9M4a.png) |
14,967 | Well, the title is pretty much self-explanatory. What happened to him? Did he die from being used as a fertilizer for the white Zetsus? Or he's alive, like Mitarashi Anko is? | 2014/11/09 | [
"https://anime.stackexchange.com/questions/14967",
"https://anime.stackexchange.com",
"https://anime.stackexchange.com/users/7866/"
] | He survived. In 699 you see him emerge from the Infinite Tsukuyomi. Spiral zetsu is near him and tries to grab him again, but the zetsu quickly falls apart (presumably it died).
You don't see him anywhere in 700, though. So it's unknown if he lived to that point or what he did after the IT was dispelled. | he survived..
naruto gaiden the seventh hokage episode 7 page 8
 |
37,204,062 | I have to use Left outer join, i am confused to find the logic why I choose 1 table in left and another in right, is there a reason behind it?
For eg. I can guess left table should be one which having NULL value in joining column | 2016/05/13 | [
"https://Stackoverflow.com/questions/37204062",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6229916/"
] | Hi instead of `background-image` use `mask-image` and then change the `background-color` color on hover... kindly check <https://jsfiddle.net/RRR0308/v3n0g8zt/1/>
**HTML**
```
<a href="javascript:void(0)">
<div class="img-smiley">
</div>
</a>
```
**CSS**
```
.img-smiley
{
background-color: r... | The current color of the image is something that's embedded inside the image's encoding and something that CSS can't know anything about, so in order to change it you need another base64 image and set it as the background.
Assuming the green base64 green image in base64 is `data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPS... |
37,204,062 | I have to use Left outer join, i am confused to find the logic why I choose 1 table in left and another in right, is there a reason behind it?
For eg. I can guess left table should be one which having NULL value in joining column | 2016/05/13 | [
"https://Stackoverflow.com/questions/37204062",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6229916/"
] | The current color of the image is something that's embedded inside the image's encoding and something that CSS can't know anything about, so in order to change it you need another base64 image and set it as the background.
Assuming the green base64 green image in base64 is `data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPS... | **Firstly** you have to encode your SVG html tag or SVG image in the base 64 format. Here is the [link](https://base64.guru/converter/encode/image/svg) to convert from SVG to base 64.
**Next** you have to set your encoded base64 to the background-image property.
**For ex:**
```
background-image: url("data:image/sv... |
37,204,062 | I have to use Left outer join, i am confused to find the logic why I choose 1 table in left and another in right, is there a reason behind it?
For eg. I can guess left table should be one which having NULL value in joining column | 2016/05/13 | [
"https://Stackoverflow.com/questions/37204062",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6229916/"
] | Hi instead of `background-image` use `mask-image` and then change the `background-color` color on hover... kindly check <https://jsfiddle.net/RRR0308/v3n0g8zt/1/>
**HTML**
```
<a href="javascript:void(0)">
<div class="img-smiley">
</div>
</a>
```
**CSS**
```
.img-smiley
{
background-color: r... | **Firstly** you have to encode your SVG html tag or SVG image in the base 64 format. Here is the [link](https://base64.guru/converter/encode/image/svg) to convert from SVG to base 64.
**Next** you have to set your encoded base64 to the background-image property.
**For ex:**
```
background-image: url("data:image/sv... |
55,264,641 | I have a website using a parallax theme that has not been updated in a while, but I don't have a child theme for it so I can't update the theme itself.
In the latest versions of Chrome, the JavaScript/navigation bar tabs do not perform the expected parallax actions/scrolling.
I assume this is likely a change to Chrom... | 2019/03/20 | [
"https://Stackoverflow.com/questions/55264641",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/60264/"
] | It seems theme use old version or jquery.nav.js and SmoothScroll.js jQuery and it create issue with latest Google Chrome so please update those two css from below repo then it will fine in your setup.
**File Location:**
/wp-content/themes/accesspress-parallax/js/SmoothScroll.js
/wp-content/themes/accesspress-paral... | First you could only update jquery to see if the problem persist. If so, I would use the following quick fix:
.css file:
```
html {
scroll-behavior: smooth;
}
```
And in html i would comment out (disable) your smooth scroll plugin. Leave the links as they are, just make sure that preventDefault is not called.
`... |
55,264,641 | I have a website using a parallax theme that has not been updated in a while, but I don't have a child theme for it so I can't update the theme itself.
In the latest versions of Chrome, the JavaScript/navigation bar tabs do not perform the expected parallax actions/scrolling.
I assume this is likely a change to Chrom... | 2019/03/20 | [
"https://Stackoverflow.com/questions/55264641",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/60264/"
] | First you could only update jquery to see if the problem persist. If so, I would use the following quick fix:
.css file:
```
html {
scroll-behavior: smooth;
}
```
And in html i would comment out (disable) your smooth scroll plugin. Leave the links as they are, just make sure that preventDefault is not called.
`... | If you have a look in the dev console you can see the error message is coming from `SmoothScroll.js`. Chrome has introduced a [restriction on scrolling event listeners](https://www.chromestatus.com/features/6662647093133312), where unless they are specifically called as non-passive.
You'll need to update the event lis... |
55,264,641 | I have a website using a parallax theme that has not been updated in a while, but I don't have a child theme for it so I can't update the theme itself.
In the latest versions of Chrome, the JavaScript/navigation bar tabs do not perform the expected parallax actions/scrolling.
I assume this is likely a change to Chrom... | 2019/03/20 | [
"https://Stackoverflow.com/questions/55264641",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/60264/"
] | It seems theme use old version or jquery.nav.js and SmoothScroll.js jQuery and it create issue with latest Google Chrome so please update those two css from below repo then it will fine in your setup.
**File Location:**
/wp-content/themes/accesspress-parallax/js/SmoothScroll.js
/wp-content/themes/accesspress-paral... | If you have a look in the dev console you can see the error message is coming from `SmoothScroll.js`. Chrome has introduced a [restriction on scrolling event listeners](https://www.chromestatus.com/features/6662647093133312), where unless they are specifically called as non-passive.
You'll need to update the event lis... |
6,710,521 | As the topic suggests I have some problems with PropertyInfo.SetValue. To get to the point, here is my example - I have created my own class and the main thing about it is the presentation object:
```
using System;
using System.Reflection;
namespace TestingSetValue
{
public class Link
{
private object presentatio... | 2011/07/15 | [
"https://Stackoverflow.com/questions/6710521",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/846833/"
] | Why not a simple string replace?
```
private string Fix(string uri)
{
var fileName = Path.GetFileNameWithoutExtension(uri);
var extension = Path.GetExtension(uri);
return uri.Replace(string.Format("{0}{1}", fileName, extension), string.Format("{0}_fixed{1}", fileName, extension));
}
```
This would only ... | How about some Regular Expression like
```
\b[a-zA-Z0-9]+\.[a-zA-Z0-9]+$
```
This should find all endings of `file` followed by an extension.
Next, if you capture the `file`...
```
\b([a-zA-Z0-9]+)(\.[a-zA-Z0-9]+)$
```
...you then can [replace](http://msdn.microsoft.com/en-us/library/system.text.regularexpressio... |
6,710,521 | As the topic suggests I have some problems with PropertyInfo.SetValue. To get to the point, here is my example - I have created my own class and the main thing about it is the presentation object:
```
using System;
using System.Reflection;
namespace TestingSetValue
{
public class Link
{
private object presentatio... | 2011/07/15 | [
"https://Stackoverflow.com/questions/6710521",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/846833/"
] | No regular expressions, no string indexes.
Just using .NET `Path` methods to retreive, and reassemble, a new filename:
```
/// <summary>
/// Partner to Path.ChangeExtension. This function changes the base filename portion
/// </summary>
/// <param name="path"></param>
/// <param name="newFilename"></param>
/// <retur... | How about some Regular Expression like
```
\b[a-zA-Z0-9]+\.[a-zA-Z0-9]+$
```
This should find all endings of `file` followed by an extension.
Next, if you capture the `file`...
```
\b([a-zA-Z0-9]+)(\.[a-zA-Z0-9]+)$
```
...you then can [replace](http://msdn.microsoft.com/en-us/library/system.text.regularexpressio... |
6,710,521 | As the topic suggests I have some problems with PropertyInfo.SetValue. To get to the point, here is my example - I have created my own class and the main thing about it is the presentation object:
```
using System;
using System.Reflection;
namespace TestingSetValue
{
public class Link
{
private object presentatio... | 2011/07/15 | [
"https://Stackoverflow.com/questions/6710521",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/846833/"
] | Why not a simple string replace?
```
private string Fix(string uri)
{
var fileName = Path.GetFileNameWithoutExtension(uri);
var extension = Path.GetExtension(uri);
return uri.Replace(string.Format("{0}{1}", fileName, extension), string.Format("{0}_fixed{1}", fileName, extension));
}
```
This would only ... | I've wrapped the working solution into a utility method. Should be some help to others.
```
/// <summary>
/// Changes the file name of the <paramref name="uri"/> using the given <paramref name="modifier"/>
/// </summary>
/// <param name="uri">A relative or absolute uri</param>
/// <param name="modi... |
6,710,521 | As the topic suggests I have some problems with PropertyInfo.SetValue. To get to the point, here is my example - I have created my own class and the main thing about it is the presentation object:
```
using System;
using System.Reflection;
namespace TestingSetValue
{
public class Link
{
private object presentatio... | 2011/07/15 | [
"https://Stackoverflow.com/questions/6710521",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/846833/"
] | Why not a simple string replace?
```
private string Fix(string uri)
{
var fileName = Path.GetFileNameWithoutExtension(uri);
var extension = Path.GetExtension(uri);
return uri.Replace(string.Format("{0}{1}", fileName, extension), string.Format("{0}_fixed{1}", fileName, extension));
}
```
This would only ... | No regular expressions, no string indexes.
Just using .NET `Path` methods to retreive, and reassemble, a new filename:
```
/// <summary>
/// Partner to Path.ChangeExtension. This function changes the base filename portion
/// </summary>
/// <param name="path"></param>
/// <param name="newFilename"></param>
/// <retur... |
6,710,521 | As the topic suggests I have some problems with PropertyInfo.SetValue. To get to the point, here is my example - I have created my own class and the main thing about it is the presentation object:
```
using System;
using System.Reflection;
namespace TestingSetValue
{
public class Link
{
private object presentatio... | 2011/07/15 | [
"https://Stackoverflow.com/questions/6710521",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/846833/"
] | No regular expressions, no string indexes.
Just using .NET `Path` methods to retreive, and reassemble, a new filename:
```
/// <summary>
/// Partner to Path.ChangeExtension. This function changes the base filename portion
/// </summary>
/// <param name="path"></param>
/// <param name="newFilename"></param>
/// <retur... | I've wrapped the working solution into a utility method. Should be some help to others.
```
/// <summary>
/// Changes the file name of the <paramref name="uri"/> using the given <paramref name="modifier"/>
/// </summary>
/// <param name="uri">A relative or absolute uri</param>
/// <param name="modi... |
104,076 | I have a new beautiful Samsung refrigerator. Black Stainless. The Door handle screw holes are stripped. We can only screw in the handle mounts about halfway. It seems to be aluminum or metal. Would you suggest I just drill out the threads and use JB weld?
Thanks so much | 2016/12/08 | [
"https://diy.stackexchange.com/questions/104076",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/63631/"
] | Take the bolt to the hardware store, figure out the thread size by screwing it into nuts until you find one that fits. Then go over to the aisle with taps and dies and buy a tap that matches that thread size.
You'll want to screw that tap into the hole until you meet resistance.
At the point where you find resistan... | The solution to this used to be called "Helicoils." Now, you can find them as "Threadserts" or just thread inserts. Measure the hole, get the closest insert you can find. They usually come with the right drill bit and screws, but you can just get the ones to match at a hardware store. Use a cordless drill with the corr... |
104,076 | I have a new beautiful Samsung refrigerator. Black Stainless. The Door handle screw holes are stripped. We can only screw in the handle mounts about halfway. It seems to be aluminum or metal. Would you suggest I just drill out the threads and use JB weld?
Thanks so much | 2016/12/08 | [
"https://diy.stackexchange.com/questions/104076",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/63631/"
] | Take the bolt to the hardware store, figure out the thread size by screwing it into nuts until you find one that fits. Then go over to the aisle with taps and dies and buy a tap that matches that thread size.
You'll want to screw that tap into the hole until you meet resistance.
At the point where you find resistan... | If it is a hole in the sheet metal fridge exterior, you may want to inject something like liquid nails, let it cure, then drill out with a bit smaller than the screw threads and screw it in to the hole. |
3,706,029 | I'm going to write and test a bootloader. In order to do this, I am planning to copy the bootloader onto a floppy image file and mount it in a VM.
However, I'm not sure where to put the bootloader's machine code. Does it just get dumped into the first few bytes of the file? | 2010/09/14 | [
"https://Stackoverflow.com/questions/3706029",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/193619/"
] | The boot sector of the floppy was the first sector. If you're talking about a raw floppy image (1440K), it should be the first 512 bytes of the image file.
From memory, this gets loaded by the BIOS into 7c00:0000 (real mode) and then jumps to that address.
The DOS boot floppies had a 3-byte `JMP` instruction there to... | its been a VERY long time but if i recall in DOS it was stored in the MBR. i believe its still the same today
<http://en.wikipedia.org/wiki/Master_boot_record> |
11,377,464 | My site had worked great untill I updated its php version to 5.4.4 (I also tryed 5.3), I can't continue using php v5.2 because I have added some function that are not supported in 5.2 version.
I work on a windows server. | 2012/07/07 | [
"https://Stackoverflow.com/questions/11377464",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1361042/"
] | Profile your PHP with xdebug.
You can see [PROFILING PHP WITH XDEBUG AND WEBGRIND](http://www.chrisabernethy.com/php-profiling-xdebug-webgrind/), the main parser of xdebug files (kcachegrind) is native for Linux.
An alternative is [windows port of kcachegrind](http://precompiledbin.sourceforge.net/), but I never trie... | XHProf is another simple tool for Profiling
It's very simple to use and configure. |
6,855,452 | surely this question has beed debated thousand of time, but I do not find any suitable solution to my need. I am new to SilverLIght and I intended to start well using MVVM.
therefore I did the following view model :
```
public class MyViewModel
{
private IRepository _Repository;
public string ... | 2011/07/28 | [
"https://Stackoverflow.com/questions/6855452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/259240/"
] | Implement the [INotifyPropertyChanged](http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged.aspx) and notify that your property has changed with the EventHandler.
```
public class MyViewModel : INotifyPropertyChanged
{
private string countText;
public string CountText
... | As far as I know you do need a mechanism like PropertyChanged in your viewmodel |
15,311,112 | I have searched and searched but i'm unable to find the solution yet.
I'm trying to load data into Highcharts with json from my server.
This is the json returned from my server:
```
[{
"x": "\/Date(1352674800000)\/",
"y": 621
}, {
"x": "\/Date(1352761200000)\/",
"y": 646
}, {
"x": "\/Da... | 2013/03/09 | [
"https://Stackoverflow.com/questions/15311112",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2114826/"
] | You were very close. The series array needs to contain an object with a data member:
```
series: [
{
data:[]
}
]
```
You can then set it using:
```
function myfunk() {
options.series[0].data = seriesData;
```
I modified your jsfiddle: <http://jsfiddle.net/dxCHB/>
Format your date numerically... | Your data should be number, so you can use parseFloat() function to transform string to number. |
21,812,702 | I like to have a debug configuration, that allows me to test the current file.
In every project it is the same, so I like to put variables in these fields:

So when I am within a test I like to click "Debug" and it runs `phpunit /my/current/test.php` using the given... | 2014/02/16 | [
"https://Stackoverflow.com/questions/21812702",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1494794/"
] | * Choose "Run" > "Edit configurations".
* Open "Defaults" and choose the scenario you want
* Place some default stuff there
Run a test using CTRL+SHIFT+F10 (in Ubuntu Gnome).
It will use the default setup on the current focues file. | [phpStorm](http://confluence.jetbrains.com/display/PhpStorm/Creating+PHPUnit+Tests+in+PhpStorm) details , you can try it |
73,623,899 | I'm new to Rust but I'm already familiar with Generics. At least that's what I thought until I came across this trait definition (edited for brevity):
```
pub trait Queue<Item: ItemT>: Core<Item> {
fn validate(
&self,
hash: <Item as ItemT>::Hash
) -> bool;
}
```
What's this `Item as ItemT` th... | 2022/09/06 | [
"https://Stackoverflow.com/questions/73623899",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/107245/"
] | The syntax `<Type as Trait>::Item` is the [fully-qualified syntax](https://doc.rust-lang.org/book/ch19-03-advanced-traits.html#fully-qualified-syntax-for-disambiguation-calling-methods-with-the-same-name) used to explicitly refer to an associated `Item` of a `Trait` on a `Type`. This is not terribly common to write out... | >
> What's this `Item as ItemT` thing?
>
>
>
`<Item as ItemT>::` is how you specify associated item (type, method, constant) from *the implementation of the trait `ItemT` for the type `Item`*.
For a less complex example, suppose we have some type `Foo` that implements the [`Default`](https://doc.rust-lang.org/std... |
57,525 | This is a follow up question to [How to reduce the space between the author block and paper text? sig-alternate.cls](https://tex.stackexchange.com/questions/57505/how-to-reduce-the-space-between-the-author-block-and-paper-text-sig-alternate-c)
I am using the template `sig-alternate.cls`, but I need a smaller font size... | 2012/05/27 | [
"https://tex.stackexchange.com/questions/57525",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/15003/"
] | To reduce the font size for the whole "References" section (not only for its heading), you may use the `etoolbox` package to add `\small` or `\scriptsize` to the definition of the `thebibliography` environment. (`\footnotesize` won't do any good, because its definition in `sig-alternate.cls` resembles that of `\normals... | The font of the section is defined by
```
\newfont{\secfnt}{ptmb8t at 12pt}
```
So to change it in front of the bibliography use:
```
\let\secfnt\undefined
\newfont{\secfnt}{ptmb8t at 10pt}
\bibliographystyle{abbrv}
\bibliography{sigproc}
```
If the bibliography isn't the last section you should group the redefi... |
29,132,095 | I faced a problem. My application downloading images from server and showing in a `UITableView` For downloading the images I am using `dispatch_async`.
```
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// downloading image from server
dispatch_async(dispatch_get_main_queue(),... | 2015/03/18 | [
"https://Stackoverflow.com/questions/29132095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1810390/"
] | You'd have to set up your own mechanism for keeping track of whether there were any pending requests for that image (e.g. a dictionary keyed by the image URL absolute string or something like that). The thing is, it's not as simple as that, as the cell that now needs to be updated may be different than (or in addition ... | For that you should store in some place the downloaded images or mark if there is a current operation for them. So you will be doing basically a image cache mechanism. I will advise that instead to do that you can use a well tested library for that like [SDWebImage](https://github.com/rs/SDWebImage) that precisely deal... |
29,132,095 | I faced a problem. My application downloading images from server and showing in a `UITableView` For downloading the images I am using `dispatch_async`.
```
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// downloading image from server
dispatch_async(dispatch_get_main_queue(),... | 2015/03/18 | [
"https://Stackoverflow.com/questions/29132095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1810390/"
] | You'd have to set up your own mechanism for keeping track of whether there were any pending requests for that image (e.g. a dictionary keyed by the image URL absolute string or something like that). The thing is, it's not as simple as that, as the cell that now needs to be updated may be different than (or in addition ... | Keep it simple: use `NSURLSession` rather than rolling your own attempt at asynchronous URL fetches. Rely on its caching to avoid repeat downloads where the previous download completed. Then all you have to worry about is repeat requests for downloads that are currently ongoing.
The easiest thing is probably just to k... |
368,463 | We are in the process of designing a simple service-oriented architecture using WCF as the implementation framework. There are a handful of services that a few applications use. These services are mostly used internally, so a basic authentication and authorization scheme (such as Windows-based) is enough.
We want, how... | 2008/12/15 | [
"https://Stackoverflow.com/questions/368463",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16026/"
] | I have done something very similar to this. What you can do is expose an endpoint with a single operation.
That operation would look something like
```
[OperationContract(Namespace="www.fu.com", Action="*")]
void CallThis(Message msg);
```
Have your clients use a proxy that is intended for the service they intended... | It seems it is sufficient to build an interface as follows:
```
[OperationContract(Action="*", ReplyAction="*")]
Message CallThis(Message msg);
```
I also found [this post](http://sajay.com/sending-a-simple-string-using-wcf-understandi) useful for implementing the *CallThis* method by "fiddling" with *Message* objec... |
368,463 | We are in the process of designing a simple service-oriented architecture using WCF as the implementation framework. There are a handful of services that a few applications use. These services are mostly used internally, so a basic authentication and authorization scheme (such as Windows-based) is enough.
We want, how... | 2008/12/15 | [
"https://Stackoverflow.com/questions/368463",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16026/"
] | I have done something very similar to this. What you can do is expose an endpoint with a single operation.
That operation would look something like
```
[OperationContract(Namespace="www.fu.com", Action="*")]
void CallThis(Message msg);
```
Have your clients use a proxy that is intended for the service they intended... | Check out [this SO question](https://stackoverflow.com/questions/1213781/is-is-possible-to-relay-a-wcf-service-from-another-server) where one of the responses suggests .NET 4's RoutingService. Very nice addition to WCF. |
368,463 | We are in the process of designing a simple service-oriented architecture using WCF as the implementation framework. There are a handful of services that a few applications use. These services are mostly used internally, so a basic authentication and authorization scheme (such as Windows-based) is enough.
We want, how... | 2008/12/15 | [
"https://Stackoverflow.com/questions/368463",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16026/"
] | It seems it is sufficient to build an interface as follows:
```
[OperationContract(Action="*", ReplyAction="*")]
Message CallThis(Message msg);
```
I also found [this post](http://sajay.com/sending-a-simple-string-using-wcf-understandi) useful for implementing the *CallThis* method by "fiddling" with *Message* objec... | Check out [this SO question](https://stackoverflow.com/questions/1213781/is-is-possible-to-relay-a-wcf-service-from-another-server) where one of the responses suggests .NET 4's RoutingService. Very nice addition to WCF. |
4,314,976 | ```
<%@ page language="java" import="net.sf.json.JSONArray" %>
<%
JSONArray arrayObj=new JSONArray();
arrayObj.add("MCA");
arrayObj.add("Amit Kumar");
arrayObj.add("19-12-1986");
arrayObj.add(24);
arrayObj.add("Scored");
arrayObj.add(new Double(66.67));
%>
<h2>Array Object is =></h2> <%=arrayObj%>... | 2010/11/30 | [
"https://Stackoverflow.com/questions/4314976",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/105167/"
] | Either the JSON library is not there where you think it is, or the JAR file of the JSON library which you've downloaded simply doesn't contain that class. Investigate the JAR file using a ZIP or RAR tool. There should be a `net/sf/json/JSONArray.class` file inside the JAR. If it is missing, then you probably downloaded... | I also had the same problem, make sure you Download JSONLibraries and place it into Tomcat's lib directory . Also **restart the server** before executing your jsp file. |
4,314,976 | ```
<%@ page language="java" import="net.sf.json.JSONArray" %>
<%
JSONArray arrayObj=new JSONArray();
arrayObj.add("MCA");
arrayObj.add("Amit Kumar");
arrayObj.add("19-12-1986");
arrayObj.add(24);
arrayObj.add("Scored");
arrayObj.add(new Double(66.67));
%>
<h2>Array Object is =></h2> <%=arrayObj%>... | 2010/11/30 | [
"https://Stackoverflow.com/questions/4314976",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/105167/"
] | I had the same problem it is solved after i placed json libraries in WEB-INF\lib folder
If you are using eclipse it helps to clean build once.
--Kiran.Kumar | I also had the same problem, make sure you Download JSONLibraries and place it into Tomcat's lib directory . Also **restart the server** before executing your jsp file. |
2,976,760 | Can I intercept SMS messages on the iPhone? I would like to intercept messages and NOT have them display on the phone and then send out an auto reply. Is this possible in 3.x? Is it something they may alow in the future? | 2010/06/04 | [
"https://Stackoverflow.com/questions/2976760",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30099/"
] | Nope. Nor is there a method of accessing already delivered text messages. (Even if you could, without background processing I'm not sure how your app would work anyway?) | While the OS stack might be locked down I wonder if it is possible to access the radio layer via serial and control local delivery by issuing GSM AT commands? I don't have access to an IPhone it may very well not be possible. |
33,671,799 | I'm fairly new to Python and I still do basic stuff for my ICT course.
I have a task to create a program that catches foreign number plates that are speeding. I have done times of entry and leave, which would be later assigned to 10 different number plates (that bit isn't important).
To save space, I'm trying to use ... | 2015/11/12 | [
"https://Stackoverflow.com/questions/33671799",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5554705/"
] | I think you're looking for `zip`
```
Enter=[7.12,
7.14,
7.24,
7.45,
7.28,
7.31,
7.18,
7.25,
7.33,
7.38] #A list for the times of cars passing Camera A
Leave=[7.56,
7.24,
7.48,
7.52,
7.45,
7.57,
7.22,
7.31,
... | You can use map:
```
for interval in map(lambda x, y: y-x, Enter, Leave):
print interval
```
Take care this made some weird things for me in python 2.7 when I tried to print the entire list and not one by one (See here [Python 2.7.5 error printing list of float numbers](https://stackoverflow.com/questions/336726... |
436,080 | In my research, I've recently started to play with Voronoi tessellations. I currently have a Python code that creates the tessellation and I am trying to color the polygonal regions according to their regularity. The best-case scenario would be to have a color scale (let's say from red to blue) where regions in red wou... | 2022/12/07 | [
"https://mathoverflow.net/questions/436080",
"https://mathoverflow.net",
"https://mathoverflow.net/users/168737/"
] | Internal angles are not enough to determine the regularity of a polygon. E.g., angles of $2\pi/3$ between sides of length $1,1,4,1,1,4$ make an irregular hexagon.
For a metric of regularity, I suggest $$A \ / \ \sum d\_i^2$$ where $A$ is the area of the hexagon and the $d\_i$ are the side lengths.
Using this metric:
... | All indices are in $\mathbb Z\bmod6$.
Let $z\_k=\frac{\ell\_{k,k+1}}{\ell\_{k-1,k}}e^{i(\pi-\theta\_k)}=\frac{v\_{k+1}-v\_k}{v\_k-v\_{k-1}}$, where $\ell$ is edge length, $\pi-\theta$ is vertex exterior angle, and $v\_k\in\mathbb C$ is the $k$th vertex of the polygon. So the complex number $z\_k$ scales and rotates on... |
35,562 | After I finished my paid internship for the summer, my supervisor keeps asking me to help with small tasks here and there, but it'll end up becoming a lot of time. I don't want to burn bridges, but I also have school and other commitments and I really don't want to continue doing this. How do I say no without burning b... | 2014/10/30 | [
"https://workplace.stackexchange.com/questions/35562",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/29101/"
] | Saying no is a task necessary to learn for all professions. The key is to be polite but crystal clear that you are saying no. People try all the time to avoid outright saying no but then they wonder why the other person thinks they might mean yes. Remember it is kinder to say no clearly right awy than let someonthink i... | First, decide if you want to continue doing these tasks. If you can't afford the time, asking for compensation won't solve your problem.
Nobody works for free (unless you're an intern or a volunteer). Even most interns are compensated for their time/effort in one way or another. Ask your supervisor how he thinks about... |
35,562 | After I finished my paid internship for the summer, my supervisor keeps asking me to help with small tasks here and there, but it'll end up becoming a lot of time. I don't want to burn bridges, but I also have school and other commitments and I really don't want to continue doing this. How do I say no without burning b... | 2014/10/30 | [
"https://workplace.stackexchange.com/questions/35562",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/29101/"
] | First, decide if you want to continue doing these tasks. If you can't afford the time, asking for compensation won't solve your problem.
Nobody works for free (unless you're an intern or a volunteer). Even most interns are compensated for their time/effort in one way or another. Ask your supervisor how he thinks about... | Then just as casually mention that:
1. you have school commitments;
2. you can't afford to work for free;
3. the limited amount of time that you have available must be allocated to paying engagements as a matter of financial priority
Say that you are sorry but at this point in your life, these considerations must ta... |
35,562 | After I finished my paid internship for the summer, my supervisor keeps asking me to help with small tasks here and there, but it'll end up becoming a lot of time. I don't want to burn bridges, but I also have school and other commitments and I really don't want to continue doing this. How do I say no without burning b... | 2014/10/30 | [
"https://workplace.stackexchange.com/questions/35562",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/29101/"
] | Saying no is a task necessary to learn for all professions. The key is to be polite but crystal clear that you are saying no. People try all the time to avoid outright saying no but then they wonder why the other person thinks they might mean yes. Remember it is kinder to say no clearly right awy than let someonthink i... | Then just as casually mention that:
1. you have school commitments;
2. you can't afford to work for free;
3. the limited amount of time that you have available must be allocated to paying engagements as a matter of financial priority
Say that you are sorry but at this point in your life, these considerations must ta... |
649,586 | I want to read serial data by a python script from a light sensor. I have the light sensor BH1750 and a USB-TTL Chip (see image). I have no idea about electronic hardware. Could someone tell me how I connect the pins between these two?
[](https://i.stack... | 2023/01/11 | [
"https://electronics.stackexchange.com/questions/649586",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/330290/"
] | BH1750 uses I2C interface (you can tell by pin names SDA/SCL), but your adapter has UART. You won't be able to connect these two.
If you want to read values from the sensor in your python script, you'll need some kind of man-in-the-middle like an Arduino for example, that will read values from the sensor over I2C and ... | You have the wrong adapter. FTDI offers adapters for I2C, see the selection guide:
<https://ftdichip.com/wp-content/uploads/2020/08/AN_255_USB-to-I2C-Example-using-the-FT232H-and-FT201X-devices-1.pdf>
Good option would be the C232HM-EDHSL-0, where you would connect Orange to SCL, Yellow and Green to SDA and Black to G... |
148,126 | Centripetal force is the centre-seeking force & is responsible for circular motion. But what if the centripetal force were acting radially outward? What would happen then? | 2014/11/22 | [
"https://physics.stackexchange.com/questions/148126",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/-1/"
] | If the tangential velocity is changing in magnitude, that implies a tangential acceleration, and thus a tangential force in addition to the centripetal force.
If the motion of the object is in a circle of constant radius, then the instantaneous centripetal force is given by the expression you wrote.
The argument is n... | Just my two cents to add to the other answers a more concrete example. Imagine an initially circular motion due to a mass being pulled towards the center by the tension of a rope. If you keep the tension constant, you have circular motion. Now, if you start increasing the tension, the mass will move in a spiral fashion... |
148,126 | Centripetal force is the centre-seeking force & is responsible for circular motion. But what if the centripetal force were acting radially outward? What would happen then? | 2014/11/22 | [
"https://physics.stackexchange.com/questions/148126",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/-1/"
] | If the tangential velocity is changing in magnitude, that implies a tangential acceleration, and thus a tangential force in addition to the centripetal force.
If the motion of the object is in a circle of constant radius, then the instantaneous centripetal force is given by the expression you wrote.
The argument is n... | Let's go: This is a circular motion:
$$ x(t) = R\cos\theta $$
$$ y(t) = R\sin\theta $$
Hence we can derive it:
$$
\dot x(t) = -R\dot\theta\sin\theta, \quad\quad
\ddot x(t) = -R\ddot\theta\sin\theta - R\dot\theta^2\cos\theta
$$
$$
\dot y(t) = R\dot\theta\cos\theta, \quad\quad
\ddot y(t) = R\ddot\theta\cos\theta - R\t... |
148,126 | Centripetal force is the centre-seeking force & is responsible for circular motion. But what if the centripetal force were acting radially outward? What would happen then? | 2014/11/22 | [
"https://physics.stackexchange.com/questions/148126",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/-1/"
] | Let's go: This is a circular motion:
$$ x(t) = R\cos\theta $$
$$ y(t) = R\sin\theta $$
Hence we can derive it:
$$
\dot x(t) = -R\dot\theta\sin\theta, \quad\quad
\ddot x(t) = -R\ddot\theta\sin\theta - R\dot\theta^2\cos\theta
$$
$$
\dot y(t) = R\dot\theta\cos\theta, \quad\quad
\ddot y(t) = R\ddot\theta\cos\theta - R\t... | Just my two cents to add to the other answers a more concrete example. Imagine an initially circular motion due to a mass being pulled towards the center by the tension of a rope. If you keep the tension constant, you have circular motion. Now, if you start increasing the tension, the mass will move in a spiral fashion... |
11,456,440 | I have a gray scale image that I would like to enlarge so that I can better see the individual pixels. I've tried setting Smoothing mode to none and some different Interpolation Modes (as suggested on other questions on here), but the images still appear to me as if they are still doing some sort of blending before bei... | 2012/07/12 | [
"https://Stackoverflow.com/questions/11456440",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/410949/"
] | Try to set interpolation mode:
```
g.InterpolationMode = InterpolationMode.NearestNeighbor;
``` | May be this could help!
<http://www.codeproject.com/Articles/191424/Resizing-an-Image-On-The-Fly-using-NET>
Else can you please implement this method and see whether it works for you?
```
private static Bitmap ResizeBitmap(Bitmap sourceBMP, int width, int height )
{
Bitmap result = new Bitmap(width, heig... |
11,456,440 | I have a gray scale image that I would like to enlarge so that I can better see the individual pixels. I've tried setting Smoothing mode to none and some different Interpolation Modes (as suggested on other questions on here), but the images still appear to me as if they are still doing some sort of blending before bei... | 2012/07/12 | [
"https://Stackoverflow.com/questions/11456440",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/410949/"
] | I too was looking to do something similar. When I found this question neither answer were quite what I was looking for but combined they were. This is what got me to where I wanted to be and from what I can tell from your question what you want.
```
private Bitmap ResizeBitmap(Bitmap sourceBMP, int width, int height)
... | May be this could help!
<http://www.codeproject.com/Articles/191424/Resizing-an-Image-On-The-Fly-using-NET>
Else can you please implement this method and see whether it works for you?
```
private static Bitmap ResizeBitmap(Bitmap sourceBMP, int width, int height )
{
Bitmap result = new Bitmap(width, heig... |
11,456,440 | I have a gray scale image that I would like to enlarge so that I can better see the individual pixels. I've tried setting Smoothing mode to none and some different Interpolation Modes (as suggested on other questions on here), but the images still appear to me as if they are still doing some sort of blending before bei... | 2012/07/12 | [
"https://Stackoverflow.com/questions/11456440",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/410949/"
] | Try to set interpolation mode:
```
g.InterpolationMode = InterpolationMode.NearestNeighbor;
``` | I too was looking to do something similar. When I found this question neither answer were quite what I was looking for but combined they were. This is what got me to where I wanted to be and from what I can tell from your question what you want.
```
private Bitmap ResizeBitmap(Bitmap sourceBMP, int width, int height)
... |
10,342,739 | Writing my basic programs on multi threading and I m coming across several difficulties.
In the program below if I give sleep at position 1 then value of shared data being printed is always 10 while keeping sleep at position 2 the value of shared data is always 0.
Why this kind of output is coming ?
How to decide at ... | 2012/04/26 | [
"https://Stackoverflow.com/questions/10342739",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/733583/"
] | It works native
```
["a", "b", "c", "d"].slice(1,3).join("-") //b-c
```
If you want it to behave like your definition you could use it that way:
```
Array.prototype.myJoin = function(seperator,start,end){
if(!start) start = 0;
if(!end) end = this.length - 1;
end++;
return this.slice(start,end).join(... | Just slice the array you want out, then join it manually.
```
var array= ["a", "b", "c", "d"];
var joinedArray = array.slice(1, 3).join("-");
```
Note: `slice()` doesn't include the last index specified, so (1, 3) is equivalent to (1, 2). |
981,291 | Im trying to move a system from using morbid to rabbitmq, but I cannot seem to get the same broadcast behaviour morbid supplied by default. By broadcast I mean that when a message is added to the queue, every consumer recieves it. With rabbit, when a message is added they are distributed round robin style to every list... | 2009/06/11 | [
"https://Stackoverflow.com/questions/981291",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7813/"
] | There are functions `TIMEDIFF(expr1,expr2)`, which returns the value of `expr1-expr2`, and `TIME_TO_SEC(expr3)`, which expresses `expr3` in seconds.
Note that `expr1` and `expr2` are datetime values, and `expr3` is a time value only.
Check [this link](http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.htm... | You can try and cast them to Unix Time stamp, and take the difference. |
981,291 | Im trying to move a system from using morbid to rabbitmq, but I cannot seem to get the same broadcast behaviour morbid supplied by default. By broadcast I mean that when a message is added to the queue, every consumer recieves it. With rabbit, when a message is added they are distributed round robin style to every list... | 2009/06/11 | [
"https://Stackoverflow.com/questions/981291",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7813/"
] | [TIMESTAMPDIFF](http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_timestampdiff) is like TIMEDIFF which Matthew states, except it returns the difference of the two datetimes in whatever units you desire (seconds, minutes, hours, etc).
For example,
```
SELECT TIMESTAMPDIFF(MINUTE,LogOutTime,... | You can try and cast them to Unix Time stamp, and take the difference. |
981,291 | Im trying to move a system from using morbid to rabbitmq, but I cannot seem to get the same broadcast behaviour morbid supplied by default. By broadcast I mean that when a message is added to the queue, every consumer recieves it. With rabbit, when a message is added they are distributed round robin style to every list... | 2009/06/11 | [
"https://Stackoverflow.com/questions/981291",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7813/"
] | I would do it like this - fetch where last activity is within 10 mins of now
```
SELECT * FROM table WHERE last_activity >= DATE_SUB(NOW(), INTERVAL 10 MINUTE)
``` | You can try and cast them to Unix Time stamp, and take the difference. |
981,291 | Im trying to move a system from using morbid to rabbitmq, but I cannot seem to get the same broadcast behaviour morbid supplied by default. By broadcast I mean that when a message is added to the queue, every consumer recieves it. With rabbit, when a message is added they are distributed round robin style to every list... | 2009/06/11 | [
"https://Stackoverflow.com/questions/981291",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7813/"
] | ```
SELECT TIMESTAMPDIFF(MINUTE,LogOutTime,LogInTime) AS TimeLoggedIn
FROM LogTable
```
This example shall ruin the time if its used by using millitary time. So for calculating millitairy time I do not recommend it Because it outputs negative values. | You can try and cast them to Unix Time stamp, and take the difference. |
981,291 | Im trying to move a system from using morbid to rabbitmq, but I cannot seem to get the same broadcast behaviour morbid supplied by default. By broadcast I mean that when a message is added to the queue, every consumer recieves it. With rabbit, when a message is added they are distributed round robin style to every list... | 2009/06/11 | [
"https://Stackoverflow.com/questions/981291",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7813/"
] | There are functions `TIMEDIFF(expr1,expr2)`, which returns the value of `expr1-expr2`, and `TIME_TO_SEC(expr3)`, which expresses `expr3` in seconds.
Note that `expr1` and `expr2` are datetime values, and `expr3` is a time value only.
Check [this link](http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.htm... | [TIMESTAMPDIFF](http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_timestampdiff) is like TIMEDIFF which Matthew states, except it returns the difference of the two datetimes in whatever units you desire (seconds, minutes, hours, etc).
For example,
```
SELECT TIMESTAMPDIFF(MINUTE,LogOutTime,... |
981,291 | Im trying to move a system from using morbid to rabbitmq, but I cannot seem to get the same broadcast behaviour morbid supplied by default. By broadcast I mean that when a message is added to the queue, every consumer recieves it. With rabbit, when a message is added they are distributed round robin style to every list... | 2009/06/11 | [
"https://Stackoverflow.com/questions/981291",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7813/"
] | There are functions `TIMEDIFF(expr1,expr2)`, which returns the value of `expr1-expr2`, and `TIME_TO_SEC(expr3)`, which expresses `expr3` in seconds.
Note that `expr1` and `expr2` are datetime values, and `expr3` is a time value only.
Check [this link](http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.htm... | I would do it like this - fetch where last activity is within 10 mins of now
```
SELECT * FROM table WHERE last_activity >= DATE_SUB(NOW(), INTERVAL 10 MINUTE)
``` |
981,291 | Im trying to move a system from using morbid to rabbitmq, but I cannot seem to get the same broadcast behaviour morbid supplied by default. By broadcast I mean that when a message is added to the queue, every consumer recieves it. With rabbit, when a message is added they are distributed round robin style to every list... | 2009/06/11 | [
"https://Stackoverflow.com/questions/981291",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7813/"
] | There are functions `TIMEDIFF(expr1,expr2)`, which returns the value of `expr1-expr2`, and `TIME_TO_SEC(expr3)`, which expresses `expr3` in seconds.
Note that `expr1` and `expr2` are datetime values, and `expr3` is a time value only.
Check [this link](http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.htm... | ```
SELECT TIMESTAMPDIFF(MINUTE,LogOutTime,LogInTime) AS TimeLoggedIn
FROM LogTable
```
This example shall ruin the time if its used by using millitary time. So for calculating millitairy time I do not recommend it Because it outputs negative values. |
981,291 | Im trying to move a system from using morbid to rabbitmq, but I cannot seem to get the same broadcast behaviour morbid supplied by default. By broadcast I mean that when a message is added to the queue, every consumer recieves it. With rabbit, when a message is added they are distributed round robin style to every list... | 2009/06/11 | [
"https://Stackoverflow.com/questions/981291",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7813/"
] | [TIMESTAMPDIFF](http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_timestampdiff) is like TIMEDIFF which Matthew states, except it returns the difference of the two datetimes in whatever units you desire (seconds, minutes, hours, etc).
For example,
```
SELECT TIMESTAMPDIFF(MINUTE,LogOutTime,... | I would do it like this - fetch where last activity is within 10 mins of now
```
SELECT * FROM table WHERE last_activity >= DATE_SUB(NOW(), INTERVAL 10 MINUTE)
``` |
981,291 | Im trying to move a system from using morbid to rabbitmq, but I cannot seem to get the same broadcast behaviour morbid supplied by default. By broadcast I mean that when a message is added to the queue, every consumer recieves it. With rabbit, when a message is added they are distributed round robin style to every list... | 2009/06/11 | [
"https://Stackoverflow.com/questions/981291",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7813/"
] | [TIMESTAMPDIFF](http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_timestampdiff) is like TIMEDIFF which Matthew states, except it returns the difference of the two datetimes in whatever units you desire (seconds, minutes, hours, etc).
For example,
```
SELECT TIMESTAMPDIFF(MINUTE,LogOutTime,... | ```
SELECT TIMESTAMPDIFF(MINUTE,LogOutTime,LogInTime) AS TimeLoggedIn
FROM LogTable
```
This example shall ruin the time if its used by using millitary time. So for calculating millitairy time I do not recommend it Because it outputs negative values. |
981,291 | Im trying to move a system from using morbid to rabbitmq, but I cannot seem to get the same broadcast behaviour morbid supplied by default. By broadcast I mean that when a message is added to the queue, every consumer recieves it. With rabbit, when a message is added they are distributed round robin style to every list... | 2009/06/11 | [
"https://Stackoverflow.com/questions/981291",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7813/"
] | I would do it like this - fetch where last activity is within 10 mins of now
```
SELECT * FROM table WHERE last_activity >= DATE_SUB(NOW(), INTERVAL 10 MINUTE)
``` | ```
SELECT TIMESTAMPDIFF(MINUTE,LogOutTime,LogInTime) AS TimeLoggedIn
FROM LogTable
```
This example shall ruin the time if its used by using millitary time. So for calculating millitairy time I do not recommend it Because it outputs negative values. |
27,577,463 | Skill level: beginner
I am trying to add a library in python. The extension is wheel.
Can somebody tell stepwise approach in installing wheel file? | 2014/12/20 | [
"https://Stackoverflow.com/questions/27577463",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4291825/"
] | First open a console then cd to where you've downloaded your file like some-package.whl and use
```
pip install some-package.whl
```
Note: if pip.exe is not recognized, you may find it in the "Scripts" directory from where python has been installed. I have multiple Python installations, and needed to use the pip ass... | From [How do I install a Python package with a .whl file?](https://stackoverflow.com/questions/27885397/how-do-i-install-a-python-package-with-a-whl-file/27885547#27885547)
[sic],
How do I install a Python package USING a .whl file ?
For all Windows platforms:
1) Download the .WHL package install file.
2) Make Sure ... |
38,956,916 | I'm using <https://github.com/open-xml-templating/docxtemplater>
My data:
```
var person = {
name: 'Joe',
address: {
city: 'Stockholm',
postal: 45123
}
}
```
How do write the syntax in the docx with this nested object?
This is not working:
```
{address.city}
```
Can't find any example in the docs. | 2016/08/15 | [
"https://Stackoverflow.com/questions/38956916",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1572526/"
] | By default, you have to do : {#address}{city}{/address}
if you use the angularParser, it would be {address.city} : <http://docxtemplater.readthedocs.io/en/latest/configuration.html?highlight=angular#custom-parser>
See <https://github.com/open-xml-templating/docxtemplater/issues/243> | use angularParser
<https://docxtemplater.readthedocs.io/en/latest/angular_parse.html>
`var expressions = require("angular-expressions");`
```
function angularParser(tag) {
if (tag === ".") {
return {
get: function (s) {
return s;
... |
9,696,097 | Our requirement is to show some text bold and some text as normal style in a label.
e.g. **ABC** 002
(there is not space between ABC and 002)
There are lots of instances of such labels on a single view, so using UIWebView is not preferred.
Is it possible using the UILabel? If no, then what are the alternatives? | 2012/03/14 | [
"https://Stackoverflow.com/questions/9696097",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/191/"
] | [Try `\G`](http://msdn.microsoft.com/en-us/library/az24scfc.aspx#atomic_zerowidth_assertions), eg:
```
var regex = new Regex(@"\G\d+\b");
Console.WriteLine(regex.IsMatch("x 10", 2));
```
[`\G`](http://msdn.microsoft.com/en-us/library/az24scfc.aspx#atomic_zerowidth_assertions) matches at the point where the previous ... | var regex = new Regex(@"\w\t\d+\b"); |
2,381,213 | Suppose the non-constant functions $f$ and $g$ satisfy the following two conditions:
$1)\ g(x-y) = g(x)g(y) +f(x)f(y)$
$2)\ f(0) = 0$.
Determine $g(0)$ and $(f(x))^2 + (g(x))^2.$
Is the answer $g(0) = 0?$ Is the second answer $0?$ | 2017/08/03 | [
"https://math.stackexchange.com/questions/2381213",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/463689/"
] | Put $x=0$ and $y=0$ into the relation,
$$g(0-0)=g(0)g(0)+f(0)f(0)$$
$$g(0)=(g(0))^2+0$$
$$g(0)=0 , 1$$
Assume $g(0)=1$ , we get $f+g=0 $ but $f$ and $g$ are non-constant
So $g(0)=0$
Also,
$$(f(x))^2 + (g(x))^2$$
$$=g(x-x)=g(0)$$ | Putting $x=y$ in the first relation, note that $g(0)=g^2(x)+f^2(x)$. Also, $g(0)=g^2(0)+f^2(0)\implies g(0)=0,1$. But $g(0)=0\implies f(x)=0,g(x)=0$, which contradicts the fact that they are non-constant. So, $g(0)=1$. |
2,381,213 | Suppose the non-constant functions $f$ and $g$ satisfy the following two conditions:
$1)\ g(x-y) = g(x)g(y) +f(x)f(y)$
$2)\ f(0) = 0$.
Determine $g(0)$ and $(f(x))^2 + (g(x))^2.$
Is the answer $g(0) = 0?$ Is the second answer $0?$ | 2017/08/03 | [
"https://math.stackexchange.com/questions/2381213",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/463689/"
] | I am supposing that $f$ and $g$ are real functions. \
For $x = y = 0$ we have $g(0) = g(0) ^ 2$ then $g(0) = 0$ or $g(0) = 1$ but if $g(0) = 0$ we have $g(x)^2 + f(x) ^ 2 = g(0) = 0$ which implies $f = g = 0$ since $f,g$ are non constants we have $g(0) = g(x) ^ 2 + f(x) ^ 2 = 1$. | Putting $x=y$ in the first relation, note that $g(0)=g^2(x)+f^2(x)$. Also, $g(0)=g^2(0)+f^2(0)\implies g(0)=0,1$. But $g(0)=0\implies f(x)=0,g(x)=0$, which contradicts the fact that they are non-constant. So, $g(0)=1$. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.