qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
26,734,569
How do I add 2 background colours to a container div. I've seen some solutions that work but only with 50% height for each colour. I need one however to have a set height (see image). My current solution is for background 1 to be an 1x260px background image with background 2 being a background colour. This however lea...
2014/11/04
[ "https://Stackoverflow.com/questions/26734569", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1500992/" ]
You can add a pseudo-element like `::after` on your page. ```css * { margin: 0; padding: 0; } body { background: #00AEEF; } body:after { background: #0F75BC; content: ""; display: block; height: 50px; left: 0; top: 0; width: 100%; } ```
**used to this** css ```css .nice{ width:500px; height:500px; margin:auto; position:relative; background:red; color:white; z-index:1; } .nice:after{ content:""; position:absolute; left:0; right:0; top:0; bottom:70%; background:green; z-in...
26,734,569
How do I add 2 background colours to a container div. I've seen some solutions that work but only with 50% height for each colour. I need one however to have a set height (see image). My current solution is for background 1 to be an 1x260px background image with background 2 being a background colour. This however lea...
2014/11/04
[ "https://Stackoverflow.com/questions/26734569", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1500992/" ]
You could use CSS color gradients. Color stops can be specified in pixels for the first band, and then 100% for the rest. This way you won't have to calculate auto-height depending on the container. Here is an example based on your use-case. I have taken 60px as the height of first band to make it fit neatly in the be...
**used to this** css ```css .nice{ width:500px; height:500px; margin:auto; position:relative; background:red; color:white; z-index:1; } .nice:after{ content:""; position:absolute; left:0; right:0; top:0; bottom:70%; background:green; z-in...
26,734,569
How do I add 2 background colours to a container div. I've seen some solutions that work but only with 50% height for each colour. I need one however to have a set height (see image). My current solution is for background 1 to be an 1x260px background image with background 2 being a background colour. This however lea...
2014/11/04
[ "https://Stackoverflow.com/questions/26734569", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1500992/" ]
You can add a pseudo-element like `::after` on your page. ```css * { margin: 0; padding: 0; } body { background: #00AEEF; } body:after { background: #0F75BC; content: ""; display: block; height: 50px; left: 0; top: 0; width: 100%; } ```
Here, I have done only using css and background color. Working [JsFiddle](http://jsfiddle.net/LL9voo6m/) HTML: ``` <div class="part-b"> <div class="background"></div> <div class="container"> <div class="row"> Content </div> </div> </div> ``` CSS: ``` .container { width: 960px !imp...
26,734,569
How do I add 2 background colours to a container div. I've seen some solutions that work but only with 50% height for each colour. I need one however to have a set height (see image). My current solution is for background 1 to be an 1x260px background image with background 2 being a background colour. This however lea...
2014/11/04
[ "https://Stackoverflow.com/questions/26734569", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1500992/" ]
You could use CSS color gradients. Color stops can be specified in pixels for the first band, and then 100% for the rest. This way you won't have to calculate auto-height depending on the container. Here is an example based on your use-case. I have taken 60px as the height of first band to make it fit neatly in the be...
Here, I have done only using css and background color. Working [JsFiddle](http://jsfiddle.net/LL9voo6m/) HTML: ``` <div class="part-b"> <div class="background"></div> <div class="container"> <div class="row"> Content </div> </div> </div> ``` CSS: ``` .container { width: 960px !imp...
46,334,316
Scenario- There is a master lambda who is splitting work and giving it off to multiple other lambdas (workers). The first lambda iterates and invokes the other lambdas asynchronously If the number of lambdas which are getting spawned are more than 1000, will it fail? Should there be an SNS between the two lambdas... ...
2017/09/21
[ "https://Stackoverflow.com/questions/46334316", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8604662/" ]
Just loop through the tuple. ``` #tup stores your tuple string = '' for s in tuple : string+=s ``` Here you are going through the tuple and adding each element of it into a new string.
You can use map to and join. ``` tup = ('h','e',4) map_str = map(str, tup) print(''.join(map_str)) ``` Map takes two arguments. First argument is the function which has to be used for each element of the list. Second argument is the iterable.
46,334,316
Scenario- There is a master lambda who is splitting work and giving it off to multiple other lambdas (workers). The first lambda iterates and invokes the other lambdas asynchronously If the number of lambdas which are getting spawned are more than 1000, will it fail? Should there be an SNS between the two lambdas... ...
2017/09/21
[ "https://Stackoverflow.com/questions/46334316", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8604662/" ]
The given `filter` is useless for this but the given `accumulate` can be used easily: ``` >>> t = ('h','e',4) >>> accumulate(lambda x, s: str(x) + s, '', t) 'he4' ```
Just loop through the tuple. ``` #tup stores your tuple string = '' for s in tuple : string+=s ``` Here you are going through the tuple and adding each element of it into a new string.
46,334,316
Scenario- There is a master lambda who is splitting work and giving it off to multiple other lambdas (workers). The first lambda iterates and invokes the other lambdas asynchronously If the number of lambdas which are getting spawned are more than 1000, will it fail? Should there be an SNS between the two lambdas... ...
2017/09/21
[ "https://Stackoverflow.com/questions/46334316", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8604662/" ]
1) Use `reduce` function: ``` >>> t = ('h','e',4) >>> reduce(lambda x,y: str(x)+str(y), t, '') 'he4' ``` 2) Use foolish recursion: ``` >>> def str_by_recursion(t,s=''): if not t: return '' return str(t[0]) + str_by_recursion(t[1:]) >>> str_by_recursion(t) 'he4' ```
You can use map to and join. ``` tup = ('h','e',4) map_str = map(str, tup) print(''.join(map_str)) ``` Map takes two arguments. First argument is the function which has to be used for each element of the list. Second argument is the iterable.
46,334,316
Scenario- There is a master lambda who is splitting work and giving it off to multiple other lambdas (workers). The first lambda iterates and invokes the other lambdas asynchronously If the number of lambdas which are getting spawned are more than 1000, will it fail? Should there be an SNS between the two lambdas... ...
2017/09/21
[ "https://Stackoverflow.com/questions/46334316", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8604662/" ]
The given `filter` is useless for this but the given `accumulate` can be used easily: ``` >>> t = ('h','e',4) >>> accumulate(lambda x, s: str(x) + s, '', t) 'he4' ```
You can use map to and join. ``` tup = ('h','e',4) map_str = map(str, tup) print(''.join(map_str)) ``` Map takes two arguments. First argument is the function which has to be used for each element of the list. Second argument is the iterable.
46,334,316
Scenario- There is a master lambda who is splitting work and giving it off to multiple other lambdas (workers). The first lambda iterates and invokes the other lambdas asynchronously If the number of lambdas which are getting spawned are more than 1000, will it fail? Should there be an SNS between the two lambdas... ...
2017/09/21
[ "https://Stackoverflow.com/questions/46334316", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8604662/" ]
The given `filter` is useless for this but the given `accumulate` can be used easily: ``` >>> t = ('h','e',4) >>> accumulate(lambda x, s: str(x) + s, '', t) 'he4' ```
1) Use `reduce` function: ``` >>> t = ('h','e',4) >>> reduce(lambda x,y: str(x)+str(y), t, '') 'he4' ``` 2) Use foolish recursion: ``` >>> def str_by_recursion(t,s=''): if not t: return '' return str(t[0]) + str_by_recursion(t[1:]) >>> str_by_recursion(t) 'he4' ```
2,417,197
Currently I am using ViewData or TempData for object persistance in my ASP.NET MVC application. However in a few cases where I am storing objects into ViewData through my base controller class, I am hitting the database on every request (when ViewData["whatever"] == null). It would be good to persist these into somet...
2010/03/10
[ "https://Stackoverflow.com/questions/2417197", "https://Stackoverflow.com", "https://Stackoverflow.com/users/231216/" ]
I believe this is what Session was designed for - to temporarily store session specific data. However, due to increased complexity connected with using the Session, even if negligible - in my own ASP.NET MVC project, I have decided to hit the database on every Order creation step page (only ID is passed between the s...
You can serialize what you wish to persist and place it in a hidden input field like ViewState in WebForms. Here's an article that should get you started: <http://weblogs.asp.net/shijuvarghese/archive/2010/03/06/persisting-model-state-in-asp-net-mvc-using-html-serialize.aspx>
2,417,197
Currently I am using ViewData or TempData for object persistance in my ASP.NET MVC application. However in a few cases where I am storing objects into ViewData through my base controller class, I am hitting the database on every request (when ViewData["whatever"] == null). It would be good to persist these into somet...
2010/03/10
[ "https://Stackoverflow.com/questions/2417197", "https://Stackoverflow.com", "https://Stackoverflow.com/users/231216/" ]
Just thought I would share how I am using session in my application. I really like this implementation ([Suggestions for Accessing ASP.NET MVC Session[] Data in Controllers and Extension Methods?](https://stackoverflow.com/questions/2213052/suggestions-for-accessing-asp-net-mvc-session-data-in-controllers-and-extension...
You can serialize what you wish to persist and place it in a hidden input field like ViewState in WebForms. Here's an article that should get you started: <http://weblogs.asp.net/shijuvarghese/archive/2010/03/06/persisting-model-state-in-asp-net-mvc-using-html-serialize.aspx>
2,417,197
Currently I am using ViewData or TempData for object persistance in my ASP.NET MVC application. However in a few cases where I am storing objects into ViewData through my base controller class, I am hitting the database on every request (when ViewData["whatever"] == null). It would be good to persist these into somet...
2010/03/10
[ "https://Stackoverflow.com/questions/2417197", "https://Stackoverflow.com", "https://Stackoverflow.com/users/231216/" ]
I believe this is what Session was designed for - to temporarily store session specific data. However, due to increased complexity connected with using the Session, even if negligible - in my own ASP.NET MVC project, I have decided to hit the database on every Order creation step page (only ID is passed between the s...
Just thought I would share how I am using session in my application. I really like this implementation ([Suggestions for Accessing ASP.NET MVC Session[] Data in Controllers and Extension Methods?](https://stackoverflow.com/questions/2213052/suggestions-for-accessing-asp-net-mvc-session-data-in-controllers-and-extension...
118,290
Basic Problem ------------- I'm trying to produce a command sequence `\m` that 1. Is called from within math mode, with a single argument `list` 2. "Replaces" all instances `,` and `;` in `list` with `&` and `\\` (resp.) 3. Creates a `pmatrix` with output of 1 & 2 as its content For example, the code ``` \[ \m{...
2013/06/08
[ "https://tex.stackexchange.com/questions/118290", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/14062/" ]
Here's an implementation with `expl3` functions: ``` \documentclass{article} \usepackage{xparse,amsmath} \ExplSyntaxOn \NewDocumentCommand{\matlabmatrix}{m} { \asql_matlab_matrix:n { #1 } } \seq_new:N \l_asql_rows_seq \seq_new:N \l_asql_one_row_seq \tl_new:N \l_asql_matrix_tl \cs_new_protected:Npn \asql_matlab_m...
This code should do what you want: ``` \documentclass{article} \usepackage{xstring,amsmath} \newcommand*\mmm[1]{% \begingroup\expandarg \StrSubstitute{\noexpand#1},&[\result]% \StrSubstitute\result{\noexpand;}{\noexpand\\}[\result]% \begin{pmatrix}\result\end{pmatrix}\endgroup } \begin{document} \[\mmm...
118,290
Basic Problem ------------- I'm trying to produce a command sequence `\m` that 1. Is called from within math mode, with a single argument `list` 2. "Replaces" all instances `,` and `;` in `list` with `&` and `\\` (resp.) 3. Creates a `pmatrix` with output of 1 & 2 as its content For example, the code ``` \[ \m{...
2013/06/08
[ "https://tex.stackexchange.com/questions/118290", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/14062/" ]
Here is a method the old-fashioned way, using macros with delimited parameters. ``` \documentclass{article} \usepackage{amsmath} % for pmatrix environment \newtoks\asqltoks \makeatletter \def\gobtilundef #1\undef {} \def\matlabmatrix #1{\asqltoks{\begin{pmatrix}}\@asqlA #1;\undef;} % \def\@asqlA #1;{\gobtilundef #...
This code should do what you want: ``` \documentclass{article} \usepackage{xstring,amsmath} \newcommand*\mmm[1]{% \begingroup\expandarg \StrSubstitute{\noexpand#1},&[\result]% \StrSubstitute\result{\noexpand;}{\noexpand\\}[\result]% \begin{pmatrix}\result\end{pmatrix}\endgroup } \begin{document} \[\mmm...
118,290
Basic Problem ------------- I'm trying to produce a command sequence `\m` that 1. Is called from within math mode, with a single argument `list` 2. "Replaces" all instances `,` and `;` in `list` with `&` and `\\` (resp.) 3. Creates a `pmatrix` with output of 1 & 2 as its content For example, the code ``` \[ \m{...
2013/06/08
[ "https://tex.stackexchange.com/questions/118290", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/14062/" ]
Here's an implementation with `expl3` functions: ``` \documentclass{article} \usepackage{xparse,amsmath} \ExplSyntaxOn \NewDocumentCommand{\matlabmatrix}{m} { \asql_matlab_matrix:n { #1 } } \seq_new:N \l_asql_rows_seq \seq_new:N \l_asql_one_row_seq \tl_new:N \l_asql_matrix_tl \cs_new_protected:Npn \asql_matlab_m...
Well, if you’re already using [`xstring`](http://www.ctan.org/pkg/xstring), you could just try [`xparse`](http://www.ctan.org/pkg/xparse). Apparently, `pmatrix` survives an additional `\\` after the last line without adding an extra line (unlike the usual math environments). The additional `&` though has to be removed...
118,290
Basic Problem ------------- I'm trying to produce a command sequence `\m` that 1. Is called from within math mode, with a single argument `list` 2. "Replaces" all instances `,` and `;` in `list` with `&` and `\\` (resp.) 3. Creates a `pmatrix` with output of 1 & 2 as its content For example, the code ``` \[ \m{...
2013/06/08
[ "https://tex.stackexchange.com/questions/118290", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/14062/" ]
Here's an implementation with `expl3` functions: ``` \documentclass{article} \usepackage{xparse,amsmath} \ExplSyntaxOn \NewDocumentCommand{\matlabmatrix}{m} { \asql_matlab_matrix:n { #1 } } \seq_new:N \l_asql_rows_seq \seq_new:N \l_asql_one_row_seq \tl_new:N \l_asql_matrix_tl \cs_new_protected:Npn \asql_matlab_m...
You don't have to do string replacement you can just define `,` and `;` to do the right thing in `pmatrix` ![enter image description here](https://i.stack.imgur.com/6bCUi.png) ``` \documentclass{article} \usepackage{amsmath} \def\m#1{{% \mathcode`\,"8000 \mathcode`\;"8000 \begingroup\lccode`\~`\,% \lowercase{\endgrou...
118,290
Basic Problem ------------- I'm trying to produce a command sequence `\m` that 1. Is called from within math mode, with a single argument `list` 2. "Replaces" all instances `,` and `;` in `list` with `&` and `\\` (resp.) 3. Creates a `pmatrix` with output of 1 & 2 as its content For example, the code ``` \[ \m{...
2013/06/08
[ "https://tex.stackexchange.com/questions/118290", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/14062/" ]
Here is a method the old-fashioned way, using macros with delimited parameters. ``` \documentclass{article} \usepackage{amsmath} % for pmatrix environment \newtoks\asqltoks \makeatletter \def\gobtilundef #1\undef {} \def\matlabmatrix #1{\asqltoks{\begin{pmatrix}}\@asqlA #1;\undef;} % \def\@asqlA #1;{\gobtilundef #...
Well, if you’re already using [`xstring`](http://www.ctan.org/pkg/xstring), you could just try [`xparse`](http://www.ctan.org/pkg/xparse). Apparently, `pmatrix` survives an additional `\\` after the last line without adding an extra line (unlike the usual math environments). The additional `&` though has to be removed...
118,290
Basic Problem ------------- I'm trying to produce a command sequence `\m` that 1. Is called from within math mode, with a single argument `list` 2. "Replaces" all instances `,` and `;` in `list` with `&` and `\\` (resp.) 3. Creates a `pmatrix` with output of 1 & 2 as its content For example, the code ``` \[ \m{...
2013/06/08
[ "https://tex.stackexchange.com/questions/118290", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/14062/" ]
Here is a method the old-fashioned way, using macros with delimited parameters. ``` \documentclass{article} \usepackage{amsmath} % for pmatrix environment \newtoks\asqltoks \makeatletter \def\gobtilundef #1\undef {} \def\matlabmatrix #1{\asqltoks{\begin{pmatrix}}\@asqlA #1;\undef;} % \def\@asqlA #1;{\gobtilundef #...
You don't have to do string replacement you can just define `,` and `;` to do the right thing in `pmatrix` ![enter image description here](https://i.stack.imgur.com/6bCUi.png) ``` \documentclass{article} \usepackage{amsmath} \def\m#1{{% \mathcode`\,"8000 \mathcode`\;"8000 \begingroup\lccode`\~`\,% \lowercase{\endgrou...
52,959,822
Hy I have made an AIR application that uses the flash.desktop.NativeProcess to start an c++ a\* pathsolver. The reason being - Flash needs too much time to solve 250 \* 250 open grid. The AIR app is fine. It can start the c++ exe file The exe fine works on its own The problem is. They don't work in pair :( When ...
2018/10/24
[ "https://Stackoverflow.com/questions/52959822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3845417/" ]
You can use modle bind to data in your label.Just like this: in xaml : ``` <Label Text="{Binding Name,StringFormat='You can win {0} dollars for sure'}" HorizontalOptions="Center" VerticalOptions="CenterAndExpand" /> ``` in ContentPage, should bind context: ``` nativeDataTemple = new NativeDataTempl...
use spans within a Label ``` <Label> <Label.FormattedText> <FormattedString> <Span Text="You can win " /> <Span Text="{Binding DollarAmount}" /> <Span Text=" dollars for sure." /> </FormattedString> </Label.FormattedText> </Label> ```
23,077,657
`Thread.sleep()` to me seems like a really useless concept because the only way I see it working is in the following scenarios ``` public void someFunction() { //thread does something Thread.sleep(50000); //now other threads do something } ``` The problem is that for me this is just asking for t...
2014/04/15
[ "https://Stackoverflow.com/questions/23077657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2385352/" ]
Both `Thread.sleep(long)` and `Object.wait(long)` block current thread. However `wait` may return earlier (spurious wakeup), see javadoc. So for `wait` we need to implement additional logic which guarantees that specified amount of time elapsed. So if you simply want to make a pause - use `Thread.sleep`
You use `Thread.sleep` every time you want to slow things down. In certain scenarios you are unable to synchronize, like in case of communication with external systems over the network, database, etc. Example scenarios: * ***Error recovery*** - When your system depends on some external entity that reports temporary e...
23,077,657
`Thread.sleep()` to me seems like a really useless concept because the only way I see it working is in the following scenarios ``` public void someFunction() { //thread does something Thread.sleep(50000); //now other threads do something } ``` The problem is that for me this is just asking for t...
2014/04/15
[ "https://Stackoverflow.com/questions/23077657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2385352/" ]
Although many times the event-driven model is the best way to "wait" for an action to occur, there are sometimes that you need to wait intentionally for a short amount of time and then make an action. A common case of this is a condition of sampling/polling data (from files, from the network etc) between some periods ...
If the requirement spec calls for a five-second wait, maybe somewhere deep down in several functions in some process-control thread code, maybe only under some conditions, a Sleep(5000) call is a good solution for the following reasons: * It does not require simple in-line code to be rewritten as a complex state-machi...
23,077,657
`Thread.sleep()` to me seems like a really useless concept because the only way I see it working is in the following scenarios ``` public void someFunction() { //thread does something Thread.sleep(50000); //now other threads do something } ``` The problem is that for me this is just asking for t...
2014/04/15
[ "https://Stackoverflow.com/questions/23077657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2385352/" ]
It would be impossible to write java.util.Timer without a sleep() method, or at least it would require you to abuse the wait() method, and write a lot of extra code around it to protect against spurious wakeups.
You use `Thread.sleep` every time you want to slow things down. In certain scenarios you are unable to synchronize, like in case of communication with external systems over the network, database, etc. Example scenarios: * ***Error recovery*** - When your system depends on some external entity that reports temporary e...
23,077,657
`Thread.sleep()` to me seems like a really useless concept because the only way I see it working is in the following scenarios ``` public void someFunction() { //thread does something Thread.sleep(50000); //now other threads do something } ``` The problem is that for me this is just asking for t...
2014/04/15
[ "https://Stackoverflow.com/questions/23077657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2385352/" ]
It would be impossible to write java.util.Timer without a sleep() method, or at least it would require you to abuse the wait() method, and write a lot of extra code around it to protect against spurious wakeups.
If the requirement spec calls for a five-second wait, maybe somewhere deep down in several functions in some process-control thread code, maybe only under some conditions, a Sleep(5000) call is a good solution for the following reasons: * It does not require simple in-line code to be rewritten as a complex state-machi...
23,077,657
`Thread.sleep()` to me seems like a really useless concept because the only way I see it working is in the following scenarios ``` public void someFunction() { //thread does something Thread.sleep(50000); //now other threads do something } ``` The problem is that for me this is just asking for t...
2014/04/15
[ "https://Stackoverflow.com/questions/23077657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2385352/" ]
Consider a service launching 2 different threads performing 2 different things connected to each other, one of the threads fails an an exception is caught(network problem, a remote host doesn't reply), you want your service to be up and running in the shortest time possible. The best thing is to wait some time and then...
You use `Thread.sleep` every time you want to slow things down. In certain scenarios you are unable to synchronize, like in case of communication with external systems over the network, database, etc. Example scenarios: * ***Error recovery*** - When your system depends on some external entity that reports temporary e...
23,077,657
`Thread.sleep()` to me seems like a really useless concept because the only way I see it working is in the following scenarios ``` public void someFunction() { //thread does something Thread.sleep(50000); //now other threads do something } ``` The problem is that for me this is just asking for t...
2014/04/15
[ "https://Stackoverflow.com/questions/23077657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2385352/" ]
It would be impossible to write java.util.Timer without a sleep() method, or at least it would require you to abuse the wait() method, and write a lot of extra code around it to protect against spurious wakeups.
Consider a service launching 2 different threads performing 2 different things connected to each other, one of the threads fails an an exception is caught(network problem, a remote host doesn't reply), you want your service to be up and running in the shortest time possible. The best thing is to wait some time and then...
23,077,657
`Thread.sleep()` to me seems like a really useless concept because the only way I see it working is in the following scenarios ``` public void someFunction() { //thread does something Thread.sleep(50000); //now other threads do something } ``` The problem is that for me this is just asking for t...
2014/04/15
[ "https://Stackoverflow.com/questions/23077657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2385352/" ]
Although many times the event-driven model is the best way to "wait" for an action to occur, there are sometimes that you need to wait intentionally for a short amount of time and then make an action. A common case of this is a condition of sampling/polling data (from files, from the network etc) between some periods ...
You use `Thread.sleep` every time you want to slow things down. In certain scenarios you are unable to synchronize, like in case of communication with external systems over the network, database, etc. Example scenarios: * ***Error recovery*** - When your system depends on some external entity that reports temporary e...
23,077,657
`Thread.sleep()` to me seems like a really useless concept because the only way I see it working is in the following scenarios ``` public void someFunction() { //thread does something Thread.sleep(50000); //now other threads do something } ``` The problem is that for me this is just asking for t...
2014/04/15
[ "https://Stackoverflow.com/questions/23077657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2385352/" ]
Both `Thread.sleep(long)` and `Object.wait(long)` block current thread. However `wait` may return earlier (spurious wakeup), see javadoc. So for `wait` we need to implement additional logic which guarantees that specified amount of time elapsed. So if you simply want to make a pause - use `Thread.sleep`
If the requirement spec calls for a five-second wait, maybe somewhere deep down in several functions in some process-control thread code, maybe only under some conditions, a Sleep(5000) call is a good solution for the following reasons: * It does not require simple in-line code to be rewritten as a complex state-machi...
23,077,657
`Thread.sleep()` to me seems like a really useless concept because the only way I see it working is in the following scenarios ``` public void someFunction() { //thread does something Thread.sleep(50000); //now other threads do something } ``` The problem is that for me this is just asking for t...
2014/04/15
[ "https://Stackoverflow.com/questions/23077657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2385352/" ]
It would be impossible to write java.util.Timer without a sleep() method, or at least it would require you to abuse the wait() method, and write a lot of extra code around it to protect against spurious wakeups.
Although many times the event-driven model is the best way to "wait" for an action to occur, there are sometimes that you need to wait intentionally for a short amount of time and then make an action. A common case of this is a condition of sampling/polling data (from files, from the network etc) between some periods ...
23,077,657
`Thread.sleep()` to me seems like a really useless concept because the only way I see it working is in the following scenarios ``` public void someFunction() { //thread does something Thread.sleep(50000); //now other threads do something } ``` The problem is that for me this is just asking for t...
2014/04/15
[ "https://Stackoverflow.com/questions/23077657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2385352/" ]
Consider a service launching 2 different threads performing 2 different things connected to each other, one of the threads fails an an exception is caught(network problem, a remote host doesn't reply), you want your service to be up and running in the shortest time possible. The best thing is to wait some time and then...
If the requirement spec calls for a five-second wait, maybe somewhere deep down in several functions in some process-control thread code, maybe only under some conditions, a Sleep(5000) call is a good solution for the following reasons: * It does not require simple in-line code to be rewritten as a complex state-machi...
37,567,638
I have a HTML button: ``` <button id="reset" type="button">Reset</button> ``` I want to set the `onclick` behaviour - link to a page depending on the URL parameters for this button. On searching, I found that it is only possible through Javascript, through something like this: ``` <script type="text/javascript"char...
2016/06/01
[ "https://Stackoverflow.com/questions/37567638", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1770037/" ]
I don't think speed is a concern here, the difference between them is so quick it wont effect your code..
I think, id selector works faster. HTML ID attributes are unique in every page and even older browsers can locate a single element very quickly.
37,567,638
I have a HTML button: ``` <button id="reset" type="button">Reset</button> ``` I want to set the `onclick` behaviour - link to a page depending on the URL parameters for this button. On searching, I found that it is only possible through Javascript, through something like this: ``` <script type="text/javascript"char...
2016/06/01
[ "https://Stackoverflow.com/questions/37567638", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1770037/" ]
I don't think speed is a concern here, the difference between them is so quick it wont effect your code..
Id is obviously faster then class because there can be only one Id, once found need no more search. However the speed is not concern. If you need to do some work on multiple elements you use class but if you need to do work on a particular element you use Id.
37,567,638
I have a HTML button: ``` <button id="reset" type="button">Reset</button> ``` I want to set the `onclick` behaviour - link to a page depending on the URL parameters for this button. On searching, I found that it is only possible through Javascript, through something like this: ``` <script type="text/javascript"char...
2016/06/01
[ "https://Stackoverflow.com/questions/37567638", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1770037/" ]
I don't think speed is a concern here, the difference between them is so quick it wont effect your code..
Id's in html are auto assigned in JS. Because there can be only 1 `id` on the page with that name. the **entire** element is assigned into a JS variable. For example: the element `<span id='spanTagOne'>Text</span>` will be a JS variable `spanTagOne`. So you don't even need to get them since they are already assigned...
37,567,638
I have a HTML button: ``` <button id="reset" type="button">Reset</button> ``` I want to set the `onclick` behaviour - link to a page depending on the URL parameters for this button. On searching, I found that it is only possible through Javascript, through something like this: ``` <script type="text/javascript"char...
2016/06/01
[ "https://Stackoverflow.com/questions/37567638", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1770037/" ]
I don't think speed is a concern here, the difference between them is so quick it wont effect your code..
try this way to find $('parent').find('.child') is a faster way to find element.
30,353,628
I get the error `"Communications link failure"` at this line of code: ``` mySqlCon = DriverManager.getConnection("jdbc:mysql://**server ip address**:3306/db-name", "mu-user-name", "my-password"); ``` I checked everything in [this post](https://stackoverflow.com/questions/6865538/solving-a-communications-link-failure...
2015/05/20
[ "https://Stackoverflow.com/questions/30353628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2959833/" ]
Take a look [here](https://dev.mysql.com/doc/refman/5.7/en/packet-too-large.html) . Looks the following describes your case > > The largest possible packet that can be transmitted to or from a MySQL > 5.7 server or client is 1GB. > > > When a MySQL client or the mysqld server receives a packet bigger than > max\_...
I changed the binding address in my.cnf file in /etc/mysql to the ip address of the server, and it solved the problem.
2,009,098
Let P be an external point of a circle with center in O and also the intersection of two lines r and s that are tangent to the circle. If PAB is a triangle such that AB is also also tangent to the circle, find AÔB knowing that P = 40°. I draw the problem: [![enter image description here](https://i.stack.imgur.com/UCZ...
2016/11/11
[ "https://math.stackexchange.com/questions/2009098", "https://math.stackexchange.com", "https://math.stackexchange.com/users/78511/" ]
First of all, note that $\angle PAB + \angle PBA = 140^\circ$. That means that $\angle MAB + \angle NBA = 220^\circ$. Then we see that $AO$ bisects $\angle MAB$, and $BO$ bisects $\angle NBA$, so $\angle OAB + \angle OBA = 110^\circ$. Lastly, looking at the quadrilateral $AOBP$, we see that $x = 360^\circ - 40^\circ ...
We know $\angle PON=70°$ and $\angle NOP=140°$. And we also know that $OB$ and $OA$ are bisectors of $\angle NOT$ and $\angle TOM$ respectively. Therefore $$BOT+TOA=70°$$ [![enter image description here](https://i.stack.imgur.com/19MdE.jpg)](https://i.stack.imgur.com/19MdE.jpg)
2,009,098
Let P be an external point of a circle with center in O and also the intersection of two lines r and s that are tangent to the circle. If PAB is a triangle such that AB is also also tangent to the circle, find AÔB knowing that P = 40°. I draw the problem: [![enter image description here](https://i.stack.imgur.com/UCZ...
2016/11/11
[ "https://math.stackexchange.com/questions/2009098", "https://math.stackexchange.com", "https://math.stackexchange.com/users/78511/" ]
First of all, note that $\angle PAB + \angle PBA = 140^\circ$. That means that $\angle MAB + \angle NBA = 220^\circ$. Then we see that $AO$ bisects $\angle MAB$, and $BO$ bisects $\angle NBA$, so $\angle OAB + \angle OBA = 110^\circ$. Lastly, looking at the quadrilateral $AOBP$, we see that $x = 360^\circ - 40^\circ ...
Two tangents meet at a point. Therefore MP = NP. Only if OTP is a straight line, triangles MPN and APB are similar, hence both isoceles in this particular case - otherwise the triangles are not similar and only MPN is isoceles.
40,111,882
I was browsing the w3.org page about the `article` element and one of the exemples surprised me: ``` <article> <header> <h1>The Very First Rule of Life</h1> <p><time pubdate datetime="2009-10-09T14:28-08:00"></time></p> </header> <p>If there's a microphone anywhere near you, assume it's hot and sending whateve...
2016/10/18
[ "https://Stackoverflow.com/questions/40111882", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6456842/" ]
According to what you have in your question and the astropy docs (<http://docs.astropy.org/en/stable/io/fits/>), it looks like you just need to do: ``` from astropy.io import fits import pandas with fits.open('datafile') as data: df = pandas.DataFrame(data[0].data) ``` Edit: I don't have much experience we astr...
Note: the second option with Table is better for most cases, since the way FITS files store data is big-endian, which can cause problems when reading into a DataFrame object which is little-endian. See <https://github.com/astropy/astropy/issues/1156>
44,014,722
I built an npm module named `emeraldfw` and published it. My `package.json` file is ``` { "name": "emeraldfw", "version": "0.6.0", "bin": "./emeraldfw.js", "description": "Emerald Framework is a language-agnostig web development framework, designed to make developer's lives easier and fun while coding.", "ma...
2017/05/17
[ "https://Stackoverflow.com/questions/44014722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5021963/" ]
> > I want to get html-text few seconds after opening url. > > > Well, the webpage HTML stays the same right after you "get" the url using Requests, so there's no need to wait a few seconds as the HTML will not change. I assume the reason that you would like to wait is for the page to load all the relevant resour...
You want to change the last line to: ``` html = requests.get(url).text ```
44,014,722
I built an npm module named `emeraldfw` and published it. My `package.json` file is ``` { "name": "emeraldfw", "version": "0.6.0", "bin": "./emeraldfw.js", "description": "Emerald Framework is a language-agnostig web development framework, designed to make developer's lives easier and fun while coding.", "ma...
2017/05/17
[ "https://Stackoverflow.com/questions/44014722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5021963/" ]
try using [`time.sleep(t)`](https://docs.python.org/2/library/time.html#time.sleep) ``` response = request.get(url) time.sleep(5) # suspend execution for 5 secs html = response.text ```
You want to change the last line to: ``` html = requests.get(url).text ```
44,014,722
I built an npm module named `emeraldfw` and published it. My `package.json` file is ``` { "name": "emeraldfw", "version": "0.6.0", "bin": "./emeraldfw.js", "description": "Emerald Framework is a language-agnostig web development framework, designed to make developer's lives easier and fun while coding.", "ma...
2017/05/17
[ "https://Stackoverflow.com/questions/44014722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5021963/" ]
You want to change the last line to: ``` html = requests.get(url).text ```
basically you can give a sleep to the request as a parameter as bellow: ``` import requests import time url = "http://XXXXX…" seconds = 5 html = requests.get(url,time.sleep(seconds)).text #for example 5 seconds ```
44,014,722
I built an npm module named `emeraldfw` and published it. My `package.json` file is ``` { "name": "emeraldfw", "version": "0.6.0", "bin": "./emeraldfw.js", "description": "Emerald Framework is a language-agnostig web development framework, designed to make developer's lives easier and fun while coding.", "ma...
2017/05/17
[ "https://Stackoverflow.com/questions/44014722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5021963/" ]
> > I want to get html-text few seconds after opening url. > > > Well, the webpage HTML stays the same right after you "get" the url using Requests, so there's no need to wait a few seconds as the HTML will not change. I assume the reason that you would like to wait is for the page to load all the relevant resour...
try using [`time.sleep(t)`](https://docs.python.org/2/library/time.html#time.sleep) ``` response = request.get(url) time.sleep(5) # suspend execution for 5 secs html = response.text ```
44,014,722
I built an npm module named `emeraldfw` and published it. My `package.json` file is ``` { "name": "emeraldfw", "version": "0.6.0", "bin": "./emeraldfw.js", "description": "Emerald Framework is a language-agnostig web development framework, designed to make developer's lives easier and fun while coding.", "ma...
2017/05/17
[ "https://Stackoverflow.com/questions/44014722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5021963/" ]
> > I want to get html-text few seconds after opening url. > > > Well, the webpage HTML stays the same right after you "get" the url using Requests, so there's no need to wait a few seconds as the HTML will not change. I assume the reason that you would like to wait is for the page to load all the relevant resour...
basically you can give a sleep to the request as a parameter as bellow: ``` import requests import time url = "http://XXXXX…" seconds = 5 html = requests.get(url,time.sleep(seconds)).text #for example 5 seconds ```
44,014,722
I built an npm module named `emeraldfw` and published it. My `package.json` file is ``` { "name": "emeraldfw", "version": "0.6.0", "bin": "./emeraldfw.js", "description": "Emerald Framework is a language-agnostig web development framework, designed to make developer's lives easier and fun while coding.", "ma...
2017/05/17
[ "https://Stackoverflow.com/questions/44014722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5021963/" ]
> > I want to get html-text few seconds after opening url. > > > Well, the webpage HTML stays the same right after you "get" the url using Requests, so there's no need to wait a few seconds as the HTML will not change. I assume the reason that you would like to wait is for the page to load all the relevant resour...
I have found the library `requests-html` handy for this purpose, though mostly I use Selenium (as already proposed in Danny answer). ``` from requests_html import HTMLSession, HTMLResponse session = HTMLSession() req = cast(HTMLResponse, session.get("http://XXXXX")) req.html.render(sleep=5, keep_page=True) ``` Now,...
44,014,722
I built an npm module named `emeraldfw` and published it. My `package.json` file is ``` { "name": "emeraldfw", "version": "0.6.0", "bin": "./emeraldfw.js", "description": "Emerald Framework is a language-agnostig web development framework, designed to make developer's lives easier and fun while coding.", "ma...
2017/05/17
[ "https://Stackoverflow.com/questions/44014722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5021963/" ]
try using [`time.sleep(t)`](https://docs.python.org/2/library/time.html#time.sleep) ``` response = request.get(url) time.sleep(5) # suspend execution for 5 secs html = response.text ```
basically you can give a sleep to the request as a parameter as bellow: ``` import requests import time url = "http://XXXXX…" seconds = 5 html = requests.get(url,time.sleep(seconds)).text #for example 5 seconds ```
44,014,722
I built an npm module named `emeraldfw` and published it. My `package.json` file is ``` { "name": "emeraldfw", "version": "0.6.0", "bin": "./emeraldfw.js", "description": "Emerald Framework is a language-agnostig web development framework, designed to make developer's lives easier and fun while coding.", "ma...
2017/05/17
[ "https://Stackoverflow.com/questions/44014722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5021963/" ]
try using [`time.sleep(t)`](https://docs.python.org/2/library/time.html#time.sleep) ``` response = request.get(url) time.sleep(5) # suspend execution for 5 secs html = response.text ```
I have found the library `requests-html` handy for this purpose, though mostly I use Selenium (as already proposed in Danny answer). ``` from requests_html import HTMLSession, HTMLResponse session = HTMLSession() req = cast(HTMLResponse, session.get("http://XXXXX")) req.html.render(sleep=5, keep_page=True) ``` Now,...
44,014,722
I built an npm module named `emeraldfw` and published it. My `package.json` file is ``` { "name": "emeraldfw", "version": "0.6.0", "bin": "./emeraldfw.js", "description": "Emerald Framework is a language-agnostig web development framework, designed to make developer's lives easier and fun while coding.", "ma...
2017/05/17
[ "https://Stackoverflow.com/questions/44014722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5021963/" ]
I have found the library `requests-html` handy for this purpose, though mostly I use Selenium (as already proposed in Danny answer). ``` from requests_html import HTMLSession, HTMLResponse session = HTMLSession() req = cast(HTMLResponse, session.get("http://XXXXX")) req.html.render(sleep=5, keep_page=True) ``` Now,...
basically you can give a sleep to the request as a parameter as bellow: ``` import requests import time url = "http://XXXXX…" seconds = 5 html = requests.get(url,time.sleep(seconds)).text #for example 5 seconds ```
24,950,742
I am trying to iterate both index of **JSON**(Players and Buildings), so that i can a get new result in **jQuery** I have two index of **JSON** one having information of Players and second index having information of Building related Player. I want to Parse it so that i can get Player and its building name. **My Ac...
2014/07/25
[ "https://Stackoverflow.com/questions/24950742", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1868277/" ]
Here you go, this go for each player and check if there are buildings and will map them to new structure. This will not filter values for buildings that do not have mapping to players, and will not include the buildings with no players. ``` var x = { "Players": [ { "id": "35", "buil...
If you need it in PHP : ``` $json = '{...}'; // create and PHP array with you json data. $array = json_decode($json, true); // make an array with buildings informations and with building id as key $buildings = array(); foreach( $array['Buildings'] as $b ) $buildings[$b['id']] = $b; $informations = array(); for ( $...
24,343,943
I am currently getting absolutely bally nowhere with a problem with Hibernate where I am given the message: ``` Your page request has caused a QueryException: could not resolve property: PERSON_ID of: library.model.Person [FROM library.model.Person p JOIN Book b ON p.PERSON_ID = b.PERSON_ID WHERE p.PERSON_ID = 2] erro...
2014/06/21
[ "https://Stackoverflow.com/questions/24343943", "https://Stackoverflow.com", "https://Stackoverflow.com/users/953331/" ]
You wrote your HQL query as if it was a SQL query. It's not. HQL and JPQL are different languages. HQL never uses table and column names. It always uses entity names and their persistent field names (i.e. personId and not PERSON\_ID) and their associations. Joins in HQL consists in navigating through association betwe...
If i understand correctly after you get Person from controller `return (Person) session.get(Person.class, personId);` This person instance is not having books as books are loaded by lazily. And when you call person.getBooks() it requires an open session to load the books but in your DAO session got already closed in fi...
24,343,943
I am currently getting absolutely bally nowhere with a problem with Hibernate where I am given the message: ``` Your page request has caused a QueryException: could not resolve property: PERSON_ID of: library.model.Person [FROM library.model.Person p JOIN Book b ON p.PERSON_ID = b.PERSON_ID WHERE p.PERSON_ID = 2] erro...
2014/06/21
[ "https://Stackoverflow.com/questions/24343943", "https://Stackoverflow.com", "https://Stackoverflow.com/users/953331/" ]
You wrote your HQL query as if it was a SQL query. It's not. HQL and JPQL are different languages. HQL never uses table and column names. It always uses entity names and their persistent field names (i.e. personId and not PERSON\_ID) and their associations. Joins in HQL consists in navigating through association betwe...
In HQL no need to use ON condition in joins hibernate will generate this on runtime. And only our POJO variable name should be used in our HQL. FROM Person p JOIN p.book b WHERE p.persionId=personid
24,343,943
I am currently getting absolutely bally nowhere with a problem with Hibernate where I am given the message: ``` Your page request has caused a QueryException: could not resolve property: PERSON_ID of: library.model.Person [FROM library.model.Person p JOIN Book b ON p.PERSON_ID = b.PERSON_ID WHERE p.PERSON_ID = 2] erro...
2014/06/21
[ "https://Stackoverflow.com/questions/24343943", "https://Stackoverflow.com", "https://Stackoverflow.com/users/953331/" ]
Safer still than HQL is using the [criteria API](http://www.mkyong.com/hibernate/hibernate-criteria-examples/): ``` @RequestMapping(value = "/books", method = RequestMethod.GET) public String listBooks(@RequestParam("personId") String personId, Model model) { Criteria query = session....
If i understand correctly after you get Person from controller `return (Person) session.get(Person.class, personId);` This person instance is not having books as books are loaded by lazily. And when you call person.getBooks() it requires an open session to load the books but in your DAO session got already closed in fi...
24,343,943
I am currently getting absolutely bally nowhere with a problem with Hibernate where I am given the message: ``` Your page request has caused a QueryException: could not resolve property: PERSON_ID of: library.model.Person [FROM library.model.Person p JOIN Book b ON p.PERSON_ID = b.PERSON_ID WHERE p.PERSON_ID = 2] erro...
2014/06/21
[ "https://Stackoverflow.com/questions/24343943", "https://Stackoverflow.com", "https://Stackoverflow.com/users/953331/" ]
Safer still than HQL is using the [criteria API](http://www.mkyong.com/hibernate/hibernate-criteria-examples/): ``` @RequestMapping(value = "/books", method = RequestMethod.GET) public String listBooks(@RequestParam("personId") String personId, Model model) { Criteria query = session....
In HQL no need to use ON condition in joins hibernate will generate this on runtime. And only our POJO variable name should be used in our HQL. FROM Person p JOIN p.book b WHERE p.persionId=personid
16,435
I'm working on *yet* another time-tracking web application. This application has, next to the normal site, a mobile version. Now I wonder, is it ok for the mobile version to be a limited subset of the full site? For example, the mobile version shows a very limited overview of today's activities, while in the full sit...
2012/01/22
[ "https://ux.stackexchange.com/questions/16435", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/11078/" ]
Mobile websites should not be mobile versions of desktop websites - they should be a service or product *for mobile usage*. That means that yes, if certain content isn't relevant 'on the road', or if its inclusion makes it harder to provide an interface that works better in a mobile context, you should consider choppin...
**Certainly**. Mobile users have much less attention and time to spend on your site (as discussed in the excelent resource [Mobile First](http://www.abookapart.com/products/mobile-first) by Luke Wroblewski). This means extraneous, rarely used actions will get in the way. [Take a page from mobile apps](http://www.luke...
16,435
I'm working on *yet* another time-tracking web application. This application has, next to the normal site, a mobile version. Now I wonder, is it ok for the mobile version to be a limited subset of the full site? For example, the mobile version shows a very limited overview of today's activities, while in the full sit...
2012/01/22
[ "https://ux.stackexchange.com/questions/16435", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/11078/" ]
Mobile websites should not be mobile versions of desktop websites - they should be a service or product *for mobile usage*. That means that yes, if certain content isn't relevant 'on the road', or if its inclusion makes it harder to provide an interface that works better in a mobile context, you should consider choppin...
Does "mobile" include "tablet"? If it does, then the answer is probably no. Expect tablets to become significant enough to replace desktops for at least some of your users. However, even on tablets the screen space is still a bit scarce. You may need to move less frequently used features off the main screens.
16,435
I'm working on *yet* another time-tracking web application. This application has, next to the normal site, a mobile version. Now I wonder, is it ok for the mobile version to be a limited subset of the full site? For example, the mobile version shows a very limited overview of today's activities, while in the full sit...
2012/01/22
[ "https://ux.stackexchange.com/questions/16435", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/11078/" ]
**Certainly**. Mobile users have much less attention and time to spend on your site (as discussed in the excelent resource [Mobile First](http://www.abookapart.com/products/mobile-first) by Luke Wroblewski). This means extraneous, rarely used actions will get in the way. [Take a page from mobile apps](http://www.luke...
Does "mobile" include "tablet"? If it does, then the answer is probably no. Expect tablets to become significant enough to replace desktops for at least some of your users. However, even on tablets the screen space is still a bit scarce. You may need to move less frequently used features off the main screens.
74,224,393
So I was watching a course and stumbled on a method called `Object.assign()` which merges two objects together. But since objects are orderless, I was wondering in which order the properties of the objects would be merged. Kudos to any good answers.
2022/10/27
[ "https://Stackoverflow.com/questions/74224393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You can use a `sequence` to produce a cycle of alphabetic values. Start with a sequence that cycles through values from `1` to `26`: ``` create sequence AlphaValue as Int MinValue 1 MaxValue 26 Cycle; ``` Then you can use `Char` to convert the returned value into the corresponding letter: ``` declare @Count as Int ...
Thank you, was able to figure it out, with your help of course.. Please see the code below, This will print A to Z individually every time I run this block of code Declare @Alphabet TABLE (Alpha1 VARCHAR(1), Alphaint VARCHAR(2), Count1 INT) Declare @Count as Int = 0; Declare @AlphaValue as Int; while @Count < 30 b...
38,469,634
There's any way to edit an $.ajax function, to include the proprierty "data", when she's receive any value, and remove her, when there's not? I mean, dynamically? e.g.: When there's a value to the variable: ``` var parametro = "{id: "1"}"; $.ajax({ type: "POST", url: url, da...
2016/07/19
[ "https://Stackoverflow.com/questions/38469634", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1717381/" ]
Because both of them are objects, you can use `jQuery.extend()` to extend the options object. Like this: ``` var parametro = { id: "1" }; var defaults = { type: "POST", url: url, async: async, ... }; var options = $.extend(defaults, parametro); $.ajax(options); ``` ...
As far as I know I would suggest put the if condition outside of `$.ajax` such as ``` if(parametro){ $.ajax({ type: "POST", url: url, data: parametro , async: async, ... }); }else{ $.ajax({ type: "POST", url: url, async: async, ... } ```
38,469,634
There's any way to edit an $.ajax function, to include the proprierty "data", when she's receive any value, and remove her, when there's not? I mean, dynamically? e.g.: When there's a value to the variable: ``` var parametro = "{id: "1"}"; $.ajax({ type: "POST", url: url, da...
2016/07/19
[ "https://Stackoverflow.com/questions/38469634", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1717381/" ]
Because both of them are objects, you can use `jQuery.extend()` to extend the options object. Like this: ``` var parametro = { id: "1" }; var defaults = { type: "POST", url: url, async: async, ... }; var options = $.extend(defaults, parametro); $.ajax(options); ``` ...
Try this way, ``` if(parametro) { $.ajax({ type: "POST", url: url, data: parametro, async: false, }); } ``` if no data then no needs to do ajax call, I think.
3,472,124
I'm working on learning python, here is a simple program, I wrote: ``` def guesser(var, num1,possible): if var == 'n': cutoff = len(possible)/2 possible = possible[0:cutoff] cutoff = possible[len(possible)/2] #print possible if (len(possible) == 1): print "Your...
2010/08/12
[ "https://Stackoverflow.com/questions/3472124", "https://Stackoverflow.com", "https://Stackoverflow.com/users/417449/" ]
Before doing it more pythonic I will probably make it more simple... the algorithm is much more complex than necessary. No need to use a list when two ints are enough. ``` def guesser(low = 0, up = 100): print("Choose a number between %d and %d" % (low, up-1)) while low < up - 1: mid = (low+up)//2 ...
Normally I would try to help with your code, but you have made it so *way* much too complicated that I think it would be easier for you to look at some code. ``` def guesser( bounds ): a, b = bounds mid = ( a + b ) // 2 if a == b: return a if input( "over {0}? ".format( mid ) ) == "y": new_bo...
3,472,124
I'm working on learning python, here is a simple program, I wrote: ``` def guesser(var, num1,possible): if var == 'n': cutoff = len(possible)/2 possible = possible[0:cutoff] cutoff = possible[len(possible)/2] #print possible if (len(possible) == 1): print "Your...
2010/08/12
[ "https://Stackoverflow.com/questions/3472124", "https://Stackoverflow.com", "https://Stackoverflow.com/users/417449/" ]
Before doing it more pythonic I will probably make it more simple... the algorithm is much more complex than necessary. No need to use a list when two ints are enough. ``` def guesser(low = 0, up = 100): print("Choose a number between %d and %d" % (low, up-1)) while low < up - 1: mid = (low+up)//2 ...
This is not as elegant as katrielalex's recursion, but it illustrates a basic class. ``` class guesser: def __init__(self, l_bound, u_bound): self.u_bound = u_bound self.l_bound = l_bound self.nextguess() def nextguess(self): self.guess = int((self.u_bound + self.l_bound)/2) ...
3,472,124
I'm working on learning python, here is a simple program, I wrote: ``` def guesser(var, num1,possible): if var == 'n': cutoff = len(possible)/2 possible = possible[0:cutoff] cutoff = possible[len(possible)/2] #print possible if (len(possible) == 1): print "Your...
2010/08/12
[ "https://Stackoverflow.com/questions/3472124", "https://Stackoverflow.com", "https://Stackoverflow.com/users/417449/" ]
Before doing it more pythonic I will probably make it more simple... the algorithm is much more complex than necessary. No need to use a list when two ints are enough. ``` def guesser(low = 0, up = 100): print("Choose a number between %d and %d" % (low, up-1)) while low < up - 1: mid = (low+up)//2 ...
More pythonic to use the `bisect` module - and a `class` of course :) ``` import bisect hival= 50 class Guesser(list): def __getitem__(self, idx): return 0 if raw_input("Is your number bigger than %s? (y/n)"%idx)=='y' else hival g=Guesser() print "Think of a number between 0 and %s"%hival print "Your...
3,472,124
I'm working on learning python, here is a simple program, I wrote: ``` def guesser(var, num1,possible): if var == 'n': cutoff = len(possible)/2 possible = possible[0:cutoff] cutoff = possible[len(possible)/2] #print possible if (len(possible) == 1): print "Your...
2010/08/12
[ "https://Stackoverflow.com/questions/3472124", "https://Stackoverflow.com", "https://Stackoverflow.com/users/417449/" ]
Normally I would try to help with your code, but you have made it so *way* much too complicated that I think it would be easier for you to look at some code. ``` def guesser( bounds ): a, b = bounds mid = ( a + b ) // 2 if a == b: return a if input( "over {0}? ".format( mid ) ) == "y": new_bo...
This is not as elegant as katrielalex's recursion, but it illustrates a basic class. ``` class guesser: def __init__(self, l_bound, u_bound): self.u_bound = u_bound self.l_bound = l_bound self.nextguess() def nextguess(self): self.guess = int((self.u_bound + self.l_bound)/2) ...
3,472,124
I'm working on learning python, here is a simple program, I wrote: ``` def guesser(var, num1,possible): if var == 'n': cutoff = len(possible)/2 possible = possible[0:cutoff] cutoff = possible[len(possible)/2] #print possible if (len(possible) == 1): print "Your...
2010/08/12
[ "https://Stackoverflow.com/questions/3472124", "https://Stackoverflow.com", "https://Stackoverflow.com/users/417449/" ]
More pythonic to use the `bisect` module - and a `class` of course :) ``` import bisect hival= 50 class Guesser(list): def __getitem__(self, idx): return 0 if raw_input("Is your number bigger than %s? (y/n)"%idx)=='y' else hival g=Guesser() print "Think of a number between 0 and %s"%hival print "Your...
This is not as elegant as katrielalex's recursion, but it illustrates a basic class. ``` class guesser: def __init__(self, l_bound, u_bound): self.u_bound = u_bound self.l_bound = l_bound self.nextguess() def nextguess(self): self.guess = int((self.u_bound + self.l_bound)/2) ...
70,600,836
I want it to show on the screen as soon as I enter the location, how can I do it? i have to use ctrl + s when i try this way ``` Future<void> getData() async{ data = await client.getCurrentWeather(locatian.text.toString()); } TextEditingController locatian = new TextEditingController(); body: Futur...
2022/01/05
[ "https://Stackoverflow.com/questions/70600836", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15332001/" ]
Use the builtin `process` class ``` begin process pid; pid = process::self(); ... end ``` See section *9.7 Fine-grain process control* in the [IEEE 1800-2017 SystemVerilog LRM](https://ieeexplore.ieee.org/document/8299595)
SystemVerilog does not have any facility to get 'pid' of its process. It provides an object to do limited process control in a system-independent way. You can check lrm 9.7 for available controls. However, it is possible to get pid using DPI or PLI functions, using 'c' calls. But implementation could be system and sim...
39,546
Junto a una imagen de la Virgen en Buenos Aires estaba la siguiente inscripción: [![Oh María Madre Mía Virgencita de Luján Amparadme y Guiadme a la Patria Celestial](https://i.stack.imgur.com/MST9h.jpg)](https://i.stack.imgur.com/MST9h.jpg) Si el sujeto es María, ¿no debería decir "ampárame y guíame"? ¿El sujeto no es...
2021/08/23
[ "https://spanish.stackexchange.com/questions/39546", "https://spanish.stackexchange.com", "https://spanish.stackexchange.com/users/33/" ]
Primero veamos de donde viene. > > Amparadme: Forma **enclítica** del Singular del modo Imperativo del > verbo amparar > > > El significado de amparar se refiere a valerse del favor de alguno. En este caso, Él pide que lo ampare, pero utiliza un recurso llamado el **Voseo** que como mencionaron anteriormente es s...
Actualmente esa forma no aparece recogida en el DLE en la conjugación del verbo [amparar](https://dle.rae.es/amparar) pero a mí no me parece que sea incorrecta, solo **arcaica**. Es de cuando se empleaba el pronombre vos como indicativo de **respeto**. > > Amparadme vos > > > Algo sobre la [evolución del voseo](h...
39,546
Junto a una imagen de la Virgen en Buenos Aires estaba la siguiente inscripción: [![Oh María Madre Mía Virgencita de Luján Amparadme y Guiadme a la Patria Celestial](https://i.stack.imgur.com/MST9h.jpg)](https://i.stack.imgur.com/MST9h.jpg) Si el sujeto es María, ¿no debería decir "ampárame y guíame"? ¿El sujeto no es...
2021/08/23
[ "https://spanish.stackexchange.com/questions/39546", "https://spanish.stackexchange.com", "https://spanish.stackexchange.com/users/33/" ]
Primero veamos de donde viene. > > Amparadme: Forma **enclítica** del Singular del modo Imperativo del > verbo amparar > > > El significado de amparar se refiere a valerse del favor de alguno. En este caso, Él pide que lo ampare, pero utiliza un recurso llamado el **Voseo** que como mencionaron anteriormente es s...
Es un ejemplo de [plural mayestático](https://blog.lengua-e.com/2011/plural-mayestatico/), una forma arcaica de dirigirse a una alta autoridad, o de que dicha autoridad hable de sí misma. Ese mismo ejemplo forma parte de una [conocida canción tradicional](https://funjdiaz.net/a_canciones2.php?id=42).
24,032,282
I have following Pandas Dataframe: ``` In [66]: hdf.size() Out[66]: a b 0 0.0 21004 0.1 119903 0.2 186579 0.3 417349 0.4 202723 0.5 100906 0.6 56386 0.7 ...
2014/06/04
[ "https://Stackoverflow.com/questions/24032282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3706049/" ]
Thanks a lot! My fault was, that I did not realize, that I have to apply some function to the groupby dataframe, like `.size()`, to work with it... ``` hdf = aggdf.groupby(['a','b']).size() hdf ``` gives me ``` a b 1 -2.0 1 -1.9 1 -1.8 1 ...
Welcome to SO. It looks quite clear that for each of your 'a' level, the numbers of 'b' levels are not the same, thus I will suggest the following solution: ``` In [44]: print df #an example, you can get your dataframe in to this by rest_index() a b value 0 0 1 0.336885 1 0 2 0.276750 2 0 3 0.79...
41,802,181
So basically i want to add some custom properties to a word document. Is this possible yet from the word api 1.3? I found something along the lines of: ``` context.document.workbook.properties ``` but that only seems to work for excel. Thanks!
2017/01/23
[ "https://Stackoverflow.com/questions/41802181", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7047202/" ]
To add more detail to the previous answer: Yes Word.js 1.3 introduces creation and retrieval of custom and built-in document properties. The API is still in preview, you need to at least have the December fork build for this feature to work. Make sure you try it on 16.0.7766+ builds. Also please make sure to use our Pr...
[Word API 1.3](https://dev.office.com/reference/add-ins/requirement-sets/word-api-requirement-sets?product=word) introduces documentProperties and customProperty, but the status is still listed as Preview, and requires Word 2016 Desktop Version 1605 (Build 6925.1000) or later or the mobile apps (not yet available onlin...
793,192
August 2015 Summary =================== Please note, this is still happening. This is **not** related to linuxatemyram.com - the memory is not used for disk cache/buffers. This is what it looks like in NewRelic - the system leaks all the memory, uses up all swap space and then crashes. In this screenshot I rebooted th...
2014/08/06
[ "https://superuser.com/questions/793192", "https://superuser.com", "https://superuser.com/users/50300/" ]
Do you change the [Swapiness](http://en.wikipedia.org/wiki/Swappiness) of your Kernel manualy or disable it? you can whatch you current swappyness-level with ``` cat /proc/sys/vm/swappiness ``` You could try to force your kernel to swap aggressively with ``` sudo sysctl -w vm.swappiness=100 ``` if this decrease...
You are not quite right – yes your free –m command is showing free 220MB but it is also showing that 1771MB is used as buffers. Buffers and Cached is memory used by the kernel to optimize access to slow access data, usually disks. So you should consider all memory marked as buffers as free memory because kernel can tak...
793,192
August 2015 Summary =================== Please note, this is still happening. This is **not** related to linuxatemyram.com - the memory is not used for disk cache/buffers. This is what it looks like in NewRelic - the system leaks all the memory, uses up all swap space and then crashes. In this screenshot I rebooted th...
2014/08/06
[ "https://superuser.com/questions/793192", "https://superuser.com", "https://superuser.com/users/50300/" ]
Story ===== I can reproduce your issue using [ZFS on Linux](http://zfsonlinux.org/). Here is a server called `node51` with `20GB` of RAM. I marked `16GiB` of RAM to be allocatable to the [ZFS adaptive replacement cache (ARC)](http://open-zfs.org/wiki/Performance_tuning#Adaptive_Replacement_Cache): ``` root@node51 [~...
Do you change the [Swapiness](http://en.wikipedia.org/wiki/Swappiness) of your Kernel manualy or disable it? you can whatch you current swappyness-level with ``` cat /proc/sys/vm/swappiness ``` You could try to force your kernel to swap aggressively with ``` sudo sysctl -w vm.swappiness=100 ``` if this decrease...
793,192
August 2015 Summary =================== Please note, this is still happening. This is **not** related to linuxatemyram.com - the memory is not used for disk cache/buffers. This is what it looks like in NewRelic - the system leaks all the memory, uses up all swap space and then crashes. In this screenshot I rebooted th...
2014/08/06
[ "https://superuser.com/questions/793192", "https://superuser.com", "https://superuser.com/users/50300/" ]
My conclusion is it is a kernel memory leak somewhere in the Linux kernel, this is why none of the userspace tools are able to show where memory is being leaked. Maybe it is related to this question: <https://serverfault.com/questions/670423/linux-memory-usage-higher-than-sum-of-processes> I upgraded the kernel versio...
Do you change the [Swapiness](http://en.wikipedia.org/wiki/Swappiness) of your Kernel manualy or disable it? you can whatch you current swappyness-level with ``` cat /proc/sys/vm/swappiness ``` You could try to force your kernel to swap aggressively with ``` sudo sysctl -w vm.swappiness=100 ``` if this decrease...
793,192
August 2015 Summary =================== Please note, this is still happening. This is **not** related to linuxatemyram.com - the memory is not used for disk cache/buffers. This is what it looks like in NewRelic - the system leaks all the memory, uses up all swap space and then crashes. In this screenshot I rebooted th...
2014/08/06
[ "https://superuser.com/questions/793192", "https://superuser.com", "https://superuser.com/users/50300/" ]
Story ===== I can reproduce your issue using [ZFS on Linux](http://zfsonlinux.org/). Here is a server called `node51` with `20GB` of RAM. I marked `16GiB` of RAM to be allocatable to the [ZFS adaptive replacement cache (ARC)](http://open-zfs.org/wiki/Performance_tuning#Adaptive_Replacement_Cache): ``` root@node51 [~...
You are not quite right – yes your free –m command is showing free 220MB but it is also showing that 1771MB is used as buffers. Buffers and Cached is memory used by the kernel to optimize access to slow access data, usually disks. So you should consider all memory marked as buffers as free memory because kernel can tak...
793,192
August 2015 Summary =================== Please note, this is still happening. This is **not** related to linuxatemyram.com - the memory is not used for disk cache/buffers. This is what it looks like in NewRelic - the system leaks all the memory, uses up all swap space and then crashes. In this screenshot I rebooted th...
2014/08/06
[ "https://superuser.com/questions/793192", "https://superuser.com", "https://superuser.com/users/50300/" ]
My conclusion is it is a kernel memory leak somewhere in the Linux kernel, this is why none of the userspace tools are able to show where memory is being leaked. Maybe it is related to this question: <https://serverfault.com/questions/670423/linux-memory-usage-higher-than-sum-of-processes> I upgraded the kernel versio...
You are not quite right – yes your free –m command is showing free 220MB but it is also showing that 1771MB is used as buffers. Buffers and Cached is memory used by the kernel to optimize access to slow access data, usually disks. So you should consider all memory marked as buffers as free memory because kernel can tak...
793,192
August 2015 Summary =================== Please note, this is still happening. This is **not** related to linuxatemyram.com - the memory is not used for disk cache/buffers. This is what it looks like in NewRelic - the system leaks all the memory, uses up all swap space and then crashes. In this screenshot I rebooted th...
2014/08/06
[ "https://superuser.com/questions/793192", "https://superuser.com", "https://superuser.com/users/50300/" ]
My conclusion is it is a kernel memory leak somewhere in the Linux kernel, this is why none of the userspace tools are able to show where memory is being leaked. Maybe it is related to this question: <https://serverfault.com/questions/670423/linux-memory-usage-higher-than-sum-of-processes> I upgraded the kernel versio...
Story ===== I can reproduce your issue using [ZFS on Linux](http://zfsonlinux.org/). Here is a server called `node51` with `20GB` of RAM. I marked `16GiB` of RAM to be allocatable to the [ZFS adaptive replacement cache (ARC)](http://open-zfs.org/wiki/Performance_tuning#Adaptive_Replacement_Cache): ``` root@node51 [~...
2,148,783
I want to know how to solve the question if you have a set of polynomials $$ p\_1 = 1 + x, $$ $$ p\_2 = 1 + 2x + x^2, $$ $$ p\_3 = 1 + 3x + 3x^2 + x^3, $$ and if the polynomial $p = 2017 + x^2 + 26x^3$ is spanned by the set $S = \{p\_1,p\_2,p\_3\}$ Thank you
2017/02/17
[ "https://math.stackexchange.com/questions/2148783", "https://math.stackexchange.com", "https://math.stackexchange.com/users/417321/" ]
**Proof I** > > $$3^n + 1 \implies (2x + 1)+1 \implies 2x+2$$ > > > Case: $n = 0$ $$ (2\cdot0 + 2) = 2 $$ Case: $n = n$ $$(2n + 2) = 2(n+1) $$ Case: $n = n+1$ $$(2(n+1) + 2) = 2n+4 = 2(n+2)$$ $$\Box$$ --- **Proof II** > > $$(3^n + 1)\text{ mod }2 \implies (3^n + 2 -1) \text{ mod }2 \implies (3^n -1)\text{ mod...
An easier answer is to note that: $3^n - 1 \equiv 1^n - 1 \equiv 0 (mod 2)$.Thus, we conclude that $2|(3^n -1)$. Hence, $3^n - 1$ is always even.
2,148,783
I want to know how to solve the question if you have a set of polynomials $$ p\_1 = 1 + x, $$ $$ p\_2 = 1 + 2x + x^2, $$ $$ p\_3 = 1 + 3x + 3x^2 + x^3, $$ and if the polynomial $p = 2017 + x^2 + 26x^3$ is spanned by the set $S = \{p\_1,p\_2,p\_3\}$ Thank you
2017/02/17
[ "https://math.stackexchange.com/questions/2148783", "https://math.stackexchange.com", "https://math.stackexchange.com/users/417321/" ]
**Direct Proof:** $3^n$ has no factor of $2$, so it is odd. $3^n+1$ is one greater than an odd number. --- **Inductive Proof:** $3^0+1=2$ is even. Suppose $3^n+1$ is even, then $$ 3^{n+1}+1=3\left(3^n+1\right)-2 $$ is an even number minus an even number, hence even.
**Proof I** > > $$3^n + 1 \implies (2x + 1)+1 \implies 2x+2$$ > > > Case: $n = 0$ $$ (2\cdot0 + 2) = 2 $$ Case: $n = n$ $$(2n + 2) = 2(n+1) $$ Case: $n = n+1$ $$(2(n+1) + 2) = 2n+4 = 2(n+2)$$ $$\Box$$ --- **Proof II** > > $$(3^n + 1)\text{ mod }2 \implies (3^n + 2 -1) \text{ mod }2 \implies (3^n -1)\text{ mod...
2,148,783
I want to know how to solve the question if you have a set of polynomials $$ p\_1 = 1 + x, $$ $$ p\_2 = 1 + 2x + x^2, $$ $$ p\_3 = 1 + 3x + 3x^2 + x^3, $$ and if the polynomial $p = 2017 + x^2 + 26x^3$ is spanned by the set $S = \{p\_1,p\_2,p\_3\}$ Thank you
2017/02/17
[ "https://math.stackexchange.com/questions/2148783", "https://math.stackexchange.com", "https://math.stackexchange.com/users/417321/" ]
**Direct Proof:** $3^n$ has no factor of $2$, so it is odd. $3^n+1$ is one greater than an odd number. --- **Inductive Proof:** $3^0+1=2$ is even. Suppose $3^n+1$ is even, then $$ 3^{n+1}+1=3\left(3^n+1\right)-2 $$ is an even number minus an even number, hence even.
An easier answer is to note that: $3^n - 1 \equiv 1^n - 1 \equiv 0 (mod 2)$.Thus, we conclude that $2|(3^n -1)$. Hence, $3^n - 1$ is always even.
5,073,402
I have a script that works in several steps to e-mail students at a school who are tardy. The school essentially penalizes students who have 3 and 5 tardies. However, alongside that, there's a total tardy count. For example, a student can have 16 tardies but their "penalizing" count will `16 % 5 === 1`. This is how it...
2011/02/22
[ "https://Stackoverflow.com/questions/5073402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/588055/" ]
Really thanks u, i tested and it's true. This is over view of my problems: I have 132 images in device (~300 kb / 1 image), now my purpose is to merge each 2 images into 1 large image (side by side in horizontal orient). This is what I do : ``` int index = 1; for(int i = 1;i <= 132;i++) { if(i % 2 == 0 && ...
I assume you omitted `NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];` before the quoted code. You should release `image1` before sending `[pool drain]` because you allocated it. The `data` object is autoreleased, which means it gets released in `[pool drain]`. However, releasing the object does not magica...
222,828
Is the following sentence incorrect? > > Churchil was a great orator and a great politician of his time. > > > Some say that when article refers to a single person it must be used just once As > > Churchil was a great orator and politician of his time. > > > But to me both the sentences sound correct. The...
2019/09/01
[ "https://ell.stackexchange.com/questions/222828", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/-1/" ]
> > 1. Churchill was a great orator and a great politician of his times. > 2. Churchill was a great orator and politician of his times. > > > Both of the above sentences are not only correct but also mean exactly the same thing. But the following sentences have different shades of meaning: > > 1. Tagore is a gr...
A sentence can have multiple phrases, each of which refers to a different aspect of a single entity. Each phrase can have an appropriate article (or lack thereof). For example: > > A man, a plan, a canal -- Panama! -- A famous palindrome about U.S. President Teddy Roosevelt and the construction of the Panama Canal. >...
222,828
Is the following sentence incorrect? > > Churchil was a great orator and a great politician of his time. > > > Some say that when article refers to a single person it must be used just once As > > Churchil was a great orator and politician of his time. > > > But to me both the sentences sound correct. The...
2019/09/01
[ "https://ell.stackexchange.com/questions/222828", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/-1/" ]
> > 1. Churchill was a great orator and a great politician of his times. > 2. Churchill was a great orator and politician of his times. > > > Both of the above sentences are not only correct but also mean exactly the same thing. But the following sentences have different shades of meaning: > > 1. Tagore is a gr...
> > Churchill was a great orator and a great politician of his time. > > > It *is* correct. As has already been mentioned, it is just a style choice whether you want to make a sentence shorter or not. However, I would argue that *most* people prefer more concise, succinct language. The sentence could be shortened...
222,828
Is the following sentence incorrect? > > Churchil was a great orator and a great politician of his time. > > > Some say that when article refers to a single person it must be used just once As > > Churchil was a great orator and politician of his time. > > > But to me both the sentences sound correct. The...
2019/09/01
[ "https://ell.stackexchange.com/questions/222828", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/-1/" ]
> > 1. Churchill was a great orator and a great politician of his times. > 2. Churchill was a great orator and politician of his times. > > > Both of the above sentences are not only correct but also mean exactly the same thing. But the following sentences have different shades of meaning: > > 1. Tagore is a gr...
Style Difference is a matter of context: In a formal speech: > > Churchill was a great orator and a great politician. > > > In other contexts, it depends on how formal or emphatic you want to be. Separating out the terms using two articles emphasizes each individually. I just don't think it is more complicated...
18,168,730
Hello everyone I have a problem with my custom navigation bar. I needed to create a custom navigation bar and this was to be used in several view controllers so i created it as a category for UIViewController and Used the following code for creating the customisation i needed. ``` - (void)setCustomLabel:(NSString *)l...
2013/08/11
[ "https://Stackoverflow.com/questions/18168730", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2354428/" ]
This is because you are **adding** the label to the navigation bar. Since it is the same navigation bar no matter how many views you go to, it just keeps adding new labels to the bar and leaves them there. The way that I see it you have two options to fix this: 1. You can create a singular label one time and have it ...
You're not removing the label from the navigationbar when you're addign a new one. Perhaps you should try calling `[navigationLabel removeFromSuperview]` on it when you wish to set a new one. (This means you probably have to store it in an @property) example: header file: ``` @property (assign, nonatomic) UILabel *n...
86,172
Context: 95 Acura Glove compartment handle, latch and key cylinder. The dark ring pins the arm to the keyed-cylinder. The goal is to remove the cylinder to reveal the 4 digit "key cut code". 1. What is the name of the beveled-dark-annual retaining ring? 2. What is the method to remove the ring without damaging it so ...
2021/11/28
[ "https://mechanics.stackexchange.com/questions/86172", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/18905/" ]
Chuck a cat in and leave overnight. There is the old joke about the Landrover engineers sent to BMW to see how to improve quality. They inspected the production line, looking at all the dimensional checks and tests carried out. Once they got to the end of the line they saw an operative open the door of the BMW coming ...
Not sure if this applies to your make / model. <https://topclassactions.com/lawsuit-settlements/consumer-products/auto-news/1019074-class-action-toyota-soy-coated-wiring-attracts-vehicle-damaging-rats-can-proceed/>
86,172
Context: 95 Acura Glove compartment handle, latch and key cylinder. The dark ring pins the arm to the keyed-cylinder. The goal is to remove the cylinder to reveal the 4 digit "key cut code". 1. What is the name of the beveled-dark-annual retaining ring? 2. What is the method to remove the ring without damaging it so ...
2021/11/28
[ "https://mechanics.stackexchange.com/questions/86172", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/18905/" ]
I have the same problem - but only under the bonnet - of a Pug 307. Set a trap, secured with a tiewrap, and to date am catching a mouse a night (for around a fortnight). No, not the same one... Hope to run out of mice by next week. So, traps anyway, or use a device which emits a high pitched noise to deter them. Searc...
Not sure if this applies to your make / model. <https://topclassactions.com/lawsuit-settlements/consumer-products/auto-news/1019074-class-action-toyota-soy-coated-wiring-attracts-vehicle-damaging-rats-can-proceed/>
86,172
Context: 95 Acura Glove compartment handle, latch and key cylinder. The dark ring pins the arm to the keyed-cylinder. The goal is to remove the cylinder to reveal the 4 digit "key cut code". 1. What is the name of the beveled-dark-annual retaining ring? 2. What is the method to remove the ring without damaging it so ...
2021/11/28
[ "https://mechanics.stackexchange.com/questions/86172", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/18905/" ]
Use "sticky" traps baited with peanut butter. If you don't want to kill the mouse, vegetable oil will free it from the sticky. I would do it sooner rather than later because he will chew electric wire insulation disabling something.
Not sure if this applies to your make / model. <https://topclassactions.com/lawsuit-settlements/consumer-products/auto-news/1019074-class-action-toyota-soy-coated-wiring-attracts-vehicle-damaging-rats-can-proceed/>
35,030,120
I am missing a ZlibEx unit in my code. Can I used the ZlibEx library from [Mike Lischke's GraphicEx library](https://github.com/mike-lischke/GraphicEx/tree/master/3rd%20party/DelphiZlib)? The [Base2 Technologies site](http://www.base2ti.com/) mentions the library is only for "*Delphi 5, 6, 7, 8, 2005, 2006, 2007, 2009,...
2016/01/27
[ "https://Stackoverflow.com/questions/35030120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4418929/" ]
I believe the ZlibEx unit was created to bring a newer version of the [ZLIB](http://zlib.net/) library into Delphi, since at the time the version that was shipping with the VCL was an older version and was missing some needed functionality. Delphi 10 Seattle now has been updated to use the latest version of ZLIB, so y...
> > Can I use it for Delphi 10 Seattle? > > > Yes. The code compiles in Delphi 10 Seattle and I see no reason why it will not work. The text that lists the supported compiler versions is simply out of date and has not been updated since the release of XE3.
9,919,946
I am new to wpf and i am working on first application i have some issues related with this 1.)Control allignment : My controls when set on the page is seem ok but when i run my application controls slightly change their position. 2.)Resolution Issue : When i try to run application on the machine with different resolu...
2012/03/29
[ "https://Stackoverflow.com/questions/9919946", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1230768/" ]
1. WPF has its own alignment system that differs from those in WinForms and HTML. Be sure to study the issue before doing any markup - trust me, you will just lose time. 2. WPF is resolution independent - it's one of the most essential of its features. The problem should be related to the 1st one. 3. Could you provide ...
**1 & 2)** As EvAlex says, WPF has it's own alignment system using various `Panel` types. These grow and shrink content to take advantage of the available space and resolution. You appear to be dragging controls onto the form in DevStudio, which is adding all those `Margin="323,182,0,0"` properties to you markup. This...
65,764,908
My title is a bit messy but hopefully the information below is specific enough. I have a script that scrapes the name and price of items from a online store and stores them in a pandas dataframe with 2 columns, Name and Price. The script runs at regular time periods and exports the data to a csv. Now I want to combine...
2021/01/17
[ "https://Stackoverflow.com/questions/65764908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14851943/" ]
You can go the CSS variable way. This [codepen](https://codepen.io/kmurphs/pen/bGwzEXy) demonstrates. Basically, in the `React` file: ``` <div style={{"--img": "url('https://images.unsplash.com/photo-1610907083431-d36d8947c8e2')"}}>text</div> ``` And, in CSS: ``` background-image: linear-gradient(to bottom, rgba(2...
The first answer works well. I am just adding another option you would like to use. You can have the img url as **PROPS** just to make your code more Dynamic and robust. Here is my use case: ``` function SndHeader({ bgImage }) { return ( <div className="sndHeader" style={{ "--img": `url(${bgImage}), ...
74,013
As per GDPR, we need to pseudonymize the name and email address. How can we pseudonymize name and email address? For example, is the below is correct way to pseudonymize? > > Steve Anderson > Stxxx Axxdxrxn > > > test@testdomain.com > txxx@xxxxxxxxxx.com > > > Is the above definition of pseudonymize is correct?...
2021/10/27
[ "https://law.stackexchange.com/questions/74013", "https://law.stackexchange.com", "https://law.stackexchange.com/users/41447/" ]
The GDPR does not prescribe how information should be pseudonymized and does not even define the term properly. Yet, pseudonymization is suggested as an safety measure in various places, so that pseudonymization should be implemented wherever appropriate. The most useful guidance the GDPR gives is by contrasting pseud...
First of all, the GDPR doe not require you to pseudonymize anything. It requires that "appropriate" security measures be used. It also required that when Personal Data (which I shall call PI) is processed (which includes storing PI) that there be a lawful basis, as described in GDPR [Article 6](https://gdpr-info.eu/art...
38,162,803
I have created a Database Access Object (DAO) class, entity class, and table script, but I am getting an error that cannot be mapped to entity. I am using hibernate framework and the connections are made properly with the database but still error occurs. please check the code below and help in any ways you can, all ...
2016/07/02
[ "https://Stackoverflow.com/questions/38162803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6542086/" ]
If your result row is compatible with `UserEntity` the following modification might solve your problem: ``` Query q1 = session .createNativeQuery("select * from rmc_user where user_name=?", UserEntity.class); ```
The problem probably lies here ``` Query q1 = session.createNativeQuery("select * from rmc_user where user_name=?"); ``` When you execute this query, because it's an sql query, the return list of `q1.list()` will have this format : Object[] { row1col1, row1col2,row1,col3,row2col1,...} that is it spreads the columns...
30,740,306
I´m designing an android app that locate places, these places are in a database in a server but I only have the name and location of the place, so I need to locate it in my app and put a *marker* there. It's posible to get coordinates only with address or, Do I need to redo my database adding fields with latitude and l...
2015/06/09
[ "https://Stackoverflow.com/questions/30740306", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4987172/" ]
You can use the [Geocoder](http://developer.android.com/reference/android/location/Geocoder.html) class to do a look-up of the addresses you have, and then populate the map with Markers using the `LanLng` objects that are returned. Note that the `Geocoder` class will not be able to geocode every address, but it will b...
You can make a request to google maps API to get possible addresses by a address string. Check this [link](https://developers.google.com/maps/documentation/geocoding/#geocoding).
30,740,306
I´m designing an android app that locate places, these places are in a database in a server but I only have the name and location of the place, so I need to locate it in my app and put a *marker* there. It's posible to get coordinates only with address or, Do I need to redo my database adding fields with latitude and l...
2015/06/09
[ "https://Stackoverflow.com/questions/30740306", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4987172/" ]
You can use the [Geocoder](http://developer.android.com/reference/android/location/Geocoder.html) class to do a look-up of the addresses you have, and then populate the map with Markers using the `LanLng` objects that are returned. Note that the `Geocoder` class will not be able to geocode every address, but it will b...
You can use the Geocoder class, which will return the latitude and longitude for a given address in a specified format.However a specified format has to be followed for the address name. Check out for more information on this from the below link :- <https://developer.android.com/reference/android/location/Geocoder>
49,014,610
I have this simple Rust function: ``` #[no_mangle] pub fn compute(operator: &str, n1: i32, n2: i32) -> i32 { match operator { "SUM" => n1 + n2, "DIFF" => n1 - n2, "MULT" => n1 * n2, "DIV" => n1 / n2, _ => 0 } } ``` I am compiling this to WebAssembly successfully, but d...
2018/02/27
[ "https://Stackoverflow.com/questions/49014610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2432221/" ]
Easiest and most idiomatic solution =================================== Most people should use [wasm-bindgen](https://github.com/rustwasm/wasm-bindgen), which makes this whole process *much* simpler! Low-level manual implementation =============================== To transfer string data between JavaScript and Rust, ...
As pointed out by Shepmaster, only numbers can be passed to WebAssembly, so we need to convert the string into an `Uint16Array`. To do so we can use this `str2ab` function found [here](https://developers.google.com/web/updates/2012/06/How-to-convert-ArrayBuffer-to-and-from-String): ``` function str2ab(str) { var bu...
49,014,610
I have this simple Rust function: ``` #[no_mangle] pub fn compute(operator: &str, n1: i32, n2: i32) -> i32 { match operator { "SUM" => n1 + n2, "DIFF" => n1 - n2, "MULT" => n1 * n2, "DIV" => n1 / n2, _ => 0 } } ``` I am compiling this to WebAssembly successfully, but d...
2018/02/27
[ "https://Stackoverflow.com/questions/49014610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2432221/" ]
A WebAssembly program has it's own memory space. And this space is often managed by the WebAssembly program itself, with the help of an allocator library, such as the [wee\_alloc](http://fitzgeraldnick.com/2018/02/09/wee-alloc.html). The JavaScript can see and modify that memory space, but it has no way of knowing how...
As pointed out by Shepmaster, only numbers can be passed to WebAssembly, so we need to convert the string into an `Uint16Array`. To do so we can use this `str2ab` function found [here](https://developers.google.com/web/updates/2012/06/How-to-convert-ArrayBuffer-to-and-from-String): ``` function str2ab(str) { var bu...
49,014,610
I have this simple Rust function: ``` #[no_mangle] pub fn compute(operator: &str, n1: i32, n2: i32) -> i32 { match operator { "SUM" => n1 + n2, "DIFF" => n1 - n2, "MULT" => n1 * n2, "DIV" => n1 / n2, _ => 0 } } ``` I am compiling this to WebAssembly successfully, but d...
2018/02/27
[ "https://Stackoverflow.com/questions/49014610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2432221/" ]
Easiest and most idiomatic solution =================================== Most people should use [wasm-bindgen](https://github.com/rustwasm/wasm-bindgen), which makes this whole process *much* simpler! Low-level manual implementation =============================== To transfer string data between JavaScript and Rust, ...
A WebAssembly program has it's own memory space. And this space is often managed by the WebAssembly program itself, with the help of an allocator library, such as the [wee\_alloc](http://fitzgeraldnick.com/2018/02/09/wee-alloc.html). The JavaScript can see and modify that memory space, but it has no way of knowing how...
56,137,343
Angular 5 Project working on Chrome, Internet Explorer, Firefox etc. But only not working on Safari Browser. I am getting error > > Can't find variable: DragEvent > > > [![enter image description here](https://i.stack.imgur.com/gz7tS.png)](https://i.stack.imgur.com/gz7tS.png)
2019/05/14
[ "https://Stackoverflow.com/questions/56137343", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10590264/" ]
I have had same issue, just search for `DragEvent` and change them `any`
DragEvent is not supported in Safari. In your code change 'DragEvent' to any.
65,687,852
I'm building a prototype that fetches a Spotify user's playlist data in React. The data fetching is done inside a useEffect hook and sets the state of playlists variable. Consequently, I want to render the name of each playlist. However, it seems that the data is only fetched after rendering, causing an issue, because ...
2021/01/12
[ "https://Stackoverflow.com/questions/65687852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11383969/" ]
Change code to ``` <?php //myFunction that will return a status if(myFunction() === true){ $status = "success"; }else{ $status = "failure"; } echo $status ``` or short it to ``` echo myFunction() ? "success" : "failure"; ``` To wait for an answer - you can execute the request asynchronously, and get the...
Your PHP needs to return the value. If you want to keep the dataType Json (suggested) you just need to json\_encode your output. So the PHP becomes: ``` <?php $type=$_POST['type']; //myFunction that will return a status if(myFunction() === true){ $status = "success"; }else{ $status = "failure"; } echo json_en...
29,014,393
I'm trying to make a simple voting-function to our site. Something in it does not work. ``` if(isset($_POST['vote'])) { if($_POST['rate'] == "rate_1") { $rate = 'rate_1'; $rate_opload = ++$rest['rate_1']; } if else($_POST['rate'] == "rate_2") { $rate = 'rate_2'; $ra...
2015/03/12
[ "https://Stackoverflow.com/questions/29014393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4655160/" ]
First you forgot to put name="vote" into your html form ``` <form method=\"post\" id=\"vote\"> <select name=\"rate\"> <option value=\"rate_1\" >&#x2605;</option> <option value=\"rate_2\" >&#x2605;&#x2605</option> <option value=\"rate_3\" >&#x2605;&#x2605;&#x2605;</option> <option value=\"rate_4\">&#x2605;&#x2605;&#x26...
Your ``` if(isset($_POST['vote'])) ``` is not reached, you have to add name="vote" to your submit button
11,509
En mathématiques, il est fréquent de supposer. Parfois, lorsqu'on énonce un théorème, on peut lire, par exemple : « *Supposons que f atteint un max ou un min en un point a de I.* » Ou encore : « *Supposons que f atteigne un max ou un min en un point a de I.* » En cherchant sur le Net le bon temps de verbe à employer, ...
2014/07/30
[ "https://french.stackexchange.com/questions/11509", "https://french.stackexchange.com", "https://french.stackexchange.com/users/2845/" ]
Etant mathématicien, ni l'un ni l'autre ne me choquent et j'emploie les deux un peu au hasard chaque jour. Cependant, tu as tout à fait raison quant à l'emploi du subjonctif dans les mathématiques : il est quasiment tout le temps utilisé dans les démonstrations par l'absurde, sans doute parce qu'une démonstration par ...
Grammaticalement, il faut utiliser le subjonctif dans cette construction de phrase avec 'que'. Je pense que l'utilisation de l'indicatif est un abus de langage. Personnellement, je trouve que 'Supposons que i est grand' sonne faux.
11,509
En mathématiques, il est fréquent de supposer. Parfois, lorsqu'on énonce un théorème, on peut lire, par exemple : « *Supposons que f atteint un max ou un min en un point a de I.* » Ou encore : « *Supposons que f atteigne un max ou un min en un point a de I.* » En cherchant sur le Net le bon temps de verbe à employer, ...
2014/07/30
[ "https://french.stackexchange.com/questions/11509", "https://french.stackexchange.com", "https://french.stackexchange.com/users/2845/" ]
Etant mathématicien, ni l'un ni l'autre ne me choquent et j'emploie les deux un peu au hasard chaque jour. Cependant, tu as tout à fait raison quant à l'emploi du subjonctif dans les mathématiques : il est quasiment tout le temps utilisé dans les démonstrations par l'absurde, sans doute parce qu'une démonstration par ...
On ne connaît pas la valeur d'un objet, il dépend d'un autre objet, le subjonctif est recommandé : > > Supposons que *a* soit supérieur à *b*, alors nous pouvons démontrer .... > > > ... ici on a fait une hypothèse sur *a* qui n'est pas connu, l'existence de *a* est subordonnée à celle de *b*. Cela vient de l...
11,509
En mathématiques, il est fréquent de supposer. Parfois, lorsqu'on énonce un théorème, on peut lire, par exemple : « *Supposons que f atteint un max ou un min en un point a de I.* » Ou encore : « *Supposons que f atteigne un max ou un min en un point a de I.* » En cherchant sur le Net le bon temps de verbe à employer, ...
2014/07/30
[ "https://french.stackexchange.com/questions/11509", "https://french.stackexchange.com", "https://french.stackexchange.com/users/2845/" ]
On ne connaît pas la valeur d'un objet, il dépend d'un autre objet, le subjonctif est recommandé : > > Supposons que *a* soit supérieur à *b*, alors nous pouvons démontrer .... > > > ... ici on a fait une hypothèse sur *a* qui n'est pas connu, l'existence de *a* est subordonnée à celle de *b*. Cela vient de l...
Grammaticalement, il faut utiliser le subjonctif dans cette construction de phrase avec 'que'. Je pense que l'utilisation de l'indicatif est un abus de langage. Personnellement, je trouve que 'Supposons que i est grand' sonne faux.