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
58,242,916
Why am I getting this error? ```none Cannot read property 'target' of undefined at btn ``` I declare `btn()` in my html file. I have multiples buttons in the html invoking `btn()`. ``` function btn(event){ var theTarget = event.target; alert(theTarget.tagName); } ```
2019/10/04
[ "https://Stackoverflow.com/questions/58242916", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5689051/" ]
Suggests that the `event` parameter has not been set (i.e. is undefined) when the `btn(...)` method was called. You should verify that `event` is set whenever the code tries to use that method. It might also be safer to not use `event` as the parameter name in your function - this might cause problems (i.e. it's [app...
By default function takes arguments values as **undefined** in JavaScript so I wish you have forgotten to pass **event** to handler function i.e. to **btn()**. > > A best simple example to understand this concept would be > <https://www.w3schools.com/jsref/event_target.asp> > > > So instead of calling like `onc...
58,242,916
Why am I getting this error? ```none Cannot read property 'target' of undefined at btn ``` I declare `btn()` in my html file. I have multiples buttons in the html invoking `btn()`. ``` function btn(event){ var theTarget = event.target; alert(theTarget.tagName); } ```
2019/10/04
[ "https://Stackoverflow.com/questions/58242916", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5689051/" ]
There are a few options for how to do this, and each behaves differently. **Option 1** Set `onclick="btn(this)"` on the button. This *always* passes the button itself as the argument. The other options pass an event as opposed to the element itself. ```js function btn(elem) { var theTarget = elem; console.log(t...
Suggests that the `event` parameter has not been set (i.e. is undefined) when the `btn(...)` method was called. You should verify that `event` is set whenever the code tries to use that method. It might also be safer to not use `event` as the parameter name in your function - this might cause problems (i.e. it's [app...
58,242,916
Why am I getting this error? ```none Cannot read property 'target' of undefined at btn ``` I declare `btn()` in my html file. I have multiples buttons in the html invoking `btn()`. ``` function btn(event){ var theTarget = event.target; alert(theTarget.tagName); } ```
2019/10/04
[ "https://Stackoverflow.com/questions/58242916", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5689051/" ]
There are a few options for how to do this, and each behaves differently. **Option 1** Set `onclick="btn(this)"` on the button. This *always* passes the button itself as the argument. The other options pass an event as opposed to the element itself. ```js function btn(elem) { var theTarget = elem; console.log(t...
Note: When we call the function from the HTML we get the button directly i.e. the `target`. With binding we get `event` ```js function btn(event){ var theTarget = event.target || event; alert(theTarget.tagName); } document.querySelector('#boundEvent').onclick = btn; ``` ```html <!-- In this way...
58,242,916
Why am I getting this error? ```none Cannot read property 'target' of undefined at btn ``` I declare `btn()` in my html file. I have multiples buttons in the html invoking `btn()`. ``` function btn(event){ var theTarget = event.target; alert(theTarget.tagName); } ```
2019/10/04
[ "https://Stackoverflow.com/questions/58242916", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5689051/" ]
There are a few options for how to do this, and each behaves differently. **Option 1** Set `onclick="btn(this)"` on the button. This *always* passes the button itself as the argument. The other options pass an event as opposed to the element itself. ```js function btn(elem) { var theTarget = elem; console.log(t...
By default function takes arguments values as **undefined** in JavaScript so I wish you have forgotten to pass **event** to handler function i.e. to **btn()**. > > A best simple example to understand this concept would be > <https://www.w3schools.com/jsref/event_target.asp> > > > So instead of calling like `onc...
22,307,967
I am attempting to clean up in a messy table consisting of words which are unnecessary. The example below shows the typical content: ``` row1 | ------------- text <12> | more [dada] | (123) foo | la {55w} da | ``` Basically what i define as unnecessary content is all the words starting and ending with a p...
2014/03/10
[ "https://Stackoverflow.com/questions/22307967", "https://Stackoverflow.com", "https://Stackoverflow.com/users/531203/" ]
Ok i see now ! **use the replace like this** - see example(will clean everything from inside '()') ``` mysql> CREATE TABLE tbl ( -> txt VARCHAR(255) -> ); Query OK, 0 rows affected (0.50 sec) mysql> INSERT INTO tbl VALUES -> ('sometext (asdebtrw)'), -> ('some other text ( sd sdasddebtrw)'), ...
[regex\_replace](https://mariadb.com/kb/en/regexp_replace/) is your mate here: ``` SELECT REGEXP_REPLACE('ab12cd','[0-9]','') AS remove_digits; -> abcd ``` Though it may be a [MariaDB](http://mariadb.com) enhancement.
4,982,847
I am trying to hack an ACL into a Template without making the Template aware of the ACL object in the class definition. The following code generates an undefined method Template::isAllowed Why is this? TIA! ``` class ACL { protected $allowed = array('anything'); public funct...
2011/02/13
[ "https://Stackoverflow.com/questions/4982847", "https://Stackoverflow.com", "https://Stackoverflow.com/users/427387/" ]
This: ``` $Template->isAllowed('anything') ``` actually tells PHP to call a method `Template::isAllowed()`, which obviously doesn't exist as given by your fatal error. You cannot treat `Template::isAllowed()` as if it were a real method by assigning a closure to a property. However you can still call the closure th...
Simply this does not work -- you can not add class methods dynamically in PHP, period. This was discussed at places like [define a closure as method from class](https://stackoverflow.com/questions/2881311/define-a-closure-as-method-from-class).
209,795
I have a line and point layer. Points are not exactly intersect with line layer. With respect to existing point, how to find the new points which are exactly on the line ? consider buffer distance is provided. [![enter image description here](https://i.stack.imgur.com/JYiIR.png)](https://i.stack.imgur.com/JYiIR.png)
2016/09/07
[ "https://gis.stackexchange.com/questions/209795", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/43581/" ]
You can use the near tool to calculate the perpendicular points on a line : 1. Calculate the distance from points to lines with the [Near tool](http://desktop.arcgis.com/en/arcmap/10.3/tools/analysis-toolbox/near.htm) : * input features: Points * near features: Lines * check "location option" to get near\_x and ne...
You can use the **[Linear referencing tools](https://pro.arcgis.com/en/pro-app/tool-reference/linear-referencing/an-overview-of-the-linear-referencing-toolbox.htm)** to quantify that distance in the other way round, to get all distances possible for all the points you have. You will be free to choose which distance wil...
147,487
Whenever I fire a weapon or stomp, my computer emits the new device sound and disables my controller for a split second, meaning I fire a shot or two on an automatic rifle and then return to stance. This only happens with stomp or shooting while zoomed in. It doesn't happen with running, or striking. Any ideas?
2013/12/23
[ "https://gaming.stackexchange.com/questions/147487", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/64653/" ]
You might be running into one of the issues mentioned in this article: <http://kotaku.com/wanna-catch-your-pokemon-in-a-shiny-new-color-in-x-y-1450801224> For instance, you could be walking into Slow or Normal shaking grass, which could be breaking your chain.
There can be several possible causes for this: 1. Leaving the field you were chaining in. 2. Turning off your game. 3. Using any other key item besides the PokeRadar. 4. Having an egg hatched during your chaining. 5. Running into a wild Pokemon that is not from the PokeRadar. You can use Repels to avoid this. 6. Stepp...
371,529
I am modelling a regression with a GBM and evaluate by RMSE. My model input & target is log-transformed which results in an RMSE that is also on log-scale. How can i interpret this in an intuitive way, e.g. as deviation from the mean price or sth. equal, that is easy to understand?
2018/10/12
[ "https://stats.stackexchange.com/questions/371529", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/217805/" ]
As the RMSE is in log-space it behaves like a multipicative factor. So you are finding the square root of the mean of the squared ratio between the model values and the true values. I.e. if the RMSE were 0.693 (=ln 2) the model values would be roughly a factor of two out on average (in either direction) from the true ...
great answer by @stuart10 above. I'd like to add that if you transform your `y_pred` and `y` variables back from logspace (say, using `np.exp`) you can in addition calculate RMSE where the results is the mean error in the original units. so if `y` was in dollars, after transforming back from logspace, RMSE would give ...
57,364,810
I have this array as an output of a json.loads and I need to get the title and the duration, but not videos, only tracklist: ``` `[{'styles': ['Latin', 'Ballad'], 'genres': ['Latin', 'Pop'], 'videos': [{'duration': 285, 'embed': True, 'title': 'Crazy', 'description': '', 'uri': 'https://www.youtube...
2019/08/05
[ "https://Stackoverflow.com/questions/57364810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11864449/" ]
``` import pandas as pd test = {'styles': ['Latin', 'Ballad'], 'genres': ['Latin', 'Pop'], 'videos': [ {'duration': 285, 'description': 'Crazy (Spanish Video Remastered)', 'embed': True, 'uri': 'https://www.youtube.com/watch?v=p7QYo-9SlP0', 'title': 'Crazy2 (Spanish Video Remastered)'}, {'duration': 247, '...
You can jo with pandas function `json_normalize` and then process the dataframe easier. json\_normalize "flats" the dict to a dataframe like this: ``` { "Name": Jhon, "Pet": { "Animal": dog } } # to Name Pet_Animal ---------------------------------- Jhon Dog ``` <https://pandas.pydata.org/pan...
52,176,680
I'm using ng6 with NGRX to display two datasets in the view. The first dataset is the complete dataset. The second dataset is an subset of the first dataset. I need to use an ngFor loop on the second dataset, which provides an `id`, and within the loop use the `id` to display a single entity from the first dataset. ...
2018/09/05
[ "https://Stackoverflow.com/questions/52176680", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8016446/" ]
Since you're already using selectors I would suggest to create a new selector based on the current two. ``` const combinedSelector = createSelect(datasetOne, datasetTwo, (one, two) => ... ) ``` If this isn't possible, you could also the following, as mentioned in [NgRx: Parameterized selectors](https://blog.angula...
You basically have two streams and you want to create a new stream using values from both. You need to use `zip` Doc : <http://reactivex.io/documentation/operators/zip.html> Syntax is something like : ``` Observable.zip ( source 1, source 2, function ) ``` Ex : ```js const dataNames = Rx.Observable.of(['name1'...
69,908,377
How do I avoid passing a service as a parameter in the constructor? If a declare it as an instance, I get a null value. Im using Vaadin14 with Spring Boot and Java v11 ``` public interface AccountRoleRepository extends JpaRepository<AccountRole, Long> { } @Service public class AccountRoleRepositoryService { @Aut...
2021/11/10
[ "https://Stackoverflow.com/questions/69908377", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2964585/" ]
You should not instantiate @Route classes manually. There's technically nothing preventing you from doing that, but it's almost certainly going to make your code more difficult to understand, and as you have noticed, you can't use Spring dependency injection.
I was able to solve it by implementing a singleton in my service class.. ``` @Service public class AccountRoleRepositoryService { private static AccountRoleRepository repository; private static AccountRoleRepositoryService INSTANCE; private AccountRoleRepositoryService(AccountRoleRepository repository) ...
69,908,377
How do I avoid passing a service as a parameter in the constructor? If a declare it as an instance, I get a null value. Im using Vaadin14 with Spring Boot and Java v11 ``` public interface AccountRoleRepository extends JpaRepository<AccountRole, Long> { } @Service public class AccountRoleRepositoryService { @Aut...
2021/11/10
[ "https://Stackoverflow.com/questions/69908377", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2964585/" ]
You should not instantiate @Route classes manually. There's technically nothing preventing you from doing that, but it's almost certainly going to make your code more difficult to understand, and as you have noticed, you can't use Spring dependency injection.
The difference between constructor-injection and field-injection is that with field-injection, the injected component is NOT available (==> null) **during the constructor**, it will be available directly after the constructor, for example in a method annotated with `@PostConstruct` or at any later stage **as long as th...
318,610
In two of my latest reviewed edits, the [fabric](https://stackoverflow.com/questions/tagged/fabric "show questions tagged 'fabric'") tag was removed from the post, as the context was Android. The current Stack Overflow [fabric](https://stackoverflow.com/questions/tagged/fabric "show questions tagged 'fabric'") tag refe...
2016/03/09
[ "https://meta.stackoverflow.com/questions/318610", "https://meta.stackoverflow.com", "https://meta.stackoverflow.com/users/818827/" ]
> > Is it ok to remove a not matching tag from a series of questions? > > > Yes, that's definitely ok. > > I assume 20 questions are far too less to suggest splitting [fabric] to [fabric.python] and [fabric.android], right? > > > It's probably too few to support creating a `[fabric.python]` tag. Since there ...
There are already at least three tags related to the framework you're talking about. Take a look at [fabric-twitter](https://stackoverflow.com/questions/tagged/fabric-twitter "show questions tagged 'fabric-twitter'") (382 Q), [twitter-fabric](https://stackoverflow.com/questions/tagged/twitter-fabric "show questions tag...
318,610
In two of my latest reviewed edits, the [fabric](https://stackoverflow.com/questions/tagged/fabric "show questions tagged 'fabric'") tag was removed from the post, as the context was Android. The current Stack Overflow [fabric](https://stackoverflow.com/questions/tagged/fabric "show questions tagged 'fabric'") tag refe...
2016/03/09
[ "https://meta.stackoverflow.com/questions/318610", "https://meta.stackoverflow.com", "https://meta.stackoverflow.com/users/818827/" ]
> > Is it ok to remove a not matching tag from a series of questions? > > > Yes, that's definitely ok. > > I assume 20 questions are far too less to suggest splitting [fabric] to [fabric.python] and [fabric.android], right? > > > It's probably too few to support creating a `[fabric.python]` tag. Since there ...
So, Fabric was [acquired by Google](https://fabric.io/blog/fabric-joins-google). I suggest to use [google-fabric](https://stackoverflow.com/questions/tagged/google-fabric "show questions tagged 'google-fabric'") and make [twitter-fabric](https://stackoverflow.com/questions/tagged/twitter-fabric "show questions tagged ...
318,610
In two of my latest reviewed edits, the [fabric](https://stackoverflow.com/questions/tagged/fabric "show questions tagged 'fabric'") tag was removed from the post, as the context was Android. The current Stack Overflow [fabric](https://stackoverflow.com/questions/tagged/fabric "show questions tagged 'fabric'") tag refe...
2016/03/09
[ "https://meta.stackoverflow.com/questions/318610", "https://meta.stackoverflow.com", "https://meta.stackoverflow.com/users/818827/" ]
There are already at least three tags related to the framework you're talking about. Take a look at [fabric-twitter](https://stackoverflow.com/questions/tagged/fabric-twitter "show questions tagged 'fabric-twitter'") (382 Q), [twitter-fabric](https://stackoverflow.com/questions/tagged/twitter-fabric "show questions tag...
So, Fabric was [acquired by Google](https://fabric.io/blog/fabric-joins-google). I suggest to use [google-fabric](https://stackoverflow.com/questions/tagged/google-fabric "show questions tagged 'google-fabric'") and make [twitter-fabric](https://stackoverflow.com/questions/tagged/twitter-fabric "show questions tagged ...
29,577
Suppose we have systems $A$ and $B$ with respective Hamiltonians $H\_A \otimes \mathbb{1}$ and $\mathbb{1} \otimes H\_B$. These Hamiltonians commute, so they share the same eigenbasis and hence can be simultaneously diagonalized. If we work in the shared eigenbasis, is it true that we can rewrite the Hamiltonians as $...
2023/01/05
[ "https://quantumcomputing.stackexchange.com/questions/29577", "https://quantumcomputing.stackexchange.com", "https://quantumcomputing.stackexchange.com/users/15947/" ]
**TL;DR:** You can always achieve simultaneous diagonalization of $H\_A\otimes\mathbb{1}$ and $\mathbb{1}\otimes H\_B$ even if $[H\_A, H\_B]\ne 0$. And yes, this does follow from the fact that $[H\_A\otimes\mathbb{1}, \mathbb{1}\otimes H\_B]=0$. Moreover, it is true whether or not the Hilbert spaces of $A$ and $B$ have...
I'm assuming these Hamiltonians act on separate subsystems, since that's the only way to *guarantee* that $[H\_A \otimes \mathbb{1}, \mathbb{1} \otimes H\_B] = 0$. Since the two Hamiltonians act on separate subsystems, they commute *qubit-wise*, which means you can apply diagonalizing unitaries to each subsystem indepe...
4,678,447
I'm trying to find a good (and well documented) hashing library to use with my C++ program, I only need to generate two hashes from a string. I've tried with `crypto++` and `mhash` and I didn't manage to make them work, also with <http://www.zedwood.com/article/121/cpp-md5-function> I would be glad if this library is...
2011/01/13
[ "https://Stackoverflow.com/questions/4678447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/572534/" ]
Try this open source library <http://hashlib2plus.sourceforge.net/>
see my answer [here](https://stackoverflow.com/questions/4669306/using-cryptographic-streams-in-c/4671578#4671578). The original sample is taken from [here](http://www.cryptopp.com/fom-serve/cache/50.html), and operates on `std::string` rather than on `std::istream`. There are many good samples on cryptopp wiki, I'll t...
4,678,447
I'm trying to find a good (and well documented) hashing library to use with my C++ program, I only need to generate two hashes from a string. I've tried with `crypto++` and `mhash` and I didn't manage to make them work, also with <http://www.zedwood.com/article/121/cpp-md5-function> I would be glad if this library is...
2011/01/13
[ "https://Stackoverflow.com/questions/4678447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/572534/" ]
Try this open source library <http://hashlib2plus.sourceforge.net/>
Search before ask, there is already question: [What is the best encryption library in C/C++?](https://stackoverflow.com/questions/180870/what-is-the-best-encryption-library-in-c-c) Solutions like OpenSSL and Crypto++ are cross-platform, if you "didn't manage to make them work", you should have been more specific like:...
39,108,930
On my WPF application, I made two separate projects: the UI (with the XAML and the ViewModels) and the "Core" (it has what people call "domain objects" or "business objects" - objects that represent discrete concepts in my use cases). I understand this is a good practice. But many of my business objects interact with ...
2016/08/23
[ "https://Stackoverflow.com/questions/39108930", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1253691/" ]
Because `From` (that is `From` with `F` in upper-case, `rom` in lower, followed by a space character) in the beginning of the line marks the beginning of a new message in the [*mbox*](https://en.wikipedia.org/wiki/Mbox#Family) format. The *mbox* format is just really one text file with messages appended to each other. ...
That same practice has been introduced in another Linux tool: Git (2.10, June 2016), which teached `format-patch` and `mailsplit` (hence "`am`") how a line that happens to begin with "`From` " in the e-mail message is quoted with "`>`", so that these lines can be restored to their original shape. See [commit d9925d1](...
12,889,796
I have to put large amount of text into the `JTable`. When I try to put the text into the `JTable` , it all goes all into a row without breaking a line like : ![enter image description here](https://i.stack.imgur.com/KsH6u.jpg) and there are no horizontal scroll bars also. Is there any way I can put the text in a new...
2012/10/15
[ "https://Stackoverflow.com/questions/12889796", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1607545/" ]
You can try .Insert() as below: ``` al.Insert(1, "bcd"); ```
EDIT: You can't directly insert based on an index in a List, you can only Set(Modify)/Get a value to an index. **If it exists** --- You can use indexing with an ArrayList as well, but use a Generic [List](http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx) instead of ArrayList. Its type safe. and Also support inse...
12,889,796
I have to put large amount of text into the `JTable`. When I try to put the text into the `JTable` , it all goes all into a row without breaking a line like : ![enter image description here](https://i.stack.imgur.com/KsH6u.jpg) and there are no horizontal scroll bars also. Is there any way I can put the text in a new...
2012/10/15
[ "https://Stackoverflow.com/questions/12889796", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1607545/" ]
EDIT: You can't directly insert based on an index in a List, you can only Set(Modify)/Get a value to an index. **If it exists** --- You can use indexing with an ArrayList as well, but use a Generic [List](http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx) instead of ArrayList. Its type safe. and Also support inse...
al[1] needs to be created before you can use it via the indexer. `al[1] = "bcd";` will result in an exception of `ArgumentOutOfRangeException`. Remember array indexes start from zero. If you want to overwrite it, it should be like this. ``` al[0] = "bcd"; ```
12,889,796
I have to put large amount of text into the `JTable`. When I try to put the text into the `JTable` , it all goes all into a row without breaking a line like : ![enter image description here](https://i.stack.imgur.com/KsH6u.jpg) and there are no horizontal scroll bars also. Is there any way I can put the text in a new...
2012/10/15
[ "https://Stackoverflow.com/questions/12889796", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1607545/" ]
You can try .Insert() as below: ``` al.Insert(1, "bcd"); ```
al[1] needs to be created before you can use it via the indexer. `al[1] = "bcd";` will result in an exception of `ArgumentOutOfRangeException`. Remember array indexes start from zero. If you want to overwrite it, it should be like this. ``` al[0] = "bcd"; ```
19,218,066
Hi I'm new to C# and C++ programming and trying to use an unmanaged C++ dll in a C# project (.NET 3.5). I'm stuck on this error: System.Runtime.InteropServices.SafeArrayTypeMismatchException: Specified array was not of the expected type. Here is the header file for the DLL ``` #ifdef FUNCTIONLIB_EXPORTS #define FUN...
2013/10/07
[ "https://Stackoverflow.com/questions/19218066", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1024276/" ]
Several problems: ``` public char[] UserName; ``` That needs to be marshaled as an embedded string: ``` [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] public string UserName; ``` Repeat that for the other fields that are declared like this. ``` public char *pOutBuf; // example C++ usage: ...
I think you are missing a couple of things from your structure definition * The layout of struct in memory is different in c++ so you need to add `[StructLayout(LayoutKind.Sequential)]` attribute to your structure * In C++ you have fixed length char arrays, so you need to specify that also in c# using attribute `[Mars...
15,531
I setup my environment to create a core dump of everything that crashes, however when I run an program with SUID set on a different user than the executing user it doesn't create a core dump. Any idea's why this might be? I couldn't find it anywhere on the web, I think it's some sort of security feature but I would lik...
2011/06/23
[ "https://unix.stackexchange.com/questions/15531", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/8579/" ]
The memory of a setuid program might (is likely to, even) contain confidential data. So the core dump would have to be readable by root only. If the core dump is owned by root, I don't see an obvious security hole, though the kernel would have to be careful not to overwrite an existing file. Linux disables core dumps...
The core dump contains a copy of everything which was in memory at the time of the fault. If the program is running suid, that means it needs access to something which you, as a user, do not have access to. If the program gets that information then dumps core, you'll be able to read that privileged information. From y...
15,531
I setup my environment to create a core dump of everything that crashes, however when I run an program with SUID set on a different user than the executing user it doesn't create a core dump. Any idea's why this might be? I couldn't find it anywhere on the web, I think it's some sort of security feature but I would lik...
2011/06/23
[ "https://unix.stackexchange.com/questions/15531", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/8579/" ]
The core dump contains a copy of everything which was in memory at the time of the fault. If the program is running suid, that means it needs access to something which you, as a user, do not have access to. If the program gets that information then dumps core, you'll be able to read that privileged information. From y...
I decided that I will also share my use case, until I forget it. It might be handy also for future me since I was solving same issue months ago and it took me too much time to find out once more. Ok. it is not actually core-dump, but stack trace that is also useful. Problem: No idea what is going on there: ``` sudo i...
15,531
I setup my environment to create a core dump of everything that crashes, however when I run an program with SUID set on a different user than the executing user it doesn't create a core dump. Any idea's why this might be? I couldn't find it anywhere on the web, I think it's some sort of security feature but I would lik...
2011/06/23
[ "https://unix.stackexchange.com/questions/15531", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/8579/" ]
The memory of a setuid program might (is likely to, even) contain confidential data. So the core dump would have to be readable by root only. If the core dump is owned by root, I don't see an obvious security hole, though the kernel would have to be careful not to overwrite an existing file. Linux disables core dumps...
I decided that I will also share my use case, until I forget it. It might be handy also for future me since I was solving same issue months ago and it took me too much time to find out once more. Ok. it is not actually core-dump, but stack trace that is also useful. Problem: No idea what is going on there: ``` sudo i...
26,430,189
So: ``` //aValue = 4.45 //bValue = 4.35 //maxValueDiff = 0.1 //The absolute value of a - b = 0.1 if( Math.abs(aValue - bValue) <= maxValueDiff ) return true; logger.info("valueDiffCheck a:" + aValue +" b:"+ bValue + " e1:" + maxValueDiff); ``` Why do I see this in my logs: ``` valueDiffCheck a:4.45 b:4.35 e1:0.1 ...
2014/10/17
[ "https://Stackoverflow.com/questions/26430189", "https://Stackoverflow.com", "https://Stackoverflow.com/users/447607/" ]
If you want to be exact, I don't see any way around using BigDecimal. But depending what you do with this numbers you can always round using `Math.round` to "ensure" you have the "correct" decimals set. [Round a double to 2 decimal places](https://stackoverflow.com/questions/2808535/round-a-double-to-2-decimal-places...
You can always consider using your own decimal class that uses `long` to store the value and a decimal placeholder. ``` public Class MyDecimal { private long value = 0; private long decimalPlace = 0; ... } ``` This means you can make 0.44 be doing something like: ``` MyDecimal decimal = new MyDecimal(4...
26,430,189
So: ``` //aValue = 4.45 //bValue = 4.35 //maxValueDiff = 0.1 //The absolute value of a - b = 0.1 if( Math.abs(aValue - bValue) <= maxValueDiff ) return true; logger.info("valueDiffCheck a:" + aValue +" b:"+ bValue + " e1:" + maxValueDiff); ``` Why do I see this in my logs: ``` valueDiffCheck a:4.45 b:4.35 e1:0.1 ...
2014/10/17
[ "https://Stackoverflow.com/questions/26430189", "https://Stackoverflow.com", "https://Stackoverflow.com/users/447607/" ]
I solve this problem by using an error margin in places where it might come up. The following is a very simple way - but not necessarily the best way (you may want it more centralized, configurable, etc.) - to modify your code to do this: ``` private static final double ERROR = 1e-7; // SNIP if( Math.abs(aValue - bV...
You can always consider using your own decimal class that uses `long` to store the value and a decimal placeholder. ``` public Class MyDecimal { private long value = 0; private long decimalPlace = 0; ... } ``` This means you can make 0.44 be doing something like: ``` MyDecimal decimal = new MyDecimal(4...
15,584,204
I am trying to generate a set of files through a python script on a 48-core cluster which actually has a master-and 3 slave machines. I need to generate a set of files, run some scripts on them, collect results and then delete them. I again repeat the process- regenerate files, execute, delete etc., When I delete and r...
2013/03/23
[ "https://Stackoverflow.com/questions/15584204", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1984671/" ]
> > I am not able to get a simple thing like `subprocess.Popen('cd /whatever_directory')` working. > > > Each process's current working directory is independent of other processes in the system. When you start a subprocess (using either of these mechanisms), and get it to `cd` into another directory, that has no ...
I might be not answering you question directly, but for such tasks which require running subprocess, I always use [plumbum](http://plumbum.readthedocs.org). IMO, It makes the task much simpler and more intuitive, including running on remote machines. Using plumbum, in order to set subprocess's working directory, you ...
15,584,204
I am trying to generate a set of files through a python script on a 48-core cluster which actually has a master-and 3 slave machines. I need to generate a set of files, run some scripts on them, collect results and then delete them. I again repeat the process- regenerate files, execute, delete etc., When I delete and r...
2013/03/23
[ "https://Stackoverflow.com/questions/15584204", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1984671/" ]
As NPE already noted, new processes don't affect the existing one (which means `os.system('cd /some/where')` also has no effect on the current process). In this case, though, I think you're tripping over the fact that `os.system` invokes a shell to interpret the command you pass in, while `subprocess.Popen` does not do...
> > I am not able to get a simple thing like `subprocess.Popen('cd /whatever_directory')` working. > > > Each process's current working directory is independent of other processes in the system. When you start a subprocess (using either of these mechanisms), and get it to `cd` into another directory, that has no ...
15,584,204
I am trying to generate a set of files through a python script on a 48-core cluster which actually has a master-and 3 slave machines. I need to generate a set of files, run some scripts on them, collect results and then delete them. I again repeat the process- regenerate files, execute, delete etc., When I delete and r...
2013/03/23
[ "https://Stackoverflow.com/questions/15584204", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1984671/" ]
As NPE already noted, new processes don't affect the existing one (which means `os.system('cd /some/where')` also has no effect on the current process). In this case, though, I think you're tripping over the fact that `os.system` invokes a shell to interpret the command you pass in, while `subprocess.Popen` does not do...
I might be not answering you question directly, but for such tasks which require running subprocess, I always use [plumbum](http://plumbum.readthedocs.org). IMO, It makes the task much simpler and more intuitive, including running on remote machines. Using plumbum, in order to set subprocess's working directory, you ...
31,590,184
I have a pandas dataframe with three columns and a datetime index ``` date px_last 200dma 50dma 2014-12-24 2081.88 1953.16760 2019.2726 2014-12-26 2088.77 1954.37975 2023.7982 2014-12-29 2090.57 1955.62695 2028.3544 2014-12-30 2080.35 1956.73455 2032.2262 2014-12-31 2058.90 1957.66780 ...
2015/07/23
[ "https://Stackoverflow.com/questions/31590184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1796649/" ]
Here is an example to do it without `matplotlib.collections.LineCollection`. The idea is to first identify the cross-over point and then using a `plot` function via groupby. ``` import pandas as pd import numpy as np import matplotlib.pyplot as plt # simulate data # ============================= np.random.seed(1234) ...
Building on [@Jianxun Li](https://stackoverflow.com/users/5014134/jianxun-li)'s answer, here's a version that's more easily extendible to 3+ colors: ``` import numpy as np import pandas as pd import matplotlib.pyplot as plt # Simulate data np.random.seed(1234) df = pd.DataFrame( {'px_last': 100 + np.random.randn(...
58,579,105
WebAssembly has only four value types: * `i32` – 32-bit integers * `f32` – 32-bit floating point numbers * `i64` – 64-bit integers * `f64` – 64-bit floating point numbers Each has their own set of opcodes representing arithmetic operations, e.g. `i32.add`, `i64.add`, `f32.add` and `f64.add`. There are also opcodes fo...
2019/10/27
[ "https://Stackoverflow.com/questions/58579105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/132208/" ]
They exists for much the same reason that many programming languages support numerics of varying precision - lower precision numbers require less storage and operations applied to these can be faster than for higher precision numbers. Furthermore, reducing the number of opcodes in WebAssembly as suggested wouldn’t yie...
One of WebAssembly’s goals is to efficiently run on widely used modern processors (including embedded systems), which all support 32-bit operations.
1,895,682
I coded in NetBeans something like this: ``` public class Grafo<V, E> { class Par { int a, b; Par(int a, int b) { this.a = a; this.b = b; } @Override public boolean equals(Object ob) { if(ob instanceof Par) { P...
2009/12/13
[ "https://Stackoverflow.com/questions/1895682", "https://Stackoverflow.com", "https://Stackoverflow.com/users/230563/" ]
Try `ob instanceof Grafo<?,?>.Par` I think that the compiler thinks that `ob instanceof Par` involves a runtime check on generic type parameters; i.e. that it is equivalent to `ob instanceof Grafo<V,E>.Par`. But `instanceof` tests cannot check generic type parameters.
``` @SuppressWarnings("unchecked") @Override public boolean equals(Object ob) { if(ob instanceof Grafo.Par) { Par p = (Par)ob; return this.a==p.a && this.b==p.b; } return false; } ``` Or define your inner class `static`
44,740,288
I'm beginner to c# programming. I'm going to make game in c#.In that case I want to color change when I click the picture box.this is my code ``` private void pictureBox1_MouseClick(object sender, MouseEventArgs e) { int[] R = { 0, 255, 255, 34, 249,255 }; int[] G = { 0, 255, 0, 235, 255 ,...
2017/06/24
[ "https://Stackoverflow.com/questions/44740288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7469625/" ]
I found the way. ``` int[] R = { 0, 255, 255, 34, 249, 255 }; int[] G = { 0, 255, 0, 235, 255, 153 }; int[] B = { 255, 255, 0, 27, 40, 51 }; pictureBox2.BackColor = Color.FromArgb(R[this.index], G[this.index], B[this.index]); this.index++; if (this.index == 6) { ...
Array index start from 0 and it's length is 6, therefore just wrap IF around your code something like this ``` private void pictureBox1_MouseClick(object sender, MouseEventArgs e) { if(this.index <= 5){ int[] R = { 0, 255, 255, 34, 249,255 }; int[] G = { 0, 255, 0, 235, 255 ,153}; int[] B= { 255, 255, 0...
44,740,288
I'm beginner to c# programming. I'm going to make game in c#.In that case I want to color change when I click the picture box.this is my code ``` private void pictureBox1_MouseClick(object sender, MouseEventArgs e) { int[] R = { 0, 255, 255, 34, 249,255 }; int[] G = { 0, 255, 0, 235, 255 ,...
2017/06/24
[ "https://Stackoverflow.com/questions/44740288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7469625/" ]
Please try with this. You need to consider about the length of the arrays. ``` private void pictureBox1_MouseClick(object sender, MouseEventArgs e) { int[] R = { 0, 255, 255, 34, 249,255 }; int[] G = { 0, 255, 0, 235, 255 ,153}; int[] B= { 255, 255, 0, 27, 40,51 }; if(this.index <= (R.Length - 1) ||thi...
Array index start from 0 and it's length is 6, therefore just wrap IF around your code something like this ``` private void pictureBox1_MouseClick(object sender, MouseEventArgs e) { if(this.index <= 5){ int[] R = { 0, 255, 255, 34, 249,255 }; int[] G = { 0, 255, 0, 235, 255 ,153}; int[] B= { 255, 255, 0...
34,329,280
how to check whether my token is expired or not? ``` var token = jwt.sign(user,app.get('superSecret'),{ expiresIn : 2 }); ```
2015/12/17
[ "https://Stackoverflow.com/questions/34329280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3868914/" ]
``` var isExpiredToken = false; var dateNow = new Date(); if(decodedToken.exp < dateNow.getTime()/1000) { isExpiredToken = true; } ```
``` var isExpiredToken = false; var dateNow = new Date(); if(decodedToken.exp < dateNow.getTime()) { isExpiredToken = true; } ```
34,329,280
how to check whether my token is expired or not? ``` var token = jwt.sign(user,app.get('superSecret'),{ expiresIn : 2 }); ```
2015/12/17
[ "https://Stackoverflow.com/questions/34329280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3868914/" ]
I assume you are using the jsonwebtoken package that is [documented here](https://github.com/auth0/node-jsonwebtoken#tokenexpirederror "documented here") If that is the case, have a look at the `jwt.verify` method: ``` jwt.verify(token, 'shhhhh', function(err, decoded) { if (err) { /* err = { name...
``` var isExpiredToken = false; var seconds = 1000; var d = new Date(); var t= d.getTime(); if (decoded.exp < Math.round(t / seconds)) { // code... isExpiredToken = true; } ``` Source: <https://www.w3schools.com/jsref/jsref_gettime.asp>
34,329,280
how to check whether my token is expired or not? ``` var token = jwt.sign(user,app.get('superSecret'),{ expiresIn : 2 }); ```
2015/12/17
[ "https://Stackoverflow.com/questions/34329280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3868914/" ]
``` var isExpiredToken = false; var dateNow = new Date(); if(decodedToken.exp < dateNow.getTime()) { isExpiredToken = true; } ```
The best way set the code in your parent component of page or wrapper. Your need delete your old (expared) token. ``` let token = localStorage.getItem( 'token' ); jwt.verify( token, 'yourkey', function(err, decoded) { if ( err ) { localStorage.removeItem( 'token' ); } } ); ```
34,329,280
how to check whether my token is expired or not? ``` var token = jwt.sign(user,app.get('superSecret'),{ expiresIn : 2 }); ```
2015/12/17
[ "https://Stackoverflow.com/questions/34329280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3868914/" ]
``` var isExpiredToken = false; var dateNow = new Date(); if(decodedToken.exp < dateNow.getTime()) { isExpiredToken = true; } ```
You need set the host current time to compare the expiration date in the verify function example: `jwt.verify(token, JWT.SECRET_KEY, {clockTimestamp: new Date().getTime()}, callback)` the clockTimestamp property is required to set the host current time.
34,329,280
how to check whether my token is expired or not? ``` var token = jwt.sign(user,app.get('superSecret'),{ expiresIn : 2 }); ```
2015/12/17
[ "https://Stackoverflow.com/questions/34329280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3868914/" ]
``` var isExpiredToken = false; var dateNow = new Date(); if(decodedToken.exp < dateNow.getTime()/1000) { isExpiredToken = true; } ```
You need set the host current time to compare the expiration date in the verify function example: `jwt.verify(token, JWT.SECRET_KEY, {clockTimestamp: new Date().getTime()}, callback)` the clockTimestamp property is required to set the host current time.
34,329,280
how to check whether my token is expired or not? ``` var token = jwt.sign(user,app.get('superSecret'),{ expiresIn : 2 }); ```
2015/12/17
[ "https://Stackoverflow.com/questions/34329280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3868914/" ]
I assume you are using the jsonwebtoken package that is [documented here](https://github.com/auth0/node-jsonwebtoken#tokenexpirederror "documented here") If that is the case, have a look at the `jwt.verify` method: ``` jwt.verify(token, 'shhhhh', function(err, decoded) { if (err) { /* err = { name...
``` var isExpiredToken = false; var dateNow = new Date(); if(decodedToken.exp < dateNow.getTime()) { isExpiredToken = true; } ```
34,329,280
how to check whether my token is expired or not? ``` var token = jwt.sign(user,app.get('superSecret'),{ expiresIn : 2 }); ```
2015/12/17
[ "https://Stackoverflow.com/questions/34329280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3868914/" ]
``` var isExpiredToken = false; var dateNow = new Date(); if(decodedToken.exp < dateNow.getTime()) { isExpiredToken = true; } ```
in place "expires in" use key name as "iat"...hope it will work
34,329,280
how to check whether my token is expired or not? ``` var token = jwt.sign(user,app.get('superSecret'),{ expiresIn : 2 }); ```
2015/12/17
[ "https://Stackoverflow.com/questions/34329280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3868914/" ]
I assume you are using the jsonwebtoken package that is [documented here](https://github.com/auth0/node-jsonwebtoken#tokenexpirederror "documented here") If that is the case, have a look at the `jwt.verify` method: ``` jwt.verify(token, 'shhhhh', function(err, decoded) { if (err) { /* err = { name...
You need set the host current time to compare the expiration date in the verify function example: `jwt.verify(token, JWT.SECRET_KEY, {clockTimestamp: new Date().getTime()}, callback)` the clockTimestamp property is required to set the host current time.
34,329,280
how to check whether my token is expired or not? ``` var token = jwt.sign(user,app.get('superSecret'),{ expiresIn : 2 }); ```
2015/12/17
[ "https://Stackoverflow.com/questions/34329280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3868914/" ]
``` var isExpiredToken = false; var dateNow = new Date(); if(decodedToken.exp < dateNow.getTime()/1000) { isExpiredToken = true; } ```
``` var isExpiredToken = false; var seconds = 1000; var d = new Date(); var t= d.getTime(); if (decoded.exp < Math.round(t / seconds)) { // code... isExpiredToken = true; } ``` Source: <https://www.w3schools.com/jsref/jsref_gettime.asp>
34,329,280
how to check whether my token is expired or not? ``` var token = jwt.sign(user,app.get('superSecret'),{ expiresIn : 2 }); ```
2015/12/17
[ "https://Stackoverflow.com/questions/34329280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3868914/" ]
I assume you are using the jsonwebtoken package that is [documented here](https://github.com/auth0/node-jsonwebtoken#tokenexpirederror "documented here") If that is the case, have a look at the `jwt.verify` method: ``` jwt.verify(token, 'shhhhh', function(err, decoded) { if (err) { /* err = { name...
in place "expires in" use key name as "iat"...hope it will work
39,620
I got introduced to this "Female Buddha" when I was looking name for my friend's daughter. So what does female Buddha mean? **Wikipedia :** > > [Tara (Buddhism)](https://en.wikipedia.org/wiki/Tara_(Buddhism)) > > Tara (Sanskrit: तारा, tārā; Tib. སྒྲོལ་མ, Dölma), Ārya Tārā, or Shayama Tara, also known as Jetsun D...
2020/07/04
[ "https://buddhism.stackexchange.com/questions/39620", "https://buddhism.stackexchange.com", "https://buddhism.stackexchange.com/users/567/" ]
The Void is sometimes implied differently than other times in English. Existential descriptioning isn't English's long suit. Maybe Zen/ Chan discussions of the concept are generally more prominent overall. Confusion etc isn't The Void. In The True Void 'is' Reality. There isn't confusion. There isn't dukkha. There i...
In Buddhism, there is a state called "Nirodha Samapatthi" or Cessation of Perception and feeling. It is said that in this state you are not conscious but the body has not died. The maximum duration of this state is seven days and you emerge from it and understand it as empty.
39,620
I got introduced to this "Female Buddha" when I was looking name for my friend's daughter. So what does female Buddha mean? **Wikipedia :** > > [Tara (Buddhism)](https://en.wikipedia.org/wiki/Tara_(Buddhism)) > > Tara (Sanskrit: तारा, tārā; Tib. སྒྲོལ་མ, Dölma), Ārya Tārā, or Shayama Tara, also known as Jetsun D...
2020/07/04
[ "https://buddhism.stackexchange.com/questions/39620", "https://buddhism.stackexchange.com", "https://buddhism.stackexchange.com/users/567/" ]
> > **OP:** Whatever is,the question is quite clear: if you can reach a > state of emptiness , how can you state that Void is not part of a > higher consciousness (aka God) but it is just Void? If you “feel” the > Void during meditation and you call it nirodha samapatti for example, > how do you know that it is just V...
In Buddhism, there is a state called "Nirodha Samapatthi" or Cessation of Perception and feeling. It is said that in this state you are not conscious but the body has not died. The maximum duration of this state is seven days and you emerge from it and understand it as empty.
39,620
I got introduced to this "Female Buddha" when I was looking name for my friend's daughter. So what does female Buddha mean? **Wikipedia :** > > [Tara (Buddhism)](https://en.wikipedia.org/wiki/Tara_(Buddhism)) > > Tara (Sanskrit: तारा, tārā; Tib. སྒྲོལ་མ, Dölma), Ārya Tārā, or Shayama Tara, also known as Jetsun D...
2020/07/04
[ "https://buddhism.stackexchange.com/questions/39620", "https://buddhism.stackexchange.com", "https://buddhism.stackexchange.com/users/567/" ]
The Void is sometimes implied differently than other times in English. Existential descriptioning isn't English's long suit. Maybe Zen/ Chan discussions of the concept are generally more prominent overall. Confusion etc isn't The Void. In The True Void 'is' Reality. There isn't confusion. There isn't dukkha. There i...
When I go to sleep, I wake up wanting coffee. I don't remember what happened when I slept, but somehow I wake up wanting coffee. I can even go to sleep thinking "arise at 6am" and I will arise at 6am, and I am still wanting coffee. Is there a super-consciousness there? I don't think so. Consciousness is bound to choic...
39,620
I got introduced to this "Female Buddha" when I was looking name for my friend's daughter. So what does female Buddha mean? **Wikipedia :** > > [Tara (Buddhism)](https://en.wikipedia.org/wiki/Tara_(Buddhism)) > > Tara (Sanskrit: तारा, tārā; Tib. སྒྲོལ་མ, Dölma), Ārya Tārā, or Shayama Tara, also known as Jetsun D...
2020/07/04
[ "https://buddhism.stackexchange.com/questions/39620", "https://buddhism.stackexchange.com", "https://buddhism.stackexchange.com/users/567/" ]
> > **OP:** Whatever is,the question is quite clear: if you can reach a > state of emptiness , how can you state that Void is not part of a > higher consciousness (aka God) but it is just Void? If you “feel” the > Void during meditation and you call it nirodha samapatti for example, > how do you know that it is just V...
When I go to sleep, I wake up wanting coffee. I don't remember what happened when I slept, but somehow I wake up wanting coffee. I can even go to sleep thinking "arise at 6am" and I will arise at 6am, and I am still wanting coffee. Is there a super-consciousness there? I don't think so. Consciousness is bound to choic...
39,620
I got introduced to this "Female Buddha" when I was looking name for my friend's daughter. So what does female Buddha mean? **Wikipedia :** > > [Tara (Buddhism)](https://en.wikipedia.org/wiki/Tara_(Buddhism)) > > Tara (Sanskrit: तारा, tārā; Tib. སྒྲོལ་མ, Dölma), Ārya Tārā, or Shayama Tara, also known as Jetsun D...
2020/07/04
[ "https://buddhism.stackexchange.com/questions/39620", "https://buddhism.stackexchange.com", "https://buddhism.stackexchange.com/users/567/" ]
The Void is sometimes implied differently than other times in English. Existential descriptioning isn't English's long suit. Maybe Zen/ Chan discussions of the concept are generally more prominent overall. Confusion etc isn't The Void. In The True Void 'is' Reality. There isn't confusion. There isn't dukkha. There i...
There is a mind state called “void”, but it is not Nibbana. This void is of the mind, when it is void of perceptions, feelings, thinking, everything that makes up what we understand as the Thinking conscious mind. What is left is knowing. But knowing of the void implies that it is not beyond mind. Mind, and consequentl...
39,620
I got introduced to this "Female Buddha" when I was looking name for my friend's daughter. So what does female Buddha mean? **Wikipedia :** > > [Tara (Buddhism)](https://en.wikipedia.org/wiki/Tara_(Buddhism)) > > Tara (Sanskrit: तारा, tārā; Tib. སྒྲོལ་མ, Dölma), Ārya Tārā, or Shayama Tara, also known as Jetsun D...
2020/07/04
[ "https://buddhism.stackexchange.com/questions/39620", "https://buddhism.stackexchange.com", "https://buddhism.stackexchange.com/users/567/" ]
> > **OP:** Whatever is,the question is quite clear: if you can reach a > state of emptiness , how can you state that Void is not part of a > higher consciousness (aka God) but it is just Void? If you “feel” the > Void during meditation and you call it nirodha samapatti for example, > how do you know that it is just V...
There is a mind state called “void”, but it is not Nibbana. This void is of the mind, when it is void of perceptions, feelings, thinking, everything that makes up what we understand as the Thinking conscious mind. What is left is knowing. But knowing of the void implies that it is not beyond mind. Mind, and consequentl...
39,620
I got introduced to this "Female Buddha" when I was looking name for my friend's daughter. So what does female Buddha mean? **Wikipedia :** > > [Tara (Buddhism)](https://en.wikipedia.org/wiki/Tara_(Buddhism)) > > Tara (Sanskrit: तारा, tārā; Tib. སྒྲོལ་མ, Dölma), Ārya Tārā, or Shayama Tara, also known as Jetsun D...
2020/07/04
[ "https://buddhism.stackexchange.com/questions/39620", "https://buddhism.stackexchange.com", "https://buddhism.stackexchange.com/users/567/" ]
The Void is sometimes implied differently than other times in English. Existential descriptioning isn't English's long suit. Maybe Zen/ Chan discussions of the concept are generally more prominent overall. Confusion etc isn't The Void. In The True Void 'is' Reality. There isn't confusion. There isn't dukkha. There i...
> > **OP:** Whatever is,the question is quite clear: if you can reach a > state of emptiness , how can you state that Void is not part of a > higher consciousness (aka God) but it is just Void? If you “feel” the > Void during meditation and you call it nirodha samapatti for example, > how do you know that it is just V...
611,598
I have a LINQ query which gives me a list with a number of child lists all with double values. I want to get a queryResult from this. How can I get the first, the last, the highest and the lowest double value? Should it be a new object and should the new return values be a list?
2009/03/04
[ "https://Stackoverflow.com/questions/611598", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
it is true that handcoded version will be a bit faster, but unless you know that performance is the key issue of your application, I wouldn't worry about that. The LINQ version of the code would look like this: ``` IEnumerable<List<double>> queryResults = /*...*/ var aggregates = from ds in queryResults s...
Your question is fairly unclear. However, it sounds like you have a series of list objects that are being returned from a LINQ query, and you want to get some aggregates out of the values in all of those sub-lists. I haven't ever seen a way to do this in LINQ, and honestly I don't think the performance is likely to be ...
31,247,771
this is my login.php file ``` <?php require ("database_connect.php");?> <!DOCTYPE html> <html> <body> <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"])?>"> Name : <input type="text" name="name"><br/> Password : <input type = "text" name="password"><br/> <input type="submit...
2015/07/06
[ "https://Stackoverflow.com/questions/31247771", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3421131/" ]
Your test\_input function is weak/unsafe, also, mysql\_query is depricated, use mysqli and prepared statements as explained here: <http://php.net/manual/en/mysqli.prepare.php> Furthermore, I included a section of code I use for my login system (bit more sophisticated using salts etc, you should be able to compile it i...
try to change this query ``` $result = mysqli_query($conn,"SELECT * FROM users WHERE name='$name' and password='$password'") to $result = mysqli_query($conn,"SELECT * FROM users WHERE name='$name' and password='$password' limit 1") ``` then you will get only one row , and try to change ``` $row = $result->fetch...
31,247,771
this is my login.php file ``` <?php require ("database_connect.php");?> <!DOCTYPE html> <html> <body> <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"])?>"> Name : <input type="text" name="name"><br/> Password : <input type = "text" name="password"><br/> <input type="submit...
2015/07/06
[ "https://Stackoverflow.com/questions/31247771", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3421131/" ]
I don't know what do you mean but thats how i query mysqli ``` $query = mysqli_query($db, "SELECT * FROM users WHERE name='$name' AND password='$password'"); if($query && mysqli_affected_rows($db) >= 1) { //If query was successfull and it has 1 or more than 1 result echo 'Query Success!'; //and this is how i fetch r...
try to change this query ``` $result = mysqli_query($conn,"SELECT * FROM users WHERE name='$name' and password='$password'") to $result = mysqli_query($conn,"SELECT * FROM users WHERE name='$name' and password='$password' limit 1") ``` then you will get only one row , and try to change ``` $row = $result->fetch...
31,247,771
this is my login.php file ``` <?php require ("database_connect.php");?> <!DOCTYPE html> <html> <body> <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"])?>"> Name : <input type="text" name="name"><br/> Password : <input type = "text" name="password"><br/> <input type="submit...
2015/07/06
[ "https://Stackoverflow.com/questions/31247771", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3421131/" ]
Your test\_input function is weak/unsafe, also, mysql\_query is depricated, use mysqli and prepared statements as explained here: <http://php.net/manual/en/mysqli.prepare.php> Furthermore, I included a section of code I use for my login system (bit more sophisticated using salts etc, you should be able to compile it i...
``` <?php mysql_connect("abc.com","user","password"); mysql_select_db("database name"); $query1="select * from table_name"; $exe1= mysql_query($query1); $row= mysql_fetch_assoc($exe1); if($row["email"]==$_POST["email"] && $row["[password"]==$_POST["password"]) { echo "Login successfully"; } els...
31,247,771
this is my login.php file ``` <?php require ("database_connect.php");?> <!DOCTYPE html> <html> <body> <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"])?>"> Name : <input type="text" name="name"><br/> Password : <input type = "text" name="password"><br/> <input type="submit...
2015/07/06
[ "https://Stackoverflow.com/questions/31247771", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3421131/" ]
I don't know what do you mean but thats how i query mysqli ``` $query = mysqli_query($db, "SELECT * FROM users WHERE name='$name' AND password='$password'"); if($query && mysqli_affected_rows($db) >= 1) { //If query was successfull and it has 1 or more than 1 result echo 'Query Success!'; //and this is how i fetch r...
``` <?php mysql_connect("abc.com","user","password"); mysql_select_db("database name"); $query1="select * from table_name"; $exe1= mysql_query($query1); $row= mysql_fetch_assoc($exe1); if($row["email"]==$_POST["email"] && $row["[password"]==$_POST["password"]) { echo "Login successfully"; } els...
24,753,199
I've dropped my table successfully from the database from the console, using `ActiveRecord::Migration.drop_table(:foo)`, But for some reason the table data still shows in the schema file. I would like a method to do this without having to manually remove the data, (Doesn't give a proper rails feeling to it.)
2014/07/15
[ "https://Stackoverflow.com/questions/24753199", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1237532/" ]
The schema file located in `db/schema.rb` was most likely generated the very last time you ran `rake db:migrate`. This is because `rake db:migrate` migrates your db through all of the migrations in your `db/migrate` folder, **and then it calls the `db:schema:dump` task**, which generates the schema file based on the cu...
While the answers provided here work properly, I wanted something a bit more 'straightforward', I found it here: [link](http://problemateek.blogspot.com.es/2012/07/drop-table-from-rails-console.html) First enter rails console: ``` $rails console ``` Then just type: ``` ActiveRecord::Migration.drop_table(:foo) ``` ...
65,713,374
I could use a help. I'm still new to doing jQuery, and I can get the divs to show when there is no submit button, but when I add the submit button, I can't get the divs based on the radio button. ```js $(document).ready(function(){ $(".result").click(function(){ $("input[name=expectation]").change(function(...
2021/01/14
[ "https://Stackoverflow.com/questions/65713374", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12556915/" ]
You can display the content of divs only after clicking on the button. Why such a concept? I have given two solutions. In the second solution, without clicking the button. What concept do you need? How should it work? Use the `each()` method, passing the **index**. ```js $(document).ready(function(){ $(".result")....
You cannot have mutliple elements with same `id` i.e : radio and div have same ids . So, instead of id you can use `data-atribute` .Then you can change your selector like `$("div[data-id=" + expectedValue + "]")` to show div. ***Demo Code*** : ```js $(document).ready(function() { $("input[name=expectation]").chang...
4,664,438
each unit test I'm running is writing python code out to a file, then importing it as a module. The problem is that the code changes but further import statements don't modify the module. I think what I need is a way to ether force a reload on a module or clear the internal bytecode cache. Any ideas? Thanks!
2011/01/12
[ "https://Stackoverflow.com/questions/4664438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/67491/" ]
Reimporting modules is tricky to get all the edge cases right. The documentation for [reload](http://docs.python.org/library/functions.html#reload) mentions some of them. Depending on what you are testing, you *may* be better off by testing the imports with separate invocations of the interpreter by running each via, s...
Use [`reload()`](http://docs.python.org/library/functions.html#reload). > > Reload a previously imported module. > The argument must be a module object, > so it must have been successfully > imported before. This is useful if you > have edited the module source file > using an external editor and want to > try ...
4,664,438
each unit test I'm running is writing python code out to a file, then importing it as a module. The problem is that the code changes but further import statements don't modify the module. I think what I need is a way to ether force a reload on a module or clear the internal bytecode cache. Any ideas? Thanks!
2011/01/12
[ "https://Stackoverflow.com/questions/4664438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/67491/" ]
Use [`reload()`](http://docs.python.org/library/functions.html#reload). > > Reload a previously imported module. > The argument must be a module object, > so it must have been successfully > imported before. This is useful if you > have edited the module source file > using an external editor and want to > try ...
Ran into a similar situation. Later on found that the white space indentation technique used matters. Especially on windows platforms, ensure that a uniform technique is adapted throughout the module i.e., either use tab or spaces exclusively.
4,664,438
each unit test I'm running is writing python code out to a file, then importing it as a module. The problem is that the code changes but further import statements don't modify the module. I think what I need is a way to ether force a reload on a module or clear the internal bytecode cache. Any ideas? Thanks!
2011/01/12
[ "https://Stackoverflow.com/questions/4664438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/67491/" ]
Reimporting modules is tricky to get all the edge cases right. The documentation for [reload](http://docs.python.org/library/functions.html#reload) mentions some of them. Depending on what you are testing, you *may* be better off by testing the imports with separate invocations of the interpreter by running each via, s...
Write your code to differently-named modules. Writing new code into an existing file, and trying to import it again will not work well. Alternatively, you can clobber `sys.modules`. For example: ``` class MyTestCase(unittest.TestCase): def setUp(self): # Record sys.modules here so we can restore it in tea...
4,664,438
each unit test I'm running is writing python code out to a file, then importing it as a module. The problem is that the code changes but further import statements don't modify the module. I think what I need is a way to ether force a reload on a module or clear the internal bytecode cache. Any ideas? Thanks!
2011/01/12
[ "https://Stackoverflow.com/questions/4664438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/67491/" ]
Reimporting modules is tricky to get all the edge cases right. The documentation for [reload](http://docs.python.org/library/functions.html#reload) mentions some of them. Depending on what you are testing, you *may* be better off by testing the imports with separate invocations of the interpreter by running each via, s...
Ran into a similar situation. Later on found that the white space indentation technique used matters. Especially on windows platforms, ensure that a uniform technique is adapted throughout the module i.e., either use tab or spaces exclusively.
4,664,438
each unit test I'm running is writing python code out to a file, then importing it as a module. The problem is that the code changes but further import statements don't modify the module. I think what I need is a way to ether force a reload on a module or clear the internal bytecode cache. Any ideas? Thanks!
2011/01/12
[ "https://Stackoverflow.com/questions/4664438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/67491/" ]
Write your code to differently-named modules. Writing new code into an existing file, and trying to import it again will not work well. Alternatively, you can clobber `sys.modules`. For example: ``` class MyTestCase(unittest.TestCase): def setUp(self): # Record sys.modules here so we can restore it in tea...
Ran into a similar situation. Later on found that the white space indentation technique used matters. Especially on windows platforms, ensure that a uniform technique is adapted throughout the module i.e., either use tab or spaces exclusively.
18,545,093
I have a http server code (I tried both TJWS or NanoHTTPD), the client from the same application would connect to server running on port 8080 or whatever. I am starting server object in a separate AsyncTask so it should be okay. While NanoHTTPD completely failed to start other ways I can see from TJWS logs, it says ...
2013/08/31
[ "https://Stackoverflow.com/questions/18545093", "https://Stackoverflow.com", "https://Stackoverflow.com/users/988930/" ]
For the server, the address 0.0.0.0 is like a wildcard and means, it is listening on all IP addresses the device has. For the client, you need to use a real IP address like 127.0.0.1
After debugging a little I found that problem is not where client opens a connection but issue was at where server was starting it never returned **onPostExecute()** method, but after wrapping my server start code inside a Runnable ``` new Thread(new Runnable() { @Override public void run() { ...
55,019,076
I am fairly new to Django and I have installed and am trying to use crispy forms in my web app.I have added crispy\_forms to my installed apps with a comma after it. When I run the server I get this error: ``` Watching for file changes with StatReloader Performing system checks... Exception in thread Thread-3: Traceb...
2019/03/06
[ "https://Stackoverflow.com/questions/55019076", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11146797/" ]
Your version of django-crispy-forms is outdated, this has been fixed. Update it by running: ``` pip install django-crispy-forms -U ``` `-U` makes pip upgrade your current installation to the newest. You can find more about it by running `pip install -h`
The problem has been solved. I uninstalled the django version I had and used: ``` pip install Django==2.1.7 ``` Thank you @YugandharChaudhari for helping me realize to change versions.
59,376,397
I'm using a method that gets JSON data from an API, in Java whenever I use `getJSONObject` I have to surround the method with a try/catch, since it detects that the method throws a `JSONException`, I want to be able to force the programmer to surround my function in Kotlin when it's used. The method on which I want to...
2019/12/17
[ "https://Stackoverflow.com/questions/59376397", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4564450/" ]
Kotlin does not have checked exceptions. `@Throws` only forces Java code to check for exceptions and has no effect on Kotlin code. One alternative is using a sealed class that enables returning either the desired result or an error. ``` sealed class HitEventsResult { data class Success(val value: List<AlgoliaEven...
In Kotlin, there's no checked exceptions ([Source](https://kotlinlang.org/docs/reference/exceptions.html#checked-exceptions)). No exceptions have to be declared and you aren't forced to catch any exception. To indicate that an exception can be or has to be catched, you can use the [@Throw tag](https://kotlinlang.org/...
156,936
I have been using C# for a while now, and going back to C++ is a headache. I am trying to get some of my practices from C# with me to C++, but I am finding some resistance and I would be glad to accept your help. I would like to expose an iterator for a class like this: ``` template <class T> class MyContainer { publ...
2008/10/01
[ "https://Stackoverflow.com/questions/156936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2166173/" ]
You may find the following article interesting as it addresses exactly the problem you have posted: [On the Tension Between Object-Oriented and Generic Programming in C++ and What Type Erasure Can Do About It](http://www.artima.com/cppsource/type_erasure.html)
This should do what you want: ``` typedef typename std::vector<T>::iterator MyIterator; ``` From [Accelerated C++](http://www.acceleratedcpp.com/): > > Whenever you have a type, such as `vector<T>`, that depends on a template parameter, and you want to use a member of that type, such as `size_type`, that is itself...
156,936
I have been using C# for a while now, and going back to C++ is a headache. I am trying to get some of my practices from C# with me to C++, but I am finding some resistance and I would be glad to accept your help. I would like to expose an iterator for a class like this: ``` template <class T> class MyContainer { publ...
2008/10/01
[ "https://Stackoverflow.com/questions/156936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2166173/" ]
I have done the following before so that I got an iterator that was independent of the container. This may have been overkill since I could also have used an API where the caller passes in a `vector<T*>&` that should be populated with all the elements and then the caller can just iterate from the vector directly. ``` ...
This should do what you want: ``` typedef typename std::vector<T>::iterator MyIterator; ``` From [Accelerated C++](http://www.acceleratedcpp.com/): > > Whenever you have a type, such as `vector<T>`, that depends on a template parameter, and you want to use a member of that type, such as `size_type`, that is itself...
156,936
I have been using C# for a while now, and going back to C++ is a headache. I am trying to get some of my practices from C# with me to C++, but I am finding some resistance and I would be glad to accept your help. I would like to expose an iterator for a class like this: ``` template <class T> class MyContainer { publ...
2008/10/01
[ "https://Stackoverflow.com/questions/156936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2166173/" ]
You may find the following article interesting as it addresses exactly the problem you have posted: [On the Tension Between Object-Oriented and Generic Programming in C++ and What Type Erasure Can Do About It](http://www.artima.com/cppsource/type_erasure.html)
I am unsure about what you mean by "not exposing std::vector publicly" but indeed, you can just define your typedef like that: ``` typedef typename std::vector<T>::iterator iterator; typedef typename std::vector<T>::const_iterator const_iterator; // To work with constant references ``` You will be able to change the...
156,936
I have been using C# for a while now, and going back to C++ is a headache. I am trying to get some of my practices from C# with me to C++, but I am finding some resistance and I would be glad to accept your help. I would like to expose an iterator for a class like this: ``` template <class T> class MyContainer { publ...
2008/10/01
[ "https://Stackoverflow.com/questions/156936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2166173/" ]
I have done the following before so that I got an iterator that was independent of the container. This may have been overkill since I could also have used an API where the caller passes in a `vector<T*>&` that should be populated with all the elements and then the caller can just iterate from the vector directly. ``` ...
I am unsure about what you mean by "not exposing std::vector publicly" but indeed, you can just define your typedef like that: ``` typedef typename std::vector<T>::iterator iterator; typedef typename std::vector<T>::const_iterator const_iterator; // To work with constant references ``` You will be able to change the...
156,936
I have been using C# for a while now, and going back to C++ is a headache. I am trying to get some of my practices from C# with me to C++, but I am finding some resistance and I would be glad to accept your help. I would like to expose an iterator for a class like this: ``` template <class T> class MyContainer { publ...
2008/10/01
[ "https://Stackoverflow.com/questions/156936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2166173/" ]
You may find the following article interesting as it addresses exactly the problem you have posted: [On the Tension Between Object-Oriented and Generic Programming in C++ and What Type Erasure Can Do About It](http://www.artima.com/cppsource/type_erasure.html)
I have done the following before so that I got an iterator that was independent of the container. This may have been overkill since I could also have used an API where the caller passes in a `vector<T*>&` that should be populated with all the elements and then the caller can just iterate from the vector directly. ``` ...
69,098,207
Hi I'm trying to run my react native app on mac mini. I can run another app also this app to but when i write `pod install` in terminal it gives this error. ``` 1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1449:in `block in activate_dependencies' /Sys...
2021/09/08
[ "https://Stackoverflow.com/questions/69098207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16858051/" ]
You can try this command ```sh sudo gem uninstall -aIx rm -rf ~/.gem sudo gem install cocoapods sudo chown -R $USER ~/Library/Caches/CocoaPods ```
For me, install a new version of ruby resolved this issue. ``` curl -L https://get.rvm.io | bash -s stable source ~/.rvm/scripts/rvm rvm list known rvm install 2.7.2 sudo gem install cocoapods ```
69,098,207
Hi I'm trying to run my react native app on mac mini. I can run another app also this app to but when i write `pod install` in terminal it gives this error. ``` 1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1449:in `block in activate_dependencies' /Sys...
2021/09/08
[ "https://Stackoverflow.com/questions/69098207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16858051/" ]
You can try this command ```sh sudo gem uninstall -aIx rm -rf ~/.gem sudo gem install cocoapods sudo chown -R $USER ~/Library/Caches/CocoaPods ```
Same issue. Just updating gem package manager is works for me `gem update` Terminal will display installing 'ffi' ``` Successfully installed ffi-1.15.5 ```
69,098,207
Hi I'm trying to run my react native app on mac mini. I can run another app also this app to but when i write `pod install` in terminal it gives this error. ``` 1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1449:in `block in activate_dependencies' /Sys...
2021/09/08
[ "https://Stackoverflow.com/questions/69098207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16858051/" ]
You can try this command ```sh sudo gem uninstall -aIx rm -rf ~/.gem sudo gem install cocoapods sudo chown -R $USER ~/Library/Caches/CocoaPods ```
i solved the issue by installing the command line tool for XCode. Just download the specific CLT from apple website
69,098,207
Hi I'm trying to run my react native app on mac mini. I can run another app also this app to but when i write `pod install` in terminal it gives this error. ``` 1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1449:in `block in activate_dependencies' /Sys...
2021/09/08
[ "https://Stackoverflow.com/questions/69098207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16858051/" ]
You can try this command ```sh sudo gem uninstall -aIx rm -rf ~/.gem sudo gem install cocoapods sudo chown -R $USER ~/Library/Caches/CocoaPods ```
I just did a ``` bundle install ``` and that allowed me to do a pod install after upgrading (without asking me to Xcode 14).
69,098,207
Hi I'm trying to run my react native app on mac mini. I can run another app also this app to but when i write `pod install` in terminal it gives this error. ``` 1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1449:in `block in activate_dependencies' /Sys...
2021/09/08
[ "https://Stackoverflow.com/questions/69098207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16858051/" ]
For me, install a new version of ruby resolved this issue. ``` curl -L https://get.rvm.io | bash -s stable source ~/.rvm/scripts/rvm rvm list known rvm install 2.7.2 sudo gem install cocoapods ```
Same issue. Just updating gem package manager is works for me `gem update` Terminal will display installing 'ffi' ``` Successfully installed ffi-1.15.5 ```
69,098,207
Hi I'm trying to run my react native app on mac mini. I can run another app also this app to but when i write `pod install` in terminal it gives this error. ``` 1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1449:in `block in activate_dependencies' /Sys...
2021/09/08
[ "https://Stackoverflow.com/questions/69098207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16858051/" ]
For me, install a new version of ruby resolved this issue. ``` curl -L https://get.rvm.io | bash -s stable source ~/.rvm/scripts/rvm rvm list known rvm install 2.7.2 sudo gem install cocoapods ```
i solved the issue by installing the command line tool for XCode. Just download the specific CLT from apple website
69,098,207
Hi I'm trying to run my react native app on mac mini. I can run another app also this app to but when i write `pod install` in terminal it gives this error. ``` 1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1449:in `block in activate_dependencies' /Sys...
2021/09/08
[ "https://Stackoverflow.com/questions/69098207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16858051/" ]
For me, install a new version of ruby resolved this issue. ``` curl -L https://get.rvm.io | bash -s stable source ~/.rvm/scripts/rvm rvm list known rvm install 2.7.2 sudo gem install cocoapods ```
I just did a ``` bundle install ``` and that allowed me to do a pod install after upgrading (without asking me to Xcode 14).
69,098,207
Hi I'm trying to run my react native app on mac mini. I can run another app also this app to but when i write `pod install` in terminal it gives this error. ``` 1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1449:in `block in activate_dependencies' /Sys...
2021/09/08
[ "https://Stackoverflow.com/questions/69098207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16858051/" ]
Same issue. Just updating gem package manager is works for me `gem update` Terminal will display installing 'ffi' ``` Successfully installed ffi-1.15.5 ```
i solved the issue by installing the command line tool for XCode. Just download the specific CLT from apple website
69,098,207
Hi I'm trying to run my react native app on mac mini. I can run another app also this app to but when i write `pod install` in terminal it gives this error. ``` 1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1449:in `block in activate_dependencies' /Sys...
2021/09/08
[ "https://Stackoverflow.com/questions/69098207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16858051/" ]
Same issue. Just updating gem package manager is works for me `gem update` Terminal will display installing 'ffi' ``` Successfully installed ffi-1.15.5 ```
I just did a ``` bundle install ``` and that allowed me to do a pod install after upgrading (without asking me to Xcode 14).
68,366,435
Complete amateur here. I am working on a little personal project and need to be able to put numbers **directly over** over certain letters like this: [![enter image description here](https://i.stack.imgur.com/MD11v.png)](https://i.stack.imgur.com/MD11v.png) My current method is to just embed the equations as jpegs, b...
2021/07/13
[ "https://Stackoverflow.com/questions/68366435", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14622218/" ]
Use the superscript and subscript tags. ```css sup { left: -.5em; top: -.5em; margin-left: -1em; position: relative; } ``` ```html K<sub>2</sub>Cr<sub>2</sub><sup>+6</sup>O<sub>7</sub> ``` Are you looking for something like this? It may require some fine-tuning based on the exact formula you are trying to re...
I don't know if you can with HTML only, but there is [mathJax](https://www.mathjax.org/) which is > > a JavaScript display engine for mathematics that works in all browsers. > > >
187,371
I am using the following select statement to enter the a record in a cartodb database. ```sql INSERT INTO catch ( site_code, have_catch, fishtype1, fishtype2, fishtype3, fishtype4, fishtype5, number_of_species, **catch_date**, fisherman_id ) VALUES ( '$siteCode', 1, '$fishtype1',...
2016/03/31
[ "https://gis.stackexchange.com/questions/187371", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/1260/" ]
Is it UTC? Current UTC time: 3:41 AM Thursday, March 31, 2016 My local time: 8:41 PM Wednesday, March 30, 2016 [Coordinated Universal Time (UTC)](https://en.wikipedia.org/wiki/Coordinated_Universal_Time)
Once you know in which time zone the data was collected ([here](http://www.timeanddate.com/time/zones/caribbean) you have a list of all the Caribbean time zones), you can update your date column with the following SQL query: ``` UPDATE TABLE_NAME SET DATE_COLUMN = DATE_COLUMN AT TIME ZONE 'CODE' ```
12,404,593
I have a question regarding transactions and celery tasks. So it's no mystery to me that of course if you have a transaction and a celery task accessing the same table/records we'll have a race condition. However, consider the following piece of code: ``` def f(self): # function of module that inherits from models...
2012/09/13
[ "https://Stackoverflow.com/questions/12404593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/344487/" ]
To display Users with Location I think you need one class called AdsnapshotUsers ``` public class AdsnapshotUsers { // three fields UserId, UserLogonName, Location } ``` Now create one method which return `IList<AdsnapshotUsers>` ``` public IList<AdsnapshotUsers> GetAdsnapshotUsers() { List<User> Users = GetAci...
The simplest way to join two IEnumerables in LINQ is with Join(): ``` var joined = from u in GetActiveUsers() join ad in _adSnapshotRepository.GetAll() on u.UserLogonName equals ad.UserLogonName select new { User = u, Location = ad.Location } ``` Of course, join...
12,404,593
I have a question regarding transactions and celery tasks. So it's no mystery to me that of course if you have a transaction and a celery task accessing the same table/records we'll have a race condition. However, consider the following piece of code: ``` def f(self): # function of module that inherits from models...
2012/09/13
[ "https://Stackoverflow.com/questions/12404593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/344487/" ]
The simplest way to join two IEnumerables in LINQ is with Join(): ``` var joined = from u in GetActiveUsers() join ad in _adSnapshotRepository.GetAll() on u.UserLogonName equals ad.UserLogonName select new { User = u, Location = ad.Location } ``` Of course, join...
If you have relationship (1:1) between these two tables then you can get records very easily using just one query. and evenif records are not present in second table. I am using above defined class definition to store data. ``` _userRepository.GetAll().Select(u=>new AdsnapshotUsers { UserId= u.UserId, ...
12,404,593
I have a question regarding transactions and celery tasks. So it's no mystery to me that of course if you have a transaction and a celery task accessing the same table/records we'll have a race condition. However, consider the following piece of code: ``` def f(self): # function of module that inherits from models...
2012/09/13
[ "https://Stackoverflow.com/questions/12404593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/344487/" ]
To display Users with Location I think you need one class called AdsnapshotUsers ``` public class AdsnapshotUsers { // three fields UserId, UserLogonName, Location } ``` Now create one method which return `IList<AdsnapshotUsers>` ``` public IList<AdsnapshotUsers> GetAdsnapshotUsers() { List<User> Users = GetAci...
If you have relationship (1:1) between these two tables then you can get records very easily using just one query. and evenif records are not present in second table. I am using above defined class definition to store data. ``` _userRepository.GetAll().Select(u=>new AdsnapshotUsers { UserId= u.UserId, ...
168,193
I just got a new wireless printer and I love that it lets me print from any device on my wireless network, even my iPhone. There is, however, one feature that appears to be missing. When I print from my computer, I can select different print quality settings: "Draft, Normal, Photo, Black & White". I don't seem to be a...
2015/01/20
[ "https://apple.stackexchange.com/questions/168193", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/110407/" ]
According to Apple, [AirPrint on iPhone](http://support.apple.com/en-us/HT201387) is simplified application. It only lets you choose the printer and the number of copies, but not print quality etc.. in other words it use the current Printer defaults. So what can you do? Log in to the printer's set up page IP address...
With iOS 9 AirPrint now has the option to print Black & White. Screenshot: [![Black & White AirPrint](https://i.stack.imgur.com/AC6Ga.png)](https://i.stack.imgur.com/AC6Ga.png)
168,193
I just got a new wireless printer and I love that it lets me print from any device on my wireless network, even my iPhone. There is, however, one feature that appears to be missing. When I print from my computer, I can select different print quality settings: "Draft, Normal, Photo, Black & White". I don't seem to be a...
2015/01/20
[ "https://apple.stackexchange.com/questions/168193", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/110407/" ]
According to Apple, [AirPrint on iPhone](http://support.apple.com/en-us/HT201387) is simplified application. It only lets you choose the printer and the number of copies, but not print quality etc.. in other words it use the current Printer defaults. So what can you do? Log in to the printer's set up page IP address...
Standard Apple answer - "there's an app for that" I have, no, had the same issue with a Canon printer. In the app store I did a search for 'Airprint' and found a long list of apps from several major manufactures. Downloaded the Canon app and I can now control all the settings when I airprint to my printer.
16,429,732
The two things I'd like to do in particular are: * slice up an individual video into many smaller videos * Draw basic shapes on top of the video I would prefer to use python because I already know it and it is well-suited for the rest of the work that is happening around this video.
2013/05/07
[ "https://Stackoverflow.com/questions/16429732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1481457/" ]
Try [Media Lovin' Toolkit](http://www.mltframework.org/), which has Python bindings.
Maybe OpenCV could help you. The main project page : <http://opencv.org/> And the bindings for Python : <https://code.google.com/p/pyopencv/> Cheers, K.
40,151,160
I'm making a project that dumps a file by putting the offsets (hexadecimal). I must put the hexadecimal with 0x like 0xBEE4DC because the application will crash or return an error if I put a hexadecimal without 0x like BEE4DC. Is there a way to put the hexadecimal without "0x" ? This is my code. i'm keeping this proje...
2016/10/20
[ "https://Stackoverflow.com/questions/40151160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
For the `NavigationDrawer` to be on top of everything else, your `DrawerLayout` must be the parent layout for all your views. ``` <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/drawer_layout...
Try to place the **TabLayout** Inside Drawer Layout ``` <android.support.v4.widget.DrawerLayout android:layout_width="match_parent" android:layout_height="0dp" android:id="@+id/drawer_layout" android:layout_weight="1" > <FrameLayout android:layout_width="match_parent" android:la...
22,522
I want to make sure I'm understanding how this works. Specifically the term "Sending Port ID" has me very confused. Consider this diagram, I want to make sure I have root port selection figured out: [![enter image description here](https://i.stack.imgur.com/lIZZI.jpg)](https://i.stack.imgur.com/lIZZI.jpg) The switch...
2015/09/15
[ "https://networkengineering.stackexchange.com/questions/22522", "https://networkengineering.stackexchange.com", "https://networkengineering.stackexchange.com/users/13362/" ]
you need to understand the next Spanning-Tree Port Roles - Root Port (RP) - It is a port on a non-root switch, which is the shortest (the best) path towards the root bridge. (i.e. port 0/4 0/3 in SW3) - Designated Port (DP) - It is a port that is in the forwarding state. (i.e. port 0/1 0/2 SW2) - Non-Desi...
Some corrections to the above answer. Port-id and port-priority are different. One is configurable. The other is internally set. I'll make an attempt to answer your question below. There has to be just 1 root port per switch. By definition , this is the port with the lowest **path-cost** to root. * A path-cost is th...
41,154,505
I am having trouble understanding what needs to be done in order to connect to MongoDB so i can insert an Object into the database. I am new to using Express as well as MongoDB and don't have a full grasp on the both of them yet. My app.js which was created using the standard Express setup is as follows. ``` var exp...
2016/12/15
[ "https://Stackoverflow.com/questions/41154505", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7154852/" ]
\*for express , ``` var mongo = require('mongodb'); var MongoClient = mongo.MongoClient; MongoClient.connect('mongodb://'+DB_USERNAME+':'+DB_PASSWORD+'@'+DB_HOST+':'DB_PORT+'/'+DB_NAME,function(err, db){ if(err) console.log(err); else {...
Your code is super mess,I can show your my configuration and u can refer to. ``` db.js import mongoose from 'mongoose'; export default function connectDB() { mongoose.Promise = global.Promise; mongoose.connect('mongodb://localhost:27017/contacts'); mongoose.connection.once('open', function () { co...
2,625,185
Suppose that $A$ is a matrix field and that $v$ is a vector field. What is the divergence of the matrix-vector product $A \cdot v$, which is a vector field?
2018/01/28
[ "https://math.stackexchange.com/questions/2625185", "https://math.stackexchange.com", "https://math.stackexchange.com/users/3557/" ]
I agree with Tommaso Seneci. This question deserves a better answer. Yes, it is just vector calculus, but there are some non-trivial tricks that deserve to be noted. Inspired by [this note by Piaras Kelly](http://homepages.engineering.auckland.ac.nz/~pkel015/SolidMechanicsBooks/Part_III/Chapter_1_Vectors_Tensors/Vecto...
**Hint:** As the divergence is simply the sum of $n$ partial derivatives, I will show you how to deal with these derivatives. If you have a matrix valued function $A$ and a vector valued function $\def\b{\mathbf}\b v$, then their product can be differentiated in the following way: \begin{align} \def\d{\partial} \def...
2,625,185
Suppose that $A$ is a matrix field and that $v$ is a vector field. What is the divergence of the matrix-vector product $A \cdot v$, which is a vector field?
2018/01/28
[ "https://math.stackexchange.com/questions/2625185", "https://math.stackexchange.com", "https://math.stackexchange.com/users/3557/" ]
I agree with Tommaso Seneci. This question deserves a better answer. Yes, it is just vector calculus, but there are some non-trivial tricks that deserve to be noted. Inspired by [this note by Piaras Kelly](http://homepages.engineering.auckland.ac.nz/~pkel015/SolidMechanicsBooks/Part_III/Chapter_1_Vectors_Tensors/Vecto...
Let us write the matrix-vector product ${\bf M}\cdot {\bf c}$ in index notation ([Einstein convention](https://en.wikipedia.org/wiki/Einstein_notation)). Using the product rule, the divergence of $({\bf M}\cdot {\bf c})\_{i} = M\_{ij} c\_j$ satisfies $$ \nabla\cdot({\bf M}\cdot {\bf c}) = M\_{ij,i} c\_j + M\_{ij} c\_{j...
2,116
I want to make a rocket 'whooooooooooooooooooosh' sound that can go on FOREVER. I have the sound I like, I just need some protips on making it loop. I've been hacking away at it in Pro Tools, and when I loop it in there, it works, but when I implement it in the game I'm working on, there's a clear loop point. Any idea ...
2010/07/20
[ "https://sound.stackexchange.com/questions/2116", "https://sound.stackexchange.com", "https://sound.stackexchange.com/users/14/" ]
Try it in game. You probably won't notice the loop as it's flying by you. If you do, take that same sample and offset it in another track in Pro Tools. Bounce that down and loop that. That should help remedy it. If that's really not solving the issue then look for another static track to layer in. Jet airplanes are go...
surely the way is to seperate construction of the events the doppler effect is most noticeable when it passes the listener, so from launch, to close passby, to close away use Michaels awesome rocket sound then 1. make the constant rocket engine sound (like you have a mic gaffer-taped to the side of the rocket) 2. a...
2,116
I want to make a rocket 'whooooooooooooooooooosh' sound that can go on FOREVER. I have the sound I like, I just need some protips on making it loop. I've been hacking away at it in Pro Tools, and when I loop it in there, it works, but when I implement it in the game I'm working on, there's a clear loop point. Any idea ...
2010/07/20
[ "https://sound.stackexchange.com/questions/2116", "https://sound.stackexchange.com", "https://sound.stackexchange.com/users/14/" ]
Try it in game. You probably won't notice the loop as it's flying by you. If you do, take that same sample and offset it in another track in Pro Tools. Bounce that down and loop that. That should help remedy it. If that's really not solving the issue then look for another static track to layer in. Jet airplanes are go...
This may sound simplistic but I'll be glad to share what I've learned from a recent game project earlier this year. Make sure you have clean heads and tails. You may be able to loop well in Pro tools because of the region you selected. But when you play the wav file completely, you may still have some audio at the star...
2,116
I want to make a rocket 'whooooooooooooooooooosh' sound that can go on FOREVER. I have the sound I like, I just need some protips on making it loop. I've been hacking away at it in Pro Tools, and when I loop it in there, it works, but when I implement it in the game I'm working on, there's a clear loop point. Any idea ...
2010/07/20
[ "https://sound.stackexchange.com/questions/2116", "https://sound.stackexchange.com", "https://sound.stackexchange.com/users/14/" ]
hmm... maybe there's a way to combine it with a Shepard tone so the doppler is "continuous" (assuming our perspective is fixed from outside the rocket) <http://en.wikipedia.org/wiki/Shepard_tone>
surely the way is to seperate construction of the events the doppler effect is most noticeable when it passes the listener, so from launch, to close passby, to close away use Michaels awesome rocket sound then 1. make the constant rocket engine sound (like you have a mic gaffer-taped to the side of the rocket) 2. a...
2,116
I want to make a rocket 'whooooooooooooooooooosh' sound that can go on FOREVER. I have the sound I like, I just need some protips on making it loop. I've been hacking away at it in Pro Tools, and when I loop it in there, it works, but when I implement it in the game I'm working on, there's a clear loop point. Any idea ...
2010/07/20
[ "https://sound.stackexchange.com/questions/2116", "https://sound.stackexchange.com", "https://sound.stackexchange.com/users/14/" ]
hmm... maybe there's a way to combine it with a Shepard tone so the doppler is "continuous" (assuming our perspective is fixed from outside the rocket) <http://en.wikipedia.org/wiki/Shepard_tone>
This may sound simplistic but I'll be glad to share what I've learned from a recent game project earlier this year. Make sure you have clean heads and tails. You may be able to loop well in Pro tools because of the region you selected. But when you play the wav file completely, you may still have some audio at the star...