qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
65,159,884
1. I know that the access token obtained from OAuth2.0 can be used to access protected resources. 2. OpenID Connect issues ID token and access token after authentication. And the spec says that the access token can be used to access userinfo endpoint to get additional user information. One thing I'm not able to unders...
2020/12/05
[ "https://Stackoverflow.com/questions/65159884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1790274/" ]
You tend to just implement both OIDC and OAuth 2.0 together as a combined flow, by plugging in an Open Id Connect security library. Eg For a mobile app it is common to plug in [AppAuth Libraries](https://github.com/openid/AppAuth-iOS), which would give you this behaviour: * An OAuth 2.0 authorization redirect using r...
This access tokens have different audiences ("aud" claim): the OAuth 2.0 access token is intended for resource server (i.e. API), and OIDC access token is intended for identity server itself. As for me, they cannot be used interchangebly, but some examples (e.g. IdentityServer4) do that without checking the "aud" claim...
170,577
In D&D, the main ability is a score from 1-30, while the modifiers range from -5 to +10 (score -10/2 round down) In the Player's Handbook, it states: > > Because ability modifiers affect almost every Attack roll, ability check, and saving throw, ability modifiers come up in play more often than their associated scor...
2020/06/17
[ "https://rpg.stackexchange.com/questions/170577", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/2944/" ]
Pretty rarely, but there are a few examples ------------------------------------------- Strength -------- * [Carrying capacity](https://www.dndbeyond.com/sources/basic-rules/using-ability-scores#LiftingandCarrying) - The score, not the modifier is used to determine how much a character can carry without becoming encu...
Modifications work on scores rather than modifiers. =================================================== When character gains an ability score improvement, usually at levels 4, 8, 12, 16, and 19 (though the fighter and rogue get more) the characters' ability scores are increased, rather than their modifiers. The same ...
68,799,458
I am currently building an application using NgRx and the Router Store. There is a dropdown in one component, that changes params in the url and navigates on the same component. Since navigating on the same component doesn't call NgOnInit the corresponding effect (that calls the API) is not called. In my opinion, the e...
2021/08/16
[ "https://Stackoverflow.com/questions/68799458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10554259/" ]
Since you wanna control the loading of data via the route, it would be ideal and cleaner to perform the pulling of transactionData via routeGuards, specifically the `CanActivate` Guard A simple snippet of a possible method can be seen below, **routing.module.ts** ``` const routes: Routes = [ { path: '', compon...
I read the documentation more closely and the [effects guide](https://ngrx.io/guide/effects) tells you the following: > > **Note:** Event streams are not limited to dispatched actions, but can be any observable that produces new actions, such as observables from the Angular Router, observables created from browser ev...
42,318,747
I've been creating a program requesting the user to input a char value, but if they enter more than one character it will move onto the next function and break the program. I've added in the second method which gets run when multiple inputs are entered.
2017/02/18
[ "https://Stackoverflow.com/questions/42318747", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7196630/" ]
Your problem is not one of limiting the number of characters written to `cInput`; the format specifier `%1s` does that already. Your problem is one of leaving unprocessed characters in the input buffer. You need to remove all characters from the buffer if subsequent input will not handle them. For example if you leave ...
If I understand your question correctly, you want the function to return if the user input is any of * `y` followed by newline * `Y` followed by newline * `n` followed by newline * `N` followed by newline In all other cases you want to stay in the function and get new user input (e.g. `nYnhhh` followed by newline sha...
402,454
I cannot install anything from the Ubuntu software center (on 13.10). The "Install" button is missing and only the one fore "More information" is there. I suspect it is a problem with the software repository cause I have been messing up with it trying to install OpenOffice but I don't know how to fix it. Any help? Aft...
2014/01/08
[ "https://askubuntu.com/questions/402454", "https://askubuntu.com", "https://askubuntu.com/users/233365/" ]
Your problem is that the `http://es.archive.ubuntu.com/ubuntu/` mirror seems to be unstable for the moment. You can select other mirrors using Software Sources or using this method from the command line: ``` sudo sed -i 's/es\.archive/archive/g' /etc/apt/sources.list /etc/apt/sources.list.d/*.list sudo apt-get update ...
Try to update your system first. You can do this in the terminal (`Ctrl`+`Alt`+`T`) by typing: ``` sudo apt-get update sudo apt-get dist-upgrade ``` If that doesn't work, then please edit your answer, appending the contents of your `/etc/apt/sources.list` file and the error messages resulting from the above commands...
402,454
I cannot install anything from the Ubuntu software center (on 13.10). The "Install" button is missing and only the one fore "More information" is there. I suspect it is a problem with the software repository cause I have been messing up with it trying to install OpenOffice but I don't know how to fix it. Any help? Aft...
2014/01/08
[ "https://askubuntu.com/questions/402454", "https://askubuntu.com", "https://askubuntu.com/users/233365/" ]
and another way - change your package server ``` search "Synaptic Package Manager" on "dash home" and select following setting -> repositories -> ubuntu software select new server on "download from" ``` or see this link >> <https://help.ubuntu.com/community/Repositories/Ubuntu>
Try to update your system first. You can do this in the terminal (`Ctrl`+`Alt`+`T`) by typing: ``` sudo apt-get update sudo apt-get dist-upgrade ``` If that doesn't work, then please edit your answer, appending the contents of your `/etc/apt/sources.list` file and the error messages resulting from the above commands...
402,454
I cannot install anything from the Ubuntu software center (on 13.10). The "Install" button is missing and only the one fore "More information" is there. I suspect it is a problem with the software repository cause I have been messing up with it trying to install OpenOffice but I don't know how to fix it. Any help? Aft...
2014/01/08
[ "https://askubuntu.com/questions/402454", "https://askubuntu.com", "https://askubuntu.com/users/233365/" ]
Your problem is that the `http://es.archive.ubuntu.com/ubuntu/` mirror seems to be unstable for the moment. You can select other mirrors using Software Sources or using this method from the command line: ``` sudo sed -i 's/es\.archive/archive/g' /etc/apt/sources.list /etc/apt/sources.list.d/*.list sudo apt-get update ...
and another way - change your package server ``` search "Synaptic Package Manager" on "dash home" and select following setting -> repositories -> ubuntu software select new server on "download from" ``` or see this link >> <https://help.ubuntu.com/community/Repositories/Ubuntu>
58,841,930
I have a problem with the addition of font in xcode. my font is well added in my computer, I did the ctrl drag and target my project, I added it in the fonts providded by app, it is in copy bundle resources but impossible to see in the inspector attributes in the storyboard. Thanks for your help[font not visible](https...
2019/11/13
[ "https://Stackoverflow.com/questions/58841930", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12368031/" ]
How about something like this? ``` class Class1 : IConstraint {} class Class2 : IConstraint {} interface IConstraint {} class MustHaveConstraints<T> where T : IConstraint {} ``` If your types are only classes this kind of implementation will be more flexable. **UPDATE** As @DRapp suggested, this can be done wit...
You can't constraint on an array. An array is not really a type, it is a *false* type: a raw basic memory data structure like a train with wagoons as cells even if `Array` is a class to manipulate them. In IL generated code, the usage of `new` keyword is transposed in `newarr` operand: * class types: no instance is ...
58,841,930
I have a problem with the addition of font in xcode. my font is well added in my computer, I did the ctrl drag and target my project, I added it in the fonts providded by app, it is in copy bundle resources but impossible to see in the inspector attributes in the storyboard. Thanks for your help[font not visible](https...
2019/11/13
[ "https://Stackoverflow.com/questions/58841930", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12368031/" ]
How about something like this? ``` class Class1 : IConstraint {} class Class2 : IConstraint {} interface IConstraint {} class MustHaveConstraints<T> where T : IConstraint {} ``` If your types are only classes this kind of implementation will be more flexable. **UPDATE** As @DRapp suggested, this can be done wit...
As an answer to my own question, yes it possible but not in the conventional way. One would have to use text templates to generate these classes ``` <#@ var types = "T1, T2, T3"; #> namespace Generics { class GenericClass<<#=types#>> { } } ```
39,423,640
I am developing a piece of software that need to check duplicate small text *(normally less than 2 kb)* using **pre-calculated signature (4bytes)**. Currently , I've implemented CRC32 (4byte) to achieve this purpose but I suspect that CRC32 would generated a lot of duplicate values. I know it is impossible to make it r...
2016/09/10
[ "https://Stackoverflow.com/questions/39423640", "https://Stackoverflow.com", "https://Stackoverflow.com/users/365229/" ]
Without further knowledge about `small text`, the best you can hope for is each hash value equally probable, and most of 2³² 4-octet-values used. Even then, you are more likely than not to have a collision with just about 77000 texts, let alone a million. With a few exceptions (Adler32 coming to mind), well-known hash ...
In case you get into hash collision you have to check if text is equal. The best way would be to count how many time it happens to have collision make some statistics and if it looks bad optimizing it. I got this idea that you could build 2 different hash values crc32 and md5 (or Luhn or whatever you like) and check fo...
39,423,640
I am developing a piece of software that need to check duplicate small text *(normally less than 2 kb)* using **pre-calculated signature (4bytes)**. Currently , I've implemented CRC32 (4byte) to achieve this purpose but I suspect that CRC32 would generated a lot of duplicate values. I know it is impossible to make it r...
2016/09/10
[ "https://Stackoverflow.com/questions/39423640", "https://Stackoverflow.com", "https://Stackoverflow.com/users/365229/" ]
Without further knowledge about `small text`, the best you can hope for is each hash value equally probable, and most of 2³² 4-octet-values used. Even then, you are more likely than not to have a collision with just about 77000 texts, let alone a million. With a few exceptions (Adler32 coming to mind), well-known hash ...
I did something very similar in one of my projects. In my project i used something called a **BLOOM FILTER** , [watch](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=video&cd=1&cad=rja&uact=8&ved=0ahUKEwiC-I7J6YTPAhUEqo8KHdM4DHkQtwIIHDAA&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DbEmBh1HtYrw&usg=AFQjCNHOeJ...
29,171,752
I am trying to resize a CMSampleBufferRef as quickly as possible on an iOS 8 device for use in image processing. From what I have found online, the way to do this seems to be by using the [vImage API](https://developer.apple.com/library/ios/documentation/Performance/Conceptual/vImage/GeometricOperations/GeometricOperat...
2015/03/20
[ "https://Stackoverflow.com/questions/29171752", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1199792/" ]
Let's break it down: ``` >>> A = [ 'a', 'b', 'c', 'd', 'e'] A[0] A[1] >>A[2]<< A[3] A[4] >>> A[2] 'c' #Third item in list? - Yes >>> A = [ '0', '1', '2', '3', '4'] A[0] A[1] >>A[2]<< A[3] A[4] >>> A[2] '2' #Third item in list? - Yes ...
In both cases, `A[2]` is referencing whatever is stored in index `2` of the list. For ``` A = ['a', 'b', 'c', 'd', 'e'] ``` This is `'c'`. (Note that due to zero-based counting `'a'` is at index `0`) In the same way `A[2]` for ``` A = ['0', '1', '2', '3', '4'] ``` references index `2` which yields a value of `'2...
99,687
I have the following function: **Input:** ``` f=-a n^2/v^2 +v/n ``` I want to Replace `v/n` by `v_new` **Attempt:** *[Failed]* ``` f/. v/n -> v_new ``` **Desired output:** ``` -a/v_new +v_new ```
2015/11/17
[ "https://mathematica.stackexchange.com/questions/99687", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/19369/" ]
Just simplify your replacement rule so that you aren't replacing `v/n->v2`, but replacing `v->n v2` ``` f = -a n^2/v^2 + v/n (* -((5 n^2)/v^2) + v/n *) f /. v -> n v2 (* -(5/v2^2) + v2 *) ```
**Overview** I do not know how to evaluate your eq. to the desired output. However if you use [ReplaceAll](http://reference.wolfram.com/language/ref/ReplaceAll.html) in a following way you can replace 'v/n' term. Please see the implementation below. Also, please refer to [this](https://mathematica.stackexchange.com/q...
61,153,803
Here is the code snippet: ``` a := 40 f := float64(a/100.0) fmt.Println("Hello, playground", f) ``` `f=0`, why?
2020/04/11
[ "https://Stackoverflow.com/questions/61153803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1206899/" ]
Sampled mean is not always same as theoretical mean. But, when the sample size becomes big, then the difference will be small. See the code. ``` import numpy as np print(np.random.normal(0, 1, 100).mean()) # 0.08 print(np.random.normal(0, 1, 1000).mean()) # -0.03 print(np.random.normal(0, 1, 10000).mean()) # -0.004 p...
Imagine some simple cases: * N=1: almost no chance of getting exactly zero, once in a while you'll be near zero. * N=2: whatever you get for the first number, better hope you get exactly the inverse for the second number. Won't usually happen, wouldn't be random if it did. * N=3: once you get the first two, now you ne...
61,153,803
Here is the code snippet: ``` a := 40 f := float64(a/100.0) fmt.Println("Hello, playground", f) ``` `f=0`, why?
2020/04/11
[ "https://Stackoverflow.com/questions/61153803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1206899/" ]
Sampled mean is not always same as theoretical mean. But, when the sample size becomes big, then the difference will be small. See the code. ``` import numpy as np print(np.random.normal(0, 1, 100).mean()) # 0.08 print(np.random.normal(0, 1, 1000).mean()) # -0.03 print(np.random.normal(0, 1, 10000).mean()) # -0.004 p...
The theory says that the standard deviation of the mean of a normal sample is equal to sigma/sqrt(n) where n is the size of the sample and sigma the standard deviation of the normal distribution. So as @Gilseung said is his answer the mean get closer to 0 when the size of the sample increases.
61,153,803
Here is the code snippet: ``` a := 40 f := float64(a/100.0) fmt.Println("Hello, playground", f) ``` `f=0`, why?
2020/04/11
[ "https://Stackoverflow.com/questions/61153803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1206899/" ]
Imagine some simple cases: * N=1: almost no chance of getting exactly zero, once in a while you'll be near zero. * N=2: whatever you get for the first number, better hope you get exactly the inverse for the second number. Won't usually happen, wouldn't be random if it did. * N=3: once you get the first two, now you ne...
The theory says that the standard deviation of the mean of a normal sample is equal to sigma/sqrt(n) where n is the size of the sample and sigma the standard deviation of the normal distribution. So as @Gilseung said is his answer the mean get closer to 0 when the size of the sample increases.
63,546,674
I'm developing an Android app... when I run it on my Motorola it runs ok, but when I launch it in my Samsung device, that has less screen size, the app doesn't show some buttons. It seems that the resolution is different in either both devices. How can I configure my app so I don't have problems running in mostly devic...
2020/08/23
[ "https://Stackoverflow.com/questions/63546674", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9135192/" ]
As stated @abed in his answer, ConstraintLayout should be good for solving most of this issues, but you can never know that it will be fine on all devices. Testing on multiple devices is one way to be sure, so if you expect that there will be problems, or that something should be different. You can easy see behavior o...
when you build your layout Use `<androidx.constraintlayout.widget.ConstraintLayout` check this <https://developer.android.com/training/constraint-layout>
2,571,447
From Effective Java 2nd Edition Item 7: Avoid Finalizers "Oh, and one more thing: there is a severe performance penalty for using finalizers. On my machine, the time to create and destroy a simple object is about 5.6 ns. Adding a finalizer increases the time to 2,400 ns. In other words, it is about 430 times slower to...
2010/04/03
[ "https://Stackoverflow.com/questions/2571447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/115988/" ]
That only measures the time to execute the finalize method. The vast majority of the cost of finalization will be in the special handling that the GC has to perform.
You could request the Runtime to perform Garbage collection via [`Runtime.gc()`](http://java.sun.com/javase/6/docs/api/java/lang/Runtime.html#gc()), but the Garbage Collector is not required to perform it right there and then: * The [`finalize()`](http://java.sun.com/javase/6/docs/api/java/lang/Object.html#finalize())...
2,571,447
From Effective Java 2nd Edition Item 7: Avoid Finalizers "Oh, and one more thing: there is a severe performance penalty for using finalizers. On my machine, the time to create and destroy a simple object is about 5.6 ns. Adding a finalizer increases the time to 2,400 ns. In other words, it is about 430 times slower to...
2010/04/03
[ "https://Stackoverflow.com/questions/2571447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/115988/" ]
That only measures the time to execute the finalize method. The vast majority of the cost of finalization will be in the special handling that the GC has to perform.
Instead of futilely trying to microbenchmark this, as Tom Hawtin said above, the best approach is to examine the time to do a few hundred thousand cycles of creation and destruction, and divide by number of cycles. This approach is the best in a lot of situations where the code you write is not the only code involved...
2,571,447
From Effective Java 2nd Edition Item 7: Avoid Finalizers "Oh, and one more thing: there is a severe performance penalty for using finalizers. On my machine, the time to create and destroy a simple object is about 5.6 ns. Adding a finalizer increases the time to 2,400 ns. In other words, it is about 430 times slower to...
2010/04/03
[ "https://Stackoverflow.com/questions/2571447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/115988/" ]
That only measures the time to execute the finalize method. The vast majority of the cost of finalization will be in the special handling that the GC has to perform.
One possible solution is to rely on the `java.lang.ref` package, which only supports a limited degree of interactions with the garbage collector. The result of measurement couldn't be accurate, as it's hard to know the real ending of an object. I believe Joshua must have another approach to measure time, **maybe** hea...
2,571,447
From Effective Java 2nd Edition Item 7: Avoid Finalizers "Oh, and one more thing: there is a severe performance penalty for using finalizers. On my machine, the time to create and destroy a simple object is about 5.6 ns. Adding a finalizer increases the time to 2,400 ns. In other words, it is about 430 times slower to...
2010/04/03
[ "https://Stackoverflow.com/questions/2571447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/115988/" ]
Instead of futilely trying to microbenchmark this, as Tom Hawtin said above, the best approach is to examine the time to do a few hundred thousand cycles of creation and destruction, and divide by number of cycles. This approach is the best in a lot of situations where the code you write is not the only code involved...
You could request the Runtime to perform Garbage collection via [`Runtime.gc()`](http://java.sun.com/javase/6/docs/api/java/lang/Runtime.html#gc()), but the Garbage Collector is not required to perform it right there and then: * The [`finalize()`](http://java.sun.com/javase/6/docs/api/java/lang/Object.html#finalize())...
2,571,447
From Effective Java 2nd Edition Item 7: Avoid Finalizers "Oh, and one more thing: there is a severe performance penalty for using finalizers. On my machine, the time to create and destroy a simple object is about 5.6 ns. Adding a finalizer increases the time to 2,400 ns. In other words, it is about 430 times slower to...
2010/04/03
[ "https://Stackoverflow.com/questions/2571447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/115988/" ]
Instead of futilely trying to microbenchmark this, as Tom Hawtin said above, the best approach is to examine the time to do a few hundred thousand cycles of creation and destruction, and divide by number of cycles. This approach is the best in a lot of situations where the code you write is not the only code involved...
One possible solution is to rely on the `java.lang.ref` package, which only supports a limited degree of interactions with the garbage collector. The result of measurement couldn't be accurate, as it's hard to know the real ending of an object. I believe Joshua must have another approach to measure time, **maybe** hea...
352,066
I'm using `tmux` in OpenBSD (`tmux` in the base system of OpenBSD 6.1-beta), and I do some development on Linux hosts. Whenever I log into a Linux host, it renames the current `tmux` window. This is what's displayed in the lower right-hand corner of my `tmux` window: ``` "root@pelleplutt: /hom" 10:51 17-Mar-17 ``` ...
2017/03/17
[ "https://unix.stackexchange.com/questions/352066", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/116858/" ]
From [a thread in the tmux-users list asking about this](https://www.mail-archive.com/tmux-users@googlegroups.com/msg00005.html): > > allow-rename affects the window name not the title. > > > In your output from `Prefix`+`w`: ``` (0) 0: ksh93* "root@pelleplutt: /home/ubuntu" ``` The `"ksh93"` part is what `t...
it's changed option name. so type 'man tmux' and need to check command. ``` $ tmux -V tmux 3.1b $ man tmux ... ... automatic-rename [on | off] Control automatic window renaming. When this setting is enabled, tmux will rename the window automatically using the format specified by automatic-rena...
37,585,254
Consider I have a global variable called `generatedPattern`. I want to use it in a `function animate()`, but do not want to change its value. So I copy generatedPattern to a local var(say `var patternToAnimate`) in the function and then use patternToAnimate. Will any change to patternToAnimate change generatedPattern?...
2016/06/02
[ "https://Stackoverflow.com/questions/37585254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4983469/" ]
If you use and alter `generatedPattern` somewhere else, well, it gets changed. If you want to use the values of `genratedPattern` in another function without modifying it, you indeed have to copy it. But beware, don't save it as a reference: ``` var generatedPattern = [1, 2, 3]; var patternToAnimate = generatedPatte...
Just assign the global variable to a new variable within a lower scope: ```js console.clear(); console.log('no problem') var global = 123; (function () { var local = global; local = 321; console.log("local is",local); })(); console.log("global is",global); console.log('Actually change the global variabl...
33,004,440
Yes this is a homework question. However, I don't think it is a problem to use stack exchange to solve homework problems. This is what real programmers do, don't they. I have this program that prints two rocket ships to the console. The rockets are stacked vertically. I would like them to appear side-by-side. Is there...
2015/10/08
[ "https://Stackoverflow.com/questions/33004440", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5420796/" ]
You have to modify the static methods. By using concatenation operator you can achieve two rockets side by side. comment out one //appearrocket(); ``` package com.stackover.ex; public class TwoRockets { public static void main (String[] args) { appearrocket(); //appearrocket(); } ...
A generic edition which can handle any number of side-by-side rockets just by changing the value of the variable copies: ``` public class TwoRockets { public static void main(String[] args) { final int copies = 3; printCap(copies); printBox(copies); printUS(copies); printBox(copies); printCap...
2,898,944
I have studied *Advanced Calculus* by Fitzpatrick which discusses the so called the Second Fundamental Theorem (Differentiating Integrals) but it is when the upper or lower limits of integral is a function of $x$ and differentiation is on $x$. But differentiation of the type in the title is not discussed at all and is ...
2018/08/29
[ "https://math.stackexchange.com/questions/2898944", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Recall [Leibniz's integral rule](http://mathworld.wolfram.com/LeibnizIntegralRule.html) $$\frac{d}{dt}\int\_{\phi(t)}^{\psi(t)} f(t,s) ds = \int\_{\phi(t)}^{\psi(t)} \frac{d}{dt}f(t,s) ds+f(t,\psi(t))\frac{d}{dt}\psi(t) -f(t,\phi(t))\frac{d}{dt}\phi(t)$$ Notice that if ${\displaystyle \psi(t)}$and ${\displaystyle \ph...
"Fundamental Theorem (Differentiating Integrals) but it is when the upper or lower limits of integral is a function of x and differentiation is on x" might not count as a proof but just an observation I thought might be useful, when you mentioned that the limits of the integral are a function of x, your limits in thi...
2,898,944
I have studied *Advanced Calculus* by Fitzpatrick which discusses the so called the Second Fundamental Theorem (Differentiating Integrals) but it is when the upper or lower limits of integral is a function of $x$ and differentiation is on $x$. But differentiation of the type in the title is not discussed at all and is ...
2018/08/29
[ "https://math.stackexchange.com/questions/2898944", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
A proof would use some "limit theorem" to interchange integral and limit. Probably in a course with only Riemann integration we would use uniform convergence for that. But in a course with Lebesgue integration we could use a monotone convergence or dominated convergence argument. Here we mark with $\overset{\*}{=}$ whe...
Recall [Leibniz's integral rule](http://mathworld.wolfram.com/LeibnizIntegralRule.html) $$\frac{d}{dt}\int\_{\phi(t)}^{\psi(t)} f(t,s) ds = \int\_{\phi(t)}^{\psi(t)} \frac{d}{dt}f(t,s) ds+f(t,\psi(t))\frac{d}{dt}\psi(t) -f(t,\phi(t))\frac{d}{dt}\phi(t)$$ Notice that if ${\displaystyle \psi(t)}$and ${\displaystyle \ph...
2,898,944
I have studied *Advanced Calculus* by Fitzpatrick which discusses the so called the Second Fundamental Theorem (Differentiating Integrals) but it is when the upper or lower limits of integral is a function of $x$ and differentiation is on $x$. But differentiation of the type in the title is not discussed at all and is ...
2018/08/29
[ "https://math.stackexchange.com/questions/2898944", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
For a decently behaving $\frac{\partial}{\partial x}f(x,t)$ one has $f(x,t)=f(x\_0,t)+\int\_{x\_0}^x\frac{\partial}{\partial y}f(y,t)\ dy\ $ and therefore $$\int\_a^b f(x,t) \ dt=\int\_a^b f(x\_0,t) \ dt+\int\_a^b\int\_{x\_0}^x\frac{\partial}{\partial y}f(y,t)\ dy\ dt=$$ $$=\int\_a^b f(x\_0,t) \ dt + \int\_{x\_0}^x\int...
Recall [Leibniz's integral rule](http://mathworld.wolfram.com/LeibnizIntegralRule.html) $$\frac{d}{dt}\int\_{\phi(t)}^{\psi(t)} f(t,s) ds = \int\_{\phi(t)}^{\psi(t)} \frac{d}{dt}f(t,s) ds+f(t,\psi(t))\frac{d}{dt}\psi(t) -f(t,\phi(t))\frac{d}{dt}\phi(t)$$ Notice that if ${\displaystyle \psi(t)}$and ${\displaystyle \ph...
2,898,944
I have studied *Advanced Calculus* by Fitzpatrick which discusses the so called the Second Fundamental Theorem (Differentiating Integrals) but it is when the upper or lower limits of integral is a function of $x$ and differentiation is on $x$. But differentiation of the type in the title is not discussed at all and is ...
2018/08/29
[ "https://math.stackexchange.com/questions/2898944", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
A proof would use some "limit theorem" to interchange integral and limit. Probably in a course with only Riemann integration we would use uniform convergence for that. But in a course with Lebesgue integration we could use a monotone convergence or dominated convergence argument. Here we mark with $\overset{\*}{=}$ whe...
"Fundamental Theorem (Differentiating Integrals) but it is when the upper or lower limits of integral is a function of x and differentiation is on x" might not count as a proof but just an observation I thought might be useful, when you mentioned that the limits of the integral are a function of x, your limits in thi...
2,898,944
I have studied *Advanced Calculus* by Fitzpatrick which discusses the so called the Second Fundamental Theorem (Differentiating Integrals) but it is when the upper or lower limits of integral is a function of $x$ and differentiation is on $x$. But differentiation of the type in the title is not discussed at all and is ...
2018/08/29
[ "https://math.stackexchange.com/questions/2898944", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
For a decently behaving $\frac{\partial}{\partial x}f(x,t)$ one has $f(x,t)=f(x\_0,t)+\int\_{x\_0}^x\frac{\partial}{\partial y}f(y,t)\ dy\ $ and therefore $$\int\_a^b f(x,t) \ dt=\int\_a^b f(x\_0,t) \ dt+\int\_a^b\int\_{x\_0}^x\frac{\partial}{\partial y}f(y,t)\ dy\ dt=$$ $$=\int\_a^b f(x\_0,t) \ dt + \int\_{x\_0}^x\int...
"Fundamental Theorem (Differentiating Integrals) but it is when the upper or lower limits of integral is a function of x and differentiation is on x" might not count as a proof but just an observation I thought might be useful, when you mentioned that the limits of the integral are a function of x, your limits in thi...
2,898,944
I have studied *Advanced Calculus* by Fitzpatrick which discusses the so called the Second Fundamental Theorem (Differentiating Integrals) but it is when the upper or lower limits of integral is a function of $x$ and differentiation is on $x$. But differentiation of the type in the title is not discussed at all and is ...
2018/08/29
[ "https://math.stackexchange.com/questions/2898944", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
For a decently behaving $\frac{\partial}{\partial x}f(x,t)$ one has $f(x,t)=f(x\_0,t)+\int\_{x\_0}^x\frac{\partial}{\partial y}f(y,t)\ dy\ $ and therefore $$\int\_a^b f(x,t) \ dt=\int\_a^b f(x\_0,t) \ dt+\int\_a^b\int\_{x\_0}^x\frac{\partial}{\partial y}f(y,t)\ dy\ dt=$$ $$=\int\_a^b f(x\_0,t) \ dt + \int\_{x\_0}^x\int...
A proof would use some "limit theorem" to interchange integral and limit. Probably in a course with only Riemann integration we would use uniform convergence for that. But in a course with Lebesgue integration we could use a monotone convergence or dominated convergence argument. Here we mark with $\overset{\*}{=}$ whe...
18,825,529
I have an autoscroll feature in my app. When it's activated, my code disables textView scroll and changes contentOffset using `CADisplayLink`. Works fine in earlier versions of iOS, but in 7th text appears cropped. While discovered further I've found that `contentSize` being changed some time after I disable scroll o...
2013/09/16
[ "https://Stackoverflow.com/questions/18825529", "https://Stackoverflow.com", "https://Stackoverflow.com/users/140592/" ]
If your text is cropped in the bottom while scrollEnabled is NO: ``` self.textContainerInset = UIEdgeInsetsMake(0.0f, 0.0f, -20.0f, 0.0f); ```
Doesn't exactly solve the issue, but as a work around, you can allowing scrolling to be enabled, but set UserInteractionEnabled to NO. ``` [_textView setScrollEnabled:YES]; [_textView setUserInteractionEnabled:NO]; ```
36,034,322
I have some big arrays given by MATLAB to C++ (therefore I need to take them as they are) that needs casting and permuting (row-mayor, column mayor issues). The array, `imgaux` is double type has size `size_proj[0]*size_proj[1]*size_proj[2]` and needs to be casted to float, changing some locations of values. A minimal...
2016/03/16
[ "https://Stackoverflow.com/questions/36034322", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1485872/" ]
Ok, let's unravel your loop a little bit by precalculating things ASAP: ``` int max0 = size_proj[0]; int max1 = size_proj[1]; int max2 = size_proj[2]; for (int k = 0; k < max0; k++) { int kOffset1 = k*max1; int kOffset2 = k; for (int i = 0; i < max1; i++) { int iOffset1 = i; int iOffs...
In terms of the algorithm you're using, I think you're always going to end up with three nested loops. Two things to think about: * In your innermost loop, there's some values that you calculate every time, which don't change every iteration. The compiler may cache them, but maybe not, so try moving them to the highe...
36,034,322
I have some big arrays given by MATLAB to C++ (therefore I need to take them as they are) that needs casting and permuting (row-mayor, column mayor issues). The array, `imgaux` is double type has size `size_proj[0]*size_proj[1]*size_proj[2]` and needs to be casted to float, changing some locations of values. A minimal...
2016/03/16
[ "https://Stackoverflow.com/questions/36034322", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1485872/" ]
Ok, let's unravel your loop a little bit by precalculating things ASAP: ``` int max0 = size_proj[0]; int max1 = size_proj[1]; int max2 = size_proj[2]; for (int k = 0; k < max0; k++) { int kOffset1 = k*max1; int kOffset2 = k; for (int i = 0; i < max1; i++) { int iOffset1 = i; int iOffs...
The problem in this example is cache locality. Looking at the assignment, the fastest-changing index is `j` but this has the largest effect on the address of the write in the target array: ``` img[i + k*size_proj[1] + j*size_proj[0] * size_proj[1]] = ``` Notice that j is multiplied by 2 constants. Every change in j...
12,962,091
I got a pretty simple regular expression I am using ``` %%(products?)%% ``` Now I want it to be able to match both products? and Products?. The obvious answer is to use the CASE\_INSENSITIVE tag when compiling a pattern: ``` Pattern.compile("%%(products?)%%", Pattern.CASE_INSENSITIVE) ``` But on the [documentat...
2012/10/18
[ "https://Stackoverflow.com/questions/12962091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/879485/" ]
Actually, there is a significant difference between the methods. While `Pattern.compile("%%(products?)%%", Pattern.CASE_INSENSITIVE)` might seem less efficient than `Pattern.compile("%%([Pp]roducts?)%%")` at first glance, it's internal functioning is not exactly that of comparing each character with both their lower' ...
Since the case insensitive version is the equivalent of ``` Pattern.compile("%%([Pp][Rr][Oo][Dd][Uu][Cc][Tt][Ss]?)%%") ``` it is pretty clear that you get some kind of performance penalty. So in your case the last version would be slightly more effective (and also more limited). *However*, in this case (and pr...
28,226,573
Currently if I have this: ``` <div> some dynamic data </div> ``` I am using ``` <div> <% Response.Write(get.SomeString()); %> </div> ``` Obviously this works fine, but there definitely seems like there should be a shorthand for this.
2015/01/29
[ "https://Stackoverflow.com/questions/28226573", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4394748/" ]
You're looking for `<%: get.SomeString() %>`
The basic syntax is documented on [MSDN](https://msdn.microsoft.com/en-us/library/k6xeyd4z(v=vs.100).aspx): > > Code render blocks define inline code or inline expressions that execute when the page is rendered. There are two styles of code render blocks: inline code and inline expressions. Use inline code to define ...
395,904
I would like to know how I can copy the following lemma. [![enter image description here](https://i.stack.imgur.com/g6xVk.jpg)](https://i.stack.imgur.com/g6xVk.jpg) I tried the following code ``` \begin{lemma} On any $t-$manifold there exist $\rho \in \mathcal{C}^{\infty}(X)$ such that \begin{multline}...
2017/10/12
[ "https://tex.stackexchange.com/questions/395904", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/117162/" ]
Labelling an equation in the middle across a number of lines can be achieved using an `array`/`tabular` structure, or `gathered`: [![enter image description here](https://i.stack.imgur.com/QKkpm.png)](https://i.stack.imgur.com/QKkpm.png) ``` \documentclass[leqno]{report} \usepackage{amsthm,amsmath} \newtheorem{lemma...
Just for fun. BTW, `centertags` was not used here. I just threw it in as a reminder. [![demo](https://i.stack.imgur.com/4wLRZ.png)](https://i.stack.imgur.com/4wLRZ.png) ``` \documentclass{article} \usepackage[leqno,centertags]{amsmath} \newtheorem{lemma}{Lemma} \begin{document} \begin{lemma} On any $t-$manifold t...
395,904
I would like to know how I can copy the following lemma. [![enter image description here](https://i.stack.imgur.com/g6xVk.jpg)](https://i.stack.imgur.com/g6xVk.jpg) I tried the following code ``` \begin{lemma} On any $t-$manifold there exist $\rho \in \mathcal{C}^{\infty}(X)$ such that \begin{multline}...
2017/10/12
[ "https://tex.stackexchange.com/questions/395904", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/117162/" ]
Labelling an equation in the middle across a number of lines can be achieved using an `array`/`tabular` structure, or `gathered`: [![enter image description here](https://i.stack.imgur.com/QKkpm.png)](https://i.stack.imgur.com/QKkpm.png) ``` \documentclass[leqno]{report} \usepackage{amsthm,amsmath} \newtheorem{lemma...
A simple way of achieve a Lemma as I understood you want, could be this one: ``` \documentclass[leqno]{article} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{ntheorem} \newtheorem{lemma}{Lemma} \begin{document} \begin{lemma} On any $t-$manifold there exist $\rho \in \mathcal{C}^{\infty}(X)$ s...
395,904
I would like to know how I can copy the following lemma. [![enter image description here](https://i.stack.imgur.com/g6xVk.jpg)](https://i.stack.imgur.com/g6xVk.jpg) I tried the following code ``` \begin{lemma} On any $t-$manifold there exist $\rho \in \mathcal{C}^{\infty}(X)$ such that \begin{multline}...
2017/10/12
[ "https://tex.stackexchange.com/questions/395904", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/117162/" ]
Labelling an equation in the middle across a number of lines can be achieved using an `array`/`tabular` structure, or `gathered`: [![enter image description here](https://i.stack.imgur.com/QKkpm.png)](https://i.stack.imgur.com/QKkpm.png) ``` \documentclass[leqno]{report} \usepackage{amsthm,amsmath} \newtheorem{lemma...
I propose this layout with `alignat`: ``` \documentclass{book} \usepackage[leqno]{mathtools} \usepackage[amsmath, thmmarks]{ntheorem} \theoremheaderfont{\scshape} \theoremseparator{. } \theorembodyfont{\itshape} \newtheorem{lemma}{Lemma}[section] \begin{document} \setcounter{chapter}{1} \setcounter{section}{6} \setco...
395,904
I would like to know how I can copy the following lemma. [![enter image description here](https://i.stack.imgur.com/g6xVk.jpg)](https://i.stack.imgur.com/g6xVk.jpg) I tried the following code ``` \begin{lemma} On any $t-$manifold there exist $\rho \in \mathcal{C}^{\infty}(X)$ such that \begin{multline}...
2017/10/12
[ "https://tex.stackexchange.com/questions/395904", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/117162/" ]
Just for fun. BTW, `centertags` was not used here. I just threw it in as a reminder. [![demo](https://i.stack.imgur.com/4wLRZ.png)](https://i.stack.imgur.com/4wLRZ.png) ``` \documentclass{article} \usepackage[leqno,centertags]{amsmath} \newtheorem{lemma}{Lemma} \begin{document} \begin{lemma} On any $t-$manifold t...
A simple way of achieve a Lemma as I understood you want, could be this one: ``` \documentclass[leqno]{article} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{ntheorem} \newtheorem{lemma}{Lemma} \begin{document} \begin{lemma} On any $t-$manifold there exist $\rho \in \mathcal{C}^{\infty}(X)$ s...
395,904
I would like to know how I can copy the following lemma. [![enter image description here](https://i.stack.imgur.com/g6xVk.jpg)](https://i.stack.imgur.com/g6xVk.jpg) I tried the following code ``` \begin{lemma} On any $t-$manifold there exist $\rho \in \mathcal{C}^{\infty}(X)$ such that \begin{multline}...
2017/10/12
[ "https://tex.stackexchange.com/questions/395904", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/117162/" ]
I propose this layout with `alignat`: ``` \documentclass{book} \usepackage[leqno]{mathtools} \usepackage[amsmath, thmmarks]{ntheorem} \theoremheaderfont{\scshape} \theoremseparator{. } \theorembodyfont{\itshape} \newtheorem{lemma}{Lemma}[section] \begin{document} \setcounter{chapter}{1} \setcounter{section}{6} \setco...
A simple way of achieve a Lemma as I understood you want, could be this one: ``` \documentclass[leqno]{article} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{ntheorem} \newtheorem{lemma}{Lemma} \begin{document} \begin{lemma} On any $t-$manifold there exist $\rho \in \mathcal{C}^{\infty}(X)$ s...
65,050,991
Getting error: incompatible types: int cannot be converted to T. I want to build a queue using linked list that can store items of different data types. Please suggest ways on how can i pass values belonging to different data types into the generic function add(). ``` public void main(String args[]) { MyQueue<T> q...
2020/11/28
[ "https://Stackoverflow.com/questions/65050991", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14040181/" ]
`T` is a placeholder for a Type, but you can't declare `T` like this since `T` must be a known type. You want something like this. Here `T` is a known type which is passed to `QueueNode` and `MyQueue`. ``` package com.company; import java.util.ArrayList; import java.util.List; class QueueNode<T> { private T node...
You should change de `T` for `Object`. This way you can place whatever data type you want and then you can use a foreach, for example: ``` public static void main(String args[]) { Queue<Object> queues=new LinkedList<>(); queues.add(10); queues.add("Hello"); for(Object queue:queues){ System.out...
6,321,887
I have an unusual need. I have five input checkboxes that look like this: ``` <input class="abc" id="Response[0]" name="Response[0]" type="checkbox" /> <input class="abc" id="Response[1]" name="Response[1]" type="checkbox" /> <input class="abc" id="Response[2]" name="Response[2]" type="checkbox" /> <input class="abc" ...
2011/06/12
[ "https://Stackoverflow.com/questions/6321887", "https://Stackoverflow.com", "https://Stackoverflow.com/users/794734/" ]
Yes, this isn't hard to do with [`change`](http://api.jquery.com/change). I'm going to assume that you don't mind if more than one of the checkboxes is checked, as long as at least one is... ``` $('input.abc').change(function() { if ($('input.abc:checked').length) { $('#yourButton').prop('disabled', false)...
There are [several ways to check if a checkbox is checked](http://jquery-howto.blogspot.com/2008/12/how-to-check-if-checkbox-is-checked.html). Here's one: ``` $(':checkbox').click(function() { if ($(this).is(':checked')) { // Do stuff with button. } }); ```
6,321,887
I have an unusual need. I have five input checkboxes that look like this: ``` <input class="abc" id="Response[0]" name="Response[0]" type="checkbox" /> <input class="abc" id="Response[1]" name="Response[1]" type="checkbox" /> <input class="abc" id="Response[2]" name="Response[2]" type="checkbox" /> <input class="abc" ...
2011/06/12
[ "https://Stackoverflow.com/questions/6321887", "https://Stackoverflow.com", "https://Stackoverflow.com/users/794734/" ]
Yes, this isn't hard to do with [`change`](http://api.jquery.com/change). I'm going to assume that you don't mind if more than one of the checkboxes is checked, as long as at least one is... ``` $('input.abc').change(function() { if ($('input.abc:checked').length) { $('#yourButton').prop('disabled', false)...
You could subscribe for the click event of all those checkboxes and once the user clicks on one of them enable the button: ``` $(':checkbox[id^="Response"]').click(function() { $('#id_of_button').removeAttr('disabled'); }); ```
6,872,223
We have branches origin and develop. The initial state of master was tagged at `tag_ABC`. We have few changes made to the develop branch and pushed to origin. Then we have accidentally merged develop into master and pushed to origin. Now we would like to revert master to the checkpoint `tag_ABC`. How can we do that...
2011/07/29
[ "https://Stackoverflow.com/questions/6872223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/765581/" ]
You can do ``` git checkout master git reset --hard tag_ABC git push --force origin master ``` Please note that this will overwrite existing history in the upstream repo and may cause problems for other developers who have this repo checked out. As per [Luke Wenke's comment](https://stackoverflow.com/questions/6872...
This isn't a direct answer to the question but this page comes back when searching for ways to revert a branch's code to a tag release. Another way is to create a diff between the current state of the branch and the tag you want to revert to and then apply that to the branch. This keeps the version history correct and...
45,804,644
I'm trying to implement some services on my Angular v1.6.4 app. However I get this error [![my error](https://i.stack.imgur.com/jSUA7.png)](https://i.stack.imgur.com/jSUA7.png) when I import the service in my index.html This is the content of my service ``` angular.module('myApp', []) .service('SessionService', funct...
2017/08/21
[ "https://Stackoverflow.com/questions/45804644", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5847417/" ]
I would expect the syntax to be like this: ``` declare @sql varchar(1000) = ''; set @sql = ; select (case when col like ''123%'' then ''123'' when col =''234'' then ''234'' else 'Other' end) as col from . . . '; exec sp_executesql @sql; ``` Your code is referencing `col`, which n...
Are you trying to do this: ``` declare @sql varchar(1000)='' set @sql= 'select case when col like ''123%'' then ''123'' when col=''234'' then ''234'' else ''Other'' end as col from table' EXEC (@sql) ```
21,553,690
i am trying to check the if the element clicked. if element is already clicked, skip this step or else do this step.for this i am using jquery but i am not able get how can i do it... code: ``` $('.f').click(function(evt) { $('#ex4').trigger('click'); var idx = $(...
2014/02/04
[ "https://Stackoverflow.com/questions/21553690", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2590090/" ]
JQueryUI might be an option here, could just be for reference. [JQuery UI autocomplete](http://jqueryui.com/autocomplete/)
This seems quite similar to your needs <http://harvesthq.github.io/chosen/>
21,553,690
i am trying to check the if the element clicked. if element is already clicked, skip this step or else do this step.for this i am using jquery but i am not able get how can i do it... code: ``` $('.f').click(function(evt) { $('#ex4').trigger('click'); var idx = $(...
2014/02/04
[ "https://Stackoverflow.com/questions/21553690", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2590090/" ]
I think you are searching for <http://podio.github.io/jquery-mentions-input/> Or <https://github.com/jakiestfu/Mention.js/> Another one <http://www.emposha.com/demo/fcbkcomplete_2/>
This seems quite similar to your needs <http://harvesthq.github.io/chosen/>
21,553,690
i am trying to check the if the element clicked. if element is already clicked, skip this step or else do this step.for this i am using jquery but i am not able get how can i do it... code: ``` $('.f').click(function(evt) { $('#ex4').trigger('click'); var idx = $(...
2014/02/04
[ "https://Stackoverflow.com/questions/21553690", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2590090/" ]
Writing this in **2021** Many of the suggested libraries are not actively developed/supported, and haven't been touched in many years. There is this library called tribute which might be of good help: Working Example: <https://zurb.github.io/tribute/example/> Github Repo: <https://github.com/zurb/tribute>
This seems quite similar to your needs <http://harvesthq.github.io/chosen/>
21,553,690
i am trying to check the if the element clicked. if element is already clicked, skip this step or else do this step.for this i am using jquery but i am not able get how can i do it... code: ``` $('.f').click(function(evt) { $('#ex4').trigger('click'); var idx = $(...
2014/02/04
[ "https://Stackoverflow.com/questions/21553690", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2590090/" ]
I think you are searching for <http://podio.github.io/jquery-mentions-input/> Or <https://github.com/jakiestfu/Mention.js/> Another one <http://www.emposha.com/demo/fcbkcomplete_2/>
JQueryUI might be an option here, could just be for reference. [JQuery UI autocomplete](http://jqueryui.com/autocomplete/)
21,553,690
i am trying to check the if the element clicked. if element is already clicked, skip this step or else do this step.for this i am using jquery but i am not able get how can i do it... code: ``` $('.f').click(function(evt) { $('#ex4').trigger('click'); var idx = $(...
2014/02/04
[ "https://Stackoverflow.com/questions/21553690", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2590090/" ]
JQueryUI might be an option here, could just be for reference. [JQuery UI autocomplete](http://jqueryui.com/autocomplete/)
After playing with all of these options, I have to say that at.js is far and away the better option. Both the podio library and the mentions.js library mentioned in the selected answer are hardly supported any more and full of issues. At.js has over 4000 stars on github, is actively developed, and is just a better piec...
21,553,690
i am trying to check the if the element clicked. if element is already clicked, skip this step or else do this step.for this i am using jquery but i am not able get how can i do it... code: ``` $('.f').click(function(evt) { $('#ex4').trigger('click'); var idx = $(...
2014/02/04
[ "https://Stackoverflow.com/questions/21553690", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2590090/" ]
Writing this in **2021** Many of the suggested libraries are not actively developed/supported, and haven't been touched in many years. There is this library called tribute which might be of good help: Working Example: <https://zurb.github.io/tribute/example/> Github Repo: <https://github.com/zurb/tribute>
JQueryUI might be an option here, could just be for reference. [JQuery UI autocomplete](http://jqueryui.com/autocomplete/)
21,553,690
i am trying to check the if the element clicked. if element is already clicked, skip this step or else do this step.for this i am using jquery but i am not able get how can i do it... code: ``` $('.f').click(function(evt) { $('#ex4').trigger('click'); var idx = $(...
2014/02/04
[ "https://Stackoverflow.com/questions/21553690", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2590090/" ]
I think you are searching for <http://podio.github.io/jquery-mentions-input/> Or <https://github.com/jakiestfu/Mention.js/> Another one <http://www.emposha.com/demo/fcbkcomplete_2/>
After playing with all of these options, I have to say that at.js is far and away the better option. Both the podio library and the mentions.js library mentioned in the selected answer are hardly supported any more and full of issues. At.js has over 4000 stars on github, is actively developed, and is just a better piec...
21,553,690
i am trying to check the if the element clicked. if element is already clicked, skip this step or else do this step.for this i am using jquery but i am not able get how can i do it... code: ``` $('.f').click(function(evt) { $('#ex4').trigger('click'); var idx = $(...
2014/02/04
[ "https://Stackoverflow.com/questions/21553690", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2590090/" ]
I think you are searching for <http://podio.github.io/jquery-mentions-input/> Or <https://github.com/jakiestfu/Mention.js/> Another one <http://www.emposha.com/demo/fcbkcomplete_2/>
Writing this in **2021** Many of the suggested libraries are not actively developed/supported, and haven't been touched in many years. There is this library called tribute which might be of good help: Working Example: <https://zurb.github.io/tribute/example/> Github Repo: <https://github.com/zurb/tribute>
21,553,690
i am trying to check the if the element clicked. if element is already clicked, skip this step or else do this step.for this i am using jquery but i am not able get how can i do it... code: ``` $('.f').click(function(evt) { $('#ex4').trigger('click'); var idx = $(...
2014/02/04
[ "https://Stackoverflow.com/questions/21553690", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2590090/" ]
Writing this in **2021** Many of the suggested libraries are not actively developed/supported, and haven't been touched in many years. There is this library called tribute which might be of good help: Working Example: <https://zurb.github.io/tribute/example/> Github Repo: <https://github.com/zurb/tribute>
After playing with all of these options, I have to say that at.js is far and away the better option. Both the podio library and the mentions.js library mentioned in the selected answer are hardly supported any more and full of issues. At.js has over 4000 stars on github, is actively developed, and is just a better piec...
19,692,516
This worked in *VS2010* and *VS2012*. But in *VS2013* application (by pressing "Run" or *F5*) is just starts with my user's rights and cannot access some resources (I'm using HttpListener). ``` <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> <security> <requestedPrivileges xmlns="urn:schemas-microsoft-com:a...
2013/10/30
[ "https://Stackoverflow.com/questions/19692516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1259074/" ]
You need to disable the hosting process option to get the VS restart prompt. Project + Properties, Debug tab, untick the "Enable the Visual Studio hosting process" checkbox. It can be easier to just start VS elevated right away. Right-click the shortcut, Run as Administrator. Not entirely sure if this is a bug or a fe...
I'm hoping this will get fixed soon™ In the mean time you can use handy shortcuts for restarting VS in admin mode, look up "Visual Studio Restart" in the extension gallery. Edit: Only way I see you can achieve the old behavior is to turn off VS hosting process as it is this process that for some reason "eats" the ele...
19,692,516
This worked in *VS2010* and *VS2012*. But in *VS2013* application (by pressing "Run" or *F5*) is just starts with my user's rights and cannot access some resources (I'm using HttpListener). ``` <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> <security> <requestedPrivileges xmlns="urn:schemas-microsoft-com:a...
2013/10/30
[ "https://Stackoverflow.com/questions/19692516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1259074/" ]
What I ended up doing is I run the project without debugging `CRTL+F5` . The it gives me the same prompt that Visual Studio 2010 gives you.
I'm hoping this will get fixed soon™ In the mean time you can use handy shortcuts for restarting VS in admin mode, look up "Visual Studio Restart" in the extension gallery. Edit: Only way I see you can achieve the old behavior is to turn off VS hosting process as it is this process that for some reason "eats" the ele...
19,692,516
This worked in *VS2010* and *VS2012*. But in *VS2013* application (by pressing "Run" or *F5*) is just starts with my user's rights and cannot access some resources (I'm using HttpListener). ``` <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> <security> <requestedPrivileges xmlns="urn:schemas-microsoft-com:a...
2013/10/30
[ "https://Stackoverflow.com/questions/19692516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1259074/" ]
You need to disable the hosting process option to get the VS restart prompt. Project + Properties, Debug tab, untick the "Enable the Visual Studio hosting process" checkbox. It can be easier to just start VS elevated right away. Right-click the shortcut, Run as Administrator. Not entirely sure if this is a bug or a fe...
What I ended up doing is I run the project without debugging `CRTL+F5` . The it gives me the same prompt that Visual Studio 2010 gives you.
45,214,163
I am starting out Android development by building a simple quiz app with only two buttons, True and False. The app displays a Toast saying whether the answer is correct or incorrect. What I am trying to do is disable both the buttons as soon as either is clicked/tapped, then re-enable them after the Toast has been d...
2017/07/20
[ "https://Stackoverflow.com/questions/45214163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4779809/" ]
Enable with a Handler like this after 1500 ms. ``` mTrueButton.setEnabled(false); mFalseButton.setEnabled(false); checkAnswer(false); //Display the appropriate Toast new Handler().postDelayed(new Runnable() { @Override public void run() { mTrueButton.setEnabled(true); mFalseButton.setEnabled(true); ...
Try this ``` mTrueButton.setVisibility(View.INVISIBLE); mTrueButton.setVisibility(View.VISIBLE); ```
45,214,163
I am starting out Android development by building a simple quiz app with only two buttons, True and False. The app displays a Toast saying whether the answer is correct or incorrect. What I am trying to do is disable both the buttons as soon as either is clicked/tapped, then re-enable them after the Toast has been d...
2017/07/20
[ "https://Stackoverflow.com/questions/45214163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4779809/" ]
Enable with a Handler like this after 1500 ms. ``` mTrueButton.setEnabled(false); mFalseButton.setEnabled(false); checkAnswer(false); //Display the appropriate Toast new Handler().postDelayed(new Runnable() { @Override public void run() { mTrueButton.setEnabled(true); mFalseButton.setEnabled(true); ...
Use ``` mTrueButton.setClickable(false); ``` instead of ``` mTrueButton.setEnable(false); ```
45,214,163
I am starting out Android development by building a simple quiz app with only two buttons, True and False. The app displays a Toast saying whether the answer is correct or incorrect. What I am trying to do is disable both the buttons as soon as either is clicked/tapped, then re-enable them after the Toast has been d...
2017/07/20
[ "https://Stackoverflow.com/questions/45214163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4779809/" ]
Enable with a Handler like this after 1500 ms. ``` mTrueButton.setEnabled(false); mFalseButton.setEnabled(false); checkAnswer(false); //Display the appropriate Toast new Handler().postDelayed(new Runnable() { @Override public void run() { mTrueButton.setEnabled(true); mFalseButton.setEnabled(true); ...
``` private static final ScheduledExecutorService worker = Executors.newSingleThreadScheduledExecutor(); checkAnswer(false); Runnable task = new Runnable() { public void run() { mTrueButton.setEnabled(true); mFalseButton.setEnabled(true); mFalseButton.setEnabled(true); ...
45,214,163
I am starting out Android development by building a simple quiz app with only two buttons, True and False. The app displays a Toast saying whether the answer is correct or incorrect. What I am trying to do is disable both the buttons as soon as either is clicked/tapped, then re-enable them after the Toast has been d...
2017/07/20
[ "https://Stackoverflow.com/questions/45214163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4779809/" ]
Enable with a Handler like this after 1500 ms. ``` mTrueButton.setEnabled(false); mFalseButton.setEnabled(false); checkAnswer(false); //Display the appropriate Toast new Handler().postDelayed(new Runnable() { @Override public void run() { mTrueButton.setEnabled(true); mFalseButton.setEnabled(true); ...
try this ``` mFalseButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mTrueButton.setEnabled(false); mFalseButton.setEnabled(false); checkAnswer(false); //Display the appropriate Toast new Handler().postDelayed(new Runnable() { ...
45,214,163
I am starting out Android development by building a simple quiz app with only two buttons, True and False. The app displays a Toast saying whether the answer is correct or incorrect. What I am trying to do is disable both the buttons as soon as either is clicked/tapped, then re-enable them after the Toast has been d...
2017/07/20
[ "https://Stackoverflow.com/questions/45214163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4779809/" ]
Use ``` mTrueButton.setClickable(false); ``` instead of ``` mTrueButton.setEnable(false); ```
Try this ``` mTrueButton.setVisibility(View.INVISIBLE); mTrueButton.setVisibility(View.VISIBLE); ```
45,214,163
I am starting out Android development by building a simple quiz app with only two buttons, True and False. The app displays a Toast saying whether the answer is correct or incorrect. What I am trying to do is disable both the buttons as soon as either is clicked/tapped, then re-enable them after the Toast has been d...
2017/07/20
[ "https://Stackoverflow.com/questions/45214163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4779809/" ]
Use ``` mTrueButton.setClickable(false); ``` instead of ``` mTrueButton.setEnable(false); ```
``` private static final ScheduledExecutorService worker = Executors.newSingleThreadScheduledExecutor(); checkAnswer(false); Runnable task = new Runnable() { public void run() { mTrueButton.setEnabled(true); mFalseButton.setEnabled(true); mFalseButton.setEnabled(true); ...
45,214,163
I am starting out Android development by building a simple quiz app with only two buttons, True and False. The app displays a Toast saying whether the answer is correct or incorrect. What I am trying to do is disable both the buttons as soon as either is clicked/tapped, then re-enable them after the Toast has been d...
2017/07/20
[ "https://Stackoverflow.com/questions/45214163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4779809/" ]
Use ``` mTrueButton.setClickable(false); ``` instead of ``` mTrueButton.setEnable(false); ```
try this ``` mFalseButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mTrueButton.setEnabled(false); mFalseButton.setEnabled(false); checkAnswer(false); //Display the appropriate Toast new Handler().postDelayed(new Runnable() { ...
36,953,204
My aim is to reload a page at a certain interval and run a function. I have read about storing the function in my localStorage and calling it when the page reloads via body onload. I wish to run this code on my console on a page so I don't think the `<body>` works. Correct me if I am wrong. A good example would be, c...
2016/04/30
[ "https://Stackoverflow.com/questions/36953204", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5976667/" ]
It's because they do different things. An annotation adds metadata to a piece of code that can later be read and used by other code. While a decoration decorates some code with some other code. Take the case of logging. A logging annotation can be retrieved at runtime by the logger (maybe via reflection) and loggin...
Annotations in Java are **metadata** attached to class, methods etc. However decorators in TypeScript are **functions** which can add metadata but can also add some **behavior** like logging. More information: <https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Decorators.md>
62,585,416
I have a very large "work request" data set that I need to clean up. The data set has some consistent elements, a series of numbers that are a set length this changes about about half way through the data set but the change is predictable. One issue with the data set is that there are multiple deliminators in places, s...
2020/06/25
[ "https://Stackoverflow.com/questions/62585416", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2647327/" ]
Here's a function using Regular Expressions that returns an array of the results. ``` Option Explicit 'Set reference to Microsoft VBScript Regular Expressions 5.5 ' or use late binding Function Splitter(S As String) As String() Dim re As RegExp, MC As MatchCollection Const sPat As String = "^(?:\D*?(?=R?\d)(R...
Try this code ``` Private Sub UserForm_Click() Dim Sp() As String: Sp = Split(Strip("2590082.A/4900 REPLACE DXAC"), "|") Sheet1.Range("B2", Sheet1.Cells(RowIndex:=2, ColumnIndex:=UBound(Sp) + 2)).Value = Sp End Sub Function Strip(s As String) As String If s = "" Then Exit Function Dim tmp As String ...
62,585,416
I have a very large "work request" data set that I need to clean up. The data set has some consistent elements, a series of numbers that are a set length this changes about about half way through the data set but the change is predictable. One issue with the data set is that there are multiple deliminators in places, s...
2020/06/25
[ "https://Stackoverflow.com/questions/62585416", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2647327/" ]
Here's a function using Regular Expressions that returns an array of the results. ``` Option Explicit 'Set reference to Microsoft VBScript Regular Expressions 5.5 ' or use late binding Function Splitter(S As String) As String() Dim re As RegExp, MC As MatchCollection Const sPat As String = "^(?:\D*?(?=R?\d)(R...
Here's an example using a regular expression. ``` Sub WorkRequests() Dim re As Object, allMatches, m, rv, sep, c As Range Set re = CreateObject("VBScript.RegExp") re.Pattern = "(((R00)?\d{7})[\.]?([A-Z])?)" re.ignorecase = True re.MultiLine = True re.Global = True For Each c In Range("B5...
1,502,868
I am looking for all square matrices $A$ of order 2 and 3 that satisfy $A^2 = - I$, $I$ being the identity matrix of the corresponding order.
2015/10/29
[ "https://math.stackexchange.com/questions/1502868", "https://math.stackexchange.com", "https://math.stackexchange.com/users/130354/" ]
There is no $3\times 3$ matrix $A$ with real entries that satisfies the equation $A^2=-I$. Suppose there were. We take determinants, to get $$\left\lvert A\right\rvert^2=\left\lvert A^2\right\rvert=\left\lvert -I\right\rvert=-1$$ But $\left\lvert A\right\rvert$ is real, and no real number squares to $-1$. In the $2\ti...
There are essentially infinite solutions that satisfy A^2 = -I for 2x2 and 3x3 matrices. They can be solved in similar manners of creating systems of equations and then solving those to produce general solutions. I will solve for 2x2 matrices. For standard square matrices we have a matrix A such that A =\begin{bmatr...
1,502,868
I am looking for all square matrices $A$ of order 2 and 3 that satisfy $A^2 = - I$, $I$ being the identity matrix of the corresponding order.
2015/10/29
[ "https://math.stackexchange.com/questions/1502868", "https://math.stackexchange.com", "https://math.stackexchange.com/users/130354/" ]
There is no $3\times 3$ matrix $A$ with real entries that satisfies the equation $A^2=-I$. Suppose there were. We take determinants, to get $$\left\lvert A\right\rvert^2=\left\lvert A^2\right\rvert=\left\lvert -I\right\rvert=-1$$ But $\left\lvert A\right\rvert$ is real, and no real number squares to $-1$. In the $2\ti...
@vadmin answers your question for $3\times3$ matrices. For $2\times2$ matrices, either: * There is at least one real eigenvalue. So there is a subspace of dimension at least $1$, where $A$ acts as scaling by $\lambda$. So $A^2$ acts as scaling by $\lambda^2\geq0$. This is not compatible with $A^2$ being $-I$, since $-...
1,502,868
I am looking for all square matrices $A$ of order 2 and 3 that satisfy $A^2 = - I$, $I$ being the identity matrix of the corresponding order.
2015/10/29
[ "https://math.stackexchange.com/questions/1502868", "https://math.stackexchange.com", "https://math.stackexchange.com/users/130354/" ]
@vadmin answers your question for $3\times3$ matrices. For $2\times2$ matrices, either: * There is at least one real eigenvalue. So there is a subspace of dimension at least $1$, where $A$ acts as scaling by $\lambda$. So $A^2$ acts as scaling by $\lambda^2\geq0$. This is not compatible with $A^2$ being $-I$, since $-...
There are essentially infinite solutions that satisfy A^2 = -I for 2x2 and 3x3 matrices. They can be solved in similar manners of creating systems of equations and then solving those to produce general solutions. I will solve for 2x2 matrices. For standard square matrices we have a matrix A such that A =\begin{bmatr...
47,355,274
I have problem , i want to create TODO app in ReactJS and there is functionality like this: 1. onClick is showing/hidding AddTaskBox (form in div, where you have to write title and describtion ) - I done it. 2. In visable AddTaskBox is button with "x" and I want to use him to delete whole "AddTaskBox" - Can't figur i...
2017/11/17
[ "https://Stackoverflow.com/questions/47355274", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8784531/" ]
Assuming by `AddTaskComponent` you mean `AddTaskBox` you would pass the `toggleHidden` function to `AddTaskBox` `{this.state.isHidden && <AddTaskBox onClose={this.toggleHidden.bind(this)} />}` and then call the function from the child on click `<button onClick={this.props.onClose}> x </button>`
You can pass your `toggleHidden()` function as prop to AddTasktBox component. So your close button in AddTaskBox will be like ``` ... <button onClick={this.props.handleClick}> x </button> ... ``` You can pass it like ``` {this.state.isHidden && <AddTaskBox handleClick={this.toggleHidden.bind(this)} />} ```
429,567
So I've been studying vectors and tensors, and I'm trying to understand metric tensors. As I understand them, besides a vast array of explanations, they provide an invariant distance between vectors regardless of whether their basis has changed. So if you had a set of vectors in say a Cartesian coordinate space, usin...
2013/06/26
[ "https://math.stackexchange.com/questions/429567", "https://math.stackexchange.com", "https://math.stackexchange.com/users/74962/" ]
Suppose $U\subseteq{\bf R}^2$ is some open region and $f:U\to{\bf R}^3$ defines some smooth surface in space. Now let $\gamma:I\to U$ be a path in $U$ that corresponds to a path $f\circ\gamma:I\to{\cal S}=f(U)\subset {\bf R}^3$ on the surface which we denote by $\cal S$ (here $I$ is an open interval in $\bf R$). How do...
@Anon's answer focuses on the distance function, but perhaps one could relate to the question as stated, in the context of the metric tensor. @mathacka: your notation for the metric tensor is highly unusual. Which book are you using? Usually what one writes down is an expression of the sort $ds^2= g\_{11} dx^2 + g\_{2...
15,794,822
I have this really simple fiddle set up, if someone could point out why it's not working I'd really appreciate it, been struggling to figure this out for some time now. Here's the code: ``` $('input[type=file]').change(function () { if ($(this).val()) { alert('This thing works.'); $(this).append(...
2013/04/03
[ "https://Stackoverflow.com/questions/15794822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1072143/" ]
You can't append anything to an `input`, use `.after` or `.replaceWith`. The input is an element that may not contain child elements.
You can't append anything to `input` element
15,794,822
I have this really simple fiddle set up, if someone could point out why it's not working I'd really appreciate it, been struggling to figure this out for some time now. Here's the code: ``` $('input[type=file]').change(function () { if ($(this).val()) { alert('This thing works.'); $(this).append(...
2013/04/03
[ "https://Stackoverflow.com/questions/15794822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1072143/" ]
You can't append anything to an `input`, use `.after` or `.replaceWith`. The input is an element that may not contain child elements.
use `.after()` or `.before()` or `.inserAfter()`: ``` $(this).after('<input type="file" name="test">'); ```
15,794,822
I have this really simple fiddle set up, if someone could point out why it's not working I'd really appreciate it, been struggling to figure this out for some time now. Here's the code: ``` $('input[type=file]').change(function () { if ($(this).val()) { alert('This thing works.'); $(this).append(...
2013/04/03
[ "https://Stackoverflow.com/questions/15794822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1072143/" ]
You can't append anything to `input` element
use `.after()` or `.before()` or `.inserAfter()`: ``` $(this).after('<input type="file" name="test">'); ```
51,838,628
This is a project that user/employee requests for a leave and the admin can see it. models.py ``` from django.db import models from django.contrib.auth.models import User CHOICES = (('1','Earned Leave'),('2','Casual Leave'),('3','Sick Leave'),('4','Paid Leave')) class Leave(models.Model): user = models.ForeignK...
2018/08/14
[ "https://Stackoverflow.com/questions/51838628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10218854/" ]
You can use `array[0:10] = [1] * 10`, you just need to make an array of the size of the slice you are replacing.
I'll give you an example with list: ``` L = [0 for k in range(100)] # List of 0 L[10:20] = [1 for k in range(10)] # Output: L = [0, ..., 0, 1, 1, ..., 1, 0, ..., 0] ``` You need to give a list as well to replace N values.
51,838,628
This is a project that user/employee requests for a leave and the admin can see it. models.py ``` from django.db import models from django.contrib.auth.models import User CHOICES = (('1','Earned Leave'),('2','Casual Leave'),('3','Sick Leave'),('4','Paid Leave')) class Leave(models.Model): user = models.ForeignK...
2018/08/14
[ "https://Stackoverflow.com/questions/51838628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10218854/" ]
Another way is to turn your list into a numpy array, and numpy will [broadcast](https://docs.scipy.org/doc/numpy-1.13.0/user/basics.broadcasting.html) your value to the whole part of the array: ``` import numpy as np a = np.array([100]*100) a[0:10] = 1 print(a) # array([ 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
I'll give you an example with list: ``` L = [0 for k in range(100)] # List of 0 L[10:20] = [1 for k in range(10)] # Output: L = [0, ..., 0, 1, 1, ..., 1, 0, ..., 0] ``` You need to give a list as well to replace N values.
51,838,628
This is a project that user/employee requests for a leave and the admin can see it. models.py ``` from django.db import models from django.contrib.auth.models import User CHOICES = (('1','Earned Leave'),('2','Casual Leave'),('3','Sick Leave'),('4','Paid Leave')) class Leave(models.Model): user = models.ForeignK...
2018/08/14
[ "https://Stackoverflow.com/questions/51838628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10218854/" ]
You can use `array[0:10] = [1] * 10`, you just need to make an array of the size of the slice you are replacing.
the type of operands in both side should be same in this case ``` Array[0:10]=[1]*10 ```
51,838,628
This is a project that user/employee requests for a leave and the admin can see it. models.py ``` from django.db import models from django.contrib.auth.models import User CHOICES = (('1','Earned Leave'),('2','Casual Leave'),('3','Sick Leave'),('4','Paid Leave')) class Leave(models.Model): user = models.ForeignK...
2018/08/14
[ "https://Stackoverflow.com/questions/51838628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10218854/" ]
You can use `array[0:10] = [1] * 10`, you just need to make an array of the size of the slice you are replacing.
Another way is to turn your list into a numpy array, and numpy will [broadcast](https://docs.scipy.org/doc/numpy-1.13.0/user/basics.broadcasting.html) your value to the whole part of the array: ``` import numpy as np a = np.array([100]*100) a[0:10] = 1 print(a) # array([ 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
51,838,628
This is a project that user/employee requests for a leave and the admin can see it. models.py ``` from django.db import models from django.contrib.auth.models import User CHOICES = (('1','Earned Leave'),('2','Casual Leave'),('3','Sick Leave'),('4','Paid Leave')) class Leave(models.Model): user = models.ForeignK...
2018/08/14
[ "https://Stackoverflow.com/questions/51838628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10218854/" ]
You can use `array[0:10] = [1] * 10`, you just need to make an array of the size of the slice you are replacing.
### lists in python are mutable it's not good to write them in the form [100]\*100. You might have problems later when your code gets complicated. I suggest to write it as: ``` array = [100 for _ in range(100)] for i in range(10): array[i] = 1 print(array) output: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 100, 100, 100, 10...
51,838,628
This is a project that user/employee requests for a leave and the admin can see it. models.py ``` from django.db import models from django.contrib.auth.models import User CHOICES = (('1','Earned Leave'),('2','Casual Leave'),('3','Sick Leave'),('4','Paid Leave')) class Leave(models.Model): user = models.ForeignK...
2018/08/14
[ "https://Stackoverflow.com/questions/51838628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10218854/" ]
Another way is to turn your list into a numpy array, and numpy will [broadcast](https://docs.scipy.org/doc/numpy-1.13.0/user/basics.broadcasting.html) your value to the whole part of the array: ``` import numpy as np a = np.array([100]*100) a[0:10] = 1 print(a) # array([ 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
the type of operands in both side should be same in this case ``` Array[0:10]=[1]*10 ```
51,838,628
This is a project that user/employee requests for a leave and the admin can see it. models.py ``` from django.db import models from django.contrib.auth.models import User CHOICES = (('1','Earned Leave'),('2','Casual Leave'),('3','Sick Leave'),('4','Paid Leave')) class Leave(models.Model): user = models.ForeignK...
2018/08/14
[ "https://Stackoverflow.com/questions/51838628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10218854/" ]
Another way is to turn your list into a numpy array, and numpy will [broadcast](https://docs.scipy.org/doc/numpy-1.13.0/user/basics.broadcasting.html) your value to the whole part of the array: ``` import numpy as np a = np.array([100]*100) a[0:10] = 1 print(a) # array([ 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
### lists in python are mutable it's not good to write them in the form [100]\*100. You might have problems later when your code gets complicated. I suggest to write it as: ``` array = [100 for _ in range(100)] for i in range(10): array[i] = 1 print(array) output: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 100, 100, 100, 10...
85,540
I know that TEA has its weaknesses, but is easy to implement. My question is whether it would be suitable for my use case: The main reason for using encryption is not so much secrecy, but authentication and protection against interference. * I have a number (max 20-30) of GPS trackers, which send their location by rad...
2020/10/13
[ "https://crypto.stackexchange.com/questions/85540", "https://crypto.stackexchange.com", "https://crypto.stackexchange.com/users/84181/" ]
> > The main reason for using encryption is not so much secrecy, but authentication and protection against interference. > > > In that case, [what you want is an authenticated encryption scheme](https://crypto.stackexchange.com/questions/12178/why-should-i-use-authenticated-encryption-instead-of-just-encryption). ...
Yes you can use TEA. What you want is to add a MAC, a message authentication code. And you can use TEA as the underlying cipher. You need not encrypt the data if it isn't required, it's even better not to. TEA uses a 64 bit block. You could do CBC-MAC which will add a 64 bit authentication and it won't be cracked in ho...
85,540
I know that TEA has its weaknesses, but is easy to implement. My question is whether it would be suitable for my use case: The main reason for using encryption is not so much secrecy, but authentication and protection against interference. * I have a number (max 20-30) of GPS trackers, which send their location by rad...
2020/10/13
[ "https://crypto.stackexchange.com/questions/85540", "https://crypto.stackexchange.com", "https://crypto.stackexchange.com/users/84181/" ]
> > What I want to avoid from happening is anyone sending fake messages > > > The simplest option for this is * A secret key $K$ in trackers and base station that adversaries ("anyone") can not get at. This is the hard part, and the [original question](https://crypto.stackexchange.com/revisions/85540/3) was short...
Yes you can use TEA. What you want is to add a MAC, a message authentication code. And you can use TEA as the underlying cipher. You need not encrypt the data if it isn't required, it's even better not to. TEA uses a 64 bit block. You could do CBC-MAC which will add a 64 bit authentication and it won't be cracked in ho...
85,540
I know that TEA has its weaknesses, but is easy to implement. My question is whether it would be suitable for my use case: The main reason for using encryption is not so much secrecy, but authentication and protection against interference. * I have a number (max 20-30) of GPS trackers, which send their location by rad...
2020/10/13
[ "https://crypto.stackexchange.com/questions/85540", "https://crypto.stackexchange.com", "https://crypto.stackexchange.com/users/84181/" ]
> > What I want to avoid from happening is anyone sending fake messages > > > The simplest option for this is * A secret key $K$ in trackers and base station that adversaries ("anyone") can not get at. This is the hard part, and the [original question](https://crypto.stackexchange.com/revisions/85540/3) was short...
> > The main reason for using encryption is not so much secrecy, but authentication and protection against interference. > > > In that case, [what you want is an authenticated encryption scheme](https://crypto.stackexchange.com/questions/12178/why-should-i-use-authenticated-encryption-instead-of-just-encryption). ...
42,294
Can gaining weight whilst losing fat mass be a plausible thing to do and if so, how does it work?
2020/06/16
[ "https://fitness.stackexchange.com/questions/42294", "https://fitness.stackexchange.com", "https://fitness.stackexchange.com/users/33451/" ]
> > How does [someone] prepare to do 110 pull ups in a row > > > Start by recognizing this as an extreme goal. I bet the people achieving >75 pull-ups got there by doing gymnastics or bar calisthenics for *years*. Coming even close to this number of pull-ups in one set is such a rare skill that you shouldn't ask a...
You could keep your bodyweight mass down, lose fat if you have any, and do several lat exercises such as landmine rows with t bar, or lat bars, one armed rows, etc. Use an endurance type rep scheme(15-20). Working your forearm strength and grip as well as core and biceps to some degree with additional training. Try add...
42,294
Can gaining weight whilst losing fat mass be a plausible thing to do and if so, how does it work?
2020/06/16
[ "https://fitness.stackexchange.com/questions/42294", "https://fitness.stackexchange.com", "https://fitness.stackexchange.com/users/33451/" ]
You could keep your bodyweight mass down, lose fat if you have any, and do several lat exercises such as landmine rows with t bar, or lat bars, one armed rows, etc. Use an endurance type rep scheme(15-20). Working your forearm strength and grip as well as core and biceps to some degree with additional training. Try add...
Kipping! When I started doing pull-ups I could barely do 2 or 3. One day I strapped myself in to a machine that was designed to lighten my weight. I adjusted the machine so I weighed nothing. Then I did 20 pull-ups. I kept removing counterweights and doing 20 more pull-ups each time. Within an hour my body had learned...
42,294
Can gaining weight whilst losing fat mass be a plausible thing to do and if so, how does it work?
2020/06/16
[ "https://fitness.stackexchange.com/questions/42294", "https://fitness.stackexchange.com", "https://fitness.stackexchange.com/users/33451/" ]
> > How does [someone] prepare to do 110 pull ups in a row > > > Start by recognizing this as an extreme goal. I bet the people achieving >75 pull-ups got there by doing gymnastics or bar calisthenics for *years*. Coming even close to this number of pull-ups in one set is such a rare skill that you shouldn't ask a...
Kipping! When I started doing pull-ups I could barely do 2 or 3. One day I strapped myself in to a machine that was designed to lighten my weight. I adjusted the machine so I weighed nothing. Then I did 20 pull-ups. I kept removing counterweights and doing 20 more pull-ups each time. Within an hour my body had learned...
42,294
Can gaining weight whilst losing fat mass be a plausible thing to do and if so, how does it work?
2020/06/16
[ "https://fitness.stackexchange.com/questions/42294", "https://fitness.stackexchange.com", "https://fitness.stackexchange.com/users/33451/" ]
> > How does [someone] prepare to do 110 pull ups in a row > > > Start by recognizing this as an extreme goal. I bet the people achieving >75 pull-ups got there by doing gymnastics or bar calisthenics for *years*. Coming even close to this number of pull-ups in one set is such a rare skill that you shouldn't ask a...
Don't. If you can do 100 pullups, unless you're doing it to prove a point or show off, training to do 110 is a huge waste of time, because the majority of your time is spent slowly reaching your limit, at which point gains can be made. Instead, make the exercise harder until you're reaching your limit at, say, ten re...
42,294
Can gaining weight whilst losing fat mass be a plausible thing to do and if so, how does it work?
2020/06/16
[ "https://fitness.stackexchange.com/questions/42294", "https://fitness.stackexchange.com", "https://fitness.stackexchange.com/users/33451/" ]
Don't. If you can do 100 pullups, unless you're doing it to prove a point or show off, training to do 110 is a huge waste of time, because the majority of your time is spent slowly reaching your limit, at which point gains can be made. Instead, make the exercise harder until you're reaching your limit at, say, ten re...
Kipping! When I started doing pull-ups I could barely do 2 or 3. One day I strapped myself in to a machine that was designed to lighten my weight. I adjusted the machine so I weighed nothing. Then I did 20 pull-ups. I kept removing counterweights and doing 20 more pull-ups each time. Within an hour my body had learned...
15,778,426
can somebody help for this? currently i met some problems, i am using spring,jpa,hibernate. here is the problem, when i try to save several objects, and then manually roll back as when solrj return false. i tried the following: 1. usertransaction (exception: `Injection of autowired dependencies failed; nested except...
2013/04/03
[ "https://Stackoverflow.com/questions/15778426", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1528153/" ]
Proper way is to remove all manual transaction management when using the @Transactional. In a proper CMT context you shouldn't manually interact with transactions, the @transactional ensure that your method will run inside a transaction, will propagate the transaction context to delegate call and will commit at the end...
The problem is that your save method is annotated Transactional which means that the transaction would be handled by Spring, but within the method you are trying to manage transaction programatically using the JPA API. So you are **wrongly mixing** two approaches. Ideally you should use only the Transactional annotat...
1,094,511
I do not want to display all the slashes when displaying the html What I have is ``` echo "<input type=\"text\" name=\"myname\" value=\"myvalue\""; ``` What I want to do is: ``` echo '<input type="text" name="myname" value="myvalue">'; ``` I am looking to save myself from typing all the slashes. Is there a way a...
2009/07/07
[ "https://Stackoverflow.com/questions/1094511", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26130/" ]
Your second example works (although it is ugly), I assume you want a way to be able to print variables while printing the HTML with double quotes. If that's the case, you could use [Heredoc](http://php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc) syntax: ``` echo <<<DOC <input type="te...
Your second example works just fine. However, if you want you can use single slashes to quote the HTML, it will still come out valid. This would also allow you to quote variables: ``` echo "<input type='text' name='myname' value='$value' />"; ```
1,094,511
I do not want to display all the slashes when displaying the html What I have is ``` echo "<input type=\"text\" name=\"myname\" value=\"myvalue\""; ``` What I want to do is: ``` echo '<input type="text" name="myname" value="myvalue">'; ``` I am looking to save myself from typing all the slashes. Is there a way a...
2009/07/07
[ "https://Stackoverflow.com/questions/1094511", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26130/" ]
Your second example works (although it is ugly), I assume you want a way to be able to print variables while printing the HTML with double quotes. If that's the case, you could use [Heredoc](http://php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc) syntax: ``` echo <<<DOC <input type="te...
You probably don't want to echo stuff really, and Paolo explained that quite well, but in general the best practice regarding apostrophes and quotation marks is as follows: When you have apostrophes ' in the text, enclose it in double quotes " ``` echo "foo bar 'baz'"; ``` When you have double quotes, enclose in ap...
1,094,511
I do not want to display all the slashes when displaying the html What I have is ``` echo "<input type=\"text\" name=\"myname\" value=\"myvalue\""; ``` What I want to do is: ``` echo '<input type="text" name="myname" value="myvalue">'; ``` I am looking to save myself from typing all the slashes. Is there a way a...
2009/07/07
[ "https://Stackoverflow.com/questions/1094511", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26130/" ]
Your second example works (although it is ugly), I assume you want a way to be able to print variables while printing the HTML with double quotes. If that's the case, you could use [Heredoc](http://php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc) syntax: ``` echo <<<DOC <input type="te...
Do not forget you can also do something along the lines of: ``` /* PHP CODE */ ?> --- HTML HERE --- <input type="text" name="myname" value="myvalue"> <?php /*PHP CODE */ ``` Typically I use the second example with apostrophes. ``` <?php echo '<input type="text" name="myname" value="myvalue">'; ?> ``` As Paolo...
1,094,511
I do not want to display all the slashes when displaying the html What I have is ``` echo "<input type=\"text\" name=\"myname\" value=\"myvalue\""; ``` What I want to do is: ``` echo '<input type="text" name="myname" value="myvalue">'; ``` I am looking to save myself from typing all the slashes. Is there a way a...
2009/07/07
[ "https://Stackoverflow.com/questions/1094511", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26130/" ]
Your second example works (although it is ugly), I assume you want a way to be able to print variables while printing the HTML with double quotes. If that's the case, you could use [Heredoc](http://php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc) syntax: ``` echo <<<DOC <input type="te...
``` echo '<img src="'.$files[$i].'">'; ```
1,094,511
I do not want to display all the slashes when displaying the html What I have is ``` echo "<input type=\"text\" name=\"myname\" value=\"myvalue\""; ``` What I want to do is: ``` echo '<input type="text" name="myname" value="myvalue">'; ``` I am looking to save myself from typing all the slashes. Is there a way a...
2009/07/07
[ "https://Stackoverflow.com/questions/1094511", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26130/" ]
You probably don't want to echo stuff really, and Paolo explained that quite well, but in general the best practice regarding apostrophes and quotation marks is as follows: When you have apostrophes ' in the text, enclose it in double quotes " ``` echo "foo bar 'baz'"; ``` When you have double quotes, enclose in ap...
Your second example works just fine. However, if you want you can use single slashes to quote the HTML, it will still come out valid. This would also allow you to quote variables: ``` echo "<input type='text' name='myname' value='$value' />"; ```
1,094,511
I do not want to display all the slashes when displaying the html What I have is ``` echo "<input type=\"text\" name=\"myname\" value=\"myvalue\""; ``` What I want to do is: ``` echo '<input type="text" name="myname" value="myvalue">'; ``` I am looking to save myself from typing all the slashes. Is there a way a...
2009/07/07
[ "https://Stackoverflow.com/questions/1094511", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26130/" ]
Your second example works just fine. However, if you want you can use single slashes to quote the HTML, it will still come out valid. This would also allow you to quote variables: ``` echo "<input type='text' name='myname' value='$value' />"; ```
``` echo '<img src="'.$files[$i].'">'; ```
1,094,511
I do not want to display all the slashes when displaying the html What I have is ``` echo "<input type=\"text\" name=\"myname\" value=\"myvalue\""; ``` What I want to do is: ``` echo '<input type="text" name="myname" value="myvalue">'; ``` I am looking to save myself from typing all the slashes. Is there a way a...
2009/07/07
[ "https://Stackoverflow.com/questions/1094511", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26130/" ]
You probably don't want to echo stuff really, and Paolo explained that quite well, but in general the best practice regarding apostrophes and quotation marks is as follows: When you have apostrophes ' in the text, enclose it in double quotes " ``` echo "foo bar 'baz'"; ``` When you have double quotes, enclose in ap...
Do not forget you can also do something along the lines of: ``` /* PHP CODE */ ?> --- HTML HERE --- <input type="text" name="myname" value="myvalue"> <?php /*PHP CODE */ ``` Typically I use the second example with apostrophes. ``` <?php echo '<input type="text" name="myname" value="myvalue">'; ?> ``` As Paolo...
1,094,511
I do not want to display all the slashes when displaying the html What I have is ``` echo "<input type=\"text\" name=\"myname\" value=\"myvalue\""; ``` What I want to do is: ``` echo '<input type="text" name="myname" value="myvalue">'; ``` I am looking to save myself from typing all the slashes. Is there a way a...
2009/07/07
[ "https://Stackoverflow.com/questions/1094511", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26130/" ]
You probably don't want to echo stuff really, and Paolo explained that quite well, but in general the best practice regarding apostrophes and quotation marks is as follows: When you have apostrophes ' in the text, enclose it in double quotes " ``` echo "foo bar 'baz'"; ``` When you have double quotes, enclose in ap...
``` echo '<img src="'.$files[$i].'">'; ```