qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
73,518
I've been reading many opinions from the United State Supreme Court and discovered the phrase "inter alia," meaning "among other things." I have not encountered this phrase outside of these opinions. Is the phrase "inter alia" primarily localized to legalese? Or would it be acceptable to use it in general writing?
2012/07/04
[ "https://english.stackexchange.com/questions/73518", "https://english.stackexchange.com", "https://english.stackexchange.com/users/6523/" ]
The best course, undoubtedly, is to use "among others", a phrase that can refer to people or things. It should be noted that "inter alia" is Latin for "among others" when "others" are things. If the others are persons, "alia" must be changed to "alios" (the OED quotes, from 1670, *The lords produce **inter alios** Jo...
*Inter alia* looks as though it can bear its weight in business reporting and used as a throw-away phrase elsewhere, usually unitalicized. It seems to be a regular journalistic condiment at the *Financial Times*. > > “...it has become increasing clear to us that top leadership had > shaped a culture that lacks, ***...
9,133,923
Using the following code: ``` >>> import time >>> start = time.time() >>> end = time.time() >>> end - start ``` one can measure time between "start" and "end". What about measuring the time between specific keystrokes? Specifically, if a module was run and the user started typing something, how can pyth...
2012/02/03
[ "https://Stackoverflow.com/questions/9133923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1139651/" ]
This will work (on some systems!): ``` import termios, sys, time def getch(inp=sys.stdin): old = termios.tcgetattr(inp) new = old[:] new[-1] = old[-1][:] new[3] &= ~(termios.ECHO | termios.ICANON) new[-1][termios.VMIN] = 1 try: termios.tcsetattr(inp, termios.TCSANOW, new) return...
On Windows you can you [msvcrt.kbhit()](http://docs.python.org/library/msvcrt.html#msvcrt.kbhit) to tell when a key has been pressed. See <http://effbot.org/librarybook/msvcrt.htm> for a worked-out example.
9,133,923
Using the following code: ``` >>> import time >>> start = time.time() >>> end = time.time() >>> end - start ``` one can measure time between "start" and "end". What about measuring the time between specific keystrokes? Specifically, if a module was run and the user started typing something, how can pyth...
2012/02/03
[ "https://Stackoverflow.com/questions/9133923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1139651/" ]
This will work (on some systems!): ``` import termios, sys, time def getch(inp=sys.stdin): old = termios.tcgetattr(inp) new = old[:] new[-1] = old[-1][:] new[3] &= ~(termios.ECHO | termios.ICANON) new[-1][termios.VMIN] = 1 try: termios.tcsetattr(inp, termios.TCSANOW, new) return...
A simple way you could do that is: ``` from time import time begin = time.time() raw_input() #this is when you start typing #this would be after you hit enter end = time.time() elapsed = end - begin print elapsed #it will tell you how long it took you to type your name ```
9,133,923
Using the following code: ``` >>> import time >>> start = time.time() >>> end = time.time() >>> end - start ``` one can measure time between "start" and "end". What about measuring the time between specific keystrokes? Specifically, if a module was run and the user started typing something, how can pyth...
2012/02/03
[ "https://Stackoverflow.com/questions/9133923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1139651/" ]
A simple way you could do that is: ``` from time import time begin = time.time() raw_input() #this is when you start typing #this would be after you hit enter end = time.time() elapsed = end - begin print elapsed #it will tell you how long it took you to type your name ```
On Windows you can you [msvcrt.kbhit()](http://docs.python.org/library/msvcrt.html#msvcrt.kbhit) to tell when a key has been pressed. See <http://effbot.org/librarybook/msvcrt.htm> for a worked-out example.
38,723
I've been looking to use unicode for more iconography, and I haven't been able to find any appropriate unicode for a "view" icon. None of the "eye"-related unicode that I've found works on the web. Does anyone know of any unicode icons that would be appropriate for a "view" icon?
2012/12/07
[ "https://webmasters.stackexchange.com/questions/38723", "https://webmasters.stackexchange.com", "https://webmasters.stackexchange.com/users/118/" ]
You might struggle to find a unicode character to represent "view", but you'll find plenty of web font based icon sets with an eye or view concept. For example, [Font Awesome](http://fortawesome.github.com/Font-Awesome/) – the icon web font used in Twitter Bootstrap – has an icon called 'icon-eye-open' that might do t...
⚲ ([Neuter](https://www.compart.com/en/unicode/U+26B2)) looks a bit as a magnifier glas, that is what i setteled for as a view symbol.
38,723
I've been looking to use unicode for more iconography, and I haven't been able to find any appropriate unicode for a "view" icon. None of the "eye"-related unicode that I've found works on the web. Does anyone know of any unicode icons that would be appropriate for a "view" icon?
2012/12/07
[ "https://webmasters.stackexchange.com/questions/38723", "https://webmasters.stackexchange.com", "https://webmasters.stackexchange.com/users/118/" ]
You might struggle to find a unicode character to represent "view", but you'll find plenty of web font based icon sets with an eye or view concept. For example, [Font Awesome](http://fortawesome.github.com/Font-Awesome/) – the icon web font used in Twitter Bootstrap – has an icon called 'icon-eye-open' that might do t...
This question was asked in 2012. Browsers in 2020 now support a much wider range of Unicode characters. These three Unicode characters all render in my browser (Ubuntu 19.10, latest FF and Chrome): * Right-Pointing Magnifying Glass (`&#x1f50e;`): * Left-Pointing Magnifying Glass: (`&#x1f50d;`): * Eye (`&#x1f441;`): I...
1,596,582
$$x^{\frac{-4}{3}}(-x^{\frac{2}{3}}+1)^{\frac{1}{2}}=\frac{\sqrt{(-\sqrt[3]{x^2}+1)}}{\sqrt[3]{x^4}}$$ Is it necessary to simplify the function further? What substitution is useful? $u=\sqrt[n]{\frac{ax+b}{cx+d}}$ doesn't work.
2016/01/02
[ "https://math.stackexchange.com/questions/1596582", "https://math.stackexchange.com", "https://math.stackexchange.com/users/300044/" ]
As suggested in RecklessReckoner's comment, let us first change variable $x=u^3$ then $dx=3u^2du$. So, $$I=\int \frac{\sqrt{1-x^{2/3}}}{x^{4/3}}dx=3\int\frac{ \sqrt{1-u^2}}{u^2}du$$ Now, $u=\sin(t)$, $du=\cos(t)\,dt$ makes $$I=3\int \cot ^2(t)\,dt=3\int \frac{1-\sin^2(t)}{\sin^2(t)}dt =3\Big(\int \frac{dt}{\sin^2(t)}-\...
Following RecklessReckoner's comment: We have $\int x^{\frac{-4}{3}}(-x^{\frac{2}{3}}+1)^{\frac{1}{2}}\mathrm dx$. Now, let $u=x^{1/3}$ and $3u \mathrm du=\mathrm dx$ This gives $3\int u^{-4}(-u^{2}+1)^{\frac{1}{2}}u\mathrm du=3\int u^{-3}(-u^{2}+1)^{\frac{1}{2}}\mathrm du=3\int u^{-3}(1-u^{2})^{\frac{1}{2}}\mathrm ...
1,596,582
$$x^{\frac{-4}{3}}(-x^{\frac{2}{3}}+1)^{\frac{1}{2}}=\frac{\sqrt{(-\sqrt[3]{x^2}+1)}}{\sqrt[3]{x^4}}$$ Is it necessary to simplify the function further? What substitution is useful? $u=\sqrt[n]{\frac{ax+b}{cx+d}}$ doesn't work.
2016/01/02
[ "https://math.stackexchange.com/questions/1596582", "https://math.stackexchange.com", "https://math.stackexchange.com/users/300044/" ]
Notice, $$\int x^{-4/3}\left(-x^{2/3}+1\right)^{1/2}\ dx$$$$=\int \frac{1}{x}\left(-x^{2/3}+1\right)^{1/2}(x^{-1/3}\ dx)$$ Let $-x^{2/3}+1=\sin^2\theta\implies -\frac{2}{3}x^{-1/3}\ dx=2\sin\theta\cos\theta\ d\theta$ or $x^{-1/3}\ dx=-3\sin\theta\cos\theta\ d\theta $ $$=\int\frac{1}{(1-\sin^2\theta)^{3/2}}(\sin\theta)...
Following RecklessReckoner's comment: We have $\int x^{\frac{-4}{3}}(-x^{\frac{2}{3}}+1)^{\frac{1}{2}}\mathrm dx$. Now, let $u=x^{1/3}$ and $3u \mathrm du=\mathrm dx$ This gives $3\int u^{-4}(-u^{2}+1)^{\frac{1}{2}}u\mathrm du=3\int u^{-3}(-u^{2}+1)^{\frac{1}{2}}\mathrm du=3\int u^{-3}(1-u^{2})^{\frac{1}{2}}\mathrm ...
1,596,582
$$x^{\frac{-4}{3}}(-x^{\frac{2}{3}}+1)^{\frac{1}{2}}=\frac{\sqrt{(-\sqrt[3]{x^2}+1)}}{\sqrt[3]{x^4}}$$ Is it necessary to simplify the function further? What substitution is useful? $u=\sqrt[n]{\frac{ax+b}{cx+d}}$ doesn't work.
2016/01/02
[ "https://math.stackexchange.com/questions/1596582", "https://math.stackexchange.com", "https://math.stackexchange.com/users/300044/" ]
As suggested in RecklessReckoner's comment, let us first change variable $x=u^3$ then $dx=3u^2du$. So, $$I=\int \frac{\sqrt{1-x^{2/3}}}{x^{4/3}}dx=3\int\frac{ \sqrt{1-u^2}}{u^2}du$$ Now, $u=\sin(t)$, $du=\cos(t)\,dt$ makes $$I=3\int \cot ^2(t)\,dt=3\int \frac{1-\sin^2(t)}{\sin^2(t)}dt =3\Big(\int \frac{dt}{\sin^2(t)}-\...
Notice, $$\int x^{-4/3}\left(-x^{2/3}+1\right)^{1/2}\ dx$$$$=\int \frac{1}{x}\left(-x^{2/3}+1\right)^{1/2}(x^{-1/3}\ dx)$$ Let $-x^{2/3}+1=\sin^2\theta\implies -\frac{2}{3}x^{-1/3}\ dx=2\sin\theta\cos\theta\ d\theta$ or $x^{-1/3}\ dx=-3\sin\theta\cos\theta\ d\theta $ $$=\int\frac{1}{(1-\sin^2\theta)^{3/2}}(\sin\theta)...
37,964
Is it possible to disable direct login for normal users (like `oracle`) in Linux but allow `scp` and `sftp` for that use?
2012/05/05
[ "https://unix.stackexchange.com/questions/37964", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/18425/" ]
Methods such as creating the file `/etc/nologin`, setting account login shells to `/bin/false` or `/sbin/nologin` effectively disable user accounts from logging into an interactive shell, but do not protect the system. If you want to specifically restrict a user to using `scp` or `sftp` only, install a restricted shel...
The login shell can be changed from `bash` to `/usr/sbin/nologin` or `/bin/false` do prevent a normal login. The login shell can be changed with `usermod`: ``` usermod user_name -s /usr/sbin/nologin ```
37,964
Is it possible to disable direct login for normal users (like `oracle`) in Linux but allow `scp` and `sftp` for that use?
2012/05/05
[ "https://unix.stackexchange.com/questions/37964", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/18425/" ]
You can Add this to sshd\_config: ``` Match User oracle ForceCommand set - ""$SSH_ORIGINAL_COMMAND; [ "$1" = "scp" ] || exit 1; CMD=`IFS='\`&;<>'; set - ""$SSH_ORIGINAL_COMMAND; echo $1`; [ "$CMD" ] || exit 1; exec $CMD ``` Here, I'm matching the user 'oracle'. Instead you can use `Match group scponly` to ma...
The login shell can be changed from `bash` to `/usr/sbin/nologin` or `/bin/false` do prevent a normal login. The login shell can be changed with `usermod`: ``` usermod user_name -s /usr/sbin/nologin ```
37,964
Is it possible to disable direct login for normal users (like `oracle`) in Linux but allow `scp` and `sftp` for that use?
2012/05/05
[ "https://unix.stackexchange.com/questions/37964", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/18425/" ]
Methods such as creating the file `/etc/nologin`, setting account login shells to `/bin/false` or `/sbin/nologin` effectively disable user accounts from logging into an interactive shell, but do not protect the system. If you want to specifically restrict a user to using `scp` or `sftp` only, install a restricted shel...
You can Add this to sshd\_config: ``` Match User oracle ForceCommand set - ""$SSH_ORIGINAL_COMMAND; [ "$1" = "scp" ] || exit 1; CMD=`IFS='\`&;<>'; set - ""$SSH_ORIGINAL_COMMAND; echo $1`; [ "$CMD" ] || exit 1; exec $CMD ``` Here, I'm matching the user 'oracle'. Instead you can use `Match group scponly` to ma...
37,964
Is it possible to disable direct login for normal users (like `oracle`) in Linux but allow `scp` and `sftp` for that use?
2012/05/05
[ "https://unix.stackexchange.com/questions/37964", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/18425/" ]
Methods such as creating the file `/etc/nologin`, setting account login shells to `/bin/false` or `/sbin/nologin` effectively disable user accounts from logging into an interactive shell, but do not protect the system. If you want to specifically restrict a user to using `scp` or `sftp` only, install a restricted shel...
Yes, that is possible. 1. Set their login shell appropriately, e.g. by `chsh -s /bin/false ${user}`. 2. Tell `sshd` to use the internal `sftp-server` ``` Match User ${user} ForceCommand internal-sftp ``` `Match` blocks continue until the next `Match` block or the end of the file (indentation is just for humans), ...
37,964
Is it possible to disable direct login for normal users (like `oracle`) in Linux but allow `scp` and `sftp` for that use?
2012/05/05
[ "https://unix.stackexchange.com/questions/37964", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/18425/" ]
You can Add this to sshd\_config: ``` Match User oracle ForceCommand set - ""$SSH_ORIGINAL_COMMAND; [ "$1" = "scp" ] || exit 1; CMD=`IFS='\`&;<>'; set - ""$SSH_ORIGINAL_COMMAND; echo $1`; [ "$CMD" ] || exit 1; exec $CMD ``` Here, I'm matching the user 'oracle'. Instead you can use `Match group scponly` to ma...
Yes, that is possible. 1. Set their login shell appropriately, e.g. by `chsh -s /bin/false ${user}`. 2. Tell `sshd` to use the internal `sftp-server` ``` Match User ${user} ForceCommand internal-sftp ``` `Match` blocks continue until the next `Match` block or the end of the file (indentation is just for humans), ...
227,585
At work we write a small to moderate amount of scripts to aid us in normal development. We have some people that are more comfortable in python, some in perl, some in php, etc... Sometimes I think it is best to let people work in a language they are most comfortable with. This can mean that sometimes people can do a b...
2008/10/22
[ "https://Stackoverflow.com/questions/227585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16584/" ]
My opinion is that it is just like any other development environment. Do you standardize on one development language? Why? The same should be true for your scripting environment. Not only do I lean toward standardizing on a specific language I think you should standardize all the same things that you are hopefully doin...
No. Your dev environment is hopefully a living entity that changes and is cultivated. New abilities (scripting languages) should be able to be accommodated, and older places that haven't been visited for years will someday get obviated by tools, or revisited from time to time and an evaluation will take place. Hopefu...
227,585
At work we write a small to moderate amount of scripts to aid us in normal development. We have some people that are more comfortable in python, some in perl, some in php, etc... Sometimes I think it is best to let people work in a language they are most comfortable with. This can mean that sometimes people can do a b...
2008/10/22
[ "https://Stackoverflow.com/questions/227585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16584/" ]
I would advocate standardizing on a couple languages. "Thou shalt use either Python, or Perl, or Ruby. Not Rexx, nor PHP, nor NewBatch, nor aught other, for thy brethren ought to be able to read thine writing without undue despair or cutting of their skins".
So long as the languages in question are used for scripting, I agree with other commenters that it should be left to the devteam, and different languages should be tolerated in most cases. If the language is used for your main codebase, you had better standardize on one. If some developers complain about a script not...
227,585
At work we write a small to moderate amount of scripts to aid us in normal development. We have some people that are more comfortable in python, some in perl, some in php, etc... Sometimes I think it is best to let people work in a language they are most comfortable with. This can mean that sometimes people can do a b...
2008/10/22
[ "https://Stackoverflow.com/questions/227585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16584/" ]
I would be inclined to let people choose, *and* hire people who are comfortable at learning new things. Gaining basic fluency with almost any language should be easy enough for a good developer. And for small scripts where the original author isn't far away, it's even easier. The second part of the above is the hard p...
I would advocate standardizing on a couple languages. "Thou shalt use either Python, or Perl, or Ruby. Not Rexx, nor PHP, nor NewBatch, nor aught other, for thy brethren ought to be able to read thine writing without undue despair or cutting of their skins".
227,585
At work we write a small to moderate amount of scripts to aid us in normal development. We have some people that are more comfortable in python, some in perl, some in php, etc... Sometimes I think it is best to let people work in a language they are most comfortable with. This can mean that sometimes people can do a b...
2008/10/22
[ "https://Stackoverflow.com/questions/227585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16584/" ]
I would be inclined to let people choose, *and* hire people who are comfortable at learning new things. Gaining basic fluency with almost any language should be easy enough for a good developer. And for small scripts where the original author isn't far away, it's even easier. The second part of the above is the hard p...
No. Your dev environment is hopefully a living entity that changes and is cultivated. New abilities (scripting languages) should be able to be accommodated, and older places that haven't been visited for years will someday get obviated by tools, or revisited from time to time and an evaluation will take place. Hopefu...
227,585
At work we write a small to moderate amount of scripts to aid us in normal development. We have some people that are more comfortable in python, some in perl, some in php, etc... Sometimes I think it is best to let people work in a language they are most comfortable with. This can mean that sometimes people can do a b...
2008/10/22
[ "https://Stackoverflow.com/questions/227585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16584/" ]
My opinion is that it is just like any other development environment. Do you standardize on one development language? Why? The same should be true for your scripting environment. Not only do I lean toward standardizing on a specific language I think you should standardize all the same things that you are hopefully doin...
Per Project, anything checked in should probably follow a rule of minimal complexity. Your team will be gone some day, and someone else will have to come in and maintain this. Please don't make them learn 5 languages or they are going to look for your names in the source code an hunt you down. When we've picked up ha...
227,585
At work we write a small to moderate amount of scripts to aid us in normal development. We have some people that are more comfortable in python, some in perl, some in php, etc... Sometimes I think it is best to let people work in a language they are most comfortable with. This can mean that sometimes people can do a b...
2008/10/22
[ "https://Stackoverflow.com/questions/227585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16584/" ]
So long as the languages in question are used for scripting, I agree with other commenters that it should be left to the devteam, and different languages should be tolerated in most cases. If the language is used for your main codebase, you had better standardize on one. If some developers complain about a script not...
Per Project, anything checked in should probably follow a rule of minimal complexity. Your team will be gone some day, and someone else will have to come in and maintain this. Please don't make them learn 5 languages or they are going to look for your names in the source code an hunt you down. When we've picked up ha...
227,585
At work we write a small to moderate amount of scripts to aid us in normal development. We have some people that are more comfortable in python, some in perl, some in php, etc... Sometimes I think it is best to let people work in a language they are most comfortable with. This can mean that sometimes people can do a b...
2008/10/22
[ "https://Stackoverflow.com/questions/227585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16584/" ]
So long as the languages in question are used for scripting, I agree with other commenters that it should be left to the devteam, and different languages should be tolerated in most cases. If the language is used for your main codebase, you had better standardize on one. If some developers complain about a script not...
No. Your dev environment is hopefully a living entity that changes and is cultivated. New abilities (scripting languages) should be able to be accommodated, and older places that haven't been visited for years will someday get obviated by tools, or revisited from time to time and an evaluation will take place. Hopefu...
227,585
At work we write a small to moderate amount of scripts to aid us in normal development. We have some people that are more comfortable in python, some in perl, some in php, etc... Sometimes I think it is best to let people work in a language they are most comfortable with. This can mean that sometimes people can do a b...
2008/10/22
[ "https://Stackoverflow.com/questions/227585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16584/" ]
I think the right place to ask this question is with your own team. Your team should form a consensus as to whether or not they want a common platform or whether they want the freedom to choose the right tool for the job. There is no single best answer to this question any more than there is a single best answer for ...
No. Your dev environment is hopefully a living entity that changes and is cultivated. New abilities (scripting languages) should be able to be accommodated, and older places that haven't been visited for years will someday get obviated by tools, or revisited from time to time and an evaluation will take place. Hopefu...
227,585
At work we write a small to moderate amount of scripts to aid us in normal development. We have some people that are more comfortable in python, some in perl, some in php, etc... Sometimes I think it is best to let people work in a language they are most comfortable with. This can mean that sometimes people can do a b...
2008/10/22
[ "https://Stackoverflow.com/questions/227585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16584/" ]
I would advocate standardizing on a couple languages. "Thou shalt use either Python, or Perl, or Ruby. Not Rexx, nor PHP, nor NewBatch, nor aught other, for thy brethren ought to be able to read thine writing without undue despair or cutting of their skins".
My opinion is that it is just like any other development environment. Do you standardize on one development language? Why? The same should be true for your scripting environment. Not only do I lean toward standardizing on a specific language I think you should standardize all the same things that you are hopefully doin...
227,585
At work we write a small to moderate amount of scripts to aid us in normal development. We have some people that are more comfortable in python, some in perl, some in php, etc... Sometimes I think it is best to let people work in a language they are most comfortable with. This can mean that sometimes people can do a b...
2008/10/22
[ "https://Stackoverflow.com/questions/227585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16584/" ]
I would be inclined to let people choose, *and* hire people who are comfortable at learning new things. Gaining basic fluency with almost any language should be easy enough for a good developer. And for small scripts where the original author isn't far away, it's even easier. The second part of the above is the hard p...
My opinion is that it is just like any other development environment. Do you standardize on one development language? Why? The same should be true for your scripting environment. Not only do I lean toward standardizing on a specific language I think you should standardize all the same things that you are hopefully doin...
71,422,757
I have 4 data frames saved as .csv files or .txt (df1.csv,df2.csv,df3.txt,df4.txt). I would like to sum all the rows of df1 with df3 and df4 and of df2 with df3 and df4 in a loop. I would like to store the results in two separate sublists (one for df1 and one for df2) of a main list. Example: ``` df1 df3 colA ...
2022/03/10
[ "https://Stackoverflow.com/questions/71422757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10370098/" ]
Something like this? ``` lst1 <- list(df1<-c(5,1,3), df2<-c(0,2,1)) lst2 <- list(df3<-c(1,4,1), df4<-c(0,0,9)) res_lst <- list() for(i in seq_along(lst1)){ for(j in seq_along(lst2)){ res <- lst1[[i]]+lst2[[j]] res_lst <- append(res_lst, list(res)) } } splt_lst <- split(x = res_lst, f = rep(1:2, ea...
``` for (j in 1:length(files)) { cog_out_dat[[j]]<- lapply(meta_exp_dat,function(df) try(read_outcome_data( snps = df$SNP, filename = files[[j]], gene_col = "anno", sep = " ", chr_col = "CHR", pos_col = "BP", snp_col = "SNP", beta_col = "BETA", se_col = "SE", ...
71,422,757
I have 4 data frames saved as .csv files or .txt (df1.csv,df2.csv,df3.txt,df4.txt). I would like to sum all the rows of df1 with df3 and df4 and of df2 with df3 and df4 in a loop. I would like to store the results in two separate sublists (one for df1 and one for df2) of a main list. Example: ``` df1 df3 colA ...
2022/03/10
[ "https://Stackoverflow.com/questions/71422757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10370098/" ]
Something like this? ``` lst1 <- list(df1<-c(5,1,3), df2<-c(0,2,1)) lst2 <- list(df3<-c(1,4,1), df4<-c(0,0,9)) res_lst <- list() for(i in seq_along(lst1)){ for(j in seq_along(lst2)){ res <- lst1[[i]]+lst2[[j]] res_lst <- append(res_lst, list(res)) } } splt_lst <- split(x = res_lst, f = rep(1:2, ea...
Another possible solution: ```r set.seed(123) df1 <- data.frame(colA = sample(1:10, 3)) df2 <- data.frame(colA = sample(1:10, 3)) df3 <- data.frame(colA = sample(1:10, 3)) df4 <- data.frame(colA = sample(1:10, 3)) lapply(list(df1, df2), \(x) asplit(sapply(list(df3, df4), \(y) rowSums(cbind(x,y))), 2)) #> [[...
71,422,757
I have 4 data frames saved as .csv files or .txt (df1.csv,df2.csv,df3.txt,df4.txt). I would like to sum all the rows of df1 with df3 and df4 and of df2 with df3 and df4 in a loop. I would like to store the results in two separate sublists (one for df1 and one for df2) of a main list. Example: ``` df1 df3 colA ...
2022/03/10
[ "https://Stackoverflow.com/questions/71422757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10370098/" ]
Another possible solution: ```r set.seed(123) df1 <- data.frame(colA = sample(1:10, 3)) df2 <- data.frame(colA = sample(1:10, 3)) df3 <- data.frame(colA = sample(1:10, 3)) df4 <- data.frame(colA = sample(1:10, 3)) lapply(list(df1, df2), \(x) asplit(sapply(list(df3, df4), \(y) rowSums(cbind(x,y))), 2)) #> [[...
``` for (j in 1:length(files)) { cog_out_dat[[j]]<- lapply(meta_exp_dat,function(df) try(read_outcome_data( snps = df$SNP, filename = files[[j]], gene_col = "anno", sep = " ", chr_col = "CHR", pos_col = "BP", snp_col = "SNP", beta_col = "BETA", se_col = "SE", ...
29,712,760
I'm studying the module of Mark Pilgrim's Dive Into Python Book in chapter 6, and I'm kind of stuck with what this line of code `return [getFileInfoClass(f)(f) for f in fileList]` does. getFileInfo is a nested function and I was wondering what's the duplicate (f), the extra parentheses is for. I was hoping someone can ...
2015/04/18
[ "https://Stackoverflow.com/questions/29712760", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3243986/" ]
`getFileInfoClass` returns a `class`; classes are then callable themselves -- calling a `class` by just a name returns an instance of it. The two pairs of parens in quick succession are just shorthand. It is effectively: ``` file_info_class = getFileInfoClass(f) file_info_instance = file_info_class(f) ``` Generally,...
`getFileInfoClass` returns a class, so `getFileInfoClass(f)` is a class. When you take a class name and write parentheses after it, you call a constructor. So, `[getFileInfoClass(f)(f) for f in fileList]` makes a list of `FileInfo` objects.
190,014
When choosing each split, recursively, in a regression tree, I understand that you want to measure the *spread*, in each side of the split, essentially. So, in some sources, including this one at 6 minutes into the [video](https://www.youtube.com/watch?v=_RxqyvRK0Rw), I see that a different form of variance is used, e...
2016/01/10
[ "https://stats.stackexchange.com/questions/190014", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/119114/" ]
First off, let me just say that there are *plenty* of metrics that could be used to determine a split in the Regression Tree (that's an altogether different question) but the criterion you mentioned--minimizing the sum of squares--is definitely the most popular. With respect to your second question (i.e. why we don't ...
It's an old question but the reason I can think of is as follows: We don't divide each term by the number of points in each region because while performing the split, we are not interested in average deviance instead we are interested in the absolute deviance; thus, a larger set of observations will usually have a larg...
190,014
When choosing each split, recursively, in a regression tree, I understand that you want to measure the *spread*, in each side of the split, essentially. So, in some sources, including this one at 6 minutes into the [video](https://www.youtube.com/watch?v=_RxqyvRK0Rw), I see that a different form of variance is used, e...
2016/01/10
[ "https://stats.stackexchange.com/questions/190014", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/119114/" ]
So the best split offers the best gain. If the loss function is sum of squares the gain function could look like: $\sigma^2 = \frac{\sum{(y\_i-\overline{y})^2}}{N} = SS/N$, (SS is sum of sqaures) $gain = \frac{SS\_{parent}}{n\_{parent}} - w\_l \frac{SS\_{left}}{n\_{left}} - w\_r \frac{SS\_{right}}{n\_{right}}$ $w\_l...
It's an old question but the reason I can think of is as follows: We don't divide each term by the number of points in each region because while performing the split, we are not interested in average deviance instead we are interested in the absolute deviance; thus, a larger set of observations will usually have a larg...
190,014
When choosing each split, recursively, in a regression tree, I understand that you want to measure the *spread*, in each side of the split, essentially. So, in some sources, including this one at 6 minutes into the [video](https://www.youtube.com/watch?v=_RxqyvRK0Rw), I see that a different form of variance is used, e...
2016/01/10
[ "https://stats.stackexchange.com/questions/190014", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/119114/" ]
In order to compare the behavior of the different splitting formulas, let's consider a simple example: We have $N$ predictors with value $y=1$ in the left, $N$ predictors with value $y=-1$ in the right, and a single point at the right boundary with value $y^\ast$. [![enter image description here](https://i.stack.img...
It's an old question but the reason I can think of is as follows: We don't divide each term by the number of points in each region because while performing the split, we are not interested in average deviance instead we are interested in the absolute deviance; thus, a larger set of observations will usually have a larg...
73,902,269
So, I'm trying to code a strcat function using pointers, just for studying purposes. ``` #include <stdio.h> #include <string.h> char *strcpyy(char *dest, char *orig){ char *tmp = dest; while (*dest++ = *orig++); return tmp; } char *strcatt(char *dest, char *orig){ strcpyy(dest + strlen(dest), orig); ...
2022/09/29
[ "https://Stackoverflow.com/questions/73902269", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20061951/" ]
[String literals](https://en.cppreference.com/w/c/language/string_literal) are read-only. Any attempt to write to a string literal will invoke [undefined behavior](https://en.wikipedia.org/wiki/Undefined_behavior), which means that your program may crash or not behave as intended. Therefore, you should not use a point...
You declared two pointers to string literals ``` char *a = "one"; char *b = "two"; ``` You may not append one string literal to another. Instead you need to define the variable `a` as a character array large enough to contain the appended string literal pointed to by the pointer `b`. And the both functions should ...
73,902,269
So, I'm trying to code a strcat function using pointers, just for studying purposes. ``` #include <stdio.h> #include <string.h> char *strcpyy(char *dest, char *orig){ char *tmp = dest; while (*dest++ = *orig++); return tmp; } char *strcatt(char *dest, char *orig){ strcpyy(dest + strlen(dest), orig); ...
2022/09/29
[ "https://Stackoverflow.com/questions/73902269", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20061951/" ]
You declared two pointers to string literals ``` char *a = "one"; char *b = "two"; ``` You may not append one string literal to another. Instead you need to define the variable `a` as a character array large enough to contain the appended string literal pointed to by the pointer `b`. And the both functions should ...
You cannot modify "string literals". Those are not *mutable*. The usual *idiom* for this sort of operation is to build up a string in a temporary *working buffer* that *should be* pre-dimensioned large enough to hold all that is required. The following also shows more obvious code in both your functions. ``` #includ...
73,902,269
So, I'm trying to code a strcat function using pointers, just for studying purposes. ``` #include <stdio.h> #include <string.h> char *strcpyy(char *dest, char *orig){ char *tmp = dest; while (*dest++ = *orig++); return tmp; } char *strcatt(char *dest, char *orig){ strcpyy(dest + strlen(dest), orig); ...
2022/09/29
[ "https://Stackoverflow.com/questions/73902269", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20061951/" ]
[String literals](https://en.cppreference.com/w/c/language/string_literal) are read-only. Any attempt to write to a string literal will invoke [undefined behavior](https://en.wikipedia.org/wiki/Undefined_behavior), which means that your program may crash or not behave as intended. Therefore, you should not use a point...
You cannot modify "string literals". Those are not *mutable*. The usual *idiom* for this sort of operation is to build up a string in a temporary *working buffer* that *should be* pre-dimensioned large enough to hold all that is required. The following also shows more obvious code in both your functions. ``` #includ...
6,845,302
I want an automatically generated include-guard by creating a new C++-class with Eclipse/CDT, but I don't find any way to change the `${include_guard_symbol}` attribute. My wish is an include-guard with a namespace prefix like following: ``` #ifndef NAMSPACE1_NAMESPACE2_HEADER_HPP ``` But if I use `#ifndef ${namesp...
2011/07/27
[ "https://Stackoverflow.com/questions/6845302", "https://Stackoverflow.com", "https://Stackoverflow.com/users/828424/" ]
I had a dig around in the source for CDT, and found an undocumented preference setting you can use to change what is generated by `${include_guard_symbol}`. There's no GUI for it either, but if you add the `codetemplates.includeGuardGenerationScheme` setting to `<projectpath>/.settings/org.eclipse.cdt.ui.prefs`, you ca...
I'm using Eclipse Oxygen (CDT 9.3) and as Eelke described in their comment, there has been a UI setting for this for a while now. However it only lets you choose from the preset schemes, no namespace or richer customisation options available yet. Search for 'guard' in the preferences dialog, or navigate to C/C++ > Co...
40,167,098
I tried make 1 form to make login with different user level, so i tried to login with correct user and password (user level and admin level) then it redirect me to <http://localhost/dashboard/> (when it suppose direct to index.html if level user or direct to index.php if level admin) but when i tried input wrong userna...
2016/10/21
[ "https://Stackoverflow.com/questions/40167098", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4467921/" ]
As per `p` being defined as `struct cdev *p`, `p` is very much a "memory address" but that's not *all* it is - it also has a *type* attached to it. Since the expression `*ptr` is "the object pointed to by `ptr`", that *also* has the type attached, so you can logically do `(*ptr).member`. And, since `ptr->member` is i...
`->member` has higher precedence than `&`. ``` &p->kobj ``` parses as ``` &(p->kobj) ``` i.e. it's taking the address of the `kobj` member of the struct pointed to by `p`.
40,167,098
I tried make 1 form to make login with different user level, so i tried to login with correct user and password (user level and admin level) then it redirect me to <http://localhost/dashboard/> (when it suppose direct to index.html if level user or direct to index.php if level admin) but when i tried input wrong userna...
2016/10/21
[ "https://Stackoverflow.com/questions/40167098", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4467921/" ]
As per `p` being defined as `struct cdev *p`, `p` is very much a "memory address" but that's not *all* it is - it also has a *type* attached to it. Since the expression `*ptr` is "the object pointed to by `ptr`", that *also* has the type attached, so you can logically do `(*ptr).member`. And, since `ptr->member` is i...
You have the order of operations wrong: ``` &p->kobj // &(p->kobj) ```
40,167,098
I tried make 1 form to make login with different user level, so i tried to login with correct user and password (user level and admin level) then it redirect me to <http://localhost/dashboard/> (when it suppose direct to index.html if level user or direct to index.php if level admin) but when i tried input wrong userna...
2016/10/21
[ "https://Stackoverflow.com/questions/40167098", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4467921/" ]
As per `p` being defined as `struct cdev *p`, `p` is very much a "memory address" but that's not *all* it is - it also has a *type* attached to it. Since the expression `*ptr` is "the object pointed to by `ptr`", that *also* has the type attached, so you can logically do `(*ptr).member`. And, since `ptr->member` is i...
A pointer variable contains a memory address. What you need to consider is how the C programming language is used to write source code in a higher level language that is then converted for you into the machine code actually used by the computer. The C programming language is a language that was designed to make using ...
40,167,098
I tried make 1 form to make login with different user level, so i tried to login with correct user and password (user level and admin level) then it redirect me to <http://localhost/dashboard/> (when it suppose direct to index.html if level user or direct to index.php if level admin) but when i tried input wrong userna...
2016/10/21
[ "https://Stackoverflow.com/questions/40167098", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4467921/" ]
A pointer variable contains a memory address. What you need to consider is how the C programming language is used to write source code in a higher level language that is then converted for you into the machine code actually used by the computer. The C programming language is a language that was designed to make using ...
`->member` has higher precedence than `&`. ``` &p->kobj ``` parses as ``` &(p->kobj) ``` i.e. it's taking the address of the `kobj` member of the struct pointed to by `p`.
40,167,098
I tried make 1 form to make login with different user level, so i tried to login with correct user and password (user level and admin level) then it redirect me to <http://localhost/dashboard/> (when it suppose direct to index.html if level user or direct to index.php if level admin) but when i tried input wrong userna...
2016/10/21
[ "https://Stackoverflow.com/questions/40167098", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4467921/" ]
A pointer variable contains a memory address. What you need to consider is how the C programming language is used to write source code in a higher level language that is then converted for you into the machine code actually used by the computer. The C programming language is a language that was designed to make using ...
You have the order of operations wrong: ``` &p->kobj // &(p->kobj) ```
42,712,793
I want to plot correlation matrix in such a sense that it should be interactive and show both, correlation values and corresponding p-values in ggplot2 or plot\_ly. I have tried the following code. ``` library(ggplot2) library(plotly) library(reshape) library(Hmisc) x <- Seatbelts y <- as.mat...
2017/03/10
[ "https://Stackoverflow.com/questions/42712793", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7500099/" ]
Please try this: ``` let dateString = "2017-12-01 10:00:00 +0000" print("original date = \(dateString)") var formatter = DateFormatter() formatter.dateFormat = "yyyy-MM-dd HH:mm:ss Z" formatter.timeZone = TimeZone.init(abbreviation: "UTC") if let date = formatter.date(from: dateString) { formatter.timeZone = Ti...
GMT: `formatter.timeZone = TimeZone(abbreviation: NSTimeZone.local.abbreviation()!)` UTC: `formatter.timeZone = TimeZone(abbreviation: NSTimeZone.default.abbreviation()!)` To display local datetime, i use the GMTTimeZone.
3,469,223
Can anyone tell me how to go about building a QR generator? I would like to create custom QR codes for address book entry on mobile phones. Thank you for your help.
2010/08/12
[ "https://Stackoverflow.com/questions/3469223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/418580/" ]
EF BB BF is a Unicode Byte-Order Mark (BOM). Those are actually in your files. That's why Python is seeing it. Either ignore/discard the BOM or reencode the files to omit it.
That's a UTF-8 BOM (Byte Order Mark). You've probably edited the file with Notepad.
29,317,468
Is it possible and how to create and attach custom attribute to field at runtime? ``` uses System.SysUtils, System.Classes, System.Rtti; type MyAttribute = class(TCustomAttribute) private fCaption: string; public constructor Create(const aCaption: string); property Caption: string read fCaptio...
2015/03/28
[ "https://Stackoverflow.com/questions/29317468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4267244/" ]
The framework provides no mechanism for attaching attributes at runtime. Any attempt to do so would involve hacking the framework.
Attributes is compile-time magic. In run-time you don't need such things. Just create own dictionary where of type and member (member can be set as string) is key, and list of attributes is value. And, when you need to check attributes do it by two ways - common and in your dictionary.
60,480,912
I have two programs. They solve a system of linear equations. Both of them work correctly (they produce the same result). The first program works without concurrency. the second program is very similar to the first, with the exception that I added parallelism in some places. These places are marked in code. Here are...
2020/03/01
[ "https://Stackoverflow.com/questions/60480912", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12869366/" ]
You can try something like this. For converting an integer value to chrono in milliseconds use `std::chrono::milliseconds(value);` ``` auto old_time = std::chrono::high_resolution_clock::now(); this_thread::sleep_for(chrono::milliseconds(500)); auto new_time = std::chrono::high_resolution_clock::now(); auto time_since...
You should not use intervals in comparison. Use the absolute values instead. For example: ``` next_time = curr_time + duration<int>( ... etc ... ); if( time > next_time ) { // do something } ```
60,480,912
I have two programs. They solve a system of linear equations. Both of them work correctly (they produce the same result). The first program works without concurrency. the second program is very similar to the first, with the exception that I added parallelism in some places. These places are marked in code. Here are...
2020/03/01
[ "https://Stackoverflow.com/questions/60480912", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12869366/" ]
You can try something like this. For converting an integer value to chrono in milliseconds use `std::chrono::milliseconds(value);` ``` auto old_time = std::chrono::high_resolution_clock::now(); this_thread::sleep_for(chrono::milliseconds(500)); auto new_time = std::chrono::high_resolution_clock::now(); auto time_since...
``` #include <chrono> ... milliseconds time = (750ms-(lvl*50ms)); ``` I am assuming you were controlling some delay (time) with an integer (lvl)
506,433
For example, $2\*x = 2\*5$ implies $x = 5$ but how come, if $2$ doesn't have an inverse?
2013/09/27
[ "https://math.stackexchange.com/questions/506433", "https://math.stackexchange.com", "https://math.stackexchange.com/users/91377/" ]
The relevant property is that $\Bbb{Z}$ has no zero-divisors - that is, if you multiply two integers and get $0$, one of them had to be $0$. This is relevant because $$2 x = 2 \cdot 5 \implies 2 x - 2 \cdot 5 = 0 \implies 2 \cdot (x - 5) = 0$$ But since $2 \ne 0$, we find that $x - 5 = 0$. --- Alternatively, you ca...
It is because $\mathbb{Z}$ is an integral domain. It basically means that cancell ation is allowed, even though there is another formulation. We say $R$ is an integral domain if $xy=0$ then either $x$ or $y$ is zero. Above, you can rewrite $2x-2\cdot 5=0$ so $2(x-5)=0$, but $2$ isnt zero, so $x-5=0$ so $x=5$.
53,088
I am working with beamforming algorithms for speaker arrays. One of the problems we face is that we need to **estimate the maximum amplitude of our test signals after we applied FIR/IIR filters to them**. I am looking for ways to express the reduction in headroom that a given set of filters would give us. Ultimately I ...
2018/11/05
[ "https://dsp.stackexchange.com/questions/53088", "https://dsp.stackexchange.com", "https://dsp.stackexchange.com/users/37306/" ]
1. For an input with limited amplitude, the maximum amplitude gain of a filter can be calculated as the absolute sum of the impulse response 2. Scaling with the inverse of the absolute sum, will guarantee that your max output amplitude will never exceed the max input amplitude 3. In practice, this does NOT work well: I...
As mentioned in [Hilmar's answer](https://dsp.stackexchange.com/a/53091/4298), without any extra information, the only scaling that guarantees no increase in signal amplitude is $l\_1$-scaling, i.e., scaling by $\sum\_n|h[n]|$, where $h[n]$ are the filter coefficients: $$\big|y[n]\big|=\left|\sum\_kh[k]x[n-k]\right|\l...
93,795
I was redoing a logo that I did before for a company. Original Logo: [![Original Logo](https://i.stack.imgur.com/RkUyF.png)](https://i.stack.imgur.com/RkUyF.png) New Logo: [![New Logo](https://i.stack.imgur.com/LrGVP.png)](https://i.stack.imgur.com/LrGVP.png) Flat Version: [![Flat Version](https://i.stack.imgur.com/...
2017/06/24
[ "https://graphicdesign.stackexchange.com/questions/93795", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/54820/" ]
Add black strokes to the problematic places. All other can now be white or other light color. If it must stand as well in all dark backgrounds other than black, cut slits instead of the black strokes. Be sure that the strokes or slits are wide enough to be seen as printed or onscreen apps. [![enter image description h...
Try adding a white stroke to each shape in the logo to separate these on the monochrome version. Play with the thickness of the stroke and covert it to outlines when you're done so it scales properly at different sizes. If the shape is too complex for this to work, try stroking the [reduced version](https://i.stack.im...
932,495
I've been trying to evaluate properly the following limit $$\lim\_{n\to \infty}\frac{H\_n}{n}$$ where $H\_n$ is the $n$-th harmonic number $\left(H\_n=\sum\_{i=1}^n\frac1i\right)$. My guess is that the answer is $0$, but I would appreciate rigorous explanation.
2014/09/15
[ "https://math.stackexchange.com/questions/932495", "https://math.stackexchange.com", "https://math.stackexchange.com/users/96577/" ]
Note that by the Riemann definition of integral (noting the positiveness of the functions involved), by taking $\Delta x = 1$ and calculating the upperbound of the integral in each interval, you could see that $1 + \int\limits\_2^{n + 1} {\frac{{dx}}{{x - 1}}} \ge \sum\limits\_{i = 1}^n {\frac{1}{i}} $, that is $$\sum\...
**Hint** For large values of $n$, the harmonic number can be approximated by $$H\_n=\gamma +\log (n)+O\left(\left(\frac{1}{n}\right)\right)$$ So, taking into account the respective behavior of $\log(n)$ and $n$, the limit you are looking for is $0$. This is an expansion to remember since very often used in the conte...
932,495
I've been trying to evaluate properly the following limit $$\lim\_{n\to \infty}\frac{H\_n}{n}$$ where $H\_n$ is the $n$-th harmonic number $\left(H\_n=\sum\_{i=1}^n\frac1i\right)$. My guess is that the answer is $0$, but I would appreciate rigorous explanation.
2014/09/15
[ "https://math.stackexchange.com/questions/932495", "https://math.stackexchange.com", "https://math.stackexchange.com/users/96577/" ]
> > With [Stolz–Cesàro Theorem](http://en.wikipedia.org/wiki/Stolz%E2%80%93Ces%C3%A0ro_theorem) : > > > $$ \lim\_{n\ \to\ \infty}{H\_{n + 1} - H\_{n} \over \left(\,n + 1\,\right) - n} =\lim\_{n\ \to\ \infty}{1 \over n + 1} = 0\qquad\Longrightarrow\qquad\color{#66f}{\large\lim\_{n\ \to\ \infty}{H\_{n} \over n}} = \...
**Hint** For large values of $n$, the harmonic number can be approximated by $$H\_n=\gamma +\log (n)+O\left(\left(\frac{1}{n}\right)\right)$$ So, taking into account the respective behavior of $\log(n)$ and $n$, the limit you are looking for is $0$. This is an expansion to remember since very often used in the conte...
932,495
I've been trying to evaluate properly the following limit $$\lim\_{n\to \infty}\frac{H\_n}{n}$$ where $H\_n$ is the $n$-th harmonic number $\left(H\_n=\sum\_{i=1}^n\frac1i\right)$. My guess is that the answer is $0$, but I would appreciate rigorous explanation.
2014/09/15
[ "https://math.stackexchange.com/questions/932495", "https://math.stackexchange.com", "https://math.stackexchange.com/users/96577/" ]
Note that by the Riemann definition of integral (noting the positiveness of the functions involved), by taking $\Delta x = 1$ and calculating the upperbound of the integral in each interval, you could see that $1 + \int\limits\_2^{n + 1} {\frac{{dx}}{{x - 1}}} \ge \sum\limits\_{i = 1}^n {\frac{1}{i}} $, that is $$\sum\...
> > With [Stolz–Cesàro Theorem](http://en.wikipedia.org/wiki/Stolz%E2%80%93Ces%C3%A0ro_theorem) : > > > $$ \lim\_{n\ \to\ \infty}{H\_{n + 1} - H\_{n} \over \left(\,n + 1\,\right) - n} =\lim\_{n\ \to\ \infty}{1 \over n + 1} = 0\qquad\Longrightarrow\qquad\color{#66f}{\large\lim\_{n\ \to\ \infty}{H\_{n} \over n}} = \...
34,934,484
I'm new to c# and the whole .net platform so I'm struggling with a lot of what are probably pretty basic things. go easy on me. All I'm trying to do right now is return an array of json objects (as strings, obviously). ``` [HttpPost] public string[] PostJsonString([FromBody] string[] arr) { return arr; ...
2016/01/21
[ "https://Stackoverflow.com/questions/34934484", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4922768/" ]
``` [HttpPost] public JsonResult PostJsonString([FromBody] string[] arr) { return Json(arr); } ```
Your controller will receive a *single string* ``` "[{\"someProp\":\"someVal\"},{ \"aThing\":\"someOtherThing\"}]" ``` Change the method's signature to ``` public string PostJsonString([FromBody] string arr) ``` When you want to work with the JSON array, I recommend using `JSON.net` (aka `Newtonsoft.Json`) and [...
5,782,920
I have the following regex that I am using to match on various credit card numbers within a string search of files. However, if there is a space before or after the pattern to match, then the match will fail. ``` $CC_Regex = "^(\d{4}-){3}\d{4}$|^(\d{4} ){3}\d{4}$|^\d{16}$" ``` For example, it will match the top thre...
2011/04/25
[ "https://Stackoverflow.com/questions/5782920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/570402/" ]
It would be easy enough to augment the regex to handle whitespace at the front and end: ``` ^\s*(?:(\d{4}-){3}\d{4}|(\d{4} ){3}\d{4}|\d{16})\s*$ ``` but it seems more prudent to take the string, remove everything except digits, and then check if it's a 16-digit number: ``` $result = $subject -creplace '[^0-9]+', ''...
I don't know how specifically to do this in PowerShell, but it'd be a lot easier to use some sort of replace() function to get rid of the spaces (or the equivalent in PowerShell). ``` replace(' ', ''); ``` **EDIT:** Actually, it'd make more sense to remove *everything* that's not a digit first. You could do that wit...
5,782,920
I have the following regex that I am using to match on various credit card numbers within a string search of files. However, if there is a space before or after the pattern to match, then the match will fail. ``` $CC_Regex = "^(\d{4}-){3}\d{4}$|^(\d{4} ){3}\d{4}$|^\d{16}$" ``` For example, it will match the top thre...
2011/04/25
[ "https://Stackoverflow.com/questions/5782920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/570402/" ]
It would be easy enough to augment the regex to handle whitespace at the front and end: ``` ^\s*(?:(\d{4}-){3}\d{4}|(\d{4} ){3}\d{4}|\d{16})\s*$ ``` but it seems more prudent to take the string, remove everything except digits, and then check if it's a 16-digit number: ``` $result = $subject -creplace '[^0-9]+', ''...
``` $CC_Regex = "^\s*(\d{4}-){3}\d{4}\s*$|^\s*(\d{4} ){3}\d{4}\s*$|^\s*\d{16}\s*$" ``` will make it match even if leading or trailing whitepsace is present (`\s` means any whitespace character).
5,782,920
I have the following regex that I am using to match on various credit card numbers within a string search of files. However, if there is a space before or after the pattern to match, then the match will fail. ``` $CC_Regex = "^(\d{4}-){3}\d{4}$|^(\d{4} ){3}\d{4}$|^\d{16}$" ``` For example, it will match the top thre...
2011/04/25
[ "https://Stackoverflow.com/questions/5782920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/570402/" ]
It would be easy enough to augment the regex to handle whitespace at the front and end: ``` ^\s*(?:(\d{4}-){3}\d{4}|(\d{4} ){3}\d{4}|\d{16})\s*$ ``` but it seems more prudent to take the string, remove everything except digits, and then check if it's a 16-digit number: ``` $result = $subject -creplace '[^0-9]+', ''...
``` $CC_Regex = "(?:\d{4}[- ]?){3}\d{4}" ```
5,782,920
I have the following regex that I am using to match on various credit card numbers within a string search of files. However, if there is a space before or after the pattern to match, then the match will fail. ``` $CC_Regex = "^(\d{4}-){3}\d{4}$|^(\d{4} ){3}\d{4}$|^\d{16}$" ``` For example, it will match the top thre...
2011/04/25
[ "https://Stackoverflow.com/questions/5782920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/570402/" ]
It would be easy enough to augment the regex to handle whitespace at the front and end: ``` ^\s*(?:(\d{4}-){3}\d{4}|(\d{4} ){3}\d{4}|\d{16})\s*$ ``` but it seems more prudent to take the string, remove everything except digits, and then check if it's a 16-digit number: ``` $result = $subject -creplace '[^0-9]+', ''...
How about this `^(?<myregex>\s{0,}\d{4}-{0,}\s{0,}\d{4}-{0,}\s{0,}\d{4}-{0,}\s{0,}\d{4}).*?`
5,782,920
I have the following regex that I am using to match on various credit card numbers within a string search of files. However, if there is a space before or after the pattern to match, then the match will fail. ``` $CC_Regex = "^(\d{4}-){3}\d{4}$|^(\d{4} ){3}\d{4}$|^\d{16}$" ``` For example, it will match the top thre...
2011/04/25
[ "https://Stackoverflow.com/questions/5782920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/570402/" ]
I don't know how specifically to do this in PowerShell, but it'd be a lot easier to use some sort of replace() function to get rid of the spaces (or the equivalent in PowerShell). ``` replace(' ', ''); ``` **EDIT:** Actually, it'd make more sense to remove *everything* that's not a digit first. You could do that wit...
``` $CC_Regex = "(?:\d{4}[- ]?){3}\d{4}" ```
5,782,920
I have the following regex that I am using to match on various credit card numbers within a string search of files. However, if there is a space before or after the pattern to match, then the match will fail. ``` $CC_Regex = "^(\d{4}-){3}\d{4}$|^(\d{4} ){3}\d{4}$|^\d{16}$" ``` For example, it will match the top thre...
2011/04/25
[ "https://Stackoverflow.com/questions/5782920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/570402/" ]
I don't know how specifically to do this in PowerShell, but it'd be a lot easier to use some sort of replace() function to get rid of the spaces (or the equivalent in PowerShell). ``` replace(' ', ''); ``` **EDIT:** Actually, it'd make more sense to remove *everything* that's not a digit first. You could do that wit...
How about this `^(?<myregex>\s{0,}\d{4}-{0,}\s{0,}\d{4}-{0,}\s{0,}\d{4}-{0,}\s{0,}\d{4}).*?`
5,782,920
I have the following regex that I am using to match on various credit card numbers within a string search of files. However, if there is a space before or after the pattern to match, then the match will fail. ``` $CC_Regex = "^(\d{4}-){3}\d{4}$|^(\d{4} ){3}\d{4}$|^\d{16}$" ``` For example, it will match the top thre...
2011/04/25
[ "https://Stackoverflow.com/questions/5782920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/570402/" ]
``` $CC_Regex = "^\s*(\d{4}-){3}\d{4}\s*$|^\s*(\d{4} ){3}\d{4}\s*$|^\s*\d{16}\s*$" ``` will make it match even if leading or trailing whitepsace is present (`\s` means any whitespace character).
``` $CC_Regex = "(?:\d{4}[- ]?){3}\d{4}" ```
5,782,920
I have the following regex that I am using to match on various credit card numbers within a string search of files. However, if there is a space before or after the pattern to match, then the match will fail. ``` $CC_Regex = "^(\d{4}-){3}\d{4}$|^(\d{4} ){3}\d{4}$|^\d{16}$" ``` For example, it will match the top thre...
2011/04/25
[ "https://Stackoverflow.com/questions/5782920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/570402/" ]
``` $CC_Regex = "^\s*(\d{4}-){3}\d{4}\s*$|^\s*(\d{4} ){3}\d{4}\s*$|^\s*\d{16}\s*$" ``` will make it match even if leading or trailing whitepsace is present (`\s` means any whitespace character).
How about this `^(?<myregex>\s{0,}\d{4}-{0,}\s{0,}\d{4}-{0,}\s{0,}\d{4}-{0,}\s{0,}\d{4}).*?`
7,519,680
I have a controller called "products\_controllers.rb" that have this method: ``` def create ... ... respond_to do |format| if @product.save ??????? else format.html { render :action => "new" } format.xml { render :xml => @product.errors, :status => :unprocessable_entity } end end `...
2011/09/22
[ "https://Stackoverflow.com/questions/7519680", "https://Stackoverflow.com", "https://Stackoverflow.com/users/959786/" ]
If you're using restful routes and there is a relationship where product has many suppliers, you could use: ``` format.html { redirect_to product_suppliers_url(@product) } ``` with something like this in your routes.rb: ``` map.resource :products do |product| product.resource :suppliers end ``` or you could als...
Something like `redirect_to 'product/suppliers'` Source: <http://guides.rubyonrails.org/layouts_and_rendering.html#using-redirect_to> Comment: Next time make sure to specify "in rails" in the text of your question since views and controllers are used by many frameworks.
7,519,680
I have a controller called "products\_controllers.rb" that have this method: ``` def create ... ... respond_to do |format| if @product.save ??????? else format.html { render :action => "new" } format.xml { render :xml => @product.errors, :status => :unprocessable_entity } end end `...
2011/09/22
[ "https://Stackoverflow.com/questions/7519680", "https://Stackoverflow.com", "https://Stackoverflow.com/users/959786/" ]
If you're using restful routes and there is a relationship where product has many suppliers, you could use: ``` format.html { redirect_to product_suppliers_url(@product) } ``` with something like this in your routes.rb: ``` map.resource :products do |product| product.resource :suppliers end ``` or you could als...
In your controller: ``` def create ... ... respond_to do |format| if @product.save ??????? else format.html { render :action => "suppliers" } format.xml { render :xml => @product.errors, :status => :unprocessable_entity } end end def suppliers #Your suppliers code goes here end ...
42,734,830
I am playing with image color quantization algorithms. I have found this link [Color Thief](https://github.com/lokesh/color-thief) where a javascript (a language that I have never studied) implementation of a modified median cut algorithm is presented. But the demo shows just the ten dominant colors. I would like to...
2017/03/11
[ "https://Stackoverflow.com/questions/42734830", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1048226/" ]
Here, I made this just for you. I assume you want to *simplify* colors of an image to its palette provided by `color-thief`. To achieve this I used [color-thief](https://github.com/lokesh/color-thief) and [nearest-color](https://github.com/dtao/nearest-color). Basically, you want to generate a color-thief's palette,...
I do not know the content of the page. But if I understand correctly what you do, you should start studying jQuery to manipulate events (checks, animations, etc.) of images. [enter link description here](https://jquery.com/) this is an example that i found with jquery for 'color thief' [enter link description here](...
24,421,116
I´m trying to compile this glsl shader but looks like has something wrong, because he fails. This is the message error the \_log gaves me: Vertex shader(s) were not successfully compiled before glLinkProgram()was called.Link failed. Its a light per vertex shader: ``` vec4 ambient() { vec4 ambient = vec...
2014/06/26
[ "https://Stackoverflow.com/questions/24421116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2330610/" ]
``` [0.0, 0.1, 0.2, 0.1, 0.3, 0.3, 0.1] .group_by{|e| e}.max_by{|k, v| v.length}.first # => 0.1 ```
The following will work for bimodal and multimodal datasets, but only returns a single value. For bimodal/multimodal datasets it always returns the value that occurs first in the array. ``` # returns 1.0 a = [1.0, 1.0, 2.0, 2.0, 3.0] a.max_by { |x| a.count(x) } ``` You can also try the [easystats](https://github.co...
24,421,116
I´m trying to compile this glsl shader but looks like has something wrong, because he fails. This is the message error the \_log gaves me: Vertex shader(s) were not successfully compiled before glLinkProgram()was called.Link failed. Its a light per vertex shader: ``` vec4 ambient() { vec4 ambient = vec...
2014/06/26
[ "https://Stackoverflow.com/questions/24421116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2330610/" ]
[DescriptiveStatistics](https://github.com/thirtysixthspan/descriptive_statistics) adds methods to the Enumerable module to allow easy calculation of basic descriptive statistics of Numeric sample data in collections that have included Enumerable such as Array, Hash, Set, and Range. ``` > require 'descriptive_statist...
The following will work for bimodal and multimodal datasets, but only returns a single value. For bimodal/multimodal datasets it always returns the value that occurs first in the array. ``` # returns 1.0 a = [1.0, 1.0, 2.0, 2.0, 3.0] a.max_by { |x| a.count(x) } ``` You can also try the [easystats](https://github.co...
24,421,116
I´m trying to compile this glsl shader but looks like has something wrong, because he fails. This is the message error the \_log gaves me: Vertex shader(s) were not successfully compiled before glLinkProgram()was called.Link failed. Its a light per vertex shader: ``` vec4 ambient() { vec4 ambient = vec...
2014/06/26
[ "https://Stackoverflow.com/questions/24421116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2330610/" ]
``` [0.0, 0.1, 0.2, 0.1, 0.3, 0.3, 0.1] .group_by{|e| e}.max_by{|k, v| v.length}.first # => 0.1 ```
[DescriptiveStatistics](https://github.com/thirtysixthspan/descriptive_statistics) adds methods to the Enumerable module to allow easy calculation of basic descriptive statistics of Numeric sample data in collections that have included Enumerable such as Array, Hash, Set, and Range. ``` > require 'descriptive_statist...
39,531,012
I making a webapp ,in which i want to **send data to server periodically**(with out refreshing) while the user is on some page.how can i do that using JavaScript or ajax or any other technology?
2016/09/16
[ "https://Stackoverflow.com/questions/39531012", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6829360/" ]
You don't have to modify all the template files manually. Perl has HTML parsers that can help you locate where the changes need to be made. Go ahead and fix the templates once as opposed to modifying your code to do it each and every time it runs. Below, I use `\*DATA` for illustrative purposes, but, clearly, the list ...
> > Is there any method available in HTML::Template to do this? > > > This again? ;) No, you need to read and manipulate the DOM to do what you want. HTML::Template only works with it's specific tags/markers. Store `$template->output()` into a variable. Read the variable with a parser such as [Mojo::DOM](https://m...
29,789,714
I want to implement a **Queue** of elements in android/java such that, 1. When I insert an element in that Queue, that element will start executing immediately if that is the only element in the Queue. 2. If there are other elements in the Queue, they get executed sequentially one after the other. 3. Once all the elem...
2015/04/22
[ "https://Stackoverflow.com/questions/29789714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/840669/" ]
What you need is described in the [JavaDoc](http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Executor.html). There is an implementation called SerialExecutor which might fit your problem.
Why dont you try to implement a listener, which will keep listening to the queue. This will make sure as soon as new entries are in there, they would start getting executed.
43,116,999
I need a jsonschema to validate JSON where all keys are required to be strings. All keys are arbitrary. For example this should be valid ``` { "123": "GET", "key2": "/mellons/and/strawberries", "arbitrary_key": { "SomeKey": "some data", }, } ``` while this should not ``` { 123: "GET"...
2017/03/30
[ "https://Stackoverflow.com/questions/43116999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1451794/" ]
According to [JSON](http://json.org/) the object keys are always strings (just take a look at the first graph). Some parsers may allow the use of numbers too as a string though. Since json schema is supposed to validate the structure of valid json documents, it won't recognize lexically malformed json strings. This is...
``` a={ 123: "GET", "key2": "/mellons/and/strawberries", "arbitrary_key": { "SomeKey": "some data", }, }; Object.keys(a) // this gives array of keys can assign check here ```
312,882
What do we mean when we say that Newton's Second Law of Motion is invariant under Galilean transformations? Does it mean that the value of a force measured in one reference frame is the same when measured in another reference frame, which are moving with constant velocity relative to each other? Or that the form of th...
2017/02/17
[ "https://physics.stackexchange.com/questions/312882", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/112205/" ]
> > What does it mean by saying that Newton's laws are invariant under Galilean transformations? > > > Simply speaking, the structure of the Newton's law (or the dynamical equation) is preserved under a Galilean transformation. You can see from these transformation equations that the acceleration of a particle as ...
Newton's law are invariant only when transformed from one inertial frame to another. Galilean transformation connect inertial frames, which would mean (if I understand your notation right) that $du/dt=0$. --- Well... one of those derivatives will be 0. I don't quite understand why you need three accelerating frames.....
27,228,822
I found [this extension](http://www.yiiframework.com/extension/input) for `Yii 1.1` but don't see any relevant extension for `Yii 2`. So I'm wondering if there is one or is it built-in by default? Also, when data properties gets set in your `model` for a form such as: ``` namespace app\models; use yii\base\model; c...
2014/12/01
[ "https://Stackoverflow.com/questions/27228822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/472501/" ]
You can try using HTMLPurifier for sanitizing input like so: ``` [['attr1', 'attr2'], function ($attribute) { $this->$attribute = \yii\helpers\HtmlPurifier::process($this->$attribute); }], ```
I'm surprised that in 4 months this subject hasn't got more feedback. I think that there is no easy, cure-all extension and, as with any web application, it depends on the type of data being input and how you are going to store it and then use it. However, I think the following Yii1 wiki page is still every bit as re...
30,772,765
I am trying to ease the data entry from financial report, so i try to make forms using Excel Visual Basic. I made 2 Userform so far ,later i will made 5. I made userform so the data entry operator can have simple design of the form, because the textboxs are so many,then I partitioned the sector into 5 userform to simp...
2015/06/11
[ "https://Stackoverflow.com/questions/30772765", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3292755/" ]
Try this: ``` function myfunction() { return $http.post('url') .then(function(response){ // check success-property of returned data if(response.data === 'Something you dont want') return $q.reject('some error occured'); else{ return $q.res...
As $http is a modified promise do something like : ``` var deferred = $q.defer(); $http.get(url).success(function(r) { if(r != 'your criteria') deferred.reject("Booh"); else deferred.resolve("Baah"); }).error(function(){ deferred.reject("Beeh"); }); return deferred.promise ```
30,772,765
I am trying to ease the data entry from financial report, so i try to make forms using Excel Visual Basic. I made 2 Userform so far ,later i will made 5. I made userform so the data entry operator can have simple design of the form, because the textboxs are so many,then I partitioned the sector into 5 userform to simp...
2015/06/11
[ "https://Stackoverflow.com/questions/30772765", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3292755/" ]
Try this: ``` function myfunction() { return $http.post('url') .then(function(response){ // check success-property of returned data if(response.data === 'Something you dont want') return $q.reject('some error occured'); else{ return $q.res...
You can use de reject method of the $q service to immetiately forward to the next error section, something like: ``` var deferred = $q.defer(); $http.get(url}.success(function(r) { deferred.reject(); }).error(function(){ // do something }); ``` When success q.reject will forward to the error and do somethin...
24,643,097
How do I permanently remove cloud9, bonescript, gateone, etc., from the BeagleBone Black Debian (wheezy) distribution? I can disable them with these commands: ``` systemctl disable cloud9.service systemctl disable gateone.service systemctl disable bonescript.service systemctl disable bonescript.socket systemctl disabl...
2014/07/08
[ "https://Stackoverflow.com/questions/24643097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/210948/" ]
As the Cloud9 IDE is built on node (which I did not need) I got rid av the whole shebang using: ``` sudo apt-get remove nodejs sudo apt-get autoremove ```
Try it: in your terminal, type ``` ls /lib/systemd/system ``` if your service files are there, just delete them.
24,643,097
How do I permanently remove cloud9, bonescript, gateone, etc., from the BeagleBone Black Debian (wheezy) distribution? I can disable them with these commands: ``` systemctl disable cloud9.service systemctl disable gateone.service systemctl disable bonescript.service systemctl disable bonescript.socket systemctl disabl...
2014/07/08
[ "https://Stackoverflow.com/questions/24643097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/210948/" ]
systemctl **enable** create a symlink to location /usr/lib/systemd/system and the **disable** will remove the symlink. This two command only affect the auto start behavior of the service on boot time. So in real time, the service is still there but not auto started if some other service require this service it will ge...
Try it: in your terminal, type ``` ls /lib/systemd/system ``` if your service files are there, just delete them.
11,857,529
i have write code to delete multiple record in gridview but it only delete one record in gridview. Could someone help me to solve this problem. Here is my code ``` 'This is to Delete multiple records in gridview Private Sub DeleteMultipleRecords(ByVal idCollection As StringCollection) 'Create sql Connection and S...
2012/08/08
[ "https://Stackoverflow.com/questions/11857529", "https://Stackoverflow.com", "https://Stackoverflow.com/users/692495/" ]
*initKeyboardEvent* was originallly *initKeyEvent*, there is a working example at MDN: <https://developer.mozilla.org/en-US/docs/DOM/event.initKeyEvent> and here: <http://www.howtocreate.co.uk/tutorials/javascript/domevents>. I'm sure you can find many examples through a web search: "javascript initkeyevent" and "jav...
See my answer [here](https://stackoverflow.com/a/14561303/1587897) In short: Here [Cross-browser initKeyboardEvent](https://gist.github.com/4654819/) Here [Keyboard Event Level 3 polyfill](https://github.com/termi/DOM-Keyboard-Event-Level-3-polyfill) Example: ``` var a = new KeyboardEvent("keypress", {"key": 1, "c...
1,184,516
* What's the limitation? * Is there a specific volume of data each can handle regardless of disk space? * When to use what assuming licensing is not a problem?
2009/07/26
[ "https://Stackoverflow.com/questions/1184516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37740/" ]
It depends what you are trying to do and obviously it has to do with cost. * MySQL and Postgres are very widely used by a huge number of startups because its open source and there is a lot of support out there for people using it * MSSQL is good if you are using MS programming languages because of the ease to connect ...
It would help narrow things a great deal if you'd provide details like whether or not you intend to distribute the database along with your software; your system will be hosted; how much data; etc. Don't assume anything with regard to licensing. Get a lawyer, maybe even one who specializes in open source law. "...re...
1,184,516
* What's the limitation? * Is there a specific volume of data each can handle regardless of disk space? * When to use what assuming licensing is not a problem?
2009/07/26
[ "https://Stackoverflow.com/questions/1184516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37740/" ]
This is a very nuanced question that really cannot be easily answered, as each situation can provide many pluses and minuses. Also, MySQL being owned by Oracle now and several branches off of the main functionality means that MySQL != MySQL anymore. If you are looking for really really big data sets, then you will lik...
It would help narrow things a great deal if you'd provide details like whether or not you intend to distribute the database along with your software; your system will be hosted; how much data; etc. Don't assume anything with regard to licensing. Get a lawyer, maybe even one who specializes in open source law. "...re...
1,184,516
* What's the limitation? * Is there a specific volume of data each can handle regardless of disk space? * When to use what assuming licensing is not a problem?
2009/07/26
[ "https://Stackoverflow.com/questions/1184516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37740/" ]
As to skaffman's point you may want to have a look at postgres if mysql isn't scaling for you. It is a more mature and robust than mysql and is opensource. The time to make the switch is highly dependent on you application environment, however, if you need clustering and replication to work properly 100% of the time th...
It would help narrow things a great deal if you'd provide details like whether or not you intend to distribute the database along with your software; your system will be hosted; how much data; etc. Don't assume anything with regard to licensing. Get a lawyer, maybe even one who specializes in open source law. "...re...
1,184,516
* What's the limitation? * Is there a specific volume of data each can handle regardless of disk space? * When to use what assuming licensing is not a problem?
2009/07/26
[ "https://Stackoverflow.com/questions/1184516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37740/" ]
This is a very nuanced question that really cannot be easily answered, as each situation can provide many pluses and minuses. Also, MySQL being owned by Oracle now and several branches off of the main functionality means that MySQL != MySQL anymore. If you are looking for really really big data sets, then you will lik...
Perhaps one variable which people overlook in these cases is the availability of expert support. Okay, so currently there's an oversupply of people who can help you with db issues, efficiency issues, disaster recovery etc. However this may not be always the case in the future, and it's the applications you use it for t...
1,184,516
* What's the limitation? * Is there a specific volume of data each can handle regardless of disk space? * When to use what assuming licensing is not a problem?
2009/07/26
[ "https://Stackoverflow.com/questions/1184516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37740/" ]
It depends what you are trying to do and obviously it has to do with cost. * MySQL and Postgres are very widely used by a huge number of startups because its open source and there is a lot of support out there for people using it * MSSQL is good if you are using MS programming languages because of the ease to connect ...
Perhaps one variable which people overlook in these cases is the availability of expert support. Okay, so currently there's an oversupply of people who can help you with db issues, efficiency issues, disaster recovery etc. However this may not be always the case in the future, and it's the applications you use it for t...
1,184,516
* What's the limitation? * Is there a specific volume of data each can handle regardless of disk space? * When to use what assuming licensing is not a problem?
2009/07/26
[ "https://Stackoverflow.com/questions/1184516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37740/" ]
It depends what you are trying to do and obviously it has to do with cost. * MySQL and Postgres are very widely used by a huge number of startups because its open source and there is a lot of support out there for people using it * MSSQL is good if you are using MS programming languages because of the ease to connect ...
As to skaffman's point you may want to have a look at postgres if mysql isn't scaling for you. It is a more mature and robust than mysql and is opensource. The time to make the switch is highly dependent on you application environment, however, if you need clustering and replication to work properly 100% of the time th...
1,184,516
* What's the limitation? * Is there a specific volume of data each can handle regardless of disk space? * When to use what assuming licensing is not a problem?
2009/07/26
[ "https://Stackoverflow.com/questions/1184516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37740/" ]
I'd say if you want to compare apples to apples, then it is MySQL vs SQL Express, vs Oracle Express. Or if you have $, then it is the MySQL support license, MS-SQL Standard, vs whatever Oracle's cheapest offering is. In my experience, once you choose a language, e.g. Php goes best with MySQL, then you've chosen your ...
Perhaps one variable which people overlook in these cases is the availability of expert support. Okay, so currently there's an oversupply of people who can help you with db issues, efficiency issues, disaster recovery etc. However this may not be always the case in the future, and it's the applications you use it for t...
1,184,516
* What's the limitation? * Is there a specific volume of data each can handle regardless of disk space? * When to use what assuming licensing is not a problem?
2009/07/26
[ "https://Stackoverflow.com/questions/1184516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37740/" ]
I'd say if you want to compare apples to apples, then it is MySQL vs SQL Express, vs Oracle Express. Or if you have $, then it is the MySQL support license, MS-SQL Standard, vs whatever Oracle's cheapest offering is. In my experience, once you choose a language, e.g. Php goes best with MySQL, then you've chosen your ...
Is the application buy or build ? * If Buy, does it support all three and talk to the app vendor about the differences ? * If Build, then is it an in-house build or contract out. If contracting out, put out your requirements and let the suppliers put their arguments. * If in house build, then first look at why you are...
1,184,516
* What's the limitation? * Is there a specific volume of data each can handle regardless of disk space? * When to use what assuming licensing is not a problem?
2009/07/26
[ "https://Stackoverflow.com/questions/1184516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37740/" ]
This is a very nuanced question that really cannot be easily answered, as each situation can provide many pluses and minuses. Also, MySQL being owned by Oracle now and several branches off of the main functionality means that MySQL != MySQL anymore. If you are looking for really really big data sets, then you will lik...
I'd say if you want to compare apples to apples, then it is MySQL vs SQL Express, vs Oracle Express. Or if you have $, then it is the MySQL support license, MS-SQL Standard, vs whatever Oracle's cheapest offering is. In my experience, once you choose a language, e.g. Php goes best with MySQL, then you've chosen your ...
1,184,516
* What's the limitation? * Is there a specific volume of data each can handle regardless of disk space? * When to use what assuming licensing is not a problem?
2009/07/26
[ "https://Stackoverflow.com/questions/1184516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37740/" ]
This is a very nuanced question that really cannot be easily answered, as each situation can provide many pluses and minuses. Also, MySQL being owned by Oracle now and several branches off of the main functionality means that MySQL != MySQL anymore. If you are looking for really really big data sets, then you will lik...
It depends what you are trying to do and obviously it has to do with cost. * MySQL and Postgres are very widely used by a huge number of startups because its open source and there is a lot of support out there for people using it * MSSQL is good if you are using MS programming languages because of the ease to connect ...
6,018,781
Is it possible to open a new minimized browser window using javascript? At the moment I have `onclick='window.open'`
2011/05/16
[ "https://Stackoverflow.com/questions/6018781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/755789/" ]
No. You can try blurring the window and bringing the other window to the front, but you will not be able to minimize it. ``` var winpop = window.open(...); winpop.blur(); window.focus(); ```
No. For security reasons... this is not possible... even the idea sounds spammy.
10,301,987
This may be a long shot to do without using JavaScript... If I have the following (stripped out code for the problem) ``` <div id="container"> <div id="content"></div> </div> ``` ```css #container { position: relative; } #content { position: absolute; } ``` The content box contains dynamic content so...
2012/04/24
[ "https://Stackoverflow.com/questions/10301987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/344932/" ]
edit: I misunderstood the question the first time. If all else fails, here's a jQuery solution: ``` $('#container').css('height',$('#content').height()); ```
Ok, I have no idea what your content is (jQuery UI stuff). However, say it's just an image: ``` #container { position: relative; } #content { position: absolute; top:0; bottom:0; left:0; right:0; } ``` This will set your content area to at least 100% width and height of the parent.
43,028,028
I'm really new to coding and I have a question. Ok so im trying to create a custom ListView with some strings I parsed with jSoup but for some reason it doesn't work, it says cannot resolve symbol CustomAdaptor. I dont know if this is because i implemented the Listview class wrong or because i implemented it in the wro...
2017/03/26
[ "https://Stackoverflow.com/questions/43028028", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7729491/" ]
If you want to add plots to your Jupyter notebook, then `%matplotlib inline` is a standard solution. And there are other magic commands will use `matplotlib` interactively within Jupyter. `%matplotlib`: any `plt` plot command will now cause a figure window to open, and further commands can be run to update the plot. S...
**TL;DR** `%matplotlib inline` - Displays output inline ============================================= --- IPython kernel has the ability to display plots by executing code. The IPython kernel is designed to work seamlessly with the matplotlib plotting library to provide this functionality. > > `%matplotlib` is a m...
43,028,028
I'm really new to coding and I have a question. Ok so im trying to create a custom ListView with some strings I parsed with jSoup but for some reason it doesn't work, it says cannot resolve symbol CustomAdaptor. I dont know if this is because i implemented the Listview class wrong or because i implemented it in the wro...
2017/03/26
[ "https://Stackoverflow.com/questions/43028028", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7729491/" ]
`%matplotlib` is a [*magic function*](http://ipython.readthedocs.io/en/stable/interactive/tutorial.html#magics-explained) in IPython. I'll quote the relevant documentation here for you to read for convenience: > > IPython has a set of predefined ‘magic functions’ that you can call with a command line style syntax. Th...
> > Starting with IPython 5.0 and matplotlib 2.0 you can avoid the use of > IPython’s specific magic and use > `matplotlib.pyplot.ion()/matplotlib.pyplot.ioff()` which have the > advantages of working outside of IPython as well. > > > [ipython docs](https://ipython.readthedocs.io/en/stable/interactive/plotting....
43,028,028
I'm really new to coding and I have a question. Ok so im trying to create a custom ListView with some strings I parsed with jSoup but for some reason it doesn't work, it says cannot resolve symbol CustomAdaptor. I dont know if this is because i implemented the Listview class wrong or because i implemented it in the wro...
2017/03/26
[ "https://Stackoverflow.com/questions/43028028", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7729491/" ]
Provided you are running Jupyter Notebook, the %matplotlib inline command will make your plot outputs appear in the notebook, also can be stored.
I think that with recent versions of Jupyter/matplotlib, the figures are plotted "inline" without the need to use `%matplotlib inline`. So one might think that this command is now useless… but to my understanding, it creates a "manager" which configures the plotting parameters. Matplotlib looks for an existing manager...
43,028,028
I'm really new to coding and I have a question. Ok so im trying to create a custom ListView with some strings I parsed with jSoup but for some reason it doesn't work, it says cannot resolve symbol CustomAdaptor. I dont know if this is because i implemented the Listview class wrong or because i implemented it in the wro...
2017/03/26
[ "https://Stackoverflow.com/questions/43028028", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7729491/" ]
It just means that any graph which we are creating as a part of our code will appear in the same notebook and not in separate window which would happen if we have not used this magic statement.
I think that with recent versions of Jupyter/matplotlib, the figures are plotted "inline" without the need to use `%matplotlib inline`. So one might think that this command is now useless… but to my understanding, it creates a "manager" which configures the plotting parameters. Matplotlib looks for an existing manager...
43,028,028
I'm really new to coding and I have a question. Ok so im trying to create a custom ListView with some strings I parsed with jSoup but for some reason it doesn't work, it says cannot resolve symbol CustomAdaptor. I dont know if this is because i implemented the Listview class wrong or because i implemented it in the wro...
2017/03/26
[ "https://Stackoverflow.com/questions/43028028", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7729491/" ]
`%matplotlib` is a [*magic function*](http://ipython.readthedocs.io/en/stable/interactive/tutorial.html#magics-explained) in IPython. I'll quote the relevant documentation here for you to read for convenience: > > IPython has a set of predefined ‘magic functions’ that you can call with a command line style syntax. Th...
If you don't know what backend is , you can read this: <https://matplotlib.org/stable/users/explain/backends.html> > > Some people use matplotlib interactively from the python shell and > have plotting windows pop up when they type commands. Some people run > Jupyter notebooks and draw inline plots for quick data ana...
43,028,028
I'm really new to coding and I have a question. Ok so im trying to create a custom ListView with some strings I parsed with jSoup but for some reason it doesn't work, it says cannot resolve symbol CustomAdaptor. I dont know if this is because i implemented the Listview class wrong or because i implemented it in the wro...
2017/03/26
[ "https://Stackoverflow.com/questions/43028028", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7729491/" ]
`%matplotlib` is a [*magic function*](http://ipython.readthedocs.io/en/stable/interactive/tutorial.html#magics-explained) in IPython. I'll quote the relevant documentation here for you to read for convenience: > > IPython has a set of predefined ‘magic functions’ that you can call with a command line style syntax. Th...
It is not mandatory to write that. It worked fine for me without (`%matplotlib`) magic function. I am using Sypder compiler, one that comes with in Anaconda.
43,028,028
I'm really new to coding and I have a question. Ok so im trying to create a custom ListView with some strings I parsed with jSoup but for some reason it doesn't work, it says cannot resolve symbol CustomAdaptor. I dont know if this is because i implemented the Listview class wrong or because i implemented it in the wro...
2017/03/26
[ "https://Stackoverflow.com/questions/43028028", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7729491/" ]
`%matplotlib` is a [*magic function*](http://ipython.readthedocs.io/en/stable/interactive/tutorial.html#magics-explained) in IPython. I'll quote the relevant documentation here for you to read for convenience: > > IPython has a set of predefined ‘magic functions’ that you can call with a command line style syntax. Th...
**TL;DR** `%matplotlib inline` - Displays output inline ============================================= --- IPython kernel has the ability to display plots by executing code. The IPython kernel is designed to work seamlessly with the matplotlib plotting library to provide this functionality. > > `%matplotlib` is a m...
43,028,028
I'm really new to coding and I have a question. Ok so im trying to create a custom ListView with some strings I parsed with jSoup but for some reason it doesn't work, it says cannot resolve symbol CustomAdaptor. I dont know if this is because i implemented the Listview class wrong or because i implemented it in the wro...
2017/03/26
[ "https://Stackoverflow.com/questions/43028028", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7729491/" ]
Provided you are running IPython, the `%matplotlib inline` will make your plot outputs appear and be stored within the notebook. According to [documentation](http://ipython.readthedocs.io/en/stable/interactive/plotting.html) > > To set this up, before any plotting or import of `matplotlib` is > performed you must ...
**TL;DR** `%matplotlib inline` - Displays output inline ============================================= --- IPython kernel has the ability to display plots by executing code. The IPython kernel is designed to work seamlessly with the matplotlib plotting library to provide this functionality. > > `%matplotlib` is a m...
43,028,028
I'm really new to coding and I have a question. Ok so im trying to create a custom ListView with some strings I parsed with jSoup but for some reason it doesn't work, it says cannot resolve symbol CustomAdaptor. I dont know if this is because i implemented the Listview class wrong or because i implemented it in the wro...
2017/03/26
[ "https://Stackoverflow.com/questions/43028028", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7729491/" ]
Provided you are running IPython, the `%matplotlib inline` will make your plot outputs appear and be stored within the notebook. According to [documentation](http://ipython.readthedocs.io/en/stable/interactive/plotting.html) > > To set this up, before any plotting or import of `matplotlib` is > performed you must ...
Provided you are running Jupyter Notebook, the %matplotlib inline command will make your plot outputs appear in the notebook, also can be stored.
43,028,028
I'm really new to coding and I have a question. Ok so im trying to create a custom ListView with some strings I parsed with jSoup but for some reason it doesn't work, it says cannot resolve symbol CustomAdaptor. I dont know if this is because i implemented the Listview class wrong or because i implemented it in the wro...
2017/03/26
[ "https://Stackoverflow.com/questions/43028028", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7729491/" ]
If you want to add plots to your Jupyter notebook, then `%matplotlib inline` is a standard solution. And there are other magic commands will use `matplotlib` interactively within Jupyter. `%matplotlib`: any `plt` plot command will now cause a figure window to open, and further commands can be run to update the plot. S...
It is not mandatory to write that. It worked fine for me without (`%matplotlib`) magic function. I am using Sypder compiler, one that comes with in Anaconda.
73,152,859
I have the following struct: ``` typedef struct __attribute__ ((__packed__)) { uint16_t a; uint32_t b; } st_t; ``` -> the "b" member is unaligned. When I do the following, gcc raises a warning: ``` st_t st; uint32_t * b_p = &st.b; *b_p = 0; ``` warning log: ``` taking address of packed member of 'struct...
2022/07/28
[ "https://Stackoverflow.com/questions/73152859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10917549/" ]
Can't provide a standard quote, so someone else will surely write a better answer, but here's a short one. For a packed struct, from the very definition of what a "packed struct" is, compiler has to generate working machine code for any member access. Unaligned access is known and will be handled appropriately for the...
This is a badly designed warning from GCC. When you apply the `packed` attribute to a structure, [it makes the alignment requirement of its members one byte](https://stackoverflow.com/a/66389167/298225). Thus, when you take the address of a `uint32_t` member, what you get is not a `uint32_t *` but a `uint32_t __attrib...
25,138,770
I'm trying to clone a repo in either cygwin or GitBash (msysgit) using Pageant for ssh keys. I get the following error: ``` $ git clone git@github.com:username/your-project.git Cloning into 'your-project'... The server's host key is not cached in the registry. You have no guarantee that the server is the computer you ...
2014/08/05
[ "https://Stackoverflow.com/questions/25138770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/312072/" ]
I found the solution on this page <http://www.bitsandpix.com/entry/git-setup-msysgit-install-with-pageantplink-from-putty/> but re-creating here in hopes it saves someone else time in the future as that page did not show up in google for me easily. It turns out in order to fully use pageant with cygwin/msysgit you fir...
Set GIT\_SSH to use `TortoisePlink.exe` instead of PuTTY's `plink.exe`. This will allow for popup dialog window to prompt for things (e.g. confirm fingerprint, or enter password). If you use `plink.exe` through Git, you cannot type in responses to plink.exe prompts.