qid
int64
question
string
date
string
metadata
list
response_j
string
response_k
string
448,216
There's a risk of me potentially offending someone but I am an outsider trying to get to grips with this terminology. Online, I read someone who identified themself as a > > *pansexual trans/gender-fluid person* > > > I'd like to know if my understanding of the following terms is generally correct. I just about...
2018/05/29
[ "https://english.stackexchange.com/questions/448216", "https://english.stackexchange.com", "https://english.stackexchange.com/users/44619/" ]
I want to specifically address the first question in a way that it hasn't been yet. > > Q 1. What is the difference between a bisexual and a pansexual? > > > *Bisexualism* works only in a context where gender is binary. It assumes that people are only one of two possible genders—and that if you are bisexual you a...
* Bisexuality *sensu lato* (in the broad sense) means that one is sexually attracted to both males and females; it makes no distinction as to whether or not one is sexually attracted to persons who are neither male nor female. + Bisexuality *sensu stricto* (in the narrow sense) means that one is sexually attracted to ...
448,216
There's a risk of me potentially offending someone but I am an outsider trying to get to grips with this terminology. Online, I read someone who identified themself as a > > *pansexual trans/gender-fluid person* > > > I'd like to know if my understanding of the following terms is generally correct. I just about...
2018/05/29
[ "https://english.stackexchange.com/questions/448216", "https://english.stackexchange.com", "https://english.stackexchange.com/users/44619/" ]
I want to specifically address the first question in a way that it hasn't been yet. > > Q 1. What is the difference between a bisexual and a pansexual? > > > *Bisexualism* works only in a context where gender is binary. It assumes that people are only one of two possible genders—and that if you are bisexual you a...
The difference between Pansexual and Bisexual can be explained like this. Not all heterosexuals focus on lust when selecting a spouse. For some people, hetero, gay and pan, the emphasis is on being in love, and in a committed "forever" relationship. Many do not consumate their relationships sexually until vows are exc...
448,216
There's a risk of me potentially offending someone but I am an outsider trying to get to grips with this terminology. Online, I read someone who identified themself as a > > *pansexual trans/gender-fluid person* > > > I'd like to know if my understanding of the following terms is generally correct. I just about...
2018/05/29
[ "https://english.stackexchange.com/questions/448216", "https://english.stackexchange.com", "https://english.stackexchange.com/users/44619/" ]
> > Q2. Why is there no agreement in the LGTBQ community for a single, simple term to express this gender and sexual preference? > > > A2. Because the LGTBQ is not a single speech community, that's why. A speech community -- a bunch of people who talk (mostly) with one another -- is where agreements on single te...
Regarding question 1: I think it's a matter of carefully reading the definitions. Bisexual means to be attracted to both men and women. Pansexual means to be attracted to people regardless of sex or gender identity. To illustrate the difference, let's use food (because it's more relatable). Suppose you like pizza an...
448,216
There's a risk of me potentially offending someone but I am an outsider trying to get to grips with this terminology. Online, I read someone who identified themself as a > > *pansexual trans/gender-fluid person* > > > I'd like to know if my understanding of the following terms is generally correct. I just about...
2018/05/29
[ "https://english.stackexchange.com/questions/448216", "https://english.stackexchange.com", "https://english.stackexchange.com/users/44619/" ]
> > Q2. Why is there no agreement in the LGTBQ community for a single, simple term to express this gender and sexual preference? > > > A2. Because the LGTBQ is not a single speech community, that's why. A speech community -- a bunch of people who talk (mostly) with one another -- is where agreements on single te...
The difference between Pansexual and Bisexual can be explained like this. Not all heterosexuals focus on lust when selecting a spouse. For some people, hetero, gay and pan, the emphasis is on being in love, and in a committed "forever" relationship. Many do not consumate their relationships sexually until vows are exc...
448,216
There's a risk of me potentially offending someone but I am an outsider trying to get to grips with this terminology. Online, I read someone who identified themself as a > > *pansexual trans/gender-fluid person* > > > I'd like to know if my understanding of the following terms is generally correct. I just about...
2018/05/29
[ "https://english.stackexchange.com/questions/448216", "https://english.stackexchange.com", "https://english.stackexchange.com/users/44619/" ]
The other answers are well-taken. To attempt a tl;dr: > > **Q1.** What *is* the difference between a bisexual and a pansexual? > > > The people? **Probably nothing**. But the difference between the ***terms*** '[bisexual](http://www.oed.com/view/Entry/19448)' and '[pansexual](http://www.oed.com/view/Entry/136944)...
The difference between Pansexual and Bisexual can be explained like this. Not all heterosexuals focus on lust when selecting a spouse. For some people, hetero, gay and pan, the emphasis is on being in love, and in a committed "forever" relationship. Many do not consumate their relationships sexually until vows are exc...
448,216
There's a risk of me potentially offending someone but I am an outsider trying to get to grips with this terminology. Online, I read someone who identified themself as a > > *pansexual trans/gender-fluid person* > > > I'd like to know if my understanding of the following terms is generally correct. I just about...
2018/05/29
[ "https://english.stackexchange.com/questions/448216", "https://english.stackexchange.com", "https://english.stackexchange.com/users/44619/" ]
Regarding question 1: I think it's a matter of carefully reading the definitions. Bisexual means to be attracted to both men and women. Pansexual means to be attracted to people regardless of sex or gender identity. To illustrate the difference, let's use food (because it's more relatable). Suppose you like pizza an...
The difference between Pansexual and Bisexual can be explained like this. Not all heterosexuals focus on lust when selecting a spouse. For some people, hetero, gay and pan, the emphasis is on being in love, and in a committed "forever" relationship. Many do not consumate their relationships sexually until vows are exc...
448,216
There's a risk of me potentially offending someone but I am an outsider trying to get to grips with this terminology. Online, I read someone who identified themself as a > > *pansexual trans/gender-fluid person* > > > I'd like to know if my understanding of the following terms is generally correct. I just about...
2018/05/29
[ "https://english.stackexchange.com/questions/448216", "https://english.stackexchange.com", "https://english.stackexchange.com/users/44619/" ]
* Bisexuality *sensu lato* (in the broad sense) means that one is sexually attracted to both males and females; it makes no distinction as to whether or not one is sexually attracted to persons who are neither male nor female. + Bisexuality *sensu stricto* (in the narrow sense) means that one is sexually attracted to ...
The difference between Pansexual and Bisexual can be explained like this. Not all heterosexuals focus on lust when selecting a spouse. For some people, hetero, gay and pan, the emphasis is on being in love, and in a committed "forever" relationship. Many do not consumate their relationships sexually until vows are exc...
46,159,310
I'm trying to format the footer of my app, and there are 3 things I want along the footer, all hyperlinks that I'd like on the same line. ``` <p><a href="mailto:me@myemail.com">&copy; 2017 - My Name, Section 4</a> <a asp-area="" asp-controller="Home" asp-action="About">About</a> <a asp-area="" ...
2017/09/11
[ "https://Stackoverflow.com/questions/46159310", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7800355/" ]
Just add a class and float it right with some padding: <https://jsfiddle.net/cx5m40wu/> ``` <p><a href="mailto:me@myemail.com">&copy; 2017 - My Name, Section 4</a> <a asp-area="" asp-controller="Home" asp-action="Contact" class="alignRight">Contact</a> <a asp-area="" asp-controller="Ho...
I would recommend a different approach for the markup. Use an `<ul>` (unordered list) inside a `<footer>` tag. Then, use `<li>` (list items) for each `<a>` anchor tag. This will be better for semantics and accessibility. After having a proper HTML markup, you can proceed to style it with any method you like: **Flex...
46,159,310
I'm trying to format the footer of my app, and there are 3 things I want along the footer, all hyperlinks that I'd like on the same line. ``` <p><a href="mailto:me@myemail.com">&copy; 2017 - My Name, Section 4</a> <a asp-area="" asp-controller="Home" asp-action="About">About</a> <a asp-area="" ...
2017/09/11
[ "https://Stackoverflow.com/questions/46159310", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7800355/" ]
Just add a class and float it right with some padding: <https://jsfiddle.net/cx5m40wu/> ``` <p><a href="mailto:me@myemail.com">&copy; 2017 - My Name, Section 4</a> <a asp-area="" asp-controller="Home" asp-action="Contact" class="alignRight">Contact</a> <a asp-area="" asp-controller="Ho...
Flexbox can do that: ```css p { display: flex; } p a:first-of-type { margin-right: auto; } ``` ```html <p><a href="mailto:me@myemail.com">&copy; 2017 - My Name, Section 4</a> <a asp-area="" asp-controller="Home" asp-action="About">About</a> <a asp-area="" asp-controller="Home" asp-action="Contact">Con...
20,897,236
So I am able to retrieve the images from instagram but I want the individual images to go into my gallery container div which I got a problem with. I have directed the images to the class "html5gallery" but the images does not goes in like other image urls : ``` <!-- Reference to html5gallery.js --> <script type="text...
2014/01/03
[ "https://Stackoverflow.com/questions/20897236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3152558/" ]
Change the class attribute to id or add the id attribute `id="html5gallery"` ``` <div style="display:none;margin:0 auto; " class="html5gallery" id="html5gallery" data-skin="horizontal" data-width="1200" data-height="680" > ``` **EDIT:** Try this to append image ``` var imgURL = ''; var gallery = $("#html5gal...
I've never used the instagram API before, but I think this is what you want to achieve (code below). I've included both a Vanilla Javascript method as well as a jQuery method (so you can pick and use whichever one you prefer - vanilla is faster of course) ``` (function ($, window) { var userId = "19410587"; va...
20,897,236
So I am able to retrieve the images from instagram but I want the individual images to go into my gallery container div which I got a problem with. I have directed the images to the class "html5gallery" but the images does not goes in like other image urls : ``` <!-- Reference to html5gallery.js --> <script type="text...
2014/01/03
[ "https://Stackoverflow.com/questions/20897236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3152558/" ]
Change the class attribute to id or add the id attribute `id="html5gallery"` ``` <div style="display:none;margin:0 auto; " class="html5gallery" id="html5gallery" data-skin="horizontal" data-width="1200" data-height="680" > ``` **EDIT:** Try this to append image ``` var imgURL = ''; var gallery = $("#html5gal...
If the human eye can only see 24fps or 30fps or more when playing a game or watching tv, I believe a programer can use less DIVs in HTML within the screen size, with a Javascript array of 3 million colors for a couple of DIVs and cheat it's position(because of our human eyes), based in a timer event with a bunch of fra...
248,161
Let $z\_1 , z\_2 $ be two complex numbers that satisfy: $\dfrac{z\_2 } {\bar{z\_1}}= \frac{3}{8} \big(\cos(75^{\circ})+i\sin(75^{\circ})\big) $ , $z\_1 z\_2 ^2 = \frac{1}{3} \big(\cos(120^{\circ}) + i\sin(120^{\circ}) \big) $ . How can I determine with of the following can be a possible value for $ \sqrt{z\_1} $ ?...
2012/11/30
[ "https://math.stackexchange.com/questions/248161", "https://math.stackexchange.com", "https://math.stackexchange.com/users/50436/" ]
Assuming that each week is independent, we know that if $N$ is the number of employees taken on in a particular week, then $N$ has distribution: $P(N=k) = e^{-0.1} \frac{0.1^k}{k!}$ So that, $p:=P(N=0)=e^{-0.1}$, which I'm calling $p$. Now, assuming we have an unlimited number of weeks, how can we not take on empl...
Alex has answered part of the question. The probability that more than one new employee is hired in a given week is $1$ minus the probability that only $0$ or $1$ new employees are hired. Thus it is $$ 1- \frac{0.1^0 e^{-0.1}}{0!} - \frac{0.1^1 e^{-0.1}}{1!} = 1 - e^{-0.1} - 0.1e^{-0.1}. $$ Call this number $p$. Then ...
2,484,538
Let $A$ and $B$ from $M\_n(\mathbb{R})$ with $AB=BA$ and $\det(A+B) \geq 0$ Prove that $ \forall n \in \mathbb{N^{\*}} $, $\det (A^n + B^n) \geq 0 $ --- I tried to use induction but I got stuck.
2017/10/22
[ "https://math.stackexchange.com/questions/2484538", "https://math.stackexchange.com", "https://math.stackexchange.com/users/201437/" ]
HINT: You could use complex numbers. Consider the factorization $$(X^n + 1) = \prod\_{\omega^n +1 = 0}( X- \omega)$$ The roots of the equation $X^n+1 = 0$ are complex, distinct, and conjugate in pairs, if $n$ is even, or $-1$, and $\frac{n-1}{2}$ pairs of conjugate roots, if $n$ is odd. Since $A$, $B$ commute, we c...
Ok, I really like the answer by orangeskid. However, I want to understand the solution outlined by Giuseppe Negro. As he already noted, commuting diagonalizable matrices are simultaneously diagonalizable. So let us assume that $A=diag(a\_1, a\_2, \ldots a\_n)$ and $B=diag(b\_1, b\_2, \ldots b\_n)$. Then $$\det(A+B)=...
878,022
I have the following data structure: ``` typedef vector< vector<int> > MxInt2d; typedef vector< vector<double> > MxDouble2d; class QSweep{ public: .... static MxDouble2d myPoints_; MxInt2d myEdges_; MxInt2d sweepEvents; class order{ public: bool operator() (const vector<int>& edge1, const vector<int>&...
2009/05/18
[ "https://Stackoverflow.com/questions/878022", "https://Stackoverflow.com", "https://Stackoverflow.com/users/82475/" ]
If you have 2 different criteria for sorting then you should have 2 different functors. Give them meaningful names such as: OrderBySlopes and OrderByXYZ If the 2 functors use some common code, you can refactor this out. i.e. into a base class
What [Glen](https://stackoverflow.com/questions/878022/several-functors-for-redefining-order-for-sort-function-of-vector/878046#878046) said. If you really really insist on having one function do double duty, you can rely on having different parameter types to overload two versions of operator().
878,022
I have the following data structure: ``` typedef vector< vector<int> > MxInt2d; typedef vector< vector<double> > MxDouble2d; class QSweep{ public: .... static MxDouble2d myPoints_; MxInt2d myEdges_; MxInt2d sweepEvents; class order{ public: bool operator() (const vector<int>& edge1, const vector<int>&...
2009/05/18
[ "https://Stackoverflow.com/questions/878022", "https://Stackoverflow.com", "https://Stackoverflow.com/users/82475/" ]
If you have 2 different criteria for sorting then you should have 2 different functors. Give them meaningful names such as: OrderBySlopes and OrderByXYZ If the 2 functors use some common code, you can refactor this out. i.e. into a base class
Your `orderDet::operator()` takes three arguments. The `std::sort` wants only two to compare two values. A solution may be to add the edges vector as a member of your functor: ``` struct orderDet { const vector<int>& edges; orderDet( const vector<int>& edges ):edges(edges){}; bool operator()( const vecto...
49,020,629
I have: ``` a = [['-', '-', '-'], ['-', '-', '-'], ['-', '-', '-']] b = [['-'] * 3] * 3 # => [["-", "-", "-"], ["-", "-", "-"], ["-", "-", "-"]] a == b #=> true ``` Seems correct. ``` a[0][0] = 'X' a # => [["X", "-", "-"], ["-", "-", "-"], ["-", "-", "-"]] b[0][0] = 'X' b # => [["X", "-", "-"], ["X", "-", "-"], ["...
2018/02/28
[ "https://Stackoverflow.com/questions/49020629", "https://Stackoverflow.com", "https://Stackoverflow.com/users/236353/" ]
This: ``` [object]*3 ``` will create an array with 3 references to the same object so changing one of them changes all of them like this: ``` a = [[1]]*3 #=> [[1], [1], [1]] a[0][0] = 2 #=> [[2], [2], [2]] ``` If you wish to create an array of length 3 with 3 different objects, do this: ``` a = 3.times.map {[1]}...
I found it has to be done this way: ``` irb(main):001:0> b = Array.new(3) { Array.new(3) { '-' } } => [["-", "-", "-"], ["-", "-", "-"], ["-", "-", "-"]] irb(main):002:0> b[0][0] = 'X' => "X" irb(main):003:0> b => [["X", "-", "-"], ["-", "-", "-"], ["-", "-", "-"]] ```
49,020,629
I have: ``` a = [['-', '-', '-'], ['-', '-', '-'], ['-', '-', '-']] b = [['-'] * 3] * 3 # => [["-", "-", "-"], ["-", "-", "-"], ["-", "-", "-"]] a == b #=> true ``` Seems correct. ``` a[0][0] = 'X' a # => [["X", "-", "-"], ["-", "-", "-"], ["-", "-", "-"]] b[0][0] = 'X' b # => [["X", "-", "-"], ["X", "-", "-"], ["...
2018/02/28
[ "https://Stackoverflow.com/questions/49020629", "https://Stackoverflow.com", "https://Stackoverflow.com/users/236353/" ]
This: ``` [object]*3 ``` will create an array with 3 references to the same object so changing one of them changes all of them like this: ``` a = [[1]]*3 #=> [[1], [1], [1]] a[0][0] = 2 #=> [[2], [2], [2]] ``` If you wish to create an array of length 3 with 3 different objects, do this: ``` a = 3.times.map {[1]}...
The first initialization you created 3 arrays nested in 1. ``` a = [['-', '-', '-'], ['-', '-', '-'], ['-', '-', '-']] # [['-', '-', '-'], ['-', '-', '-'], ['-', '-', '-']] # ARRAY a ARRAY b ARRAY c ``` The second initialization you created 1 array, and then pointed the same array 3 time...
41,860,373
I have a Kotlin Code just like the below, `SingleKotlin.instance` can be called by the other Kotlin files ``` class SingleKotlin private constructor(){ companion object { val instance by lazy { SingleKotlin() } } } ``` However, when I try to call `SingleKotlin.instance` from java...
2017/01/25
[ "https://Stackoverflow.com/questions/41860373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3239558/" ]
Just add @JvmStatic annotation above field (as said in this documentation <https://kotlinlang.org/docs/reference/java-to-kotlin-interop.html#static-fields>) So, your code should be like this: ``` class SingleKotlin private constructor(){ companion object { @JvmStatic val instance by lazy { ...
In addition to [@YuriiKyrylchuk](https://stackoverflow.com/users/2793494/yurii-kyrylchuk)'s answer: another option (and the only option if you don't have control over the Kotlin code) is to refer to `MyClass.Companion` from Java. Example: ``` class MyClass { companion object { val x: Int = 0 } } ``` ...
41,860,373
I have a Kotlin Code just like the below, `SingleKotlin.instance` can be called by the other Kotlin files ``` class SingleKotlin private constructor(){ companion object { val instance by lazy { SingleKotlin() } } } ``` However, when I try to call `SingleKotlin.instance` from java...
2017/01/25
[ "https://Stackoverflow.com/questions/41860373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3239558/" ]
Just add @JvmStatic annotation above field (as said in this documentation <https://kotlinlang.org/docs/reference/java-to-kotlin-interop.html#static-fields>) So, your code should be like this: ``` class SingleKotlin private constructor(){ companion object { @JvmStatic val instance by lazy { ...
If your `SingleKotlin` object has a single private constructor without parameters, you can use `object` instead: ``` object SingleKotlin { // some members of SingleKotlin val x = 42 } ``` Then in Java you reference it through the `INSTANCE` static field: ``` SingleKotlin single = SingleKotlin.INSTANCE; // o...
41,860,373
I have a Kotlin Code just like the below, `SingleKotlin.instance` can be called by the other Kotlin files ``` class SingleKotlin private constructor(){ companion object { val instance by lazy { SingleKotlin() } } } ``` However, when I try to call `SingleKotlin.instance` from java...
2017/01/25
[ "https://Stackoverflow.com/questions/41860373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3239558/" ]
Just add @JvmStatic annotation above field (as said in this documentation <https://kotlinlang.org/docs/reference/java-to-kotlin-interop.html#static-fields>) So, your code should be like this: ``` class SingleKotlin private constructor(){ companion object { @JvmStatic val instance by lazy { ...
You need to call the method from Java like this: `AppUIUtils.Companion.yourMethod()`
41,860,373
I have a Kotlin Code just like the below, `SingleKotlin.instance` can be called by the other Kotlin files ``` class SingleKotlin private constructor(){ companion object { val instance by lazy { SingleKotlin() } } } ``` However, when I try to call `SingleKotlin.instance` from java...
2017/01/25
[ "https://Stackoverflow.com/questions/41860373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3239558/" ]
Just add @JvmStatic annotation above field (as said in this documentation <https://kotlinlang.org/docs/reference/java-to-kotlin-interop.html#static-fields>) So, your code should be like this: ``` class SingleKotlin private constructor(){ companion object { @JvmStatic val instance by lazy { ...
In additional to Ilya answer you can use @JvmStatic annotation ``` object SingleKotlin { // some members of SingleKotlin @JvmStatic val x = 42 } ``` Then in Java ``` SingleKotlin.getX(); ```
41,860,373
I have a Kotlin Code just like the below, `SingleKotlin.instance` can be called by the other Kotlin files ``` class SingleKotlin private constructor(){ companion object { val instance by lazy { SingleKotlin() } } } ``` However, when I try to call `SingleKotlin.instance` from java...
2017/01/25
[ "https://Stackoverflow.com/questions/41860373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3239558/" ]
In addition to [@YuriiKyrylchuk](https://stackoverflow.com/users/2793494/yurii-kyrylchuk)'s answer: another option (and the only option if you don't have control over the Kotlin code) is to refer to `MyClass.Companion` from Java. Example: ``` class MyClass { companion object { val x: Int = 0 } } ``` ...
You need to call the method from Java like this: `AppUIUtils.Companion.yourMethod()`
41,860,373
I have a Kotlin Code just like the below, `SingleKotlin.instance` can be called by the other Kotlin files ``` class SingleKotlin private constructor(){ companion object { val instance by lazy { SingleKotlin() } } } ``` However, when I try to call `SingleKotlin.instance` from java...
2017/01/25
[ "https://Stackoverflow.com/questions/41860373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3239558/" ]
In addition to [@YuriiKyrylchuk](https://stackoverflow.com/users/2793494/yurii-kyrylchuk)'s answer: another option (and the only option if you don't have control over the Kotlin code) is to refer to `MyClass.Companion` from Java. Example: ``` class MyClass { companion object { val x: Int = 0 } } ``` ...
In additional to Ilya answer you can use @JvmStatic annotation ``` object SingleKotlin { // some members of SingleKotlin @JvmStatic val x = 42 } ``` Then in Java ``` SingleKotlin.getX(); ```
41,860,373
I have a Kotlin Code just like the below, `SingleKotlin.instance` can be called by the other Kotlin files ``` class SingleKotlin private constructor(){ companion object { val instance by lazy { SingleKotlin() } } } ``` However, when I try to call `SingleKotlin.instance` from java...
2017/01/25
[ "https://Stackoverflow.com/questions/41860373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3239558/" ]
If your `SingleKotlin` object has a single private constructor without parameters, you can use `object` instead: ``` object SingleKotlin { // some members of SingleKotlin val x = 42 } ``` Then in Java you reference it through the `INSTANCE` static field: ``` SingleKotlin single = SingleKotlin.INSTANCE; // o...
You need to call the method from Java like this: `AppUIUtils.Companion.yourMethod()`
41,860,373
I have a Kotlin Code just like the below, `SingleKotlin.instance` can be called by the other Kotlin files ``` class SingleKotlin private constructor(){ companion object { val instance by lazy { SingleKotlin() } } } ``` However, when I try to call `SingleKotlin.instance` from java...
2017/01/25
[ "https://Stackoverflow.com/questions/41860373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3239558/" ]
If your `SingleKotlin` object has a single private constructor without parameters, you can use `object` instead: ``` object SingleKotlin { // some members of SingleKotlin val x = 42 } ``` Then in Java you reference it through the `INSTANCE` static field: ``` SingleKotlin single = SingleKotlin.INSTANCE; // o...
In additional to Ilya answer you can use @JvmStatic annotation ``` object SingleKotlin { // some members of SingleKotlin @JvmStatic val x = 42 } ``` Then in Java ``` SingleKotlin.getX(); ```
19,321,047
I am using this query: ``` SELECT ts as "TimeStamp", stat as "Status" FROM myTable WHERE stat = 'O' AND source = 'Source1' AND ts BETWEEN TO_TIMESTAMP('2013-10-05','yyyy-mm-dd') AND TO_TIMESTAMP('2013-10-06','yyyy-mm-dd') ``` And also tried: ``` SELECT ts as "Time...
2013/10/11
[ "https://Stackoverflow.com/questions/19321047", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1342249/" ]
Because the TO time stamp has time even though you're not specifying. So it is selecting only up to the very beginning of the lat day. Either specify time 23:59:59 and subseconds as required, or do less than the next day. ``` ... AND ts >= TO_TIMESTAMP('2013-10-05','yyyy-mm-dd') AND ts < TO_TIMESTAMP('2013-10-07','y...
Try: AND ts BETWEEN TO\_DATE('2013-10-05','YYYY-MM-DD') AND TO\_DATE('2013-10-06','YYYY-MM-DD') And mind that it will get you results from the 10-05 at 00:00:00 to the 10-06 at 00:00:00 If you don't specify the HH MI SS mask. Date masks are case sensitivve and TO\_DATE will work better.
55,785,574
I want to assign the total number of rows to a variable named **"@row\_count"**. ``` DECLARE @row_count int SET @row_count = SELECT COUNT(*) FROM information ``` I know. I'm doing **wrong**. But I haven't found anything on how to do it. --- I want to do something like that: ``` CREATE PROC add_person ( @id t...
2019/04/21
[ "https://Stackoverflow.com/questions/55785574", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
It's not possible to blur other apps in the background. <https://www.electronjs.org/docs/api/frameless-window#limitations> > > The blur filter only applies to the web page, so there is no way to > apply blur effect to the content below the window (i.e. other > applications open on the user's system). > > >
Electron does not allow you to blur on anything running behind it. It only allows you to blur the content on your webpage/app. Anything in your css styling will only be applied to the foreground contents. I know because I too have tried and failed.
55,785,574
I want to assign the total number of rows to a variable named **"@row\_count"**. ``` DECLARE @row_count int SET @row_count = SELECT COUNT(*) FROM information ``` I know. I'm doing **wrong**. But I haven't found anything on how to do it. --- I want to do something like that: ``` CREATE PROC add_person ( @id t...
2019/04/21
[ "https://Stackoverflow.com/questions/55785574", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
electron-acrylic-window ======================= Actually, it is possible, with a little bit of magic. I have no idea why nobody pointed that out, but there exists a small utility called [electron-acrylic-window](https://github.com/Seo-Rii/electron-acrylic-window), which allows you to do exactly that. You can choose be...
It's not possible to blur other apps in the background. <https://www.electronjs.org/docs/api/frameless-window#limitations> > > The blur filter only applies to the web page, so there is no way to > apply blur effect to the content below the window (i.e. other > applications open on the user's system). > > >
55,785,574
I want to assign the total number of rows to a variable named **"@row\_count"**. ``` DECLARE @row_count int SET @row_count = SELECT COUNT(*) FROM information ``` I know. I'm doing **wrong**. But I haven't found anything on how to do it. --- I want to do something like that: ``` CREATE PROC add_person ( @id t...
2019/04/21
[ "https://Stackoverflow.com/questions/55785574", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
electron-acrylic-window ======================= Actually, it is possible, with a little bit of magic. I have no idea why nobody pointed that out, but there exists a small utility called [electron-acrylic-window](https://github.com/Seo-Rii/electron-acrylic-window), which allows you to do exactly that. You can choose be...
Electron does not allow you to blur on anything running behind it. It only allows you to blur the content on your webpage/app. Anything in your css styling will only be applied to the foreground contents. I know because I too have tried and failed.
11,826,556
I am using a service called 'embedly' which is showing my feeds. I'm trying to shorten the text of this feed, so I tried: ``` $('.description').html( function(){ return $.trim($(this).html()) .substring(0, 100) .split(" ").slice(0, -1) .join(" ") + "...";} ...
2012/08/06
[ "https://Stackoverflow.com/questions/11826556", "https://Stackoverflow.com", "https://Stackoverflow.com/users/647909/" ]
This one took me a very long time to figure out, but I think the best you can do is give the elements a second to load into the DOM, and then run your function: <http://jsfiddle.net/2VBSX/5/> ``` $('div.newscontainer').embedly({ key:':e0a98aba95ef11e09dcd4040d3dc5c07' }).hide(); setTimeout(function() { $('div...
Jquery's HTML doesn't accept a function as argument, but only plain HTML (a string). To do what you wanto to do, use `.each()` :) **Correction:** as pointed out by the commenter below, my code is correct but .html() **does** indeed accept a function as argument, in the form `$(...).html(function(index, oldhtml));`, ma...
11,826,556
I am using a service called 'embedly' which is showing my feeds. I'm trying to shorten the text of this feed, so I tried: ``` $('.description').html( function(){ return $.trim($(this).html()) .substring(0, 100) .split(" ").slice(0, -1) .join(" ") + "...";} ...
2012/08/06
[ "https://Stackoverflow.com/questions/11826556", "https://Stackoverflow.com", "https://Stackoverflow.com/users/647909/" ]
Jquery's HTML doesn't accept a function as argument, but only plain HTML (a string). To do what you wanto to do, use `.each()` :) **Correction:** as pointed out by the commenter below, my code is correct but .html() **does** indeed accept a function as argument, in the form `$(...).html(function(index, oldhtml));`, ma...
So, my other answer is not valid because the OP didn't mention that all the elements were created on the fly, so they cannot be matched in the classical way. If the modifications are attached to a suitable event (click, for example), then it would be easy to use delegates with `.on()`, as they are valid also for new e...
11,826,556
I am using a service called 'embedly' which is showing my feeds. I'm trying to shorten the text of this feed, so I tried: ``` $('.description').html( function(){ return $.trim($(this).html()) .substring(0, 100) .split(" ").slice(0, -1) .join(" ") + "...";} ...
2012/08/06
[ "https://Stackoverflow.com/questions/11826556", "https://Stackoverflow.com", "https://Stackoverflow.com/users/647909/" ]
This one took me a very long time to figure out, but I think the best you can do is give the elements a second to load into the DOM, and then run your function: <http://jsfiddle.net/2VBSX/5/> ``` $('div.newscontainer').embedly({ key:':e0a98aba95ef11e09dcd4040d3dc5c07' }).hide(); setTimeout(function() { $('div...
So, my other answer is not valid because the OP didn't mention that all the elements were created on the fly, so they cannot be matched in the classical way. If the modifications are attached to a suitable event (click, for example), then it would be easy to use delegates with `.on()`, as they are valid also for new e...
14,480,944
I have a String as folder/File Name. I am creating folder , file with that string. This string may or may not contain some charters which may not allow to create desired folder or file e.g ``` String folder = "ArslanFolder 20/01/2013"; ``` **So I want to remove these characters with "\_"** Here are characters ...
2013/01/23
[ "https://Stackoverflow.com/questions/14480944", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486139/" ]
Use this code: ``` String folder = "ArslanFolder 20/01/2013 ? / '"; String result = folder.replaceAll("[|?*<\":>+\\[\\]/']", "_"); ``` And the result would be: ``` ArslanFolder 20_01_2013 _ _ _ ``` you didn't say that space should be replaced, so spaces are there... you could add it if it is necessary to be done.
Try this : ``` replaceAll("[\\W]", "_"); ``` It will replace all non alphanumeric characters with underscore
14,480,944
I have a String as folder/File Name. I am creating folder , file with that string. This string may or may not contain some charters which may not allow to create desired folder or file e.g ``` String folder = "ArslanFolder 20/01/2013"; ``` **So I want to remove these characters with "\_"** Here are characters ...
2013/01/23
[ "https://Stackoverflow.com/questions/14480944", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486139/" ]
I used one of this: ``` String alphaOnly = input.replaceAll("[^\\p{Alpha}]+",""); String alphaAndDigits = input.replaceAll("[^\\p{Alpha}\\p{Digit}]+",""); ``` See this link: [Replace special characters](https://stackoverflow.com/questions/4283351/how-to-replace-special-characters-in-a-string)
Try this : ``` replaceAll("[\\W]", "_"); ``` It will replace all non alphanumeric characters with underscore
14,480,944
I have a String as folder/File Name. I am creating folder , file with that string. This string may or may not contain some charters which may not allow to create desired folder or file e.g ``` String folder = "ArslanFolder 20/01/2013"; ``` **So I want to remove these characters with "\_"** Here are characters ...
2013/01/23
[ "https://Stackoverflow.com/questions/14480944", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486139/" ]
Use this code: ``` String folder = "ArslanFolder 20/01/2013 ? / '"; String result = folder.replaceAll("[|?*<\":>+\\[\\]/']", "_"); ``` And the result would be: ``` ArslanFolder 20_01_2013 _ _ _ ``` you didn't say that space should be replaced, so spaces are there... you could add it if it is necessary to be done.
I used one of this: ``` String alphaOnly = input.replaceAll("[^\\p{Alpha}]+",""); String alphaAndDigits = input.replaceAll("[^\\p{Alpha}\\p{Digit}]+",""); ``` See this link: [Replace special characters](https://stackoverflow.com/questions/4283351/how-to-replace-special-characters-in-a-string)
14,480,944
I have a String as folder/File Name. I am creating folder , file with that string. This string may or may not contain some charters which may not allow to create desired folder or file e.g ``` String folder = "ArslanFolder 20/01/2013"; ``` **So I want to remove these characters with "\_"** Here are characters ...
2013/01/23
[ "https://Stackoverflow.com/questions/14480944", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486139/" ]
Use this code: ``` String folder = "ArslanFolder 20/01/2013 ? / '"; String result = folder.replaceAll("[|?*<\":>+\\[\\]/']", "_"); ``` And the result would be: ``` ArslanFolder 20_01_2013 _ _ _ ``` you didn't say that space should be replaced, so spaces are there... you could add it if it is necessary to be done.
**This is correct solution:** ``` String result = inputString.replaceAll("[\\\\|?\u0000*<\":>+\\[\\]/']", "_"); ``` Kent answer is good, but he isnt include characters `NUL` and `\`. Also, this is a secure solution for replacing/renaming text of user-input file names, for example.
14,480,944
I have a String as folder/File Name. I am creating folder , file with that string. This string may or may not contain some charters which may not allow to create desired folder or file e.g ``` String folder = "ArslanFolder 20/01/2013"; ``` **So I want to remove these characters with "\_"** Here are characters ...
2013/01/23
[ "https://Stackoverflow.com/questions/14480944", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486139/" ]
I used one of this: ``` String alphaOnly = input.replaceAll("[^\\p{Alpha}]+",""); String alphaAndDigits = input.replaceAll("[^\\p{Alpha}\\p{Digit}]+",""); ``` See this link: [Replace special characters](https://stackoverflow.com/questions/4283351/how-to-replace-special-characters-in-a-string)
**This is correct solution:** ``` String result = inputString.replaceAll("[\\\\|?\u0000*<\":>+\\[\\]/']", "_"); ``` Kent answer is good, but he isnt include characters `NUL` and `\`. Also, this is a secure solution for replacing/renaming text of user-input file names, for example.
6,122,091
I'm familiar with Java and trying to teach myself C/C++. I'm stealing some curriculum from a class that is hosting their materials [here](http://courses.washington.edu/css342/zander/css332/array.html). I unfortunately can't ask the teacher since I'm not in the class. My concern is with the section under "dynamically de...
2011/05/25
[ "https://Stackoverflow.com/questions/6122091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/349611/" ]
> > My understanding is that an array in C is simply a reference to the memory address of the first element in the array. > > > So, what is the difference between int \*pointerArray = new int[10]; and int array[10]; if any? > > > What you mention is the reason for much confusion in any C/C++ beginner. In C/C++,...
The main difference is that some operations that are allowed on pointers are not allowed on arrays.
6,122,091
I'm familiar with Java and trying to teach myself C/C++. I'm stealing some curriculum from a class that is hosting their materials [here](http://courses.washington.edu/css342/zander/css332/array.html). I unfortunately can't ask the teacher since I'm not in the class. My concern is with the section under "dynamically de...
2011/05/25
[ "https://Stackoverflow.com/questions/6122091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/349611/" ]
`int array[10];` declares the array size statically, that means it is fixed - which is the only major difference. It also might be allocated to be inside the function's stack frame, i.e. on the program's stack. You do not need to worry about using `delete []` on that kind of array, in fact, you might crash the program ...
Dynamically allocated: ``` int * pointerArray = new int[10]; ``` [BTW, this is a pointer to an array of 10 ints, NOT a pointer array] Statically allocated (possibly on the stack): ``` int array[10]; ``` Otherwise they are the same.
6,122,091
I'm familiar with Java and trying to teach myself C/C++. I'm stealing some curriculum from a class that is hosting their materials [here](http://courses.washington.edu/css342/zander/css332/array.html). I unfortunately can't ask the teacher since I'm not in the class. My concern is with the section under "dynamically de...
2011/05/25
[ "https://Stackoverflow.com/questions/6122091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/349611/" ]
`int array[10];` declares the array size statically, that means it is fixed - which is the only major difference. It also might be allocated to be inside the function's stack frame, i.e. on the program's stack. You do not need to worry about using `delete []` on that kind of array, in fact, you might crash the program ...
On the one hand: ``` int ar[10]; ``` is using memory allocated on the stack. You can think of it also locally available and while it is possible to pass a pointer / reference to otehr functions, the memory will be freed as soon as it goes out of scope (in your example at the end of the main method but that's usually...
6,122,091
I'm familiar with Java and trying to teach myself C/C++. I'm stealing some curriculum from a class that is hosting their materials [here](http://courses.washington.edu/css342/zander/css332/array.html). I unfortunately can't ask the teacher since I'm not in the class. My concern is with the section under "dynamically de...
2011/05/25
[ "https://Stackoverflow.com/questions/6122091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/349611/" ]
> > My understanding is that an array in C is simply a reference to the memory address of the first element in the array. > > > So, what is the difference between int \*pointerArray = new int[10]; and int array[10]; if any? > > > What you mention is the reason for much confusion in any C/C++ beginner. In C/C++,...
There is a difference but not in the area that you point to. `*pointerArray` will point to the beginning of a block of memory of size 10 bytes. So will `array`. The only difference will be where it is stored in memory. `pointerArray` is dynamically assigned memory (at `run-time`) and hence will go on the heap, while `a...
6,122,091
I'm familiar with Java and trying to teach myself C/C++. I'm stealing some curriculum from a class that is hosting their materials [here](http://courses.washington.edu/css342/zander/css332/array.html). I unfortunately can't ask the teacher since I'm not in the class. My concern is with the section under "dynamically de...
2011/05/25
[ "https://Stackoverflow.com/questions/6122091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/349611/" ]
`int array[10];` declares the array size statically, that means it is fixed - which is the only major difference. It also might be allocated to be inside the function's stack frame, i.e. on the program's stack. You do not need to worry about using `delete []` on that kind of array, in fact, you might crash the program ...
> > My understanding is that an array in C is simply a reference to the memory address of the first element in the array. > > > So, what is the difference between int \*pointerArray = new int[10]; and int array[10]; if any? > > > What you mention is the reason for much confusion in any C/C++ beginner. In C/C++,...
6,122,091
I'm familiar with Java and trying to teach myself C/C++. I'm stealing some curriculum from a class that is hosting their materials [here](http://courses.washington.edu/css342/zander/css332/array.html). I unfortunately can't ask the teacher since I'm not in the class. My concern is with the section under "dynamically de...
2011/05/25
[ "https://Stackoverflow.com/questions/6122091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/349611/" ]
Dynamically allocated: ``` int * pointerArray = new int[10]; ``` [BTW, this is a pointer to an array of 10 ints, NOT a pointer array] Statically allocated (possibly on the stack): ``` int array[10]; ``` Otherwise they are the same.
The main difference is that some operations that are allowed on pointers are not allowed on arrays.
6,122,091
I'm familiar with Java and trying to teach myself C/C++. I'm stealing some curriculum from a class that is hosting their materials [here](http://courses.washington.edu/css342/zander/css332/array.html). I unfortunately can't ask the teacher since I'm not in the class. My concern is with the section under "dynamically de...
2011/05/25
[ "https://Stackoverflow.com/questions/6122091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/349611/" ]
`int array[10];` declares the array size statically, that means it is fixed - which is the only major difference. It also might be allocated to be inside the function's stack frame, i.e. on the program's stack. You do not need to worry about using `delete []` on that kind of array, in fact, you might crash the program ...
First, I'd look for some other place to learn C++. The page you cite is very confusing, and has little to do with the way one actually programs in C++. In C++, most of the time, you'd use `std::vector` for an array, not the complex solutions proposed on the page you cite. In practice, you never use `operator new[]` (an...
6,122,091
I'm familiar with Java and trying to teach myself C/C++. I'm stealing some curriculum from a class that is hosting their materials [here](http://courses.washington.edu/css342/zander/css332/array.html). I unfortunately can't ask the teacher since I'm not in the class. My concern is with the section under "dynamically de...
2011/05/25
[ "https://Stackoverflow.com/questions/6122091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/349611/" ]
> > My understanding is that an array in C is simply a reference to the memory address of the first element in the array. > > > So, what is the difference between int \*pointerArray = new int[10]; and int array[10]; if any? > > > What you mention is the reason for much confusion in any C/C++ beginner. In C/C++,...
First, I'd look for some other place to learn C++. The page you cite is very confusing, and has little to do with the way one actually programs in C++. In C++, most of the time, you'd use `std::vector` for an array, not the complex solutions proposed on the page you cite. In practice, you never use `operator new[]` (an...
6,122,091
I'm familiar with Java and trying to teach myself C/C++. I'm stealing some curriculum from a class that is hosting their materials [here](http://courses.washington.edu/css342/zander/css332/array.html). I unfortunately can't ask the teacher since I'm not in the class. My concern is with the section under "dynamically de...
2011/05/25
[ "https://Stackoverflow.com/questions/6122091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/349611/" ]
`int array[10];` declares the array size statically, that means it is fixed - which is the only major difference. It also might be allocated to be inside the function's stack frame, i.e. on the program's stack. You do not need to worry about using `delete []` on that kind of array, in fact, you might crash the program ...
It is true that you can get most of array functionality by using a pointer to its first element. But compiler knows that a static array is composed of several elements and the most notable difference is the result of the `sizeof` operator. `sizeof(pointerArray) = sizeof int*` `sizeof(array) = 10 * sizeof int`
6,122,091
I'm familiar with Java and trying to teach myself C/C++. I'm stealing some curriculum from a class that is hosting their materials [here](http://courses.washington.edu/css342/zander/css332/array.html). I unfortunately can't ask the teacher since I'm not in the class. My concern is with the section under "dynamically de...
2011/05/25
[ "https://Stackoverflow.com/questions/6122091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/349611/" ]
The problem with understanding C/C++ arrays when coming from Java is that C/C++ distinguishes between the array variable and the memory used to store the array contents. Both concepts are important and distinct. In Java, you really just have a reference to an object that is an array. You also need to understand that C...
The main difference is that some operations that are allowed on pointers are not allowed on arrays.
10,710,566
How to match different instances of the same word. Eg: if the string is synergy. How to match it with synergizes, synergism, synergically, synergistic. I could write the following: ``` while(<IN>) { chomp $_; my $line= $_; $word="Synergy"; if($line=~m/$word(\w+)/i) { $line=~s/$word/<Effect>$word<\/Effect>/...
2012/05/22
[ "https://Stackoverflow.com/questions/10710566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1226696/" ]
What you probably want to do is called stemming. However, for this to work, you have to stem all the words in the text plus the one you search for. Hopefully all of your listed words result in the same stem. I haven't tested it yet. ``` use Lingua::Stem; my $stemmer = Lingua::Stem->new( -locale => 'EN-UK' ); # first ...
You're going to want to use regular expressions. It is unclear what exactly the criteria you want to match, but in your example all the words start with "synergi" so `if($string =~ \bsynergi\w*\b)` would find all lines containing "synergi" anywhere in them.
10,710,566
How to match different instances of the same word. Eg: if the string is synergy. How to match it with synergizes, synergism, synergically, synergistic. I could write the following: ``` while(<IN>) { chomp $_; my $line= $_; $word="Synergy"; if($line=~m/$word(\w+)/i) { $line=~s/$word/<Effect>$word<\/Effect>/...
2012/05/22
[ "https://Stackoverflow.com/questions/10710566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1226696/" ]
What you probably want to do is called stemming. However, for this to work, you have to stem all the words in the text plus the one you search for. Hopefully all of your listed words result in the same stem. I haven't tested it yet. ``` use Lingua::Stem; my $stemmer = Lingua::Stem->new( -locale => 'EN-UK' ); # first ...
You might want to check out Text::Soundex. For example, ``` use Text::Soundex; # The following all return S562 print soundex("synergizes"), "\n"; print soundex("synergism"), "\n"; print soundex("synergically"), "\n"; print soundex("synergistic"), "\n"; ``` Further reading: [Perldoc Text::Soundex](http://perldoc.per...
161,687
You sometimes hear it said about Perl that there might be 6 different ways to approach the same problem. Good Perl developers usually have well-reasoned insights for making choices between the various possible methods of implementation. So an example Perl problem: A simple script which recursively iterates through a ...
2008/10/02
[ "https://Stackoverflow.com/questions/161687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19468/" ]
Others have mentioned File::Find, which is the way I'd go, but you asked for an iterator, which File::Find isn't (nor is File::Find::Rule). You might want to look at [File::Next](http://search.cpan.org/dist/File-Next/) or [File::Find::Object](http://search.cpan.org/dist/File-Find-Object/), which do have an iterative in...
My preferred method is to use the File::Find module as so: ``` use File::Find; find (\&checkFile, $directory_to_check_recursively); sub checkFile() { #examine each file in here. Filename is in $_ and you are chdired into it's directory #directory is also available in $File::Find::dir } ```
161,687
You sometimes hear it said about Perl that there might be 6 different ways to approach the same problem. Good Perl developers usually have well-reasoned insights for making choices between the various possible methods of implementation. So an example Perl problem: A simple script which recursively iterates through a ...
2008/10/02
[ "https://Stackoverflow.com/questions/161687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19468/" ]
This sounds like a job for [File::Find::Rule](http://search.cpan.org/perldoc?File::Find::Rule): ``` #!/usr/bin/perl use strict; use warnings; use autodie; # Causes built-ins like open to succeed or die. # You can 'use Fatal qw(open)' if autodie is not installed. use File::Find::Rule; use Getopt::Std; ...
[File::Find](http://search.cpan.org/~rgarcia/perl-5.10.0/lib/File/Find.pm) is the right way to solve this problem. There is no use in reimplementing stuff that already exists in other modules, but reimplementing something that is in a standard module should really be discouraged.
161,687
You sometimes hear it said about Perl that there might be 6 different ways to approach the same problem. Good Perl developers usually have well-reasoned insights for making choices between the various possible methods of implementation. So an example Perl problem: A simple script which recursively iterates through a ...
2008/10/02
[ "https://Stackoverflow.com/questions/161687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19468/" ]
Where the problem is solved mainly by standard libraries use them. File::Find in this case works nicely. There may be many ways to do things in perl, but where a very standard library exists to do something, it should be utilised unless it has problems of it's own. ``` #!/usr/bin/perl use strict; use File::Find(); ...
I write a subroutine that reads a directory with `readdir`, throws out the "." and ".." directories, recurses if it finds a new directory, and examines the files for what I'm looking for (in your case, you'll want to use `utime` or `stat`). By time the recursion is done, every file should have been examined. I think a...
161,687
You sometimes hear it said about Perl that there might be 6 different ways to approach the same problem. Good Perl developers usually have well-reasoned insights for making choices between the various possible methods of implementation. So an example Perl problem: A simple script which recursively iterates through a ...
2008/10/02
[ "https://Stackoverflow.com/questions/161687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19468/" ]
Others have mentioned File::Find, which is the way I'd go, but you asked for an iterator, which File::Find isn't (nor is File::Find::Rule). You might want to look at [File::Next](http://search.cpan.org/dist/File-Next/) or [File::Find::Object](http://search.cpan.org/dist/File-Find-Object/), which do have an iterative in...
I write a subroutine that reads a directory with `readdir`, throws out the "." and ".." directories, recurses if it finds a new directory, and examines the files for what I'm looking for (in your case, you'll want to use `utime` or `stat`). By time the recursion is done, every file should have been examined. I think a...
161,687
You sometimes hear it said about Perl that there might be 6 different ways to approach the same problem. Good Perl developers usually have well-reasoned insights for making choices between the various possible methods of implementation. So an example Perl problem: A simple script which recursively iterates through a ...
2008/10/02
[ "https://Stackoverflow.com/questions/161687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19468/" ]
My preferred method is to use the File::Find module as so: ``` use File::Find; find (\&checkFile, $directory_to_check_recursively); sub checkFile() { #examine each file in here. Filename is in $_ and you are chdired into it's directory #directory is also available in $File::Find::dir } ```
I write a subroutine that reads a directory with `readdir`, throws out the "." and ".." directories, recurses if it finds a new directory, and examines the files for what I'm looking for (in your case, you'll want to use `utime` or `stat`). By time the recursion is done, every file should have been examined. I think a...
161,687
You sometimes hear it said about Perl that there might be 6 different ways to approach the same problem. Good Perl developers usually have well-reasoned insights for making choices between the various possible methods of implementation. So an example Perl problem: A simple script which recursively iterates through a ...
2008/10/02
[ "https://Stackoverflow.com/questions/161687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19468/" ]
Where the problem is solved mainly by standard libraries use them. File::Find in this case works nicely. There may be many ways to do things in perl, but where a very standard library exists to do something, it should be utilised unless it has problems of it's own. ``` #!/usr/bin/perl use strict; use File::Find(); ...
I wrote [File::Find::Closures](http://search.cpan.org/dist/File-Find-Closures) as a set of closures that you can use with File::Find so you don't have to write your own. There's a couple of mtime functions that should handle ``` use File::Find; use File::Find::Closures qw(:all); my( $wanted, $list_reporter ) = find...
161,687
You sometimes hear it said about Perl that there might be 6 different ways to approach the same problem. Good Perl developers usually have well-reasoned insights for making choices between the various possible methods of implementation. So an example Perl problem: A simple script which recursively iterates through a ...
2008/10/02
[ "https://Stackoverflow.com/questions/161687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19468/" ]
This sounds like a job for [File::Find::Rule](http://search.cpan.org/perldoc?File::Find::Rule): ``` #!/usr/bin/perl use strict; use warnings; use autodie; # Causes built-ins like open to succeed or die. # You can 'use Fatal qw(open)' if autodie is not installed. use File::Find::Rule; use Getopt::Std; ...
Where the problem is solved mainly by standard libraries use them. File::Find in this case works nicely. There may be many ways to do things in perl, but where a very standard library exists to do something, it should be utilised unless it has problems of it's own. ``` #!/usr/bin/perl use strict; use File::Find(); ...
161,687
You sometimes hear it said about Perl that there might be 6 different ways to approach the same problem. Good Perl developers usually have well-reasoned insights for making choices between the various possible methods of implementation. So an example Perl problem: A simple script which recursively iterates through a ...
2008/10/02
[ "https://Stackoverflow.com/questions/161687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19468/" ]
My preferred method is to use the File::Find module as so: ``` use File::Find; find (\&checkFile, $directory_to_check_recursively); sub checkFile() { #examine each file in here. Filename is in $_ and you are chdired into it's directory #directory is also available in $File::Find::dir } ```
Using standard modules is indeed a good idea but out of interest here is my back to basic approach using no external modules. I know code syntax here might not be everyone's cup of tea. It could be improved to use less memory via providing an iterator access (input list could temporarily be on hold once it reaches a ...
161,687
You sometimes hear it said about Perl that there might be 6 different ways to approach the same problem. Good Perl developers usually have well-reasoned insights for making choices between the various possible methods of implementation. So an example Perl problem: A simple script which recursively iterates through a ...
2008/10/02
[ "https://Stackoverflow.com/questions/161687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19468/" ]
Where the problem is solved mainly by standard libraries use them. File::Find in this case works nicely. There may be many ways to do things in perl, but where a very standard library exists to do something, it should be utilised unless it has problems of it's own. ``` #!/usr/bin/perl use strict; use File::Find(); ...
There's my [File::Finder](http://search.cpan.org/perldoc/File::Finder), as already mentioned, but there's also my iterator-as-a-tied-hash solution from [Finding Files Incrementally (Linux Magazine)](http://www.stonehenge.com/merlyn/LinuxMag/col30.html).
161,687
You sometimes hear it said about Perl that there might be 6 different ways to approach the same problem. Good Perl developers usually have well-reasoned insights for making choices between the various possible methods of implementation. So an example Perl problem: A simple script which recursively iterates through a ...
2008/10/02
[ "https://Stackoverflow.com/questions/161687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19468/" ]
There's my [File::Finder](http://search.cpan.org/perldoc/File::Finder), as already mentioned, but there's also my iterator-as-a-tied-hash solution from [Finding Files Incrementally (Linux Magazine)](http://www.stonehenge.com/merlyn/LinuxMag/col30.html).
I'm riskying to get downvoted, but IMHO 'ls' (with appropriate params) command does it in a best known performant way. In this case it might be quite good solution to pipe 'ls' from perl code through shell, returning results to an array or hash. Edit: It could also be 'find' used, as proposed in comments.
11,497,749
I am transitioning to GlassFish 3.1.2, and can't seem to resolve a problem with authentication. The agenda is simple: I want a login bean to do programmatic authentication for a user. The authentication seems to work (the code goes past the login() method), but the server ends up shown 403 for the protected resources....
2012/07/16
[ "https://Stackoverflow.com/questions/11497749", "https://Stackoverflow.com", "https://Stackoverflow.com/users/590984/" ]
Oh, well, I guess this one is too deployment specific. I ended up re-conding the prototype in Spring for Tomcat stack. Works like charm now :).
i think you are not permitted jsf resources in spring security. add following line in security.xml in http tags. ``` <http .........> <intercept-url pattern="/javax.faces.resource/**" access="permitAll"/> </http> ```
20,876,772
I'm developing a multiple segment file downloader. To accomplish this task I'm currently creating as many temporary files on disk as segments I have (they are fixed in number during the file downloading). In the end I just create a new file `f` and copy all the segments' contents onto `f`. I was wondering if there's n...
2014/01/02
[ "https://Stackoverflow.com/questions/20876772", "https://Stackoverflow.com", "https://Stackoverflow.com/users/130758/" ]
Simply declare a parameter of type `Form` in the other's class constructor: ``` public class myClass { private Form otherForm; public myClass(Form form) { otherForm = form; } } ``` and call it from within `Form1`: ``` _myClass = new myClass(this); ```
Sure you can: ``` _myClass = new myClass(this); ```
20,876,772
I'm developing a multiple segment file downloader. To accomplish this task I'm currently creating as many temporary files on disk as segments I have (they are fixed in number during the file downloading). In the end I just create a new file `f` and copy all the segments' contents onto `f`. I was wondering if there's n...
2014/01/02
[ "https://Stackoverflow.com/questions/20876772", "https://Stackoverflow.com", "https://Stackoverflow.com/users/130758/" ]
You'd just do: ``` _myClass = new myClass(this); ``` And then change the constructor in myClass: ``` public class myClass { private Form1 theForm; public myClass(Form1 theForm) { this.theForm = theForm; } ... } ``` Now you can access the form from within the class. I think I'd avoid ...
Simply declare a parameter of type `Form` in the other's class constructor: ``` public class myClass { private Form otherForm; public myClass(Form form) { otherForm = form; } } ``` and call it from within `Form1`: ``` _myClass = new myClass(this); ```
20,876,772
I'm developing a multiple segment file downloader. To accomplish this task I'm currently creating as many temporary files on disk as segments I have (they are fixed in number during the file downloading). In the end I just create a new file `f` and copy all the segments' contents onto `f`. I was wondering if there's n...
2014/01/02
[ "https://Stackoverflow.com/questions/20876772", "https://Stackoverflow.com", "https://Stackoverflow.com/users/130758/" ]
Simply declare a parameter of type `Form` in the other's class constructor: ``` public class myClass { private Form otherForm; public myClass(Form form) { otherForm = form; } } ``` and call it from within `Form1`: ``` _myClass = new myClass(this); ```
Unless I'm missing something, this ought to be fairly straightforward: ``` public Form1(myClass instance) { InitializeComponent(); _myClass = instance; } ```
20,876,772
I'm developing a multiple segment file downloader. To accomplish this task I'm currently creating as many temporary files on disk as segments I have (they are fixed in number during the file downloading). In the end I just create a new file `f` and copy all the segments' contents onto `f`. I was wondering if there's n...
2014/01/02
[ "https://Stackoverflow.com/questions/20876772", "https://Stackoverflow.com", "https://Stackoverflow.com/users/130758/" ]
You'd just do: ``` _myClass = new myClass(this); ``` And then change the constructor in myClass: ``` public class myClass { private Form1 theForm; public myClass(Form1 theForm) { this.theForm = theForm; } ... } ``` Now you can access the form from within the class. I think I'd avoid ...
Sure you can: ``` _myClass = new myClass(this); ```
20,876,772
I'm developing a multiple segment file downloader. To accomplish this task I'm currently creating as many temporary files on disk as segments I have (they are fixed in number during the file downloading). In the end I just create a new file `f` and copy all the segments' contents onto `f`. I was wondering if there's n...
2014/01/02
[ "https://Stackoverflow.com/questions/20876772", "https://Stackoverflow.com", "https://Stackoverflow.com/users/130758/" ]
Sure you can: ``` _myClass = new myClass(this); ```
Unless I'm missing something, this ought to be fairly straightforward: ``` public Form1(myClass instance) { InitializeComponent(); _myClass = instance; } ```
20,876,772
I'm developing a multiple segment file downloader. To accomplish this task I'm currently creating as many temporary files on disk as segments I have (they are fixed in number during the file downloading). In the end I just create a new file `f` and copy all the segments' contents onto `f`. I was wondering if there's n...
2014/01/02
[ "https://Stackoverflow.com/questions/20876772", "https://Stackoverflow.com", "https://Stackoverflow.com/users/130758/" ]
I can't figure out what you want to achieve. but if you just want to pass this form than you can use this. ``` _myClass = new myClass(this); ```
Sure you can: ``` _myClass = new myClass(this); ```
20,876,772
I'm developing a multiple segment file downloader. To accomplish this task I'm currently creating as many temporary files on disk as segments I have (they are fixed in number during the file downloading). In the end I just create a new file `f` and copy all the segments' contents onto `f`. I was wondering if there's n...
2014/01/02
[ "https://Stackoverflow.com/questions/20876772", "https://Stackoverflow.com", "https://Stackoverflow.com/users/130758/" ]
You'd just do: ``` _myClass = new myClass(this); ``` And then change the constructor in myClass: ``` public class myClass { private Form1 theForm; public myClass(Form1 theForm) { this.theForm = theForm; } ... } ``` Now you can access the form from within the class. I think I'd avoid ...
Unless I'm missing something, this ought to be fairly straightforward: ``` public Form1(myClass instance) { InitializeComponent(); _myClass = instance; } ```
20,876,772
I'm developing a multiple segment file downloader. To accomplish this task I'm currently creating as many temporary files on disk as segments I have (they are fixed in number during the file downloading). In the end I just create a new file `f` and copy all the segments' contents onto `f`. I was wondering if there's n...
2014/01/02
[ "https://Stackoverflow.com/questions/20876772", "https://Stackoverflow.com", "https://Stackoverflow.com/users/130758/" ]
You'd just do: ``` _myClass = new myClass(this); ``` And then change the constructor in myClass: ``` public class myClass { private Form1 theForm; public myClass(Form1 theForm) { this.theForm = theForm; } ... } ``` Now you can access the form from within the class. I think I'd avoid ...
I can't figure out what you want to achieve. but if you just want to pass this form than you can use this. ``` _myClass = new myClass(this); ```
20,876,772
I'm developing a multiple segment file downloader. To accomplish this task I'm currently creating as many temporary files on disk as segments I have (they are fixed in number during the file downloading). In the end I just create a new file `f` and copy all the segments' contents onto `f`. I was wondering if there's n...
2014/01/02
[ "https://Stackoverflow.com/questions/20876772", "https://Stackoverflow.com", "https://Stackoverflow.com/users/130758/" ]
I can't figure out what you want to achieve. but if you just want to pass this form than you can use this. ``` _myClass = new myClass(this); ```
Unless I'm missing something, this ought to be fairly straightforward: ``` public Form1(myClass instance) { InitializeComponent(); _myClass = instance; } ```
17,008,230
I am currently using eclipse for working with Java. Additionaly I use git to synchronize my project between my laptop and my desktop PC. The problem is now the following: I added external JARs to the project (Slick-Util, LWJGL). But the path to each library is another on each device. So everytime I start working ...
2013/06/09
[ "https://Stackoverflow.com/questions/17008230", "https://Stackoverflow.com", "https://Stackoverflow.com/users/970549/" ]
add jar files to a lib folder inside your project like this : D:\Workspace\myproject\lib\your-jar-file.jar then go to your projects build path select libraries tab and click on *add jars* and **NOT** *add external jars* this way your jar files path will be relative to your project **EDIT :** I highly recommend to us...
Up until now i usually use svn so i'm not entirely sure how it works out in git, but have you tried to store the JARs in the lib folder of the project they are used in? (Eclipse displays the lib folder so you can easiely add them to the buildpath with a right click on the library in the package explorer.) That way the ...
17,008,230
I am currently using eclipse for working with Java. Additionaly I use git to synchronize my project between my laptop and my desktop PC. The problem is now the following: I added external JARs to the project (Slick-Util, LWJGL). But the path to each library is another on each device. So everytime I start working ...
2013/06/09
[ "https://Stackoverflow.com/questions/17008230", "https://Stackoverflow.com", "https://Stackoverflow.com/users/970549/" ]
Just don't add the libraries' jars to git. There are multiple build tools for java, which manage dependencies for you - you just state the libraries you're going to use, and the build tool downloads it for you at build time. I would recommend [Gradle](http://www.gradle.org/), but [Maven](http://maven.apache.org/) is a...
add jar files to a lib folder inside your project like this : D:\Workspace\myproject\lib\your-jar-file.jar then go to your projects build path select libraries tab and click on *add jars* and **NOT** *add external jars* this way your jar files path will be relative to your project **EDIT :** I highly recommend to us...
17,008,230
I am currently using eclipse for working with Java. Additionaly I use git to synchronize my project between my laptop and my desktop PC. The problem is now the following: I added external JARs to the project (Slick-Util, LWJGL). But the path to each library is another on each device. So everytime I start working ...
2013/06/09
[ "https://Stackoverflow.com/questions/17008230", "https://Stackoverflow.com", "https://Stackoverflow.com/users/970549/" ]
add jar files to a lib folder inside your project like this : D:\Workspace\myproject\lib\your-jar-file.jar then go to your projects build path select libraries tab and click on *add jars* and **NOT** *add external jars* this way your jar files path will be relative to your project **EDIT :** I highly recommend to us...
You can simply use -f flag on add command. ``` git add -f test.jar ``` And, then commit and push to your repo.
17,008,230
I am currently using eclipse for working with Java. Additionaly I use git to synchronize my project between my laptop and my desktop PC. The problem is now the following: I added external JARs to the project (Slick-Util, LWJGL). But the path to each library is another on each device. So everytime I start working ...
2013/06/09
[ "https://Stackoverflow.com/questions/17008230", "https://Stackoverflow.com", "https://Stackoverflow.com/users/970549/" ]
Just don't add the libraries' jars to git. There are multiple build tools for java, which manage dependencies for you - you just state the libraries you're going to use, and the build tool downloads it for you at build time. I would recommend [Gradle](http://www.gradle.org/), but [Maven](http://maven.apache.org/) is a...
Up until now i usually use svn so i'm not entirely sure how it works out in git, but have you tried to store the JARs in the lib folder of the project they are used in? (Eclipse displays the lib folder so you can easiely add them to the buildpath with a right click on the library in the package explorer.) That way the ...
17,008,230
I am currently using eclipse for working with Java. Additionaly I use git to synchronize my project between my laptop and my desktop PC. The problem is now the following: I added external JARs to the project (Slick-Util, LWJGL). But the path to each library is another on each device. So everytime I start working ...
2013/06/09
[ "https://Stackoverflow.com/questions/17008230", "https://Stackoverflow.com", "https://Stackoverflow.com/users/970549/" ]
Just don't add the libraries' jars to git. There are multiple build tools for java, which manage dependencies for you - you just state the libraries you're going to use, and the build tool downloads it for you at build time. I would recommend [Gradle](http://www.gradle.org/), but [Maven](http://maven.apache.org/) is a...
You can simply use -f flag on add command. ``` git add -f test.jar ``` And, then commit and push to your repo.
67,868,175
I need to include jinja templating in element.innerHTML but jinja is not working. Code script.js: ``` contentDiv.innerHTML = getContent(fragmentId); function getContent(fragmentId) { var pages = { quad1: ` <form class="form-inline" method="POST" id="form1"> <h3> <...
2021/06/07
[ "https://Stackoverflow.com/questions/67868175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15879415/" ]
Sure you can write your own Functional Interface(s), despite as many as possible will be nearly infinite (bound by size limitations of source and code files!) The Functional Interfaces are specified in [JLS 9.8](https://docs.oracle.com/javase/specs/jls/se16/html/jls-9.html#jls-9.8) - basically an `interface` with a si...
A few years ago I created this set of generic functional interfaces with zero to three arguments, with and without return value. It covered 99% of my use cases since Java 8. ``` /** * Functional Interfaces */ public class Functions { /** 0 args, with return value */ @FunctionalInterface public static interface...
27,755,437
I have this code: ``` CGRect screenRect = [[UIScreen mainScreen] bounds]; CGFloat screenWidth = screenRect.size.width; NSLog([NSString stringWithFormat:@"\n%g pixel \n=======================================",screenWidth]); CGFloat imageWidth = [[self.widthArray objectAtIndex:indexPath.row] floatValue];...
2015/01/03
[ "https://Stackoverflow.com/questions/27755437", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3927513/" ]
If you see `(lldb)` in the console you've most likely hit a breakpoint. If you haven't added a breakpoint there yourself there might be an exception breakpoint in your project, catching all uncaught exceptions. Try clicking on the "play" looking button above the console, that should continue the execution (or at least...
``` CGRect screenRect = [[UIScreen mainScreen] bounds]; CGFloat screenWidth = screenRect.size.width; NSLog(@"Screen width = %f pixel", (float) screenWidth); CGFloat imageWidth = [[self.widthArray objectAtIndex:indexPath.row] floatValue]; NSLog(@"Image width = %f pixel", (float) imageWidth]); CGFloat ratio = screenWidth...
12,978,404
I got the following query: ``` SELECT ur.repair_id, ur.repair_complete, ur.repair_noted_by_client, ur.repair_problem, ur.added_at, ur.added_by, ur.repaired_at, ur.repaired_by, aa.account_fullname AS added_by_name, ar.account_fullname AS repaired_by_name FROM units_re...
2012/10/19
[ "https://Stackoverflow.com/questions/12978404", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1009061/" ]
You are joining with inner query: ``` SELECT account_id, account_fullname FROM accounts LIMIT 1 ``` where you have `LIMIT 1`, which gives you only one row (which probably has repaired\_by = 1), and then you want to filter and get only rows where repaired\_by is 2...and you don't have that one.
Probably there are no records that satisfy the condition `repaired_by = 2` in the line, ``` LEFT JOIN (SELECT account_id, account_fullname FROM accounts LIMIT 1) AS ar ON ar.account_id = ur.repaired_by ``` Hence, `ar.account_id = ur.repaired_by` returns NULL.
7,268
This is the basic layout of our apartment (not exactly to scale): ``` |==========--------====---------------------======| | | | | | | | | | | | Master | | | Bedroom | Be...
2015/06/01
[ "https://lifehacks.stackexchange.com/questions/7268", "https://lifehacks.stackexchange.com", "https://lifehacks.stackexchange.com/users/6941/" ]
First, stop the extra heat from the window by putting up plastic in the window. Painters plastic should be good, just get a correctly sized piece and tape it up, making sure to completely seal the plastic to the window frame. Next, I would put a big fan in a cold part of the living room and aim it down the hall to yo...
Two options spring to mind. First is to relocate into the living room with your computers as that room seems to be the coolest. In one flat I lived in I swapped rooms so that the master bed room became the living room and vice versa. The other thought was that instead of blocking vent 1, which might damage the vent, ...
46,299,115
In my app I am sending post request with string value with Jquery, then in controller, passed string value is used to get some data from API. Next controller returns a view and model with data from API inside. That data from model I want to put inside values of few textboxes. The main problem is that I dont know how...
2017/09/19
[ "https://Stackoverflow.com/questions/46299115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8082886/" ]
At this point you're not really working with "views and models" in the ASP.NET MVC sense, you're simply working with JavaScript/jQuery to update your DOM. How you do that depends on the data you have and is done entirely in here: ``` success: function (data) { } ``` So what's in `data`? This implies that you have ...
You need to use the `success: function(data)` listener inside your AJAX request. Get your `data` and parse it into the div.
101,113
What happens if you encrypt data with a good cypher that produces a cyphertext that looks random (say, AES but avoiding ECB mode), and then apply a Vigenere cypher to the encrypted random-looking data? 1. Encrypt data so it looks random (for example with AES-CBC) 2. Choose a long random binary key for Vigenere (for ex...
2022/07/21
[ "https://crypto.stackexchange.com/questions/101113", "https://crypto.stackexchange.com", "https://crypto.stackexchange.com/users/102959/" ]
If you already encrypted with a strong cipher (e.g AES-256) and a strong secret key, the data is secure without Vigenere applied on top. Adding a Vigenere layer on top won't hurt security but what is it's purpose? Vigenere is usually very easy to break using frequency analasis however if the data input into Vigenere i...
The answer is somewhere between a bad idea and perfect security. If the key is as long as the message or even longer, your Vigenere cypher becomes a One Time Pad. The latter is perfectly secure, but not good for practice. One the other hand: Normal Vigenere is easy and fast to solve computationally. Therefore you may ...
5,774,158
I'm trying to run the following MySQL query: ``` SELECT * FROM user u JOIN user_categories uc ON u.user_id = uc.user_id WHERE (uc.category_id = 3 OR uc.category_id = 1) ``` It currently returns: ``` Joe,Smith,60657,male Joe,Smith,60657,male Mickey,Mouse,60613,female Petter,Pan,60625,male Petter,Pan,60625,male D...
2011/04/25
[ "https://Stackoverflow.com/questions/5774158", "https://Stackoverflow.com", "https://Stackoverflow.com/users/215863/" ]
You need a semi join. This can be achieved with a sub query. ``` SELECT * FROM user u WHERE EXISTS(SELECT * FROM user_categories uc WHERE u.user_id = uc.user_id AND uc.category_id IN(1,3)) ``` In MySQL the performance of sub queries is quite problematic however so a `JOIN` and duplicate el...
Try using a GROUP BY ``` SELECT * FROM user u JOIN user_categories uc ON u.user_id = uc.user_id WHERE uc.category_id = 3 OR uc.category_id = 1 GROUP BY u.user_id ```
5,774,158
I'm trying to run the following MySQL query: ``` SELECT * FROM user u JOIN user_categories uc ON u.user_id = uc.user_id WHERE (uc.category_id = 3 OR uc.category_id = 1) ``` It currently returns: ``` Joe,Smith,60657,male Joe,Smith,60657,male Mickey,Mouse,60613,female Petter,Pan,60625,male Petter,Pan,60625,male D...
2011/04/25
[ "https://Stackoverflow.com/questions/5774158", "https://Stackoverflow.com", "https://Stackoverflow.com/users/215863/" ]
You need a semi join. This can be achieved with a sub query. ``` SELECT * FROM user u WHERE EXISTS(SELECT * FROM user_categories uc WHERE u.user_id = uc.user_id AND uc.category_id IN(1,3)) ``` In MySQL the performance of sub queries is quite problematic however so a `JOIN` and duplicate el...
I don't know about MySQL, but in Postgres you *may* get better performance in the semi-join version from ``` SELECT * FROM user u WHERE u.user_id IN (SELECT user_id FROM user_categories uc WHERE uc.category_id IN (1,3)); ``` I would expect `SELECT DISTINCT` to run fastest but I have learned my expectations and DB ...
5,774,158
I'm trying to run the following MySQL query: ``` SELECT * FROM user u JOIN user_categories uc ON u.user_id = uc.user_id WHERE (uc.category_id = 3 OR uc.category_id = 1) ``` It currently returns: ``` Joe,Smith,60657,male Joe,Smith,60657,male Mickey,Mouse,60613,female Petter,Pan,60625,male Petter,Pan,60625,male D...
2011/04/25
[ "https://Stackoverflow.com/questions/5774158", "https://Stackoverflow.com", "https://Stackoverflow.com/users/215863/" ]
I don't know about MySQL, but in Postgres you *may* get better performance in the semi-join version from ``` SELECT * FROM user u WHERE u.user_id IN (SELECT user_id FROM user_categories uc WHERE uc.category_id IN (1,3)); ``` I would expect `SELECT DISTINCT` to run fastest but I have learned my expectations and DB ...
Try using a GROUP BY ``` SELECT * FROM user u JOIN user_categories uc ON u.user_id = uc.user_id WHERE uc.category_id = 3 OR uc.category_id = 1 GROUP BY u.user_id ```
3,096,420
I have this problem with my homework 6. Let $E$ be a non-empty bounded set of real numbers and put $\alpha = \sup E ,$ and $\beta = \inf E$ . Assume that $\alpha \notin E$ and $\beta \notin E .$ Which of the following statements is true and which is false. In each case justify your answer. (a) $E$ is an open set. (b...
2019/02/01
[ "https://math.stackexchange.com/questions/3096420", "https://math.stackexchange.com", "https://math.stackexchange.com/users/640177/" ]
This is a huge question... It depends on the precision you'd like and on the kind of input data you have. For discrete methods, you can use [Delaunay triangulation](https://en.wikipedia.org/wiki/Delaunay_triangulation). See for example [Delaunay Triangulation Algorithm and Application to Terrain Generation](http://pa...
RBF based interpolation worked great. I divide the world in degree blocks e.. 31-32 lat 40-41 lon would be one block, I sample about 40k elevation pts from each block and fit RBF Gaussian bumps, or multiquadric functions to smaller sections of a block. I save W matrix and lat, lons for the fit and I have my continuous ...
17,246,800
I'm currently messing around with Twitter API, but this question isn't really related to Twitter API; it's just a general PHP question. I'm pulling a couple queries of Tweets separately and then merging the requests together. And so, basically, I'm ending up with a final array something like this at the end of it all,...
2013/06/22
[ "https://Stackoverflow.com/questions/17246800", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1391400/" ]
There's two parts to this question. First, you need a way to compare two times - a straight string comparison of the time in the given format won't give you any useful information. You can use [`strtotime()`](http://ca3.php.net/manual/en/function.strtotime.php) to convert the strings to a unix timestamp that is just a...
Use [array\_multisort](http://php.net/manual/en/function.array-multisort.php). ``` // Obtain a list of columns foreach ($tweets as $key => $row) { $text[$key] = $row['text']; $time[$key] = strtotime($row['time']); } array_multisort($time, SORT_DESC); ```
57,248,774
I have the dataframe, from that I converted to ndarray, ``` X = df.iloc[:].values ``` then I did the feature selection which gives me some columns [3,45,67,89,101,145,...] as there are many columns may I know how to get back the corresponding column names in the dataframe The reverse I can do using below code ``...
2019/07/29
[ "https://Stackoverflow.com/questions/57248774", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11053801/" ]
You can use [`object.keys([schema])`](https://joi.dev/api/#objectkeysschema), which > > Sets or extends the allowed object keys where: > > > > > * `schema` - optional object where each key is assigned a **joi** type object. > If `schema` is `{}` no keys allowed. If `schema` is `null` or `undefined`, any > key al...
Simply you can [spread](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax#Spread_in_object_literals) the `user` inside `ownerSchema`: ``` const ownerSchema = { ...user, /* owner specific fields goes here */ }; ```
3,061,094
Given an integer $n \in \Bbb{Z}$, we understand $\root 3 \of n$ to mean the number $x \in \Bbb{R}$ such that $x^3 - n = 0$. Then $\Bbb{Q}(\root 3 \of n) \subset \Bbb{R}$, right? The same then goes for the ring of algebraic integers $\mathcal{O}\_{\Bbb{Q}(\root 3 \of n)}$. Since $\root 3 \of {-n} = -\root 3 \of n$, it ...
2019/01/03
[ "https://math.stackexchange.com/questions/3061094", "https://math.stackexchange.com", "https://math.stackexchange.com/users/215060/" ]
Things are so easy at algebraic degree $1$, we only have $\textbf Z$ to worry about. At algebraic degree $2$, we have infinitely many real quadratic integer rings and infinitely many imaginary quadratic integer rings, but it still feels manageable because we're only dealing with two kinds of rings, plus $\textbf Z$. ...
Hmmm... our own Franz Lemmermeyer really needs to weigh in on this one. Seven years ago he wrote a paper on the "simplest cubic fields" in *Manuscripta Mathematica*. There are * Simply real cubic rings * Totally real cubic rings I'm not sure what the distinction is. Then of course there are imaginary cubic rings, wh...
3,061,094
Given an integer $n \in \Bbb{Z}$, we understand $\root 3 \of n$ to mean the number $x \in \Bbb{R}$ such that $x^3 - n = 0$. Then $\Bbb{Q}(\root 3 \of n) \subset \Bbb{R}$, right? The same then goes for the ring of algebraic integers $\mathcal{O}\_{\Bbb{Q}(\root 3 \of n)}$. Since $\root 3 \of {-n} = -\root 3 \of n$, it ...
2019/01/03
[ "https://math.stackexchange.com/questions/3061094", "https://math.stackexchange.com", "https://math.stackexchange.com/users/215060/" ]
It is a bit unclear to me exactly what kind of an answer you are looking for. Listing the following points that occurred to me while reading the question. 1. You don't need to use $\omega$ to get a cubic extension field containing non-real numbers. Any cubic polynomial $f(x)$, irreducible over $\Bbb{Q}$, such that $f$...
Hmmm... our own Franz Lemmermeyer really needs to weigh in on this one. Seven years ago he wrote a paper on the "simplest cubic fields" in *Manuscripta Mathematica*. There are * Simply real cubic rings * Totally real cubic rings I'm not sure what the distinction is. Then of course there are imaginary cubic rings, wh...
3,061,094
Given an integer $n \in \Bbb{Z}$, we understand $\root 3 \of n$ to mean the number $x \in \Bbb{R}$ such that $x^3 - n = 0$. Then $\Bbb{Q}(\root 3 \of n) \subset \Bbb{R}$, right? The same then goes for the ring of algebraic integers $\mathcal{O}\_{\Bbb{Q}(\root 3 \of n)}$. Since $\root 3 \of {-n} = -\root 3 \of n$, it ...
2019/01/03
[ "https://math.stackexchange.com/questions/3061094", "https://math.stackexchange.com", "https://math.stackexchange.com/users/215060/" ]
I am copying the information below from [Daniel Harrer's diploma thesis](https://www.iazd.uni-hannover.de/fileadmin/institut/derenthal/papers/diplom-harrer.pdf), section 2.3; I believe it is originally due to Delone and Fadeev. For any integers $a$, $b$, $c$, $d$, there is a commutative associative ring with basis $1$...
Hmmm... our own Franz Lemmermeyer really needs to weigh in on this one. Seven years ago he wrote a paper on the "simplest cubic fields" in *Manuscripta Mathematica*. There are * Simply real cubic rings * Totally real cubic rings I'm not sure what the distinction is. Then of course there are imaginary cubic rings, wh...
11,204,894
I am working on an android project, the application is already built but just in order to improve the user interface. I am working on restyling the application. For that I am also trying to use a custom font, but that is not working. I have gone through the sample codes available on the web but none doesn't solve my p...
2012/06/26
[ "https://Stackoverflow.com/questions/11204894", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1175682/" ]
Did you forget the namespace? ``` <com.crittermap.backcountrynavigator.dialog.MyTextView android:id="@+id/offlinesummary" android:layout_marginLeft="5dip" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_toLeftOf="@id/offline...
Try to add the layout width and height. Then, execute the program.
11,204,894
I am working on an android project, the application is already built but just in order to improve the user interface. I am working on restyling the application. For that I am also trying to use a custom font, but that is not working. I have gone through the sample codes available on the web but none doesn't solve my p...
2012/06/26
[ "https://Stackoverflow.com/questions/11204894", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1175682/" ]
Did you forget the namespace? ``` <com.crittermap.backcountrynavigator.dialog.MyTextView android:id="@+id/offlinesummary" android:layout_marginLeft="5dip" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_toLeftOf="@id/offline...
change your code as ``` public class MyTextView extends TextView { private Paint mPaint; float middleY=1; float mX=30; float DY=30; public MyTextView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); init(); } public MyTextView(Context context, A...
11,204,894
I am working on an android project, the application is already built but just in order to improve the user interface. I am working on restyling the application. For that I am also trying to use a custom font, but that is not working. I have gone through the sample codes available on the web but none doesn't solve my p...
2012/06/26
[ "https://Stackoverflow.com/questions/11204894", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1175682/" ]
Did you forget the namespace? ``` <com.crittermap.backcountrynavigator.dialog.MyTextView android:id="@+id/offlinesummary" android:layout_marginLeft="5dip" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_toLeftOf="@id/offline...
try this ``` <com.crittermap.backcountrynavigator.dialog.MyTextView android:id="@+id/offlinesummary" android:layout_marginLeft="5dip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" ...
11,204,894
I am working on an android project, the application is already built but just in order to improve the user interface. I am working on restyling the application. For that I am also trying to use a custom font, but that is not working. I have gone through the sample codes available on the web but none doesn't solve my p...
2012/06/26
[ "https://Stackoverflow.com/questions/11204894", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1175682/" ]
Did you forget the namespace? ``` <com.crittermap.backcountrynavigator.dialog.MyTextView android:id="@+id/offlinesummary" android:layout_marginLeft="5dip" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_toLeftOf="@id/offline...
u have to use in xml as given below ``` <com.crittermap.backcountrynavigator.dialog.MyTextView android:id="@+id/offlinesummary" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="5dip" android:layout_alignParentBott...
12,899,282
I've started building Linux installers on the 64 bit windows version of Install4j recently and am getting the error below when it the generated installers start to do their extraction. Is this something I'm doing wrong or is unsupported? Or a bug in 5.1 of install4j. I've recently upgraded to it as well. ``` Extracti...
2012/10/15
[ "https://Stackoverflow.com/questions/12899282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1192789/" ]
You are cloning the div **but not inserting** it anywhere in your DOM.. So it is non existent until you do that ``` var off = $(this).offset(); var div = $('#testtt').clone(); div.css({ position: "absolute", top: off.top, left: off.left }); $('body').append(div); <-- Appending to body here.. You can append anywher...
Probably an issue with duplicate id's From the [API page](http://api.jquery.com/clone/): > > Note: Using .clone() has the side-effect of producing elements with > duplicate id attributes, which are supposed to be unique. Where > possible, it is recommended to avoid cloning elements with this > attribute or using ...
12,899,282
I've started building Linux installers on the 64 bit windows version of Install4j recently and am getting the error below when it the generated installers start to do their extraction. Is this something I'm doing wrong or is unsupported? Or a bug in 5.1 of install4j. I've recently upgraded to it as well. ``` Extracti...
2012/10/15
[ "https://Stackoverflow.com/questions/12899282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1192789/" ]
You need to append div to your page. Currently, you have just created a reference to the clone without displaying it. $("body").append(div);
in Jquery ``` $('.addRow').click(function(){ var off = $(this).offset(); var div = $('#testtt').clone(); div.css({ position: "absolute", top: off.top, left: off.left }); div.show(); div.appendTo($("#testtt"); ``` })
12,899,282
I've started building Linux installers on the 64 bit windows version of Install4j recently and am getting the error below when it the generated installers start to do their extraction. Is this something I'm doing wrong or is unsupported? Or a bug in 5.1 of install4j. I've recently upgraded to it as well. ``` Extracti...
2012/10/15
[ "https://Stackoverflow.com/questions/12899282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1192789/" ]
You need to append div to your page. Currently, you have just created a reference to the clone without displaying it. $("body").append(div);
As per the comment from @andrewWhitaker, you need to add the new element to the DOM. e.g. ``` div.attr('id').val( div.attr('id')+"_cloned" ); $("#my_container_element_id").append(div); ``` You can also remove the ``` div.show(); ```
12,899,282
I've started building Linux installers on the 64 bit windows version of Install4j recently and am getting the error below when it the generated installers start to do their extraction. Is this something I'm doing wrong or is unsupported? Or a bug in 5.1 of install4j. I've recently upgraded to it as well. ``` Extracti...
2012/10/15
[ "https://Stackoverflow.com/questions/12899282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1192789/" ]
You are cloning the div **but not inserting** it anywhere in your DOM.. So it is non existent until you do that ``` var off = $(this).offset(); var div = $('#testtt').clone(); div.css({ position: "absolute", top: off.top, left: off.left }); $('body').append(div); <-- Appending to body here.. You can append anywher...
You have to attach the cloned div somewhere inside your html. For example: ``` var off = $(this).offset(); var div = $('#testtt').clone(); div.css({ position: "absolute", top: off.top, left: off.left }); // append to parent of "this" var parent = $(this).parent(); div.appendTo(parent); // should be unnecessary, exce...
12,899,282
I've started building Linux installers on the 64 bit windows version of Install4j recently and am getting the error below when it the generated installers start to do their extraction. Is this something I'm doing wrong or is unsupported? Or a bug in 5.1 of install4j. I've recently upgraded to it as well. ``` Extracti...
2012/10/15
[ "https://Stackoverflow.com/questions/12899282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1192789/" ]
You need to append div to your page. Currently, you have just created a reference to the clone without displaying it. $("body").append(div);
Probably an issue with duplicate id's From the [API page](http://api.jquery.com/clone/): > > Note: Using .clone() has the side-effect of producing elements with > duplicate id attributes, which are supposed to be unique. Where > possible, it is recommended to avoid cloning elements with this > attribute or using ...
12,899,282
I've started building Linux installers on the 64 bit windows version of Install4j recently and am getting the error below when it the generated installers start to do their extraction. Is this something I'm doing wrong or is unsupported? Or a bug in 5.1 of install4j. I've recently upgraded to it as well. ``` Extracti...
2012/10/15
[ "https://Stackoverflow.com/questions/12899282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1192789/" ]
You are cloning the div **but not inserting** it anywhere in your DOM.. So it is non existent until you do that ``` var off = $(this).offset(); var div = $('#testtt').clone(); div.css({ position: "absolute", top: off.top, left: off.left }); $('body').append(div); <-- Appending to body here.. You can append anywher...
You need to append it to another element by using `append()` or `appendTo()`.
12,899,282
I've started building Linux installers on the 64 bit windows version of Install4j recently and am getting the error below when it the generated installers start to do their extraction. Is this something I'm doing wrong or is unsupported? Or a bug in 5.1 of install4j. I've recently upgraded to it as well. ``` Extracti...
2012/10/15
[ "https://Stackoverflow.com/questions/12899282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1192789/" ]
You have to attach the cloned div somewhere inside your html. For example: ``` var off = $(this).offset(); var div = $('#testtt').clone(); div.css({ position: "absolute", top: off.top, left: off.left }); // append to parent of "this" var parent = $(this).parent(); div.appendTo(parent); // should be unnecessary, exce...
Probably an issue with duplicate id's From the [API page](http://api.jquery.com/clone/): > > Note: Using .clone() has the side-effect of producing elements with > duplicate id attributes, which are supposed to be unique. Where > possible, it is recommended to avoid cloning elements with this > attribute or using ...