Search is not available for this dataset
qid int64 1 74.7M | question stringlengths 1 70k | date stringlengths 10 10 | metadata list | response_j stringlengths 0 115k | response_k stringlengths 0 60.5k |
|---|---|---|---|---|---|
3,195,720 | I know the question has been asked thousands of times, but I'll ask it again: is there a way (even patchy) to write/read a dumb text file with Javascript or Protoype ?
This is only for debug purposes, and is not designed for production. The thing is I need it to work with (at least) both Firefox and IE (preferably und... | 2010/07/07 | [
"https://Stackoverflow.com/questions/3195720",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/277128/"
] | Javascript in browsers doesn't allow you to write local files, for **security reasons**. This **may change with time**, but as for now you have to **deal with it**. | What about cookies? It is accessible via javascript, it is on your client and it is a plain text file. Only issue is the size of it (4k max if I remember well).
What you can do as well is use your browser localStorage / userData / globalStorage (depending on your browser version). It acts like cookies (new webStorage ... |
3,195,720 | I know the question has been asked thousands of times, but I'll ask it again: is there a way (even patchy) to write/read a dumb text file with Javascript or Protoype ?
This is only for debug purposes, and is not designed for production. The thing is I need it to work with (at least) both Firefox and IE (preferably und... | 2010/07/07 | [
"https://Stackoverflow.com/questions/3195720",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/277128/"
] | **It *is* possible to read/write to a local file via JavaScript**: take a look at [TiddlyWIki](http://www.tiddlywiki.com/). *(Caveat: only works for local documents.)*
I have actually written a [Single Page Application](http://softwareas.com/towards-a-single-page-application-framework) (SPA) using [twFile](http://jque... | Only with a server side javascript interpreter, but that isn't the typical environment you run javascript in. |
3,195,720 | I know the question has been asked thousands of times, but I'll ask it again: is there a way (even patchy) to write/read a dumb text file with Javascript or Protoype ?
This is only for debug purposes, and is not designed for production. The thing is I need it to work with (at least) both Firefox and IE (preferably und... | 2010/07/07 | [
"https://Stackoverflow.com/questions/3195720",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/277128/"
] | Only with a server side javascript interpreter, but that isn't the typical environment you run javascript in. | What about cookies? It is accessible via javascript, it is on your client and it is a plain text file. Only issue is the size of it (4k max if I remember well).
What you can do as well is use your browser localStorage / userData / globalStorage (depending on your browser version). It acts like cookies (new webStorage ... |
3,195,720 | I know the question has been asked thousands of times, but I'll ask it again: is there a way (even patchy) to write/read a dumb text file with Javascript or Protoype ?
This is only for debug purposes, and is not designed for production. The thing is I need it to work with (at least) both Firefox and IE (preferably und... | 2010/07/07 | [
"https://Stackoverflow.com/questions/3195720",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/277128/"
] | **It *is* possible to read/write to a local file via JavaScript**: take a look at [TiddlyWIki](http://www.tiddlywiki.com/). *(Caveat: only works for local documents.)*
I have actually written a [Single Page Application](http://softwareas.com/towards-a-single-page-application-framework) (SPA) using [twFile](http://jque... | What about cookies? It is accessible via javascript, it is on your client and it is a plain text file. Only issue is the size of it (4k max if I remember well).
What you can do as well is use your browser localStorage / userData / globalStorage (depending on your browser version). It acts like cookies (new webStorage ... |
945,527 | Isn't that nicely recursive?
I've got a portable command prompt on my external drive, and it has a nice .bat file to configure some initial settings, but I'd like more!
Here's what I know how to set from .bat:
* Colors = (color XY) where x and y are hex digits for the predefined colors
* Prompt = (prompt $p$g) set... | 2009/06/03 | [
"https://Stackoverflow.com/questions/945527",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/93221/"
] | Regarding setting the buffer size:
Using `mode con: cols=XX lines=YY` sets not only the window (screen) size, but the buffer size too.
If you specify a size allowed by your system, based on available screen size, you'll see that both window and buffer dimension are set to the same value; .e.g:
```
mode con: cols=100... | Regarding auto-completion:
>
> File and Directory name completion is
> NOT enabled by default. You can
> enable or disable file name completion
> for a particular invocation of CMD.EXE
> with the /F:ON or /F:OFF switch. You
> can enable or disable completion for
> all invocations of CMD.EXE on a
> machine and/... |
945,527 | Isn't that nicely recursive?
I've got a portable command prompt on my external drive, and it has a nice .bat file to configure some initial settings, but I'd like more!
Here's what I know how to set from .bat:
* Colors = (color XY) where x and y are hex digits for the predefined colors
* Prompt = (prompt $p$g) set... | 2009/06/03 | [
"https://Stackoverflow.com/questions/945527",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/93221/"
] | Regarding auto-completion:
>
> File and Directory name completion is
> NOT enabled by default. You can
> enable or disable file name completion
> for a particular invocation of CMD.EXE
> with the /F:ON or /F:OFF switch. You
> can enable or disable completion for
> all invocations of CMD.EXE on a
> machine and/... | For true Buffer Size adjustment use DOSKEY /LISTSIZE=size
You can't change colors within the shell anymore since Microsoft took ANSI ESC control out of the command/cmd prompts. |
945,527 | Isn't that nicely recursive?
I've got a portable command prompt on my external drive, and it has a nice .bat file to configure some initial settings, but I'd like more!
Here's what I know how to set from .bat:
* Colors = (color XY) where x and y are hex digits for the predefined colors
* Prompt = (prompt $p$g) set... | 2009/06/03 | [
"https://Stackoverflow.com/questions/945527",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/93221/"
] | Regarding setting the buffer size:
Using `mode con: cols=XX lines=YY` sets not only the window (screen) size, but the buffer size too.
If you specify a size allowed by your system, based on available screen size, you'll see that both window and buffer dimension are set to the same value; .e.g:
```
mode con: cols=100... | For true Buffer Size adjustment use DOSKEY /LISTSIZE=size
You can't change colors within the shell anymore since Microsoft took ANSI ESC control out of the command/cmd prompts. |
945,527 | Isn't that nicely recursive?
I've got a portable command prompt on my external drive, and it has a nice .bat file to configure some initial settings, but I'd like more!
Here's what I know how to set from .bat:
* Colors = (color XY) where x and y are hex digits for the predefined colors
* Prompt = (prompt $p$g) set... | 2009/06/03 | [
"https://Stackoverflow.com/questions/945527",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/93221/"
] | Regarding setting the buffer size:
Using `mode con: cols=XX lines=YY` sets not only the window (screen) size, but the buffer size too.
If you specify a size allowed by your system, based on available screen size, you'll see that both window and buffer dimension are set to the same value; .e.g:
```
mode con: cols=100... | You can set these values through a shortcut (.INK file).
I have a shortcut on my desktop with this as the target:
%windir%\system32\cmd.exe /K %userprofile%\STARTUP.CMD
The /K switch tells CMD.exe to run the batch file (which sets some variables, the prompt, etc.) and then stay open.
If you right-click on the short... |
945,527 | Isn't that nicely recursive?
I've got a portable command prompt on my external drive, and it has a nice .bat file to configure some initial settings, but I'd like more!
Here's what I know how to set from .bat:
* Colors = (color XY) where x and y are hex digits for the predefined colors
* Prompt = (prompt $p$g) set... | 2009/06/03 | [
"https://Stackoverflow.com/questions/945527",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/93221/"
] | You can set these values through a shortcut (.INK file).
I have a shortcut on my desktop with this as the target:
%windir%\system32\cmd.exe /K %userprofile%\STARTUP.CMD
The /K switch tells CMD.exe to run the batch file (which sets some variables, the prompt, etc.) and then stay open.
If you right-click on the short... | For true Buffer Size adjustment use DOSKEY /LISTSIZE=size
You can't change colors within the shell anymore since Microsoft took ANSI ESC control out of the command/cmd prompts. |
223,590 | Where does this meme come from (as in a *trip down memory lane*) ?
Is it from a book ? | 2015/01/25 | [
"https://english.stackexchange.com/questions/223590",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/64820/"
] | Christine Ammer, *The Facts on File Dictionary of Clichés*, second edition (2006) has this entry for the phrase "down memory lane":
>
> **down memory lane** Looking back on the past. Often put in a nostalgic way, this term may have originated as the title of a popular song of 1924, "Memory Lane," words by Bud de Sylv... | Merriam-Webster claims it was first used in 1903. There are mentions here:
[memory lane](https://www.google.it/search?lr=lang_en&tbo=p&tbm=bks&q=%22memory%20lane%22&tbs=,cdr:1,cd_min:Jan%201_2%201903,cd_max:Jan%2031_2%201906&num=10&gws_rd=cr,ssl&ei=-czEVLWpEZPZaseYgZAB),
that go back almost that far. Many of them r... |
41,983,979 | Configuring multiple sources for an agent throwing me lock error using FILE channel. Below is my config file.
```
a1.sources = r1 r2
a1.sinks = k1 k2
a1.channels = c1 c3
#sources
a1.sources.r1.type=netcat
a1.sources.r1.bind=localhost
a1.sources.r1.port=4444
a1.sources.r2.type=exec
a1.sources.r2.command=tail -f /opt/... | 2017/02/01 | [
"https://Stackoverflow.com/questions/41983979",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4029265/"
] | Check your php.ini for:
**session.gc\_maxlifetime** - Default 1440 secs - 24 mins
>
> **session.gc\_maxlifetime** specifies the number of seconds after which data will be seen as 'garbage' and potentially cleaned up. Garbage collection may occur during session start (depending on session.gc\_probability and session.... | Change `.env` file in your app root
```
SESSION_LIFETIME=120
```
And value is in minutes. |
41,983,979 | Configuring multiple sources for an agent throwing me lock error using FILE channel. Below is my config file.
```
a1.sources = r1 r2
a1.sinks = k1 k2
a1.channels = c1 c3
#sources
a1.sources.r1.type=netcat
a1.sources.r1.bind=localhost
a1.sources.r1.port=4444
a1.sources.r2.type=exec
a1.sources.r2.command=tail -f /opt/... | 2017/02/01 | [
"https://Stackoverflow.com/questions/41983979",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4029265/"
] | Check your php.ini for:
**session.gc\_maxlifetime** - Default 1440 secs - 24 mins
>
> **session.gc\_maxlifetime** specifies the number of seconds after which data will be seen as 'garbage' and potentially cleaned up. Garbage collection may occur during session start (depending on session.gc\_probability and session.... | I found lifetime settings on this place in one project...
*bootstrap/cache/config.php*
so I need to run first
```
php artisan config:clear
``` |
41,983,979 | Configuring multiple sources for an agent throwing me lock error using FILE channel. Below is my config file.
```
a1.sources = r1 r2
a1.sinks = k1 k2
a1.channels = c1 c3
#sources
a1.sources.r1.type=netcat
a1.sources.r1.bind=localhost
a1.sources.r1.port=4444
a1.sources.r2.type=exec
a1.sources.r2.command=tail -f /opt/... | 2017/02/01 | [
"https://Stackoverflow.com/questions/41983979",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4029265/"
] | Check your php.ini for:
**session.gc\_maxlifetime** - Default 1440 secs - 24 mins
>
> **session.gc\_maxlifetime** specifies the number of seconds after which data will be seen as 'garbage' and potentially cleaned up. Garbage collection may occur during session start (depending on session.gc\_probability and session.... | Please modify true to false for Expire on close as:
```
'expire_on_close' => false,
``` |
41,983,979 | Configuring multiple sources for an agent throwing me lock error using FILE channel. Below is my config file.
```
a1.sources = r1 r2
a1.sinks = k1 k2
a1.channels = c1 c3
#sources
a1.sources.r1.type=netcat
a1.sources.r1.bind=localhost
a1.sources.r1.port=4444
a1.sources.r2.type=exec
a1.sources.r2.command=tail -f /opt/... | 2017/02/01 | [
"https://Stackoverflow.com/questions/41983979",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4029265/"
] | Change `.env` file in your app root
```
SESSION_LIFETIME=120
```
And value is in minutes. | I found lifetime settings on this place in one project...
*bootstrap/cache/config.php*
so I need to run first
```
php artisan config:clear
``` |
41,983,979 | Configuring multiple sources for an agent throwing me lock error using FILE channel. Below is my config file.
```
a1.sources = r1 r2
a1.sinks = k1 k2
a1.channels = c1 c3
#sources
a1.sources.r1.type=netcat
a1.sources.r1.bind=localhost
a1.sources.r1.port=4444
a1.sources.r2.type=exec
a1.sources.r2.command=tail -f /opt/... | 2017/02/01 | [
"https://Stackoverflow.com/questions/41983979",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4029265/"
] | Change `.env` file in your app root
```
SESSION_LIFETIME=120
```
And value is in minutes. | Please modify true to false for Expire on close as:
```
'expire_on_close' => false,
``` |
41,983,979 | Configuring multiple sources for an agent throwing me lock error using FILE channel. Below is my config file.
```
a1.sources = r1 r2
a1.sinks = k1 k2
a1.channels = c1 c3
#sources
a1.sources.r1.type=netcat
a1.sources.r1.bind=localhost
a1.sources.r1.port=4444
a1.sources.r2.type=exec
a1.sources.r2.command=tail -f /opt/... | 2017/02/01 | [
"https://Stackoverflow.com/questions/41983979",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4029265/"
] | I found lifetime settings on this place in one project...
*bootstrap/cache/config.php*
so I need to run first
```
php artisan config:clear
``` | Please modify true to false for Expire on close as:
```
'expire_on_close' => false,
``` |
22,153,836 | I am curious as to why Start-Job increments in twos. My worry is that I am doing something wrong that makes the ID of a new job jump by 2.
```
Start-Job -ScriptBlock {Get-WinEvent -LogName system -MaxEvents 1000}
```
Results as shown by Get-Job
```
Id Name State HasMoreData Command ... | 2014/03/03 | [
"https://Stackoverflow.com/questions/22153836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/200586/"
] | Each time you start a job, it consists of a parent job and one or more child jobs. If you run `get-job | fl` you'll see the child jobs, and you'll see that their names are the "missing" odd numbered names. | @1.618 give the right answer, here are some more details :
```
Start-Job -ScriptBlock {Get-Process}
Id Name PSJobTypeName State HasMoreData Location Command
-- ---- ------------- ----- ----------- -------- ------- ... |
4,554,498 | I am creating a Chart (DataVisualization.Charting.Chart) programmatically, which is a Stacked Bar chart.
I am also adding Legend entries programmatically to it. I want to show the Legend at the bottom of the chart.
But, while doing so, the Legend overlapps with the X-axis of the chart.
Here is the code I am using:
... | 2010/12/29 | [
"https://Stackoverflow.com/questions/4554498",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/557172/"
] | I had the same problem today. Try adding:
```
objLegend.Position.Auto = true
objLegend.DockedToChartArea = "yourChartAreaName"
```
That did not help me but I found on the net that this might be helpful (and clean solution).
What actually worked for me was moving chart area to make space for legend so it no longer o... | I had an overlapping legend/chart area problem as well but none of the other suggestions here seemed to make any difference. I think the problem stems from legend text wrapping to two lines and the sizing algorithms not taking account of this.
The ideas here got me thinking more clearly about the problem though, and I... |
35,854,555 | We will be developing a new web site for a client who already has a Kentico 8.2 license. I am trying to make a case for developing the site using Kentico 9. Some key features I have found so far include:
* faster performance (how much in real-world terms?)
* better integration with .Net MVC
* content staging tasks can... | 2016/03/07 | [
"https://Stackoverflow.com/questions/35854555",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5971415/"
] | ### Preserving and Restoring State
Feature you are looking for is called State Restoration. From the [docs](http://State%20preservation%20records%20the%20configuration%20of%20your%20app%20before%20it%20is%20suspended%20so%20that%20the%20configuration%20can%20be%20restored%20on%20a%20subsequent%20app%20launch.):
>
> ... | What you're trying to do is keep persistent data between launches of your application, right?
For that you should use core data, there are many useful recourses on the web to help you with that, heres a few helpful ones.
<https://developer.apple.com/library/watchos/documentation/Cocoa/Conceptual/CoreData/index.html>
... |
35,854,555 | We will be developing a new web site for a client who already has a Kentico 8.2 license. I am trying to make a case for developing the site using Kentico 9. Some key features I have found so far include:
* faster performance (how much in real-world terms?)
* better integration with .Net MVC
* content staging tasks can... | 2016/03/07 | [
"https://Stackoverflow.com/questions/35854555",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5971415/"
] | There are many tools available to you to persist data from an app. Choosing an appropriate one requires some understanding of your needs, or at least making a guess. Here's where I would start but keep an eye out in case my assumptions don't match your needs.
*What type of data do you want to persist?*
Presumably you... | What you're trying to do is keep persistent data between launches of your application, right?
For that you should use core data, there are many useful recourses on the web to help you with that, heres a few helpful ones.
<https://developer.apple.com/library/watchos/documentation/Cocoa/Conceptual/CoreData/index.html>
... |
35,854,555 | We will be developing a new web site for a client who already has a Kentico 8.2 license. I am trying to make a case for developing the site using Kentico 9. Some key features I have found so far include:
* faster performance (how much in real-world terms?)
* better integration with .Net MVC
* content staging tasks can... | 2016/03/07 | [
"https://Stackoverflow.com/questions/35854555",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5971415/"
] | There are many tools available to you to persist data from an app. Choosing an appropriate one requires some understanding of your needs, or at least making a guess. Here's where I would start but keep an eye out in case my assumptions don't match your needs.
*What type of data do you want to persist?*
Presumably you... | ### Preserving and Restoring State
Feature you are looking for is called State Restoration. From the [docs](http://State%20preservation%20records%20the%20configuration%20of%20your%20app%20before%20it%20is%20suspended%20so%20that%20the%20configuration%20can%20be%20restored%20on%20a%20subsequent%20app%20launch.):
>
> ... |
9,415 | What does テラス means in the context of declining an invitation, like below?
>
> うううううう!!いきたい!けどその時間帯もろに仕事だ:::またやって!!テラスーーーーー
>
>
>
I guess it is slang?
I am familiar with テラワロス but it seems different in both spelling and context.
More context: Public comment sent on a night-time birthday event page on a social n... | 2012/11/13 | [
"https://japanese.stackexchange.com/questions/9415",
"https://japanese.stackexchange.com",
"https://japanese.stackexchange.com/users/107/"
] | So far the only viable explanation I can think of is that テラス is a contracted form of テラワロス.
* [ニコニコ[百科]{ひゃっか} entry for テラス](http://dic.nicovideo.jp/a/%E3%83%86%E3%83%A9%E3%82%B9) defines it as: `3. テラワロスの略`
+ 3rd sense: Contraction of "terawarosu"
* [a 2ch.net post](http://2chnull.info/r/train/1273323743/901-1000) ... | I'm Japanese, but I've never heard Japanese people using テラス. That's not even slang. I don't understand its meaning. |
471,151 | $(l^2,\|\cdot\|\_2)$ is a Hilbert space with scalar product $\langle x,y\rangle=\sum^{\infty}\_{k=1}x\_ky\_k$.
How can I show that every vector $x\in l^2$ can be written in a form $\sum^{\infty}\_{k=1}x\_ke^k$ where $e^k,k\in N$ are unit vectors? | 2013/08/19 | [
"https://math.stackexchange.com/questions/471151",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/20885/"
] | By definition equality
$$
x=\sum\limits\_{k=1}^\infty x\_k e^k
$$
means that
$$
x=\lim\limits\_{n\to\infty}\sum\limits\_{k=1}^n x\_k e^k
$$
which by definition means that
$$
\lim\limits\_{n\to\infty}\left\Vert x-\sum\limits\_{k=1}^n x\_k e^k\right\Vert\_2=0\tag{1}
$$
Now use the fact that $\Vert z\Vert\_2^2=\langle... | Let's take $x$ and define $x\_k:=\langle x,e\_k\rangle$. Now we need to prove that the vector
$$y=\sum\_k x\_ke\_k$$
exists and equal to $x$.
First, we show that it exists: the series converges by [pythagorean identity](http://en.wikipedia.org/wiki/Hilbert_space#Pythagorean_identity) ); moreover, it converges to the ... |
177,933 | Harry Potter chose to come back from the dead because he was the master of death. But how could he be the master of death as he never had the Elder Wand?
If Harry could come back does that mean that Dumbledore could come back from the dead too? Why/why not?
After all, Dumbledore did have the three Deathly Hallows. He... | 2018/01/02 | [
"https://scifi.stackexchange.com/questions/177933",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/93971/"
] | There are many fundamental errors in your question itself. I really suggest you go back and read the books because your understanding of both the Hallows and Harry's resurrection is wrong.
Firstly, Harry was the owner of Elder Wand having won it from Draco Malfoy when he escaped from Malfoy Manor. Draco became the ow... | >
> he passes the cloak to harry but he still own it
>
>
>
No, Dumbledore never **owned** it. Harry's father owned it, and and passed it along with everything else to Harry. Dumbledore was simply in possession of it because he had **borrowed** it before Harry's parents were killed.
I don't have the exact quote, b... |
177,933 | Harry Potter chose to come back from the dead because he was the master of death. But how could he be the master of death as he never had the Elder Wand?
If Harry could come back does that mean that Dumbledore could come back from the dead too? Why/why not?
After all, Dumbledore did have the three Deathly Hallows. He... | 2018/01/02 | [
"https://scifi.stackexchange.com/questions/177933",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/93971/"
] | >
> he passes the cloak to harry but he still own it
>
>
>
No, Dumbledore never **owned** it. Harry's father owned it, and and passed it along with everything else to Harry. Dumbledore was simply in possession of it because he had **borrowed** it before Harry's parents were killed.
I don't have the exact quote, b... | Dumbledore was never the master of death.
At the time he was in possession of the Elder Wand and the Resurrection Stone, Harry was in possession of the Cloak of Invisibility.
Harry was not the master of death when he 'died', as he did not possess the Elder Wand. There is no concrete answer as to why Harry survived. ... |
177,933 | Harry Potter chose to come back from the dead because he was the master of death. But how could he be the master of death as he never had the Elder Wand?
If Harry could come back does that mean that Dumbledore could come back from the dead too? Why/why not?
After all, Dumbledore did have the three Deathly Hallows. He... | 2018/01/02 | [
"https://scifi.stackexchange.com/questions/177933",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/93971/"
] | >
> he passes the cloak to harry but he still own it
>
>
>
No, Dumbledore never **owned** it. Harry's father owned it, and and passed it along with everything else to Harry. Dumbledore was simply in possession of it because he had **borrowed** it before Harry's parents were killed.
I don't have the exact quote, b... | Dumbledore *was* dead. Harry wasn't. That's established by the text itself:
>
> “But you’re dead.” said Harry. “Oh yes,” said Dumbledore matter-of-factly. “Then . . . I’m dead too?” “Ah,” said Dumbledore, smiling still more broadly. “That is the question, isn’t it? On the whole, dear boy, I think not.”
>
>
>
Harr... |
177,933 | Harry Potter chose to come back from the dead because he was the master of death. But how could he be the master of death as he never had the Elder Wand?
If Harry could come back does that mean that Dumbledore could come back from the dead too? Why/why not?
After all, Dumbledore did have the three Deathly Hallows. He... | 2018/01/02 | [
"https://scifi.stackexchange.com/questions/177933",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/93971/"
] | >
> he passes the cloak to harry but he still own it
>
>
>
No, Dumbledore never **owned** it. Harry's father owned it, and and passed it along with everything else to Harry. Dumbledore was simply in possession of it because he had **borrowed** it before Harry's parents were killed.
I don't have the exact quote, b... | Even if Dumbledore would be able to come back, he wouldn't. This is one of the primary points of the books.
-----------------------------------------------------------------------------------------------------------
Although I agree with the other answers that the questioner seems to have misunderstood the Hallows, I ... |
177,933 | Harry Potter chose to come back from the dead because he was the master of death. But how could he be the master of death as he never had the Elder Wand?
If Harry could come back does that mean that Dumbledore could come back from the dead too? Why/why not?
After all, Dumbledore did have the three Deathly Hallows. He... | 2018/01/02 | [
"https://scifi.stackexchange.com/questions/177933",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/93971/"
] | There are many fundamental errors in your question itself. I really suggest you go back and read the books because your understanding of both the Hallows and Harry's resurrection is wrong.
Firstly, Harry was the owner of Elder Wand having won it from Draco Malfoy when he escaped from Malfoy Manor. Draco became the ow... | Dumbledore was never the master of death.
At the time he was in possession of the Elder Wand and the Resurrection Stone, Harry was in possession of the Cloak of Invisibility.
Harry was not the master of death when he 'died', as he did not possess the Elder Wand. There is no concrete answer as to why Harry survived. ... |
177,933 | Harry Potter chose to come back from the dead because he was the master of death. But how could he be the master of death as he never had the Elder Wand?
If Harry could come back does that mean that Dumbledore could come back from the dead too? Why/why not?
After all, Dumbledore did have the three Deathly Hallows. He... | 2018/01/02 | [
"https://scifi.stackexchange.com/questions/177933",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/93971/"
] | There are many fundamental errors in your question itself. I really suggest you go back and read the books because your understanding of both the Hallows and Harry's resurrection is wrong.
Firstly, Harry was the owner of Elder Wand having won it from Draco Malfoy when he escaped from Malfoy Manor. Draco became the ow... | Dumbledore *was* dead. Harry wasn't. That's established by the text itself:
>
> “But you’re dead.” said Harry. “Oh yes,” said Dumbledore matter-of-factly. “Then . . . I’m dead too?” “Ah,” said Dumbledore, smiling still more broadly. “That is the question, isn’t it? On the whole, dear boy, I think not.”
>
>
>
Harr... |
177,933 | Harry Potter chose to come back from the dead because he was the master of death. But how could he be the master of death as he never had the Elder Wand?
If Harry could come back does that mean that Dumbledore could come back from the dead too? Why/why not?
After all, Dumbledore did have the three Deathly Hallows. He... | 2018/01/02 | [
"https://scifi.stackexchange.com/questions/177933",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/93971/"
] | There are many fundamental errors in your question itself. I really suggest you go back and read the books because your understanding of both the Hallows and Harry's resurrection is wrong.
Firstly, Harry was the owner of Elder Wand having won it from Draco Malfoy when he escaped from Malfoy Manor. Draco became the ow... | Even if Dumbledore would be able to come back, he wouldn't. This is one of the primary points of the books.
-----------------------------------------------------------------------------------------------------------
Although I agree with the other answers that the questioner seems to have misunderstood the Hallows, I ... |
177,933 | Harry Potter chose to come back from the dead because he was the master of death. But how could he be the master of death as he never had the Elder Wand?
If Harry could come back does that mean that Dumbledore could come back from the dead too? Why/why not?
After all, Dumbledore did have the three Deathly Hallows. He... | 2018/01/02 | [
"https://scifi.stackexchange.com/questions/177933",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/93971/"
] | Dumbledore was never the master of death.
At the time he was in possession of the Elder Wand and the Resurrection Stone, Harry was in possession of the Cloak of Invisibility.
Harry was not the master of death when he 'died', as he did not possess the Elder Wand. There is no concrete answer as to why Harry survived. ... | Even if Dumbledore would be able to come back, he wouldn't. This is one of the primary points of the books.
-----------------------------------------------------------------------------------------------------------
Although I agree with the other answers that the questioner seems to have misunderstood the Hallows, I ... |
177,933 | Harry Potter chose to come back from the dead because he was the master of death. But how could he be the master of death as he never had the Elder Wand?
If Harry could come back does that mean that Dumbledore could come back from the dead too? Why/why not?
After all, Dumbledore did have the three Deathly Hallows. He... | 2018/01/02 | [
"https://scifi.stackexchange.com/questions/177933",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/93971/"
] | Dumbledore *was* dead. Harry wasn't. That's established by the text itself:
>
> “But you’re dead.” said Harry. “Oh yes,” said Dumbledore matter-of-factly. “Then . . . I’m dead too?” “Ah,” said Dumbledore, smiling still more broadly. “That is the question, isn’t it? On the whole, dear boy, I think not.”
>
>
>
Harr... | Even if Dumbledore would be able to come back, he wouldn't. This is one of the primary points of the books.
-----------------------------------------------------------------------------------------------------------
Although I agree with the other answers that the questioner seems to have misunderstood the Hallows, I ... |
95,207 | How does a Stack Overflow moderator know about sock puppet accounts?
How do they trap the user? | 2011/06/15 | [
"https://meta.stackexchange.com/questions/95207",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/161645/"
] | I am not going to answer this directly, for reasons that should be obvious.
However; this isn't a "trap" - it is our attempt at *enforcing reasonable behaviour*; using a sock-puppet for *any purpose* (most commonly, but not exclusively: upvoting yourself) is unacceptable.
If you want the vote of the masses; write goo... | They have ways of finding pretty much any kind of sock puppets using their sites...
 |
95,207 | How does a Stack Overflow moderator know about sock puppet accounts?
How do they trap the user? | 2011/06/15 | [
"https://meta.stackexchange.com/questions/95207",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/161645/"
] | I am not going to answer this directly, for reasons that should be obvious.
However; this isn't a "trap" - it is our attempt at *enforcing reasonable behaviour*; using a sock-puppet for *any purpose* (most commonly, but not exclusively: upvoting yourself) is unacceptable.
If you want the vote of the masses; write goo... | Actions speak louder than IP address… Possibly even a “view” of a question is an action. |
95,207 | How does a Stack Overflow moderator know about sock puppet accounts?
How do they trap the user? | 2011/06/15 | [
"https://meta.stackexchange.com/questions/95207",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/161645/"
] | I am not going to answer this directly, for reasons that should be obvious.
However; this isn't a "trap" - it is our attempt at *enforcing reasonable behaviour*; using a sock-puppet for *any purpose* (most commonly, but not exclusively: upvoting yourself) is unacceptable.
If you want the vote of the masses; write goo... | You know, throughout your posts here, you keep referring to this as a "bug" or a "trap". It's not a bug at all; it's a *feature* designed to prevent people from abusing the site. **Which is exactly what you were doing.**
In your comments on Marc's answer, you complain that your friend "Nahid" got her account merged du... |
95,207 | How does a Stack Overflow moderator know about sock puppet accounts?
How do they trap the user? | 2011/06/15 | [
"https://meta.stackexchange.com/questions/95207",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/161645/"
] | They have ways of finding pretty much any kind of sock puppets using their sites...
 | Actions speak louder than IP address… Possibly even a “view” of a question is an action. |
95,207 | How does a Stack Overflow moderator know about sock puppet accounts?
How do they trap the user? | 2011/06/15 | [
"https://meta.stackexchange.com/questions/95207",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/161645/"
] | You know, throughout your posts here, you keep referring to this as a "bug" or a "trap". It's not a bug at all; it's a *feature* designed to prevent people from abusing the site. **Which is exactly what you were doing.**
In your comments on Marc's answer, you complain that your friend "Nahid" got her account merged du... | Actions speak louder than IP address… Possibly even a “view” of a question is an action. |
71,288,129 | I am trying to extend the symbols available to me for plotting in 3D. In 2D, I use:
```
x1 <- sort(rnorm(10))
y1 <- rnorm(10)
z1 <- rnorm(10) + atan2(x1, y1)
x2 <- sort(rnorm(10))
y2 <- rnorm(10)
z2 <- rnorm(10) + atan2(x2, y2)
x3 <- sort(rnorm(10))
y3 <- rnorm(10)
z3 <- rnorm(10) + atan2(x3, y3)
new.styles <- -1*c(98... | 2022/02/27 | [
"https://Stackoverflow.com/questions/71288129",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3236841/"
] | I was able to only get a solution using `text3d()` -- hopefully there exists a better solution.
```
x1 <- sort(rnorm(12))
y1 <- rnorm(12)
z1 <- rnorm(12) + atan2(x1, y1)
x2 <- sort(rnorm(12))
y2 <- rnorm(12)
z2 <- rnorm(12) + atan2(x2, y2)
x3 <- sort(rnorm(12))
y3 <- rnorm(12)
z3 <- rnorm(12) + atan2(x3, y3)
new.style... | This is the best I could do:
[](https://i.stack.imgur.com/GNqv4.png)
Set up file for texture/shape:
```r
crown <- tempfile(pattern = "crown", fileext = ".png")
png(filename = crown)
plot(1,1, ann=FALSE, axes=FALSE, pch=-9818, cex = 40, col = 2)
dev.off()
... |
1,336,337 | I've got my first RoR app deployed to Dreamhost and it's using Passenger. The one note on Dreamhost's wiki about slow response mentioned changing a RewriteRules line in the public/.htaccess file to use FastCGI. But I assume this will have no effect if I'm using Passenger, is that right?
I've looked at the logs and com... | 2009/08/26 | [
"https://Stackoverflow.com/questions/1336337",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26270/"
] | You must be running in Development mode. Try running in Production mode to see if it is still slow.
Post below may help:
[Ruby On Rails is slow...?](https://stackoverflow.com/questions/566401/ruby-on-rails-is-slow) | [New Relic](http://www.newrelic.com/) is a Rails performance monitoring app. I haven't personally used it, but I hear their name a lot and it looks like they have a free lite version that you could try. From my experience profiling other applications, a tool like this is worth using because the slow parts of your appli... |
205,706 | I can't find a way to toggle mc internal editor in hex mode. [Here](http://www.tldp.org/LDP/LG/issue23/wkndmech_dec97/mc_article.html) it says to use F4 however it suggest to replace. How to do it? | 2015/05/26 | [
"https://unix.stackexchange.com/questions/205706",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/50426/"
] | You can open file with `F3`.
Hex view - `F4`.
Start edit - `F2`. | `F4` toggles hex mode in the Midnight Commander **viewer** (accessed using `F3`), not in the editor. Once in hex mode in the viewer, `F2` allows you to make changes to the file being viewed.
As you discovered, `F4` in the editor starts a search. |
6,061,310 | I'm getting crazy, cause I cannot find what are the "default" keys you would have in a PDF Document.
For example, if I want to retrieve an hyperlink from a CGPDFDocument, I do this:
```
CGPDFStringRef uriStringRef;
if(!CGPDFDictionaryGetString(aDict, "URI", &uriStringRef)) {
break;
}
```
In this case, the key i... | 2011/05/19 | [
"https://Stackoverflow.com/questions/6061310",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/287454/"
] | The [Adobe PDF Reference](http://www.adobe.com/devnet/pdf/pdf_reference_archive.html) describes all of the keys. | The keys in a dictionary depend on the actual object the dictionary represents (a page dictionary has other keys than an annotation dictionary). The Adobe PDF reference describes all these objects and their keys. |
6,061,310 | I'm getting crazy, cause I cannot find what are the "default" keys you would have in a PDF Document.
For example, if I want to retrieve an hyperlink from a CGPDFDocument, I do this:
```
CGPDFStringRef uriStringRef;
if(!CGPDFDictionaryGetString(aDict, "URI", &uriStringRef)) {
break;
}
```
In this case, the key i... | 2011/05/19 | [
"https://Stackoverflow.com/questions/6061310",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/287454/"
] | It's absurd that you would have to go read 1300 page long specs just to find what keys a dictionary contains, a dictionary that could contain anything depending on what kind of annotation it is.
To get a list of keys in a `CGPDFDictionaryRef` you do:
```
// temporary C function to print out keys
void printPDFKeys(con... | The [Adobe PDF Reference](http://www.adobe.com/devnet/pdf/pdf_reference_archive.html) describes all of the keys. |
6,061,310 | I'm getting crazy, cause I cannot find what are the "default" keys you would have in a PDF Document.
For example, if I want to retrieve an hyperlink from a CGPDFDocument, I do this:
```
CGPDFStringRef uriStringRef;
if(!CGPDFDictionaryGetString(aDict, "URI", &uriStringRef)) {
break;
}
```
In this case, the key i... | 2011/05/19 | [
"https://Stackoverflow.com/questions/6061310",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/287454/"
] | It's absurd that you would have to go read 1300 page long specs just to find what keys a dictionary contains, a dictionary that could contain anything depending on what kind of annotation it is.
To get a list of keys in a `CGPDFDictionaryRef` you do:
```
// temporary C function to print out keys
void printPDFKeys(con... | The keys in a dictionary depend on the actual object the dictionary represents (a page dictionary has other keys than an annotation dictionary). The Adobe PDF reference describes all these objects and their keys. |
36,711,776 | This is the HTML I want to extract from.
```
<input type="hidden" id="continueTo" name="continueTo" value="/oauth2/authz/?response_type=code&client_id=localoauth20&redirect_uri=http%3A%2F%2Fbg-sip-activemq%3A8080%2Fjbpm-console%2Foauth20Callback&state=72a37ba7-2033-47f4-8e7e-69a207406dfb" />
```
I need a Xpath to ex... | 2016/04/19 | [
"https://Stackoverflow.com/questions/36711776",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5850305/"
] | The XPATH:
```
//input[@id="continueTo"]/@value
```
It will get the value of the node `input` with id `continueTo`. Then it will need to be processed with a Regex first to get a final result.
The Regex:
```
`[^=]+$`
```
`$` means the end of the string. It will get everything on the end of the string which is not... | Use below code:-
```
String val = driver.findElement(By.xpath("//input[@id='continueTo']/@value")).getText();
String [] myValue = val.split("&state=");
System.out.println(myValue[1]);
```
Hope it will help you :) |
36,711,776 | This is the HTML I want to extract from.
```
<input type="hidden" id="continueTo" name="continueTo" value="/oauth2/authz/?response_type=code&client_id=localoauth20&redirect_uri=http%3A%2F%2Fbg-sip-activemq%3A8080%2Fjbpm-console%2Foauth20Callback&state=72a37ba7-2033-47f4-8e7e-69a207406dfb" />
```
I need a Xpath to ex... | 2016/04/19 | [
"https://Stackoverflow.com/questions/36711776",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5850305/"
] | Hi you can only get value of a attribute using xpath not its sub-string but if you want to get sub-string then please do it like below
```
String AttributeValue = driver.findElement(By.id("continueTo")).getAttribute("value");
System.out.println("Value of the attribute value is : " + AttributeValue);
// now as yo... | Use below code:-
```
String val = driver.findElement(By.xpath("//input[@id='continueTo']/@value")).getText();
String [] myValue = val.split("&state=");
System.out.println(myValue[1]);
```
Hope it will help you :) |
25,242,580 | I am working on node.js where forever is installed. I am not sure where is intalled . when i go to project directory then type command `forever list` then it will display no forever
Can any body tell me how to check and how to resart processes.
My website is running. it means forever may be running | 2014/08/11 | [
"https://Stackoverflow.com/questions/25242580",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3883164/"
] | If `forever list` is empty, your nodeJS app is not running.
You have to start it first by doing `forever start yourApp.js` | You have to install forever with sudo. |
60,784 | I'm starting a VPN connection using Network Manager.
Once the connection is established I have to change [MTU](http://en.wikipedia.org/wiki/Maximum_transmission_unit) in order it to work properly.
For example:
```
sudo ifconfig ppp0 mtu 777
```
It is very annoying to execute this command every time I open a VPN conn... | 2011/09/10 | [
"https://askubuntu.com/questions/60784",
"https://askubuntu.com",
"https://askubuntu.com/users/24741/"
] | Create a script in `/etc/network/if-up.d`, containing
```
#!/bin/sh
if [ "$IFACE" = "ppp0" ]; then
ifconfig ppp0 mtu 777
fi
```
and [make it executable](https://askubuntu.com/questions/122428/how-to-run-sh-file). | Here's a modernized (using `ip` instead of `ifconfig`) and generic (`openconnect` on the command-line uses `tun0`, Network Manager uses `vpn0` through the network applet; the numbers may vary if another network is already active) variant of @enzotib's excellent answer, tested on Ubuntu 20.04:
```
#!/bin/bash
if [[ "$... |
9,479,819 | Sorry for the very noob question.
Let's suppose I have an enum like so
```
public enum MyElementType {
TYPE_ONE,
TYPE_TWO,
TYPE_THREE;
}
```
When I want to loop over this enum, I always see this solution:
```
for(MyElementType type: MyElementType.values())
{
//do things
}
```
I wonder if there exist a viable solu... | 2012/02/28 | [
"https://Stackoverflow.com/questions/9479819",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/740480/"
] | Why do you want to use a while loop rather than the for-each you more typically see?
In any case, it's pretty simple
```
Set<MyElementType> elements = EnumSet.allOf(MyElementType.class);
Iterator<MyElementType> it = elements.iterator();
while (it.hasNext()) {
MyElementType el = it.next();
// etc
}
// or
Iter... | Take a look @ <http://www.javaspecialists.eu/archive/Issue107.html> |
2,855 | Consider an application that currently uses a combination of license file and/or subscription to verify which features to activate. I can use a smart contract instead of the license file, and potentially the subscription. But today, the subscription check requires an online validation and associated credential check.
... | 2016/04/10 | [
"https://ethereum.stackexchange.com/questions/2855",
"https://ethereum.stackexchange.com",
"https://ethereum.stackexchange.com/users/1161/"
] | When your app is able to sync with the blockchain (network connection available), the check the blockchain and update your app settings file to allow use for up to e.g. 1 week after the blockchain subscription check. Just tell the user that they have to sync before the period is up.
One extra feature you can add:
* Y... | If you want to get up-to-date information from the Ethereum blockchain then you'll need a node somewhere that's synced up. However, in theory you could do this with either a trusted server or a more lightweight proof so you wouldn't necessarily need the whole chain to be downloaded to the client.
If you can tolerate p... |
4,347,995 | I ask this as someone who loves maths but has no ability. So 2 axioms & a question.
Axiom 1 - a digital processor exists that can find the n'th prime number of any size instantly.
Axiom 2 - all natural numbers can be expressed as the sum of 2 primes.
Would it take more/less/same amount of bits to define a natural num... | 2022/01/03 | [
"https://math.stackexchange.com/questions/4347995",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/603487/"
] | The ordinary way of storing natural numbers by means of bits is already optimal. This can easily be seen: Each of the $2^n$ combinations of assignments of $n$ bits represents exactly one distinct natural number between $0$ and $2^n-1$. If there was a way of storing more numbers with the same amount of bits, and we woul... | In this reference, <https://en.m.wikipedia.org/wiki/Goldbach%27s_conjecture>
they give a nineteen digit number whose lower prime must be at least 9781.
The $n$th prime is about $n\ln n$ so you save a factor of 42, or about six bits, by storing the index of the larger prime. But 9781 is about the 1000th prime, so you... |
4,568,514 | I'm working through Example 2.22 in Steward and Tall's Algebraic Number Theory book. The goal is to determine the ring of integers of $\mathbb Q(\sqrt[3]5)$. Let $\theta\in\mathbb R$ such that $\theta^3=5$. Let $\omega=e^{2\pi i/3}$. I'm at the point where I need to check whether
$$
\alpha=\frac 13(1+\theta+\theta^2)
$... | 2022/11/03 | [
"https://math.stackexchange.com/questions/4568514",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/405827/"
] | [](https://i.stack.imgur.com/7hWo2.png)
As pointed out by dezdichado, the problem can be done by two applications of Cosine Formula.
Refer to the figure,
One such formula is:
$$\cos \alpha=\frac{(c-x)^2+y^2-a^2}{2(c-x)y}$$
Applying Cosine Formula ... | I have an idea to start :
In $\Bbb C, A=0, B=1, C=\xi +i\eta, D=x$
Unfortunately, none of my calculations succeed, although simplifications appear: I suspect that there is a sign error in the proposed equality. |
4,605,482 | I want my marker to appear not in the center of the screen, but 25% of the way up to give extra room for the popup box. Although sticking an offset in is easy, the offset depends on the zoom level as if you're zoomed far out, you'll want to center the map quite far up (such as 50km). If you're really zoomed in, then yo... | 2011/01/05 | [
"https://Stackoverflow.com/questions/4605482",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/174375/"
] | Try this:
Take the height of the plugin and get 25% of that.
Then you need to multiply that by the degrees or kilometres per pixel scale at that height (if you can't get it straight from the plugin then I guess do the math), then centre the screen at that point on the globe. | I am not sure as it has been a while since I messed around with the API, but I think you can create a custom marker object with its own pixel based offset, and display that instead of the default marker.
EDIT: Whoops read it again and realized you probably just wanted to move the whole map and not the marker. |
44,487,654 | I know this is a very classical question which might be answered many times in this forum, however I could not find any clear answer which explains this clearly from scratch.
Firstly, imgine that my dataset called my\_data has 4 variables such as
my\_data = variable1, variable2, variable3, target\_variable
So, let's ... | 2017/06/11 | [
"https://Stackoverflow.com/questions/44487654",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8010314/"
] | First off, you are using the deprecated package `cross-validation` of scikit library. New package is named `model_selection`. So I am using that in this answer.
Second, you are importing `RandomForestRegressor`, but defining `RandomForestClassifier` in the code. I am taking `RandomForestRegressor` here, because the me... | Also in the for loop it should be:
```
model = RandomForestRegressor(n_estimators=100)
for train_index, test_index in cv.split(X):
``` |
10,248,776 | Requirements for a TextBox control were to accept the following as valid inputs:
1. A sequence of numbers.
2. Literal string 'Number of rooms'.
3. No value at all (left blank). Not specifying a value at all should allow for the RegularExpressionValidator to pass.
Following RegEx yielded the desired results (successf... | 2012/04/20 | [
"https://Stackoverflow.com/questions/10248776",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/988951/"
] | The order matters since that is the order which the Regex engine will try to match.
Case 1: `Number of rooms|[0-9]*`
In this case the regex engine will first try to match the text "Number of room". If this fails will then try to match numbers or nothing.
Case 2: `[0-9]*|Number of rooms`:
In this case the engine wil... | The point is that the `[0-9]*` at the beginning is matching empty strings if you specify that first.
If you specify that *the whole string* should be digits, then it should work:
```
^[0-9]*$|Number of rooms
```
Unless you specify `^` and `$`, to indicate that *the whole string* must be a match, an empty string w... |
10,248,776 | Requirements for a TextBox control were to accept the following as valid inputs:
1. A sequence of numbers.
2. Literal string 'Number of rooms'.
3. No value at all (left blank). Not specifying a value at all should allow for the RegularExpressionValidator to pass.
Following RegEx yielded the desired results (successf... | 2012/04/20 | [
"https://Stackoverflow.com/questions/10248776",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/988951/"
] | The order matters since that is the order which the Regex engine will try to match.
Case 1: `Number of rooms|[0-9]*`
In this case the regex engine will first try to match the text "Number of room". If this fails will then try to match numbers or nothing.
Case 2: `[0-9]*|Number of rooms`:
In this case the engine wil... | You probably wanted to use regex `Number of rooms|[0-9]+` or `[0-9]+|Number of rooms`, because pattern `[0-9]*` (with star) will always match at least empty string (`*` means `{0,}`, so "zero or more..."). |
83,623 | I am trying to round the corners of a custom shape, but it is just straightening the original curves out.
*Note: This is in Illustrator CS5*
**Here is the shape before the effect:**
[](https://i.stack.imgur.com/luohd.png)
The 3 "corners should be r... | 2017/01/20 | [
"https://graphicdesign.stackexchange.com/questions/83623",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/84489/"
] | I don't have CS5, but this should work:
Select your path. With the pen tool selected, create points on each side of the anchor points, something like the following:
[](https://i.stack.imgur.com/U3Mk7.png)
With the... | My way is easier if you have good experience with the pen tool.
First, make your triangle. In my case, I just made a box, deleted 1 anchor point, joined the two points creating a segment opposite to the middle point and rotated about 45 degrees (please correct me if I'm wrong).
[](https://i.stack.imgur.com/luohd.png)
The 3 "corners should be r... | 2017/01/20 | [
"https://graphicdesign.stackexchange.com/questions/83623",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/84489/"
] | I don't have CS5, but this should work:
Select your path. With the pen tool selected, create points on each side of the anchor points, something like the following:
[](https://i.stack.imgur.com/U3Mk7.png)
With the... | The simple way:
Create additional anchor points around cornes (as it was mentioned at first answer), then apply Round Corner effect as usual. |
83,623 | I am trying to round the corners of a custom shape, but it is just straightening the original curves out.
*Note: This is in Illustrator CS5*
**Here is the shape before the effect:**
[](https://i.stack.imgur.com/luohd.png)
The 3 "corners should be r... | 2017/01/20 | [
"https://graphicdesign.stackexchange.com/questions/83623",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/84489/"
] | I don't have CS5, but this should work:
Select your path. With the pen tool selected, create points on each side of the anchor points, something like the following:
[](https://i.stack.imgur.com/U3Mk7.png)
With the... | **Purely for comparison’s sake**, I thought it would be good to show what Adobe Illustrator CC (in this case, I am using v2017) can do:
[](https://i.stack.imgur.com/8d2hQ.gif)
1. With the selection tool, select your entire path
2. On a Mac, hold down... |
83,623 | I am trying to round the corners of a custom shape, but it is just straightening the original curves out.
*Note: This is in Illustrator CS5*
**Here is the shape before the effect:**
[](https://i.stack.imgur.com/luohd.png)
The 3 "corners should be r... | 2017/01/20 | [
"https://graphicdesign.stackexchange.com/questions/83623",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/84489/"
] | **Purely for comparison’s sake**, I thought it would be good to show what Adobe Illustrator CC (in this case, I am using v2017) can do:
[](https://i.stack.imgur.com/8d2hQ.gif)
1. With the selection tool, select your entire path
2. On a Mac, hold down... | My way is easier if you have good experience with the pen tool.
First, make your triangle. In my case, I just made a box, deleted 1 anchor point, joined the two points creating a segment opposite to the middle point and rotated about 45 degrees (please correct me if I'm wrong).
[](https://i.stack.imgur.com/luohd.png)
The 3 "corners should be r... | 2017/01/20 | [
"https://graphicdesign.stackexchange.com/questions/83623",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/84489/"
] | **Purely for comparison’s sake**, I thought it would be good to show what Adobe Illustrator CC (in this case, I am using v2017) can do:
[](https://i.stack.imgur.com/8d2hQ.gif)
1. With the selection tool, select your entire path
2. On a Mac, hold down... | The simple way:
Create additional anchor points around cornes (as it was mentioned at first answer), then apply Round Corner effect as usual. |
66,920,844 | I use a custom hook to support dark mode with tailwindcss in my new react-native app, created with Expo CLI. The TailwindProvider with the dark mode logic looks like this:
```js
const TailwindProvider: React.FC = ({ children }) => {
const [currentColorScheme, setcurrentColorScheme] = useState(Appearance.getColorSche... | 2021/04/02 | [
"https://Stackoverflow.com/questions/66920844",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10183816/"
] | Use `systimestamp` since that includes a time zone.
```
select systimestamp at time zone 'US/Eastern'
from dual;
```
should return a timestamp in the Eastern time zone (assuming your database time zone files are up to date).
Note that if you ask for a timestamp in EST, that should be an hour earlier than the curr... | Use `systimestamp` rather than `sysdate`, because it is already timezone-aware; then `at time zone` to translate:
```
select systimestamp at time zone 'America/New_York' from dual
```
Using a region is better/safer than an abbreviation like 'EST", which might not be unique; and [gives you the wrong answer](https://d... |
66,920,844 | I use a custom hook to support dark mode with tailwindcss in my new react-native app, created with Expo CLI. The TailwindProvider with the dark mode logic looks like this:
```js
const TailwindProvider: React.FC = ({ children }) => {
const [currentColorScheme, setcurrentColorScheme] = useState(Appearance.getColorSche... | 2021/04/02 | [
"https://Stackoverflow.com/questions/66920844",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10183816/"
] | Use `systimestamp` rather than `sysdate`, because it is already timezone-aware; then `at time zone` to translate:
```
select systimestamp at time zone 'America/New_York' from dual
```
Using a region is better/safer than an abbreviation like 'EST", which might not be unique; and [gives you the wrong answer](https://d... | If you really want to use `SYSDATE` then you can use:
```sql
SELECT from_tz(CAST(sysdate AS TIMESTAMP),'PST') AT TIME ZONE 'EST5EDT' FROM DUAL;
```
Which outputs:
>
>
> ```
>
> | FROM_TZ(CAST(SYSDATEASTIMESTAMP),'PST')ATTIMEZONE'EST5EDT' |
> | :--------------------------------------------------------- |
> | 02-A... |
66,920,844 | I use a custom hook to support dark mode with tailwindcss in my new react-native app, created with Expo CLI. The TailwindProvider with the dark mode logic looks like this:
```js
const TailwindProvider: React.FC = ({ children }) => {
const [currentColorScheme, setcurrentColorScheme] = useState(Appearance.getColorSche... | 2021/04/02 | [
"https://Stackoverflow.com/questions/66920844",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10183816/"
] | Use `systimestamp` since that includes a time zone.
```
select systimestamp at time zone 'US/Eastern'
from dual;
```
should return a timestamp in the Eastern time zone (assuming your database time zone files are up to date).
Note that if you ask for a timestamp in EST, that should be an hour earlier than the curr... | If you really want to use `SYSDATE` then you can use:
```sql
SELECT from_tz(CAST(sysdate AS TIMESTAMP),'PST') AT TIME ZONE 'EST5EDT' FROM DUAL;
```
Which outputs:
>
>
> ```
>
> | FROM_TZ(CAST(SYSDATEASTIMESTAMP),'PST')ATTIMEZONE'EST5EDT' |
> | :--------------------------------------------------------- |
> | 02-A... |
65,536,088 | I have a dataframe which is called "df". It looks like this:
```
a
0 2
1 3
2 0
3 5
4 1
5 3
6 1
7 2
8 2
9 1
```
I would like to produce a cummulative sum column which:
* Sums the contents of column "a" cumulatively;
* Until it gets a sum of "5";
* Resets the cums... | 2021/01/02 | [
"https://Stackoverflow.com/questions/65536088",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11622176/"
] | You can get the cumsum, and floor divide by 5. Then subtract the result of the floor division, multiplied by 5, from the below row's cumulative sum:
```
c = df['a'].cumsum()
g = 5 * (c // 5)
df['a_cumm_sum'] = (c.shift(-1) - g).shift().fillna(df['a']).astype(int)
df
Out[1]:
a a_cumm_sum
0 2 2
1 3 ... | The assignment can be combined with a condition. The code is as follows:
```py
import numpy as np
import pandas as pd
a = [2, 3, 0, 5, 1, 3, 1, 2, 2, 1]
df = pd.DataFrame(a, columns=["a"])
df["cumsum"] = df["a"].cumsum()
df["new"] = df["cumsum"]%5
df["new"][((df["cumsum"]/5)==(df["cumsum"]/5).astype(int)) & (df["a"]!... |
65,536,088 | I have a dataframe which is called "df". It looks like this:
```
a
0 2
1 3
2 0
3 5
4 1
5 3
6 1
7 2
8 2
9 1
```
I would like to produce a cummulative sum column which:
* Sums the contents of column "a" cumulatively;
* Until it gets a sum of "5";
* Resets the cums... | 2021/01/02 | [
"https://Stackoverflow.com/questions/65536088",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11622176/"
] | You can get the cumsum, and floor divide by 5. Then subtract the result of the floor division, multiplied by 5, from the below row's cumulative sum:
```
c = df['a'].cumsum()
g = 5 * (c // 5)
df['a_cumm_sum'] = (c.shift(-1) - g).shift().fillna(df['a']).astype(int)
df
Out[1]:
a a_cumm_sum
0 2 2
1 3 ... | **EDIT**:
As Trenton McKinney pointed out in the comments, OP likely wanted to reset it to 0 whenever the cumsum exceeded 5. This makes the definition to be a recurrence which is usually difficult to do with pandas/numpy (see David's solution). I'd recommend using `numba` to speed up the for loop in this case
---
Ano... |
65,536,088 | I have a dataframe which is called "df". It looks like this:
```
a
0 2
1 3
2 0
3 5
4 1
5 3
6 1
7 2
8 2
9 1
```
I would like to produce a cummulative sum column which:
* Sums the contents of column "a" cumulatively;
* Until it gets a sum of "5";
* Resets the cums... | 2021/01/02 | [
"https://Stackoverflow.com/questions/65536088",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11622176/"
] | You can get the cumsum, and floor divide by 5. Then subtract the result of the floor division, multiplied by 5, from the below row's cumulative sum:
```
c = df['a'].cumsum()
g = 5 * (c // 5)
df['a_cumm_sum'] = (c.shift(-1) - g).shift().fillna(df['a']).astype(int)
df
Out[1]:
a a_cumm_sum
0 2 2
1 3 ... | You could try using this for loop:
```
lastvalue = 0
newcum = []
for i in df['a']:
if lastvalue >= 5:
lastvalue = i
else:
lastvalue += i
newcum.append(lastvalue)
df['a_cum_sum'] = newcum
print(df)
```
Output:
```
a a_cum_sum
0 2 2
1 3 5
2 0 0
3 5 ... |
325,415 | (<https://webapps.stackexchange.com/review/suggested-edits/111499> shows action by both.) [Edit: At first glance they both looked like special users. Not so.] | 2019/03/18 | [
"https://meta.stackexchange.com/questions/325415",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/218120/"
] | Community♦ is [a special user](https://meta.stackexchange.com/questions/19738/who-is-the-community-user). Community is credited for reviews when they are:
* Done by deleted users
* Improved, in which case Community is shown as having approved the edit
* Rejected and edited, in which case Community is shown as having r... | A key difference is that their real user numbers, respectively, are -1 for Community♦ and 186471 for user0 (on webapps, and thus *not* 0), as can be seen in the URL (classically displayed in a browser's status bar when mousing over the usernames) that clicking on the name opens.
[Community♦](https://stackexchange.com... |
48,751,289 | My project can switch between languages. The items are stored in a database, and using $\_GET['lang'] in the database gives back the correct items. For now, only English and French are in use, so it works with this code :
```
if ($_GET['lang'] == 'fr' OR ($_GET['lang'] == 'en')) {
$header = getTranslation('header'... | 2018/02/12 | [
"https://Stackoverflow.com/questions/48751289",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9244707/"
] | You should move the else part outside of the loop, as otherwise you will always execute it at some point in the loop iterations. Only when you have iterated through *all* possibilities, and you still have no match, then you can be sure there to have to navigate to the language page:
```
$header = null;
while ($transla... | Easiest is to have a mapping in an array, check if your language is present there, and if so, do stuff. Something like this;
```
$languages = array('en', 'fr', 'de', '...');
$default_language = 'en';
$language = in_array($_GET['lang'], $languages) ? $_GET['lang'] : $default_language;
$header = getTranslation('header'... |
36,937,302 | I have a list of strings (see below) how do I concatenate these strings into one list containing one string.
```
["hello","stack","overflow"]
```
to
```
["hellostackoverflow"]
```
I am just allowed to import Data.Char and Data.List | 2016/04/29 | [
"https://Stackoverflow.com/questions/36937302",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6219741/"
] | Consider each string in a list as a list of characters
```
["hello","stack","overflow"] :: [[Char]]
```
Concatenation is a process of connecting several lists into one. It must have a following type:
```
concat :: [[a]] -> [a]
```
If you will have such a function, you'll get a half of job done. You are looking fo... | You can also use the list monad to reduce the list to a single string, then re-wrap the result in a list.
```
> [["hello", "stack", "overflow"] >>= id]
["hellostackoverflow"]
```
The preceding avoids explicitly use of `Control.Monad.join`:
```
> import Control.Monad
> [join ["hello", "stack", "overflow"]
["hellosta... |
36,937,302 | I have a list of strings (see below) how do I concatenate these strings into one list containing one string.
```
["hello","stack","overflow"]
```
to
```
["hellostackoverflow"]
```
I am just allowed to import Data.Char and Data.List | 2016/04/29 | [
"https://Stackoverflow.com/questions/36937302",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6219741/"
] | Consider each string in a list as a list of characters
```
["hello","stack","overflow"] :: [[Char]]
```
Concatenation is a process of connecting several lists into one. It must have a following type:
```
concat :: [[a]] -> [a]
```
If you will have such a function, you'll get a half of job done. You are looking fo... | ```hs
concat ["hello","stack","overflow"] -- => "hellostackoverflow"
``` |
36,937,302 | I have a list of strings (see below) how do I concatenate these strings into one list containing one string.
```
["hello","stack","overflow"]
```
to
```
["hellostackoverflow"]
```
I am just allowed to import Data.Char and Data.List | 2016/04/29 | [
"https://Stackoverflow.com/questions/36937302",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6219741/"
] | ```hs
concat ["hello","stack","overflow"] -- => "hellostackoverflow"
``` | You can also use the list monad to reduce the list to a single string, then re-wrap the result in a list.
```
> [["hello", "stack", "overflow"] >>= id]
["hellostackoverflow"]
```
The preceding avoids explicitly use of `Control.Monad.join`:
```
> import Control.Monad
> [join ["hello", "stack", "overflow"]
["hellosta... |
5,809,104 | Here T could be an array or a single object. How can add the array to an arraylist or add a single object to the same arraylist. This gives me a build-time error that the overloaded match for `AddRange` has invalid arguments.
```
T loadedContent;
if (typeof(T).IsArray)
{
contentArrayList.AddRange(loadedContent);
}... | 2011/04/27 | [
"https://Stackoverflow.com/questions/5809104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/727904/"
] | Make sure you have set the correct editor associations and content types
Go to settings (`Window -> preferences`)
**Content Types**
1. Type in `Content Types` in the search box (should show under `General -> Types`
2. Click on the arrow next to `Text`, select `PHP Content Type`
3. Add `*.ctp` by clicking on the Add ... | You can change the extension that CakePHP uses for view files to an extension that Eclipse likes. In the controller (or app\_controller) add the following variable:
```
var $ext = '.tpl';
```
If you change the extension to "PHP" you may have problems because CakePHP will try to load a class that matches the filename... |
133,508 | I've tried connecting a camera to my Raspberry Pi and I've enabled it on `raspi-config` but `vcgencmd get_camera` still shows `supported=0` `detected=0`. Also, in my `boot/config.txt`, `start_x=1` is not even commented nor enabled upon enabling camera interface. Another thing to note is my Raspberry Pi constantly shows... | 2021/11/25 | [
"https://raspberrypi.stackexchange.com/questions/133508",
"https://raspberrypi.stackexchange.com",
"https://raspberrypi.stackexchange.com/users/141166/"
] | Thanks to the comments, I have rectified the issue. The issue was with the bullseye version of the os. I used a buster version and it worked just fine | 1. [Check first if the camera is supported](http://elinux.org/RPi_VerifiedPeripherals#USB_Webcams)
2. Try a powered USB hub to plug in the camera / maybe it isnt getting enough power
Then you can install this tool to test out the camera `sudo apt-get install luvcview` |
21,876,004 | I am having problems while doing some test for a new app.
I have an activity in which I execute an asynctask to communicate with my server and ask for a json file.
I want that this file is downloaded periodically (don't know, 3-4 seconds) so I created a handler in my activity to execute it each time.
It works fine wi... | 2014/02/19 | [
"https://Stackoverflow.com/questions/21876004",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1463191/"
] | You cannot execute the same `AsyncTask` multiple times.
Before executing the `AsyncTask`, instantiate a new instance first:
```
private void askForData(){
asyncTask = new MyTask();
asyncTask.delegate = this;
asyncTask.execute(urlServer+"test.php");
}
```
Also remove the instantiation of the `AsyncTask` ... | Try like this,
```
private void askForData(){
if (task.getStatus() == AsyncTask.Status.FINISHED) {
task = new AsyncTask();
}
if (task.getStatus() != AsyncTask.Status.RUNNING) {
task.execute();
}
}
``` |
17,206,523 | I was processing my `resultset` to get the details. I need to return an `ArrayList`, so how can I put the key,values from the `resultset` to any of the collection objects and then put the same to an `ArrayList`?
Here is the code:
```
public List<Bike> addBikes() throws ClassNotFoundException, SQLException{
Li... | 2013/06/20 | [
"https://Stackoverflow.com/questions/17206523",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/930544/"
] | For each result in the result set, create a `new Bike()` and copy the values from that result to the new bikes fields. At the end, add the bike to the list.
```
Bike bike = new Bike()
bike.setName(rs.getString("name"));
//...
bikeList.add(bike);
``` | you would instantiate a Bike object and set properties that you read from result set, then add the bike object to your arraylist, isnt it what you are looking for? |
17,206,523 | I was processing my `resultset` to get the details. I need to return an `ArrayList`, so how can I put the key,values from the `resultset` to any of the collection objects and then put the same to an `ArrayList`?
Here is the code:
```
public List<Bike> addBikes() throws ClassNotFoundException, SQLException{
Li... | 2013/06/20 | [
"https://Stackoverflow.com/questions/17206523",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/930544/"
] | For each result in the result set, create a `new Bike()` and copy the values from that result to the new bikes fields. At the end, add the bike to the list.
```
Bike bike = new Bike()
bike.setName(rs.getString("name"));
//...
bikeList.add(bike);
``` | You have Banana in your hand..just eat it :)
Create a empty list and in iteration Create new Bike and add into the List.
```
List<Bike> bikes = new ArrayList<Bikes>();
while(rs.next())
{
Bike bike = new Bike();
bike.setname( rs.getString("name"));
//other prope... |
17,206,523 | I was processing my `resultset` to get the details. I need to return an `ArrayList`, so how can I put the key,values from the `resultset` to any of the collection objects and then put the same to an `ArrayList`?
Here is the code:
```
public List<Bike> addBikes() throws ClassNotFoundException, SQLException{
Li... | 2013/06/20 | [
"https://Stackoverflow.com/questions/17206523",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/930544/"
] | For each result in the result set, create a `new Bike()` and copy the values from that result to the new bikes fields. At the end, add the bike to the list.
```
Bike bike = new Bike()
bike.setName(rs.getString("name"));
//...
bikeList.add(bike);
``` | ```
while (rs.next()) {
Bike bike = new Bike();
bike.setName(rs.getString("name"));
bike.setModel(rs.getString("model"));
bikeList.add(bike);
}
``` |
17,206,523 | I was processing my `resultset` to get the details. I need to return an `ArrayList`, so how can I put the key,values from the `resultset` to any of the collection objects and then put the same to an `ArrayList`?
Here is the code:
```
public List<Bike> addBikes() throws ClassNotFoundException, SQLException{
Li... | 2013/06/20 | [
"https://Stackoverflow.com/questions/17206523",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/930544/"
] | For each result in the result set, create a `new Bike()` and copy the values from that result to the new bikes fields. At the end, add the bike to the list.
```
Bike bike = new Bike()
bike.setName(rs.getString("name"));
//...
bikeList.add(bike);
``` | I don't know how Your Bike class look like, but you should do it like this way:
```
while(rs.next())
{
String column1 = rs.getString("column1_name");
.... and the others columns
Bike bike = new Bike();
bike.setColumn1(column1);
.... and others...
bikeList.add(bike)
}
``` |
17,206,523 | I was processing my `resultset` to get the details. I need to return an `ArrayList`, so how can I put the key,values from the `resultset` to any of the collection objects and then put the same to an `ArrayList`?
Here is the code:
```
public List<Bike> addBikes() throws ClassNotFoundException, SQLException{
Li... | 2013/06/20 | [
"https://Stackoverflow.com/questions/17206523",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/930544/"
] | For each result in the result set, create a `new Bike()` and copy the values from that result to the new bikes fields. At the end, add the bike to the list.
```
Bike bike = new Bike()
bike.setName(rs.getString("name"));
//...
bikeList.add(bike);
``` | You need to instantiate Bike in while loop and add to `List`.
```
List<Bike> bikes = new ArrayList<>();
while(rs.next())
{
Bike bike = new Bike();
bike.setname( rs.getString("name"));
//other properties
bikes.add(bike);
}
return bikes;
``` |
17,206,523 | I was processing my `resultset` to get the details. I need to return an `ArrayList`, so how can I put the key,values from the `resultset` to any of the collection objects and then put the same to an `ArrayList`?
Here is the code:
```
public List<Bike> addBikes() throws ClassNotFoundException, SQLException{
Li... | 2013/06/20 | [
"https://Stackoverflow.com/questions/17206523",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/930544/"
] | you would instantiate a Bike object and set properties that you read from result set, then add the bike object to your arraylist, isnt it what you are looking for? | You need to instantiate Bike in while loop and add to `List`.
```
List<Bike> bikes = new ArrayList<>();
while(rs.next())
{
Bike bike = new Bike();
bike.setname( rs.getString("name"));
//other properties
bikes.add(bike);
}
return bikes;
``` |
17,206,523 | I was processing my `resultset` to get the details. I need to return an `ArrayList`, so how can I put the key,values from the `resultset` to any of the collection objects and then put the same to an `ArrayList`?
Here is the code:
```
public List<Bike> addBikes() throws ClassNotFoundException, SQLException{
Li... | 2013/06/20 | [
"https://Stackoverflow.com/questions/17206523",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/930544/"
] | You have Banana in your hand..just eat it :)
Create a empty list and in iteration Create new Bike and add into the List.
```
List<Bike> bikes = new ArrayList<Bikes>();
while(rs.next())
{
Bike bike = new Bike();
bike.setname( rs.getString("name"));
//other prope... | You need to instantiate Bike in while loop and add to `List`.
```
List<Bike> bikes = new ArrayList<>();
while(rs.next())
{
Bike bike = new Bike();
bike.setname( rs.getString("name"));
//other properties
bikes.add(bike);
}
return bikes;
``` |
17,206,523 | I was processing my `resultset` to get the details. I need to return an `ArrayList`, so how can I put the key,values from the `resultset` to any of the collection objects and then put the same to an `ArrayList`?
Here is the code:
```
public List<Bike> addBikes() throws ClassNotFoundException, SQLException{
Li... | 2013/06/20 | [
"https://Stackoverflow.com/questions/17206523",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/930544/"
] | ```
while (rs.next()) {
Bike bike = new Bike();
bike.setName(rs.getString("name"));
bike.setModel(rs.getString("model"));
bikeList.add(bike);
}
``` | You need to instantiate Bike in while loop and add to `List`.
```
List<Bike> bikes = new ArrayList<>();
while(rs.next())
{
Bike bike = new Bike();
bike.setname( rs.getString("name"));
//other properties
bikes.add(bike);
}
return bikes;
``` |
17,206,523 | I was processing my `resultset` to get the details. I need to return an `ArrayList`, so how can I put the key,values from the `resultset` to any of the collection objects and then put the same to an `ArrayList`?
Here is the code:
```
public List<Bike> addBikes() throws ClassNotFoundException, SQLException{
Li... | 2013/06/20 | [
"https://Stackoverflow.com/questions/17206523",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/930544/"
] | I don't know how Your Bike class look like, but you should do it like this way:
```
while(rs.next())
{
String column1 = rs.getString("column1_name");
.... and the others columns
Bike bike = new Bike();
bike.setColumn1(column1);
.... and others...
bikeList.add(bike)
}
``` | You need to instantiate Bike in while loop and add to `List`.
```
List<Bike> bikes = new ArrayList<>();
while(rs.next())
{
Bike bike = new Bike();
bike.setname( rs.getString("name"));
//other properties
bikes.add(bike);
}
return bikes;
``` |
4,268,625 | What is the best and/or fastest to learn Java API for consuming XML feeds like this:
```
<body copyright="Company">
<student id="1" fname="Anthony" lname="Hopkins"/>
<student id="2" fname="John" lname="Anderson"/>
<student id="3" fname="Will" lname="Smitherman"/>
</body>
```
As you can see it provides a... | 2010/11/24 | [
"https://Stackoverflow.com/questions/4268625",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/311263/"
] | Easiest way is to use JaxB to generate the Java classes for you. If you have a schema you use xjb tool that will create the classes and can let java do all the parsing without you needing to do anything.
Look at <http://www.javaworld.com/javaworld/jw-06-2006/jw-0626-jaxb.html> | It depends on what you want to do with it but XStream might be the easiest way to import data from XML. This can produce a data structure to match your data. |
25,656,841 | I'm trying to make a Greasemonkey script to hide a really annoying div, on a website, that pops up after a few seconds. Neither of these works:
```
$("#flyin").hide();
$(document).ready(function(){
$("#flyin").hide();
});
```
I assume it's because the `#flyin` div is not created, yet. How do I tell jQuery to keep ... | 2014/09/04 | [
"https://Stackoverflow.com/questions/25656841",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1347640/"
] | There's [a utility for that (waitForKeyElements)](https://gist.github.com/2625891).
Your **whole script** would simply be:
```
// ==UserScript==
// @name _YOUR_SCRIPT_NAME
// @include http://YOUR_SERVER.COM/YOUR_PATH/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js
// @require http... | Try
```
(function () {
var $el = $("#flyin").hide();
//the element is not already created
if (!$el.length) {
//create an interval to keep checking for the presents of the element
var timer = setInterval(function () {
var $el = $("#flyin").hide();
//if the element is ... |
180,502 | I wrote a selector for several countries. This selector allows the user to choose a country, then a region and then a city. After the user chooses a city, it displays the selected object's country code, region code and area code (in terms of the [VK API](https://vk.com/dev/database.getCities) social network).
The sele... | 2017/11/15 | [
"https://codereview.stackexchange.com/questions/180502",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/91959/"
] | 1. There is too much nesting, which, for me, makes the logic hard to read. A good rule of thumb is to aim for two levels of nesting, by using the Extract Method refactoring.
2. When the user clicks on the input, nothing happens. When the user starts typing a name that isn't in the list, sometimes the list pops up (if t... | [dcorking](https://codereview.stackexchange.com/users/49616/dcorking) has good points in his/her [answer](https://codereview.stackexchange.com/a/180579/120114) - especially about the redundant code (i.e. point #3). Below is my suggestion to improve the code, in addition to his/her advice.
### Cache DOM Lookups
Like I... |
83,635 | I'm a complete cooking newb. I saw on youtube the other day that you should cook steak in an oven before frying it. I think it makes it softer (not sure, please let me know).
But anyway, I never used an oven in my entire life. And I looked inside the oven and there are no trays in there. So I went to the store and th... | 2017/08/10 | [
"https://cooking.stackexchange.com/questions/83635",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/60749/"
] | To answer your question directly, if the method of cooking is what I think it is, the pan you use should be fine, even if it has a nonstick coating on it. You can read the second section to see if my assumption about your cooking method is correct.
It's important that you don't use nonstick cookware for extremely high... | The method I think you are referring to is called "reverse sear". When I do a reverse sear, I use a standard [wire rack](http://dailydecor.foodiefriendsfridaydailydish.com/wp-content/uploads/2015/04/30b0052baa76.jpg) on top of a foil covered baking sheet. I'm not sure precisely what you mean by a dessert tray - but you... |
31,714,522 | I have two strings.
```
str_a = "the_quick_brown_fox"
str_b = "the_quick_red_fox"
```
I want to find the first index at which the two strings differ (i.e. `str_a[i] != str_b[i]`).
I know I could solve this with something like the following:
```
def diff_char_index(str_a, str_b)
arr_a, arr_b = str_a.split(""), st... | 2015/07/30 | [
"https://Stackoverflow.com/questions/31714522",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3295407/"
] | Something like this ought to work:
```
str_a.each_char.with_index
.find_index {|char, idx| char != str_b[idx] } || str_a.size
```
**Edit:** It works: <http://ideone.com/Ttwu1x>
**Edit 2:** My original code returned `nil` if `str_a` was shorter than `str_b`. I've updated it to work correctly (it will return `str... | ```
i = 0
i += 1 while str_a[i] and str_a[i] == str_b[i]
i
``` |
31,714,522 | I have two strings.
```
str_a = "the_quick_brown_fox"
str_b = "the_quick_red_fox"
```
I want to find the first index at which the two strings differ (i.e. `str_a[i] != str_b[i]`).
I know I could solve this with something like the following:
```
def diff_char_index(str_a, str_b)
arr_a, arr_b = str_a.split(""), st... | 2015/07/30 | [
"https://Stackoverflow.com/questions/31714522",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3295407/"
] | Something like this ought to work:
```
str_a.each_char.with_index
.find_index {|char, idx| char != str_b[idx] } || str_a.size
```
**Edit:** It works: <http://ideone.com/Ttwu1x>
**Edit 2:** My original code returned `nil` if `str_a` was shorter than `str_b`. I've updated it to work correctly (it will return `str... | This uses a binary search to find the index where a slice of `str_a` no longer occurs at the beginning of `str_b`:
```
(0..str_a.length).bsearch { |i| str_b.rindex(str_a[0..i]) != 0 }
``` |
31,714,522 | I have two strings.
```
str_a = "the_quick_brown_fox"
str_b = "the_quick_red_fox"
```
I want to find the first index at which the two strings differ (i.e. `str_a[i] != str_b[i]`).
I know I could solve this with something like the following:
```
def diff_char_index(str_a, str_b)
arr_a, arr_b = str_a.split(""), st... | 2015/07/30 | [
"https://Stackoverflow.com/questions/31714522",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3295407/"
] | Something like this ought to work:
```
str_a.each_char.with_index
.find_index {|char, idx| char != str_b[idx] } || str_a.size
```
**Edit:** It works: <http://ideone.com/Ttwu1x>
**Edit 2:** My original code returned `nil` if `str_a` was shorter than `str_b`. I've updated it to work correctly (it will return `str... | ```
str_a = "the_quick_brown_dog"
str_b = "the_quick_red_dog"
(0..(1.0)/0).find { |i| (str_a[i] != str_b[i]) || str_a[i].nil? }
#=> 10
str_a = "the_quick_brown_dog"
str_b = "the_quick_brown_dog"
(0..(1.0)/0).find { |i| (str_a[i] != str_b[i]) || str_a[i].nil? }
#=> 19
str_a.size
#=> 19
``` |
31,714,522 | I have two strings.
```
str_a = "the_quick_brown_fox"
str_b = "the_quick_red_fox"
```
I want to find the first index at which the two strings differ (i.e. `str_a[i] != str_b[i]`).
I know I could solve this with something like the following:
```
def diff_char_index(str_a, str_b)
arr_a, arr_b = str_a.split(""), st... | 2015/07/30 | [
"https://Stackoverflow.com/questions/31714522",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3295407/"
] | ```
i = 0
i += 1 while str_a[i] and str_a[i] == str_b[i]
i
``` | This uses a binary search to find the index where a slice of `str_a` no longer occurs at the beginning of `str_b`:
```
(0..str_a.length).bsearch { |i| str_b.rindex(str_a[0..i]) != 0 }
``` |
31,714,522 | I have two strings.
```
str_a = "the_quick_brown_fox"
str_b = "the_quick_red_fox"
```
I want to find the first index at which the two strings differ (i.e. `str_a[i] != str_b[i]`).
I know I could solve this with something like the following:
```
def diff_char_index(str_a, str_b)
arr_a, arr_b = str_a.split(""), st... | 2015/07/30 | [
"https://Stackoverflow.com/questions/31714522",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3295407/"
] | ```
str_a = "the_quick_brown_dog"
str_b = "the_quick_red_dog"
(0..(1.0)/0).find { |i| (str_a[i] != str_b[i]) || str_a[i].nil? }
#=> 10
str_a = "the_quick_brown_dog"
str_b = "the_quick_brown_dog"
(0..(1.0)/0).find { |i| (str_a[i] != str_b[i]) || str_a[i].nil? }
#=> 19
str_a.size
#=> 19
``` | This uses a binary search to find the index where a slice of `str_a` no longer occurs at the beginning of `str_b`:
```
(0..str_a.length).bsearch { |i| str_b.rindex(str_a[0..i]) != 0 }
``` |
2,015 | So this question... <https://serverfault.com/questions/45734/the-coolest-server-names>
It's horribly off topic. It's got a few votes to delete it right now because the community does not want it here (it's already been deleted once by the community).
I understand that it's being kept around for its historical signifi... | 2011/09/04 | [
"https://meta.serverfault.com/questions/2015",
"https://meta.serverfault.com",
"https://meta.serverfault.com/users/33118/"
] | I've certainly done my bit to try and get rid of that question, as well as similar ones, but the system is against us. If Jeff brought it back from the dead I'd love to hear his reasoning for doing so. The only reasoning I can think of is that it brings traffic due to Google and traffic translates to revenue and revenu... | Send it back from whence it came. |
2,015 | So this question... <https://serverfault.com/questions/45734/the-coolest-server-names>
It's horribly off topic. It's got a few votes to delete it right now because the community does not want it here (it's already been deleted once by the community).
I understand that it's being kept around for its historical signifi... | 2011/09/04 | [
"https://meta.serverfault.com/questions/2015",
"https://meta.serverfault.com",
"https://meta.serverfault.com/users/33118/"
] | Hear ye, hear ye, hear ye,
--------------------------
Three days have passed. Since then:
* 30% of our >10K users have voted to delete that question, independent of the vote going on here.
* 22 upvotes for sun-based disposal
* 4 upvotes for 'send it back from whence it came'
* Showers of hate upon 'Leave it'.
Based ... | Leave it, just keep it locked down. |
2,015 | So this question... <https://serverfault.com/questions/45734/the-coolest-server-names>
It's horribly off topic. It's got a few votes to delete it right now because the community does not want it here (it's already been deleted once by the community).
I understand that it's being kept around for its historical signifi... | 2011/09/04 | [
"https://meta.serverfault.com/questions/2015",
"https://meta.serverfault.com",
"https://meta.serverfault.com/users/33118/"
] | Throw this question into the sun. | Hear ye, hear ye, hear ye,
--------------------------
Three days have passed. Since then:
* 30% of our >10K users have voted to delete that question, independent of the vote going on here.
* 22 upvotes for sun-based disposal
* 4 upvotes for 'send it back from whence it came'
* Showers of hate upon 'Leave it'.
Based ... |
2,015 | So this question... <https://serverfault.com/questions/45734/the-coolest-server-names>
It's horribly off topic. It's got a few votes to delete it right now because the community does not want it here (it's already been deleted once by the community).
I understand that it's being kept around for its historical signifi... | 2011/09/04 | [
"https://meta.serverfault.com/questions/2015",
"https://meta.serverfault.com",
"https://meta.serverfault.com/users/33118/"
] | It needs to be burniated.
It adds nothing to the site. It was a "fun" question once upon a time *maybe* but we've moved on from that.
Perhaps it should be locked while its fate is being debated? | Send it back from whence it came. |
2,015 | So this question... <https://serverfault.com/questions/45734/the-coolest-server-names>
It's horribly off topic. It's got a few votes to delete it right now because the community does not want it here (it's already been deleted once by the community).
I understand that it's being kept around for its historical signifi... | 2011/09/04 | [
"https://meta.serverfault.com/questions/2015",
"https://meta.serverfault.com",
"https://meta.serverfault.com/users/33118/"
] | Throw this question into the sun. | If it were my choice, I'd just hit the delete button on it here and be done with it.
Yes, by today's rules it is off topic both here and on Stack Overflow. I don't feel it adds *any* useful information to this site, or any on the Stack Exchange network. It goes no way towards the Stack Exchange mission of "make the in... |
2,015 | So this question... <https://serverfault.com/questions/45734/the-coolest-server-names>
It's horribly off topic. It's got a few votes to delete it right now because the community does not want it here (it's already been deleted once by the community).
I understand that it's being kept around for its historical signifi... | 2011/09/04 | [
"https://meta.serverfault.com/questions/2015",
"https://meta.serverfault.com",
"https://meta.serverfault.com/users/33118/"
] | Throw this question into the sun. | I've certainly done my bit to try and get rid of that question, as well as similar ones, but the system is against us. If Jeff brought it back from the dead I'd love to hear his reasoning for doing so. The only reasoning I can think of is that it brings traffic due to Google and traffic translates to revenue and revenu... |
2,015 | So this question... <https://serverfault.com/questions/45734/the-coolest-server-names>
It's horribly off topic. It's got a few votes to delete it right now because the community does not want it here (it's already been deleted once by the community).
I understand that it's being kept around for its historical signifi... | 2011/09/04 | [
"https://meta.serverfault.com/questions/2015",
"https://meta.serverfault.com",
"https://meta.serverfault.com/users/33118/"
] | Send it back from whence it came. | Leave it, just keep it locked down. |
2,015 | So this question... <https://serverfault.com/questions/45734/the-coolest-server-names>
It's horribly off topic. It's got a few votes to delete it right now because the community does not want it here (it's already been deleted once by the community).
I understand that it's being kept around for its historical signifi... | 2011/09/04 | [
"https://meta.serverfault.com/questions/2015",
"https://meta.serverfault.com",
"https://meta.serverfault.com/users/33118/"
] | Hear ye, hear ye, hear ye,
--------------------------
Three days have passed. Since then:
* 30% of our >10K users have voted to delete that question, independent of the vote going on here.
* 22 upvotes for sun-based disposal
* 4 upvotes for 'send it back from whence it came'
* Showers of hate upon 'Leave it'.
Based ... | It needs to be burniated.
It adds nothing to the site. It was a "fun" question once upon a time *maybe* but we've moved on from that.
Perhaps it should be locked while its fate is being debated? |
Subsets and Splits
Short Questions in Train Set
Retrieves a limited number of short questions, providing basic filtering but minimal analytical value.
Train Questions 500-600
This query retrieves a sample of questions with lengths between 500 and 600 characters, which offers basic filtering and limited insight into the dataset's contents.
Virus Queries and Responses
This query retrieves a limited set of records where the question or response contains the word "virus," offering basic filtering but limited analytical value.