qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
9,600,499
I got a calendar which I want to take birthday of user. Its `id` is "DatePicker" ``` var tarih = new Date(); tarih =($("#DatePicker").val()); alert(tarih); ``` When I run this code I get the date from calendar. The problem occurs when I try to get year which is selected at calendar: ``` var tarih = new Date(); tar...
2012/03/07
[ "https://Stackoverflow.com/questions/9600499", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1193477/" ]
You can specify User Settings to store some information. In the Solution Explorer go to your project and in the folder Properties, double-click the settings-file. In here you can set the Name, Type, Scope and Value. Just set the Name to "FileName", Type to "string", scope to "User" and leave the Value empty or set a de...
Usually there are three location available for this kind of configuration. ``` Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); ``` The first is t...
726,016
I am wondering if there is a way to measure bandwidth by a tcp/udp port under Linux? Means I search for a way to be able to tell, tcp/53 needs now 1MBit/s, tcp/80 needs now 4.5MBit/s. iperf is able to tell me this details, but my issue is I need it in shell/bash to extract the data for later use.
2015/10/01
[ "https://serverfault.com/questions/726016", "https://serverfault.com", "https://serverfault.com/users/295469/" ]
i would recommend [darkstat](https://unix4lyfe.org/darkstat/), a description on how to is [available here](http://www.linuxfocus.org/English/September2004/article346.shtml)
Just for completeness, the best and easiest way to monitor bandwidth per port or bunch of ports under Linux, is to use `tc` to setup QoS. You can use FireQoS - a high level tool for configuring QoS - and netdata for monitoring it in real-time. Check this for more information: <https://github.com/firehol/netdata/wiki/...
30,917
Even when following strict security protocols, and what the user typed is (in this hypothetical situation) completely impossible to derive, the key that the server needs to compare to is still there. And even if that weren't the case, the server admin or someone with that ability could just access the account directly ...
2013/02/14
[ "https://security.stackexchange.com/questions/30917", "https://security.stackexchange.com", "https://security.stackexchange.com/users/20778/" ]
Yes. For more analysis, see [this blog post](http://security.blogoverflow.com/2011/11/why-passwords-should-be-hashed/): we store hashed passwords because *partial*, read-only breaches happen (if only through a mislaid backup tape) and we do not want attackers to be able to immediately escalate this breach into full rea...
> > Is the only reason for hashing to protect user's accounts on other sites in the event of a compromise? > > > No, that's not the only reason. It's also to protect the account on **your own site** from being accessed by someone who should not have access. Let's say your site was vulnerable to an SQL injection a...
30,917
Even when following strict security protocols, and what the user typed is (in this hypothetical situation) completely impossible to derive, the key that the server needs to compare to is still there. And even if that weren't the case, the server admin or someone with that ability could just access the account directly ...
2013/02/14
[ "https://security.stackexchange.com/questions/30917", "https://security.stackexchange.com", "https://security.stackexchange.com/users/20778/" ]
Yes. For more analysis, see [this blog post](http://security.blogoverflow.com/2011/11/why-passwords-should-be-hashed/): we store hashed passwords because *partial*, read-only breaches happen (if only through a mislaid backup tape) and we do not want attackers to be able to immediately escalate this breach into full rea...
Hashing the password protects you in cases where your infrastructure is not as secure as you think. Despite your best efforts, you *will* get hacked at some point in your IT career. Your strategy then shifts from prevention (which didn't work in at least this one case) to damage control and disaster recovery. Part of ...
30,917
Even when following strict security protocols, and what the user typed is (in this hypothetical situation) completely impossible to derive, the key that the server needs to compare to is still there. And even if that weren't the case, the server admin or someone with that ability could just access the account directly ...
2013/02/14
[ "https://security.stackexchange.com/questions/30917", "https://security.stackexchange.com", "https://security.stackexchange.com/users/20778/" ]
Yes. For more analysis, see [this blog post](http://security.blogoverflow.com/2011/11/why-passwords-should-be-hashed/): we store hashed passwords because *partial*, read-only breaches happen (if only through a mislaid backup tape) and we do not want attackers to be able to immediately escalate this breach into full rea...
As the others mentioned, a hashed (non-reversible) password is better because you can look at the database without the disclosure of the users password and slow down an attacker. But there are some other points that are possible when the password is only known by the account owner. You can encrypt the data with a rand...
30,917
Even when following strict security protocols, and what the user typed is (in this hypothetical situation) completely impossible to derive, the key that the server needs to compare to is still there. And even if that weren't the case, the server admin or someone with that ability could just access the account directly ...
2013/02/14
[ "https://security.stackexchange.com/questions/30917", "https://security.stackexchange.com", "https://security.stackexchange.com/users/20778/" ]
Yes. For more analysis, see [this blog post](http://security.blogoverflow.com/2011/11/why-passwords-should-be-hashed/): we store hashed passwords because *partial*, read-only breaches happen (if only through a mislaid backup tape) and we do not want attackers to be able to immediately escalate this breach into full rea...
You cannot think of a compromise as being a simple state of either your compromised or your not. There are different levels of compromise and and different levels of protection to either limit the compromise or alert you to when you have been compromised. While we appear to be seeing an increase in active, targetted 'c...
30,917
Even when following strict security protocols, and what the user typed is (in this hypothetical situation) completely impossible to derive, the key that the server needs to compare to is still there. And even if that weren't the case, the server admin or someone with that ability could just access the account directly ...
2013/02/14
[ "https://security.stackexchange.com/questions/30917", "https://security.stackexchange.com", "https://security.stackexchange.com/users/20778/" ]
> > Is the only reason for hashing to protect user's accounts on other sites in the event of a compromise? > > > No, that's not the only reason. It's also to protect the account on **your own site** from being accessed by someone who should not have access. Let's say your site was vulnerable to an SQL injection a...
As the others mentioned, a hashed (non-reversible) password is better because you can look at the database without the disclosure of the users password and slow down an attacker. But there are some other points that are possible when the password is only known by the account owner. You can encrypt the data with a rand...
30,917
Even when following strict security protocols, and what the user typed is (in this hypothetical situation) completely impossible to derive, the key that the server needs to compare to is still there. And even if that weren't the case, the server admin or someone with that ability could just access the account directly ...
2013/02/14
[ "https://security.stackexchange.com/questions/30917", "https://security.stackexchange.com", "https://security.stackexchange.com/users/20778/" ]
> > Is the only reason for hashing to protect user's accounts on other sites in the event of a compromise? > > > No, that's not the only reason. It's also to protect the account on **your own site** from being accessed by someone who should not have access. Let's say your site was vulnerable to an SQL injection a...
You cannot think of a compromise as being a simple state of either your compromised or your not. There are different levels of compromise and and different levels of protection to either limit the compromise or alert you to when you have been compromised. While we appear to be seeing an increase in active, targetted 'c...
30,917
Even when following strict security protocols, and what the user typed is (in this hypothetical situation) completely impossible to derive, the key that the server needs to compare to is still there. And even if that weren't the case, the server admin or someone with that ability could just access the account directly ...
2013/02/14
[ "https://security.stackexchange.com/questions/30917", "https://security.stackexchange.com", "https://security.stackexchange.com/users/20778/" ]
Hashing the password protects you in cases where your infrastructure is not as secure as you think. Despite your best efforts, you *will* get hacked at some point in your IT career. Your strategy then shifts from prevention (which didn't work in at least this one case) to damage control and disaster recovery. Part of ...
As the others mentioned, a hashed (non-reversible) password is better because you can look at the database without the disclosure of the users password and slow down an attacker. But there are some other points that are possible when the password is only known by the account owner. You can encrypt the data with a rand...
30,917
Even when following strict security protocols, and what the user typed is (in this hypothetical situation) completely impossible to derive, the key that the server needs to compare to is still there. And even if that weren't the case, the server admin or someone with that ability could just access the account directly ...
2013/02/14
[ "https://security.stackexchange.com/questions/30917", "https://security.stackexchange.com", "https://security.stackexchange.com/users/20778/" ]
Hashing the password protects you in cases where your infrastructure is not as secure as you think. Despite your best efforts, you *will* get hacked at some point in your IT career. Your strategy then shifts from prevention (which didn't work in at least this one case) to damage control and disaster recovery. Part of ...
You cannot think of a compromise as being a simple state of either your compromised or your not. There are different levels of compromise and and different levels of protection to either limit the compromise or alert you to when you have been compromised. While we appear to be seeing an increase in active, targetted 'c...
30,917
Even when following strict security protocols, and what the user typed is (in this hypothetical situation) completely impossible to derive, the key that the server needs to compare to is still there. And even if that weren't the case, the server admin or someone with that ability could just access the account directly ...
2013/02/14
[ "https://security.stackexchange.com/questions/30917", "https://security.stackexchange.com", "https://security.stackexchange.com/users/20778/" ]
As the others mentioned, a hashed (non-reversible) password is better because you can look at the database without the disclosure of the users password and slow down an attacker. But there are some other points that are possible when the password is only known by the account owner. You can encrypt the data with a rand...
You cannot think of a compromise as being a simple state of either your compromised or your not. There are different levels of compromise and and different levels of protection to either limit the compromise or alert you to when you have been compromised. While we appear to be seeing an increase in active, targetted 'c...
2,607,122
A covering map $p: X \to Y$ is said to be **regular** if for a point $x \in p^{-1}(y)$ we have $p\_\*(\pi\_1(X,x)) \lhd \pi\_1(Y,y)$. Now my notes say that this condition is independent of the choice of the point $x \in p^{-1}(y)$ but I don't understand exactly why. Could you please explain this to me? Thank you.
2018/01/16
[ "https://math.stackexchange.com/questions/2607122", "https://math.stackexchange.com", "https://math.stackexchange.com/users/395099/" ]
[I assume $X$ is path-connected, which is needed for this statement to be true.] The subgroups $p\_\*(\pi\_1(X,x'))$ for different choices of $x'\in p^{-1}(y)$ are exactly the conjugates of $p\_\*(\pi\_1(X,x))$. Indeed, if you pick a path $\gamma$ from $x$ to $x'$, then you get an isomorphism from $\pi\_1(X,x)$ to $\p...
There is a purely algebraic theory: a morphism $p: H \to G$ of groupoids is called a *covering morphism* if for all objects $x$ of $H$ and element $g$ of $G$ starting at $p(x)$ there is a unique element $h$ of $H$ starting at $x$ and such that $p(h)=g$. An element $g$ of a groupoid is called a *loop* if it starts and...
318,869
In most languages (I know of), people say their age with a construction like "I have X years". In English, however, you say how old you are instead. So I'm curious about what is it about the logic of English that makes this sound more natural than "I have X years". All I can find is that "this is just cultural/this is ...
2022/07/14
[ "https://ell.stackexchange.com/questions/318869", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/30946/" ]
Note that there is at least one context in which one can **have** years in English: when they are years **of** something. (Laurel already brought up another, different sense.) For example, someone can “[have ten years of experience.](https://english.stackexchange.com/questions/180836/ten-years-of-experience,)” or “fift...
Incuriously, all you could find was "this is just cultural/ how the language evolved" because that's all there is to it: this is about the nature of language, not logic. The French say "I have Y years” because theirs is a Romance language, based on Latin. The English use “I am Y years old” because like modern German, ...
318,869
In most languages (I know of), people say their age with a construction like "I have X years". In English, however, you say how old you are instead. So I'm curious about what is it about the logic of English that makes this sound more natural than "I have X years". All I can find is that "this is just cultural/this is ...
2022/07/14
[ "https://ell.stackexchange.com/questions/318869", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/30946/" ]
Note that there is at least one context in which one can **have** years in English: when they are years **of** something. (Laurel already brought up another, different sense.) For example, someone can “[have ten years of experience.](https://english.stackexchange.com/questions/180836/ten-years-of-experience,)” or “fift...
This fits a general pattern --------------------------- Rather than being specific to the concept of age, this usage follows a general pattern in English in which adjectives / qualities of a noun are often expressed as 'states of being' when in a Romance language they would often be expressed as qualities that the nou...
318,869
In most languages (I know of), people say their age with a construction like "I have X years". In English, however, you say how old you are instead. So I'm curious about what is it about the logic of English that makes this sound more natural than "I have X years". All I can find is that "this is just cultural/this is ...
2022/07/14
[ "https://ell.stackexchange.com/questions/318869", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/30946/" ]
There is no logic. In fact English used to be a language where you could use either *be* or *have* to express specific ages: > > [I]n Latin we find *sum, esse, fui* 'be' to express age (see *fuit* in (19)), whereas in Italian, which is a descendant of Latin, only AVERE 'have' is used, e.g. ho trenta anni (I-have thir...
This fits a general pattern --------------------------- Rather than being specific to the concept of age, this usage follows a general pattern in English in which adjectives / qualities of a noun are often expressed as 'states of being' when in a Romance language they would often be expressed as qualities that the nou...
318,869
In most languages (I know of), people say their age with a construction like "I have X years". In English, however, you say how old you are instead. So I'm curious about what is it about the logic of English that makes this sound more natural than "I have X years". All I can find is that "this is just cultural/this is ...
2022/07/14
[ "https://ell.stackexchange.com/questions/318869", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/30946/" ]
Here's a much closer model: > > How tall is it? It's 50 metres tall. > > > > > How long is it? It's two miles long. > > > > > How long is it? It's 40 minutes long. > > > > > **How old are you? I'm 31 years old.** > > > This doesn't work for all adjectives, only ones of dimension. Even other easily ...
There is no logic. In fact English used to be a language where you could use either *be* or *have* to express specific ages: > > [I]n Latin we find *sum, esse, fui* 'be' to express age (see *fuit* in (19)), whereas in Italian, which is a descendant of Latin, only AVERE 'have' is used, e.g. ho trenta anni (I-have thir...
318,869
In most languages (I know of), people say their age with a construction like "I have X years". In English, however, you say how old you are instead. So I'm curious about what is it about the logic of English that makes this sound more natural than "I have X years". All I can find is that "this is just cultural/this is ...
2022/07/14
[ "https://ell.stackexchange.com/questions/318869", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/30946/" ]
There is no logic. In fact English used to be a language where you could use either *be* or *have* to express specific ages: > > [I]n Latin we find *sum, esse, fui* 'be' to express age (see *fuit* in (19)), whereas in Italian, which is a descendant of Latin, only AVERE 'have' is used, e.g. ho trenta anni (I-have thir...
Incuriously, all you could find was "this is just cultural/ how the language evolved" because that's all there is to it: this is about the nature of language, not logic. The French say "I have Y years” because theirs is a Romance language, based on Latin. The English use “I am Y years old” because like modern German, ...
318,869
In most languages (I know of), people say their age with a construction like "I have X years". In English, however, you say how old you are instead. So I'm curious about what is it about the logic of English that makes this sound more natural than "I have X years". All I can find is that "this is just cultural/this is ...
2022/07/14
[ "https://ell.stackexchange.com/questions/318869", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/30946/" ]
Here's a much closer model: > > How tall is it? It's 50 metres tall. > > > > > How long is it? It's two miles long. > > > > > How long is it? It's 40 minutes long. > > > > > **How old are you? I'm 31 years old.** > > > This doesn't work for all adjectives, only ones of dimension. Even other easily ...
Note that there is at least one context in which one can **have** years in English: when they are years **of** something. (Laurel already brought up another, different sense.) For example, someone can “[have ten years of experience.](https://english.stackexchange.com/questions/180836/ten-years-of-experience,)” or “fift...
318,869
In most languages (I know of), people say their age with a construction like "I have X years". In English, however, you say how old you are instead. So I'm curious about what is it about the logic of English that makes this sound more natural than "I have X years". All I can find is that "this is just cultural/this is ...
2022/07/14
[ "https://ell.stackexchange.com/questions/318869", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/30946/" ]
Here's a much closer model: > > How tall is it? It's 50 metres tall. > > > > > How long is it? It's two miles long. > > > > > How long is it? It's 40 minutes long. > > > > > **How old are you? I'm 31 years old.** > > > This doesn't work for all adjectives, only ones of dimension. Even other easily ...
Incuriously, all you could find was "this is just cultural/ how the language evolved" because that's all there is to it: this is about the nature of language, not logic. The French say "I have Y years” because theirs is a Romance language, based on Latin. The English use “I am Y years old” because like modern German, ...
318,869
In most languages (I know of), people say their age with a construction like "I have X years". In English, however, you say how old you are instead. So I'm curious about what is it about the logic of English that makes this sound more natural than "I have X years". All I can find is that "this is just cultural/this is ...
2022/07/14
[ "https://ell.stackexchange.com/questions/318869", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/30946/" ]
Here's a much closer model: > > How tall is it? It's 50 metres tall. > > > > > How long is it? It's two miles long. > > > > > How long is it? It's 40 minutes long. > > > > > **How old are you? I'm 31 years old.** > > > This doesn't work for all adjectives, only ones of dimension. Even other easily ...
This fits a general pattern --------------------------- Rather than being specific to the concept of age, this usage follows a general pattern in English in which adjectives / qualities of a noun are often expressed as 'states of being' when in a Romance language they would often be expressed as qualities that the nou...
318,869
In most languages (I know of), people say their age with a construction like "I have X years". In English, however, you say how old you are instead. So I'm curious about what is it about the logic of English that makes this sound more natural than "I have X years". All I can find is that "this is just cultural/this is ...
2022/07/14
[ "https://ell.stackexchange.com/questions/318869", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/30946/" ]
Here's a much closer model: > > How tall is it? It's 50 metres tall. > > > > > How long is it? It's two miles long. > > > > > How long is it? It's 40 minutes long. > > > > > **How old are you? I'm 31 years old.** > > > This doesn't work for all adjectives, only ones of dimension. Even other easily ...
In Italian, which like Spanish is a Romance language, if you want to ask someone their age you will typically ask: > > [Quanti anni ***hai*** / ***ha***](https://coffeebreaklanguages.com/2019/12/quanti-anni-hai-quanti-anni-ha-how-old-are-you-coffee-break-italian-to-go-episode-4/)? > > > Which translated, literall...
318,869
In most languages (I know of), people say their age with a construction like "I have X years". In English, however, you say how old you are instead. So I'm curious about what is it about the logic of English that makes this sound more natural than "I have X years". All I can find is that "this is just cultural/this is ...
2022/07/14
[ "https://ell.stackexchange.com/questions/318869", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/30946/" ]
There is no logic. In fact English used to be a language where you could use either *be* or *have* to express specific ages: > > [I]n Latin we find *sum, esse, fui* 'be' to express age (see *fuit* in (19)), whereas in Italian, which is a descendant of Latin, only AVERE 'have' is used, e.g. ho trenta anni (I-have thir...
In Italian, which like Spanish is a Romance language, if you want to ask someone their age you will typically ask: > > [Quanti anni ***hai*** / ***ha***](https://coffeebreaklanguages.com/2019/12/quanti-anni-hai-quanti-anni-ha-how-old-are-you-coffee-break-italian-to-go-episode-4/)? > > > Which translated, literall...
42,953,754
I've just started learning bash yesterday and I need a little help. I need to make a script that will check if a file exists on co-workers computers and, if it doesn't the, script will make one. I have a general idea for that. The more important help I need is recording or logging the script to an output.txt or somethi...
2017/03/22
[ "https://Stackoverflow.com/questions/42953754", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5656813/" ]
If the intention is to retrieve all custom dimensions in a flattened form, then join with `UNNEST(customDimensions)` as well: ``` #standardSQL SELECT cd.index, cd.value FROM `xxxxx.ga_sessions_20170312`, unnest(hits) hit, unnest(hit.customDimensions) cd limit 100; ```
``` SELECT fullvisitorid, ( SELECT MAX(IF(index=1,value, NULL))FROM UNNEST(hits.customDimensions)) AS CustomDimension1, ( SELECT MAX(IF(index=2,value, NULL))FROM UNNEST(hits.customDimensions)) AS CustomDimension2 FROM `XXXXXXX`, unnest(hits) as hits ```
49,041,934
I have two variable length arrays of values, TargetName[] and TargetCpu[], which I need to return across the ENDLOCAL boundary. I've tried the following, but only the first value on the first array gets returned. ``` for /L %%i in (0,1,%MaxIndex%) do ( for /f "delims=" %%j in (""!TargetName[%%i]!"") do ( f...
2018/03/01
[ "https://Stackoverflow.com/questions/49041934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9426760/" ]
``` @echo off setlocal set "MaxIndex=6" call :CreateArrays set TargetName set TargetCPU goto :EOF :CreateArrays setlocal EnableDelayedExpansion for /L %%i in (1,1,%MaxIndex%) do ( set /A TargetName[%%i]=!random!, TargetCpu[%%i]=!random! ) rem Return the arrays to the calling scope set "currentScope=1" for /F "de...
``` set target>tempfile rem insert your endlocal here for /f "delims=" %%a in (tempfile) do set "%%a" set target ``` the first `set` will list all variable names that start `target` into a tempfile. Then execute your `endlocal` then read each line of the file, which is of the form `name=value` and execute it prefix...
28,221,852
I am having trouble archiving a row of data. The user enters text - a ServerName - that is stored in the database under the column 'ServerName'. Once the button is clicked the SQL should insert that data into the new table - archive\_servers - and then delete it from the original table, however, it will only delete the...
2015/01/29
[ "https://Stackoverflow.com/questions/28221852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4295745/" ]
``` $sql = "INSERT `archive_servers` SELECT * FROM `servers` WHERE `ServerName` = '".$_POST['name']."';"; echo $sql; $sql_delete = "DELETE FROM `servers` WHERE `ServerName` = '".$_POST['name']."';"; echo $sql_delete; $result = $db->query($sql_delete); if ($db->error) { echo $message = $db->error; } ``` With th...
You are not executing the INSERT portion. I would also recommend checking that the insert is successful before deleting the row either via a query (slower but safer) or a simple success check. ``` $sql = "INSERT `archive_servers` SELECT * FROM `servers` WHERE `ServerName` = '".$_POST['name']."';"; echo $sql; $result ...
28,221,852
I am having trouble archiving a row of data. The user enters text - a ServerName - that is stored in the database under the column 'ServerName'. Once the button is clicked the SQL should insert that data into the new table - archive\_servers - and then delete it from the original table, however, it will only delete the...
2015/01/29
[ "https://Stackoverflow.com/questions/28221852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4295745/" ]
``` $sql = "INSERT `archive_servers` SELECT * FROM `servers` WHERE `ServerName` = '".$_POST['name']."';"; echo $sql; $sql_delete = "DELETE FROM `servers` WHERE `ServerName` = '".$_POST['name']."';"; echo $sql_delete; $result = $db->query($sql_delete); if ($db->error) { echo $message = $db->error; } ``` With th...
Your first mistake is $sql = "INSERT INTO`archive_servers` SELECT \* FROM `servers` WHERE `ServerName` = '".$\_POST['name']."';";
66,629,288
Please someone who knows c for 100 years to explain to me what am I looking at here. Am I taking the right route to learning c as a career? WOW what is this I really would like to know what is going on here ``` #include <stdio.h> #include <string.h> int main() { char *checkArr[1000] = {"This is very good", ...
2021/03/14
[ "https://Stackoverflow.com/questions/66629288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14387877/" ]
`strlen()` gives you the length of a single string. So when you ``` char *checkArr[1000] = {"This is very good", ..., NULL}; int size = strlen(checkArr); ``` You are asking `strlen()` to measure an array of strings - which is not what it does. Your com...
This is prefaced by my top comments. You're replicating code. Better to add an (e.g.) `print_array` function to do the `NULL` limited printing. Note that `checkArr3` does *not* have a `NULL` terminator --- Here's some refactored code. I had replaced the `strlen` calls with the `COUNTOF` macro that I mentioned, but ...
68,317
There are ton of videos online that I like to watch but many are too slow. Often, the video plays at the speed it was recorded, but the original speaker was some intellectual who has a lot of pauses and is slow to speak. Like most videos found here: <http://videolectures.net/> How can I play these videos at a faster r...
2009/11/10
[ "https://superuser.com/questions/68317", "https://superuser.com", "https://superuser.com/users/15291/" ]
Perhaps you need to upgrade your PC. Ubuntu+text editing shouldn't be a problem for VirtualBox or VMWare. However, if you want a resource-lite distro, try Arch Linux + Xfce desktop.
I personally can get by with msysgit, which is a fork of msys, which is a fork of cygwin. Depending on what exactly you need I'd say one of those. it's unfortunate that I've noted incompatibilities between msys and msysgit. I'm not sure if there's a binary incompatibility with mingw and msysgit, but in theory they shou...
68,317
There are ton of videos online that I like to watch but many are too slow. Often, the video plays at the speed it was recorded, but the original speaker was some intellectual who has a lot of pauses and is slow to speak. Like most videos found here: <http://videolectures.net/> How can I play these videos at a faster r...
2009/11/10
[ "https://superuser.com/questions/68317", "https://superuser.com", "https://superuser.com/users/15291/" ]
Have a look at what [cygwin](http://www.cygwin.com/) can offer you for a Linux- like experience on Windows. Or: virtualize Windows (tm) inside Linux.
You may be able to tweak VirtualBox to speed it up significantly. If you have a recent CPU, you can enable VT-x (Intel) or AMD-V, and possibly also nested paging. If your processor supports both of these, you should see a significant speed increase. As mentioned by others, you could always try making linux less demandi...
68,317
There are ton of videos online that I like to watch but many are too slow. Often, the video plays at the speed it was recorded, but the original speaker was some intellectual who has a lot of pauses and is slow to speak. Like most videos found here: <http://videolectures.net/> How can I play these videos at a faster r...
2009/11/10
[ "https://superuser.com/questions/68317", "https://superuser.com", "https://superuser.com/users/15291/" ]
Have a look at what [cygwin](http://www.cygwin.com/) can offer you for a Linux- like experience on Windows. Or: virtualize Windows (tm) inside Linux.
If you want Linux on Windows without virtualization, that sounds like [coLinux](http://www.colinux.org/) to me.
68,317
There are ton of videos online that I like to watch but many are too slow. Often, the video plays at the speed it was recorded, but the original speaker was some intellectual who has a lot of pauses and is slow to speak. Like most videos found here: <http://videolectures.net/> How can I play these videos at a faster r...
2009/11/10
[ "https://superuser.com/questions/68317", "https://superuser.com", "https://superuser.com/users/15291/" ]
Did you consider using Cygwin? I didn't test this myself but there are several resources mentioning this combo: * [Get Cygwin => Rails Wiki](http://wiki.rubyonrails.org/getting-started/installation/cygwin) * [Setting up Rails on Windows with Cygwin](http://phaseshiftllc.com/archives/2008/10/02/setting-up-rails-on-wind...
I personally can get by with msysgit, which is a fork of msys, which is a fork of cygwin. Depending on what exactly you need I'd say one of those. it's unfortunate that I've noted incompatibilities between msys and msysgit. I'm not sure if there's a binary incompatibility with mingw and msysgit, but in theory they shou...
68,317
There are ton of videos online that I like to watch but many are too slow. Often, the video plays at the speed it was recorded, but the original speaker was some intellectual who has a lot of pauses and is slow to speak. Like most videos found here: <http://videolectures.net/> How can I play these videos at a faster r...
2009/11/10
[ "https://superuser.com/questions/68317", "https://superuser.com", "https://superuser.com/users/15291/" ]
Boxes are cheap, especially something to run Linux on. I have a wimpy little garage server that has only 256MB on it and it runs Ubuntu 9.04 server just fine. You can always network the filesystem so you can use *whatever* on your Win box to edit, but when you run the code, you are actually running in a Linux environme...
Download and run the [POSIX subsystem for Windows](http://en.wikipedia.org/wiki/Microsoft_POSIX_subsystem). It's kinda like Linux.
68,317
There are ton of videos online that I like to watch but many are too slow. Often, the video plays at the speed it was recorded, but the original speaker was some intellectual who has a lot of pauses and is slow to speak. Like most videos found here: <http://videolectures.net/> How can I play these videos at a faster r...
2009/11/10
[ "https://superuser.com/questions/68317", "https://superuser.com", "https://superuser.com/users/15291/" ]
Did you consider using Cygwin? I didn't test this myself but there are several resources mentioning this combo: * [Get Cygwin => Rails Wiki](http://wiki.rubyonrails.org/getting-started/installation/cygwin) * [Setting up Rails on Windows with Cygwin](http://phaseshiftllc.com/archives/2008/10/02/setting-up-rails-on-wind...
Perhaps you need to upgrade your PC. Ubuntu+text editing shouldn't be a problem for VirtualBox or VMWare. However, if you want a resource-lite distro, try Arch Linux + Xfce desktop.
68,317
There are ton of videos online that I like to watch but many are too slow. Often, the video plays at the speed it was recorded, but the original speaker was some intellectual who has a lot of pauses and is slow to speak. Like most videos found here: <http://videolectures.net/> How can I play these videos at a faster r...
2009/11/10
[ "https://superuser.com/questions/68317", "https://superuser.com", "https://superuser.com/users/15291/" ]
Boxes are cheap, especially something to run Linux on. I have a wimpy little garage server that has only 256MB on it and it runs Ubuntu 9.04 server just fine. You can always network the filesystem so you can use *whatever* on your Win box to edit, but when you run the code, you are actually running in a Linux environme...
Try [VMWare player](http://www.vmware.com/products/player/). It's free and really nice. You can drag and drop between your windows environment and Linux. It's quite easy to use aswell. I'm running Ubuntu and OpenSUSE on top of my Windows XP.
68,317
There are ton of videos online that I like to watch but many are too slow. Often, the video plays at the speed it was recorded, but the original speaker was some intellectual who has a lot of pauses and is slow to speak. Like most videos found here: <http://videolectures.net/> How can I play these videos at a faster r...
2009/11/10
[ "https://superuser.com/questions/68317", "https://superuser.com", "https://superuser.com/users/15291/" ]
I'd try to find another PC to put Ubuntu on. A relatively older one should run it fine. You can join them together and share the keyboard/mouse with win2vnc or [x2vnc](http://fredrik.hubbe.net/x2vnc.html).
If you're just looking for a "linux-like" development environment, [MSYS](http://www.mingw.org/) provides a bash shell and a good handful of development tools that run natively in Windows. Combined with MinGW, lets you compile and install plenty of open source packages. Alternatively, [Cygwin](http://cygwin.org/) prov...
68,317
There are ton of videos online that I like to watch but many are too slow. Often, the video plays at the speed it was recorded, but the original speaker was some intellectual who has a lot of pauses and is slow to speak. Like most videos found here: <http://videolectures.net/> How can I play these videos at a faster r...
2009/11/10
[ "https://superuser.com/questions/68317", "https://superuser.com", "https://superuser.com/users/15291/" ]
If you want Linux on Windows without virtualization, that sounds like [coLinux](http://www.colinux.org/) to me.
Boxes are cheap, especially something to run Linux on. I have a wimpy little garage server that has only 256MB on it and it runs Ubuntu 9.04 server just fine. You can always network the filesystem so you can use *whatever* on your Win box to edit, but when you run the code, you are actually running in a Linux environme...
68,317
There are ton of videos online that I like to watch but many are too slow. Often, the video plays at the speed it was recorded, but the original speaker was some intellectual who has a lot of pauses and is slow to speak. Like most videos found here: <http://videolectures.net/> How can I play these videos at a faster r...
2009/11/10
[ "https://superuser.com/questions/68317", "https://superuser.com", "https://superuser.com/users/15291/" ]
Have a look at what [cygwin](http://www.cygwin.com/) can offer you for a Linux- like experience on Windows. Or: virtualize Windows (tm) inside Linux.
I'd try to find another PC to put Ubuntu on. A relatively older one should run it fine. You can join them together and share the keyboard/mouse with win2vnc or [x2vnc](http://fredrik.hubbe.net/x2vnc.html).
47,247,585
I have ``` <div class="answers-form" data-id="1"> <div class="form-group"> <label> <input value="" type="checkbox" name="answer[]"> </label> </div> <span></span> </div> ``` I need to check, if input is checked, then get `div`'s `data-id`.
2017/11/12
[ "https://Stackoverflow.com/questions/47247585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8780848/" ]
You need to attach a `change` eventlistener to the checkbox, then get the parent using `closest()` and finally the data-attribute using `data()` like : ``` $('[name="answer[]"]').on('change', function() { if ( $(this).is(':checked') ) { console.log( $(this).closest('.answers-form').data('id') ); } }); ...
``` $('input[type="submit"]').on( "click", function(e) { e.preventDefault(); if( $( "input=[name='answer[]']" ).is(":checked") === true ) { var data_id = $( ".answers-form" ).attr( "data-id" ); } }); ```
47,247,585
I have ``` <div class="answers-form" data-id="1"> <div class="form-group"> <label> <input value="" type="checkbox" name="answer[]"> </label> </div> <span></span> </div> ``` I need to check, if input is checked, then get `div`'s `data-id`.
2017/11/12
[ "https://Stackoverflow.com/questions/47247585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8780848/" ]
You need to attach a `change` eventlistener to the checkbox, then get the parent using `closest()` and finally the data-attribute using `data()` like : ``` $('[name="answer[]"]').on('change', function() { if ( $(this).is(':checked') ) { console.log( $(this).closest('.answers-form').data('id') ); } }); ...
```js $(document).ready(function() { $('[name="answer[]"]').on("change",function(){ if($(this).is(':checked')){ console.log($(".answers-form").attr("data-id")) } }); }); ``` ```html <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="answers-for...
21,156,269
I'm writing a winform app that lives in the notification tray and the user can open/close it by interacting with the notifyIcon control. Whene some events happens, I need to notify the user about but the notifyIcon's BalloonTip is not enough, because I need to display a collection of messages paired with buttons, that...
2014/01/16
[ "https://Stackoverflow.com/questions/21156269", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2174240/" ]
Take a look at [this question](https://stackoverflow.com/questions/834907/single-click-to-open-menu-for-tray-icon-in-c-sharp). The `notifyIcon1_Click` displays a context menu at the mouse position. In your case you need to display a form. I think the screenshot you put shows a regular form without the title bar. So yo...
As @dburner said ``` form.ControlBox = false; form.MaximizeBox = false; form.MinimizeBox = false; form.Text = ""; ``` worked for me. However the first option doesn't give the aero feel.
20,826,331
My question is basically the same as [this SOF question](https://stackoverflow.com/questions/2132734/beforeclass-and-inheritance-order-of-execution), but deals with `@BeforeMethod` instead of `@BeforeClass` for TestNG. Does test class inheritance play a factor when determining the order that `@BeforeMethod` annotated ...
2013/12/29
[ "https://Stackoverflow.com/questions/20826331", "https://Stackoverflow.com", "https://Stackoverflow.com/users/814576/" ]
As explained in the other answers, TestNG will consider inheritance for execution order. If you prefer to make the order of the "Before" methods explicit, you can also have the child simply call the parent setup. ``` public class ChildTest extends ParentTest { @BeforeMethod public void setup() { super...
Order has nothing to do with the inheritance of the class. You can try to set the priority attribute on the `@Test` annotation. If no parameters are set in the annotation, they run in an alphabetical order. You also set a prefix to the methods according to the order you want them to run (e.g. `01_method1()`, `02_meth...
20,826,331
My question is basically the same as [this SOF question](https://stackoverflow.com/questions/2132734/beforeclass-and-inheritance-order-of-execution), but deals with `@BeforeMethod` instead of `@BeforeClass` for TestNG. Does test class inheritance play a factor when determining the order that `@BeforeMethod` annotated ...
2013/12/29
[ "https://Stackoverflow.com/questions/20826331", "https://Stackoverflow.com", "https://Stackoverflow.com/users/814576/" ]
> > If I have class A and a class B extends A and both have one @BeforeMethod method, then will the parent's (A) run before the child's (B) [...] > > > Yes, they will. `@BeforeMethod` methods will run in inheritance order - the highest superclass first, then going down the inheritance chain. `@AfterMethod` method...
Order has nothing to do with the inheritance of the class. You can try to set the priority attribute on the `@Test` annotation. If no parameters are set in the annotation, they run in an alphabetical order. You also set a prefix to the methods according to the order you want them to run (e.g. `01_method1()`, `02_meth...
20,826,331
My question is basically the same as [this SOF question](https://stackoverflow.com/questions/2132734/beforeclass-and-inheritance-order-of-execution), but deals with `@BeforeMethod` instead of `@BeforeClass` for TestNG. Does test class inheritance play a factor when determining the order that `@BeforeMethod` annotated ...
2013/12/29
[ "https://Stackoverflow.com/questions/20826331", "https://Stackoverflow.com", "https://Stackoverflow.com/users/814576/" ]
> > If I have class A and a class B extends A and both have one @BeforeMethod method, then will the parent's (A) run before the child's (B) [...] > > > Yes, they will. `@BeforeMethod` methods will run in inheritance order - the highest superclass first, then going down the inheritance chain. `@AfterMethod` method...
As explained in the other answers, TestNG will consider inheritance for execution order. If you prefer to make the order of the "Before" methods explicit, you can also have the child simply call the parent setup. ``` public class ChildTest extends ParentTest { @BeforeMethod public void setup() { super...
18,718
I'm currently going through a phase of cooking a lot of beetroot. I also love Chorizo. I was thinking of doing a Beetroot and chorizo risotto. But I'm unsure if the flavour profile would complement each other. I'm thinking of trying to balance it with balsamic vinegar and/or using red wine instead of white. In general...
2011/11/02
[ "https://cooking.stackexchange.com/questions/18718", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/2010/" ]
As you go further west from Russia the borscht often has pork sausage to replace the beef shin etc. If you like it spicy, often chorizo is then substituted for the plain/spiced/smoked pork sausage It's not everyone's ideal of a meal, but with a good dollop of sour cream it's great!
I prefer the tried and tested too, what you speak of reminds me of the [Goan pu](http://juratesrecipes.blogspot.com/2009/10/goan-sausage-puloa.html)[lao recipe](http://foodfirst.com/recipe_details.aspx?recid=208) that uses chorizo. I've seen that carrots and other veggies go well with this dish, though I've not tried b...
44,066,676
I'm getting this error because 'this' is out of scope I guess, but I can't find a way to fix it. I have tried using the fat arrow and then the function does run. But then there is the problem that I don't have a callback value that I have to use? Here is my code: ``` this.checkIfDatabaseIsLocked(function(res) { ...
2017/05/19
[ "https://Stackoverflow.com/questions/44066676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4461137/" ]
Use an arrow function here to ensure `this` remains the value you expect: ``` this.checkIfDatabaseIsLocked(res => { //If true database is locked console.log("result checkIfDatabaseIsLocked: " + res); if (res) { return; } //LockDatabase this.lockDatabase().then( resul...
You can use [arrow functions](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Functions/Arrow_functions) or bind your function with the correct context to get the correct `this` inside your function: ``` this.checkIfDatabaseIsLocked((res) => { // `this` will be bound correctly here }) ``` Or using...
73,310,918
I have a trivia app that is almost complete. It contains an array of objects (being imported from a separate JavaScript file) containing all of my questions and four possible answers. I have a function that generates a random question from that array, stores the value into a global variable called `randomQuestion` and ...
2022/08/10
[ "https://Stackoverflow.com/questions/73310918", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12441586/" ]
Since the datastax library is written in Java, the BoundStatement is expecting a Java collection. You can explicitly convert your Scala collection to a Java collection like this: ``` boundStatement.bind(new java.util.ArrayList[String](ids.asJava)) ``` Note that an implicit conversion does not work here, since the bi...
You should also be able to do: ``` boundStatement.bind().setList(0, ids.asJava) ``` Or: ``` boundStatement.bind().setList(0, ids.asJava, classOf[String]) ```
34,205,368
I've built an MMORPG that uses a MySQL database to store player related data when the user logs off. We built in a auto save timer so that all the data of every logged in user is saved to the database every 3 hours. In doing so we noticed a fatal flaw.... Due to the fact that all our database transactions are sent t...
2015/12/10
[ "https://Stackoverflow.com/questions/34205368", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5569858/" ]
You need a **database connection pool** if you're not using one already and make sure you're not locking more data than you need. If you are saving how much gold a player has, you don't need to lock the table holding the credentials. Keeping the order of events in a multi-threaded scenario is not a trivial problem, I ...
Your autosave is deterministic, meaning that you know exactly when the last one occured and when the next one would occur. I would use that somehow, along with the previously suggested idea to add a timestamp. Actually, it might be better to make the updates represent only the increments/decrements along with a user ti...
34,205,368
I've built an MMORPG that uses a MySQL database to store player related data when the user logs off. We built in a auto save timer so that all the data of every logged in user is saved to the database every 3 hours. In doing so we noticed a fatal flaw.... Due to the fact that all our database transactions are sent t...
2015/12/10
[ "https://Stackoverflow.com/questions/34205368", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5569858/" ]
You need a **database connection pool** if you're not using one already and make sure you're not locking more data than you need. If you are saving how much gold a player has, you don't need to lock the table holding the credentials. Keeping the order of events in a multi-threaded scenario is not a trivial problem, I ...
To avoid this problem in all cases you must not allow users to continue doing stuff before their last database transaction has been successfully committed. Of course that means that the DB has to be very fast -- if it can't keep the request queue below a couple of seconds worth of transactions at most, you simply have ...
145,253
I've read [How can I ask for candid feedback from my manager?](https://workplace.stackexchange.com/questions/116500/how-can-i-ask-for-candid-feedback-from-my-manager) and [How politely decline positive feedback?](https://workplace.stackexchange.com/questions/132098/how-politely-decline-positive-feedback) and concluded ...
2019/09/19
[ "https://workplace.stackexchange.com/questions/145253", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/38289/" ]
People often infer from your presentations what kind of feedback to give you. * if you present your **plans and priorities** for work on a system, they may tell you that they want you to add more things, or change the priorities. * if you present **completed work** they will generally tell you they like it, and only t...
During a demonstration, many stakeholders are likely just taking notes and checking boxes. They haven't used the tool yet, so they won't have any major points of feedback. I would suggest scheduling user testing for the sole purpose of a hands-on user operating the tool for its intended purpose and giving you feedback...
145,253
I've read [How can I ask for candid feedback from my manager?](https://workplace.stackexchange.com/questions/116500/how-can-i-ask-for-candid-feedback-from-my-manager) and [How politely decline positive feedback?](https://workplace.stackexchange.com/questions/132098/how-politely-decline-positive-feedback) and concluded ...
2019/09/19
[ "https://workplace.stackexchange.com/questions/145253", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/38289/" ]
People often infer from your presentations what kind of feedback to give you. * if you present your **plans and priorities** for work on a system, they may tell you that they want you to add more things, or change the priorities. * if you present **completed work** they will generally tell you they like it, and only t...
Just like in SE, rather than leaving your question completely open ended, go into these presentations with specific questions you have or specific areas you want feedback on. While I don't agree 100% with @JRodge01 that you should create a pain point to spark conversation, I agree that if you have points already, ask...
145,253
I've read [How can I ask for candid feedback from my manager?](https://workplace.stackexchange.com/questions/116500/how-can-i-ask-for-candid-feedback-from-my-manager) and [How politely decline positive feedback?](https://workplace.stackexchange.com/questions/132098/how-politely-decline-positive-feedback) and concluded ...
2019/09/19
[ "https://workplace.stackexchange.com/questions/145253", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/38289/" ]
People often infer from your presentations what kind of feedback to give you. * if you present your **plans and priorities** for work on a system, they may tell you that they want you to add more things, or change the priorities. * if you present **completed work** they will generally tell you they like it, and only t...
I find it useful to begin the meeting by asking each attendee what's important to them (goals / painpoints) and what they're expecting to get out of the demo. That gives me a sneak peek into their hot buttons and also allows me to reset expectations early if there's a major disconnect. It's also super handy because...
145,253
I've read [How can I ask for candid feedback from my manager?](https://workplace.stackexchange.com/questions/116500/how-can-i-ask-for-candid-feedback-from-my-manager) and [How politely decline positive feedback?](https://workplace.stackexchange.com/questions/132098/how-politely-decline-positive-feedback) and concluded ...
2019/09/19
[ "https://workplace.stackexchange.com/questions/145253", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/38289/" ]
People often infer from your presentations what kind of feedback to give you. * if you present your **plans and priorities** for work on a system, they may tell you that they want you to add more things, or change the priorities. * if you present **completed work** they will generally tell you they like it, and only t...
From my experience people just don’t have much valuable feedback ready in regards to Q&A after a presentation. Your brain is busy following the information as they are provided, making hard to give the presented concept some deeper thought. It is like back in school when you thought you understood everything after your...
145,253
I've read [How can I ask for candid feedback from my manager?](https://workplace.stackexchange.com/questions/116500/how-can-i-ask-for-candid-feedback-from-my-manager) and [How politely decline positive feedback?](https://workplace.stackexchange.com/questions/132098/how-politely-decline-positive-feedback) and concluded ...
2019/09/19
[ "https://workplace.stackexchange.com/questions/145253", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/38289/" ]
People often infer from your presentations what kind of feedback to give you. * if you present your **plans and priorities** for work on a system, they may tell you that they want you to add more things, or change the priorities. * if you present **completed work** they will generally tell you they like it, and only t...
If you present (something that looks like) a finished product, people will assume it is finished, and often that will be the only way they can imagine it looking. For many people, their reaction will either be "I like it" or "I don't like it, but I'm not sure why". Instead if you present two or three 'sketches' of alt...
187,086
I am a graduate student focused on a subdivision of theoretical physics. When I am browsing papers, I find out an interesting case about the author's name ranking: Let's assume there is a professor A (tenured) and B is a Ph.D. student supervised solely by A (which means there is no co-advising). There are plenty of pu...
2022/07/18
[ "https://academia.stackexchange.com/questions/187086", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/106321/" ]
It's because for those papers, it's the profesor who deserves the first authorship. In my field (not physics), the first author is usually the person who did most of the work and wrote the paper, so if a professor is first, it might mean they did work that would warrant the first authorship to anybody. Expecting profe...
Customs differ between disciplines. In pure Mathematics, author lists tend to be strictly alphabetically ordered. In Computer Science, your ordering is used. If the professor's name comes after the student's in alphabetical order, it might be that the professor feels that the professor's contributions outweigh the stud...
187,086
I am a graduate student focused on a subdivision of theoretical physics. When I am browsing papers, I find out an interesting case about the author's name ranking: Let's assume there is a professor A (tenured) and B is a Ph.D. student supervised solely by A (which means there is no co-advising). There are plenty of pu...
2022/07/18
[ "https://academia.stackexchange.com/questions/187086", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/106321/" ]
It's because for those papers, it's the profesor who deserves the first authorship. In my field (not physics), the first author is usually the person who did most of the work and wrote the paper, so if a professor is first, it might mean they did work that would warrant the first authorship to anybody. Expecting profe...
Publication history is irrelevant here. What matters is the contribution to the *current* manuscript. It may be that the person who did the heavy lifting is the senior person, and they feel no student did enough to warrant being first author. This happens when one persons had major input in identifying the calculation...
20,681,278
I have some expression in a Java string and a would get the letter, which was on the left side and on the right side of a specific sign. Here are two examples: ``` X-Y X-V-Y ``` Now, I need to extract in the first example the letter X and Y in a separate string. And in the second example, I need to extract the lett...
2013/12/19
[ "https://Stackoverflow.com/questions/20681278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You'd need to adjust your `max` `key` function to fit your criteria better: ``` maximum_key = max(D, key=lambda k: sum(len(v) for v in D[k])) print(D[maximum_key]) ``` Here the key takes the sum of all lengths in `D[k]`. If you wanted to find the one value with the longest *single* string, use: ``` maximum_key = ma...
``` sumlen = lambda x:sum([len(i) for i in x]) maximum = max([sumlen(i) for i in D.values()]) for i in D.values(): if sumlen(i)==maximum: print i ``` Then you would get the longest pairs (keeps all if not only one): ``` ['thisisthelongeststring2', 'thisisthelongeststring3'] ['thisisthelongeststring5', 't...
1,146,489
I have two monitors. Windows on one screen appear with a yellow background (instead of transparent/white). When I move a window between the monitors it changes its background color. Any idea how do I remove the yellow background? I have tried all suggestions with color management - did not solve my problem. I run W...
2016/11/16
[ "https://superuser.com/questions/1146489", "https://superuser.com", "https://superuser.com/users/664579/" ]
You haven't said how your monitors are connected, but, unless you deliberately set different colour profiles on the two interfaces (which you can verify by swapping the connectors) the difference is going to be the colour settings on the monitor itself. First, try raising the colour temperature; then, if you can't get...
This is always a very difficult challenge when using two different monitors. It's always best to use the same make/model monitor and the same connection type (e.g. VGA, DVI, HDMI, DisplayPort) if you want to make sure the colors match. Aside from the already mentioned adjusting of the individual monitor color tempera...
64,693,557
I am using React Navigation Bar v5 and setting title in App.js but I want to change it dynamically when the screen is displayed. I tried `this.props.navigation.navigate('ExistStock', { title: 'WHATEVER' })` but it doesn't work as it was working in v4. What are the correct ways to change the navigation bar title and bac...
2020/11/05
[ "https://Stackoverflow.com/questions/64693557", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5744975/" ]
You can do it at screenOptions just like you do in V4. You will have to pass the parameters ``` navigation.navigate('Details', { id: item.id, name: item.name,color:item.color }) ``` And in the navigator you can use it as the title and color ``` <Stack.Screen name="Details" component={Details} ...
Use useFocusEffect from React native navigation with navigation.setOptions to dynamically set the navigation options on render. ``` import React, {useCallback} from 'react'; import {useFocusEffect} from '@react-navigation/native'; const myFunctionalComponent = props => { useFocusEffect( useC...
64,693,557
I am using React Navigation Bar v5 and setting title in App.js but I want to change it dynamically when the screen is displayed. I tried `this.props.navigation.navigate('ExistStock', { title: 'WHATEVER' })` but it doesn't work as it was working in v4. What are the correct ways to change the navigation bar title and bac...
2020/11/05
[ "https://Stackoverflow.com/questions/64693557", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5744975/" ]
You can do it at screenOptions just like you do in V4. You will have to pass the parameters ``` navigation.navigate('Details', { id: item.id, name: item.name,color:item.color }) ``` And in the navigator you can use it as the title and color ``` <Stack.Screen name="Details" component={Details} ...
``` componentDidMount() { this.props.navigation.setOptions({ title: "Whatever" }); } ``` This can be used add title at the screen or change the title accordingly. ``` componentDidMount() { this.props.navigation.setOptions({ title: this.state.count === 0 ? 'Select items' : ...
9,188,969
I am currently displaying text in an HTML table that is simply one large row and two columns. I am using the table to take advantage of the side by side aspect (I could switch to floating divs if someone can tell me an advantage to doing so). I fill the text in the left side, and then I fill the right side. It is VERY ...
2012/02/08
[ "https://Stackoverflow.com/questions/9188969", "https://Stackoverflow.com", "https://Stackoverflow.com/users/221904/" ]
Assuming `UIWebView` supports it ([Mobile Safari has since iOS 3.2](http://caniuse.com/#search=columns)), you could use the [`-webkit-column`](https://developer.apple.com/library/safari/#documentation/appleapplications/reference/SafariCSSRef/Articles/StandardCSSProperties.html#//apple_ref/css/property/-webkit-column) C...
If you are asking this question because you want to use it for an iBook, then use the [iBook Author in the Mac App Store](http://itunes.apple.com/us/app/ibooks-author/id490152466?mt=12), it's free. Alternatively, you can design a table with 3 columns, the first 2 you can add **`colspan=2`**. This will make the top 2 c...
758,743
How do I find the point on the ellipses at 45'. I found [this](http://www.mathopenref.com/coordparamellipse.html), which answers part of it, but I need to know how to calculate for (x,y) at 45'. I could also use a good explanation for the `t` variable. Thanks... ``` x = a cos t y = b sin t ```
2014/04/18
[ "https://math.stackexchange.com/questions/758743", "https://math.stackexchange.com", "https://math.stackexchange.com/users/143957/" ]
Your answer is absolutely right; but, the explanation could use some work. Let me give you one way that you could explain it! The key here is that if $\xi\_i$, $i=1,2,\ldots,n$, is the indicator variable of the event "person $i$ starts singing", then $X=\xi\_1+\xi\_2+\cdots+\xi\_n$, and therefore $$ \mathbb{E}[X]=\sum...
Let $Y\_i$ be a Boolean variable that is 1 if the $i$th person sings and 0 otherwise. Then, $X = \sum\_i Y\_i$. And $E(Y\_i) = Pr\{Y\_i = 1\} = 1/8$. By linearity of expectation, $E[X] = E[\sum\_i Y\_i] = \sum\_i E[Y\_i] = n/8$.
21,942,917
We are given a integer number, and the task is to tell whether the binary representation of the number includes equal number of binary `1`'s and `0`'s or not? I want the solution in constant time. I have the code for calculating no of 1s with the help of hamming weight algorithm! Please help i want to count no of...
2014/02/21
[ "https://Stackoverflow.com/questions/21942917", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3185786/" ]
If x - is your number, N1 is the number of "1" then ``` int N0 = ceil(log2(x)) - N1; ``` will calculate number of "0". Do not forget ``` #include <math.h> ```
``` int numberOfZeros = numberOfBinaryDigits - numberOfOnes; ``` Where number of binary digits is either based on the storage used for the data, or log2.
21,942,917
We are given a integer number, and the task is to tell whether the binary representation of the number includes equal number of binary `1`'s and `0`'s or not? I want the solution in constant time. I have the code for calculating no of 1s with the help of hamming weight algorithm! Please help i want to count no of...
2014/02/21
[ "https://Stackoverflow.com/questions/21942917", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3185786/" ]
If x - is your number, N1 is the number of "1" then ``` int N0 = ceil(log2(x)) - N1; ``` will calculate number of "0". Do not forget ``` #include <math.h> ```
32 bit integer examples: Using bit operators (and multiply): ``` int bitcount(unsigned int i) { // generate a bit count in each pair of bits i = i - ( (i >> 1) & 0x55555555); // generate a bit count in each nibble i = (i & 0x33333333) + ( (i >> 2) & 0x33333333 ); // sum up the bits counts in the n...
21,942,917
We are given a integer number, and the task is to tell whether the binary representation of the number includes equal number of binary `1`'s and `0`'s or not? I want the solution in constant time. I have the code for calculating no of 1s with the help of hamming weight algorithm! Please help i want to count no of...
2014/02/21
[ "https://Stackoverflow.com/questions/21942917", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3185786/" ]
In production code (I mean if not restricted by rules dictated in an assignment) I'd do it like this: ``` #include <iostream> #include <bitset> int main() { int k(24); // an example integer - the one you check for equality of 0's and ones std::bitset<32> bs(k); // I suppose 32 bit numbers - choose your own le...
``` int numberOfZeros = numberOfBinaryDigits - numberOfOnes; ``` Where number of binary digits is either based on the storage used for the data, or log2.
21,942,917
We are given a integer number, and the task is to tell whether the binary representation of the number includes equal number of binary `1`'s and `0`'s or not? I want the solution in constant time. I have the code for calculating no of 1s with the help of hamming weight algorithm! Please help i want to count no of...
2014/02/21
[ "https://Stackoverflow.com/questions/21942917", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3185786/" ]
In production code (I mean if not restricted by rules dictated in an assignment) I'd do it like this: ``` #include <iostream> #include <bitset> int main() { int k(24); // an example integer - the one you check for equality of 0's and ones std::bitset<32> bs(k); // I suppose 32 bit numbers - choose your own le...
32 bit integer examples: Using bit operators (and multiply): ``` int bitcount(unsigned int i) { // generate a bit count in each pair of bits i = i - ( (i >> 1) & 0x55555555); // generate a bit count in each nibble i = (i & 0x33333333) + ( (i >> 2) & 0x33333333 ); // sum up the bits counts in the n...
59,476,632
I want to import excell value from 2nd row and on to the DataGridView but dont know how. If possible I want to keep the current existing data value in datagridview is not deleted so the imported data just added after. this is the current result of the export from the datagridview. I want it to become template to impo...
2019/12/25
[ "https://Stackoverflow.com/questions/59476632", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12484324/" ]
You can use the **Microsoft.Office.Interop.Excel** library Below is an example: ``` using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using Excel = Microso...
using OleDbConnection , OleDbDataAdapter , DataSet to do that : * Import System.Data. * Using ADO.NET to read content (SQL SELECT command like). * The content will be in DataSet * dataGridView1.DataSource = datatSet.Tables[0]; check this link to get the code [Read and Import Excel File into DataSet](http://csharp.net...
14,957
If I wanted to use fire to cut down a tree how would I accomplish this safely? Clearly if I build a big bonfire at the base of the tree it will burn down and possibly cause a forest fire.
2017/01/20
[ "https://outdoors.stackexchange.com/questions/14957", "https://outdoors.stackexchange.com", "https://outdoors.stackexchange.com/users/7995/" ]
**Unless you are building a bridge you don't.** If you don't have the tools to cut it down you don't have the tools to do anything with it once it is down. You are converting it from a big living standing tree to a big dead laying down tree. Neither of which you have the tools to modify. The only scenario where this a...
According to [this resource](http://www.native-art-in-canada.com/fellatree.html) one technique is to cake mud on the tree trunk at least 2 inches thick and 6 feet tall. The mud will protect the flames from spreading up the tree. Throughout the whole process it is important to keep an eye on this mud, and replenish it a...
14,957
If I wanted to use fire to cut down a tree how would I accomplish this safely? Clearly if I build a big bonfire at the base of the tree it will burn down and possibly cause a forest fire.
2017/01/20
[ "https://outdoors.stackexchange.com/questions/14957", "https://outdoors.stackexchange.com", "https://outdoors.stackexchange.com/users/7995/" ]
According to [this resource](http://www.native-art-in-canada.com/fellatree.html) one technique is to cake mud on the tree trunk at least 2 inches thick and 6 feet tall. The mud will protect the flames from spreading up the tree. Throughout the whole process it is important to keep an eye on this mud, and replenish it a...
Yes Grasshopper, Burning a tree down, is one of the most entertaining things I do in my woods. Forgive the assumptions and the judgements of the naysayers. They know not, that they know not. This is how I burn a tree down, thank you to the Emersld Ash Borer (often because it’s too risky to cut it down, as the top break...
14,957
If I wanted to use fire to cut down a tree how would I accomplish this safely? Clearly if I build a big bonfire at the base of the tree it will burn down and possibly cause a forest fire.
2017/01/20
[ "https://outdoors.stackexchange.com/questions/14957", "https://outdoors.stackexchange.com", "https://outdoors.stackexchange.com/users/7995/" ]
**Unless you are building a bridge you don't.** If you don't have the tools to cut it down you don't have the tools to do anything with it once it is down. You are converting it from a big living standing tree to a big dead laying down tree. Neither of which you have the tools to modify. The only scenario where this a...
Yes Grasshopper, Burning a tree down, is one of the most entertaining things I do in my woods. Forgive the assumptions and the judgements of the naysayers. They know not, that they know not. This is how I burn a tree down, thank you to the Emersld Ash Borer (often because it’s too risky to cut it down, as the top break...
371,058
I'm trying to conduct a paired samples t-test in Python (statsmodels package), but I don't see a function for it in their documentation. The closest I can find is [ttost\_paired](http://www.statsmodels.org/0.9.0/generated/statsmodels.stats.weightstats.ttost_paired.html#statsmodels.stats.weightstats.ttost_paired), but I...
2018/10/09
[ "https://stats.stackexchange.com/questions/371058", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/68268/" ]
the function `ttost` is not a t-test and therefore is not suitable for your purposes. The TTOST is a test of non-equivalence. It employes two one-sided t-tests in order to verify if both samples are equivalent or not. Please, have a look at the function documentation. There exists the [ttest\_mean function](https://w...
You can use the [ttest\_rel](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.ttest_rel.html) function in scipy.stats: > > Calculate the t-test on TWO RELATED samples of scores, a and b. This > is a two-sided test for the null hypothesis that 2 related or repeated > samples have identical average (e...
371,058
I'm trying to conduct a paired samples t-test in Python (statsmodels package), but I don't see a function for it in their documentation. The closest I can find is [ttost\_paired](http://www.statsmodels.org/0.9.0/generated/statsmodels.stats.weightstats.ttost_paired.html#statsmodels.stats.weightstats.ttost_paired), but I...
2018/10/09
[ "https://stats.stackexchange.com/questions/371058", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/68268/" ]
the function `ttost` is not a t-test and therefore is not suitable for your purposes. The TTOST is a test of non-equivalence. It employes two one-sided t-tests in order to verify if both samples are equivalent or not. Please, have a look at the function documentation. There exists the [ttest\_mean function](https://w...
Standard paired t-test for two samples y1 and y2 is just the one sample t-test applied on the difference `d = y1 - y2`. The same applies when using a normal distribution in a z-test. (That and the availability of paired t-test in scipy.stats are the reasons why statsmodels currently does not implement a separate pa...
473
I was instructed to "burn the bootloader" to my Arduino to fix an error I was getting. How can I do this? (And what exactly is the bootloader?)
2014/02/26
[ "https://arduino.stackexchange.com/questions/473", "https://arduino.stackexchange.com", "https://arduino.stackexchange.com/users/37/" ]
The bootloader is a small program that is (almost) always on an Arduino. It manages uploading and starting the sketches you make, and blinks the pin 13 LED whenever the board resets. --- To burn the bootloader: 1. Obtain an AVR ISP, [USBtinyISP](http://learn.adafruit.com/usbtinyisp), [ParallelProgrammer](http://ardu...
### What is a bootloader? > > And what exactly is the bootloader? > > > The bootloader is a small piece of code residing in the "high" part of program memory. Normally it is not erased when you upload new sketches. Its purpose it to be activated immediately after a reset (the fuses are configured to commence cod...
372,912
I am spawning a few test servers on ec2 that happen to be m1.larges. I am using these test servers for load balancin testing. Anyways, most of the servers I have used before have been backed by EBS, but these instances (ubuntu 11.04) obviously come with a lot of ephemeral space located @ /mnt. What I noticed that is h...
2012/03/23
[ "https://serverfault.com/questions/372912", "https://serverfault.com", "https://serverfault.com/users/99029/" ]
The tutorial is correct, according to the official Amazon EC2 docs at <http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/InstanceStorage.html>. So you should not be losing this data. How exactly are you rebooting these instances? Are you sure you are losing the data on the instance storage device and not just t...
Ephemeral storage should persist across instance reboots (i.e. running `reboot` or similar within the instance, or issuing a RebootInstances API request). Is a script in your AMI possibly formatting the ephemeral storage at startup?
69,152,831
Since I'm new to OOPS concept,What if I write static public void instead of public static void in c sharp? Will that make any difference?
2021/09/12
[ "https://Stackoverflow.com/questions/69152831", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14183249/" ]
* It won’t make any difference as long as your method name comes last and the return type of your method comes second last. * It's generally a best practice to put the access specifier (i.e public, private, protected) at the start
No, this is pure standard coding guidelines, the generated code will be exactly the same. The general guideline is to put the visibility keyword first. I suggest you to use the StyleCop analyzer in order to be used to efficient, standard guidelines : <https://github.com/DotNetAnalyzers/StyleCopAnalyzers>
69,152,831
Since I'm new to OOPS concept,What if I write static public void instead of public static void in c sharp? Will that make any difference?
2021/09/12
[ "https://Stackoverflow.com/questions/69152831", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14183249/" ]
The [C# language specification](https://www.ecma-international.org/wp-content/uploads/ECMA-334_5th_edition_december_2017.pdf) defines a method header in chapter 15.6.1 as > > method-header: > attributesopt method-modifiersopt partialopt return-type member-name type-parameter-listopt > ( formal-parameter-listopt ) typ...
No, this is pure standard coding guidelines, the generated code will be exactly the same. The general guideline is to put the visibility keyword first. I suggest you to use the StyleCop analyzer in order to be used to efficient, standard guidelines : <https://github.com/DotNetAnalyzers/StyleCopAnalyzers>
21,576,870
I'm having trouble to make a .csv file and force its download inside a wordpress plugin. If i call this code inside the php plugin i get "cannot modify headers", and i call i from outside wordpress, i can download the .csv but can't include the wpdb.php (propably because i don't have access outside my plugin folder) ...
2014/02/05
[ "https://Stackoverflow.com/questions/21576870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1415032/" ]
you need to look at [stemming](http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#Stemming). Depending on what language you need to handle, there are different analyzers.
If there isn't strong requirement to use Solr analyzers, you can simply achieve above search results by using wild card '\*' characters. For eg: Suppose field name in schema is "foo" which has values "b", "ba", "bar", "bart", "bartender", & "foobar". To search all the values with "bar", you can simply query as below....
13,585,870
I'm looking for alternatives to use Git on Windows. Git Gui is to complex for our developers, they used to work with subversion (assembla) using tortois, and committed very easily. Now we are moving to Git with BitBucket, and I'm looking for a normal client via WebStorm. There's no hint in their documentaion on how to ...
2012/11/27
[ "https://Stackoverflow.com/questions/13585870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1223457/" ]
I've found that Source Tree is the one Git GUI app that team members actually enjoy using: <http://www.sourcetreeapp.com/> It's for both Windows and Mac.
I'm using the bitbucket plugin, try one of these options 1) <https://bitbucket.org/dmitry_cherkas/jetbrains-bitbucket-connector/overview> 2) <http://plugins.jetbrains.com/plugin/6207?pr=ruby> I have personally gone with the first version, and sofar it's working just fine.
71,155
When making bullet points of details about something, do we punctuate the abbreviation? Is it this way? > > The details of the Vehicle are given below: > > > 1. Vehicle Chassis No.: [dot and colon with no space] > 2. Vehicle Chassis No. [dot only] > 3. Vehicle Chassis No. : [dot and colon with space] > > > Whi...
2015/10/18
[ "https://ell.stackexchange.com/questions/71155", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/-1/" ]
The abbreviated form `No.` comes from the word 'numero'. Note the **'dot'** after the letter 'o'. It's 'No.' *(with dot)* and **not** 'No' *(without dot)*. Now, the pattern you follow seems to be *listing* the credential of a vehicle. Generally, we put colons in such context. For instance... > > Name: Mr. Narendra...
If I am sending email updates for a play named "Into the Woods Junior", I would send it with the subject line, "Into the Woods Jr.: Box Office & Scheduling Update" I think the colon should come after an abbreviation but to be honest I was never really sure.
18,654,859
Is there any difference in time space complexity for these two? ``` for (int i=0; i<= 100; i++) { System.out.println("hi"); } for (int i=100; i>= 0; i--) { System.out.println("hi"); } ``` And what if the loop is larger and complex? Like when `i <= 1000000`
2013/09/06
[ "https://Stackoverflow.com/questions/18654859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2500377/" ]
No, there is no difference in space or time complexity between the two. I'd be curious to hear why you thought there might be. P.S. Of course, if the actual code is different, then the answer might be different too.
For these simple loops? No. You're just working with a constant string, some of `System.out.println()`'s overhead, and an iterated primitive. However, for more complex nested loops, there could be differences, especially if loops are nested with changing inner loop lengths.
18,654,859
Is there any difference in time space complexity for these two? ``` for (int i=0; i<= 100; i++) { System.out.println("hi"); } for (int i=100; i>= 0; i--) { System.out.println("hi"); } ``` And what if the loop is larger and complex? Like when `i <= 1000000`
2013/09/06
[ "https://Stackoverflow.com/questions/18654859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2500377/" ]
No, there is no difference in space or time complexity between the two. I'd be curious to hear why you thought there might be. P.S. Of course, if the actual code is different, then the answer might be different too.
No both has same time space complexity.
18,654,859
Is there any difference in time space complexity for these two? ``` for (int i=0; i<= 100; i++) { System.out.println("hi"); } for (int i=100; i>= 0; i--) { System.out.println("hi"); } ``` And what if the loop is larger and complex? Like when `i <= 1000000`
2013/09/06
[ "https://Stackoverflow.com/questions/18654859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2500377/" ]
No, there is no difference in space or time complexity between the two. I'd be curious to hear why you thought there might be. P.S. Of course, if the actual code is different, then the answer might be different too.
As such no difference in time complexity i.e O(N). Deciding on which approach to follow is your design specific. For example if I have to find largest prime factor of a given number I would probably use 2nd approach. So basically it is design(of your intended project) specific.
18,654,859
Is there any difference in time space complexity for these two? ``` for (int i=0; i<= 100; i++) { System.out.println("hi"); } for (int i=100; i>= 0; i--) { System.out.println("hi"); } ``` And what if the loop is larger and complex? Like when `i <= 1000000`
2013/09/06
[ "https://Stackoverflow.com/questions/18654859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2500377/" ]
No, there is no difference in space or time complexity between the two. I'd be curious to hear why you thought there might be. P.S. Of course, if the actual code is different, then the answer might be different too.
As long as you don't break out of the loop with some logic (depending on index variable) there should be no difference in space/complexity. If you need to iterate on every single value of your index, going in reverse order is exactly like going in forward.
18,654,859
Is there any difference in time space complexity for these two? ``` for (int i=0; i<= 100; i++) { System.out.println("hi"); } for (int i=100; i>= 0; i--) { System.out.println("hi"); } ``` And what if the loop is larger and complex? Like when `i <= 1000000`
2013/09/06
[ "https://Stackoverflow.com/questions/18654859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2500377/" ]
No, there is no difference in space or time complexity between the two. I'd be curious to hear why you thought there might be. P.S. Of course, if the actual code is different, then the answer might be different too.
For this particular example is not. For larger arrays it might be slower on some systems. Usually systems are optimized for accessing memory sequentially. As long as memory access pattern is predictable both loops have same efficiency but on older machines or different architectures things may be different. For space...
27,238,305
In our company, we just started using Mercurial and we are facing the following problem: We have some files in the remote repository that are changed by each developer to add some local configuration but these files must never be changed in the remote repository. Is there a way to tell Mercurial to stop tracking tho...
2014/12/01
[ "https://Stackoverflow.com/questions/27238305", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2619082/" ]
If the file you want unchanged is, for example, `config.cfg`, check in a `config_template.cfg`, forget `config.cfg` if it is already tracked, and add `config.cfg` to the ignore list. Then, a build rule can create `config.cfg` from the template *if it does not already exist*. A user will then have a starting config.cfg...
You could use the configuration `[defaults]` section to add some "`--exclude`" options to usual commands (see my answer to [Mercurial hg ignore does not work properly](https://stackoverflow.com/questions/15699917/mercurial-hg-ignore-does-not-work-properly/15700916#15700916) ) for more details. But.. be careful that it...
27,238,305
In our company, we just started using Mercurial and we are facing the following problem: We have some files in the remote repository that are changed by each developer to add some local configuration but these files must never be changed in the remote repository. Is there a way to tell Mercurial to stop tracking tho...
2014/12/01
[ "https://Stackoverflow.com/questions/27238305", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2619082/" ]
If the file you want unchanged is, for example, `config.cfg`, check in a `config_template.cfg`, forget `config.cfg` if it is already tracked, and add `config.cfg` to the ignore list. Then, a build rule can create `config.cfg` from the template *if it does not already exist*. A user will then have a starting config.cfg...
IMHO it's a wrong approach to have a file in the repository which every person needs changed anyway - it's an indication that you do not want to have it tracked at all. Change the file to config.sample, and have your programme create a default config upon first start (thus when there's no existing config file) and hav...
37,164,561
I'm attempting a small coding project; a simple encryption program. I was wondering if I would be able to directly run my Python code from Notepad++, or if there is a different program that could do this task (preferably free). Not that I have to have said feature, it would just make things easier for me. Sorry if thi...
2016/05/11
[ "https://Stackoverflow.com/questions/37164561", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6320661/" ]
**Wing IDE** and **PyCharm** (*My favourite personally*) are really powerful IDE's that can run and debug your application all inside the same environment. Alongside features like auto-completion, support for documentation, version control support right out of the box, and multiple build configurations (there's way mor...
If you want a text editor that will run the code directly, then try [PyCharm](https://www.jetbrains.com/pycharm/). Otherwise open up a command prompt, save the file (e.g. `simplencrypt.py`) and then run `python.exe simplencrypt.py` in the command prompt when you want to run it. I don't think you will be able to run y...
88,172
I'm researching my options for **closing my UK Limited company**. Over time my small business has acquired some minor assets such as computer hardware and an outside office building in my garden. If I was to close the company, what happens to these assets? Would I need to pay tax on the assets, particularly the office...
2017/12/12
[ "https://money.stackexchange.com/questions/88172", "https://money.stackexchange.com", "https://money.stackexchange.com/users/65656/" ]
Many routes- simplest is to value all assets and buy them. Then pay a dividend with the proceeds. Take care to leave enough to pay all taxes etc.
Unless there's something weird in the UK that I'm not aware of, the depreciated value of those assets is income for whoever acquires them, just like the balance of the company bank account is for whoever's account you transfer that into.
67,859
As the subject is in the air, it occurs to me to ask how long a US president would serve if he came to office by reversing in a court the result of an election some way into the term of his opponent ? My impression is that the election has to happen at fixed intervals, and if so that means that the "court-imposed" pre...
2021/08/03
[ "https://politics.stackexchange.com/questions/67859", "https://politics.stackexchange.com", "https://politics.stackexchange.com/users/14675/" ]
This will never happen and a court will not be able to over turn the 51+ presidential elections + electoral college + congress confirming the vote. The constitution spells out how the election is decided and it is based on the electoral college not the votes in each state. Anyone who is claiming the election can be ov...
There is no precedent in the United States regarding a court removing a President from office. ---------------------------------------------------------------------------------------------- All previous Presidential successions, including the 2021 succession from Donald Trump to Joe Biden, have followed the rules laid...
38,184,611
I am trying to form 3 radio buttons with Image on them. So I have used the XML attribute `android:button`. But since my image size is too big, I can't see it fit in the button. Following is my XML code: ``` <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android....
2016/07/04
[ "https://Stackoverflow.com/questions/38184611", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5279855/" ]
It is no longer a default service. You have to configure it in Startup.cs ``` services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>(); services.TryAddSingleton<IActionContextAccessor, ActionContextAccessor>(); ``` **UPDATE**: In ASP.NET Core 2.1, [the `AddHttpContextAccessor` helper extension method](h...
You can add in this way. ```cs services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>(); ```
38,184,611
I am trying to form 3 radio buttons with Image on them. So I have used the XML attribute `android:button`. But since my image size is too big, I can't see it fit in the button. Following is my XML code: ``` <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android....
2016/07/04
[ "https://Stackoverflow.com/questions/38184611", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5279855/" ]
It is no longer a default service. You have to configure it in Startup.cs ``` services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>(); services.TryAddSingleton<IActionContextAccessor, ActionContextAccessor>(); ``` **UPDATE**: In ASP.NET Core 2.1, [the `AddHttpContextAccessor` helper extension method](h...
You can add in this way for .Net 6 ``` builder.Services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>(); ```
38,184,611
I am trying to form 3 radio buttons with Image on them. So I have used the XML attribute `android:button`. But since my image size is too big, I can't see it fit in the button. Following is my XML code: ``` <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android....
2016/07/04
[ "https://Stackoverflow.com/questions/38184611", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5279855/" ]
You can add in this way for .Net 6 ``` builder.Services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>(); ```
You can add in this way. ```cs services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>(); ```
8,777,757
This is my code: ``` foreach ($all_orders as $order){//the $all_orders array contains a number of arrays, so it's a multidimensional array $order["Order Rank"]=$order[0]; unset($order[0]); } ``` after renaming the key with the new key and when i print the array: ``` print_r($all_orders); ``` i got the old key na...
2012/01/08
[ "https://Stackoverflow.com/questions/8777757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/602257/" ]
You're modifying a *copy* of the element. Use references: ``` foreach ($all_orders as &$order) { //... } ```
You are working with the $order variable, which is not the same as the array. You want to: ``` foreach ($all_orders as $key => $order){//the $all_orders array contains a number of arrays, so it's a multidimensional array $all_orders[$key]["Order Rank"]=$order[0]; unset($all_orders[$key]); } ```
15,777,997
If I have an array like: int [] numb = {0, 1, 2, 3}; and I want to find the minimum value of the array. I just do a quick easy for loop to find it, but if I have duplicate minimum values, such as: int [] numb = {0, 1, 0, 2, 3}; How do I find the locations of all the minimum values and how many times it shows up in ...
2013/04/03
[ "https://Stackoverflow.com/questions/15777997", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1953859/" ]
This code does all you want in just one loop. It also doesn't require you to hardcode in an initial 'minimum' value. ``` int[] values = {6, 2, 4, 3, 1, 1, 7, 2, 1}; Integer minimum = null; List<Integer> indexes = new ArrayList<Integer>(); for(int i = 0; i < values.length; i++) { if(minimum ...
when you fined an element dont break from the loop, instead increment a counter to count the number of time it repeats in the array. and keep track of all the places it appeared. Or make your method return the index of were the first element was found, then run the same method again exept at a higher index
15,777,997
If I have an array like: int [] numb = {0, 1, 2, 3}; and I want to find the minimum value of the array. I just do a quick easy for loop to find it, but if I have duplicate minimum values, such as: int [] numb = {0, 1, 0, 2, 3}; How do I find the locations of all the minimum values and how many times it shows up in ...
2013/04/03
[ "https://Stackoverflow.com/questions/15777997", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1953859/" ]
This code does all you want in just one loop. It also doesn't require you to hardcode in an initial 'minimum' value. ``` int[] values = {6, 2, 4, 3, 1, 1, 7, 2, 1}; Integer minimum = null; List<Integer> indexes = new ArrayList<Integer>(); for(int i = 0; i < values.length; i++) { if(minimum ...
``` int[] array = {0, 1, 0, 2, 3} int mininum=999999 //initialize to a number larger than anything in the array would reasonably be for (int curr = 0; curr < array.size; curr++) { if (array1[curr] < minimum) { minimum = array[i]; } } int duplicates = 0; for (int i : array){ if (i...
15,777,997
If I have an array like: int [] numb = {0, 1, 2, 3}; and I want to find the minimum value of the array. I just do a quick easy for loop to find it, but if I have duplicate minimum values, such as: int [] numb = {0, 1, 0, 2, 3}; How do I find the locations of all the minimum values and how many times it shows up in ...
2013/04/03
[ "https://Stackoverflow.com/questions/15777997", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1953859/" ]
This code does all you want in just one loop. It also doesn't require you to hardcode in an initial 'minimum' value. ``` int[] values = {6, 2, 4, 3, 1, 1, 7, 2, 1}; Integer minimum = null; List<Integer> indexes = new ArrayList<Integer>(); for(int i = 0; i < values.length; i++) { if(minimum ...
Try to use Guava library multiset. If you wont use it, see for example this link <http://www.zparacha.com/minimum-maximum-array-value/>
2,928
In the movie *Cash McCall*, the main character, McCall, owns an aircraft that looks remarkably similar to a B-25 or B-26, but is painted yellow and has no turrets. Have these aircraft been converted for private business use or were there business aircraft based on the design of WWII bombers?
2014/03/31
[ "https://aviation.stackexchange.com/questions/2928", "https://aviation.stackexchange.com", "https://aviation.stackexchange.com/users/718/" ]
[IMDB](http://www.imdb.com/title/tt0052680/trivia): > > McCall's plane is a demilitarized Douglas A-26 Invader, a type used in WWII. > > > Since the film was made in 1960, I imagine there were plenty of them around. (The A-26 was known a the B-26 from 1948 to 1965, [according to Wikipedia](https://en.wikipedia....
Yes. After World War 2, surplus aircraft were cheap, plentiful, and offered great performance compared to pre-war designs, and many were converted to use as executive transports. The A-26/B-26 was no exception, being the basis for the [On Mark Marksman](http://en.m.wikipedia.org/wiki/On_Mark_Marksman) series. Some of ...
2,928
In the movie *Cash McCall*, the main character, McCall, owns an aircraft that looks remarkably similar to a B-25 or B-26, but is painted yellow and has no turrets. Have these aircraft been converted for private business use or were there business aircraft based on the design of WWII bombers?
2014/03/31
[ "https://aviation.stackexchange.com/questions/2928", "https://aviation.stackexchange.com", "https://aviation.stackexchange.com/users/718/" ]
Yes. After World War 2, surplus aircraft were cheap, plentiful, and offered great performance compared to pre-war designs, and many were converted to use as executive transports. The A-26/B-26 was no exception, being the basis for the [On Mark Marksman](http://en.m.wikipedia.org/wiki/On_Mark_Marksman) series. Some of ...
I remember Air Spray Ltd., at Red Deer, Alberta, had a highly modified A26 bought from the Mexican government that used to fly around call girls as the interior of the plane had a fully plush white shag carpet everywhere and you could fully stretch out with your hostess. It also had curtained windows in the back area a...
2,928
In the movie *Cash McCall*, the main character, McCall, owns an aircraft that looks remarkably similar to a B-25 or B-26, but is painted yellow and has no turrets. Have these aircraft been converted for private business use or were there business aircraft based on the design of WWII bombers?
2014/03/31
[ "https://aviation.stackexchange.com/questions/2928", "https://aviation.stackexchange.com", "https://aviation.stackexchange.com/users/718/" ]
The aircraft is a modified Douglas A-26 Invader. As mentioned in an earlier reply there were several companies which undertook such work. Most well known was On-Mark Engineering of Van Nuys, CA. The 26 in question, N36B was one of several (at least two used the same reg.) owned by citrus tycoon Willis (Bill) Bailard of...
The question leaves it unclear as to whether the "B-26" reference was meant to apply to the Martin B-26 Marauder, or the Douglas A-26 Invader, later renamed B--26 after the retirement of the Marauder. Both were converted for use as executive transports (see <https://en.m.wikipedia.org/wiki/Martin_B-26_Marauder> , and <...
2,928
In the movie *Cash McCall*, the main character, McCall, owns an aircraft that looks remarkably similar to a B-25 or B-26, but is painted yellow and has no turrets. Have these aircraft been converted for private business use or were there business aircraft based on the design of WWII bombers?
2014/03/31
[ "https://aviation.stackexchange.com/questions/2928", "https://aviation.stackexchange.com", "https://aviation.stackexchange.com/users/718/" ]
The aircraft is a modified Douglas A-26 Invader. As mentioned in an earlier reply there were several companies which undertook such work. Most well known was On-Mark Engineering of Van Nuys, CA. The 26 in question, N36B was one of several (at least two used the same reg.) owned by citrus tycoon Willis (Bill) Bailard of...
Here is a [list of surviving B-25](https://en.wikipedia.org/wiki/List_of_surviving_North_American_B-25_Mitchells) which may provide some references. It looks like Redbull has one that they fly around (arguably for business reasons) ![enter image description here](https://i.stack.imgur.com/WL3Yq.jpg)
2,928
In the movie *Cash McCall*, the main character, McCall, owns an aircraft that looks remarkably similar to a B-25 or B-26, but is painted yellow and has no turrets. Have these aircraft been converted for private business use or were there business aircraft based on the design of WWII bombers?
2014/03/31
[ "https://aviation.stackexchange.com/questions/2928", "https://aviation.stackexchange.com", "https://aviation.stackexchange.com/users/718/" ]
[IMDB](http://www.imdb.com/title/tt0052680/trivia): > > McCall's plane is a demilitarized Douglas A-26 Invader, a type used in WWII. > > > Since the film was made in 1960, I imagine there were plenty of them around. (The A-26 was known a the B-26 from 1948 to 1965, [according to Wikipedia](https://en.wikipedia....
Here is a [list of surviving B-25](https://en.wikipedia.org/wiki/List_of_surviving_North_American_B-25_Mitchells) which may provide some references. It looks like Redbull has one that they fly around (arguably for business reasons) ![enter image description here](https://i.stack.imgur.com/WL3Yq.jpg)