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
976,665
How can I prove that, for $a,b \in \mathbb{Z}$ we have $$ 0 \leq \left \lfloor{\frac{2a}{b}}\right \rfloor - 2 \left \lfloor{\frac{a}{b}}\right \rfloor \leq 1 \, ? $$ Here, $\left \lfloor\,\right \rfloor$ is the [floor](http://mathworld.wolfram.com/FloorFunction.html) function. I tried the following: say that $\frac{2a...
2014/10/16
[ "https://math.stackexchange.com/questions/976665", "https://math.stackexchange.com", "https://math.stackexchange.com/users/53283/" ]
In general $$ 0\le \lfloor 2x\rfloor -2\lfloor x\rfloor\le 1. $$ Proof. Either $x\in [k,k+1/2)$ or $x\in [k+1/2,k+1)$, for some $k\in\mathbb Z$. If $x\in [k,k+1/2)$, then $$ \lfloor 2x\rfloor=2k\quad\text{and}\quad 2\lfloor x\rfloor=2k, $$ while $x\in [k+1/2,k+1)$, for some $k\in\mathbb Z$, then $$ \lfloor 2x\rfloor=...
Just for fun, here is an alternative proof, using the same induction approach as [another math.se answer of mine](https://math.stackexchange.com/a/1678830/11994).$ \newcommand{\calc}{\begin{align} \quad &} \newcommand{\op}[1]{\\ #1 \quad & \quad \unicode{x201c}} \newcommand{\hints}[1]{\mbox{#1} \\ \quad & \quad \phanto...
976,665
How can I prove that, for $a,b \in \mathbb{Z}$ we have $$ 0 \leq \left \lfloor{\frac{2a}{b}}\right \rfloor - 2 \left \lfloor{\frac{a}{b}}\right \rfloor \leq 1 \, ? $$ Here, $\left \lfloor\,\right \rfloor$ is the [floor](http://mathworld.wolfram.com/FloorFunction.html) function. I tried the following: say that $\frac{2a...
2014/10/16
[ "https://math.stackexchange.com/questions/976665", "https://math.stackexchange.com", "https://math.stackexchange.com/users/53283/" ]
$0 \leq \left \lfloor{\frac{2a}{b}}\right \rfloor \leq \frac{2\*a}{b} < 2\*(\left \lfloor{\frac{a}{b}}\right \rfloor + 1)$ = $2\*\left \lfloor{\frac{a}{b}}\right \rfloor$ + 2 $\left \lfloor{\frac{2a}{b}}\right \rfloor$ is an integer, so being < than an other integer means being $\leq$ than this integer -1 => $\left ...
Just for fun, here is an alternative proof, using the same induction approach as [another math.se answer of mine](https://math.stackexchange.com/a/1678830/11994).$ \newcommand{\calc}{\begin{align} \quad &} \newcommand{\op}[1]{\\ #1 \quad & \quad \unicode{x201c}} \newcommand{\hints}[1]{\mbox{#1} \\ \quad & \quad \phanto...
976,665
How can I prove that, for $a,b \in \mathbb{Z}$ we have $$ 0 \leq \left \lfloor{\frac{2a}{b}}\right \rfloor - 2 \left \lfloor{\frac{a}{b}}\right \rfloor \leq 1 \, ? $$ Here, $\left \lfloor\,\right \rfloor$ is the [floor](http://mathworld.wolfram.com/FloorFunction.html) function. I tried the following: say that $\frac{2a...
2014/10/16
[ "https://math.stackexchange.com/questions/976665", "https://math.stackexchange.com", "https://math.stackexchange.com/users/53283/" ]
Hint: let $a=pb+q$ where $p, q \in \mathbb Z$ and $0\le q<b$.
Just for fun, here is an alternative proof, using the same induction approach as [another math.se answer of mine](https://math.stackexchange.com/a/1678830/11994).$ \newcommand{\calc}{\begin{align} \quad &} \newcommand{\op}[1]{\\ #1 \quad & \quad \unicode{x201c}} \newcommand{\hints}[1]{\mbox{#1} \\ \quad & \quad \phanto...
50,248,178
I am trying to scan for beacons using [startScan(filters, settings, callbackIntent)](https://developer.android.com/reference/android/bluetooth/le/BluetoothLeScanner#startScan(java.util.List%3Candroid.bluetooth.le.ScanFilter%3E,%20android.bluetooth.le.ScanSettings,%20android.app.PendingIntent)). I have an implementation...
2018/05/09
[ "https://Stackoverflow.com/questions/50248178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1570640/" ]
You have registered the broadcast receiver in the AndroidManifest.xml with an Intent Filter name `<action android:name="BluetoothDevice.ACTION_FOUND" />` First of all, you may provide there any String. Above suggest that you are using [this constant](https://developer.android.com/reference/android/bluetooth/Bluetooth...
You need to pass an empty filters list to the startScan() call instead of null ``` List<ScanFilter> listOfFiters = new ArrayList<>(); ScanFilter.Builder builder = new ScanFilter.Builder(); ScanFilter filter = builder.build(); listOfFiters.add(filter); bleScanner.startScan(listOfFilters, null, getPendingIntent()) ```
50,248,178
I am trying to scan for beacons using [startScan(filters, settings, callbackIntent)](https://developer.android.com/reference/android/bluetooth/le/BluetoothLeScanner#startScan(java.util.List%3Candroid.bluetooth.le.ScanFilter%3E,%20android.bluetooth.le.ScanSettings,%20android.app.PendingIntent)). I have an implementation...
2018/05/09
[ "https://Stackoverflow.com/questions/50248178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1570640/" ]
You have registered the broadcast receiver in the AndroidManifest.xml with an Intent Filter name `<action android:name="BluetoothDevice.ACTION_FOUND" />` First of all, you may provide there any String. Above suggest that you are using [this constant](https://developer.android.com/reference/android/bluetooth/Bluetooth...
Ah, and in addition to passing empty filter to the startScan you will also need ACCESS\_FINE\_LOCATION permission on latest Android versions.
186,283
Now I am using the pull-down menus to set `:TTarget`, `:TCTarget`, and `:TVTarget` to `pdf`. I also tried setting `g:Tex_DefaultTargetFormat='pdf'` and `g:tex_flavor='pdflatex'`, but neither worked. Thanks!
2010/09/08
[ "https://superuser.com/questions/186283", "https://superuser.com", "https://superuser.com/users/45020/" ]
Set ``` let g:Tex_DefaultTargetFormat = 'pdf' let g:Tex_MultipleCompileFormats='pdf, aux' ``` in your config file for vim (e.g. `~/.vimrc`). That works well for me here, using vim 7.3.3 on Arch Linux.
Add the following lines to ~/.vim/ftplugin/tex.vim (create the file if it doesn't already exist). ``` let g:Tex_DefaultTargetFormat = 'pdf' let g:Tex_MultipleCompileFormats='pdf, aux' ``` This is the same as [evnu's solution](https://superuser.com/a/186288/184674), but without cluttering up your vimrc.
322,594
Hello I'm trying to do something like this but it wont work, can you guys tell me help me out? ``` /usr/bin/mysql -B -r -h ******** -u******* -p****** -D***** \ -e'SELECT `username`, `uid`, `gid`, `homedir` FROM `some_table`)' | \ awk '{print $1":x:"$2":"$3"::"$4":/usr/sbin/nologin"}' >> /tmp/file1 ; ...
2011/10/18
[ "https://serverfault.com/questions/322594", "https://serverfault.com", "https://serverfault.com/users/97188/" ]
When you want to run two different commands on the same incoming pipe data, you need to use an intermediate file: ``` TMPFILE="$(mktemp)" /usr/bin/mysql -B -r -h ******** -u******* -p****** -D***** \ -e'SELECT `username`, `uid`, `gid`, `homedir` FROM `some_table`)' >"$TMPFILE" awk '{print $1":x:"$2":"$3...
You've made quite a mess, starting with the formatting of your question (see what I've done above which should make things below more clear). ***First problem:*** If you have a semicolon (`;`) or a "continue-on-success (`&&`) you are running two separate sets of commands. Completely separate. It's like you ran ...
322,594
Hello I'm trying to do something like this but it wont work, can you guys tell me help me out? ``` /usr/bin/mysql -B -r -h ******** -u******* -p****** -D***** \ -e'SELECT `username`, `uid`, `gid`, `homedir` FROM `some_table`)' | \ awk '{print $1":x:"$2":"$3"::"$4":/usr/sbin/nologin"}' >> /tmp/file1 ; ...
2011/10/18
[ "https://serverfault.com/questions/322594", "https://serverfault.com", "https://serverfault.com/users/97188/" ]
When you want to run two different commands on the same incoming pipe data, you need to use an intermediate file: ``` TMPFILE="$(mktemp)" /usr/bin/mysql -B -r -h ******** -u******* -p****** -D***** \ -e'SELECT `username`, `uid`, `gid`, `homedir` FROM `some_table`)' >"$TMPFILE" awk '{print $1":x:"$2":"$3...
Your command as shown will never work, as processing is entirely sequential, and the output of mysql is already used up by the first awk statement. I would simply move all that to a tiny bash script: ``` #!/bin/bash mycmd="SELECT `username`, `uid`, `gid`, `homedir` FROM `some_table`" while read -r username, uid, gid,...
322,594
Hello I'm trying to do something like this but it wont work, can you guys tell me help me out? ``` /usr/bin/mysql -B -r -h ******** -u******* -p****** -D***** \ -e'SELECT `username`, `uid`, `gid`, `homedir` FROM `some_table`)' | \ awk '{print $1":x:"$2":"$3"::"$4":/usr/sbin/nologin"}' >> /tmp/file1 ; ...
2011/10/18
[ "https://serverfault.com/questions/322594", "https://serverfault.com", "https://serverfault.com/users/97188/" ]
Try this: ``` /usr/bin/mysql -B -r -h ******** -u******* -p****** -D***** \ -e'SELECT `username`, `uid`, `gid`, `homedir` FROM `some_table`)' | \ awk '{ print $1":x:"$2":"$3"::"$4":/usr/sbin/nologin" >> "/tmp/file1"; print $1":"$5":13753:0:99999:7:::" >> "/tmp/file2" }' ```
When you want to run two different commands on the same incoming pipe data, you need to use an intermediate file: ``` TMPFILE="$(mktemp)" /usr/bin/mysql -B -r -h ******** -u******* -p****** -D***** \ -e'SELECT `username`, `uid`, `gid`, `homedir` FROM `some_table`)' >"$TMPFILE" awk '{print $1":x:"$2":"$3...
322,594
Hello I'm trying to do something like this but it wont work, can you guys tell me help me out? ``` /usr/bin/mysql -B -r -h ******** -u******* -p****** -D***** \ -e'SELECT `username`, `uid`, `gid`, `homedir` FROM `some_table`)' | \ awk '{print $1":x:"$2":"$3"::"$4":/usr/sbin/nologin"}' >> /tmp/file1 ; ...
2011/10/18
[ "https://serverfault.com/questions/322594", "https://serverfault.com", "https://serverfault.com/users/97188/" ]
You've made quite a mess, starting with the formatting of your question (see what I've done above which should make things below more clear). ***First problem:*** If you have a semicolon (`;`) or a "continue-on-success (`&&`) you are running two separate sets of commands. Completely separate. It's like you ran ...
Your command as shown will never work, as processing is entirely sequential, and the output of mysql is already used up by the first awk statement. I would simply move all that to a tiny bash script: ``` #!/bin/bash mycmd="SELECT `username`, `uid`, `gid`, `homedir` FROM `some_table`" while read -r username, uid, gid,...
322,594
Hello I'm trying to do something like this but it wont work, can you guys tell me help me out? ``` /usr/bin/mysql -B -r -h ******** -u******* -p****** -D***** \ -e'SELECT `username`, `uid`, `gid`, `homedir` FROM `some_table`)' | \ awk '{print $1":x:"$2":"$3"::"$4":/usr/sbin/nologin"}' >> /tmp/file1 ; ...
2011/10/18
[ "https://serverfault.com/questions/322594", "https://serverfault.com", "https://serverfault.com/users/97188/" ]
Try this: ``` /usr/bin/mysql -B -r -h ******** -u******* -p****** -D***** \ -e'SELECT `username`, `uid`, `gid`, `homedir` FROM `some_table`)' | \ awk '{ print $1":x:"$2":"$3"::"$4":/usr/sbin/nologin" >> "/tmp/file1"; print $1":"$5":13753:0:99999:7:::" >> "/tmp/file2" }' ```
You've made quite a mess, starting with the formatting of your question (see what I've done above which should make things below more clear). ***First problem:*** If you have a semicolon (`;`) or a "continue-on-success (`&&`) you are running two separate sets of commands. Completely separate. It's like you ran ...
322,594
Hello I'm trying to do something like this but it wont work, can you guys tell me help me out? ``` /usr/bin/mysql -B -r -h ******** -u******* -p****** -D***** \ -e'SELECT `username`, `uid`, `gid`, `homedir` FROM `some_table`)' | \ awk '{print $1":x:"$2":"$3"::"$4":/usr/sbin/nologin"}' >> /tmp/file1 ; ...
2011/10/18
[ "https://serverfault.com/questions/322594", "https://serverfault.com", "https://serverfault.com/users/97188/" ]
Try this: ``` /usr/bin/mysql -B -r -h ******** -u******* -p****** -D***** \ -e'SELECT `username`, `uid`, `gid`, `homedir` FROM `some_table`)' | \ awk '{ print $1":x:"$2":"$3"::"$4":/usr/sbin/nologin" >> "/tmp/file1"; print $1":"$5":13753:0:99999:7:::" >> "/tmp/file2" }' ```
Your command as shown will never work, as processing is entirely sequential, and the output of mysql is already used up by the first awk statement. I would simply move all that to a tiny bash script: ``` #!/bin/bash mycmd="SELECT `username`, `uid`, `gid`, `homedir` FROM `some_table`" while read -r username, uid, gid,...
973,548
![enter image description here](https://i.stack.imgur.com/ZSOJc.jpg)In Fig.$9.17$ $PQRS$ and $ABRS$ are parallelograms and $X$ is any point on side $BR$. Show that i) $[PQRS]=[ABRS]$ ii)$[AXS]=1/2\cdot [PQRS]$ I have no clue.
2014/10/14
[ "https://math.stackexchange.com/questions/973548", "https://math.stackexchange.com", "https://math.stackexchange.com/users/162079/" ]
I can already see one mistake in that $$\ln|y-1|=\int(y-1)^{-1}\;dy\neq-\ln(y-1).$$ Also, you ought to note in the derivation of this technique in solving separable ODE (i.e. an application of the chain rule) that you can incorporate the initial conditions in the integration, avoiding arbitrary constants and making mo...
There is an error in the fourth equation. $$ \int\frac{dy}{y-1}=\ln(y-1). $$
973,548
![enter image description here](https://i.stack.imgur.com/ZSOJc.jpg)In Fig.$9.17$ $PQRS$ and $ABRS$ are parallelograms and $X$ is any point on side $BR$. Show that i) $[PQRS]=[ABRS]$ ii)$[AXS]=1/2\cdot [PQRS]$ I have no clue.
2014/10/14
[ "https://math.stackexchange.com/questions/973548", "https://math.stackexchange.com", "https://math.stackexchange.com/users/162079/" ]
I can already see one mistake in that $$\ln|y-1|=\int(y-1)^{-1}\;dy\neq-\ln(y-1).$$ Also, you ought to note in the derivation of this technique in solving separable ODE (i.e. an application of the chain rule) that you can incorporate the initial conditions in the integration, avoiding arbitrary constants and making mo...
~ SPOILER ALERT: Here's the solution. ~ $\frac{dy}{dt}=-3(y-1)$ with $y(2)=-3$ $$\frac{dy}{dt}=-3(y-1)$$ $$\frac{1}{y-1}dy=-3dt, where \space y≠1$$ $$\int\frac{1}{y-1}dy=\int-3dt$$ $$ln|y-1|=-3t+C$$ $$e^{ln|y-1|}=e^{-3t+C}$$ $$|y-1|=C\*e^{-3t}$$ $$y-1=C\*e^{-3t}$$ Note: I removed the absolute value sign because eith...
14,348,930
We recently upgraded all of our projects to Visual Studio 2012 and .Net 4.5. Most of our projects have custom MMC snapins that handle product configuration. I've now learned that MMC 3.0 doesn't natively handle the .Net 4.0 runtime, since the runtime shipped long after MMC 3.0 was released. I'm looking for a way to fi...
2013/01/15
[ "https://Stackoverflow.com/questions/14348930", "https://Stackoverflow.com", "https://Stackoverflow.com/users/125882/" ]
For me it works to tell MMC to use the v4 Framework, I've got v4.0.30319 ``` set COMPLUS_version=v4.0.30319 start SomeConsole.msc ``` Check the workarounds: <http://connect.microsoft.com/VisualStudio/feedback/details/474039/can-not-use-net-4-0-to-create-mmc-snapin> And this are my debug settings:![enter image descr...
Take a look at comments on this page (<http://msdn.microsoft.com/en-us/library/ms692759%28VS.85%29.aspx>). It looks like managed MMC snap-ins can target at most framework 3.5.
17,947,251
I have 2 class, classA and classB. ObjectA have a property which is ObjectB. Now the scenario is- 1. ObjectA call ObjectB method- [ObjectB methodB1]. 2. after executing method [ObjectB methodB1], objectB send callback to objectA. 3. getting callback ObjectA release ObjectB. did it following way- [ObjectB release]; O...
2013/07/30
[ "https://Stackoverflow.com/questions/17947251", "https://Stackoverflow.com", "https://Stackoverflow.com/users/168394/" ]
move your callback to ObjectA just after the execution of [ObjectB methodB2]. Or create two callbacks : one after [ObjectB methodB1] and another after [ObjectB methodB2] and release ObjectB after the second callback
``` ObjectB.ObjectA = nil; [ObjectB release]; ObjectB = nil; ```
17,947,251
I have 2 class, classA and classB. ObjectA have a property which is ObjectB. Now the scenario is- 1. ObjectA call ObjectB method- [ObjectB methodB1]. 2. after executing method [ObjectB methodB1], objectB send callback to objectA. 3. getting callback ObjectA release ObjectB. did it following way- [ObjectB release]; O...
2013/07/30
[ "https://Stackoverflow.com/questions/17947251", "https://Stackoverflow.com", "https://Stackoverflow.com/users/168394/" ]
move your callback to ObjectA just after the execution of [ObjectB methodB2]. Or create two callbacks : one after [ObjectB methodB1] and another after [ObjectB methodB2] and release ObjectB after the second callback
`methodB1` should retain `self` when it starts and release it when it finishes.
17,947,251
I have 2 class, classA and classB. ObjectA have a property which is ObjectB. Now the scenario is- 1. ObjectA call ObjectB method- [ObjectB methodB1]. 2. after executing method [ObjectB methodB1], objectB send callback to objectA. 3. getting callback ObjectA release ObjectB. did it following way- [ObjectB release]; O...
2013/07/30
[ "https://Stackoverflow.com/questions/17947251", "https://Stackoverflow.com", "https://Stackoverflow.com/users/168394/" ]
move your callback to ObjectA just after the execution of [ObjectB methodB2]. Or create two callbacks : one after [ObjectB methodB1] and another after [ObjectB methodB2] and release ObjectB after the second callback
two scenario's here: 1) ObjectB could have different properties passed to it when called by ObjectA the two times 2) Object B is only ever passed one set of properties and Object A needs Bethod B1 and B2 to run while ObjectB retains the same properties. 3) Use getters and setters if object B needs new parameters pas...
51,897,851
Lets say I have a method which I decorate with `@property`. Is there a way to get the underlying name of the decorated method? How could I for instance print the name of the property when it does not have a `__name__` attribute? I'm trying to do a RPC call and everything works for methods and static functions but no...
2018/08/17
[ "https://Stackoverflow.com/questions/51897851", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7917697/" ]
A property has the following attributes: *fget*, *fset* and *fdel*, which are references to the getter/setter/deleter functions. So, you can get the `__name__` of each of this functions (if not `None`) Demo: ``` class Thing(object): @property def foo(self): return "foo" def get_baz(self): ...
i think if use decorator @property you can access your function with name of function and you can give return value. ``` class Foo: value = 'Foo' def setName(self, name): self.value = name @property def name(self): return "You name is: {}".format(self.value) foo = Foo() print(foo.name) foo.setN...
51,897,851
Lets say I have a method which I decorate with `@property`. Is there a way to get the underlying name of the decorated method? How could I for instance print the name of the property when it does not have a `__name__` attribute? I'm trying to do a RPC call and everything works for methods and static functions but no...
2018/08/17
[ "https://Stackoverflow.com/questions/51897851", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7917697/" ]
A property has the following attributes: *fget*, *fset* and *fdel*, which are references to the getter/setter/deleter functions. So, you can get the `__name__` of each of this functions (if not `None`) Demo: ``` class Thing(object): @property def foo(self): return "foo" def get_baz(self): ...
If you use [`functools.wraps()`](https://docs.python.org/3/library/functools.html#functools.wraps) in your decorator, the decorated function *will* have the `__name__` of the wrapped function. IF you had some sample code for the decorator in your question, I could show more precisely how to do this...
8,450,027
I have a C app (VStudio 2010, win7 64bit) running on a machine with dual xeon chips, meaning 12 physical and 24 logical cores, and 192 gig of ram. EDIT: THE OS is win7 (ie, Windows 7, 64 bit). The app has 24 threads (each thread has its own logical core) doing calculations and filling up a different part of a massive...
2011/12/09
[ "https://Stackoverflow.com/questions/8450027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/994179/" ]
It is hard to judge the best thing for your situation. The first optimization to make is to preallocate the file. That way your file system does not need to keep extending its size. That should optimize some disk operations. However, avoid writing actual zeros to disk. Just set the length. Then you have choices betwe...
mmap(), or [boost mmap](http://www.boost.org/doc/libs/1_41_0/libs/iostreams/doc/classes/mapped_file.html) is almost always the best approach. The OS is smarter than you, let it worry about what to cache! You didn't say what OS, but on Linux the [madvise](http://www.gnu.org/s/hello/manual/libc/Memory_002dmapped-I_002fO...
2,532,008
I'm sure this has been asked before, but I can't seem to find it (or know the proper wording to search for) Basically I want a regex that matches all non-alphanumeric except hyphens. So basically match \W+ except exclude '-' I'm not sure how to exclude specific ones from a premade set.
2010/03/28
[ "https://Stackoverflow.com/questions/2532008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23822/" ]
`\W` is a shorthand for `[^\w]`. So: ``` [^\w-]+ ``` A bit of background: * `[…]` defines a set * `[^…]` negates a set * Generally, every `\v` (smallcase) set is negated by a `\V` (uppercase) where V is any letter that defines a set. * for international characters, you may want to look into `[[:alpha:]]` and `[[:al...
``` [^\w-]+ ``` will do just that. Match any characters not in the `\w` set except hyphen.
2,532,008
I'm sure this has been asked before, but I can't seem to find it (or know the proper wording to search for) Basically I want a regex that matches all non-alphanumeric except hyphens. So basically match \W+ except exclude '-' I'm not sure how to exclude specific ones from a premade set.
2010/03/28
[ "https://Stackoverflow.com/questions/2532008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23822/" ]
``` [^\w-]+ ``` will do just that. Match any characters not in the `\w` set except hyphen.
In Java7 or above, you need to prepend the `(?U)` to match all locale specific characters. e.g. ``` (?U)[^\w-] ``` In a Java string (you need to escape `\` character with another one): ``` (?U)[^\\w-] ```
2,532,008
I'm sure this has been asked before, but I can't seem to find it (or know the proper wording to search for) Basically I want a regex that matches all non-alphanumeric except hyphens. So basically match \W+ except exclude '-' I'm not sure how to exclude specific ones from a premade set.
2010/03/28
[ "https://Stackoverflow.com/questions/2532008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23822/" ]
`\W` is a shorthand for `[^\w]`. So: ``` [^\w-]+ ``` A bit of background: * `[…]` defines a set * `[^…]` negates a set * Generally, every `\v` (smallcase) set is negated by a `\V` (uppercase) where V is any letter that defines a set. * for international characters, you may want to look into `[[:alpha:]]` and `[[:al...
You can use: ``` [^a-zA-Z0-9_-] ``` or ``` [^\w-] ``` to match a single non-hyphen, non-alphanumeric. To match one or more of then prefix with a `+`
2,532,008
I'm sure this has been asked before, but I can't seem to find it (or know the proper wording to search for) Basically I want a regex that matches all non-alphanumeric except hyphens. So basically match \W+ except exclude '-' I'm not sure how to exclude specific ones from a premade set.
2010/03/28
[ "https://Stackoverflow.com/questions/2532008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23822/" ]
`\W` is a shorthand for `[^\w]`. So: ``` [^\w-]+ ``` A bit of background: * `[…]` defines a set * `[^…]` negates a set * Generally, every `\v` (smallcase) set is negated by a `\V` (uppercase) where V is any letter that defines a set. * for international characters, you may want to look into `[[:alpha:]]` and `[[:al...
In Java7 or above, you need to prepend the `(?U)` to match all locale specific characters. e.g. ``` (?U)[^\w-] ``` In a Java string (you need to escape `\` character with another one): ``` (?U)[^\\w-] ```
2,532,008
I'm sure this has been asked before, but I can't seem to find it (or know the proper wording to search for) Basically I want a regex that matches all non-alphanumeric except hyphens. So basically match \W+ except exclude '-' I'm not sure how to exclude specific ones from a premade set.
2010/03/28
[ "https://Stackoverflow.com/questions/2532008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23822/" ]
You can use: ``` [^a-zA-Z0-9_-] ``` or ``` [^\w-] ``` to match a single non-hyphen, non-alphanumeric. To match one or more of then prefix with a `+`
In Java7 or above, you need to prepend the `(?U)` to match all locale specific characters. e.g. ``` (?U)[^\w-] ``` In a Java string (you need to escape `\` character with another one): ``` (?U)[^\\w-] ```
51,114,273
I started coding around last month and am using Atom Text Editor. I can't seem to link my CSS code to my HTML here's a screenshot [![enter image description here](https://i.stack.imgur.com/VHUup.png)](https://i.stack.imgur.com/VHUup.png) The CSS file is in the same folder as the HTML file and I've put in the exact ...
2018/06/30
[ "https://Stackoverflow.com/questions/51114273", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10014388/" ]
Try this `<link rel="stylesheet" type="text/css" href="./index.css">`
I think you did not save your project(blue Dot on the tab). First save your project by Ctrl+S and the review the page.
51,114,273
I started coding around last month and am using Atom Text Editor. I can't seem to link my CSS code to my HTML here's a screenshot [![enter image description here](https://i.stack.imgur.com/VHUup.png)](https://i.stack.imgur.com/VHUup.png) The CSS file is in the same folder as the HTML file and I've put in the exact ...
2018/06/30
[ "https://Stackoverflow.com/questions/51114273", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10014388/" ]
Try this `<link rel="stylesheet" type="text/css" href="./index.css">`
Close the html tag at the end & be sure to save both the files in same folder
51,114,273
I started coding around last month and am using Atom Text Editor. I can't seem to link my CSS code to my HTML here's a screenshot [![enter image description here](https://i.stack.imgur.com/VHUup.png)](https://i.stack.imgur.com/VHUup.png) The CSS file is in the same folder as the HTML file and I've put in the exact ...
2018/06/30
[ "https://Stackoverflow.com/questions/51114273", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10014388/" ]
This is how you troubleshoot HTML and CSS: 1. Open your index.html in a browser. E.g.: Chrome 2. Open Developer Tools. In the case of Chrome, right click and click Inspect in the menu. 3. You will be shown something like the image below. [![Developer tools in Elements tab](https://i.stack.imgur.com/Ad9t8.png)](https:...
I think you did not save your project(blue Dot on the tab). First save your project by Ctrl+S and the review the page.
51,114,273
I started coding around last month and am using Atom Text Editor. I can't seem to link my CSS code to my HTML here's a screenshot [![enter image description here](https://i.stack.imgur.com/VHUup.png)](https://i.stack.imgur.com/VHUup.png) The CSS file is in the same folder as the HTML file and I've put in the exact ...
2018/06/30
[ "https://Stackoverflow.com/questions/51114273", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10014388/" ]
Without more accurate specification, we can try to solve generally all troubles. These are my advices. 1 Be careful saving your files before uploading. 2 Link stylesheet with relative paths like the posts before. 3 add ‘file version’ of your css script. In this way your browser will reload all css styles. (Very im...
I think you did not save your project(blue Dot on the tab). First save your project by Ctrl+S and the review the page.
51,114,273
I started coding around last month and am using Atom Text Editor. I can't seem to link my CSS code to my HTML here's a screenshot [![enter image description here](https://i.stack.imgur.com/VHUup.png)](https://i.stack.imgur.com/VHUup.png) The CSS file is in the same folder as the HTML file and I've put in the exact ...
2018/06/30
[ "https://Stackoverflow.com/questions/51114273", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10014388/" ]
This is how you troubleshoot HTML and CSS: 1. Open your index.html in a browser. E.g.: Chrome 2. Open Developer Tools. In the case of Chrome, right click and click Inspect in the menu. 3. You will be shown something like the image below. [![Developer tools in Elements tab](https://i.stack.imgur.com/Ad9t8.png)](https:...
Close the html tag at the end & be sure to save both the files in same folder
51,114,273
I started coding around last month and am using Atom Text Editor. I can't seem to link my CSS code to my HTML here's a screenshot [![enter image description here](https://i.stack.imgur.com/VHUup.png)](https://i.stack.imgur.com/VHUup.png) The CSS file is in the same folder as the HTML file and I've put in the exact ...
2018/06/30
[ "https://Stackoverflow.com/questions/51114273", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10014388/" ]
Without more accurate specification, we can try to solve generally all troubles. These are my advices. 1 Be careful saving your files before uploading. 2 Link stylesheet with relative paths like the posts before. 3 add ‘file version’ of your css script. In this way your browser will reload all css styles. (Very im...
Close the html tag at the end & be sure to save both the files in same folder
331,235
I can pair my bluetooth headset with my laptop once. But when I disconnect my headset, I cannot reconnect it again. The only way it works is to restart the bluetooth daemon: ``` service bluetooth restart ``` When I do that, I see following in my log: ``` bluetoothd: Terminating bluetoothd: Stopping hci0 event soc...
2016/12/18
[ "https://unix.stackexchange.com/questions/331235", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/43007/" ]
It's buggy with certain brands of headsets. I suffer the same problems and this python script to reconnect my bluetooth headset works for me. Make sure to have at least python 3.5 installed. Directions on how to use the script is self explanatory in the header: <https://gist.github.com/pylover/d68be364adac5f946887b8...
I can say you a couple of things: a) my (little) experience with bluetooth under linux tells me is usually broken; there or here I always have some kind of issue. b) `bluez 4.99` was issued in March 2012, thus you are using a really, really old version; I suggest you (if you can) to, at least test, a newer version...
297,466
I am creating my CV in LaTeX with classicthesis-styled CV. Instead of adding publications individually, I would like to add a bibliography file. I tried it with the following code, but couldn't get it working. **MWE** ``` \documentclass{scrartcl} \reversemarginpar % Move the margin to the left of the page \newcomm...
2016/03/05
[ "https://tex.stackexchange.com/questions/297466", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/72911/" ]
You neglected to load `biblatex` in your MWE. Furthermore, `\printbibsection` is not a standard `biblatex` command, it is defined in the `friggeri-cv` as ``` \newcommand{\printbibsection}[2]{ \begin{refsection} \nocite{*} \printbibliography[sorting=chronological, type={#1}, title={#2}, heading=subbibliograp...
From this work provided by Friggeri template and using [Tabular bibliography with 2 cols for @inbook, @article etc](https://tex.stackexchange.com/questions/157359) I can provide you my template that permit to distinguish the same type of publications using `keywords={france}`. This following MWE can be another start ...
553,404
I use [Lucene.net](http://incubator.apache.org/lucene.net/) for indexing content & documents etc.. on websites. The index is very simple and has this format: ``` LuceneId - unique id for Lucene (TypeId + ItemId) TypeId - the type of text (eg. page content, product, public doc etc..) ItemId - the web page id, docu...
2009/02/16
[ "https://Stackoverflow.com/questions/553404", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14072/" ]
I do [2], but one problem I have is that I cannot use different analyzers depending on the language. I've combined the stopwords of the languages I want, but I lose the capability of more advanced stuff that the analyzer will offer such as stemming etc.
You can eliminate option 1 and 2. You can use one index and the fields that contains arabic words create two fileds for each: If you have field "**Text**" might contain arabic or english contents ==> * Create 2 fields for "**Text**" : 1 field, "**Text**", indexed/searched with your standard analyzer and another on...
359,448
I need to place a Wifi surveillance camera near the entrance of my house where no power outlet is in that area. I pulled a wire wrapping wire (awg 30) to the target location without thinking about wire resistance. And as you all expected, it didn't able to power the webcam. The power the camera uses is 5V @ 1A. I m...
2018/03/03
[ "https://electronics.stackexchange.com/questions/359448", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/179935/" ]
The short answer is that I'd argue that a spacing change near the start or end point of a differential signal is not that bad. I'd also argue that 6 layers is not that many. But at high speeds, definitely keep all noise sources away from the clock. For the longer answer, let's look at the reasons given. The Toradex so...
If you really need to know, you should look into simulation. You should also edit your question to include the signaling speed or edge rate of the signals. But I think there is a good chance you will get away with it. Diff pairs primarily couple to the adjacent plane. They don't couple edge-wise to each other very mu...
359,448
I need to place a Wifi surveillance camera near the entrance of my house where no power outlet is in that area. I pulled a wire wrapping wire (awg 30) to the target location without thinking about wire resistance. And as you all expected, it didn't able to power the webcam. The power the camera uses is 5V @ 1A. I m...
2018/03/03
[ "https://electronics.stackexchange.com/questions/359448", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/179935/" ]
The short answer is that I'd argue that a spacing change near the start or end point of a differential signal is not that bad. I'd also argue that 6 layers is not that many. But at high speeds, definitely keep all noise sources away from the clock. For the longer answer, let's look at the reasons given. The Toradex so...
If that region of discontinuityis << wavelength, then you are OK. If your edges are 1nanosecond Trise, Tfall, and that region of bad Z\_diff is 50 picoseconds ( < 5% of the edge time) you will be OK. And even the edge gets upset, the DATA EYE is what is important. 100pS upset in a 5nanosecond-long data-eye will be fi...
359,448
I need to place a Wifi surveillance camera near the entrance of my house where no power outlet is in that area. I pulled a wire wrapping wire (awg 30) to the target location without thinking about wire resistance. And as you all expected, it didn't able to power the webcam. The power the camera uses is 5V @ 1A. I m...
2018/03/03
[ "https://electronics.stackexchange.com/questions/359448", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/179935/" ]
If you really need to know, you should look into simulation. You should also edit your question to include the signaling speed or edge rate of the signals. But I think there is a good chance you will get away with it. Diff pairs primarily couple to the adjacent plane. They don't couple edge-wise to each other very mu...
If that region of discontinuityis << wavelength, then you are OK. If your edges are 1nanosecond Trise, Tfall, and that region of bad Z\_diff is 50 picoseconds ( < 5% of the edge time) you will be OK. And even the edge gets upset, the DATA EYE is what is important. 100pS upset in a 5nanosecond-long data-eye will be fi...
6,303,163
I've built an interface formed by a ListView and a panel with a few textboxes. In order to make change the context in those textboxes when another ListViewItem is selected, I've captured the SelectionChange event, to change accordingly DataContexts of the textboxes. Something like this: ``` void customersList_SelectI...
2011/06/10
[ "https://Stackoverflow.com/questions/6303163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/667175/" ]
If the textboxes were all contained in a containing element (e.g. a Grid), then you could just set the DataContext of the Grid element instead. This would be cleaner. Even better yet would be to use XAML binding and [MVVM](http://www.wintellect.com/cs/blogs/jlikness/archive/2010/04/14/model-view-viewmodel-mvvm-explain...
Bind the dependent controls DataContext property to the ListBox's SelectedItem property. Or better yet if they are within a container control - Set its data context once and have the children inherit it. Something like... ``` <StackPanel DataContext="{Binding ElementName=ListBoxName, Path=SelectedItem}"> <!--- de...
6,303,163
I've built an interface formed by a ListView and a panel with a few textboxes. In order to make change the context in those textboxes when another ListViewItem is selected, I've captured the SelectionChange event, to change accordingly DataContexts of the textboxes. Something like this: ``` void customersList_SelectI...
2011/06/10
[ "https://Stackoverflow.com/questions/6303163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/667175/" ]
If the textboxes were all contained in a containing element (e.g. a Grid), then you could just set the DataContext of the Grid element instead. This would be cleaner. Even better yet would be to use XAML binding and [MVVM](http://www.wintellect.com/cs/blogs/jlikness/archive/2010/04/14/model-view-viewmodel-mvvm-explain...
You can also use the ["/" binding path syntax](http://msdn.microsoft.com/en-us/library/ms752300.aspx#Path_Syntax) in WPF in combination with a CollectionView: ``` <Window ... xmlns:local="..."> <Window.DataContext> <local:MyViewModel ... /> </Window.DataContext> <Window.Resources> <CollectionViewSource...
6,303,163
I've built an interface formed by a ListView and a panel with a few textboxes. In order to make change the context in those textboxes when another ListViewItem is selected, I've captured the SelectionChange event, to change accordingly DataContexts of the textboxes. Something like this: ``` void customersList_SelectI...
2011/06/10
[ "https://Stackoverflow.com/questions/6303163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/667175/" ]
Bind the dependent controls DataContext property to the ListBox's SelectedItem property. Or better yet if they are within a container control - Set its data context once and have the children inherit it. Something like... ``` <StackPanel DataContext="{Binding ElementName=ListBoxName, Path=SelectedItem}"> <!--- de...
You can also use the ["/" binding path syntax](http://msdn.microsoft.com/en-us/library/ms752300.aspx#Path_Syntax) in WPF in combination with a CollectionView: ``` <Window ... xmlns:local="..."> <Window.DataContext> <local:MyViewModel ... /> </Window.DataContext> <Window.Resources> <CollectionViewSource...
2,749,785
Let $\mathcal{B}$ be an orthonormal basis for a finite dimensional complex vector space $V$. Let $U$ be an operator on that space. Show that $U$ is a unitary operator if and only if $[U]\_{\mathcal{B}}$ is a unitary matrix. I'm stuck on how to even approach this problem.
2018/04/23
[ "https://math.stackexchange.com/questions/2749785", "https://math.stackexchange.com", "https://math.stackexchange.com/users/157069/" ]
There are a couple of things going on here. You have some abstract $\mathbb{C}$-vector space, equipped with an inner product $(-, -)\_V: V \times V \to \mathbb{C}$, which I will consider to be conjugate-linear in the first argument, and $\mathbb{C}$-linear in the second: $(\lambda v, \mu w)\_V = \overline{\lambda} \mu ...
$$U=R^{-1}[U]\_{B}R$$ where R is the change-of-base matrix from B to K (B is orthonormal so R is unitary!), now if $$U^{\*}U=I$$ then an operator is unitary. $$U=R^{\*}[U]\_{B}R$$ $$U^{\*}U=R^{\*}[U]\_{B}^{\*}RR^{\*}[U]\_{B}R$$ which definitely equals I. (you multiply matrices from the middle) It’s the same for the o...
2,749,785
Let $\mathcal{B}$ be an orthonormal basis for a finite dimensional complex vector space $V$. Let $U$ be an operator on that space. Show that $U$ is a unitary operator if and only if $[U]\_{\mathcal{B}}$ is a unitary matrix. I'm stuck on how to even approach this problem.
2018/04/23
[ "https://math.stackexchange.com/questions/2749785", "https://math.stackexchange.com", "https://math.stackexchange.com/users/157069/" ]
There are a couple of things going on here. You have some abstract $\mathbb{C}$-vector space, equipped with an inner product $(-, -)\_V: V \times V \to \mathbb{C}$, which I will consider to be conjugate-linear in the first argument, and $\mathbb{C}$-linear in the second: $(\lambda v, \mu w)\_V = \overline{\lambda} \mu ...
Given $\mathcal B$ an orthonormal basis of $V$ $$\begin{align}&[UU^\*]\_\mathcal{B}=[U^\*U]\_\mathcal{B}=[I]\_\mathcal{B}=I\_n\\ \iff &[U]\_\mathcal{B}[U^\*]\_\mathcal{B}=[U^\*]\_\mathcal{B}[U]\_\mathcal{B}=I\_n\\ \iff &[U]\_\mathcal{B}[U]\_\mathcal{B}^\*=[U]\_\mathcal{B}^\*[U]\_\mathcal{B}=I\_n .\end{align}$$ notice...
66,233,085
I have a dataframe values like this: ``` name foreign_name acronym alias United States États-Unis USA USA ``` I want to merge all those four columns in a row into one single columns 'names', so I do: ``` merge = lambda x: '|'.join([a for a in x.unique() if a]) df['names'] = df[['name', 'f...
2021/02/16
[ "https://Stackoverflow.com/questions/66233085", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3943868/" ]
MCVE: ``` import pandas as pd import numpy as np d= {'name': {0: 'United States'}, 'foreign_name': {0: 'États-Unis'}, 'acronym': {0: 'USA'}, 'alias': {0: 'USA'}} df = pd.DataFrame(d) merge = lambda x: '|'.join([a for a in x.unique() if a]) df['names'] = df[['name', 'foreign_name', 'acronym', 'alias',]].apply(merg...
You just need to tell is to operate along row axis. `axis=1` ``` df.apply(lambda r: "|".join(r.unique()), axis=1) ``` ### output ``` United States|États-Unis|USA dtype: object ```
66,233,085
I have a dataframe values like this: ``` name foreign_name acronym alias United States États-Unis USA USA ``` I want to merge all those four columns in a row into one single columns 'names', so I do: ``` merge = lambda x: '|'.join([a for a in x.unique() if a]) df['names'] = df[['name', 'f...
2021/02/16
[ "https://Stackoverflow.com/questions/66233085", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3943868/" ]
aggregate to set to eliminate duplicates Turn the set to list apply `str.join('|')` to concat the strings with a `|` separator ``` df['name']=df.agg(set,1).map(list).str.join('|') ```
You just need to tell is to operate along row axis. `axis=1` ``` df.apply(lambda r: "|".join(r.unique()), axis=1) ``` ### output ``` United States|États-Unis|USA dtype: object ```
5,479,106
OK, so I thought I was solving a problem and I created an even bigger one. I was trying to get rid of a lingering reference to `MySql` and deleted a bunch of files from the Temporary ASP.NET files directory. Now, when I try to run the ASP.NET configuration tool I get this, reprinted in its full glory: > > System.Inva...
2011/03/29
[ "https://Stackoverflow.com/questions/5479106", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83678/" ]
To answer my own question... I wound up changing the Apache file /etc/apache/sites-available/default from AllowOverRide = None to AllowOverRide = All.
have you also tried RewriteBase / or RewriteBase /simple/ or along those lines? in my dealings on servers i've used, i've never had to put the domain into the rewrite base. Just the folders
54,695,113
I'm trying to create a filter based that is triggered by checkboxes, which shows and hides options from a list. I have tried to use resources online to put the script together but nothing seems to work. In order to hide or show list items I am editing a - class= "marker" parent element based on wether - class= "...
2019/02/14
[ "https://Stackoverflow.com/questions/54695113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8206451/" ]
Due to the docs: <https://developers.google.com/recaptcha/docs/verify> invalid-input-secret: **The secret parameter is invalid or malformed.** Maybe you have mixed the site\_key and the secret\_key.
You need to add the user remote IP address. ``` var user_ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress; request({ url: 'https://www.google.com/recaptcha/api/siteverify', method: 'POST', headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: `secret=${secret}&respo...
54,695,113
I'm trying to create a filter based that is triggered by checkboxes, which shows and hides options from a list. I have tried to use resources online to put the script together but nothing seems to work. In order to hide or show list items I am editing a - class= "marker" parent element based on wether - class= "...
2019/02/14
[ "https://Stackoverflow.com/questions/54695113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8206451/" ]
You need to add the user remote IP address. ``` var user_ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress; request({ url: 'https://www.google.com/recaptcha/api/siteverify', method: 'POST', headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: `secret=${secret}&respo...
For reCAPTCHA Enterprise, check the official docs: <https://cloud.google.com/recaptcha-enterprise/docs/create-assessment>. In short, you need to use the library that Google provides: ``` const { RecaptchaEnterpriseServiceClient } = require('@google-cloud/recaptcha-enterprise'); const client = new RecaptchaEn...
54,695,113
I'm trying to create a filter based that is triggered by checkboxes, which shows and hides options from a list. I have tried to use resources online to put the script together but nothing seems to work. In order to hide or show list items I am editing a - class= "marker" parent element based on wether - class= "...
2019/02/14
[ "https://Stackoverflow.com/questions/54695113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8206451/" ]
You need to add the user remote IP address. ``` var user_ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress; request({ url: 'https://www.google.com/recaptcha/api/siteverify', method: 'POST', headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: `secret=${secret}&respo...
``` var response = JSON.stringify(req.body.response); ``` The stringifying here is probably the cause of the invalid-input-response error. If your body is something like `{"g-recaptcha-response": "..."}`, you need to pull out the response value and pass that directly in your post. Regarding invalid-input-secret, if ...
54,695,113
I'm trying to create a filter based that is triggered by checkboxes, which shows and hides options from a list. I have tried to use resources online to put the script together but nothing seems to work. In order to hide or show list items I am editing a - class= "marker" parent element based on wether - class= "...
2019/02/14
[ "https://Stackoverflow.com/questions/54695113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8206451/" ]
Due to the docs: <https://developers.google.com/recaptcha/docs/verify> invalid-input-secret: **The secret parameter is invalid or malformed.** Maybe you have mixed the site\_key and the secret\_key.
For reCAPTCHA Enterprise, check the official docs: <https://cloud.google.com/recaptcha-enterprise/docs/create-assessment>. In short, you need to use the library that Google provides: ``` const { RecaptchaEnterpriseServiceClient } = require('@google-cloud/recaptcha-enterprise'); const client = new RecaptchaEn...
54,695,113
I'm trying to create a filter based that is triggered by checkboxes, which shows and hides options from a list. I have tried to use resources online to put the script together but nothing seems to work. In order to hide or show list items I am editing a - class= "marker" parent element based on wether - class= "...
2019/02/14
[ "https://Stackoverflow.com/questions/54695113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8206451/" ]
Due to the docs: <https://developers.google.com/recaptcha/docs/verify> invalid-input-secret: **The secret parameter is invalid or malformed.** Maybe you have mixed the site\_key and the secret\_key.
``` var response = JSON.stringify(req.body.response); ``` The stringifying here is probably the cause of the invalid-input-response error. If your body is something like `{"g-recaptcha-response": "..."}`, you need to pull out the response value and pass that directly in your post. Regarding invalid-input-secret, if ...
70,369,847
In the case of CPUs, the (linux specific) sys calls `getcpu()` or `sched_getcpu()` can be used inside a program to obtain the ID of the core executing them. For example, in the case of a 4 processors system, the logical index returned by the mentionned calls makes it possible to deduce which one of the 4 CPUs is being ...
2021/12/15
[ "https://Stackoverflow.com/questions/70369847", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9653244/" ]
Ignoring all of the irrelevant code in the question, the problem is this: ``` class base {}; class derived : base {}; base *ptr = new derived; ``` `derived` inherits **privately** from `base`, so, as the error message says, converting that `derived*` created by `new derived` to a `base*` is not legal. The fix is si...
You need to publicly inherit it (with `class` it default to `private`) ``` class silver : public card { //... }; ``` you cannot access private base outside because, well, it's private (like private member)
17,358,226
I want to fix width of gridview. I am filling gridview as following; ``` sorgu = "select urun.urunId as \"İş No\",urun.modelNo as \"Model No\",modelAd as \"Model Adı\",bedenAd as \"Beden\", adet as \"Adet\"" + ",aciklama as \"Açıklama\", kesmeTalimat as \"Kesim Talimatı\", atolyeTalimat as \"Atölye Talim...
2013/06/28
[ "https://Stackoverflow.com/questions/17358226", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2511352/" ]
Instead of using "change" event, the "key" event does fire on the source view. Thanks for Kicker's hint
[The CKEditor 4 documentation](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.editor-event-change) tells that the change event won't be fired in source mode. The example from the documentation worked for me. It binds a listener to the mode event. That's fired when the mode changes. When it changes to source...
391,144
Why does macOS need to verify LibreOffice each time after a restart? I haven't updated the app in a while, and after the first verification it opens normally the next time. This is annoying and it takes a long time (about a minute). This should happen once, after installing (in the /Applications folder), not repeatedly...
2020/05/14
[ "https://apple.stackexchange.com/questions/391144", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/35070/" ]
* <https://bugs.documentfoundation.org/show_bug.cgi?id=126409> It is a bug filed on LibreOffice's tracker. So they're aware of it. Please do not flood the tracker with "me too" comments.
You still seem to start LibreOffice from the DMG file it was delivered in. Just drag the LibreOffice icon into your `/Applications` folder to install it properly. You can then eject and delete the DMG file.
391,144
Why does macOS need to verify LibreOffice each time after a restart? I haven't updated the app in a while, and after the first verification it opens normally the next time. This is annoying and it takes a long time (about a minute). This should happen once, after installing (in the /Applications folder), not repeatedly...
2020/05/14
[ "https://apple.stackexchange.com/questions/391144", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/35070/" ]
* <https://bugs.documentfoundation.org/show_bug.cgi?id=126409> It is a bug filed on LibreOffice's tracker. So they're aware of it. Please do not flood the tracker with "me too" comments.
It appears you do not have the app installed on your computer, and hence the app config is missing, causing macOS to ask you to verify with every restart. You should consider installing it as mentioned in [@nohillside's answer](https://apple.stackexchange.com/a/391145/279727), by dragging to copy the LibreOffice.app i...
405,305
It is well known that an estimator's MSE can be decomposed into the sum of the variance and the squared bias. I'd like to actually perform this decomposition. Here is some code to set up and train a small model. ``` import numpy as np from sklearn.model_selection import train_test_split from sklearn.metrics import mea...
2019/04/26
[ "https://stats.stackexchange.com/questions/405305", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/111259/" ]
The MSE and its components (squared bias and variance) are random variables. Therefore, in order to accurately access these statistics you need to iterate the process many times. For this purpose, we generally use bootstrapping. The procedure for obtaining bias and variance terms is as follows: 1. Generate multiple t...
[![MSE Variance|Bias decomposition](https://i.stack.imgur.com/Jr6Zo.png)](https://i.stack.imgur.com/Jr6Zo.png) The key for understanding the previous MSE decomposition is to realise that $\theta$ represents a point variable with a fixed value and $\hat{\theta}$ represents a vector containing samples from the estimator...
10,008,614
I've just moved a Joomla 1.7 site to a new server. Administration back-end works fine. Configuration.php seems fine. Get "The requested document was not found on this server." for every page other than Home. Must be talking to the database OK or I'd get an error. Could this be a problem with the PHP? Thanks, Andy
2012/04/04
[ "https://Stackoverflow.com/questions/10008614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/559152/" ]
* Did you clear joomla cache ? * Disable page and/or module caching. * Disable any plugin that optimizes "loading speed". * Try removing SEF URLs (Joomla! and any 3rd party extension). * If you are using a custom .htacess, then use an unmodified joomla one. * Disable some system plugins. * Disable modules in the homepa...
Check whether you are using any modules that is calling database and you have not changed DB details in that module after migration. If admin panel is working fine then I think problem with some modules that are used in front-end. You can do debugging by disabling few suspected modules and check whether your site works...
10,008,614
I've just moved a Joomla 1.7 site to a new server. Administration back-end works fine. Configuration.php seems fine. Get "The requested document was not found on this server." for every page other than Home. Must be talking to the database OK or I'd get an error. Could this be a problem with the PHP? Thanks, Andy
2012/04/04
[ "https://Stackoverflow.com/questions/10008614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/559152/" ]
You have Seach Engine Friendly URLs enabled in /administrator/ area's global configuration settings. You have probably enabled the option to use the mod\_rewrite function which removes the /index.php/ portion of the urls. It is a requirement of this mode that you have the .htaccess file in place in the root of your si...
Check whether you are using any modules that is calling database and you have not changed DB details in that module after migration. If admin panel is working fine then I think problem with some modules that are used in front-end. You can do debugging by disabling few suspected modules and check whether your site works...
10,008,614
I've just moved a Joomla 1.7 site to a new server. Administration back-end works fine. Configuration.php seems fine. Get "The requested document was not found on this server." for every page other than Home. Must be talking to the database OK or I'd get an error. Could this be a problem with the PHP? Thanks, Andy
2012/04/04
[ "https://Stackoverflow.com/questions/10008614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/559152/" ]
* Did you clear joomla cache ? * Disable page and/or module caching. * Disable any plugin that optimizes "loading speed". * Try removing SEF URLs (Joomla! and any 3rd party extension). * If you are using a custom .htacess, then use an unmodified joomla one. * Disable some system plugins. * Disable modules in the homepa...
You have Seach Engine Friendly URLs enabled in /administrator/ area's global configuration settings. You have probably enabled the option to use the mod\_rewrite function which removes the /index.php/ portion of the urls. It is a requirement of this mode that you have the .htaccess file in place in the root of your si...
150,327
A lot of universities are expecting not to be able to run in-person exams for at least part of the 2020/21 academic year. I believe, for example, that no UK universities is currently planning to hold in-person exams this coming January. I can see how other forms of assessment might be possible for some subjects. But I ...
2020/06/10
[ "https://academia.stackexchange.com/questions/150327", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/37765/" ]
Here are some examples of how it is done at the University of Copenhagen for the two courses that I have exams in next week. One course has a written exam: We are given a problem sheet that we write up a solution to and submit to an online portal after a time limit of four hours. We are allowed to use the internet and...
It's not possible to give a universal answer, of course, as that depends on many factors: how many people are available to grade, how many students need to pass the course (solutions that work for 20 students may not work for 200), what technological solutions are available… In our department somewhere in France, the s...
15,470,937
I have been trying to populate an array using a for loop and taking such values using `document.getElementById("spin " + i).value;` The `ids` on my html for every input tag go from spin1 to spin18. Any suggestions on what I am doing wrong? Or what I can change? ``` var nums = []; for(var i = 1; i <= 18; i++){ v...
2013/03/18
[ "https://Stackoverflow.com/questions/15470937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1890684/" ]
What is the problem? You never mention what kind of results being generated or what the front-end html code looks like. The js looks compilable, but here are some pointers. **The number 0 is before 1** ---------------------------- It's a good habit to get in this mind set, plus it might save you from making stupid m...
try this ``` var nums = []; for(var i = 1; i <= 18; i++){ var num= parseInt(document.getElementById("spin" + i).value); nums.push(num); } alert(nums.length); ```
15,470,937
I have been trying to populate an array using a for loop and taking such values using `document.getElementById("spin " + i).value;` The `ids` on my html for every input tag go from spin1 to spin18. Any suggestions on what I am doing wrong? Or what I can change? ``` var nums = []; for(var i = 1; i <= 18; i++){ v...
2013/03/18
[ "https://Stackoverflow.com/questions/15470937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1890684/" ]
What is the problem? You never mention what kind of results being generated or what the front-end html code looks like. The js looks compilable, but here are some pointers. **The number 0 is before 1** ---------------------------- It's a good habit to get in this mind set, plus it might save you from making stupid m...
A couple of things to note: 1. As PSR has mentioned, you use: ``` var num[i] ``` when it should be ``` var num ``` 1. `getElementById(id).value` only works for form elements, you have to use `.innerHTML` for divs. This works for me: <http://jsfiddle.net/sbqeT/>
127,679
How can I adjust the placement of `y unit` with `pgfplots`? I'm trying to put it near the top-left corner of the graph box. However, there *may* (but does not have to) be a scientific multiplier. As shown in the professionally type-set picture below, the unit should be displayed just after the multiplier and of course ...
2013/08/11
[ "https://tex.stackexchange.com/questions/127679", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/10662/" ]
Here's an approach that doesn't use the `units` library, but instead defines a new key `y unit label=<text>` that places the `<text>` behind the scale label (if it exists) or at the position of the scale label (if it doesn't). If you put the following code in your preamble... ``` \makeatletter \long\def\ifnodedefined...
Not a general approach, but a stopgap in case no other solution presents itself. In this case, turn off the y-axis label, and overlay the image with the desired text at the specified location. The relevant lines that changed relative to your MWE were the following: ``` \usepackage{stackengine} \def\stackalignment{l} \...
4,599,321
i have a problem with Autotest. In my user model are the username & email address unique. When i start Autotest everything works fine. In the secound round, from autotest, i have a > > Validation failed: Email has already been taken, Username has already been taken > > > error in only two test. I dont understand...
2011/01/04
[ "https://Stackoverflow.com/questions/4599321", "https://Stackoverflow.com", "https://Stackoverflow.com/users/210023/" ]
This is exactly the problem I had just run into -- and had a strange experience where this problem didn't seem to happen if I was just running "rake spec". After not finding an obvious answer, I did try something that seems to have solved the problem! It seems like setting a class variable inside a before() block is t...
The problem is probably in your config file. You have a line in your spec config file (probably spec\_helper.rb) that reads: ``` config.use_transactional_fixtures = false ``` This should be: ``` config.use_transactional_fixtures = true ``` Or if you don't want to use transactional fixtures, you should have a be...
4,599,321
i have a problem with Autotest. In my user model are the username & email address unique. When i start Autotest everything works fine. In the secound round, from autotest, i have a > > Validation failed: Email has already been taken, Username has already been taken > > > error in only two test. I dont understand...
2011/01/04
[ "https://Stackoverflow.com/questions/4599321", "https://Stackoverflow.com", "https://Stackoverflow.com/users/210023/" ]
I have gotten that problem from having the database not being properly cleared after some tests. If you run: rake db:test:prepare before the autotest, does it still happen? I eventually got around it by isolating which tests were not being cleared and fixing them (or removing them). Sorry, I can't remember what was t...
The problem is probably in your config file. You have a line in your spec config file (probably spec\_helper.rb) that reads: ``` config.use_transactional_fixtures = false ``` This should be: ``` config.use_transactional_fixtures = true ``` Or if you don't want to use transactional fixtures, you should have a be...
4,599,321
i have a problem with Autotest. In my user model are the username & email address unique. When i start Autotest everything works fine. In the secound round, from autotest, i have a > > Validation failed: Email has already been taken, Username has already been taken > > > error in only two test. I dont understand...
2011/01/04
[ "https://Stackoverflow.com/questions/4599321", "https://Stackoverflow.com", "https://Stackoverflow.com/users/210023/" ]
This is exactly the problem I had just run into -- and had a strange experience where this problem didn't seem to happen if I was just running "rake spec". After not finding an obvious answer, I did try something that seems to have solved the problem! It seems like setting a class variable inside a before() block is t...
I ran into a very similar problem and I tried several of the suggestions on this thread with no luck. I did however fix it with adding the following to my spec\_helper.rb: ``` # Clean up the database require 'database_cleaner' config.before(:suite) do DatabaseCleaner.strategy = :truncation DatabaseClean...
4,599,321
i have a problem with Autotest. In my user model are the username & email address unique. When i start Autotest everything works fine. In the secound round, from autotest, i have a > > Validation failed: Email has already been taken, Username has already been taken > > > error in only two test. I dont understand...
2011/01/04
[ "https://Stackoverflow.com/questions/4599321", "https://Stackoverflow.com", "https://Stackoverflow.com/users/210023/" ]
I have gotten that problem from having the database not being properly cleared after some tests. If you run: rake db:test:prepare before the autotest, does it still happen? I eventually got around it by isolating which tests were not being cleared and fixing them (or removing them). Sorry, I can't remember what was t...
I ran into a very similar problem and I tried several of the suggestions on this thread with no luck. I did however fix it with adding the following to my spec\_helper.rb: ``` # Clean up the database require 'database_cleaner' config.before(:suite) do DatabaseCleaner.strategy = :truncation DatabaseClean...
2,999,058
Cutting a 1D Line: ``` We can cut a 1D line via 0D point. if we want to cut a 1D line via a 1D line. we have to move 1 dimension up that is in 2D ``` [(Image for 1D Line cut by 0D pt.)](https://i.stack.imgur.com/EE3Fn.png) [(Image for 1D Line cut by 1D line)](https://i.stack.imgur.com/fTzeS.png) Cutting a 2d Plane...
2018/11/15
[ "https://math.stackexchange.com/questions/2999058", "https://math.stackexchange.com", "https://math.stackexchange.com/users/494766/" ]
How are you choosing the $s\_j$? The definition in Stephen Abbott's book allows us to choose the $s\_j$ freely so long as $\Delta\_j<\delta$. Let $P=\{x\_i\}\_1^n$ with $x\_i<x\_{i+1}$ and $\Delta\_i<\delta$ for all $i$. Then if $f$ is bounded on $[x\_i,x\_{i+1}]$, then it is bounded on $[a,b]$, hence if it is unboun...
Assuming $f$ is not bounded we get that for every $K>0$ and every Partition $\mathcal{P}$ of $[a,b]$ we find $x\in [a,b]$ such that for every $\Delta\_j$ of this partition we have $f(x)\cdot \Delta\_j>K$ so $f$ is not Riemann integrable. So we conclude that if $f$ is Riemann integrable, it is bounded. That should be...
41,759
To express "lengthen an essay", should I write "*prolonger la composition*" or "*allonger la composition*"? I found in the dictionary saying these two words both means to lengthen. My question is "Elle a essayé de/d' \_\_\_\_\_\_\_\_ son article", given the options to fill in the blank are A prolonger B longer C all...
2020/04/18
[ "https://french.stackexchange.com/questions/41759", "https://french.stackexchange.com", "https://french.stackexchange.com/users/22658/" ]
Bonjour Claire, "prolonger" est à prendre au sens *"étendre"* dans la durée **(lié au temps)**, par exemple "je *prolonge la durée* du confinement". *"Allonger"* est plus à prendre au **sens physique** ou au **sens spatial (ajouter de la longueur)** : "je m'allonge sur mon lit". Bien entendu, il existe des exceptions....
If what you mean is that she padded her essay with less relevant stuff to make it longer, then *allonger* is perfect. It is used in cooking, where *allonger une sauce* means to dilute it with water. It can be used figuratively for productions of the mind such as an essay or an article and it would be understood as a sl...
41,759
To express "lengthen an essay", should I write "*prolonger la composition*" or "*allonger la composition*"? I found in the dictionary saying these two words both means to lengthen. My question is "Elle a essayé de/d' \_\_\_\_\_\_\_\_ son article", given the options to fill in the blank are A prolonger B longer C all...
2020/04/18
[ "https://french.stackexchange.com/questions/41759", "https://french.stackexchange.com", "https://french.stackexchange.com/users/22658/" ]
To express "lengthen an essay", I would personally use "rallonger la composition". According to [Larousse definition](https://www.larousse.fr/dictionnaires/francais/rallonger/66321): > > Accroître la longueur de quelque chose : *Rallonger un article de quelques lignes*. > > > It is a very close synonym of "allon...
If what you mean is that she padded her essay with less relevant stuff to make it longer, then *allonger* is perfect. It is used in cooking, where *allonger une sauce* means to dilute it with water. It can be used figuratively for productions of the mind such as an essay or an article and it would be understood as a sl...
41,759
To express "lengthen an essay", should I write "*prolonger la composition*" or "*allonger la composition*"? I found in the dictionary saying these two words both means to lengthen. My question is "Elle a essayé de/d' \_\_\_\_\_\_\_\_ son article", given the options to fill in the blank are A prolonger B longer C all...
2020/04/18
[ "https://french.stackexchange.com/questions/41759", "https://french.stackexchange.com", "https://french.stackexchange.com/users/22658/" ]
*Prolonger* is more like to append something at the end of an existing object while *allonger* can also mean to stretch something to increase its length. Both *prolonger* and *allonger* are then possible among the four suggested choices but for an essay, I'd rather write : > > *Elle a essayé d'étoffer son article.* ...
If what you mean is that she padded her essay with less relevant stuff to make it longer, then *allonger* is perfect. It is used in cooking, where *allonger une sauce* means to dilute it with water. It can be used figuratively for productions of the mind such as an essay or an article and it would be understood as a sl...
164,128
Would you be kind enough to explain the nuance between "pitiful" and "pitiable"? My Oxford Advanced Learner's Dictionary shows two similar meanings for the aforementioned words. 1. deserving pity or causing you to feel pity. 2. not deserving respect I am confused as to why there are two different adjectives with almo...
2014/04/16
[ "https://english.stackexchange.com/questions/164128", "https://english.stackexchange.com", "https://english.stackexchange.com/users/70234/" ]
I'd say that pitiful might be either of those two definitions (you use context to know which is being used), but pitiable is only the first. A coach might tell his team "Your guys on defense were pitiful today". He's telling them that they did a bad job. But you would never use pitiable there.
I would distinguish them as **Pitiable** is something evocative of pity or sympathy, but not necessarily in a bad condition **Pitiful** is something deserving of pity, and disadvantaged in some way Consider a cute kitten giving an imploring look in a picture - she is **pitiable** and you mentally go 'aww, what a cu...
66,603,998
``` drinks = 5 if drinks <= 2: print("Keep going buddy") elif drinks == 3: print("I believe you've had enough, sir") else: print("stop") ``` This was the code I was trying to run, and it keeps giving me a syntax error with the "else" and I don't know why.
2021/03/12
[ "https://Stackoverflow.com/questions/66603998", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15384124/" ]
Your syntax is wrong. Remove the space before the `else:`
The syntax of your code is labeled as incorrect because an `else` statement and clause cannot exist without an `if` statement and clause preceding it. Since you have an `else` statement alone inside an `elif` clause, an error is thrown. Likely this is just an issue with your indentation, which you need to be very care...
33,596,145
In a bash script I need to compare the first char of two Strings. To do this, I use the `head` operator like this: ``` var1="foo" var2="doo" headVar1=$(head -c1 $var1) headVar2=$(head -c1 $var2) if [ $headVar1 == $headVar2 ] then #miau fi ``` But the console says "head: cant open foo for reading: Doesnt exis...
2015/11/08
[ "https://Stackoverflow.com/questions/33596145", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1886172/" ]
`head` interpreted `foo` as a filename. See `man head` on what options are available for the command. To store command output in a variable, use command substitution: ``` headVar1=$(printf %s "$var1" | head -c1) ``` which could be shortened using a "here string": ``` headVar1=$(head -c1 <<< "$var1") ``` But para...
Your code must be, ``` var1="foo" var2="doo" headVar1=$(head -c1 <<<"$var1") headVar2=$(head -c1 <<<"$var2") if [[ "$headVar1" == "$headVar2" ]] then echo "It's same" else echo "Not same" fi ``` * remove the space which exists next to equal sign (*variable assignment part*). * Use `<<<` to fed input from a...
33,596,145
In a bash script I need to compare the first char of two Strings. To do this, I use the `head` operator like this: ``` var1="foo" var2="doo" headVar1=$(head -c1 $var1) headVar2=$(head -c1 $var2) if [ $headVar1 == $headVar2 ] then #miau fi ``` But the console says "head: cant open foo for reading: Doesnt exis...
2015/11/08
[ "https://Stackoverflow.com/questions/33596145", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1886172/" ]
Your code must be, ``` var1="foo" var2="doo" headVar1=$(head -c1 <<<"$var1") headVar2=$(head -c1 <<<"$var2") if [[ "$headVar1" == "$headVar2" ]] then echo "It's same" else echo "Not same" fi ``` * remove the space which exists next to equal sign (*variable assignment part*). * Use `<<<` to fed input from a...
A circuitous, but POSIX-compatible, solution: ``` var1="foo" var2="doo" headVar1=${var1%${var1#?}} headVar2=${var2%${var2#?}} if [ "$headVar1" = "$headVar2" ] then #miau fi ``` `${var1#?}` expands to the value of `var1` minus its first character. That is used as the *suffix* to remove with `${var1%...}`, leavin...
33,596,145
In a bash script I need to compare the first char of two Strings. To do this, I use the `head` operator like this: ``` var1="foo" var2="doo" headVar1=$(head -c1 $var1) headVar2=$(head -c1 $var2) if [ $headVar1 == $headVar2 ] then #miau fi ``` But the console says "head: cant open foo for reading: Doesnt exis...
2015/11/08
[ "https://Stackoverflow.com/questions/33596145", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1886172/" ]
`head` interpreted `foo` as a filename. See `man head` on what options are available for the command. To store command output in a variable, use command substitution: ``` headVar1=$(printf %s "$var1" | head -c1) ``` which could be shortened using a "here string": ``` headVar1=$(head -c1 <<< "$var1") ``` But para...
A circuitous, but POSIX-compatible, solution: ``` var1="foo" var2="doo" headVar1=${var1%${var1#?}} headVar2=${var2%${var2#?}} if [ "$headVar1" = "$headVar2" ] then #miau fi ``` `${var1#?}` expands to the value of `var1` minus its first character. That is used as the *suffix* to remove with `${var1%...}`, leavin...
65,036,643
There is a page where you can see the details of a user's loan. There is a decorator where I return values ​​using the get () method. In general, there is a partial refund, which returns items of partial payments as shown in the photo. My problem is that I cannot specify all partial payments, only receive one by one. ...
2020/11/27
[ "https://Stackoverflow.com/questions/65036643", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14719180/" ]
For starters the argument of malloc is confusing ``` arr = malloc(sizeof(arr[SIZE]) * 10); ``` It seems you mean ``` arr = malloc(sizeof( *arr ) * 10); ``` That is you are trying to allocate dynamically an array of the type `int[10][SIZE]`. More precisely the record used as an argument in the call of malloc ```...
The allocation size `sizeof(arr[SIZE]) * 10` is incorrect but will evaluate to the expected size by coincidence. It should be `sizeof(*arr) * 10`, meaning 10 times the size of whatever `arr` points to, in this case arrays of `SIZE` `int`. You can encapsulate this allocation in a function this way: ``` int (*allocate2...
35,769,134
**CONTEXT** The code is supposed to get a file object and extract information from it using awk. It uses readlines() with 'pieceSize' as an argument. 'pieceSize' is the number of MBs I want readlines() to work with as it goes through the file. I did this with hopes that my program wont run into trouble if the file t...
2016/03/03
[ "https://Stackoverflow.com/questions/35769134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6012406/" ]
The error occurs because `str.rsplit()` returns a *list*, but `Popen.communicate()` expects a string (or buffer). So you can't pass the result of `eachline` to `communicate()`. That's the cause of the problem, but I'm not sure why you are splitting the lines. `rsplit()` will split on *all* whitespace, that includes sp...
You need to pass a string inside the list returned from split to input: ``` pOut, _ = p.communicate(input=eachline[0]) ``` You are passing `line.rsplit()` i.e a list, not sure what you want to pass exactly, maybe you want `input=" ".join(eachline)` but whatever it is, it should be a string not the list itself you p...
35,769,134
**CONTEXT** The code is supposed to get a file object and extract information from it using awk. It uses readlines() with 'pieceSize' as an argument. 'pieceSize' is the number of MBs I want readlines() to work with as it goes through the file. I did this with hopes that my program wont run into trouble if the file t...
2016/03/03
[ "https://Stackoverflow.com/questions/35769134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6012406/" ]
The error occurs because `str.rsplit()` returns a *list*, but `Popen.communicate()` expects a string (or buffer). So you can't pass the result of `eachline` to `communicate()`. That's the cause of the problem, but I'm not sure why you are splitting the lines. `rsplit()` will split on *all* whitespace, that includes sp...
It's not fully clear what output you are expecting to achieve. However, maybe this will be helpful: * Why use `awk` if all you are doing is print the first word in a line, you can use python for that. * If you would like to read a file with size larger than your memory, you can load each line using `readline` or `for...
50,318,309
I use Python 2.7. I'm trying to run my UI-automation script, but I got ImportError. I have at least 30 Classes with methods. I want to have these methods in each and any class that's why I created BaseClass(MainClass) and created objects of all my classes. Please advise what should I do in this case or how I can solve...
2018/05/13
[ "https://Stackoverflow.com/questions/50318309", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8687066/" ]
check this line: from test\_class.baseclass import MainClass -> it seems like all other imports had a '\_' between the names like second\_class. So try maybe to write base\_class. who knows might work
Are you proabably running your code like `python test_class/second_class.py`. If you just do this then python will think the base directory to find modules is `./test_class`. So when you import the `test_class` package python will start looking for a folder called `./test_class/test_class` to find the sub-modules. This...
50,318,309
I use Python 2.7. I'm trying to run my UI-automation script, but I got ImportError. I have at least 30 Classes with methods. I want to have these methods in each and any class that's why I created BaseClass(MainClass) and created objects of all my classes. Please advise what should I do in this case or how I can solve...
2018/05/13
[ "https://Stackoverflow.com/questions/50318309", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8687066/" ]
check this line: from test\_class.baseclass import MainClass -> it seems like all other imports had a '\_' between the names like second\_class. So try maybe to write base\_class. who knows might work
You could try importing the full files instead of using from file import class. Then you would only need to add the file name before referencing something from another file.
1,710,070
I know that the solution to the differential equation $\frac{dy}{dt}=y(a-by), a>0, b>0, y(0)=y\_0$ can be derived using integration using partial fractions, and the final result is: $$y=a/(b+ke^{-at})$$ where $k$ is $(a/y\_0)-b$. My doubt is: Say $y\_0<0$. Then the differential equation itself tells me that $\frac{dy}...
2016/03/23
[ "https://math.stackexchange.com/questions/1710070", "https://math.stackexchange.com", "https://math.stackexchange.com/users/325288/" ]
You got nothing wrong, it is just that the solution ends at the asymptote. Solutions of differential equations are defined over intervals containing the initial point. These intervals can have finite end points even for the so-called "maximal solution". Often these finite end points happen because the trajectory of the...
It is a classical differential equation called the **logistic differential equation** <http://math.usu.edu/~powell/biomath/mlab3-02/node2.html>
72,436,803
After in my Laravel 9 project I run `composer update` I faced this error message: ``` Writing lock file Installing dependencies from lock file (including require-dev) Package operations: 0 installs, 1 update, 1 removal - Downloading fruitcake/laravel-cors (v3.0.0) - Removing asm89/stack-cors (v2.1.1) - Upgrading...
2022/05/30
[ "https://Stackoverflow.com/questions/72436803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/972828/" ]
I found a soution: 1. upgrade to PHP 8.1 2. run `docker pull composer` to upgrade latest version of composer (from 2.0 to 2.2) 3. run `composer update` in Docker container
I did : ``` composer require --ignore-platform-reqs symfony/finder 6.1 ``` and i have a similar issue now : ``` [2022-05-30 17:52:03] laravel.ERROR: syntax error, unexpected token ")" {"exception":"[object] (ParseError(code: 0): syntax error, unexpected token \")\" at /vendor/symfony/finder/Finder.php:588) [stacktr...
72,436,803
After in my Laravel 9 project I run `composer update` I faced this error message: ``` Writing lock file Installing dependencies from lock file (including require-dev) Package operations: 0 installs, 1 update, 1 removal - Downloading fruitcake/laravel-cors (v3.0.0) - Removing asm89/stack-cors (v2.1.1) - Upgrading...
2022/05/30
[ "https://Stackoverflow.com/questions/72436803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/972828/" ]
To continue using php 8.0 add these entries to your composer.json ``` "require": { ... "symfony/console": "6.0.*", "symfony/error-handler": "6.0.*", "symfony/finder": "6.0.*", "symfony/http-foundation": "6.0.*", "symfony/http-kernel": "6.0.*", "symfony/mailer...
I did : ``` composer require --ignore-platform-reqs symfony/finder 6.1 ``` and i have a similar issue now : ``` [2022-05-30 17:52:03] laravel.ERROR: syntax error, unexpected token ")" {"exception":"[object] (ParseError(code: 0): syntax error, unexpected token \")\" at /vendor/symfony/finder/Finder.php:588) [stacktr...
72,436,803
After in my Laravel 9 project I run `composer update` I faced this error message: ``` Writing lock file Installing dependencies from lock file (including require-dev) Package operations: 0 installs, 1 update, 1 removal - Downloading fruitcake/laravel-cors (v3.0.0) - Removing asm89/stack-cors (v2.1.1) - Upgrading...
2022/05/30
[ "https://Stackoverflow.com/questions/72436803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/972828/" ]
I did : ``` composer require --ignore-platform-reqs symfony/finder 6.1 ``` and i have a similar issue now : ``` [2022-05-30 17:52:03] laravel.ERROR: syntax error, unexpected token ")" {"exception":"[object] (ParseError(code: 0): syntax error, unexpected token \")\" at /vendor/symfony/finder/Finder.php:588) [stacktr...
Upgrading your PHP version to `PHP 8.1` should solve the problem. And just make sure to run `composer install` or `composer update` again
72,436,803
After in my Laravel 9 project I run `composer update` I faced this error message: ``` Writing lock file Installing dependencies from lock file (including require-dev) Package operations: 0 installs, 1 update, 1 removal - Downloading fruitcake/laravel-cors (v3.0.0) - Removing asm89/stack-cors (v2.1.1) - Upgrading...
2022/05/30
[ "https://Stackoverflow.com/questions/72436803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/972828/" ]
To continue using php 8.0 add these entries to your composer.json ``` "require": { ... "symfony/console": "6.0.*", "symfony/error-handler": "6.0.*", "symfony/finder": "6.0.*", "symfony/http-foundation": "6.0.*", "symfony/http-kernel": "6.0.*", "symfony/mailer...
I found a soution: 1. upgrade to PHP 8.1 2. run `docker pull composer` to upgrade latest version of composer (from 2.0 to 2.2) 3. run `composer update` in Docker container
72,436,803
After in my Laravel 9 project I run `composer update` I faced this error message: ``` Writing lock file Installing dependencies from lock file (including require-dev) Package operations: 0 installs, 1 update, 1 removal - Downloading fruitcake/laravel-cors (v3.0.0) - Removing asm89/stack-cors (v2.1.1) - Upgrading...
2022/05/30
[ "https://Stackoverflow.com/questions/72436803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/972828/" ]
I found a soution: 1. upgrade to PHP 8.1 2. run `docker pull composer` to upgrade latest version of composer (from 2.0 to 2.2) 3. run `composer update` in Docker container
Upgrading your PHP version to `PHP 8.1` should solve the problem. And just make sure to run `composer install` or `composer update` again
72,436,803
After in my Laravel 9 project I run `composer update` I faced this error message: ``` Writing lock file Installing dependencies from lock file (including require-dev) Package operations: 0 installs, 1 update, 1 removal - Downloading fruitcake/laravel-cors (v3.0.0) - Removing asm89/stack-cors (v2.1.1) - Upgrading...
2022/05/30
[ "https://Stackoverflow.com/questions/72436803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/972828/" ]
To continue using php 8.0 add these entries to your composer.json ``` "require": { ... "symfony/console": "6.0.*", "symfony/error-handler": "6.0.*", "symfony/finder": "6.0.*", "symfony/http-foundation": "6.0.*", "symfony/http-kernel": "6.0.*", "symfony/mailer...
Upgrading your PHP version to `PHP 8.1` should solve the problem. And just make sure to run `composer install` or `composer update` again
16,723
So I have six eight years of trial-and-error evidence to show that I am incapable of building strength to any measurable degree from any form of exercise. I do not show results and I have become tired of working out for no reason. I have put it all to an end and I am seeking alternative ways to build strength. One pers...
2014/06/05
[ "https://fitness.stackexchange.com/questions/16723", "https://fitness.stackexchange.com", "https://fitness.stackexchange.com/users/8807/" ]
Stop Making Excuses ------------------- > > "I have six [to] eight years of trial-and-error evidence to show that I am incapable of building strength to any measurable degree from any form of exercise." > > > Either you have a serious medical issue or I call bullshit. I bet the reason you're not getting results i...
> > A 22 year old man who is out lifted by small teenagers who barely > workout ... I am a shame of a man and person overall. > > > With that attitude, what you are experiencing is not that strange. When thoughts of that kind manifest in your mind, notice that they don't serve you, and are not even logical (why w...
16,723
So I have six eight years of trial-and-error evidence to show that I am incapable of building strength to any measurable degree from any form of exercise. I do not show results and I have become tired of working out for no reason. I have put it all to an end and I am seeking alternative ways to build strength. One pers...
2014/06/05
[ "https://fitness.stackexchange.com/questions/16723", "https://fitness.stackexchange.com", "https://fitness.stackexchange.com/users/8807/" ]
If exercise really would not work then your muscles should have wasted away by now and you would not be able to get out of bed. Astronauts who stay on board the ISS for more than a few weeks have to work very hard to compensate for not having to carry their body weights all day long. So, your muscles are able to repai...
I have had a problem with the confidence and energy(visible as enthusiasm) which allow me to exercise and feel good until recently and I believe it was diet and sleep related. Because it sounds as though confidence and enthusiasm are likely a large part of your problem, I suggest getting at least 30 grams of protein (e...
16,723
So I have six eight years of trial-and-error evidence to show that I am incapable of building strength to any measurable degree from any form of exercise. I do not show results and I have become tired of working out for no reason. I have put it all to an end and I am seeking alternative ways to build strength. One pers...
2014/06/05
[ "https://fitness.stackexchange.com/questions/16723", "https://fitness.stackexchange.com", "https://fitness.stackexchange.com/users/8807/" ]
Genetically engineering your muscles? Not in the next decade or two. Steroids without exercise? No. Steroids increase the protein available to cells, which effectively allows you to work your muscles harder so they grow more. > > A 22 year old man who is out lifted by small teenagers who barely workout ... I am a sha...
If exercise really would not work then your muscles should have wasted away by now and you would not be able to get out of bed. Astronauts who stay on board the ISS for more than a few weeks have to work very hard to compensate for not having to carry their body weights all day long. So, your muscles are able to repai...
16,723
So I have six eight years of trial-and-error evidence to show that I am incapable of building strength to any measurable degree from any form of exercise. I do not show results and I have become tired of working out for no reason. I have put it all to an end and I am seeking alternative ways to build strength. One pers...
2014/06/05
[ "https://fitness.stackexchange.com/questions/16723", "https://fitness.stackexchange.com", "https://fitness.stackexchange.com/users/8807/" ]
Disregarding the fact that I agree with Dave Liepmann (either you are not training properly or you have a medical condition inhibiting your performance), I will give you a constructive answer. There is one thing you can do to increase strength without training. It is something that elite athletes use, and is one of the...
It can be a medical condition like growth hormone deficiency or testosteron deficiency, which you probably won't be able to get confirmed by a normal doctor. Also the mental problems you have with it, feeling unworthy etc, can also stem from there, so balancing your body hormones would be a good first start. (assuming...
16,723
So I have six eight years of trial-and-error evidence to show that I am incapable of building strength to any measurable degree from any form of exercise. I do not show results and I have become tired of working out for no reason. I have put it all to an end and I am seeking alternative ways to build strength. One pers...
2014/06/05
[ "https://fitness.stackexchange.com/questions/16723", "https://fitness.stackexchange.com", "https://fitness.stackexchange.com/users/8807/" ]
Genetically engineering your muscles? Not in the next decade or two. Steroids without exercise? No. Steroids increase the protein available to cells, which effectively allows you to work your muscles harder so they grow more. > > A 22 year old man who is out lifted by small teenagers who barely workout ... I am a sha...
I have had a problem with the confidence and energy(visible as enthusiasm) which allow me to exercise and feel good until recently and I believe it was diet and sleep related. Because it sounds as though confidence and enthusiasm are likely a large part of your problem, I suggest getting at least 30 grams of protein (e...
16,723
So I have six eight years of trial-and-error evidence to show that I am incapable of building strength to any measurable degree from any form of exercise. I do not show results and I have become tired of working out for no reason. I have put it all to an end and I am seeking alternative ways to build strength. One pers...
2014/06/05
[ "https://fitness.stackexchange.com/questions/16723", "https://fitness.stackexchange.com", "https://fitness.stackexchange.com/users/8807/" ]
Stop Making Excuses ------------------- > > "I have six [to] eight years of trial-and-error evidence to show that I am incapable of building strength to any measurable degree from any form of exercise." > > > Either you have a serious medical issue or I call bullshit. I bet the reason you're not getting results i...
Disregarding the fact that I agree with Dave Liepmann (either you are not training properly or you have a medical condition inhibiting your performance), I will give you a constructive answer. There is one thing you can do to increase strength without training. It is something that elite athletes use, and is one of the...
16,723
So I have six eight years of trial-and-error evidence to show that I am incapable of building strength to any measurable degree from any form of exercise. I do not show results and I have become tired of working out for no reason. I have put it all to an end and I am seeking alternative ways to build strength. One pers...
2014/06/05
[ "https://fitness.stackexchange.com/questions/16723", "https://fitness.stackexchange.com", "https://fitness.stackexchange.com/users/8807/" ]
Disregarding the fact that I agree with Dave Liepmann (either you are not training properly or you have a medical condition inhibiting your performance), I will give you a constructive answer. There is one thing you can do to increase strength without training. It is something that elite athletes use, and is one of the...
If exercise really would not work then your muscles should have wasted away by now and you would not be able to get out of bed. Astronauts who stay on board the ISS for more than a few weeks have to work very hard to compensate for not having to carry their body weights all day long. So, your muscles are able to repai...
16,723
So I have six eight years of trial-and-error evidence to show that I am incapable of building strength to any measurable degree from any form of exercise. I do not show results and I have become tired of working out for no reason. I have put it all to an end and I am seeking alternative ways to build strength. One pers...
2014/06/05
[ "https://fitness.stackexchange.com/questions/16723", "https://fitness.stackexchange.com", "https://fitness.stackexchange.com/users/8807/" ]
Stop Making Excuses ------------------- > > "I have six [to] eight years of trial-and-error evidence to show that I am incapable of building strength to any measurable degree from any form of exercise." > > > Either you have a serious medical issue or I call bullshit. I bet the reason you're not getting results i...
If exercise really would not work then your muscles should have wasted away by now and you would not be able to get out of bed. Astronauts who stay on board the ISS for more than a few weeks have to work very hard to compensate for not having to carry their body weights all day long. So, your muscles are able to repai...
16,723
So I have six eight years of trial-and-error evidence to show that I am incapable of building strength to any measurable degree from any form of exercise. I do not show results and I have become tired of working out for no reason. I have put it all to an end and I am seeking alternative ways to build strength. One pers...
2014/06/05
[ "https://fitness.stackexchange.com/questions/16723", "https://fitness.stackexchange.com", "https://fitness.stackexchange.com/users/8807/" ]
Disregarding the fact that I agree with Dave Liepmann (either you are not training properly or you have a medical condition inhibiting your performance), I will give you a constructive answer. There is one thing you can do to increase strength without training. It is something that elite athletes use, and is one of the...
I have had a problem with the confidence and energy(visible as enthusiasm) which allow me to exercise and feel good until recently and I believe it was diet and sleep related. Because it sounds as though confidence and enthusiasm are likely a large part of your problem, I suggest getting at least 30 grams of protein (e...
16,723
So I have six eight years of trial-and-error evidence to show that I am incapable of building strength to any measurable degree from any form of exercise. I do not show results and I have become tired of working out for no reason. I have put it all to an end and I am seeking alternative ways to build strength. One pers...
2014/06/05
[ "https://fitness.stackexchange.com/questions/16723", "https://fitness.stackexchange.com", "https://fitness.stackexchange.com/users/8807/" ]
Disregarding the fact that I agree with Dave Liepmann (either you are not training properly or you have a medical condition inhibiting your performance), I will give you a constructive answer. There is one thing you can do to increase strength without training. It is something that elite athletes use, and is one of the...
> > A 22 year old man who is out lifted by small teenagers who barely > workout ... I am a shame of a man and person overall. > > > With that attitude, what you are experiencing is not that strange. When thoughts of that kind manifest in your mind, notice that they don't serve you, and are not even logical (why w...
221,568
Is there a way in SWT to get a monospaced font simply, that works across various operating systems? For example. this works on Linux, but not Windows: ``` Font mono = new Font(parent.getDisplay(), "Mono", 10, SWT.NONE); ``` or do I need to have a method that tries loading varying fonts (Consolas, Terminal, Monaco,...
2008/10/21
[ "https://Stackoverflow.com/questions/221568", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17832/" ]
According to the section on [Font Configuration Files](http://java.sun.com/javase/6/docs/technotes/guides/intl/fontconfig.html) in the JDK documentation of [Internationalization Support](http://java.sun.com/javase/6/docs/technotes/guides/intl/)-related APIs, the concept of **Logical Font**s is used to define certain pl...
To the best of my knowledge, the AWT API does not expose underlying Font information. If you can get to it, I would expect it to be implementation dependent. Certainly, comparing the font mapping files in a couple of JRE lib directories, I can see that they are not defined in a consistent way. You could load your own ...
221,568
Is there a way in SWT to get a monospaced font simply, that works across various operating systems? For example. this works on Linux, but not Windows: ``` Font mono = new Font(parent.getDisplay(), "Mono", 10, SWT.NONE); ``` or do I need to have a method that tries loading varying fonts (Consolas, Terminal, Monaco,...
2008/10/21
[ "https://Stackoverflow.com/questions/221568", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17832/" ]
According to the section on [Font Configuration Files](http://java.sun.com/javase/6/docs/technotes/guides/intl/fontconfig.html) in the JDK documentation of [Internationalization Support](http://java.sun.com/javase/6/docs/technotes/guides/intl/)-related APIs, the concept of **Logical Font**s is used to define certain pl...
If you want just a Monospaced font use "Courier" => `new Font(display, "Courier", 10, SWT.NORMAL)`