qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
908,077
I'm looking at the PayPal `IPN docs`, and it says the `datetime` stamps of their strings are formatted as: ``` HH:MM:SS DD Mmm YY, YYYY PST ``` So year is specified twice? Once in double digits, and another with 4 digits? This looks bizarre.
2009/05/25
[ "https://Stackoverflow.com/questions/908077", "https://Stackoverflow.com", "https://Stackoverflow.com/users/73398/" ]
This seems to be a bug in the documentation. The actual format should be "HH:MM:SS Mmm DD, YYYY PST" (e.g. "08:30:06 Apr 19, 2017 PDT")
Actually, I think the right format is: yyyy-MM-ddTHH:MM:ssZ The case is important.
908,077
I'm looking at the PayPal `IPN docs`, and it says the `datetime` stamps of their strings are formatted as: ``` HH:MM:SS DD Mmm YY, YYYY PST ``` So year is specified twice? Once in double digits, and another with 4 digits? This looks bizarre.
2009/05/25
[ "https://Stackoverflow.com/questions/908077", "https://Stackoverflow.com", "https://Stackoverflow.com/users/73398/" ]
Actually in PHP you need to use date("Y-m-d\TH:i:s\Z") . That will result in something that looks like 2012-04-30T00:05:47Z -- I didn't notice a difference between urlencoded and non. Where are you guys finding this info? This information is elusive in their documentation and cost me an hour or two of hunting and tryi...
Complete date plus hours, minutes, seconds and a decimal fraction of a second YYYY-MM-DDThh:mm:ss.sTZD (eg 1997-07-16T19:20:30.45+01:00) Where TZD = time zone designator (Z or +hh:mm or -hh:mm) Example 1994-11-05T08:15:30-05:00 corresponds to November 5, 1994, 8:15:30 am, US Eastern Standard Time. 1994-11-05T13:15:3...
908,077
I'm looking at the PayPal `IPN docs`, and it says the `datetime` stamps of their strings are formatted as: ``` HH:MM:SS DD Mmm YY, YYYY PST ``` So year is specified twice? Once in double digits, and another with 4 digits? This looks bizarre.
2009/05/25
[ "https://Stackoverflow.com/questions/908077", "https://Stackoverflow.com", "https://Stackoverflow.com/users/73398/" ]
This seems to be a bug in the documentation. The actual format should be "HH:MM:SS Mmm DD, YYYY PST" (e.g. "08:30:06 Apr 19, 2017 PDT")
this is the correct format according to their documentation - 2010-03-27T12:34:49Z so it is - YYYY-MM-DDTHH:MM:SSZ (I don't know what the T in the middle and Z is but it's constant for all the dates) I've created PayPal NVP library in Java, so if you want to check how it works, or use it, you are more than welcome. it...
908,077
I'm looking at the PayPal `IPN docs`, and it says the `datetime` stamps of their strings are formatted as: ``` HH:MM:SS DD Mmm YY, YYYY PST ``` So year is specified twice? Once in double digits, and another with 4 digits? This looks bizarre.
2009/05/25
[ "https://Stackoverflow.com/questions/908077", "https://Stackoverflow.com", "https://Stackoverflow.com/users/73398/" ]
For php, the syntax is `date("G:i:s M m, Y T");`
Complete date plus hours, minutes, seconds and a decimal fraction of a second YYYY-MM-DDThh:mm:ss.sTZD (eg 1997-07-16T19:20:30.45+01:00) Where TZD = time zone designator (Z or +hh:mm or -hh:mm) Example 1994-11-05T08:15:30-05:00 corresponds to November 5, 1994, 8:15:30 am, US Eastern Standard Time. 1994-11-05T13:15:3...
908,077
I'm looking at the PayPal `IPN docs`, and it says the `datetime` stamps of their strings are formatted as: ``` HH:MM:SS DD Mmm YY, YYYY PST ``` So year is specified twice? Once in double digits, and another with 4 digits? This looks bizarre.
2009/05/25
[ "https://Stackoverflow.com/questions/908077", "https://Stackoverflow.com", "https://Stackoverflow.com/users/73398/" ]
This seems to be a bug in the documentation. The actual format should be "HH:MM:SS Mmm DD, YYYY PST" (e.g. "08:30:06 Apr 19, 2017 PDT")
For php, the syntax is `date("G:i:s M m, Y T");`
908,077
I'm looking at the PayPal `IPN docs`, and it says the `datetime` stamps of their strings are formatted as: ``` HH:MM:SS DD Mmm YY, YYYY PST ``` So year is specified twice? Once in double digits, and another with 4 digits? This looks bizarre.
2009/05/25
[ "https://Stackoverflow.com/questions/908077", "https://Stackoverflow.com", "https://Stackoverflow.com/users/73398/" ]
this is the correct format according to their documentation - 2010-03-27T12:34:49Z so it is - YYYY-MM-DDTHH:MM:SSZ (I don't know what the T in the middle and Z is but it's constant for all the dates) I've created PayPal NVP library in Java, so if you want to check how it works, or use it, you are more than welcome. it...
Actually, I think the right format is: yyyy-MM-ddTHH:MM:ssZ The case is important.
908,077
I'm looking at the PayPal `IPN docs`, and it says the `datetime` stamps of their strings are formatted as: ``` HH:MM:SS DD Mmm YY, YYYY PST ``` So year is specified twice? Once in double digits, and another with 4 digits? This looks bizarre.
2009/05/25
[ "https://Stackoverflow.com/questions/908077", "https://Stackoverflow.com", "https://Stackoverflow.com/users/73398/" ]
This seems to be a bug in the documentation. The actual format should be "HH:MM:SS Mmm DD, YYYY PST" (e.g. "08:30:06 Apr 19, 2017 PDT")
Actually in PHP you need to use date("Y-m-d\TH:i:s\Z") . That will result in something that looks like 2012-04-30T00:05:47Z -- I didn't notice a difference between urlencoded and non. Where are you guys finding this info? This information is elusive in their documentation and cost me an hour or two of hunting and tryi...
63,770,877
I am working on SQL Server and I have two tables TableMaster and TableValidator. They both share 5 columns but no IDs. I need to find in TableValidator all those records that are not on the TableMaster to eventually insert them into TableMaster. If the values of all those 5 columns are identical on both then that is th...
2020/09/07
[ "https://Stackoverflow.com/questions/63770877", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6273079/" ]
You can simply use `NOT EXISTS()` as ``` INSERT INTO MasterTable (JobCode, Location, Code1, Code2, Code3) SELECT JobCode, Location, Code1, Code2, Code3 FROM ValidatorTable VT WHERE NOT EXISTS( SELECT 1 FROM MasterTable MT WHERE VT.JobCode = MT.JobCode ...
Try the below? ``` Select A.JobCode From TableValidator A Left join TableMaster B on A.JobCode = B.JobCode Where B.JobCode is null --OR Select A.JobCode From TableValidator A Where not Exists(Select 1 From TableMaster B where A.JobCode = B.JobCode) ```
1,736,287
With Windows Presentation Foundation, if I have an HWND, how can I capture it's window as an image that I can manipulate and display?
2009/11/15
[ "https://Stackoverflow.com/questions/1736287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/76322/" ]
You can: 1. `CreateBitmap()` to create a hBitmap 2. Call `GetDC()` on the hWnd 3. `BitBlt()` the contents to the hBitmap 4. `ReleaseDC()` 5. Call `Imaging.CreateBitmapSourceFromHBitmap()` to create a managed `BitmapSource` 6. `DeleteObject()` on the hBitmap 7. Use the `BitmapSource` as desired Steps 1-4 and 6 use the...
While above answer is great, this would have saved a ton of time too: **Using section:** ``` using System; using System.Windows; using System.Windows.Interop; using System.Runtime.InteropServices; using System.Windows.Media.Imaging; ``` **Code:** ``` /// <summary> /// Captures screenshot using WINAPI. /// </summar...
399,464
I'm often creating PDF files from web pages in MacOS X (10.6) and very often I have the problem that the automatically proposed file name (based on the name of the web page) contains many special characters. So I wonder: is there an easy way (apple script, shell script, OS X service) which takes a string (like this fi...
2012/03/11
[ "https://superuser.com/questions/399464", "https://superuser.com", "https://superuser.com/users/92184/" ]
You can create an Automator service to do this in all applications that support services (which is almost all of them). --- Open Automator and select to create a *Service* that receives *selected text* in *any application* and check *Output replaces selected text*. Add a single *Run Shell Script* action from the lib...
Same idea as Daniel had. Create a *Service* in *Automator*. Replace the *Run Shell Script* shell with `/usr/bin/ruby`, and add the following: ``` input, output = STDIN.read, "" input.each("\s") {|word| output << word.capitalize} puts output.gsub!(/[^0-9A-Za-z\-]/, '') ``` This will get you the capitalization and you...
155,161
I noticed that there are a list of Platforms/Vendors for which a CVE can be applied for. What happens if I find a CVE for a proprietary platform (that is commercially available), is there a way to get a CVE assigned for it?
2017/03/28
[ "https://security.stackexchange.com/questions/155161", "https://security.stackexchange.com", "https://security.stackexchange.com/users/12253/" ]
Different vendors require different steps to be taken in order to get a CVE ID assigned for vulnerabilities. If you check [the MITRE CVE ID Request page here](https://cve.mitre.org/cve/request_id.html) then you can follow the instructions to request an ID after locating the correct CVE Numbering Authority. If the ven...
I think the main thing here is to make sure you follow Responsible Disclosure: From [wikipedia](https://en.wikipedia.org/wiki/Responsible_disclosure): > > Responsible disclosure is a computer security term describing a vulnerability disclosure model. It is like full disclosure, with the addition that all stakeholder...
2,382,723
I have been looking at the definition of a 'branch' of a complex function. The typical definition I am getting is as follows: > > ...branches $f\_1(z)$, $f\_2(z)$, $...$ of $f(z)$ each defined as a single-valued continuous function throughout its range of definition. Each branch assumes one set of the function values...
2017/08/04
[ "https://math.stackexchange.com/questions/2382723", "https://math.stackexchange.com", "https://math.stackexchange.com/users/203397/" ]
Let $f:U\to \mathbb C$ and $g:V\to\mathbb C$ be analytic on connected open sets $U,V$. They are branches of the same function if there is a sequence of open connected subsets, $U=W\_1,W\_2,\dots,V=W\_n$ and analytic functions $f\_i:W\_i\to \mathbb C$ such that $f\_1=f,f\_n=g$ and $W\_{i}\cap W\_{i+1}$ is non-empty, and...
Echoing @Andrew D. Hwang's good answer, I'd agree that a big part of the common problem in parsing discussion about "branches" is that the vocabulary to talk about many of these basic complex analysis notions is out-of-date and/or vague, even though the *ideas* go back at least to Riemann, c. 1850's. Somewhat contrary...
2,382,723
I have been looking at the definition of a 'branch' of a complex function. The typical definition I am getting is as follows: > > ...branches $f\_1(z)$, $f\_2(z)$, $...$ of $f(z)$ each defined as a single-valued continuous function throughout its range of definition. Each branch assumes one set of the function values...
2017/08/04
[ "https://math.stackexchange.com/questions/2382723", "https://math.stackexchange.com", "https://math.stackexchange.com/users/203397/" ]
"Branch" is a slightly tricky term to pin down. Literally, a branch of a function is just a holomorphic function in some non-empty open subset of the complex plane, or a continuous extension to the closure. That alone, however, misses a substantial cultural subtext: If $f$ is holomorphic, a *branch of inverse* is a le...
Echoing @Andrew D. Hwang's good answer, I'd agree that a big part of the common problem in parsing discussion about "branches" is that the vocabulary to talk about many of these basic complex analysis notions is out-of-date and/or vague, even though the *ideas* go back at least to Riemann, c. 1850's. Somewhat contrary...
43,853,743
I need to sum all digits in a given string. So for I've got this ``` public static void main(String[] args) { Scanner odczyt = new Scanner(System.in); System.out.println("Input string"); String ciag = odczyt.nextLine(); int suma = 0; for (int i = 0; i < ciag.length(); i++) { if (Charact...
2017/05/08
[ "https://Stackoverflow.com/questions/43853743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7981922/" ]
The problem occurs here: ``` suma += ciag.charAt(i); ``` you're adding the character code rather than the digit itself. change it to this: ``` suma += Integer.parseInt(ciag.charAt(i)+""); ```
That is because you are adding the ascii code of numbers. Just subtract '0' from the char number as shown below: suma += ciag.charAt(i)-'0';
65,340,738
I am creating an Input Dialog using kivymd. Whenever I try to fetch the text from the text field, it doesn't output the text, rather it seems like the text is not there. (the dialog just pops up ok and the buttons are working fine). part of the kivy code ===================== ``` <Content> MDTextField: id...
2020/12/17
[ "https://Stackoverflow.com/questions/65340738", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14284845/" ]
Go to your Canvas and change the **Render Mode** from **Screen Space-Overlay** to **Screen Space-Camera**. I think that should fix your problem.
Yes, chage your setting to **Screen Space-Camera** but use these settings (under render camera put your camera): [![enter image description here](https://i.stack.imgur.com/vSrxk.png)](https://i.stack.imgur.com/vSrxk.png)
13,714,517
I'm not the best at php coding, just learning it. But i was wondering why I keep getting a variable passed to each() is not an array or object warning. I know there is a similar thread that I had used for this code but that post was not resolved so I am hoping it can be the error is one line 46 where it states - > >...
2012/12/05
[ "https://Stackoverflow.com/questions/13714517", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1874551/" ]
`Reducer` is apparently typed as `<A, B, C, D>`. Just because A and C happen to be provided by the same type doesn't make it impossible (and should work in C# as far as I know). Edit: to clarify -- you can have a method with more than one parameter of the same type: `public void foo(String a, String b)`. One wouldn't ...
The same way that you pass an argument to two method parameters, you can substitute two type parameters by a single type argument. For instance, if `Reducer` is declared as `class Reducer<A, B, C, D>`, then `Reducer<Text, IntWritable, Text, IntWritable>` is a valid type. However, if the type parameters have different...
13,714,517
I'm not the best at php coding, just learning it. But i was wondering why I keep getting a variable passed to each() is not an array or object warning. I know there is a similar thread that I had used for this code but that post was not resolved so I am hoping it can be the error is one line 46 where it states - > >...
2012/12/05
[ "https://Stackoverflow.com/questions/13714517", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1874551/" ]
The same way that you pass an argument to two method parameters, you can substitute two type parameters by a single type argument. For instance, if `Reducer` is declared as `class Reducer<A, B, C, D>`, then `Reducer<Text, IntWritable, Text, IntWritable>` is a valid type. However, if the type parameters have different...
The two `Text`s refer to *different* type parameters. For instance if `Reducer` had the declaration ``` public class Reducer<A, B, C, D> { ``` then in `Reducer<Text, IntWritable, Text, IntWritable>`, the first `Text` would refer to type parameter `A` and the second to `C` - so the compiler can distinguish between th...
13,714,517
I'm not the best at php coding, just learning it. But i was wondering why I keep getting a variable passed to each() is not an array or object warning. I know there is a similar thread that I had used for this code but that post was not resolved so I am hoping it can be the error is one line 46 where it states - > >...
2012/12/05
[ "https://Stackoverflow.com/questions/13714517", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1874551/" ]
`Reducer` is apparently typed as `<A, B, C, D>`. Just because A and C happen to be provided by the same type doesn't make it impossible (and should work in C# as far as I know). Edit: to clarify -- you can have a method with more than one parameter of the same type: `public void foo(String a, String b)`. One wouldn't ...
The two `Text`s refer to *different* type parameters. For instance if `Reducer` had the declaration ``` public class Reducer<A, B, C, D> { ``` then in `Reducer<Text, IntWritable, Text, IntWritable>`, the first `Text` would refer to type parameter `A` and the second to `C` - so the compiler can distinguish between th...
3,207,385
I came across this question in one of the linear algebra textbooks: Proof the linear independence of the following set $\{f\_i ∣ i\in\mathbb{N}\}$, such that $f\_i : \mathbb{N}\to\mathbb{Q}$ defined as follows: For $n\in\mathbb{N}$, $$f\_i (n) = \begin{cases} -n & \text{for }n \geq i \\ 0 & \text{for }n < i \end{...
2019/04/29
[ "https://math.stackexchange.com/questions/3207385", "https://math.stackexchange.com", "https://math.stackexchange.com/users/669697/" ]
I assume that in your class $0\notin \Bbb N$ (as otherwise the claim is clearly false). Assume $\sum\_i c\_i f\_i=0$ with almost all $c\_i=0$. For any $n>1$, we have $$ 0=\sum\_i c\_if\_i(n)-\sum\_i c\_if\_i(n-1)=\sum\_i c\_i(f\_i(n)-f\_i(n-1))=-nc\_n,$$ hence $c\_n=0$. Thus $0=\sum\_i c\_if\_i(1)=c\_1f\_1(1)=-c\_1$ ...
Consider the series $$\sum\_{i=1}^\infty \alpha\_i f\_i (n)$$ for scalars $\alpha\_1, \alpha\_2, \dots$. We aim to prove that this series is never zero unless all scalars are zero. First note that $\forall i \in \mathbb{N} \space \exists n \in \mathbb{N}$ such that $n \geq i$. So $\forall n \in \mathbb{N} \space $$\...
3,207,385
I came across this question in one of the linear algebra textbooks: Proof the linear independence of the following set $\{f\_i ∣ i\in\mathbb{N}\}$, such that $f\_i : \mathbb{N}\to\mathbb{Q}$ defined as follows: For $n\in\mathbb{N}$, $$f\_i (n) = \begin{cases} -n & \text{for }n \geq i \\ 0 & \text{for }n < i \end{...
2019/04/29
[ "https://math.stackexchange.com/questions/3207385", "https://math.stackexchange.com", "https://math.stackexchange.com/users/669697/" ]
View each function as an infinite vector $$v\_i = \left( \begin{array}{c} f\_i (1)\\ f\_i (2) \\ f\_i (3)\\ \vdots \end{array}\right) = \left( \begin{array}{c} 0\\0\\\vdots\\0\\-i\\ -i-1\\-i-2\\\vdots\end{array}\right)$$ in $\prod\_{n\in\mathbb{N}}\mathbb{N} $, and show that the $v\_i $ are linearly independent (th...
I assume that in your class $0\notin \Bbb N$ (as otherwise the claim is clearly false). Assume $\sum\_i c\_i f\_i=0$ with almost all $c\_i=0$. For any $n>1$, we have $$ 0=\sum\_i c\_if\_i(n)-\sum\_i c\_if\_i(n-1)=\sum\_i c\_i(f\_i(n)-f\_i(n-1))=-nc\_n,$$ hence $c\_n=0$. Thus $0=\sum\_i c\_if\_i(1)=c\_1f\_1(1)=-c\_1$ ...
3,207,385
I came across this question in one of the linear algebra textbooks: Proof the linear independence of the following set $\{f\_i ∣ i\in\mathbb{N}\}$, such that $f\_i : \mathbb{N}\to\mathbb{Q}$ defined as follows: For $n\in\mathbb{N}$, $$f\_i (n) = \begin{cases} -n & \text{for }n \geq i \\ 0 & \text{for }n < i \end{...
2019/04/29
[ "https://math.stackexchange.com/questions/3207385", "https://math.stackexchange.com", "https://math.stackexchange.com/users/669697/" ]
View each function as an infinite vector $$v\_i = \left( \begin{array}{c} f\_i (1)\\ f\_i (2) \\ f\_i (3)\\ \vdots \end{array}\right) = \left( \begin{array}{c} 0\\0\\\vdots\\0\\-i\\ -i-1\\-i-2\\\vdots\end{array}\right)$$ in $\prod\_{n\in\mathbb{N}}\mathbb{N} $, and show that the $v\_i $ are linearly independent (th...
Consider the series $$\sum\_{i=1}^\infty \alpha\_i f\_i (n)$$ for scalars $\alpha\_1, \alpha\_2, \dots$. We aim to prove that this series is never zero unless all scalars are zero. First note that $\forall i \in \mathbb{N} \space \exists n \in \mathbb{N}$ such that $n \geq i$. So $\forall n \in \mathbb{N} \space $$\...
60,617,513
The company I work for wants a file uploader. The file uploader not only has to upload files, but it also has to prevent certain files from being uploaded. The company contracted another company to build this site. I am a Mobile Developer learning Angular. How do I prevent certain files from being uploaded? Here is a...
2020/03/10
[ "https://Stackoverflow.com/questions/60617513", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9951977/" ]
You need to use the accept attribute of HTML element. You will pass a string of comma separated file types. ``` <input type="file" id="profile_pic" name="profile_pic" accept=".jpg, .jpeg, .png"> ``` Use this for the accept attribute guide - <https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/acce...
Two things to note: first, in a normal input upload you can utilize the `accept` parameter: <https://www.w3schools.com/tags/att_input_accept.asp>. Second, you can't actually completely prevent uploads like this from the front, but you can disable them using the package you have used. If you want to completely disable (...
56,542,236
Here is my problem. I've built the following `ListView` ``` <ListView Grid.Row="1" x:Name="messageList" BorderThickness="0" ItemsSource="{Binding MySource}" HorizontalContentAlignment="Stretch"> <ListView.ItemTemplate> <DataTemplate> <Grid> ...
2019/06/11
[ "https://Stackoverflow.com/questions/56542236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6474054/" ]
It took me few minutes to produce [mcve](https://stackoverflow.com/help/minimal-reproducible-example), but the missing part of the puzzle is this: ``` <Grid MaxWidth="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType={x:Type ListView}}}"> ``` That would limit maximum width of all `Grid`s (each item h...
The problem is that your grid (and the width of the column) is calculated for each element of your list, so it takes the most space possible. I propose a backup solution, I did not find better but the result is there. This is to place 2 ListView in 2 columns of a grid and then have the Received element in one and the ...
6,008,304
I am using lua to administrate a firewall server and want to obfuscate sensible variables such as login data. I have tried luac but the variable content is still easily readable. Is there any way to encrypt/decrypt these sensible data?
2011/05/15
[ "https://Stackoverflow.com/questions/6008304", "https://Stackoverflow.com", "https://Stackoverflow.com/users/752297/" ]
I'm assuming you have a lua script which contains both the commands to send as well as any "secret data", and you want to be able to run this script without having to type in anything interactively. If so, the script itself must be able to decrypt your secret data in order to use it - and if an attacker can read the s...
If you're allowed to use compiled libraries (ie. LuaRocks), you can use the [Kepler MD5](http://www.keplerproject.org/md5) library to encrypt/decrypt the data- and if you can have the script prompt for a password, you can even make it (reasonably) secure. (If you can't prompt for a password, as Paulo says, obfuscation ...
14,814,658
I have a string: `The disk 'virtual memory' also known as 'Virtual Memory' has exceeded the maximum utilization threshold of 95 Percent.` I need to search every time in this string word `The disk` and if found then I need to extract only phrase in `'*' also known as '*'` and put it in a variable `MONITOR` In other w...
2013/02/11
[ "https://Stackoverflow.com/questions/14814658", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2061705/" ]
Here's a snippet that does what you describe. You should put it in `$(...)` to assign it to the $MONITOR variable: ``` $ awk '/The disk '\''.*'\'' also known as '\''.*'\'' has exceeded/ {gsub(/The disk /,"");gsub(/ has exceeded.*$/,"");print}' input.txt ``` The two problems with awk in this case is * it doesn't hav...
It might be a little easier with `sed` than `awk`: ``` string="The disk 'virtual memory' also known as 'Virtual Memory' has exceeded the maximum utilization threshold of 95 Percent." MONITOR=$(echo "$string" | sed -n "/The disk \('[^']*' also known as '[^']*'\) .*/s//\1/p") ``` If `awk` is necessary, then: ``` MON...
46,523,857
[![enter image description here](https://i.stack.imgur.com/fmk8w.jpg)](https://i.stack.imgur.com/fmk8w.jpg) I open the `Message-Fragment` from `Activity-A` and then open the `Camera-Fragment` from `Message-Fragment`. Now current fragment is `Camera-Fragment` and i have media-slider on it. Now I have two options, one i...
2017/10/02
[ "https://Stackoverflow.com/questions/46523857", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3583237/" ]
If I understand everything correctly I think I have a solution. I will ignore all other aspects of the navigation and just focus on the fact you want to go from `VideoPreviewActivity` to the `MainActivity` and adjust the fragment stack, and that this is being triggered from a done button (or something similar) but NOT ...
Try this, First take the framelayout in ActivityA, ``` <FrameLayout android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent" /> ``` Create method in activityA ``` public void openFragment(Fragment fragment) { getSupportFragmentManag...
59,065
First of all I just started doing barre chords after learning ordinary non-barre chords. Problem is they don't sound so well, so my question is, will training with hand grippers help me achieve this? Because I've been applying equal pressure and they still sound a bit off, only a bit off.
2017/07/09
[ "https://music.stackexchange.com/questions/59065", "https://music.stackexchange.com", "https://music.stackexchange.com/users/42610/" ]
No, training with hand grippers won't help you execute barre chords. Firstly, time spent squeezing grippers is time that you could be using to actually practise barre chords. Secondly, the physical action is markedly different and not about finger placement and subtleties of pressure. But hey, you could end up with a r...
I don't find those hand-grippers very effective in teaching you how to make your barre chords sound better. The truth is, a large part of getting your barre chords to sound good comes from good technique. There are quite a number of tiny details that will help you achieve a good sounding barre chord with minimal effort...
59,065
First of all I just started doing barre chords after learning ordinary non-barre chords. Problem is they don't sound so well, so my question is, will training with hand grippers help me achieve this? Because I've been applying equal pressure and they still sound a bit off, only a bit off.
2017/07/09
[ "https://music.stackexchange.com/questions/59065", "https://music.stackexchange.com", "https://music.stackexchange.com/users/42610/" ]
No. Simple answer. Your hands could be stronger than a weightlifter's and still not play barre chords, or any other chords, well. Actually, hardly any finger strength is needed. Putting fingers as close as possible to the fretwire helps, accurate fingering helps, and a good action helps. If the strings are a long way ...
No, training with hand grippers won't help you execute barre chords. Firstly, time spent squeezing grippers is time that you could be using to actually practise barre chords. Secondly, the physical action is markedly different and not about finger placement and subtleties of pressure. But hey, you could end up with a r...
59,065
First of all I just started doing barre chords after learning ordinary non-barre chords. Problem is they don't sound so well, so my question is, will training with hand grippers help me achieve this? Because I've been applying equal pressure and they still sound a bit off, only a bit off.
2017/07/09
[ "https://music.stackexchange.com/questions/59065", "https://music.stackexchange.com", "https://music.stackexchange.com/users/42610/" ]
No, training with hand grippers won't help you execute barre chords. Firstly, time spent squeezing grippers is time that you could be using to actually practise barre chords. Secondly, the physical action is markedly different and not about finger placement and subtleties of pressure. But hey, you could end up with a r...
Grippers (hand squeezing exercisers) won't get you anywhere. It may sound trite, but the best exercise for improving your barre chords is to play barre chords. Work on correct technique and position, and eventually you'll see marked improvement. You can try to focus on 'power chords' initially (i.e. just the lowest 3 n...
59,065
First of all I just started doing barre chords after learning ordinary non-barre chords. Problem is they don't sound so well, so my question is, will training with hand grippers help me achieve this? Because I've been applying equal pressure and they still sound a bit off, only a bit off.
2017/07/09
[ "https://music.stackexchange.com/questions/59065", "https://music.stackexchange.com", "https://music.stackexchange.com/users/42610/" ]
No. Simple answer. Your hands could be stronger than a weightlifter's and still not play barre chords, or any other chords, well. Actually, hardly any finger strength is needed. Putting fingers as close as possible to the fretwire helps, accurate fingering helps, and a good action helps. If the strings are a long way ...
I don't find those hand-grippers very effective in teaching you how to make your barre chords sound better. The truth is, a large part of getting your barre chords to sound good comes from good technique. There are quite a number of tiny details that will help you achieve a good sounding barre chord with minimal effort...
59,065
First of all I just started doing barre chords after learning ordinary non-barre chords. Problem is they don't sound so well, so my question is, will training with hand grippers help me achieve this? Because I've been applying equal pressure and they still sound a bit off, only a bit off.
2017/07/09
[ "https://music.stackexchange.com/questions/59065", "https://music.stackexchange.com", "https://music.stackexchange.com/users/42610/" ]
It turns out that strength is not what is needed to improve your ability to finger barre chords, or any chords. It's mostly about precise placement and using the minimum amount of force to hold it down. It's not necessarily that equal pressure is correct. You just need the right amount of pressure for each fret and st...
guitars are all about practice, practice and practice. so yeah if you are performing for someone use them, if you are practicing then don't because today you might not be able to do it but even if you try 15 minutes a day( not at a go) try to hold the chord, check if each string is ringing, if not readjust your positio...
59,065
First of all I just started doing barre chords after learning ordinary non-barre chords. Problem is they don't sound so well, so my question is, will training with hand grippers help me achieve this? Because I've been applying equal pressure and they still sound a bit off, only a bit off.
2017/07/09
[ "https://music.stackexchange.com/questions/59065", "https://music.stackexchange.com", "https://music.stackexchange.com/users/42610/" ]
It turns out that strength is not what is needed to improve your ability to finger barre chords, or any chords. It's mostly about precise placement and using the minimum amount of force to hold it down. It's not necessarily that equal pressure is correct. You just need the right amount of pressure for each fret and st...
I don't find those hand-grippers very effective in teaching you how to make your barre chords sound better. The truth is, a large part of getting your barre chords to sound good comes from good technique. There are quite a number of tiny details that will help you achieve a good sounding barre chord with minimal effort...
59,065
First of all I just started doing barre chords after learning ordinary non-barre chords. Problem is they don't sound so well, so my question is, will training with hand grippers help me achieve this? Because I've been applying equal pressure and they still sound a bit off, only a bit off.
2017/07/09
[ "https://music.stackexchange.com/questions/59065", "https://music.stackexchange.com", "https://music.stackexchange.com/users/42610/" ]
It turns out that strength is not what is needed to improve your ability to finger barre chords, or any chords. It's mostly about precise placement and using the minimum amount of force to hold it down. It's not necessarily that equal pressure is correct. You just need the right amount of pressure for each fret and st...
No. Simple answer. Your hands could be stronger than a weightlifter's and still not play barre chords, or any other chords, well. Actually, hardly any finger strength is needed. Putting fingers as close as possible to the fretwire helps, accurate fingering helps, and a good action helps. If the strings are a long way ...
59,065
First of all I just started doing barre chords after learning ordinary non-barre chords. Problem is they don't sound so well, so my question is, will training with hand grippers help me achieve this? Because I've been applying equal pressure and they still sound a bit off, only a bit off.
2017/07/09
[ "https://music.stackexchange.com/questions/59065", "https://music.stackexchange.com", "https://music.stackexchange.com/users/42610/" ]
No. Simple answer. Your hands could be stronger than a weightlifter's and still not play barre chords, or any other chords, well. Actually, hardly any finger strength is needed. Putting fingers as close as possible to the fretwire helps, accurate fingering helps, and a good action helps. If the strings are a long way ...
Grippers (hand squeezing exercisers) won't get you anywhere. It may sound trite, but the best exercise for improving your barre chords is to play barre chords. Work on correct technique and position, and eventually you'll see marked improvement. You can try to focus on 'power chords' initially (i.e. just the lowest 3 n...
59,065
First of all I just started doing barre chords after learning ordinary non-barre chords. Problem is they don't sound so well, so my question is, will training with hand grippers help me achieve this? Because I've been applying equal pressure and they still sound a bit off, only a bit off.
2017/07/09
[ "https://music.stackexchange.com/questions/59065", "https://music.stackexchange.com", "https://music.stackexchange.com/users/42610/" ]
It turns out that strength is not what is needed to improve your ability to finger barre chords, or any chords. It's mostly about precise placement and using the minimum amount of force to hold it down. It's not necessarily that equal pressure is correct. You just need the right amount of pressure for each fret and st...
No, training with hand grippers won't help you execute barre chords. Firstly, time spent squeezing grippers is time that you could be using to actually practise barre chords. Secondly, the physical action is markedly different and not about finger placement and subtleties of pressure. But hey, you could end up with a r...
59,065
First of all I just started doing barre chords after learning ordinary non-barre chords. Problem is they don't sound so well, so my question is, will training with hand grippers help me achieve this? Because I've been applying equal pressure and they still sound a bit off, only a bit off.
2017/07/09
[ "https://music.stackexchange.com/questions/59065", "https://music.stackexchange.com", "https://music.stackexchange.com/users/42610/" ]
No, training with hand grippers won't help you execute barre chords. Firstly, time spent squeezing grippers is time that you could be using to actually practise barre chords. Secondly, the physical action is markedly different and not about finger placement and subtleties of pressure. But hey, you could end up with a r...
guitars are all about practice, practice and practice. so yeah if you are performing for someone use them, if you are practicing then don't because today you might not be able to do it but even if you try 15 minutes a day( not at a go) try to hold the chord, check if each string is ringing, if not readjust your positio...
6,359,617
As part of a project, I need to analyse string which may contain a reference to PHP in the following manner: `[php]functionName(args1, args2)[/php]` The function name is not always the same, and I would like to replace everything in the above example (including the pseudo-tags) with another value. Can anyone sugges...
2011/06/15
[ "https://Stackoverflow.com/questions/6359617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/367401/" ]
**If** constructs like `[ php ]`, `[/*comment/*php]` (or other crazy stuff) are not allowed, you can use this: ``` /\[php\](.*?)\[\/php\]/ ``` The first matched group will be the text inside the tags. I think the regex is quite intuitive, except for the `?`: it will be lazy and match text only until the first closin...
You can search for string between these tags eg ``` \[PHP\](.+[^\b\[])\[/PHP\] ```
6,359,617
As part of a project, I need to analyse string which may contain a reference to PHP in the following manner: `[php]functionName(args1, args2)[/php]` The function name is not always the same, and I would like to replace everything in the above example (including the pseudo-tags) with another value. Can anyone sugges...
2011/06/15
[ "https://Stackoverflow.com/questions/6359617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/367401/" ]
I think `"\[php\](.*?)\[\/php\]"` would do the trick. Edit: you may or may not need the double quotes-- not sure how you're ultimately using the regex string.
**If** constructs like `[ php ]`, `[/*comment/*php]` (or other crazy stuff) are not allowed, you can use this: ``` /\[php\](.*?)\[\/php\]/ ``` The first matched group will be the text inside the tags. I think the regex is quite intuitive, except for the `?`: it will be lazy and match text only until the first closin...
6,359,617
As part of a project, I need to analyse string which may contain a reference to PHP in the following manner: `[php]functionName(args1, args2)[/php]` The function name is not always the same, and I would like to replace everything in the above example (including the pseudo-tags) with another value. Can anyone sugges...
2011/06/15
[ "https://Stackoverflow.com/questions/6359617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/367401/" ]
``` <?php $s = "Lorem ipsum dolor sit amet, [php]functionName(args1, args2)[/php] ok."; echo preg_replace("/\[php\][^\[]+\[\/php\]/", "seems to work", $s) . "\n"; // prints => Lorem ipsum dolor sit amet, seems to work ok. ?> ```
If you're using WordPress, but sure to look into the shortcode API. <http://codex.wordpress.org/Shortcode_API> And if not consider grabbing its code. It was written so it could be used in any app.
6,359,617
As part of a project, I need to analyse string which may contain a reference to PHP in the following manner: `[php]functionName(args1, args2)[/php]` The function name is not always the same, and I would like to replace everything in the above example (including the pseudo-tags) with another value. Can anyone sugges...
2011/06/15
[ "https://Stackoverflow.com/questions/6359617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/367401/" ]
Try this: ``` $start_tag ='\\\\[php\\\\]\\\\s*'; $function ='((\\\\w+)\\\\s*\\\\(([^)]*)\\\\)'; $end_tag ='\\\\s*\\\\[\\\\/php\\\\]'; $re='/(' . $start_tag . $function . $end_tag . ')/'; ``` which is: ``` ( # start capture group #1 - full match \[ # literal '[' php #...
You can search for string between these tags eg ``` \[PHP\](.+[^\b\[])\[/PHP\] ```
6,359,617
As part of a project, I need to analyse string which may contain a reference to PHP in the following manner: `[php]functionName(args1, args2)[/php]` The function name is not always the same, and I would like to replace everything in the above example (including the pseudo-tags) with another value. Can anyone sugges...
2011/06/15
[ "https://Stackoverflow.com/questions/6359617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/367401/" ]
I think `"\[php\](.*?)\[\/php\]"` would do the trick. Edit: you may or may not need the double quotes-- not sure how you're ultimately using the regex string.
You can search for string between these tags eg ``` \[PHP\](.+[^\b\[])\[/PHP\] ```
6,359,617
As part of a project, I need to analyse string which may contain a reference to PHP in the following manner: `[php]functionName(args1, args2)[/php]` The function name is not always the same, and I would like to replace everything in the above example (including the pseudo-tags) with another value. Can anyone sugges...
2011/06/15
[ "https://Stackoverflow.com/questions/6359617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/367401/" ]
I think `"\[php\](.*?)\[\/php\]"` would do the trick. Edit: you may or may not need the double quotes-- not sure how you're ultimately using the regex string.
``` <?php $s = "Lorem ipsum dolor sit amet, [php]functionName(args1, args2)[/php] ok."; echo preg_replace("/\[php\][^\[]+\[\/php\]/", "seems to work", $s) . "\n"; // prints => Lorem ipsum dolor sit amet, seems to work ok. ?> ```
6,359,617
As part of a project, I need to analyse string which may contain a reference to PHP in the following manner: `[php]functionName(args1, args2)[/php]` The function name is not always the same, and I would like to replace everything in the above example (including the pseudo-tags) with another value. Can anyone sugges...
2011/06/15
[ "https://Stackoverflow.com/questions/6359617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/367401/" ]
I think `"\[php\](.*?)\[\/php\]"` would do the trick. Edit: you may or may not need the double quotes-- not sure how you're ultimately using the regex string.
Try this: ``` $start_tag ='\\\\[php\\\\]\\\\s*'; $function ='((\\\\w+)\\\\s*\\\\(([^)]*)\\\\)'; $end_tag ='\\\\s*\\\\[\\\\/php\\\\]'; $re='/(' . $start_tag . $function . $end_tag . ')/'; ``` which is: ``` ( # start capture group #1 - full match \[ # literal '[' php #...
6,359,617
As part of a project, I need to analyse string which may contain a reference to PHP in the following manner: `[php]functionName(args1, args2)[/php]` The function name is not always the same, and I would like to replace everything in the above example (including the pseudo-tags) with another value. Can anyone sugges...
2011/06/15
[ "https://Stackoverflow.com/questions/6359617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/367401/" ]
``` <?php $s = "Lorem ipsum dolor sit amet, [php]functionName(args1, args2)[/php] ok."; echo preg_replace("/\[php\][^\[]+\[\/php\]/", "seems to work", $s) . "\n"; // prints => Lorem ipsum dolor sit amet, seems to work ok. ?> ```
try using ``` \[php\](.*)\[\/php\] ```
6,359,617
As part of a project, I need to analyse string which may contain a reference to PHP in the following manner: `[php]functionName(args1, args2)[/php]` The function name is not always the same, and I would like to replace everything in the above example (including the pseudo-tags) with another value. Can anyone sugges...
2011/06/15
[ "https://Stackoverflow.com/questions/6359617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/367401/" ]
``` <?php $s = "Lorem ipsum dolor sit amet, [php]functionName(args1, args2)[/php] ok."; echo preg_replace("/\[php\][^\[]+\[\/php\]/", "seems to work", $s) . "\n"; // prints => Lorem ipsum dolor sit amet, seems to work ok. ?> ```
Try this: ``` $start_tag ='\\\\[php\\\\]\\\\s*'; $function ='((\\\\w+)\\\\s*\\\\(([^)]*)\\\\)'; $end_tag ='\\\\s*\\\\[\\\\/php\\\\]'; $re='/(' . $start_tag . $function . $end_tag . ')/'; ``` which is: ``` ( # start capture group #1 - full match \[ # literal '[' php #...
6,359,617
As part of a project, I need to analyse string which may contain a reference to PHP in the following manner: `[php]functionName(args1, args2)[/php]` The function name is not always the same, and I would like to replace everything in the above example (including the pseudo-tags) with another value. Can anyone sugges...
2011/06/15
[ "https://Stackoverflow.com/questions/6359617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/367401/" ]
If you're using WordPress, but sure to look into the shortcode API. <http://codex.wordpress.org/Shortcode_API> And if not consider grabbing its code. It was written so it could be used in any app.
try using ``` \[php\](.*)\[\/php\] ```
48,118,038
I am trying to create a simple drag race animation. The car image moves across the page upon the click of a button until each reaches a certain position. The code below works with individual clicks moving the car a random distance each click, but I want one click to repeat the movement in a loop. I have tried putting i...
2018/01/05
[ "https://Stackoverflow.com/questions/48118038", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9178525/" ]
You're looking for [setInterval](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setInterval). `setTimeout` runs your function once after x milliseconds. `setInterval` runs your function every x milliseconds. Be sure to store your interval in a variable you can access (`var timer = setInte...
This will clear interval whenever you click the button and the race starts from the begining. Also no ned to set the `top` at every call, just `left` is enough. Happy racing!!! ```js x = $("#car").offset().left; y = $("#car").offset().top; //Move car across screen by resetting car position coordinates var interval...
48,118,038
I am trying to create a simple drag race animation. The car image moves across the page upon the click of a button until each reaches a certain position. The code below works with individual clicks moving the car a random distance each click, but I want one click to repeat the movement in a loop. I have tried putting i...
2018/01/05
[ "https://Stackoverflow.com/questions/48118038", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9178525/" ]
You're looking for [setInterval](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setInterval). `setTimeout` runs your function once after x milliseconds. `setInterval` runs your function every x milliseconds. Be sure to store your interval in a variable you can access (`var timer = setInte...
**You should use** recursive setTimeout() **not** setInterval(). See why here --> <https://develoger.com/settimeout-vs-setinterval-cff85142555b> This is how I like to approach this problem, with the function bellow you can pass number of iterations, time in between and actually callback. 1. How many times? (you can...
48,118,038
I am trying to create a simple drag race animation. The car image moves across the page upon the click of a button until each reaches a certain position. The code below works with individual clicks moving the car a random distance each click, but I want one click to repeat the movement in a loop. I have tried putting i...
2018/01/05
[ "https://Stackoverflow.com/questions/48118038", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9178525/" ]
Why are you using variables instead of standard functions? Anyway, you can call your function recursively from within the `setTimeout` function until a condition is met. Try this: ```html <html> <head> <meta charset="utf-8"> <title>Race Car</title> </head> <body> <input type="button" id="move" value="rac...
This will clear interval whenever you click the button and the race starts from the begining. Also no ned to set the `top` at every call, just `left` is enough. Happy racing!!! ```js x = $("#car").offset().left; y = $("#car").offset().top; //Move car across screen by resetting car position coordinates var interval...
48,118,038
I am trying to create a simple drag race animation. The car image moves across the page upon the click of a button until each reaches a certain position. The code below works with individual clicks moving the car a random distance each click, but I want one click to repeat the movement in a loop. I have tried putting i...
2018/01/05
[ "https://Stackoverflow.com/questions/48118038", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9178525/" ]
**You should use** recursive setTimeout() **not** setInterval(). See why here --> <https://develoger.com/settimeout-vs-setinterval-cff85142555b> This is how I like to approach this problem, with the function bellow you can pass number of iterations, time in between and actually callback. 1. How many times? (you can...
This will clear interval whenever you click the button and the race starts from the begining. Also no ned to set the `top` at every call, just `left` is enough. Happy racing!!! ```js x = $("#car").offset().left; y = $("#car").offset().top; //Move car across screen by resetting car position coordinates var interval...
48,118,038
I am trying to create a simple drag race animation. The car image moves across the page upon the click of a button until each reaches a certain position. The code below works with individual clicks moving the car a random distance each click, but I want one click to repeat the movement in a loop. I have tried putting i...
2018/01/05
[ "https://Stackoverflow.com/questions/48118038", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9178525/" ]
Why are you using variables instead of standard functions? Anyway, you can call your function recursively from within the `setTimeout` function until a condition is met. Try this: ```html <html> <head> <meta charset="utf-8"> <title>Race Car</title> </head> <body> <input type="button" id="move" value="rac...
**You should use** recursive setTimeout() **not** setInterval(). See why here --> <https://develoger.com/settimeout-vs-setinterval-cff85142555b> This is how I like to approach this problem, with the function bellow you can pass number of iterations, time in between and actually callback. 1. How many times? (you can...
66,862,650
I found some code that uses a decorator as an instance variable in a class... I tried to replicate this in plain Javascript, but it doesn't work. This is the Typescript: ``` export function ObservableProperty() { return (obj: Observable, key: string) => { let storedValue = obj[key]; Object.defineProperty(...
2021/03/29
[ "https://Stackoverflow.com/questions/66862650", "https://Stackoverflow.com", "https://Stackoverflow.com/users/424706/" ]
Decorators are a TypeScript thing, not a JavaScript thing ([yet](https://github.com/tc39/proposal-decorators)) Looking at the [TypeScript Docs](https://www.typescriptlang.org/docs/handbook/decorators.html), you can take their example (or even your example for that matter), and throw it in their Playground to get a the...
Decorators are still a proposal, and have not yet officially been added to JS. They're currently undergoing a major redesign and they will be quite different from the current TypeScript implementation, which is based on the first version of the proposal. You can follow progress on the proposal here: <https://github.com...
55,618,061
I do not understand why after clicking the link "undefined" is shown. Does anyone know why? ```js let allBlocks = ["one","two"]; for (i = 0; i < allBlocks.length; i++) { document.body.innerHTML += '<p id="" onclick="test(allBlocks[i])">Link</p>'; } function test(n){ alert(n); } ```
2019/04/10
[ "https://Stackoverflow.com/questions/55618061", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11341802/" ]
Even `i` is in global scope after the loop value of `i` would be array length so it would be like `array[array.length]` which will be `undefined`. To make it work append the value of `i` at that point along with string. ```js let allBlocks = ["one", "two"]; for (i = 0; i < allBlocks.length; i++) { document.body....
Maybe what you need is string interpolation ``` for (i = 0; i < allBlocks.length; i++) { document.body.innerHTML += `<p id="" onclick="test(${allBlocks[i]})">Link</p>`; } function test(n){ alert(n); } ``` This will pass the value of `allblocks[i]` instead of just a string
55,618,061
I do not understand why after clicking the link "undefined" is shown. Does anyone know why? ```js let allBlocks = ["one","two"]; for (i = 0; i < allBlocks.length; i++) { document.body.innerHTML += '<p id="" onclick="test(allBlocks[i])">Link</p>'; } function test(n){ alert(n); } ```
2019/04/10
[ "https://Stackoverflow.com/questions/55618061", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11341802/" ]
Even `i` is in global scope after the loop value of `i` would be array length so it would be like `array[array.length]` which will be `undefined`. To make it work append the value of `i` at that point along with string. ```js let allBlocks = ["one", "two"]; for (i = 0; i < allBlocks.length; i++) { document.body....
..because `allBlocks[i]` is undefined. You need the value of `i` to be rendered in your HTML. ```js let allBlocks = ["one","two"]; for (i = 0; i < allBlocks.length; i++) { document.body.innerHTML += '<p id="" onclick="test(allBlocks['+i+'])">Link</p>'; } function test(n){ alert(n); } ```
55,618,061
I do not understand why after clicking the link "undefined" is shown. Does anyone know why? ```js let allBlocks = ["one","two"]; for (i = 0; i < allBlocks.length; i++) { document.body.innerHTML += '<p id="" onclick="test(allBlocks[i])">Link</p>'; } function test(n){ alert(n); } ```
2019/04/10
[ "https://Stackoverflow.com/questions/55618061", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11341802/" ]
Because your code in the click handler is ``` test(allBlocks[i]) ``` It would appear your code is at global scope, which is the only reason it's not throwing an error. When the click occurs, `i` has the value `allBlocks.length`, which is beyond the end of the array. Accessing an array entry that isn't there results ...
Even `i` is in global scope after the loop value of `i` would be array length so it would be like `array[array.length]` which will be `undefined`. To make it work append the value of `i` at that point along with string. ```js let allBlocks = ["one", "two"]; for (i = 0; i < allBlocks.length; i++) { document.body....
55,618,061
I do not understand why after clicking the link "undefined" is shown. Does anyone know why? ```js let allBlocks = ["one","two"]; for (i = 0; i < allBlocks.length; i++) { document.body.innerHTML += '<p id="" onclick="test(allBlocks[i])">Link</p>'; } function test(n){ alert(n); } ```
2019/04/10
[ "https://Stackoverflow.com/questions/55618061", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11341802/" ]
Even `i` is in global scope after the loop value of `i` would be array length so it would be like `array[array.length]` which will be `undefined`. To make it work append the value of `i` at that point along with string. ```js let allBlocks = ["one", "two"]; for (i = 0; i < allBlocks.length; i++) { document.body....
`i` is acting as a global variable. Also you can use template literals ```js let allBlocks = ["one", "two"]; for (let i = 0; i < allBlocks.length; i++) { document.body.innerHTML += `<p id="" onclick="test(allBlocks[${i}])">Link</p>`; } function test(n) { alert(n); } ```
55,618,061
I do not understand why after clicking the link "undefined" is shown. Does anyone know why? ```js let allBlocks = ["one","two"]; for (i = 0; i < allBlocks.length; i++) { document.body.innerHTML += '<p id="" onclick="test(allBlocks[i])">Link</p>'; } function test(n){ alert(n); } ```
2019/04/10
[ "https://Stackoverflow.com/questions/55618061", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11341802/" ]
Maybe what you need is string interpolation ``` for (i = 0; i < allBlocks.length; i++) { document.body.innerHTML += `<p id="" onclick="test(${allBlocks[i]})">Link</p>`; } function test(n){ alert(n); } ``` This will pass the value of `allblocks[i]` instead of just a string
..because `allBlocks[i]` is undefined. You need the value of `i` to be rendered in your HTML. ```js let allBlocks = ["one","two"]; for (i = 0; i < allBlocks.length; i++) { document.body.innerHTML += '<p id="" onclick="test(allBlocks['+i+'])">Link</p>'; } function test(n){ alert(n); } ```
55,618,061
I do not understand why after clicking the link "undefined" is shown. Does anyone know why? ```js let allBlocks = ["one","two"]; for (i = 0; i < allBlocks.length; i++) { document.body.innerHTML += '<p id="" onclick="test(allBlocks[i])">Link</p>'; } function test(n){ alert(n); } ```
2019/04/10
[ "https://Stackoverflow.com/questions/55618061", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11341802/" ]
Because your code in the click handler is ``` test(allBlocks[i]) ``` It would appear your code is at global scope, which is the only reason it's not throwing an error. When the click occurs, `i` has the value `allBlocks.length`, which is beyond the end of the array. Accessing an array entry that isn't there results ...
Maybe what you need is string interpolation ``` for (i = 0; i < allBlocks.length; i++) { document.body.innerHTML += `<p id="" onclick="test(${allBlocks[i]})">Link</p>`; } function test(n){ alert(n); } ``` This will pass the value of `allblocks[i]` instead of just a string
55,618,061
I do not understand why after clicking the link "undefined" is shown. Does anyone know why? ```js let allBlocks = ["one","two"]; for (i = 0; i < allBlocks.length; i++) { document.body.innerHTML += '<p id="" onclick="test(allBlocks[i])">Link</p>'; } function test(n){ alert(n); } ```
2019/04/10
[ "https://Stackoverflow.com/questions/55618061", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11341802/" ]
Because your code in the click handler is ``` test(allBlocks[i]) ``` It would appear your code is at global scope, which is the only reason it's not throwing an error. When the click occurs, `i` has the value `allBlocks.length`, which is beyond the end of the array. Accessing an array entry that isn't there results ...
..because `allBlocks[i]` is undefined. You need the value of `i` to be rendered in your HTML. ```js let allBlocks = ["one","two"]; for (i = 0; i < allBlocks.length; i++) { document.body.innerHTML += '<p id="" onclick="test(allBlocks['+i+'])">Link</p>'; } function test(n){ alert(n); } ```
55,618,061
I do not understand why after clicking the link "undefined" is shown. Does anyone know why? ```js let allBlocks = ["one","two"]; for (i = 0; i < allBlocks.length; i++) { document.body.innerHTML += '<p id="" onclick="test(allBlocks[i])">Link</p>'; } function test(n){ alert(n); } ```
2019/04/10
[ "https://Stackoverflow.com/questions/55618061", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11341802/" ]
`i` is acting as a global variable. Also you can use template literals ```js let allBlocks = ["one", "two"]; for (let i = 0; i < allBlocks.length; i++) { document.body.innerHTML += `<p id="" onclick="test(allBlocks[${i}])">Link</p>`; } function test(n) { alert(n); } ```
..because `allBlocks[i]` is undefined. You need the value of `i` to be rendered in your HTML. ```js let allBlocks = ["one","two"]; for (i = 0; i < allBlocks.length; i++) { document.body.innerHTML += '<p id="" onclick="test(allBlocks['+i+'])">Link</p>'; } function test(n){ alert(n); } ```
55,618,061
I do not understand why after clicking the link "undefined" is shown. Does anyone know why? ```js let allBlocks = ["one","two"]; for (i = 0; i < allBlocks.length; i++) { document.body.innerHTML += '<p id="" onclick="test(allBlocks[i])">Link</p>'; } function test(n){ alert(n); } ```
2019/04/10
[ "https://Stackoverflow.com/questions/55618061", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11341802/" ]
Because your code in the click handler is ``` test(allBlocks[i]) ``` It would appear your code is at global scope, which is the only reason it's not throwing an error. When the click occurs, `i` has the value `allBlocks.length`, which is beyond the end of the array. Accessing an array entry that isn't there results ...
`i` is acting as a global variable. Also you can use template literals ```js let allBlocks = ["one", "two"]; for (let i = 0; i < allBlocks.length; i++) { document.body.innerHTML += `<p id="" onclick="test(allBlocks[${i}])">Link</p>`; } function test(n) { alert(n); } ```
1,892,851
I have created a class which name is Manager and I have a Frame which name is BirthList and this frame has a table.I work with MySQL and I have entered some data in the "birthtable" in MySQL.and i want to add those data from MySQL table in to the table which is in my frame . HINT: birthList is a list of Birth objects. ...
2009/12/12
[ "https://Stackoverflow.com/questions/1892851", "https://Stackoverflow.com", "https://Stackoverflow.com/users/124339/" ]
At first glance, I would say your `Admin` instance is null, causing the NPE in the `addToBirthListFromMySQL()` method ``` public BirthList(Admin admin) { initComponents(); // where do you set this.admin to the parameter 'admin' ? ``` You also need to initialize the static variable `admin` of your static obje...
It's hard to tell because the line numbers in the stack trace don't seem to match your code, but do you ever set the "private static Admin admin;" variable in Manager to a non-null value?
1,892,851
I have created a class which name is Manager and I have a Frame which name is BirthList and this frame has a table.I work with MySQL and I have entered some data in the "birthtable" in MySQL.and i want to add those data from MySQL table in to the table which is in my frame . HINT: birthList is a list of Birth objects. ...
2009/12/12
[ "https://Stackoverflow.com/questions/1892851", "https://Stackoverflow.com", "https://Stackoverflow.com/users/124339/" ]
Instead of hunting the root cause in the dark, I think it's better to explain how and why NPE's are caused and how they can be avoided, so that the OP can apply the newly gained knowledge to hunt his/her own trivial problem. Look, object references (the variables) can contain either a fullworthy `Object` or simply *no...
It's hard to tell because the line numbers in the stack trace don't seem to match your code, but do you ever set the "private static Admin admin;" variable in Manager to a non-null value?
1,892,851
I have created a class which name is Manager and I have a Frame which name is BirthList and this frame has a table.I work with MySQL and I have entered some data in the "birthtable" in MySQL.and i want to add those data from MySQL table in to the table which is in my frame . HINT: birthList is a list of Birth objects. ...
2009/12/12
[ "https://Stackoverflow.com/questions/1892851", "https://Stackoverflow.com", "https://Stackoverflow.com/users/124339/" ]
Instead of hunting the root cause in the dark, I think it's better to explain how and why NPE's are caused and how they can be avoided, so that the OP can apply the newly gained knowledge to hunt his/her own trivial problem. Look, object references (the variables) can contain either a fullworthy `Object` or simply *no...
At first glance, I would say your `Admin` instance is null, causing the NPE in the `addToBirthListFromMySQL()` method ``` public BirthList(Admin admin) { initComponents(); // where do you set this.admin to the parameter 'admin' ? ``` You also need to initialize the static variable `admin` of your static obje...
1,892,851
I have created a class which name is Manager and I have a Frame which name is BirthList and this frame has a table.I work with MySQL and I have entered some data in the "birthtable" in MySQL.and i want to add those data from MySQL table in to the table which is in my frame . HINT: birthList is a list of Birth objects. ...
2009/12/12
[ "https://Stackoverflow.com/questions/1892851", "https://Stackoverflow.com", "https://Stackoverflow.com/users/124339/" ]
At first glance, I would say your `Admin` instance is null, causing the NPE in the `addToBirthListFromMySQL()` method ``` public BirthList(Admin admin) { initComponents(); // where do you set this.admin to the parameter 'admin' ? ``` You also need to initialize the static variable `admin` of your static obje...
If line 272 of `Manager.java` is: ``` admin.birthList.add(list1); ``` and if `admin` is not `null` which is my understanding of your updates, then the conclusion seems pretty obvious: `birthlist` is `null` and the code breaks when you call the `add()` method on it. My guess is that your `Admin` class looks somethin...
1,892,851
I have created a class which name is Manager and I have a Frame which name is BirthList and this frame has a table.I work with MySQL and I have entered some data in the "birthtable" in MySQL.and i want to add those data from MySQL table in to the table which is in my frame . HINT: birthList is a list of Birth objects. ...
2009/12/12
[ "https://Stackoverflow.com/questions/1892851", "https://Stackoverflow.com", "https://Stackoverflow.com/users/124339/" ]
Instead of hunting the root cause in the dark, I think it's better to explain how and why NPE's are caused and how they can be avoided, so that the OP can apply the newly gained knowledge to hunt his/her own trivial problem. Look, object references (the variables) can contain either a fullworthy `Object` or simply *no...
If line 272 of `Manager.java` is: ``` admin.birthList.add(list1); ``` and if `admin` is not `null` which is my understanding of your updates, then the conclusion seems pretty obvious: `birthlist` is `null` and the code breaks when you call the `add()` method on it. My guess is that your `Admin` class looks somethin...
18,814,496
I have a JSON witch looks something like this ``` { "English": "en", "Francais": "fr", "German": "gm" } ``` Now I need to print this data in HTML structure witch looks like this ``` <ul id="links"> <li class="home"> <a href="#"></a> </li> <li...
2013/09/15
[ "https://Stackoverflow.com/questions/18814496", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2590328/" ]
Use [jQuery template](http://plugins.jquery.com/loadTemplate/) to bind the Html. [Some Sample](http://weblogs.asp.net/hajan/archive/2010/12/14/jquery-templates-supported-tags.aspx)
Something like that: ``` var getBlock = function(skipLang) { var str = '\ <ul id="links">\ <li class="home">\ <a href="#"></a>\ </li>\ <li class="languages">\ <a href="#">' + data[skipLang] + '</a>\ <ul class="available">\ ...
18,814,496
I have a JSON witch looks something like this ``` { "English": "en", "Francais": "fr", "German": "gm" } ``` Now I need to print this data in HTML structure witch looks like this ``` <ul id="links"> <li class="home"> <a href="#"></a> </li> <li...
2013/09/15
[ "https://Stackoverflow.com/questions/18814496", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2590328/" ]
Use [jQuery template](http://plugins.jquery.com/loadTemplate/) to bind the Html. [Some Sample](http://weblogs.asp.net/hajan/archive/2010/12/14/jquery-templates-supported-tags.aspx)
Although using templating engine is an option for simpler code, for this case you can directly run a for loop and assign HTML within javascript code easily. HTML part is going to be something like this ``` <ul id="links"> <li class="home"> <a href="#">home</a> </li> <li class="languages"> ...
18,814,496
I have a JSON witch looks something like this ``` { "English": "en", "Francais": "fr", "German": "gm" } ``` Now I need to print this data in HTML structure witch looks like this ``` <ul id="links"> <li class="home"> <a href="#"></a> </li> <li...
2013/09/15
[ "https://Stackoverflow.com/questions/18814496", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2590328/" ]
Use [jQuery template](http://plugins.jquery.com/loadTemplate/) to bind the Html. [Some Sample](http://weblogs.asp.net/hajan/archive/2010/12/14/jquery-templates-supported-tags.aspx)
Here is a bit that will get you two new objects, one for the first object property/value and another for the remaining. Still not clear what is done with it once you have it, but let me know if it helps: ``` // This can be replaced with existing data or updated to var langs = data; var langs = {"English": "en", "Franc...
43,177,742
Not sure why my \*ngFor loop is printing nothing out. I have the following code in an html file: ``` <table class="table table-hover"> <thead> <tr> <th>Name</th> <th>Email</th> <th>Company</th> <th>Status</th> </tr> </thead> <tbody> <!...
2017/04/03
[ "https://Stackoverflow.com/questions/43177742", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1409312/" ]
I think what you want is ```ts <ng-container *ngFor="let xb of tempData"> ``` or ```ts <ng-template ngFor let-xb [ngForOf]="tempData"> ```
For getting index as well: `<ng-template ngFor let-xb [ngForOf]="tempData" let-index="index">`
16,883,875
In this code I want to increment `index` to put it to each `yield`ing result. ``` var index=0 for(str <- splitToStrings(text) ) yield { if (index != 0) index += 1 // but index is equal to `0` all the time new Word(str, UNKNOWN_FORM, index ) } ``` Why I can not change `index` ? And what the best...
2013/06/02
[ "https://Stackoverflow.com/questions/16883875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/369759/" ]
The `zipWithIndex` method on most sequence-like collections will give you a zero-based index, incrementing with each element: ``` for ((str, index) <- splitToStrings(text).zipWithIndex) yield new Word(str, UNKNOWN_FORM, index) ```
Because initially index is set to 0, thus your condition `index != 0` is never executes to true and index is never got incremented. ~~Maybe you don't need this condition? Maybe you can count results afterwards?~~ Now I see that index is used within loop. Then you have to either use [@BenJames answer](https://stackoverf...
16,883,875
In this code I want to increment `index` to put it to each `yield`ing result. ``` var index=0 for(str <- splitToStrings(text) ) yield { if (index != 0) index += 1 // but index is equal to `0` all the time new Word(str, UNKNOWN_FORM, index ) } ``` Why I can not change `index` ? And what the best...
2013/06/02
[ "https://Stackoverflow.com/questions/16883875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/369759/" ]
Because initially index is set to 0, thus your condition `index != 0` is never executes to true and index is never got incremented. ~~Maybe you don't need this condition? Maybe you can count results afterwards?~~ Now I see that index is used within loop. Then you have to either use [@BenJames answer](https://stackoverf...
``` splitToStrings(text).foldLeft(0,List[Word]){(a,b) => { if(a._1!=0) (a._1+1,new Word(str, UNKNOWN_FORM, index) :: b) else (a._1,new Word(str, UNKNOWN_FORM, index) :: b) }} ``` I am using `foldLeft` here with a tuple as: starting base with `index = 0` and an empty `List`. I then iterate over each element. Ab...
16,883,875
In this code I want to increment `index` to put it to each `yield`ing result. ``` var index=0 for(str <- splitToStrings(text) ) yield { if (index != 0) index += 1 // but index is equal to `0` all the time new Word(str, UNKNOWN_FORM, index ) } ``` Why I can not change `index` ? And what the best...
2013/06/02
[ "https://Stackoverflow.com/questions/16883875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/369759/" ]
Because initially index is set to 0, thus your condition `index != 0` is never executes to true and index is never got incremented. ~~Maybe you don't need this condition? Maybe you can count results afterwards?~~ Now I see that index is used within loop. Then you have to either use [@BenJames answer](https://stackoverf...
`zipWithIndex` will copy and create a new collection, so better make it lazy when the collection is potentially large ``` for ((str, index) <- splitToStrings(text).view.zipWithIndex) yield new Word(str, UNKNOWN_FORM, index) ``` In fact, if you are working with an indexed sequence, then a more efficient way is to u...
16,883,875
In this code I want to increment `index` to put it to each `yield`ing result. ``` var index=0 for(str <- splitToStrings(text) ) yield { if (index != 0) index += 1 // but index is equal to `0` all the time new Word(str, UNKNOWN_FORM, index ) } ``` Why I can not change `index` ? And what the best...
2013/06/02
[ "https://Stackoverflow.com/questions/16883875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/369759/" ]
The `zipWithIndex` method on most sequence-like collections will give you a zero-based index, incrementing with each element: ``` for ((str, index) <- splitToStrings(text).zipWithIndex) yield new Word(str, UNKNOWN_FORM, index) ```
``` splitToStrings(text).foldLeft(0,List[Word]){(a,b) => { if(a._1!=0) (a._1+1,new Word(str, UNKNOWN_FORM, index) :: b) else (a._1,new Word(str, UNKNOWN_FORM, index) :: b) }} ``` I am using `foldLeft` here with a tuple as: starting base with `index = 0` and an empty `List`. I then iterate over each element. Ab...
16,883,875
In this code I want to increment `index` to put it to each `yield`ing result. ``` var index=0 for(str <- splitToStrings(text) ) yield { if (index != 0) index += 1 // but index is equal to `0` all the time new Word(str, UNKNOWN_FORM, index ) } ``` Why I can not change `index` ? And what the best...
2013/06/02
[ "https://Stackoverflow.com/questions/16883875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/369759/" ]
The `zipWithIndex` method on most sequence-like collections will give you a zero-based index, incrementing with each element: ``` for ((str, index) <- splitToStrings(text).zipWithIndex) yield new Word(str, UNKNOWN_FORM, index) ```
`zipWithIndex` will copy and create a new collection, so better make it lazy when the collection is potentially large ``` for ((str, index) <- splitToStrings(text).view.zipWithIndex) yield new Word(str, UNKNOWN_FORM, index) ``` In fact, if you are working with an indexed sequence, then a more efficient way is to u...
16,883,875
In this code I want to increment `index` to put it to each `yield`ing result. ``` var index=0 for(str <- splitToStrings(text) ) yield { if (index != 0) index += 1 // but index is equal to `0` all the time new Word(str, UNKNOWN_FORM, index ) } ``` Why I can not change `index` ? And what the best...
2013/06/02
[ "https://Stackoverflow.com/questions/16883875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/369759/" ]
`zipWithIndex` will copy and create a new collection, so better make it lazy when the collection is potentially large ``` for ((str, index) <- splitToStrings(text).view.zipWithIndex) yield new Word(str, UNKNOWN_FORM, index) ``` In fact, if you are working with an indexed sequence, then a more efficient way is to u...
``` splitToStrings(text).foldLeft(0,List[Word]){(a,b) => { if(a._1!=0) (a._1+1,new Word(str, UNKNOWN_FORM, index) :: b) else (a._1,new Word(str, UNKNOWN_FORM, index) :: b) }} ``` I am using `foldLeft` here with a tuple as: starting base with `index = 0` and an empty `List`. I then iterate over each element. Ab...
3,115,948
In my iphone app,I want to let the user upload an image to his facebook photo Album and publish a story at the same time.The story's media field contains the uploaded image's url.I successly uploaded the photo and got the result's "link" and "src\_small" property.But when I use FBStreamDialog to publish the story,I got...
2010/06/25
[ "https://Stackoverflow.com/questions/3115948", "https://Stackoverflow.com", "https://Stackoverflow.com/users/355393/" ]
you can't use that picture or the picture from facebook itself you can upload the picture on other servers or upload it to online photo sharing like picasa
I got this functionality to work with ShareKit - it's really good: <http://www.getsharekit.com/> It's also open source, so you can see how they do it inside... Good luck!
37,770,348
I'm really interested in interrupting incremental lists of items created in Rmarkdown with RStudio, to show plots and figures, then retake the list highlighting. This is quite straightforward in Latex, but I couldn't figure out how to achieve the same result using Rmarkdown. Below is some beamer example. ``` --- title...
2016/06/12
[ "https://Stackoverflow.com/questions/37770348", "https://Stackoverflow.com", "https://Stackoverflow.com/users/792000/" ]
first - you do not need the comma in the select, second - ensure that this is the only element with the id of status, third - simply check the $status value in each option and echo selected if it is. ``` echo "<select name = 'status' id = 'status'> <option value='Interested'"; if($status == "Interes...
Change this ``` echo "<select name = 'status', id = status> <option value='Interested'>Interested</option> <option value='Not Interested'>Not Interested</option> </select><br>"; ``` to this ``` // Set the selected attributes based on the value of status $interested = ($status === 'Interested') ?...
37,770,348
I'm really interested in interrupting incremental lists of items created in Rmarkdown with RStudio, to show plots and figures, then retake the list highlighting. This is quite straightforward in Latex, but I couldn't figure out how to achieve the same result using Rmarkdown. Below is some beamer example. ``` --- title...
2016/06/12
[ "https://Stackoverflow.com/questions/37770348", "https://Stackoverflow.com", "https://Stackoverflow.com/users/792000/" ]
first - you do not need the comma in the select, second - ensure that this is the only element with the id of status, third - simply check the $status value in each option and echo selected if it is. ``` echo "<select name = 'status' id = 'status'> <option value='Interested'"; if($status == "Interes...
since the default is the first option `Interested`, then `if ($status === "Not Interested")` set the [`option` attribute `selected`](http://www.w3schools.com/tags/att_option_selected.asp) ``` <?php if ($status === "Not Interested") $selected = "selected"; else $selected = ""; echo "<select name = 'status', id = stat...
14,789,226
I'm really confused right now. I'm using following code in another project without any problems: ``` public class ReadOnlyTable<T extends Model> implements ReadOnly<T> { protected at.viswars.database.framework.core.DatabaseTable datasource; private boolean debug = true; protected ReadOnlyTable() { initTable(); } ...
2013/02/09
[ "https://Stackoverflow.com/questions/14789226", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2057248/" ]
It is impossible to retrieve `String` from `go`. The type parameter of an object instantiation expression (`new GenericObject<String>()`) is not present anywhere at runtime. This is type erasure. The technique you are trying to use concerns when a *class* or *interface* extends or implements another class or interface...
You are calling `getGenericSuperclass()`, but your class does not have a *generic* superclass. Its superclass is `Object`, which cannot be cast to `ParameterizedType` as the error says. You probably want to use `getGenericInterfaces()[0]`, since your class only implements an interface. More info in here: <http://doc...
56,924,735
I don't know how to resolve this problem,can someone help me. ``` The following packages have unmet dependencies: testdisk : Depends: libntfs-3g861 E: Unable to correct problems, you have held broken packages. ```
2019/07/07
[ "https://Stackoverflow.com/questions/56924735", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10576808/" ]
Can you try after changing your template like this: ``` <ul class="nav navbar-nav"> <li><a [routerLink]='["/search"]'>Search <span class="slider"></span></a></li> <li *ngIf="isLoggedIn$ | async"><a (click)="logout()">Logout</a></li> </ul> ``` Notice the `async` pipe to unwrap the observable value. Not...
to your last comment, this is happening because the service is being re-initialized and your observable are being reset. Add this to your constructor ``` if(localStorage.getItem('currentUser') != null) this.loggedIn.next(true); ``` This worked for me.
723,613
A practice question for my analysis midterm is as follows: Give an example of a function $f:[a, b] \to\ \mathbb R$ such that $f \in R[a, c] \forall c \in\ [a, b)$ but $$f \notin R[a, b]$$ I can't think of any examples. Any help is much appreciated. Thanks in advance.
2014/03/23
[ "https://math.stackexchange.com/questions/723613", "https://math.stackexchange.com", "https://math.stackexchange.com/users/114014/" ]
$$f(x)=\left\{\begin{array}{ccc}\frac1{1-x}&\mathrm{if}&x\in[0,1)\\0&\mathrm{if}&x=1\end{array}\right.$$
Consider the function f(x) = 1/(1 - x) on [0, 1]. You can assign f(1) = any number.
9,246,871
I'm trying to delete the folder `mapeditor` from my Java engine on GitHub here (https://github.com/UrbanTwitch/Mystik-RPG) I'm on Git Bash.. messing around with `rm` and `-rf`but I can't seem to do it. How do I remove `mapeditor` folder from `Mystik-RPG` completely? Thanks.
2012/02/12
[ "https://Stackoverflow.com/questions/9246871", "https://Stackoverflow.com", "https://Stackoverflow.com/users/272501/" ]
From the `Mystik-RPG` folder: ``` git rm -rf mapeditor ```
You need to `git rm` the folder, then `git commit` the removal. Finally, `git push` your new commit to github. Just deleting the folder won't tell git you wish to have it removed - that would put it into the "tracked but missing" state. You want it to transition to the "untracked" state, which is what `git rm` is for.
46,787,270
I'm using JavaMail to the handle emails. Subject is encoded in following charset: `Subject: =?x-mac-ce?Q?Wdro=BFenia_znaku_CE?=` How to decode this using a JavaMail.
2017/10/17
[ "https://Stackoverflow.com/questions/46787270", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1087407/" ]
Windows [seems to use](https://msdn.microsoft.com/en-us/library/ms537500(v=vs.85).aspx) `x-mac-ce` as an alias for `Windows-1250` codepage (matching the CP1250 JDK charset). **JavaMail** maintains a map of "MIME to Java" charset aliases internally, as resolved with the [MimeUtility.javaCharset](http://grepcode.com/fi...
Obviously x-mac-ce is a non-standard charset. JavaMail depends on the JDK to handle conversion of charset encodings to Unicode strings. If, as described above, x-mac-ce is equivlanet to the CP1250 charset, the JavaMail FAQ explains [how to use the JDK's facilities to map unknown charsets to known charsets](https://java...
10,019,594
I have a database with an email field, and it cycles through the database to grab all the transactions concerning a certain email address. Users putting in lowercase letters when their email is stored with a couple capitals is causing it not to show their transactions. When I modify it to match perfect case with the o...
2012/04/04
[ "https://Stackoverflow.com/questions/10019594", "https://Stackoverflow.com", "https://Stackoverflow.com/users/871966/" ]
A mixed PHP/MySQL solution: ``` $result = mysql_query(" SELECT * FROM example_orders WHERE LOWER(buyer_email) = '" . strtolower($useremail) . "'; ") or die(mysql_error()); ``` What it does is converting both sides of the comparison to lowercase. This is not very efficient, because the use of `LOWER` wil...
If you do `WHERE buyer_email LIKE '...'` it'll by default do a case-insensitive match. With e-mail fields, though, I prefer to lowercase the e-mail address when I insert it into the DB.
10,019,594
I have a database with an email field, and it cycles through the database to grab all the transactions concerning a certain email address. Users putting in lowercase letters when their email is stored with a couple capitals is causing it not to show their transactions. When I modify it to match perfect case with the o...
2012/04/04
[ "https://Stackoverflow.com/questions/10019594", "https://Stackoverflow.com", "https://Stackoverflow.com/users/871966/" ]
Uh... you realize that email addresses are case *sensitive*, right? From [RFC 2821](https://www.ietf.org/rfc/rfc2821.txt): > > Verbs and argument values (e.g., "TO:" or "to:" in the RCPT command > > and extension name keywords) are not case sensitive, with the sole > > exception in this specification of a mai...
If you do `WHERE buyer_email LIKE '...'` it'll by default do a case-insensitive match. With e-mail fields, though, I prefer to lowercase the e-mail address when I insert it into the DB.
10,019,594
I have a database with an email field, and it cycles through the database to grab all the transactions concerning a certain email address. Users putting in lowercase letters when their email is stored with a couple capitals is causing it not to show their transactions. When I modify it to match perfect case with the o...
2012/04/04
[ "https://Stackoverflow.com/questions/10019594", "https://Stackoverflow.com", "https://Stackoverflow.com/users/871966/" ]
A mixed PHP/MySQL solution: ``` $result = mysql_query(" SELECT * FROM example_orders WHERE LOWER(buyer_email) = '" . strtolower($useremail) . "'; ") or die(mysql_error()); ``` What it does is converting both sides of the comparison to lowercase. This is not very efficient, because the use of `LOWER` wil...
Uh... you realize that email addresses are case *sensitive*, right? From [RFC 2821](https://www.ietf.org/rfc/rfc2821.txt): > > Verbs and argument values (e.g., "TO:" or "to:" in the RCPT command > > and extension name keywords) are not case sensitive, with the sole > > exception in this specification of a mai...
229,587
Related to the following question but looking for a PyQGIS method: [QGIS Layer Order Panel - add layers at top of layer order](https://gis.stackexchange.com/questions/180943/qgis-layer-order-panel-add-layers-at-top-of-layer-order) --- The following is a simple setup containing a group with three layers. [![Simple s...
2017/02/23
[ "https://gis.stackexchange.com/questions/229587", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/25814/" ]
You can set layer order in the `Layer Order Panel` "**manually**" using `QgsLayerTreeCanvasBridge.setCustomLayerOrder()` method, which receives an ordered list of layer ids. For instance (assuming you just loaded `vlayer`): ``` bridge = iface.layerTreeCanvasBridge() order = bridge.customLayerOrder() order.insert( 0, ...
I am not so familiar with pyqgis, but when I changed the line in your code from ``` group.insertChildNode(-1, QgsLayerTreeLayer(vlayer)) ``` to ``` group.insertChildNode(0, QgsLayerTreeLayer(vlayer)) ``` It was intserted at the top of the group, not the bottom.
229,587
Related to the following question but looking for a PyQGIS method: [QGIS Layer Order Panel - add layers at top of layer order](https://gis.stackexchange.com/questions/180943/qgis-layer-order-panel-add-layers-at-top-of-layer-order) --- The following is a simple setup containing a group with three layers. [![Simple s...
2017/02/23
[ "https://gis.stackexchange.com/questions/229587", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/25814/" ]
Hi sorry I can't comment, but the method "bridge.customLayerOrder()" doesn't exist in QGis 3.x I've found maybe a substitute command: ``` bridge = iface.layerTreeCanvasBridge() bridge.rootGroup().customLayerOrder() ``` From <https://qgis.org/api/classQgsLayerTree.html#aab7a55f2e61f0ff1dbea6ceb89e8b366>: > > The ...
I am not so familiar with pyqgis, but when I changed the line in your code from ``` group.insertChildNode(-1, QgsLayerTreeLayer(vlayer)) ``` to ``` group.insertChildNode(0, QgsLayerTreeLayer(vlayer)) ``` It was intserted at the top of the group, not the bottom.
229,587
Related to the following question but looking for a PyQGIS method: [QGIS Layer Order Panel - add layers at top of layer order](https://gis.stackexchange.com/questions/180943/qgis-layer-order-panel-add-layers-at-top-of-layer-order) --- The following is a simple setup containing a group with three layers. [![Simple s...
2017/02/23
[ "https://gis.stackexchange.com/questions/229587", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/25814/" ]
Based on this (old) question and some other research, I've successfully added a handler to my QGIS 3.10 project to move all newly added layers to the top of the custom layer order. Here's the relevant project macro code with v3 object references. ``` from qgis.core import QgsProject from qgis.utils import iface def o...
I am not so familiar with pyqgis, but when I changed the line in your code from ``` group.insertChildNode(-1, QgsLayerTreeLayer(vlayer)) ``` to ``` group.insertChildNode(0, QgsLayerTreeLayer(vlayer)) ``` It was intserted at the top of the group, not the bottom.
229,587
Related to the following question but looking for a PyQGIS method: [QGIS Layer Order Panel - add layers at top of layer order](https://gis.stackexchange.com/questions/180943/qgis-layer-order-panel-add-layers-at-top-of-layer-order) --- The following is a simple setup containing a group with three layers. [![Simple s...
2017/02/23
[ "https://gis.stackexchange.com/questions/229587", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/25814/" ]
You can set layer order in the `Layer Order Panel` "**manually**" using `QgsLayerTreeCanvasBridge.setCustomLayerOrder()` method, which receives an ordered list of layer ids. For instance (assuming you just loaded `vlayer`): ``` bridge = iface.layerTreeCanvasBridge() order = bridge.customLayerOrder() order.insert( 0, ...
Hi sorry I can't comment, but the method "bridge.customLayerOrder()" doesn't exist in QGis 3.x I've found maybe a substitute command: ``` bridge = iface.layerTreeCanvasBridge() bridge.rootGroup().customLayerOrder() ``` From <https://qgis.org/api/classQgsLayerTree.html#aab7a55f2e61f0ff1dbea6ceb89e8b366>: > > The ...
229,587
Related to the following question but looking for a PyQGIS method: [QGIS Layer Order Panel - add layers at top of layer order](https://gis.stackexchange.com/questions/180943/qgis-layer-order-panel-add-layers-at-top-of-layer-order) --- The following is a simple setup containing a group with three layers. [![Simple s...
2017/02/23
[ "https://gis.stackexchange.com/questions/229587", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/25814/" ]
You can set layer order in the `Layer Order Panel` "**manually**" using `QgsLayerTreeCanvasBridge.setCustomLayerOrder()` method, which receives an ordered list of layer ids. For instance (assuming you just loaded `vlayer`): ``` bridge = iface.layerTreeCanvasBridge() order = bridge.customLayerOrder() order.insert( 0, ...
Based on this (old) question and some other research, I've successfully added a handler to my QGIS 3.10 project to move all newly added layers to the top of the custom layer order. Here's the relevant project macro code with v3 object references. ``` from qgis.core import QgsProject from qgis.utils import iface def o...
229,587
Related to the following question but looking for a PyQGIS method: [QGIS Layer Order Panel - add layers at top of layer order](https://gis.stackexchange.com/questions/180943/qgis-layer-order-panel-add-layers-at-top-of-layer-order) --- The following is a simple setup containing a group with three layers. [![Simple s...
2017/02/23
[ "https://gis.stackexchange.com/questions/229587", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/25814/" ]
Hi sorry I can't comment, but the method "bridge.customLayerOrder()" doesn't exist in QGis 3.x I've found maybe a substitute command: ``` bridge = iface.layerTreeCanvasBridge() bridge.rootGroup().customLayerOrder() ``` From <https://qgis.org/api/classQgsLayerTree.html#aab7a55f2e61f0ff1dbea6ceb89e8b366>: > > The ...
Based on this (old) question and some other research, I've successfully added a handler to my QGIS 3.10 project to move all newly added layers to the top of the custom layer order. Here's the relevant project macro code with v3 object references. ``` from qgis.core import QgsProject from qgis.utils import iface def o...
56,194,991
Consider the following numbers: ``` 1000.10 1000.11 1000.113 ``` I would like to get these to print out in python as: ``` 1,000.10 1,000.11 1,000.11 ``` The following transformations almost do this, except that whenever the second digit to the right of the decimal point is a zero, the zero is elided and as a resu...
2019/05/18
[ "https://Stackoverflow.com/questions/56194991", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9399754/" ]
You want the format specifier `',.2f'`. `,`, as you noted, performs comma separation of thousands, while `.2f` specifies that two digits are to be retained: ``` print([f'{number:,.2f}' for number in n]) ``` Output: ``` ['1,000.10', '1,000.11', '1,000.11'] ```
You can simply use `f'{n:,.2f}'` to combine the thusand separator and the 2 decimal digits format specifiers: ``` for n in [1000.10, 1000.11, 1000.112]: print(f'{n:,.2f}') ``` Outputs ``` 1,000.10 1,000.11 1,000.11 ```
56,194,991
Consider the following numbers: ``` 1000.10 1000.11 1000.113 ``` I would like to get these to print out in python as: ``` 1,000.10 1,000.11 1,000.11 ``` The following transformations almost do this, except that whenever the second digit to the right of the decimal point is a zero, the zero is elided and as a resu...
2019/05/18
[ "https://Stackoverflow.com/questions/56194991", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9399754/" ]
You want the format specifier `',.2f'`. `,`, as you noted, performs comma separation of thousands, while `.2f` specifies that two digits are to be retained: ``` print([f'{number:,.2f}' for number in n]) ``` Output: ``` ['1,000.10', '1,000.11', '1,000.11'] ```
You might be able to do it like this: ``` num = 100.0 print(str(num) + "0") ``` So you print the number as a string plus 0 at the end. Update: So that it doesn’t do this to all numbers, try doing something like: ``` if num == 1000.10: #add the zero elif num == 1000.20: #again, add the zero #and so on and so on... ...
47,384,766
I know this question has been asked already. However, when I follow the answer given to that question it doesn't work. This is my JS function and the relevant HTML ```js function myFunction() { document.getElementById("submit").innerHTML = "LOADING..."; } ``` ```html <input class="textbox" type="number" id="nu...
2017/11/20
[ "https://Stackoverflow.com/questions/47384766", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7870395/" ]
You have to config your web server to response `index.html` when receive requests like `/place/66bb50b7a5` [vue-router doc](https://router.vuejs.org/en/essentials/history-mode.html) have example configurations for Apache, nginx, IIS... For MAMP (apache): 1. create an file name `.htaccess` in your MAMP `htdocs` folde...
I've had the same problem and I've solved it. my case in apache: 1. create `.htaccess` file in the same folder as index.html 2. copy-paste the following script, and all works charmly. ``` <IfModule mod_rewrite.c> Rew/riteEngine On RewriteBase / RewriteRule ^index\.html$ - [L] RewriteCond %{REQUEST_FILENAME} ...
64,195
If one has built a kasher sukkah, with its own completed skhakh but there is a tree branch that leans against the skhakh, is it still kasher?
2015/09/27
[ "https://judaism.stackexchange.com/questions/64195", "https://judaism.stackexchange.com", "https://judaism.stackexchange.com/users/9045/" ]
There are many details found in the Shulchan Aruch siman 626. If the branch only provides a minority of the shade etc. In one situation having the branch mixed in with the kosher schach is actually beneficial. But according to one opinion in the Shulchan Aruch, one should never under any circumstances have any bran...
Since the living branch covers only a small part of the succa, you can just not sit under the branch. Most succot (these days) are so large that a small area of invalid roof does not invalidate the whole succa. (See Succah 13b, I think.)
69,274
I have disabled the touchscreen on my official 7" display by adding the below line to my /boot/config.txt ``` # disable the touchscreen disable_touchscreen=1 ``` While this works, it also eliminates all ability to programmatically control the display. Everything under /sys/class/backlight disappears. Is the...
2017/07/02
[ "https://raspberrypi.stackexchange.com/questions/69274", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/69672/" ]
If you're using your screen with X server (GUI), then you can simply find its ID in the output of `xinput --list` and disable it with `xinput disable <ID>`. Your touchscreen will still generate input events, but your X server will not forward those events to the applications. You will want to execute the `xinput disab...
yes indeed it's possible, if I remember correctly there's a pin dedicated to the touchscreen functionality, if you unplug it you'll loose the ability.
24,681,229
Does anyone know how to associate a floating IP address with a load balancer in a heat template? I can create a load balancer on an instance (or a bunch of instances, but starting small) in heat; and can associate a floating IP address to the load balancer in Horizon, but I can't figure out how to do it through heat.
2014/07/10
[ "https://Stackoverflow.com/questions/24681229", "https://Stackoverflow.com", "https://Stackoverflow.com/users/833982/" ]
I just had to find the answer to this question myself. It turns out that the `vip` attribute of an `OS::Neutron::Pool` resource contains a few more keys than are documented [here](http://docs.openstack.org/developer/heat/template_guide/openstack.html#OS::Neutron::Pool-hot). In particular, the `vip` attribute contains ...
I had the same question in regard to Octavia rather then Neutron, however Larsks answer did point me in the right direction. The `OS::Octavia::LoadBalancer` object has a `vip_port_id` attribute which can be accessed in the same way: ``` port_id: get_attr: [lb1, vip_port_id] ```
21,668,250
I'm trying to make a program that will get the user input of a new file name, create the file, and write to it. It works but it will only write the first word of the string to the file. How can i get it to write the full string? thanks. ``` #include "stdafx.h" #include <fstream> #include <iostream> #include <string> u...
2014/02/10
[ "https://Stackoverflow.com/questions/21668250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3150762/" ]
According to [this post](https://stackoverflow.com/questions/5455802/how-to-read-a-complete-line-from-the-user-using-cin), you should consult [this reference](http://www.cplusplus.com/reference/fstream/fstream/) to use a method like getline(). Also, when you are writing out I recommend that you flush the output (cout....
You have to use `std::getline()` to read the entire line: ``` std::getline(std::cin >> std::ws, w); ``` The `>> std::ws` part gets rid of leading whitespace which is needed because the newline left in the stream from the previous extraction will prevent `std::getline()` from fully consuming the input. When insertin...