qid int64 1 74.6M | question stringlengths 45 24.2k | date stringlengths 10 10 | metadata stringlengths 101 178 | response_j stringlengths 32 23.2k | response_k stringlengths 21 13.2k |
|---|---|---|---|---|---|
95,202 | I have a Gateway laptop that originally came with Vista, and I upgraded to Vista Ultimate. I have always been able to change the brightness settings by using Func+Up or Func+Down but a few days ago it stopped working and is always at MAX bright!
Anybody knows why is that happening and how to fix it? It is very annoyin... | 2010/01/13 | ['https://superuser.com/questions/95202', 'https://superuser.com', 'https://superuser.com/users/15180/'] | The screen brightness can be changed in the power options section of Control Panel (or by clicking the little battery icon in the system tray, though i'm unsure if that's new to Win 7 or works in vista).
As for the Fn keys stopping working, it's likely that there will be an app you can install from the Gateway website... | Ensure you have the latest video driver, downloaded from the website of the card's manufacturer.
If you have installed "Dox Optimised Forceware", then uninstall it first. |
20,402,662 | Can anyone explain to me why I can write 'ECHO Y|' in the Powershell command line but not if I implement it in a script?
These variables are taken from a .csv file. When I used the command line I did not use the variables.
```
ECHO Y|cacls $_."Serverdisc" /G ADMINISTRATORS:F
cacls $_."Serverdisc" /G $_."Username":C ... | 2013/12/05 | ['https://Stackoverflow.com/questions/20402662', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2564636/'] | I am guessing you are trying to pass "Y(es)" to any possible prompts?
CMD shell and PowerShell are two different shells. What you are trying to do is use the CMD shell syntax for Powershell and therefore running into trouble
$\_ is used when you are iterating through an array coming from pipeline, so there must be som... | It's probably because the pipeline function of powershell is different from the cmd prompt
If you use `cmd /c echo Y| cacls ....`
it will work. |
20,402,662 | Can anyone explain to me why I can write 'ECHO Y|' in the Powershell command line but not if I implement it in a script?
These variables are taken from a .csv file. When I used the command line I did not use the variables.
```
ECHO Y|cacls $_."Serverdisc" /G ADMINISTRATORS:F
cacls $_."Serverdisc" /G $_."Username":C ... | 2013/12/05 | ['https://Stackoverflow.com/questions/20402662', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2564636/'] | I will add to Adil H.'s comments and say that using cacls is depreciated. You should instead be using **icacls**. icacls has a parameter /Q (Quiet) which will suppress all the confirmation messages for you, and you will not have to use `ECHO Y|` in your code.
(assuming you have the rest of your script in order(see Adi... | It's probably because the pipeline function of powershell is different from the cmd prompt
If you use `cmd /c echo Y| cacls ....`
it will work. |
50,815,061 | I am building REST API which stores name, salary and expenses of people. How can I POST data of multiple people at the same time, like an array?
This is my serializers.py file
```
from rest_framework import serializers
from .models import Bucketlist
class BucketlistSerializer(serializers.ModelSerializer):
class ... | 2018/06/12 | ['https://Stackoverflow.com/questions/50815061', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9929677/'] | As you are on your tabbed page already you can literally just do the following
```
public partial class MyTabbedPage : TabbedPage
{
public MyTabbedPage()
{
InitializeComponent();
CurrentPageChanged += CurrentPageHasChanged;
}
private void CurrentPageHasChanged(object sender,... | I don't think you can achieve what you want to do, at least not like this. The event behaves the way it does and as described: it is fired whenever the current page changes, also for children.
That being said, I think you should focus on implementing the functionality you want with the tools we have. I can't really de... |
23,284,601 | I have an input form-
```
<input type="hidden" name="unsubscribe_email" value="<?=$email;?>" />
```
The variable `$email` is a decrypted one, & it holds the value `psb@***.com` (when echoed in the same page).
I'm retrieving the value in my action page like- `$_POST['unsubscribe_email']`.
Instead of getting `***@**... | 2014/04/25 | ['https://Stackoverflow.com/questions/23284601', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3523750/'] | Assign your context variable before using, like this
```
context = getApplicationContext();
``` | Its because your context is null. Instead of context, you could use your activity like `NextActivity.this` |
39,618,765 | I need to write a test `PartitionMapperTest` for my Java class `PartitionMapper`. This class has private fields with `@Inject` annotations but it has only a no-param constructor.
For the test, I want to create a `partitionMapper` before any test and inject values into its private fields. Then, tester tests the mapper'... | 2016/09/21 | ['https://Stackoverflow.com/questions/39618765', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4381330/'] | Is there any reason to only have a no args constructor?
I would recommand you to use constructor injection instead of field injection. That would solve you problem.
For example instead of:
```
public class Foo {
@Inject
private Bar bar;
}
```
do this:
```
public class Foo {
private Bar bar;
publi... | Use protected fields instead of private to be able to mock fields in unit test:
```
@Named
public class PartitionMapper implements javax.batch.api.partition.PartitionMapper {
@Inject
JobContext jobContext;
@Inject
@BatchProperty
String fetchSize;
@Inject
@BatchProperty
String rowsPer... |
73,225,372 | What's the logic behind `if n < i*i: return True`?
```
def isPrime(n, i = 2):
# Base cases
if (n <= 2):
return True if(n == 2) else False
if (n % i == 0):
return False
if (n < i*i):
return True
# Check for the next divisor
return isPrime(n, i + 1)
``` | 2022/08/03 | ['https://Stackoverflow.com/questions/73225372', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/19583160/'] | For each factor `f`, there is a complement `n/f`. If the factor is less than `sqrt(n)`, the complement is bigger, and vice versa. So, if we checked all factors up to and including `sqrt(n)`, and found none, it is sufficient to say that there are no other factors. | At each iteration, we establish that `n` is not divisible by an integer less than or equal to `i`. If `n` were not a prime, then by definition `n = x * y` where `x` and `y` are positive integers. Both `x` and `y` must be greater than `i` as mentioned earlier. It follows that `n = x * y` must be greater than `i * i` for... |
32,922 | I've noticed on my team the developers are very busy toward the beginning of the sprint with the QA people having little to do, while the opposite is true toward the end of the sprint.
This seems inefficient... is there any way to smooth it out? | 2021/07/29 | ['https://pm.stackexchange.com/questions/32922', 'https://pm.stackexchange.com', 'https://pm.stackexchange.com/users/597/'] | It sounds like you are doing something very common in teams - a 2-week waterfall project. Things likely move from some requirements conversations before the sprint or in the early days of it to coding, then QA at the end. There are a few things you can do to change this up which will also have the impact of smoothing o... | I'm using a lot of Scrum terms here, but other agile methods are not that different.
Let me make one thing clear first: test cases are not things developers or QA people make up as they go. Test cases are defined alongside the requirements. They need to be there when the implementation starts. Maybe not as automated t... |
32,922 | I've noticed on my team the developers are very busy toward the beginning of the sprint with the QA people having little to do, while the opposite is true toward the end of the sprint.
This seems inefficient... is there any way to smooth it out? | 2021/07/29 | ['https://pm.stackexchange.com/questions/32922', 'https://pm.stackexchange.com', 'https://pm.stackexchange.com/users/597/'] | Switch to Kanban so that you can balance the flow of work without the cold-start at the beginning of every sprint.
Once you start optimizing for delivery, look at how developers can help with the QA to finish the work instead of starting new items.
Over time, this might reveal team imbalance and drive some staffing d... | I'm using a lot of Scrum terms here, but other agile methods are not that different.
Let me make one thing clear first: test cases are not things developers or QA people make up as they go. Test cases are defined alongside the requirements. They need to be there when the implementation starts. Maybe not as automated t... |
32,922 | I've noticed on my team the developers are very busy toward the beginning of the sprint with the QA people having little to do, while the opposite is true toward the end of the sprint.
This seems inefficient... is there any way to smooth it out? | 2021/07/29 | ['https://pm.stackexchange.com/questions/32922', 'https://pm.stackexchange.com', 'https://pm.stackexchange.com/users/597/'] | One key is cross-training to reduce the skill gap between QA and SW engineers. That is, train developers to do some low-level testing, and testers some low-level development work. In fact, a big-data presentation I saw all the way back in 2014 at Agile World showed the best-performing teams did not have separate discip... | I'm using a lot of Scrum terms here, but other agile methods are not that different.
Let me make one thing clear first: test cases are not things developers or QA people make up as they go. Test cases are defined alongside the requirements. They need to be there when the implementation starts. Maybe not as automated t... |
32,922 | I've noticed on my team the developers are very busy toward the beginning of the sprint with the QA people having little to do, while the opposite is true toward the end of the sprint.
This seems inefficient... is there any way to smooth it out? | 2021/07/29 | ['https://pm.stackexchange.com/questions/32922', 'https://pm.stackexchange.com', 'https://pm.stackexchange.com/users/597/'] | It sounds like you are doing something very common in teams - a 2-week waterfall project. Things likely move from some requirements conversations before the sprint or in the early days of it to coding, then QA at the end. There are a few things you can do to change this up which will also have the impact of smoothing o... | Switch to Kanban so that you can balance the flow of work without the cold-start at the beginning of every sprint.
Once you start optimizing for delivery, look at how developers can help with the QA to finish the work instead of starting new items.
Over time, this might reveal team imbalance and drive some staffing d... |
32,922 | I've noticed on my team the developers are very busy toward the beginning of the sprint with the QA people having little to do, while the opposite is true toward the end of the sprint.
This seems inefficient... is there any way to smooth it out? | 2021/07/29 | ['https://pm.stackexchange.com/questions/32922', 'https://pm.stackexchange.com', 'https://pm.stackexchange.com/users/597/'] | It sounds like you are doing something very common in teams - a 2-week waterfall project. Things likely move from some requirements conversations before the sprint or in the early days of it to coding, then QA at the end. There are a few things you can do to change this up which will also have the impact of smoothing o... | One key is cross-training to reduce the skill gap between QA and SW engineers. That is, train developers to do some low-level testing, and testers some low-level development work. In fact, a big-data presentation I saw all the way back in 2014 at Agile World showed the best-performing teams did not have separate discip... |
41,196 | I am having problem understanding why **negative frequencies are showing up to the right of positive frequencies** in discrete complex FFT.
I am not sure how to apply aliasing concept to explain such phenomenon even after reading about modulo-2pi angular frequency concept at [MIT OCW signal processing course](https://... | 2017/05/24 | ['https://dsp.stackexchange.com/questions/41196', 'https://dsp.stackexchange.com', 'https://dsp.stackexchange.com/users/22522/'] | The Fourier transform $X(e^{j\Omega})$ of a sequence $x[n]$ is by definition periodic of period $2\pi$ in $\Omega$. The $N$-point discrete Fourier transform (DFT) of $x[n]$ is simply defined as a sampled version of the Fourier transform $X(e^{j\Omega})$, that is
$$X[k] = X(e^{j\frac{2k\pi}{N}}).$$
The periodicity of $2... | I will try to give a more intuitive answer here. Have you ever seen [this effect](http://www.youtube.com/watch?v=jHS9JGkEOmA)? It is related to your question.
For simplicity, I will take easy numbers. The camera rate (fs) is, lets say, 1 frames per second: every second it takes a snapshot of the wheel. Now, assume tha... |
129,650 | Let's say I have many-to-many relationship (using the ActiveRecord attribute HasAndBelongsToMany) between Posts and Tags (domain object names changed to protect the innocent), and I wanted a method like
```
FindAllPostByTags(IList<Tag> tags)
```
that returns all Posts that have all (not just some of) the Tags in the ... | 2008/09/24 | ['https://Stackoverflow.com/questions/129650', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/14064/'] | You could also just use an `IN` statement
```
DetachedCriteria query = DetachedCriteria.For<Post>();
query.CreateCriteria("Post").Add(Expression.In("TagName", string.Join(",",tags.ToArray()) );
```
I haven't compiled that so it could have errors | I don't have a system at hand with a Castle install right now, so I didn't test or compile this, but the code below should about do what you want.
```
Junction c = Expression.Conjunction();
foreach(Tag t in tags)
c = c.Add( Expression.Eq("Tag", t);
return sess.CreateCriteria(typeof(Post)).Add(c).List();
``` |
129,650 | Let's say I have many-to-many relationship (using the ActiveRecord attribute HasAndBelongsToMany) between Posts and Tags (domain object names changed to protect the innocent), and I wanted a method like
```
FindAllPostByTags(IList<Tag> tags)
```
that returns all Posts that have all (not just some of) the Tags in the ... | 2008/09/24 | ['https://Stackoverflow.com/questions/129650', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/14064/'] | You could also just use an `IN` statement
```
DetachedCriteria query = DetachedCriteria.For<Post>();
query.CreateCriteria("Post").Add(Expression.In("TagName", string.Join(",",tags.ToArray()) );
```
I haven't compiled that so it could have errors | I just had the same problem and tried to read the HQL-documentation, however some of the features doesn't seem to be implemented in NHibernate (with-keyword for example)
I ended up with this sort of solution:
```
select p
FROM Post p
JOIN p.Tags tag1
JOIN p.Tags tag2
WHERE
tag1.Id = 1
tag2.Id = 2
```
Mean... |
71,368,718 | I am trying to build an application where user can search for various items. now my question is how can I send efficiently user search request to the server ?
example , user will type something (say 15 characters). For every 1 character he is sending one request to the server (using axios). now he is typing so fast, w... | 2022/03/06 | ['https://Stackoverflow.com/questions/71368718', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/911423/'] | You can use `setTimeout` to handle that case
```
let timer //the global variable to track the timer
async searchLocation(text) {
if (text.length > 3) {
//remove the API trigger within 3 seconds
clearTimeout(timer)
//assign new timer for the API call
timer = setTimeout(() => {
this.... | I think you can divide the issue into two steps
* At the first you must find a word that the user wants to type for search (**not result of search**)
in this step, you can just use a dictionary
* The second step is finding user search results after pressing **Enter key** or Click to the search button |
11,671,135 | Consider this list of POSIXct dates:
```
times <- list(as.POSIXct(c("2012-07-26 00:30", "2012-07-26 6:20",
"2012-07-26 10:40", "2012-07-26 15:50")),
as.POSIXct(c("2012-07-26 01:15", "2012-07-26 10:10",
"2012-07-26 15:15", "2012-07-26 18:50")),
... | 2012/07/26 | ['https://Stackoverflow.com/questions/11671135', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/176923/'] | `times[[1]]` is a vector, while `times[c(1,3)]` is a list. Convert the latter to a vector before calling `range` and all is well.
You don't want to use `unlist` though, since it will only return an atomic vector (`range` must be doing something like that internally), but you can use `do.call`:
```
range(do.call(c,tim... | As Joshua said, the hour is because of timezones. Try, for example:
```
times <- list(as.POSIXct(c("2012-07-26 00:30", "2012-07-26 6:20",
"2012-07-26 10:40", "2012-07-26 15:50"), "GMT"),
as.POSIXct(c("2012-07-26 01:15", "2012-07-26 10:10",
"2012-07-26 15:15", "20... |
1,064,367 | Title pretty much says it all. `lspci -v` finds a sound card, but neither `aplay -l` not `pacmd list-cards` don't. Problem first surfaced when updating ubuntu to 18.04, which was a hail-mary attempt to fix an another probably unrelated issue with my login screen. I'm not sure whether or not my sound was working before ... | 2018/08/11 | ['https://askubuntu.com/questions/1064367', 'https://askubuntu.com', 'https://askubuntu.com/users/527308/'] | Typically, `dconf` schemas translate nicely into `gsettings` schemas by replacing slashes with dots and vice versa.
In your example, `org.mate.peripherals-mouse` is the closest matching for what I'd expect to be a static schema.
However, not all `gsettings` schemas translate nicely. There's something known as [reloc... | To further clarify the relation between GSettings and DConf:
First of all, they are part of the *same* system. To be more precise, GSettings *uses* DConf as its ***storage backend***.
And that's what DConf is: a **storage** system. That's why it only speaks in terms of *paths*: it stores keys and values in a given pa... |
46,061,388 | I am trying to change the background color and text color of a link inside a button that I created, but only the background color changes. The text remains it's default color and refuses to change regardless of !important tags.
Here is my code:
```css
button,
input,
select,
textarea {
font-size: 100%;
/* Corrects... | 2017/09/05 | ['https://Stackoverflow.com/questions/46061388', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8565234/'] | Your CSS doesn't actually have any `a:hover` rules.
Why do you expect something to happen?
CSS will only do what you tell it to. | When you are changing a links colour on hover you need to make sure to apply it to the `a` tag directly. So in your case you want a style similar to the following:
```
a:hover {
color: white;
}
``` |
46,061,388 | I am trying to change the background color and text color of a link inside a button that I created, but only the background color changes. The text remains it's default color and refuses to change regardless of !important tags.
Here is my code:
```css
button,
input,
select,
textarea {
font-size: 100%;
/* Corrects... | 2017/09/05 | ['https://Stackoverflow.com/questions/46061388', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8565234/'] | If you want to change the `<a>` text color when hovering over the enclosing `.button` you can do this:
```
.button:hover a {
color: #FFFFFF
}
```
This has the advantage of not needing to hover over the actual link -- when you hover over any part of the button, the link color will change and stay readable.
```cs... | Your CSS doesn't actually have any `a:hover` rules.
Why do you expect something to happen?
CSS will only do what you tell it to. |
46,061,388 | I am trying to change the background color and text color of a link inside a button that I created, but only the background color changes. The text remains it's default color and refuses to change regardless of !important tags.
Here is my code:
```css
button,
input,
select,
textarea {
font-size: 100%;
/* Corrects... | 2017/09/05 | ['https://Stackoverflow.com/questions/46061388', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8565234/'] | Your CSS doesn't actually have any `a:hover` rules.
Why do you expect something to happen?
CSS will only do what you tell it to. | A link already has an predefined style. You need to remove that style first to apply your style. Try this in your link
```
text-decoration: none
```
Try hover after that. |
46,061,388 | I am trying to change the background color and text color of a link inside a button that I created, but only the background color changes. The text remains it's default color and refuses to change regardless of !important tags.
Here is my code:
```css
button,
input,
select,
textarea {
font-size: 100%;
/* Corrects... | 2017/09/05 | ['https://Stackoverflow.com/questions/46061388', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8565234/'] | If you want to change the `<a>` text color when hovering over the enclosing `.button` you can do this:
```
.button:hover a {
color: #FFFFFF
}
```
This has the advantage of not needing to hover over the actual link -- when you hover over any part of the button, the link color will change and stay readable.
```cs... | When you are changing a links colour on hover you need to make sure to apply it to the `a` tag directly. So in your case you want a style similar to the following:
```
a:hover {
color: white;
}
``` |
46,061,388 | I am trying to change the background color and text color of a link inside a button that I created, but only the background color changes. The text remains it's default color and refuses to change regardless of !important tags.
Here is my code:
```css
button,
input,
select,
textarea {
font-size: 100%;
/* Corrects... | 2017/09/05 | ['https://Stackoverflow.com/questions/46061388', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8565234/'] | When you are changing a links colour on hover you need to make sure to apply it to the `a` tag directly. So in your case you want a style similar to the following:
```
a:hover {
color: white;
}
``` | A link already has an predefined style. You need to remove that style first to apply your style. Try this in your link
```
text-decoration: none
```
Try hover after that. |
46,061,388 | I am trying to change the background color and text color of a link inside a button that I created, but only the background color changes. The text remains it's default color and refuses to change regardless of !important tags.
Here is my code:
```css
button,
input,
select,
textarea {
font-size: 100%;
/* Corrects... | 2017/09/05 | ['https://Stackoverflow.com/questions/46061388', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8565234/'] | If you want to change the `<a>` text color when hovering over the enclosing `.button` you can do this:
```
.button:hover a {
color: #FFFFFF
}
```
This has the advantage of not needing to hover over the actual link -- when you hover over any part of the button, the link color will change and stay readable.
```cs... | A link already has an predefined style. You need to remove that style first to apply your style. Try this in your link
```
text-decoration: none
```
Try hover after that. |
11,934,236 | Is there anything similar to [Celery](http://celeryproject.org) for Ruby? Is there anyone with any experience with [rcelery](https://github.com/leapfrogonline/rcelery)? Is it a good choice for production?
Update: I came across [resque](https://github.com/resque/resque), which looks like something I might be able to us... | 2012/08/13 | ['https://Stackoverflow.com/questions/11934236', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/'] | There are a lot of options for queues in ruby.
Sidekiq -> <https://github.com/mperham/sidekiq>
Resque, you got the link
DelayedJob -> <http://blog.leetsoft.com/delayed_job/>
All of them are pretty much the same. So you just need to use the one you are more confortable working with the examples.
In my projec... | Here is a good comparison of Resque and Sidekiq.
[Resque vs Sidekiq?](https://stackoverflow.com/questions/11580954/resque-vs-sidekiq)
Sidekiq uses threads so there is a much lower memory footprint then Resque or delayed job. the downside, and a huge one i think, is your workers MUST be thread safe, including whatever... |
11,012,218 | I have the following mysql table. I have been trying to select all the rows which are related with the row that has `B` as value in the `code` column. The relation is based on the value of the column `trans_id`
```
id trans_id code amount side
1 1 A 200 left
2 1 B 200 righ... | 2012/06/13 | ['https://Stackoverflow.com/questions/11012218', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1209690/'] | Your question is unclear, but as far as I understand, you could use a self join like this:
```
select a.id,
a.trans_id,
a.code,
a.amount,
a.side
from table as a
inner join table as b on (a.id=b.trans_id and b.code='B');
```
This will return the row with table.id=2:
```
id ... | If I'm understanding your problem correctly then a subquery would get you what you need.
```
SELECT * FROM yourTable WHERE id IN (SELECT trans_id FROM yourTable WHERE code='B')
``` |
11,012,218 | I have the following mysql table. I have been trying to select all the rows which are related with the row that has `B` as value in the `code` column. The relation is based on the value of the column `trans_id`
```
id trans_id code amount side
1 1 A 200 left
2 1 B 200 righ... | 2012/06/13 | ['https://Stackoverflow.com/questions/11012218', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1209690/'] | ```
select
t1.*
from
table_name t1
inner join table_name t2 on t1.trans_id = t2.trans_id
where
t2.code = 'B' and
t2.code <> t1.code
``` | If I'm understanding your problem correctly then a subquery would get you what you need.
```
SELECT * FROM yourTable WHERE id IN (SELECT trans_id FROM yourTable WHERE code='B')
``` |
11,012,218 | I have the following mysql table. I have been trying to select all the rows which are related with the row that has `B` as value in the `code` column. The relation is based on the value of the column `trans_id`
```
id trans_id code amount side
1 1 A 200 left
2 1 B 200 righ... | 2012/06/13 | ['https://Stackoverflow.com/questions/11012218', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1209690/'] | The following query should return the results you want. This uses a select query to return results to the WHERE clause.
```
SELECT * FROM yourTable
WHERE trans_id IN (
SELECT trans_id FROM yourTable WHERE code='B'
)
AND code!='B'
``` | If I'm understanding your problem correctly then a subquery would get you what you need.
```
SELECT * FROM yourTable WHERE id IN (SELECT trans_id FROM yourTable WHERE code='B')
``` |
11,012,218 | I have the following mysql table. I have been trying to select all the rows which are related with the row that has `B` as value in the `code` column. The relation is based on the value of the column `trans_id`
```
id trans_id code amount side
1 1 A 200 left
2 1 B 200 righ... | 2012/06/13 | ['https://Stackoverflow.com/questions/11012218', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1209690/'] | The following query should return the results you want. This uses a select query to return results to the WHERE clause.
```
SELECT * FROM yourTable
WHERE trans_id IN (
SELECT trans_id FROM yourTable WHERE code='B'
)
AND code!='B'
``` | Your question is unclear, but as far as I understand, you could use a self join like this:
```
select a.id,
a.trans_id,
a.code,
a.amount,
a.side
from table as a
inner join table as b on (a.id=b.trans_id and b.code='B');
```
This will return the row with table.id=2:
```
id ... |
11,012,218 | I have the following mysql table. I have been trying to select all the rows which are related with the row that has `B` as value in the `code` column. The relation is based on the value of the column `trans_id`
```
id trans_id code amount side
1 1 A 200 left
2 1 B 200 righ... | 2012/06/13 | ['https://Stackoverflow.com/questions/11012218', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1209690/'] | The following query should return the results you want. This uses a select query to return results to the WHERE clause.
```
SELECT * FROM yourTable
WHERE trans_id IN (
SELECT trans_id FROM yourTable WHERE code='B'
)
AND code!='B'
``` | ```
select
t1.*
from
table_name t1
inner join table_name t2 on t1.trans_id = t2.trans_id
where
t2.code = 'B' and
t2.code <> t1.code
``` |
9,544,602 | graph.h
```
struct Edge {
int from;
int to;
int elabel;
unsigned int id;
Edge(): from(0), to(0), elabel(0), id(0) {};
};
```
What is the difference between `vector<Edge>` and `vector<Edge*>`? I know `vector<Edge>` is an array storing `Edge` objects, but what is the `Edge*` object? | 2012/03/03 | ['https://Stackoverflow.com/questions/9544602', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/419284/'] | The `Edge*` type is a pointer-to-edge. So a `vector<Edge*>` is a vector that stores pointers-to-edges.
The vector itself doesn't store the objects, only pointers to those objects. This means in particular that the pointed-to objects don't get automatically deleted when the pointer's lifetime ends. | `Edge*` is a pointer to an `Edge`. [Read up on Pointers in C++.](http://www.cplusplus.com/doc/tutorial/pointers/) |
2,289,288 | Say I'm cloning a repository that I always clone to `C:\working_copies\<customer-name>\<customer-project>\` and that the project has variables in it's `build.properties` that get filled in with `<customer-name> <customer-project>` (by me) everytime I clone the repo.
Is there a way that I can fill in these values in t... | 2010/02/18 | ['https://Stackoverflow.com/questions/2289288', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/18149/'] | From (hazy) memory, that was the tag used by SCCS back in the "good old days". Given that (to my knowledge), BitKeeper uses SCCS underneath, it could be BitKeeper. | It is usually something that is added automatically by the version control system. |
2,289,288 | Say I'm cloning a repository that I always clone to `C:\working_copies\<customer-name>\<customer-project>\` and that the project has variables in it's `build.properties` that get filled in with `<customer-name> <customer-project>` (by me) everytime I clone the repo.
Is there a way that I can fill in these values in t... | 2010/02/18 | ['https://Stackoverflow.com/questions/2289288', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/18149/'] | `@(#)` is the character string used by the Unix `what` command to filter strings from binaries to list the components that were used to build that binary. For instance `what java` on AIX yields:
```
java:
23 1.4 src/bos/usr/ccs/lib/libpthreads/init.c, libpth, bos520 8/19/99 12:20:14
61 1.14 src... | It is usually something that is added automatically by the version control system. |
2,289,288 | Say I'm cloning a repository that I always clone to `C:\working_copies\<customer-name>\<customer-project>\` and that the project has variables in it's `build.properties` that get filled in with `<customer-name> <customer-project>` (by me) everytime I clone the repo.
Is there a way that I can fill in these values in t... | 2010/02/18 | ['https://Stackoverflow.com/questions/2289288', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/18149/'] | From (hazy) memory, that was the tag used by SCCS back in the "good old days". Given that (to my knowledge), BitKeeper uses SCCS underneath, it could be BitKeeper. | That construct has no special meaning in Java. It is just some text in a comment.
It looks like something that's inserted by a version control system. |
2,289,288 | Say I'm cloning a repository that I always clone to `C:\working_copies\<customer-name>\<customer-project>\` and that the project has variables in it's `build.properties` that get filled in with `<customer-name> <customer-project>` (by me) everytime I clone the repo.
Is there a way that I can fill in these values in t... | 2010/02/18 | ['https://Stackoverflow.com/questions/2289288', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/18149/'] | `@(#)` is the character string used by the Unix `what` command to filter strings from binaries to list the components that were used to build that binary. For instance `what java` on AIX yields:
```
java:
23 1.4 src/bos/usr/ccs/lib/libpthreads/init.c, libpth, bos520 8/19/99 12:20:14
61 1.14 src... | That construct has no special meaning in Java. It is just some text in a comment.
It looks like something that's inserted by a version control system. |
2,289,288 | Say I'm cloning a repository that I always clone to `C:\working_copies\<customer-name>\<customer-project>\` and that the project has variables in it's `build.properties` that get filled in with `<customer-name> <customer-project>` (by me) everytime I clone the repo.
Is there a way that I can fill in these values in t... | 2010/02/18 | ['https://Stackoverflow.com/questions/2289288', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/18149/'] | `@(#)` is the character string used by the Unix `what` command to filter strings from binaries to list the components that were used to build that binary. For instance `what java` on AIX yields:
```
java:
23 1.4 src/bos/usr/ccs/lib/libpthreads/init.c, libpth, bos520 8/19/99 12:20:14
61 1.14 src... | From (hazy) memory, that was the tag used by SCCS back in the "good old days". Given that (to my knowledge), BitKeeper uses SCCS underneath, it could be BitKeeper. |
52,322,097 | Say I was observing a variable
`m.someObject.observeField("content", "onContentChanged")`
after a certain period of time I no longer need `m.someObject`.
Do I need to cleanup and call
`m.someObject.unobserveField("content")`
or can I just leave it? | 2018/09/13 | ['https://Stackoverflow.com/questions/52322097', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5673746/'] | Yes, try to follow this as a good practice, just like when dealing with files after `open()` should eventually call `close()` (even as, generally speaking going out of scope takes care of closing connections, it's a good practice to explicitly take care of it).
Now, beware that `node.unobserveField("X")` is a "nuclea... | Yeah, you should. Roku doesn't have the worlds greatest garbage collection and we've noticed considerable performance improvements from being careful about that. |
11,661 | or is there something else that is opposite or similar to it...
From all the teachings i have received the rule I'd say is Islamic is do what's the best. Basically people change so labelling someone as sinner may make us overlook his/her good parts and overlook their change if it occurs.
Please provide hadiths/Quran... | 2014/03/06 | ['https://islam.stackexchange.com/questions/11661', 'https://islam.stackexchange.com', 'https://islam.stackexchange.com/users/2948/'] | “Hate the sin, not the sinner” is only partly correct in Islam. Only a sinner with sins wholly occupying his heart making his heart dark lacking any light spot survived in it is one we should hate and even curse against them, though, if we can identify them correctly. About any other sinner no we cannot hate himself, b... | It depends on the type of sin.
Quran says there has already been for you an excellent pattern in Abraham. So this means that we should follow this pattern. He many times invited his people to monotheism by kindness. But they still insisted on Shirk and did not leave their idols and tried to kill prophet Ibrahim a.s. ... |
23,010,340 | How do you use **name** with a function that I'd like to pass a keyword argument through?
For example, I have the following function:
```
def func(keyword1='A'):
print keyword1
```
I can do this:
```
func.__name__
>> 'func'
```
But, I'd like to do this:
```
func(keyword1='B').__name__
>>> 'func'
```
The ... | 2014/04/11 | ['https://Stackoverflow.com/questions/23010340', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2850808/'] | Python's functions are objects too, so you can pass them along just like any other object. What you're doing (which can't obviously work) is passing the result of calling the function. What you want is to pass the function and the function's argument:
```
def print_function_name_and_result(func, *args, **kw):
prin... | If you have a method that takes a function, **then pass in the function**, not the return value.
You are instead calling the function. The `.__name__` attribute lookup is applied to the return value of that call. If you are passing the *return value* of a function call to your method, you are **not** passing the funct... |
44,871 | I have a big share (~5TB) that is getting full.
Now I want to make a script that deletes data from 2 specified folders. But this need to be the oldest files/folders and it need to stop when ~50GB has been removed, so it won't delete all folders.
**Edit:** This need to work with Samba shares for my Synology DS-409. Th... | 2012/08/06 | ['https://unix.stackexchange.com/questions/44871', 'https://unix.stackexchange.com', 'https://unix.stackexchange.com/users/21697/'] | This should work:
```
DIRS="a/ b/"
MAXDELBYTES="53687091200" # 50GB
DELBYTES="0"
find $DIRS -type f -printf "%T@ %s %p\n" | sort -r -n | while read time bytes filename
do
rm -fv "$filename"
DELBYTES=$((DELBYTES + bytes))
if [ $DELBYTES -ge $MAXDELBYTES ]; then break; fi
done
``` | scai, autodelete.txt is a file i created in windows and uploaded to a linux share :)
Now i have made this code in nano because of windows linux code problems.
But now it gives a bunch of error's
```
root ~/.config # sh autodelete
find: unrecognized: -printf
BusyBox v1.20.2 (2012-08-09 05:49:15 CEST) multi-call binary... |
282,604 | I have two tables. Each holds some attributes for a business entity and the date range for which those attributes were valid. I want to combine these tables into one, matching rows on the common business key and splitting the time ranges.
The real-world example is two source temporal tables feeding a type-2 dimension ... | 2021/01/05 | ['https://dba.stackexchange.com/questions/282604', 'https://dba.stackexchange.com', 'https://dba.stackexchange.com/users/36809/'] | I may have misunderstood your question, but the results seem to be according to your question:
```
select a.businesskey
-- greatest(a.startdate, b.startdate)
, case when a.startdate > b.startdate
then a.startdate
else b.startdate
end as startdate
-- least(a.enddate, b.e... | This solution deconstructs the source intervals to just their starting dates. By combining these two list a set of output interval start dates are obtained. From these the corresponding output end dates are calculated by a window function. As the final output interval must end when either of the two input intervals end... |
282,604 | I have two tables. Each holds some attributes for a business entity and the date range for which those attributes were valid. I want to combine these tables into one, matching rows on the common business key and splitting the time ranges.
The real-world example is two source temporal tables feeding a type-2 dimension ... | 2021/01/05 | ['https://dba.stackexchange.com/questions/282604', 'https://dba.stackexchange.com', 'https://dba.stackexchange.com/users/36809/'] | I may have misunderstood your question, but the results seem to be according to your question:
```
select a.businesskey
-- greatest(a.startdate, b.startdate)
, case when a.startdate > b.startdate
then a.startdate
else b.startdate
end as startdate
-- least(a.enddate, b.e... | There are a lot of interesting solutions to this problem (stated in different terms) [here](https://sqlperformance.com/2022/03/t-sql-queries/supply-demand-solutions-3) and its preceding pages. There it is presented as matching supply and demand in an auction. The units supplied/demanded is directly analogous to the day... |
34,015,595 | For some unfathomable reason Google decided to add Splash Screens (Launch Screen) to their design guidelines, I know that,
**1. Splash screen is better than staring at an empty screen.**
................ [ Inflating the main layout and showing a UI without any dynamic data should be very fast. If that's not the case... | 2015/12/01 | ['https://Stackoverflow.com/questions/34015595', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5021501/'] | Sanket, splash screens also allow for the app itself to load. some apps like facebook are not actually apps but the normal website for mobile phones... made into its own special browser for only that website. thus, the app itself must load even its menus, which have icons and all on them. splash screens definitely woul... | Just display a dialog about you app updates or If ur app contains login functionality just use login using dialog.I think it may be an best alternative for splash. |
24,226,385 | How can I get the next word after pregmatch with PHP.
For example, If I have a string like this:
```
"This is a string, keyword next, some more text. keyword next-word."
```
I want to use a `preg_match` to get the next word after “keyword”, including if the word is hyphenated.
So in the case above, I want to retur... | 2014/06/15 | ['https://Stackoverflow.com/questions/24226385', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3143218/'] | Using your example this should work using [`preg_match_all`](http://www.php.net/manual/en/function.preg-match-all.php):
```
// Set the test string.
$string = "This is a string, keyword next, some more text. keyword next-word. keyword another_word. Okay, keyword do-rae-mi-fa_so_la.";
// Set the regex.
$regex = '/(?<=\... | Positive look behind is what you are looking for:
```
(?<=\bkeyword\s)([a-zA-Z-]+)
```
Should work perfect with `preg_match`. Use `g` modifier to catch all matches.
[Demo](http://regex101.com/r/nB9rU1)
Reference Question: [How to match the first word after an expression with regex?](https://stackoverflow.com/quest... |
24,226,385 | How can I get the next word after pregmatch with PHP.
For example, If I have a string like this:
```
"This is a string, keyword next, some more text. keyword next-word."
```
I want to use a `preg_match` to get the next word after “keyword”, including if the word is hyphenated.
So in the case above, I want to retur... | 2014/06/15 | ['https://Stackoverflow.com/questions/24226385', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3143218/'] | Using your example this should work using [`preg_match_all`](http://www.php.net/manual/en/function.preg-match-all.php):
```
// Set the test string.
$string = "This is a string, keyword next, some more text. keyword next-word. keyword another_word. Okay, keyword do-rae-mi-fa_so_la.";
// Set the regex.
$regex = '/(?<=\... | While regex is powerful, it's also for most of us hard to debug and memorize.
On this particular case, **Get next word after ... match with PHP**, which is a very common string operation.
Simply, by exploding the string in an array, and searching the index. This is useful because we can specify how much words forward... |
34,329 | I just got this mountain bike almost 3 weeks ago. I took it for a long ride(120km back and forth). We encountered heavy rain during our ride, we were riding on a highway back then, there's flood water flowing everywhere as you would imagine but not enough to submerge the bottom bracket.
Everything is perfect until th... | 2015/09/11 | ['https://bicycles.stackexchange.com/questions/34329', 'https://bicycles.stackexchange.com', 'https://bicycles.stackexchange.com/users/22534/'] | If you just bought it, the shop mechanic should remedy the problem no matter what specific part is to blame. If not, threaten to return the entire bike and take your business elsewhere. It should be as simple as that. | Heck, for piece of mind, I'd make the following deal with the shop. Offer to pay for a clean and repack, but if they find anything inside (like metal debris, etc) that came from the original manufacturing process then the bike manufacturer gets to own that.
My thought is.. what if a piece of extraneous metal, left in... |
1,803,274 | I have recently started learning more about complex numbers and stumbled upon this problem:
Plot the numbers $z$ in the complex plane that fulfil $|z-2i| ≤ 1$ and $\text{Im} (z) ≥ 2$
I know that $\text{Im}(z) ≥ 2$ means that all imaginary numbers who are positioned somewhere on the horizontal line $\text{Im} = 2$ or ... | 2016/05/28 | ['https://math.stackexchange.com/questions/1803274', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/333942/'] | Let's write z=x+iy and then the inequality $ |z-2i|\leq1$ becomes $ |x+(y-2)i|\leq1 $ so we get $x^2+(y-2)^2 \leq 1$. Can you see it now? | Hint let $z=x+iy$ so equation on squaring becomes $x^2+(y-2)^2\leq 1$. Now do you understand why is it $+2i$ |
51,192,832 | I need to create a login dialog like this
[](https://i.stack.imgur.com/3MJEH.png) [](https://i.stack.imgur.com/Qrkwx.png)
image files: `eyeOn.png`, `eyeOff.png`
Requirements:
* pa... | 2018/07/05 | ['https://Stackoverflow.com/questions/51192832', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4196709/'] | The solution is to add a `QAction` to the `QLineEdit`, this will create a `QToolButton` that we can obtain from the `associatedWidgets()` (it will be the second widget since the first one is the one associated with `clearButton`). Already having the `QToolButton` you must use the `pressed` and `released` signal.
**pas... | Rather than trying to make use of the `QAction` returned by `QLineEdit::addAction` you could probably use a [`QWidgetAction`](http://doc.qt.io/qt-5/qwidgetaction.html) for this when combined with a suitable event filter...
```
class eye_spy: public QWidgetAction {
using super = QWidgetAction;
public:
explicit eye_... |
284,228 | In my modern SharePoint, I have a simple webpart and there's scenerio where to allow user to choose colour from custom properties pane configuration.
it can be colour picker
[](https://i.stack.imgur.com/lSoht.png)
or as simple as dropdown options wi... | 2020/08/28 | ['https://sharepoint.stackexchange.com/questions/284228', 'https://sharepoint.stackexchange.com', 'https://sharepoint.stackexchange.com/users/92501/'] | If you are implementing SPFx you can use PnP controls color picker in prperty pane to allow user select the color value. It's easier to implement than creating custom one.
[PnP Color Picker](https://pnp.github.io/sp-dev-fx-property-controls/controls/PropertyFieldColorPicker/)
[](https://i.stack.imgur.com/3v9s8.gif)
Main code:
```
import * as React from 'react';
import * as ReactDom from 'react-dom';
import { Version } from '@microsoft/sp-core-library';
import {
IPropertyPaneConfiguration,
PropertyPaneTextField,
Prope... |
46,810 | I'm buying a train ticket on the long-distance Amtrak Empire Builder train that runs Chicago-Milwaukee-...-St. Paul-...
I'm traveling from Milwaukee to St. Paul. All the saver tickets are sold out. Value tickets are sold out for Milwaukee-St. Paul, but not for Chicago-St. Paul. This means it cheaper to buy a ticket fr... | 2015/04/27 | ['https://travel.stackexchange.com/questions/46810', 'https://travel.stackexchange.com', 'https://travel.stackexchange.com/users/20576/'] | I asked a similar question to an Amtrak agent a few days ago. Here's what he told me:
Officially, your ticket gets treated as a "no-show" and is "subject to automatic cancellation" if you haven't boarded the train within two hours of the originally-scheduled departure time at your ticketed station.
He said that if yo... | Amtrak terms and conditions state that if you fail to board your train as booked your entire reservation is subject to cancellation
It's one of the first things detailed on the conditions of carriage page here.
<http://www.amtrak.com/servlet/ContentServer?c=Page&pagename=am%2FLayout&cid=1241337896121>
If discovere... |
55,715,000 | I'm creating an application, which interacts with OpenGL via *QOpenGL\** classes. The graphics is shown through a *QOpenGLWidget*, which is placed in a UI-form.
Now, there is a library for CAD purposes ([Open CASCADE](https://www.opencascade.com)), an OpenGL interface of which requires a handle to the render window. ... | 2019/04/16 | ['https://Stackoverflow.com/questions/55715000', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4886665/'] | **QOpenGLWidget** is not the same thing as **QGLWidget**.
The classical approach for embedding OCCT 3D viewer, which you can find in Qt IESample coming with OCCT, creates QWidget with unique window handle flag, takes this window handle and ask OCCT to take care about OpenGL context creation for this window. This is mo... | After some investigation, I found that method *QOpenGLWidget::winId()* returns the correct handle. It's been found out only now, because the rendered scene disappeared immediately, leaving a black picture instead. However, when the viewport is resized, the scene returns back (and disappears again, though). Looks like O... |
31,581,537 | here the df(i updated by real data ):
```
>TIMESTAMP OLTPSOURCE RNR RQDRECORD
>20150425232836 0PU_IS_PS_44 REQU_51NHAJUV06IMMP16BVE572JM2 17020
>20150128165726 ZFI_DS41 REQU_50P1AABLYXE86KYE3O6EY390M 6925
>20150701144253 ZZZJB_TEXT REQU_52DV5FB812JCDXD... | 2015/07/23 | ['https://Stackoverflow.com/questions/31581537', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5146939/'] | Peter, we've just implemented the same thing.
Users have the software pre-installed on their device and we host update APK's on the companies servers.
From the app they can then check for updates where we have a WCF service which extracts the APK file (essentially a .zip) and returns the manifest details. From there ... | You have a couple of options, depending upon your target system.
1. Use the link you posted. This will provide the user with a traditional install dialog, whereby the user can choose to install or not. You should avoid doing that automatically, as APKs can be large and you might irritate the user if they don't want up... |
31,581,537 | here the df(i updated by real data ):
```
>TIMESTAMP OLTPSOURCE RNR RQDRECORD
>20150425232836 0PU_IS_PS_44 REQU_51NHAJUV06IMMP16BVE572JM2 17020
>20150128165726 ZFI_DS41 REQU_50P1AABLYXE86KYE3O6EY390M 6925
>20150701144253 ZZZJB_TEXT REQU_52DV5FB812JCDXD... | 2015/07/23 | ['https://Stackoverflow.com/questions/31581537', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5146939/'] | Peter, we've just implemented the same thing.
Users have the software pre-installed on their device and we host update APK's on the companies servers.
From the app they can then check for updates where we have a WCF service which extracts the APK file (essentially a .zip) and returns the manifest details. From there ... | If your app is open-source, [F-Droid](https://f-droid.org/) would solve the problem for you.
>
> F-Droid is an installable catalogue of FOSS (Free and Open Source
> Software) applications for the Android platform. The client makes it
> easy to browse, install, and keep track of updates on your device.
>
>
>
Mai... |
31,581,537 | here the df(i updated by real data ):
```
>TIMESTAMP OLTPSOURCE RNR RQDRECORD
>20150425232836 0PU_IS_PS_44 REQU_51NHAJUV06IMMP16BVE572JM2 17020
>20150128165726 ZFI_DS41 REQU_50P1AABLYXE86KYE3O6EY390M 6925
>20150701144253 ZZZJB_TEXT REQU_52DV5FB812JCDXD... | 2015/07/23 | ['https://Stackoverflow.com/questions/31581537', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5146939/'] | Peter, we've just implemented the same thing.
Users have the software pre-installed on their device and we host update APK's on the companies servers.
From the app they can then check for updates where we have a WCF service which extracts the APK file (essentially a .zip) and returns the manifest details. From there ... | Yes but as far as I remember only if you had Root privileges in order to have access to the INSTALL\_PACKAGES permission. |
9,590,702 | I have a ListBox which I put some files, if the file is not AVI I automatically converts it but I want when the files converting message will write on a label that the files are now converted to another format, i know i need use Dispatcher in order to update the UI thread but i use now Winform instead of WPF, and i nee... | 2012/03/06 | ['https://Stackoverflow.com/questions/9590702', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/979033/'] | From your question, it seems that you'd like to convert several files. You may want to consider using the [BackgroundWorker](http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx) class and overwrite the DoWork and ProgressChanged events as described in [this article](http://msdn.microsoft... | This is a very common requirement for long-running processes. If you don't explicitly call methods on a separate thread, they will automatically run on the main (see: UI) thread and cause your UI to hand (as I suspect you already know).
<http://www.dotnetperls.com/backgroundworker>
Here is an old, but excellent link ... |
9,590,702 | I have a ListBox which I put some files, if the file is not AVI I automatically converts it but I want when the files converting message will write on a label that the files are now converted to another format, i know i need use Dispatcher in order to update the UI thread but i use now Winform instead of WPF, and i nee... | 2012/03/06 | ['https://Stackoverflow.com/questions/9590702', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/979033/'] | From your question, it seems that you'd like to convert several files. You may want to consider using the [BackgroundWorker](http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx) class and overwrite the DoWork and ProgressChanged events as described in [this article](http://msdn.microsoft... | ```
public void sendFilesToConvertToPcap()
{
.....
....
this.Invoke((MethodInvoker)delegate {
lblStatus2.Text = "Convert file to .AVI..."; });
....
}
``` |
9,590,702 | I have a ListBox which I put some files, if the file is not AVI I automatically converts it but I want when the files converting message will write on a label that the files are now converted to another format, i know i need use Dispatcher in order to update the UI thread but i use now Winform instead of WPF, and i nee... | 2012/03/06 | ['https://Stackoverflow.com/questions/9590702', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/979033/'] | ```
public void sendFilesToConvertToPcap()
{
.....
....
this.Invoke((MethodInvoker)delegate {
lblStatus2.Text = "Convert file to .AVI..."; });
....
}
``` | This is a very common requirement for long-running processes. If you don't explicitly call methods on a separate thread, they will automatically run on the main (see: UI) thread and cause your UI to hand (as I suspect you already know).
<http://www.dotnetperls.com/backgroundworker>
Here is an old, but excellent link ... |
419,654 | I'm not sure what I'm doing wrong on my questions in [Go](https://en.wikipedia.org/wiki/Go_%28programming_language%29) as I always get downvotes.
Do you think something can be improved in these questions? Can I do something else to avoid being banned?
*[Deleting endpoint in Go is not working as expected](https://stac... | 2022/08/05 | ['https://meta.stackoverflow.com/questions/419654', 'https://meta.stackoverflow.com', 'https://meta.stackoverflow.com/users/15083173/'] | I closed both questions.
[Delete endpoint in golang not working as expected](https://stackoverflow.com/questions/73249646/delete-endpoint-in-golang-not-working-as-expected/73250074#73250074)
This question seems to have just been a typo. It doesn't look useful to others unless you explain what the mistake in the URL w... | Your titles are not very informative - since SO primarily intends to be useful for other people with the same issue, a title like 'Delete endpoint in golang not working as expected' is really not very helpful, since nobody else knows what 'as expected' is meant to be. For some users, that would be grounds for a downvot... |
24,371,011 | I have a Rails4 app with the following models:
```
1. Systems (has many devices, has many parameters through devices)
2. Devices (belongs to a system, has many parameters)
3. Parameters (belongs to a Device)
4. Events (polymorphic - Systems, Devices and Parameters can have events)
```
When an event is created, a... | 2014/06/23 | ['https://Stackoverflow.com/questions/24371011', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2778833/'] | Basically your Javascript could be shortened to:
```
$(".question").click(function(argument) {
$(this).parent().find(".answer").removeClass("hideinit").addClass("display");
});
```
In order to make this work the only other thing you need to do is to make `question` a class rather than as an id. That looks like... | Well, for one thing, in your JSFiddle you were not including the jQuery library. I've adjusted your code, I think this is what you were going for:
```
$(".question").click(function() {
$(this).siblings().toggle();
});
```
Here's an [updated JSFiddle](http://jsfiddle.net/8UVAf/5/).
===============================... |
24,371,011 | I have a Rails4 app with the following models:
```
1. Systems (has many devices, has many parameters through devices)
2. Devices (belongs to a system, has many parameters)
3. Parameters (belongs to a Device)
4. Events (polymorphic - Systems, Devices and Parameters can have events)
```
When an event is created, a... | 2014/06/23 | ['https://Stackoverflow.com/questions/24371011', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2778833/'] | Basically your Javascript could be shortened to:
```
$(".question").click(function(argument) {
$(this).parent().find(".answer").removeClass("hideinit").addClass("display");
});
```
In order to make this work the only other thing you need to do is to make `question` a class rather than as an id. That looks like... | Please watch your includes in your JSFiddle as the version you linked was not including the jQuery library. You should also clean up your multiple `id` references (as this is invalid HTML and will cause some issues down the road).
Those issues aside, you can use jQuery's [`.next()`](http://api.jquery.com/next/) method... |
24,371,011 | I have a Rails4 app with the following models:
```
1. Systems (has many devices, has many parameters through devices)
2. Devices (belongs to a system, has many parameters)
3. Parameters (belongs to a Device)
4. Events (polymorphic - Systems, Devices and Parameters can have events)
```
When an event is created, a... | 2014/06/23 | ['https://Stackoverflow.com/questions/24371011', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2778833/'] | Basically your Javascript could be shortened to:
```
$(".question").click(function(argument) {
$(this).parent().find(".answer").removeClass("hideinit").addClass("display");
});
```
In order to make this work the only other thing you need to do is to make `question` a class rather than as an id. That looks like... | ```
$(".question").on('click',function() {
$(this).next().toggle();
});
``` |
40,584,664 | I am new to TYPO3 and have a big problem. I deleted the page with the id 1 (startpage, I know its stupid) and now I woudl like to know if it is possible to restore the page somehow. | 2016/11/14 | ['https://Stackoverflow.com/questions/40584664', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3649851/'] | Install extension Recycler, it ships with TYPO3 by default. You can then restore pages and content you deleted using the backend UI it has.
<https://docs.typo3.org/typo3cms/extensions/recycler/Introduction/Index.html> | You can use the recycler that is found under the web module and click on a page in the page tree at a higher level than the deleted page. You can also set the depth to infinitive if not certain where the page used to be in the page tree. Then put a tick beside the page you want to restore and click undelete. Note that ... |
29,516,573 | This is something that has bugged me for many many years and have never asked.
Why is it that when writing SQL against a schema in a databases, whether it be Oracle, Postgres, MySQL or MSSQL I have to specify the database name and the table name? e.g.
SELECT id FROM mydb.mytable;
and other times as
SELECT id FROM myta... | 2015/04/08 | ['https://Stackoverflow.com/questions/29516573', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/588492/'] | The main problem is that you have declared `position1` as a `VARCHAR(100)` instead of as an `INTEGER`. This leads to the unhelpful error here as there is no substring version that takes a varchar parameter (and in this context conversion from varchar to integer is not supported).
A working (or at least: compiling) ver... | For Firebird 3
```sql
SET TERM ^ ;
create function translator (
inp varchar(10000),
pat varchar(1000),
rep varchar(1000))
returns varchar(10000)
as
declare variable tex varchar(10000);
declare variable inp_idx integer = 1;
declare variable cha char(1);
declare variable pos integer;
begin
... |
8,414,930 | I have...
```
Func<string> del2 = new Func<string>(MyMethod);
```
and I really want to do..
```
Func<> del2 = new Func<>(MyMethod);
```
so the return type of the callback method is void. Is this possible using the generic type func? | 2011/12/07 | ['https://Stackoverflow.com/questions/8414930', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/223863/'] | Yes a function returning void (no value) is a `Action`
```
public Test()
{
// first approach
Action firstApproach = delegate
{
// do your stuff
};
firstApproach();
//second approach
Action secondApproach = MyMethod;
secondApproach();
}
void MyMethod()
{
// do your stuff
}... | Use [Action delegate type](http://msdn.microsoft.com/en-us/library/system.action.aspx). |
8,414,930 | I have...
```
Func<string> del2 = new Func<string>(MyMethod);
```
and I really want to do..
```
Func<> del2 = new Func<>(MyMethod);
```
so the return type of the callback method is void. Is this possible using the generic type func? | 2011/12/07 | ['https://Stackoverflow.com/questions/8414930', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/223863/'] | The `Func` family of delegates is for methods that take zero or more parameters and return a value. For methods that take zero or more parameters an don't return a value use one of the `Action` delegates. If the method has no parameters, use [the non-generic version of `Action`](http://msdn.microsoft.com/en-us/library/... | Use [Action delegate type](http://msdn.microsoft.com/en-us/library/system.action.aspx). |
8,414,930 | I have...
```
Func<string> del2 = new Func<string>(MyMethod);
```
and I really want to do..
```
Func<> del2 = new Func<>(MyMethod);
```
so the return type of the callback method is void. Is this possible using the generic type func? | 2011/12/07 | ['https://Stackoverflow.com/questions/8414930', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/223863/'] | Yes a function returning void (no value) is a `Action`
```
public Test()
{
// first approach
Action firstApproach = delegate
{
// do your stuff
};
firstApproach();
//second approach
Action secondApproach = MyMethod;
secondApproach();
}
void MyMethod()
{
// do your stuff
}... | In cases where you're 'forced' to use `Func<T>`, e.g. in an internal generic API which you want to reuse, you can just define it as `new Func<object>(() => { SomeStuff(); return null; });`. |
8,414,930 | I have...
```
Func<string> del2 = new Func<string>(MyMethod);
```
and I really want to do..
```
Func<> del2 = new Func<>(MyMethod);
```
so the return type of the callback method is void. Is this possible using the generic type func? | 2011/12/07 | ['https://Stackoverflow.com/questions/8414930', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/223863/'] | The `Func` family of delegates is for methods that take zero or more parameters and return a value. For methods that take zero or more parameters an don't return a value use one of the `Action` delegates. If the method has no parameters, use [the non-generic version of `Action`](http://msdn.microsoft.com/en-us/library/... | Yes a function returning void (no value) is a `Action`
```
public Test()
{
// first approach
Action firstApproach = delegate
{
// do your stuff
};
firstApproach();
//second approach
Action secondApproach = MyMethod;
secondApproach();
}
void MyMethod()
{
// do your stuff
}... |
8,414,930 | I have...
```
Func<string> del2 = new Func<string>(MyMethod);
```
and I really want to do..
```
Func<> del2 = new Func<>(MyMethod);
```
so the return type of the callback method is void. Is this possible using the generic type func? | 2011/12/07 | ['https://Stackoverflow.com/questions/8414930', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/223863/'] | Yes a function returning void (no value) is a `Action`
```
public Test()
{
// first approach
Action firstApproach = delegate
{
// do your stuff
};
firstApproach();
//second approach
Action secondApproach = MyMethod;
secondApproach();
}
void MyMethod()
{
// do your stuff
}... | Here is a code example using Lambda expressions instead of Action/Func delegates.
```
delegate void TestDelegate();
static void Main(string[] args)
{
TestDelegate testDelegate = () => { /*your code*/; };
testDelegate();
}
``` |
8,414,930 | I have...
```
Func<string> del2 = new Func<string>(MyMethod);
```
and I really want to do..
```
Func<> del2 = new Func<>(MyMethod);
```
so the return type of the callback method is void. Is this possible using the generic type func? | 2011/12/07 | ['https://Stackoverflow.com/questions/8414930', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/223863/'] | The `Func` family of delegates is for methods that take zero or more parameters and return a value. For methods that take zero or more parameters an don't return a value use one of the `Action` delegates. If the method has no parameters, use [the non-generic version of `Action`](http://msdn.microsoft.com/en-us/library/... | In cases where you're 'forced' to use `Func<T>`, e.g. in an internal generic API which you want to reuse, you can just define it as `new Func<object>(() => { SomeStuff(); return null; });`. |
8,414,930 | I have...
```
Func<string> del2 = new Func<string>(MyMethod);
```
and I really want to do..
```
Func<> del2 = new Func<>(MyMethod);
```
so the return type of the callback method is void. Is this possible using the generic type func? | 2011/12/07 | ['https://Stackoverflow.com/questions/8414930', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/223863/'] | The `Func` family of delegates is for methods that take zero or more parameters and return a value. For methods that take zero or more parameters an don't return a value use one of the `Action` delegates. If the method has no parameters, use [the non-generic version of `Action`](http://msdn.microsoft.com/en-us/library/... | Here is a code example using Lambda expressions instead of Action/Func delegates.
```
delegate void TestDelegate();
static void Main(string[] args)
{
TestDelegate testDelegate = () => { /*your code*/; };
testDelegate();
}
``` |
9,247,730 | My question concerns writing JAXB plugins, in particular JAXB codemodel.
What is the role of `ClassOutline` (and it's [companions](http://www.docjar.com/docs/api/com/sun/tools/internal/xjc/outline/package-index.html)) and `JClass` (and [companions](http://codemodel.java.net/nonav/apidocs/com/sun/codemodel/package-summ... | 2012/02/12 | ['https://Stackoverflow.com/questions/9247730', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/267197/'] | Oh, oh, someone is interested in XJC internals. I might be of some help since I've probably developed more JAXB plugins than anyone else (see [JAXB2 Basics](https://github.com/highsource/jaxb2-basics) for instance)
Ok, let's start. In XJC the schema compiler does approximately following
* Parses the schema
* Creates ... | (This is to answer your further questions.)
Yes, it is possible to check customizations. [Here is](https://svn.java.net/svn/jaxb2-commons~svn/basics/trunk/tools/src/main/java/org/jvnet/jaxb2_commons/util/CustomizationUtils.java) a class I am using to access customizations.
The trick is that reference properties don't... |
5,861,428 | In lots of Linux programs, like curl, wget, and anything with a progress meter, they have the bottom line constantly update, every certain amount of time. How do I do that in a bash script? All I can do now is just echo a new line, and that's not what I want because it builds up. I did come across something that mentio... | 2011/05/02 | ['https://Stackoverflow.com/questions/5861428', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/689317/'] | Small variation on linuts' code sample to move the cursor not to the beginning, but the end of the current line.
```
{
for pc in {1..100}; do
#echo -ne "$pc%\033[0K\r"
echo -ne "\r\033[0K${pc}%"
sleep 1
done
echo
}
``` | man terminfo(5) and look at the "cap-nam" column.
```
clr_eol=$(tput el)
while true
do
printf "${clr_eol}your message here\r"
sleep 60
done
``` |
5,861,428 | In lots of Linux programs, like curl, wget, and anything with a progress meter, they have the bottom line constantly update, every certain amount of time. How do I do that in a bash script? All I can do now is just echo a new line, and that's not what I want because it builds up. I did come across something that mentio... | 2011/05/02 | ['https://Stackoverflow.com/questions/5861428', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/689317/'] | You can also use `tput cuu1;tput el` (or `printf '\e[A\e[K'`) to move the cursor up one line and erase the line:
```
for i in {1..100};do echo $i;sleep 1;tput cuu1;tput el;done
``` | `printf '\r'`, usually. There's no reason for cursor addressing in this case. |
5,861,428 | In lots of Linux programs, like curl, wget, and anything with a progress meter, they have the bottom line constantly update, every certain amount of time. How do I do that in a bash script? All I can do now is just echo a new line, and that's not what I want because it builds up. I did come across something that mentio... | 2011/05/02 | ['https://Stackoverflow.com/questions/5861428', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/689317/'] | Small variation on linuts' code sample to move the cursor not to the beginning, but the end of the current line.
```
{
for pc in {1..100}; do
#echo -ne "$pc%\033[0K\r"
echo -ne "\r\033[0K${pc}%"
sleep 1
done
echo
}
``` | `printf '\r'`, usually. There's no reason for cursor addressing in this case. |
5,861,428 | In lots of Linux programs, like curl, wget, and anything with a progress meter, they have the bottom line constantly update, every certain amount of time. How do I do that in a bash script? All I can do now is just echo a new line, and that's not what I want because it builds up. I did come across something that mentio... | 2011/05/02 | ['https://Stackoverflow.com/questions/5861428', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/689317/'] | ```
{
for pc in $(seq 1 100); do
echo -ne "$pc%\033[0K\r"
usleep 100000
done
echo
}
```
The "\033[0K" will delete to the end of the line - in case your progress line gets shorter at some point, although this may not be necessary for your purposes.
The "\r" will move the cursor to the beginning of the c... | man terminfo(5) and look at the "cap-nam" column.
```
clr_eol=$(tput el)
while true
do
printf "${clr_eol}your message here\r"
sleep 60
done
``` |
5,861,428 | In lots of Linux programs, like curl, wget, and anything with a progress meter, they have the bottom line constantly update, every certain amount of time. How do I do that in a bash script? All I can do now is just echo a new line, and that's not what I want because it builds up. I did come across something that mentio... | 2011/05/02 | ['https://Stackoverflow.com/questions/5861428', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/689317/'] | To actually erase *previous* lines, not just the current line, you can use the following bash functions:
```
# Clears the entire current line regardless of terminal size.
# See the magic by running:
# { sleep 1; clear_this_line ; }&
clear_this_line(){
printf '\r'
cols="$(tput cols)"
for i in $(... | man terminfo(5) and look at the "cap-nam" column.
```
clr_eol=$(tput el)
while true
do
printf "${clr_eol}your message here\r"
sleep 60
done
``` |
5,861,428 | In lots of Linux programs, like curl, wget, and anything with a progress meter, they have the bottom line constantly update, every certain amount of time. How do I do that in a bash script? All I can do now is just echo a new line, and that's not what I want because it builds up. I did come across something that mentio... | 2011/05/02 | ['https://Stackoverflow.com/questions/5861428', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/689317/'] | ```
{
for pc in $(seq 1 100); do
echo -ne "$pc%\033[0K\r"
usleep 100000
done
echo
}
```
The "\033[0K" will delete to the end of the line - in case your progress line gets shorter at some point, although this may not be necessary for your purposes.
The "\r" will move the cursor to the beginning of the c... | `printf '\r'`, usually. There's no reason for cursor addressing in this case. |
5,861,428 | In lots of Linux programs, like curl, wget, and anything with a progress meter, they have the bottom line constantly update, every certain amount of time. How do I do that in a bash script? All I can do now is just echo a new line, and that's not what I want because it builds up. I did come across something that mentio... | 2011/05/02 | ['https://Stackoverflow.com/questions/5861428', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/689317/'] | ```
{
for pc in $(seq 1 100); do
echo -ne "$pc%\033[0K\r"
usleep 100000
done
echo
}
```
The "\033[0K" will delete to the end of the line - in case your progress line gets shorter at some point, although this may not be necessary for your purposes.
The "\r" will move the cursor to the beginning of the c... | To actually erase *previous* lines, not just the current line, you can use the following bash functions:
```
# Clears the entire current line regardless of terminal size.
# See the magic by running:
# { sleep 1; clear_this_line ; }&
clear_this_line(){
printf '\r'
cols="$(tput cols)"
for i in $(... |
5,861,428 | In lots of Linux programs, like curl, wget, and anything with a progress meter, they have the bottom line constantly update, every certain amount of time. How do I do that in a bash script? All I can do now is just echo a new line, and that's not what I want because it builds up. I did come across something that mentio... | 2011/05/02 | ['https://Stackoverflow.com/questions/5861428', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/689317/'] | You can also use `tput cuu1;tput el` (or `printf '\e[A\e[K'`) to move the cursor up one line and erase the line:
```
for i in {1..100};do echo $i;sleep 1;tput cuu1;tput el;done
``` | To actually erase *previous* lines, not just the current line, you can use the following bash functions:
```
# Clears the entire current line regardless of terminal size.
# See the magic by running:
# { sleep 1; clear_this_line ; }&
clear_this_line(){
printf '\r'
cols="$(tput cols)"
for i in $(... |
5,861,428 | In lots of Linux programs, like curl, wget, and anything with a progress meter, they have the bottom line constantly update, every certain amount of time. How do I do that in a bash script? All I can do now is just echo a new line, and that's not what I want because it builds up. I did come across something that mentio... | 2011/05/02 | ['https://Stackoverflow.com/questions/5861428', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/689317/'] | ```
{
for pc in $(seq 1 100); do
echo -ne "$pc%\033[0K\r"
usleep 100000
done
echo
}
```
The "\033[0K" will delete to the end of the line - in case your progress line gets shorter at some point, although this may not be necessary for your purposes.
The "\r" will move the cursor to the beginning of the c... | Small variation on linuts' code sample to move the cursor not to the beginning, but the end of the current line.
```
{
for pc in {1..100}; do
#echo -ne "$pc%\033[0K\r"
echo -ne "\r\033[0K${pc}%"
sleep 1
done
echo
}
``` |
5,861,428 | In lots of Linux programs, like curl, wget, and anything with a progress meter, they have the bottom line constantly update, every certain amount of time. How do I do that in a bash script? All I can do now is just echo a new line, and that's not what I want because it builds up. I did come across something that mentio... | 2011/05/02 | ['https://Stackoverflow.com/questions/5861428', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/689317/'] | ```
{
for pc in $(seq 1 100); do
echo -ne "$pc%\033[0K\r"
usleep 100000
done
echo
}
```
The "\033[0K" will delete to the end of the line - in case your progress line gets shorter at some point, although this may not be necessary for your purposes.
The "\r" will move the cursor to the beginning of the c... | You can also use `tput cuu1;tput el` (or `printf '\e[A\e[K'`) to move the cursor up one line and erase the line:
```
for i in {1..100};do echo $i;sleep 1;tput cuu1;tput el;done
``` |
17,572,348 | According to <http://guides.rubyonrails.org/routing.html>:
```
HTTP Verb Path Action Used for
GET /photos index display a list of all photos
GET /photos/new new return an HTML form for creating a new photo
POST /photos create create a new photo
GET /photos/:id show display a specific phot... | 2013/07/10 | ['https://Stackoverflow.com/questions/17572348', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2542493/'] | Rails figures out which method to call based on whether the form submitted is a form for a new record that has not yet been saved or for a record that already exists in the database. | Read about "resource routing" in the document you referenced at the top of your post.
Also, run `rake routes` to see how rails is currently configured to route. |
17,572,348 | According to <http://guides.rubyonrails.org/routing.html>:
```
HTTP Verb Path Action Used for
GET /photos index display a list of all photos
GET /photos/new new return an HTML form for creating a new photo
POST /photos create create a new photo
GET /photos/:id show display a specific phot... | 2013/07/10 | ['https://Stackoverflow.com/questions/17572348', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2542493/'] | Read about "resource routing" in the document you referenced at the top of your post.
Also, run `rake routes` to see how rails is currently configured to route. | In The Terminal Type:
```
$rake routes
```
and hit enter
Prefix Verb URI Pattern Controller#Action
root GET / welcome#index |
17,572,348 | According to <http://guides.rubyonrails.org/routing.html>:
```
HTTP Verb Path Action Used for
GET /photos index display a list of all photos
GET /photos/new new return an HTML form for creating a new photo
POST /photos create create a new photo
GET /photos/:id show display a specific phot... | 2013/07/10 | ['https://Stackoverflow.com/questions/17572348', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2542493/'] | Rails figures out which method to call based on whether the form submitted is a form for a new record that has not yet been saved or for a record that already exists in the database. | In The Terminal Type:
```
$rake routes
```
and hit enter
Prefix Verb URI Pattern Controller#Action
root GET / welcome#index |
425,937 | I leanred, if all partial derivatives exist and all are continuous, then it is differentiable. Am I wrong?
I tried same way for this problem, I think it is differentiable because
all the derivative exist and are continuous.
However, it is not differentiable at 0.
Why is it the case?
\to (0,0)}\left|\frac{f(x,y)-\nabla f(x,y)\cdot (x-y) }{\lVert (x,y)\rVert}\right|$$
This is $$\lim\_{(x,y)\to (0,0)}\left|\frac{xy}{x... | For the first one.
if $y = ax$,
$\dfrac{xy}{\sqrt{x^2+y^2}}
=\dfrac{ax^2}{\sqrt{x^2+a^2x^2}}
=\dfrac{a}{\sqrt{1+a^2}}
$,
so the function is not even continuous
at $(0, 0)$.
(This is, of course, not original.) |
4,261,219 | I've been tinkering around trying to make an AI player for the popular card game, Dominion (http://www.boardgamegeek.com/boardgame/36218/dominion).
If you are not familiar with the game, it is basically a very streamlined cousin of Magic: The Gathering, where there is a large-ish library of cards with different rules ... | 2010/11/23 | ['https://Stackoverflow.com/questions/4261219', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/409020/'] | I would lean toward encapsulating the behaviour of a card as its own class, allowing easily for cards that have multiple behaviours (i.e. choices). It would also allow you to write parameterizable behaviours and mix and match them with cards.
So cards would contain things like the cost of the card, when it can be play... | I'm not familiar with all the variations of cards in Dominion, but the idea of writing a class for each one seems burdensome. Ideally, you would want to create a general card class that encapsulated all the variations of instructions on the card, and then load the particular values for a given card into that general cl... |
4,261,219 | I've been tinkering around trying to make an AI player for the popular card game, Dominion (http://www.boardgamegeek.com/boardgame/36218/dominion).
If you are not familiar with the game, it is basically a very streamlined cousin of Magic: The Gathering, where there is a large-ish library of cards with different rules ... | 2010/11/23 | ['https://Stackoverflow.com/questions/4261219', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/409020/'] | there are several "correct" OOP designs for this, depending on *how you want to model the game process and the game-playing-agent's AI*
personally, i would take the minimum number of cards for a valid *round* in the game and implement those as instances of a Card class, and implement the players as instances of an Age... | I'm not familiar with all the variations of cards in Dominion, but the idea of writing a class for each one seems burdensome. Ideally, you would want to create a general card class that encapsulated all the variations of instructions on the card, and then load the particular values for a given card into that general cl... |
4,261,219 | I've been tinkering around trying to make an AI player for the popular card game, Dominion (http://www.boardgamegeek.com/boardgame/36218/dominion).
If you are not familiar with the game, it is basically a very streamlined cousin of Magic: The Gathering, where there is a large-ish library of cards with different rules ... | 2010/11/23 | ['https://Stackoverflow.com/questions/4261219', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/409020/'] | I would lean toward encapsulating the behaviour of a card as its own class, allowing easily for cards that have multiple behaviours (i.e. choices). It would also allow you to write parameterizable behaviours and mix and match them with cards.
So cards would contain things like the cost of the card, when it can be play... | I've been thinking about the logic for a non-AI version of Dominion, and it's still a mess to figure out.
You almost have to have a class for each card deck and an interface for each card type, keeping in mind that cards may have multiple types (such as Great Hall which is both Action and Victory).
At present, all At... |
4,261,219 | I've been tinkering around trying to make an AI player for the popular card game, Dominion (http://www.boardgamegeek.com/boardgame/36218/dominion).
If you are not familiar with the game, it is basically a very streamlined cousin of Magic: The Gathering, where there is a large-ish library of cards with different rules ... | 2010/11/23 | ['https://Stackoverflow.com/questions/4261219', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/409020/'] | there are several "correct" OOP designs for this, depending on *how you want to model the game process and the game-playing-agent's AI*
personally, i would take the minimum number of cards for a valid *round* in the game and implement those as instances of a Card class, and implement the players as instances of an Age... | I've been thinking about the logic for a non-AI version of Dominion, and it's still a mess to figure out.
You almost have to have a class for each card deck and an interface for each card type, keeping in mind that cards may have multiple types (such as Great Hall which is both Action and Victory).
At present, all At... |
4,261,219 | I've been tinkering around trying to make an AI player for the popular card game, Dominion (http://www.boardgamegeek.com/boardgame/36218/dominion).
If you are not familiar with the game, it is basically a very streamlined cousin of Magic: The Gathering, where there is a large-ish library of cards with different rules ... | 2010/11/23 | ['https://Stackoverflow.com/questions/4261219', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/409020/'] | I would lean toward encapsulating the behaviour of a card as its own class, allowing easily for cards that have multiple behaviours (i.e. choices). It would also allow you to write parameterizable behaviours and mix and match them with cards.
So cards would contain things like the cost of the card, when it can be play... | there are several "correct" OOP designs for this, depending on *how you want to model the game process and the game-playing-agent's AI*
personally, i would take the minimum number of cards for a valid *round* in the game and implement those as instances of a Card class, and implement the players as instances of an Age... |
12,726,149 | I downloaded and configured eclipse cdt along with MinGW and able to compile c programs.
My question, how to start executing the program in command prompt when Run option clicked from eclipse. Currently it always executes the program in eclipse console.
Reason to have command prompt for executing c programs is to acc... | 2012/10/04 | ['https://Stackoverflow.com/questions/12726149', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/612465/'] | Yes.
```
select
substring(data, 1, PATINDEX('%[0-9]%',data)-1) as ename,
substring(data, PATINDEX('%[0-9]%',data), len(data)) as sal
from
table
``` | ```
SELECT SUBSTRING(@ourName, 1, CHARINDEX(' ', @ourName)) AS [First],
SUBSTRING(@ourName, CHARINDEX(' ', @ourName) + 2, LEN(@ourName)) AS[Last]
``` |
26,371,381 | Let's say I have two Tables, called Person, and Couple, where each Couple record stores a pair of Person id's (also assume that each person is bound to *at most* another different person).
I am planning to support a lot of queries where I will ask for Person records that are not married yet. Do you guys think it's wort... | 2014/10/14 | ['https://Stackoverflow.com/questions/26371381', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4143394/'] | A better option is to keep the data normalized, and utilize a view (indexed, if supported by your rdbms). This gets you the convenience of dealing with all the relevant fields in one place, without denormalizing your data.
Note: Even if a database doesn't support indexed views, you'll likely still be better off with a... | Is there always a zero to one relationship between Person and Couples? i.e. a person can have zero or one partner? If so then your `Couple` table is actually redundant, and your new field is a better approach.
The only reason to split `Couple` off to another table is if one Person can have many partners.
When someone... |
26,371,381 | Let's say I have two Tables, called Person, and Couple, where each Couple record stores a pair of Person id's (also assume that each person is bound to *at most* another different person).
I am planning to support a lot of queries where I will ask for Person records that are not married yet. Do you guys think it's wort... | 2014/10/14 | ['https://Stackoverflow.com/questions/26371381', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4143394/'] | A better option is to keep the data normalized, and utilize a view (indexed, if supported by your rdbms). This gets you the convenience of dealing with all the relevant fields in one place, without denormalizing your data.
Note: Even if a database doesn't support indexed views, you'll likely still be better off with a... | How about one table?
```
-- This is psuedo-code, the syntax is not correct, but it should
-- be clear what it's doing
CREATE TABLE Person
(
PersonId int not null
primary key
,PartnerId int null
foreign key references Person (PersonId)
)
```
With this,
* Everyone on the system has a row and a... |
26,371,381 | Let's say I have two Tables, called Person, and Couple, where each Couple record stores a pair of Person id's (also assume that each person is bound to *at most* another different person).
I am planning to support a lot of queries where I will ask for Person records that are not married yet. Do you guys think it's wort... | 2014/10/14 | ['https://Stackoverflow.com/questions/26371381', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4143394/'] | A better option is to keep the data normalized, and utilize a view (indexed, if supported by your rdbms). This gets you the convenience of dealing with all the relevant fields in one place, without denormalizing your data.
Note: Even if a database doesn't support indexed views, you'll likely still be better off with a... | I agree with Nick. Also consider the need for history of the couples. You could use row versioning in the same table, but this doesn't work very well for application databases, works best in a in a DW scenario. A history table in theory would duplicate all the data in the table, not just the relationship. A secondary t... |
26,371,381 | Let's say I have two Tables, called Person, and Couple, where each Couple record stores a pair of Person id's (also assume that each person is bound to *at most* another different person).
I am planning to support a lot of queries where I will ask for Person records that are not married yet. Do you guys think it's wort... | 2014/10/14 | ['https://Stackoverflow.com/questions/26371381', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4143394/'] | Is there always a zero to one relationship between Person and Couples? i.e. a person can have zero or one partner? If so then your `Couple` table is actually redundant, and your new field is a better approach.
The only reason to split `Couple` off to another table is if one Person can have many partners.
When someone... | How about one table?
```
-- This is psuedo-code, the syntax is not correct, but it should
-- be clear what it's doing
CREATE TABLE Person
(
PersonId int not null
primary key
,PartnerId int null
foreign key references Person (PersonId)
)
```
With this,
* Everyone on the system has a row and a... |
26,371,381 | Let's say I have two Tables, called Person, and Couple, where each Couple record stores a pair of Person id's (also assume that each person is bound to *at most* another different person).
I am planning to support a lot of queries where I will ask for Person records that are not married yet. Do you guys think it's wort... | 2014/10/14 | ['https://Stackoverflow.com/questions/26371381', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4143394/'] | Is there always a zero to one relationship between Person and Couples? i.e. a person can have zero or one partner? If so then your `Couple` table is actually redundant, and your new field is a better approach.
The only reason to split `Couple` off to another table is if one Person can have many partners.
When someone... | I agree with Nick. Also consider the need for history of the couples. You could use row versioning in the same table, but this doesn't work very well for application databases, works best in a in a DW scenario. A history table in theory would duplicate all the data in the table, not just the relationship. A secondary t... |
70,342,429 | I trying to change the color of the chevron indicator that appears on the section headers in a List view likest one shown here:
[](https://i.stack.imgur.com/paNRA.png)
I tried to do that by setting the tint color on the list view:
```
List {
...
}
... | 2021/12/14 | ['https://Stackoverflow.com/questions/70342429', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/728246/'] | You haven't provided much code but some change with `accentColor` instead of `tint` | The chevron can't react on any color changing modifiers.
You have to disable standard chevron and use own, custom, (behaviour of the List is the same), like below
```js
HStack {
Text(text)
NavigationLink(destination: Text("D")) { EmptyView() } // disabled !
Image(systemName: "chevron.right") ... |
18,274,428 | I'm tried to deploy a new version of my app to heroku. The deployment fails because heroku says, that the gem pg is not in my GEMFILE ... I have this postgres gem in my GEMFILE. I also looked for some answers, but no one worked ... As anyone an idea?
I use Ruby 2.0.0p247, Rails 3.2.14 refinery-cms 2.1.0
Here is my Ge... | 2013/08/16 | ['https://Stackoverflow.com/questions/18274428', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1458773/'] | according to the gemfile:
```
# Postgres support (added for Heroku)
#gem 'pg'
```
pg is commented-out. uncomment it to install it
```
gem 'pg'
```
In my gemfile for instance, I work in windows, and heroku doesn't. So I have
```
gem "pg", '~> 0.15.1', :group => :production
group :development, :test do
gem 'p... | The problem is that you have the pg gem in the production group. Therefore when assets are precompiled on Heroku (which uses the global group + assets group) then the PG gem cannot indeed be found because it's in the production group.
I would suggest having the pg gem in the global group and available to allow asset g... |
18,274,428 | I'm tried to deploy a new version of my app to heroku. The deployment fails because heroku says, that the gem pg is not in my GEMFILE ... I have this postgres gem in my GEMFILE. I also looked for some answers, but no one worked ... As anyone an idea?
I use Ruby 2.0.0p247, Rails 3.2.14 refinery-cms 2.1.0
Here is my Ge... | 2013/08/16 | ['https://Stackoverflow.com/questions/18274428', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1458773/'] | according to the gemfile:
```
# Postgres support (added for Heroku)
#gem 'pg'
```
pg is commented-out. uncomment it to install it
```
gem 'pg'
```
In my gemfile for instance, I work in windows, and heroku doesn't. So I have
```
gem "pg", '~> 0.15.1', :group => :production
group :development, :test do
gem 'p... | Oh no ... the solution was to delete my git repo and create a new one. I don't know why, but my repo got messed up (I added new files and so on ..) and so it didn't commit all data. After the tip of chucknelson I tried to lock a certain rails version and saw that heroku didn't get this. |
18,274,428 | I'm tried to deploy a new version of my app to heroku. The deployment fails because heroku says, that the gem pg is not in my GEMFILE ... I have this postgres gem in my GEMFILE. I also looked for some answers, but no one worked ... As anyone an idea?
I use Ruby 2.0.0p247, Rails 3.2.14 refinery-cms 2.1.0
Here is my Ge... | 2013/08/16 | ['https://Stackoverflow.com/questions/18274428', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1458773/'] | The problem is that you have the pg gem in the production group. Therefore when assets are precompiled on Heroku (which uses the global group + assets group) then the PG gem cannot indeed be found because it's in the production group.
I would suggest having the pg gem in the global group and available to allow asset g... | Oh no ... the solution was to delete my git repo and create a new one. I don't know why, but my repo got messed up (I added new files and so on ..) and so it didn't commit all data. After the tip of chucknelson I tried to lock a certain rails version and saw that heroku didn't get this. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.