qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
68,046,767
I'm new in python, please have a look on the code below ``` n = 5 m = 5 mat = [[0]*m]*n print(mat) i = 0 while(i < m): mat[0][i] = i i += 1 print(mat) ``` This code gives output like - ``` [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]] [[0, 1, 2, 3, 4], [0, 1, 2, 3, 4]...
2021/06/19
[ "https://Stackoverflow.com/questions/68046767", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13275764/" ]
I have used SafetyNet API for accessing device's runtime env. I have kept signing certificate of app on server to verify its sha256 against what we get in the SafetyNet response. Below are the steps you can refer if applies to you too. 1. Get SHA256 fingerprint of signing X509Certificate MessageDigest md = MessageDig...
Now Google depreciated SafetyAPI and Introduced PlayIntegrity API for attestation. PlayIntegrity Service provides the response as follows. ``` { "tokenPayloadExternal": { "accountDetails": { "appLicensingVerdict": "LICENSED" }, "appIntegrity": { "appRecognitionVerdict": "PLAY_RECOGNIZED", ...
279,678
Will it be slower to place functions' defintions inside a main function? I usually do that if the subfunctions are short. However, with a long subfunction I usually place it outside as I think that would make it easier to read and run faster. Now I want to do it as the first method below as I want to make it s...
2023/02/07
[ "https://mathematica.stackexchange.com/questions/279678", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/87122/" ]
We may first create all k subsets of 1..n; Then we need to select n/k subsets that have no common elements. Toward this aim we define a function that, given a number of subsets, selects a further subset that has no common element. It repeats this recursively until n/k subsets. We then feed the first subset to our rout...
I define `permutationsNk[n,k]` for `Integer` arguments, where `k` divides into `n` (or, alternatively, where `k` belongs to the `Divisors` of `n`). Evaluating eg. `res=permutationsNk[4,2]` returns [![enter image description here](https://i.stack.imgur.com/LMt3r.png)](https://i.stack.imgur.com/LMt3r.png) Looking insi...
279,678
Will it be slower to place functions' defintions inside a main function? I usually do that if the subfunctions are short. However, with a long subfunction I usually place it outside as I think that would make it easier to read and run faster. Now I want to do it as the first method below as I want to make it s...
2023/02/07
[ "https://mathematica.stackexchange.com/questions/279678", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/87122/" ]
We may first create all k subsets of 1..n; Then we need to select n/k subsets that have no common elements. Toward this aim we define a function that, given a number of subsets, selects a further subset that has no common element. It repeats this recursively until n/k subsets. We then feed the first subset to our rout...
Here is one possible solution: ``` perm[set_List, k_Integer] := If[Length[set]<2k, List/@Subsets[set,{k}], Flatten[ Function[s,Prepend[#,s]&/@perm[Complement[ Drop[set,First@FirstPosition[set,First[s]]],s],k]] /@Subsets[set, {k}], 1] ]; perm[n_Integer, k_Integer] := perm[Range[n], k]; ``` It migh...
301,722
I can't connect to Wi-Fi in Ubuntu 12.04 with an Intel PRO/Wireless 3945ABG card. What can I do? Every time I try to connect to a wireless router it keeps asking for a password and even though I write the password down it never fully connects, it just stops after a while and asks for the password again.
2013/05/29
[ "https://askubuntu.com/questions/301722", "https://askubuntu.com", "https://askubuntu.com/users/162892/" ]
The error you get is likely because the Guest Additions CD image is already mounted. To see all mounted drives open a terminal in the guest to issue `mount`. This will give you (among others) a line similar to this: ``` /dev/sr0 on /media/takkat/VBOXADDITIONS_4.2.12_849801 type iso9660 (ro,nosuid,nodev,uid=1000,gid=1...
For what it's worth, I was unable to install the guest additions until I installed the extension pack from Oracle. After that, right-ctrl+d worked like a charm.
301,722
I can't connect to Wi-Fi in Ubuntu 12.04 with an Intel PRO/Wireless 3945ABG card. What can I do? Every time I try to connect to a wireless router it keeps asking for a password and even though I write the password down it never fully connects, it just stops after a while and asks for the password again.
2013/05/29
[ "https://askubuntu.com/questions/301722", "https://askubuntu.com", "https://askubuntu.com/users/162892/" ]
The error you get is likely because the Guest Additions CD image is already mounted. To see all mounted drives open a terminal in the guest to issue `mount`. This will give you (among others) a line similar to this: ``` /dev/sr0 on /media/takkat/VBOXADDITIONS_4.2.12_849801 type iso9660 (ro,nosuid,nodev,uid=1000,gid=1...
I tried this and it worked: 1. From the terminal (`Ctrl`+`Alt`+`T`) and enter the following commands: ``` cd /mnt cd /cdrom eject ``` 2. From the VirtualBox menu (top left pane) go to "device" and insert guest additions (it should work this time) 3. Then from the terminal again type: ``` sudo sh /media/cdrom/VBoxLi...
301,722
I can't connect to Wi-Fi in Ubuntu 12.04 with an Intel PRO/Wireless 3945ABG card. What can I do? Every time I try to connect to a wireless router it keeps asking for a password and even though I write the password down it never fully connects, it just stops after a while and asks for the password again.
2013/05/29
[ "https://askubuntu.com/questions/301722", "https://askubuntu.com", "https://askubuntu.com/users/162892/" ]
The error you get is likely because the Guest Additions CD image is already mounted. To see all mounted drives open a terminal in the guest to issue `mount`. This will give you (among others) a line similar to this: ``` /dev/sr0 on /media/takkat/VBOXADDITIONS_4.2.12_849801 type iso9660 (ro,nosuid,nodev,uid=1000,gid=1...
I had this problem but at the time I was running ubuntu as a guest (when you start up the system it asks if you want to install ubuntu or run as guest). As soon as I installed ubuntu on the box, the guest additions installed without any problems
301,722
I can't connect to Wi-Fi in Ubuntu 12.04 with an Intel PRO/Wireless 3945ABG card. What can I do? Every time I try to connect to a wireless router it keeps asking for a password and even though I write the password down it never fully connects, it just stops after a while and asks for the password again.
2013/05/29
[ "https://askubuntu.com/questions/301722", "https://askubuntu.com", "https://askubuntu.com/users/162892/" ]
The error you get is likely because the Guest Additions CD image is already mounted. To see all mounted drives open a terminal in the guest to issue `mount`. This will give you (among others) a line similar to this: ``` /dev/sr0 on /media/takkat/VBOXADDITIONS_4.2.12_849801 type iso9660 (ro,nosuid,nodev,uid=1000,gid=1...
my workaround in macosx 10.10 host ubuntu 12.04 guest is to copy the virtualbox guest additions iso to a shared folder and just use the terminal in my guest to run (sudo sh /pathto/VboxLinuxAdditions.run)
301,722
I can't connect to Wi-Fi in Ubuntu 12.04 with an Intel PRO/Wireless 3945ABG card. What can I do? Every time I try to connect to a wireless router it keeps asking for a password and even though I write the password down it never fully connects, it just stops after a while and asks for the password again.
2013/05/29
[ "https://askubuntu.com/questions/301722", "https://askubuntu.com", "https://askubuntu.com/users/162892/" ]
The error you get is likely because the Guest Additions CD image is already mounted. To see all mounted drives open a terminal in the guest to issue `mount`. This will give you (among others) a line similar to this: ``` /dev/sr0 on /media/takkat/VBOXADDITIONS_4.2.12_849801 type iso9660 (ro,nosuid,nodev,uid=1000,gid=1...
I ran into this problem recently (Sept 2017) trying to install Guest Additions into Oracle VM VirtualBox Manager version 5.1.28, in a newly-installed VM for Ubuntu version 16.04.3. The problem was indeed that the Guest Additions CD image was already mounted. To fix it: * In the VM Manager under Settings->Storage, unde...
301,722
I can't connect to Wi-Fi in Ubuntu 12.04 with an Intel PRO/Wireless 3945ABG card. What can I do? Every time I try to connect to a wireless router it keeps asking for a password and even though I write the password down it never fully connects, it just stops after a while and asks for the password again.
2013/05/29
[ "https://askubuntu.com/questions/301722", "https://askubuntu.com", "https://askubuntu.com/users/162892/" ]
I tried this and it worked: 1. From the terminal (`Ctrl`+`Alt`+`T`) and enter the following commands: ``` cd /mnt cd /cdrom eject ``` 2. From the VirtualBox menu (top left pane) go to "device" and insert guest additions (it should work this time) 3. Then from the terminal again type: ``` sudo sh /media/cdrom/VBoxLi...
For what it's worth, I was unable to install the guest additions until I installed the extension pack from Oracle. After that, right-ctrl+d worked like a charm.
301,722
I can't connect to Wi-Fi in Ubuntu 12.04 with an Intel PRO/Wireless 3945ABG card. What can I do? Every time I try to connect to a wireless router it keeps asking for a password and even though I write the password down it never fully connects, it just stops after a while and asks for the password again.
2013/05/29
[ "https://askubuntu.com/questions/301722", "https://askubuntu.com", "https://askubuntu.com/users/162892/" ]
I tried this and it worked: 1. From the terminal (`Ctrl`+`Alt`+`T`) and enter the following commands: ``` cd /mnt cd /cdrom eject ``` 2. From the VirtualBox menu (top left pane) go to "device" and insert guest additions (it should work this time) 3. Then from the terminal again type: ``` sudo sh /media/cdrom/VBoxLi...
I had this problem but at the time I was running ubuntu as a guest (when you start up the system it asks if you want to install ubuntu or run as guest). As soon as I installed ubuntu on the box, the guest additions installed without any problems
301,722
I can't connect to Wi-Fi in Ubuntu 12.04 with an Intel PRO/Wireless 3945ABG card. What can I do? Every time I try to connect to a wireless router it keeps asking for a password and even though I write the password down it never fully connects, it just stops after a while and asks for the password again.
2013/05/29
[ "https://askubuntu.com/questions/301722", "https://askubuntu.com", "https://askubuntu.com/users/162892/" ]
I tried this and it worked: 1. From the terminal (`Ctrl`+`Alt`+`T`) and enter the following commands: ``` cd /mnt cd /cdrom eject ``` 2. From the VirtualBox menu (top left pane) go to "device" and insert guest additions (it should work this time) 3. Then from the terminal again type: ``` sudo sh /media/cdrom/VBoxLi...
my workaround in macosx 10.10 host ubuntu 12.04 guest is to copy the virtualbox guest additions iso to a shared folder and just use the terminal in my guest to run (sudo sh /pathto/VboxLinuxAdditions.run)
301,722
I can't connect to Wi-Fi in Ubuntu 12.04 with an Intel PRO/Wireless 3945ABG card. What can I do? Every time I try to connect to a wireless router it keeps asking for a password and even though I write the password down it never fully connects, it just stops after a while and asks for the password again.
2013/05/29
[ "https://askubuntu.com/questions/301722", "https://askubuntu.com", "https://askubuntu.com/users/162892/" ]
I tried this and it worked: 1. From the terminal (`Ctrl`+`Alt`+`T`) and enter the following commands: ``` cd /mnt cd /cdrom eject ``` 2. From the VirtualBox menu (top left pane) go to "device" and insert guest additions (it should work this time) 3. Then from the terminal again type: ``` sudo sh /media/cdrom/VBoxLi...
I ran into this problem recently (Sept 2017) trying to install Guest Additions into Oracle VM VirtualBox Manager version 5.1.28, in a newly-installed VM for Ubuntu version 16.04.3. The problem was indeed that the Guest Additions CD image was already mounted. To fix it: * In the VM Manager under Settings->Storage, unde...
6,063,541
I am currently faced with a problem, where I need to be able to launch another batch file if a file is under 10KB. E.g. If xxxxx.txt is greater than 10KB launch stage2.bat
2011/05/19
[ "https://Stackoverflow.com/questions/6063541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/761628/" ]
Here's some psuedo code that I think will get you on the path to what you want: <https://gist.github.com/981513> ``` class Person has_many :groups has_many :group_memberships, :foreign_key => "member_id", :through => :groups scope :owned_groups, where(:is_owner => true).joins(:group_memberships) # gets al...
I think like that ``` class Person has_many :groups has_many :group_memberships, :foreign_key => "member_id" has_many :own_groups, :class_name => "Group", :through => "group_memberships", :foreign_key => "group_id" end class Group_Membership belongs_to :member, :class_name => 'Person' belongs_to :group end...
13,827,004
I'm looking for confirmation/clarification with these LINQ expressions: ``` var context = new SomeCustomDbContext() // LINQ to Entities? var items = context.CustomItems.OrderBy(i => i.Property).ToList(); // LINQ to Objects? var items2 = context.CustomItems.ToList().OrderBy(i => i.Property); ``` 1. Am I correct in...
2012/12/11
[ "https://Stackoverflow.com/questions/13827004", "https://Stackoverflow.com", "https://Stackoverflow.com/users/146610/" ]
1. Yes. 2. Yes. 3. Yes. You are correct that calling `ToList()` forces linq-to-entities to evaluate and return the results as a list. As you suspect, this can have huge performance implications. There are cases where linq-to-entities cannot figure out how to parse what looks like a perfectly simple query (like `Where...
> > Am I correct in thinking the first method is LINQ to Entities where EF builds a more specific SQL statement to pass on, putting the ordering effort on on the database? > > > Yes > > Is the second method LINQ to Objects where LINQ drags the whole collection into memory ... before ordering thus leaving the bur...
13,827,004
I'm looking for confirmation/clarification with these LINQ expressions: ``` var context = new SomeCustomDbContext() // LINQ to Entities? var items = context.CustomItems.OrderBy(i => i.Property).ToList(); // LINQ to Objects? var items2 = context.CustomItems.ToList().OrderBy(i => i.Property); ``` 1. Am I correct in...
2012/12/11
[ "https://Stackoverflow.com/questions/13827004", "https://Stackoverflow.com", "https://Stackoverflow.com/users/146610/" ]
1. Yes. 2. Yes. 3. Yes. You are correct that calling `ToList()` forces linq-to-entities to evaluate and return the results as a list. As you suspect, this can have huge performance implications. There are cases where linq-to-entities cannot figure out how to parse what looks like a perfectly simple query (like `Where...
The other thing to be aware of is that IQueryable makes no guarantees on either (a) the semantic reasoning of the underlying provider, or (b) how much of the set of IQueryable methods are implemented by the provider. For example: - 1. EF does not support Last(). 2. Nor does it support time-part comparisons of DateTim...
13,827,004
I'm looking for confirmation/clarification with these LINQ expressions: ``` var context = new SomeCustomDbContext() // LINQ to Entities? var items = context.CustomItems.OrderBy(i => i.Property).ToList(); // LINQ to Objects? var items2 = context.CustomItems.ToList().OrderBy(i => i.Property); ``` 1. Am I correct in...
2012/12/11
[ "https://Stackoverflow.com/questions/13827004", "https://Stackoverflow.com", "https://Stackoverflow.com/users/146610/" ]
> > Am I correct in thinking the first method is LINQ to Entities where EF builds a more specific SQL statement to pass on, putting the ordering effort on on the database? > > > Yes > > Is the second method LINQ to Objects where LINQ drags the whole collection into memory ... before ordering thus leaving the bur...
The other thing to be aware of is that IQueryable makes no guarantees on either (a) the semantic reasoning of the underlying provider, or (b) how much of the set of IQueryable methods are implemented by the provider. For example: - 1. EF does not support Last(). 2. Nor does it support time-part comparisons of DateTim...
67,222,585
For example, this is the part of my data set I'm interested in: | EventID | Action | Actor | | --- | --- | --- | | EventID1 | ActionB | ActorX | | EventID2 | ActionB | ActorZ | | EventID1 | ActionA | ActorY | | EventID2 | ActionC | ActorZ | | EventID3 | ActionA | ActorX | | EventID3 | ActionB | ActorZ | | EventID2 | A...
2021/04/23
[ "https://Stackoverflow.com/questions/67222585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15743710/" ]
In your template, Global should be renamed as Globals Please refer to the [Globals Section](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-specification-template-anatomy-globals.html) link that you already shared.
Use `sam validate -t yourtemplate.yaml` to check for syntax errors. This error came up for me because of a missing parameter in my lambda function. Not very helpful exception but the validate tool exposed my problems.
123,794
Please advice how to install the patch command on Ubuntu Linux I download the following file , patch\_2.6-2ubuntu1\_amd64.deb ( from site - <http://packages.ubuntu.com/lucid/patch> ) But not clearly how to install it? I tried by ./patch\_2.6-2ubuntu1\_amd64.deb , ( but I get errors ) Please advice how to install t...
2014/04/08
[ "https://unix.stackexchange.com/questions/123794", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/-1/" ]
This website tells you that the package is in the repository. You should not download the package from the website to install it. You should use your package manager : ``` sudo apt-get install patch ```
".deb" files are not executable binaries. Use `dpkg` command to install your package : ``` dpkg -i your_package.deb ```
123,794
Please advice how to install the patch command on Ubuntu Linux I download the following file , patch\_2.6-2ubuntu1\_amd64.deb ( from site - <http://packages.ubuntu.com/lucid/patch> ) But not clearly how to install it? I tried by ./patch\_2.6-2ubuntu1\_amd64.deb , ( but I get errors ) Please advice how to install t...
2014/04/08
[ "https://unix.stackexchange.com/questions/123794", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/-1/" ]
".deb" files are not executable binaries. Use `dpkg` command to install your package : ``` dpkg -i your_package.deb ```
since your patch is tar.gz a simple way to install is to get alien ``` sudo apt-get install alien ``` then turn tar.gz into deb ``` sudo alien -k file.tar.gz ```
123,794
Please advice how to install the patch command on Ubuntu Linux I download the following file , patch\_2.6-2ubuntu1\_amd64.deb ( from site - <http://packages.ubuntu.com/lucid/patch> ) But not clearly how to install it? I tried by ./patch\_2.6-2ubuntu1\_amd64.deb , ( but I get errors ) Please advice how to install t...
2014/04/08
[ "https://unix.stackexchange.com/questions/123794", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/-1/" ]
This website tells you that the package is in the repository. You should not download the package from the website to install it. You should use your package manager : ``` sudo apt-get install patch ```
since your patch is tar.gz a simple way to install is to get alien ``` sudo apt-get install alien ``` then turn tar.gz into deb ``` sudo alien -k file.tar.gz ```
24,010,421
I have a problem where I'm more-or less using the jsPlumb flow-chart demo example but where there is only ever one drop target per window and there may be one or many drag targets. However I want to forbid self-connections so that a connection can be dragged from any window to any other window EXCEPT itself. I was th...
2014/06/03
[ "https://Stackoverflow.com/questions/24010421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2837057/" ]
Thanks for the answers they pointed me in the right direction. In the end used "beforeDrop" when binding the "connection" it was detaching the source endpoint of the window as well as the connection. The final solution was: ``` instance.bind("beforeDrop", function (info) { // console.log("before drop: " + info.sourc...
Bind an event to get notified whenever new connection is created. After connection creation check whether source and target of connection are same, if so detach that connection to avoid self loop. Code: ``` jsPlumb.bind("jsPlumbConnection", function(ci) { var s=ci.sourceId,c=ci.targetId; if( ...
24,010,421
I have a problem where I'm more-or less using the jsPlumb flow-chart demo example but where there is only ever one drop target per window and there may be one or many drag targets. However I want to forbid self-connections so that a connection can be dragged from any window to any other window EXCEPT itself. I was th...
2014/06/03
[ "https://Stackoverflow.com/questions/24010421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2837057/" ]
from <http://www.jsplumb.org/doc/connections.html#draganddrop> Preventing Loopback Connections In vanilla jsPlumb only, you can instruct jsPlumb to prevent loopback connections without having to resort to a beforeDrop interceptor. You do this by setting allowLoopback:false on the parameters passed to the makeTarget m...
Bind an event to get notified whenever new connection is created. After connection creation check whether source and target of connection are same, if so detach that connection to avoid self loop. Code: ``` jsPlumb.bind("jsPlumbConnection", function(ci) { var s=ci.sourceId,c=ci.targetId; if( ...
30,995,731
I have a web page with a huge form to fill. In most cases, session time out and users lost a lot of data. I searched for this problem and found this [Prevent session expired in PHP Session for inactive user](https://stackoverflow.com/questions/5962671/prevent-session-expired-in-php-session-for-inactive-user) I impleme...
2015/06/23
[ "https://Stackoverflow.com/questions/30995731", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2549665/" ]
You can not keep the session alive without calling a php script which starts a session, just downloading a png file will not keep the session from dying. Create a PHP Script like this: ``` <?php session_start(); ?> ``` Put it into the directory and call this instead of that trash.png asset. You might need to call o...
In ajax you can post timeout as ``` jQuery.ajax({ url: 'ajaxhandler.php', success: function (result) { returned_value=result; }, timeout: 10000, async: false }); ```
1,553,047
By using DeMoivre's theorm express $$\frac{\sin 7\theta}{\sin \theta}$$ in the powers of Sine only answer given in the book is $$7-56\sin ^2\theta+112\sin ^4 \theta-64\sin^6 \theta$$ can any one help to solve the question
2015/11/30
[ "https://math.stackexchange.com/questions/1553047", "https://math.stackexchange.com", "https://math.stackexchange.com/users/153864/" ]
**Steps To Carry Out** 1) First take a look [at this link](https://en.wikipedia.org/wiki/De_Moivre%27s_formula) which is a guide for DeMoivre's formula. 2) Using step 1 show that $$\sin (7x) = 64\sin \left( x \right)\cos {\left( x \right)^6} - 80\sin \left( x \right)\cos {\left( x \right)^4} + 24\sin \left( x \right...
Take a look at [Chebyshev Polynomial of the Second Kind](https://en.wikipedia.org/wiki/Chebyshev_polynomials). Since $U\_6 (\cos \theta) = \frac{\sin 7 \theta}{\sin \theta}$, we can find $U\_6(x)$ be the recurrence given in the wikipedia link, i.e. $$U\_0(x)=1$$ $$U\_1(x)=2x$$ $$U\_{n+1}(x)=2xU\_n(x)-U\_{n-1}(x)$$ We...
1,553,047
By using DeMoivre's theorm express $$\frac{\sin 7\theta}{\sin \theta}$$ in the powers of Sine only answer given in the book is $$7-56\sin ^2\theta+112\sin ^4 \theta-64\sin^6 \theta$$ can any one help to solve the question
2015/11/30
[ "https://math.stackexchange.com/questions/1553047", "https://math.stackexchange.com", "https://math.stackexchange.com/users/153864/" ]
Take a look at [Chebyshev Polynomial of the Second Kind](https://en.wikipedia.org/wiki/Chebyshev_polynomials). Since $U\_6 (\cos \theta) = \frac{\sin 7 \theta}{\sin \theta}$, we can find $U\_6(x)$ be the recurrence given in the wikipedia link, i.e. $$U\_0(x)=1$$ $$U\_1(x)=2x$$ $$U\_{n+1}(x)=2xU\_n(x)-U\_{n-1}(x)$$ We...
$sin(7\theta)=sin(\theta+6\theta)=sin(\theta).cos(6\theta)+sin(6\theta)cos(\theta)$ then we have $cos(6\theta)=cos(3\theta+3\theta)=cos(3\theta).cos(\theta)-[sin(3\theta).sin(3\theta)]$ now we know $cos(3\theta)=4cos^3(\theta)-3cos(\theta),sin(\theta)=3sin(\theta)+4sin^3(\theta)$. Now you can just back substitute and g...
1,553,047
By using DeMoivre's theorm express $$\frac{\sin 7\theta}{\sin \theta}$$ in the powers of Sine only answer given in the book is $$7-56\sin ^2\theta+112\sin ^4 \theta-64\sin^6 \theta$$ can any one help to solve the question
2015/11/30
[ "https://math.stackexchange.com/questions/1553047", "https://math.stackexchange.com", "https://math.stackexchange.com/users/153864/" ]
Take a look at [Chebyshev Polynomial of the Second Kind](https://en.wikipedia.org/wiki/Chebyshev_polynomials). Since $U\_6 (\cos \theta) = \frac{\sin 7 \theta}{\sin \theta}$, we can find $U\_6(x)$ be the recurrence given in the wikipedia link, i.e. $$U\_0(x)=1$$ $$U\_1(x)=2x$$ $$U\_{n+1}(x)=2xU\_n(x)-U\_{n-1}(x)$$ We...
$(\cos x+i\sin x)^7=\cos 7x+i\sin7x$. We have $$(r+t)^7=r^7+7r^6t+21r^5t^2+35r^4t^3+35r^3t^4+21r^2t^5+7rt^6+t^7$$ hence, making $\sin x=t$ and $\cos x=r$ and having in account the powers of $i$, we get $$\sin 7x=7r^6t-35r^4t^3+21r^2t^5-t^7$$ so, because of $\cos^2x=1-\sin^2x$, $$7t-21t^3+21t^5-7t^7-35t^3+70t^5-35t^7...
1,553,047
By using DeMoivre's theorm express $$\frac{\sin 7\theta}{\sin \theta}$$ in the powers of Sine only answer given in the book is $$7-56\sin ^2\theta+112\sin ^4 \theta-64\sin^6 \theta$$ can any one help to solve the question
2015/11/30
[ "https://math.stackexchange.com/questions/1553047", "https://math.stackexchange.com", "https://math.stackexchange.com/users/153864/" ]
**Steps To Carry Out** 1) First take a look [at this link](https://en.wikipedia.org/wiki/De_Moivre%27s_formula) which is a guide for DeMoivre's formula. 2) Using step 1 show that $$\sin (7x) = 64\sin \left( x \right)\cos {\left( x \right)^6} - 80\sin \left( x \right)\cos {\left( x \right)^4} + 24\sin \left( x \right...
$sin(7\theta)=sin(\theta+6\theta)=sin(\theta).cos(6\theta)+sin(6\theta)cos(\theta)$ then we have $cos(6\theta)=cos(3\theta+3\theta)=cos(3\theta).cos(\theta)-[sin(3\theta).sin(3\theta)]$ now we know $cos(3\theta)=4cos^3(\theta)-3cos(\theta),sin(\theta)=3sin(\theta)+4sin^3(\theta)$. Now you can just back substitute and g...
1,553,047
By using DeMoivre's theorm express $$\frac{\sin 7\theta}{\sin \theta}$$ in the powers of Sine only answer given in the book is $$7-56\sin ^2\theta+112\sin ^4 \theta-64\sin^6 \theta$$ can any one help to solve the question
2015/11/30
[ "https://math.stackexchange.com/questions/1553047", "https://math.stackexchange.com", "https://math.stackexchange.com/users/153864/" ]
**Steps To Carry Out** 1) First take a look [at this link](https://en.wikipedia.org/wiki/De_Moivre%27s_formula) which is a guide for DeMoivre's formula. 2) Using step 1 show that $$\sin (7x) = 64\sin \left( x \right)\cos {\left( x \right)^6} - 80\sin \left( x \right)\cos {\left( x \right)^4} + 24\sin \left( x \right...
$(\cos x+i\sin x)^7=\cos 7x+i\sin7x$. We have $$(r+t)^7=r^7+7r^6t+21r^5t^2+35r^4t^3+35r^3t^4+21r^2t^5+7rt^6+t^7$$ hence, making $\sin x=t$ and $\cos x=r$ and having in account the powers of $i$, we get $$\sin 7x=7r^6t-35r^4t^3+21r^2t^5-t^7$$ so, because of $\cos^2x=1-\sin^2x$, $$7t-21t^3+21t^5-7t^7-35t^3+70t^5-35t^7...
1,553,047
By using DeMoivre's theorm express $$\frac{\sin 7\theta}{\sin \theta}$$ in the powers of Sine only answer given in the book is $$7-56\sin ^2\theta+112\sin ^4 \theta-64\sin^6 \theta$$ can any one help to solve the question
2015/11/30
[ "https://math.stackexchange.com/questions/1553047", "https://math.stackexchange.com", "https://math.stackexchange.com/users/153864/" ]
$(\cos x+i\sin x)^7=\cos 7x+i\sin7x$. We have $$(r+t)^7=r^7+7r^6t+21r^5t^2+35r^4t^3+35r^3t^4+21r^2t^5+7rt^6+t^7$$ hence, making $\sin x=t$ and $\cos x=r$ and having in account the powers of $i$, we get $$\sin 7x=7r^6t-35r^4t^3+21r^2t^5-t^7$$ so, because of $\cos^2x=1-\sin^2x$, $$7t-21t^3+21t^5-7t^7-35t^3+70t^5-35t^7...
$sin(7\theta)=sin(\theta+6\theta)=sin(\theta).cos(6\theta)+sin(6\theta)cos(\theta)$ then we have $cos(6\theta)=cos(3\theta+3\theta)=cos(3\theta).cos(\theta)-[sin(3\theta).sin(3\theta)]$ now we know $cos(3\theta)=4cos^3(\theta)-3cos(\theta),sin(\theta)=3sin(\theta)+4sin^3(\theta)$. Now you can just back substitute and g...
29,756,074
I'm trying to get a flot tooltip to appear, but nothing is happening. Can anyone tell me what I'm doing wrong, please? Maybe it doesn't recognize my points, they are appearing on the graph (number of people on y axis, the years on the x-axis). ``` $.post('php/myprogram.php', function(output){ ...
2015/04/20
[ "https://Stackoverflow.com/questions/29756074", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1229001/" ]
Returning a type (not a reference) will make a *copy* of the object you're returning. Thus there's no need to cast it, the copy can be changed without affecting the original. The code will compile cleanly if you remove the `const_cast`. Edit: based on the latest edit to the question, I'd say this is an abuse of `const...
you can just return `n_`, as it is ``` int n() const { return n_; } ```
29,756,074
I'm trying to get a flot tooltip to appear, but nothing is happening. Can anyone tell me what I'm doing wrong, please? Maybe it doesn't recognize my points, they are appearing on the graph (number of people on y axis, the years on the x-axis). ``` $.post('php/myprogram.php', function(output){ ...
2015/04/20
[ "https://Stackoverflow.com/questions/29756074", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1229001/" ]
Returning a type (not a reference) will make a *copy* of the object you're returning. Thus there's no need to cast it, the copy can be changed without affecting the original. The code will compile cleanly if you remove the `const_cast`. Edit: based on the latest edit to the question, I'd say this is an abuse of `const...
There is no need for using a cast. In the function, `this->n_` is a `const` pointer it does not point to `const int`. ``` int* n() const { // No need for a cast. return n_; } ``` It makes more sense to return a `const int*` from the `const` function. You don't want something like this: ``` const A a; a.n()[...
29,756,074
I'm trying to get a flot tooltip to appear, but nothing is happening. Can anyone tell me what I'm doing wrong, please? Maybe it doesn't recognize my points, they are appearing on the graph (number of people on y axis, the years on the x-axis). ``` $.post('php/myprogram.php', function(output){ ...
2015/04/20
[ "https://Stackoverflow.com/questions/29756074", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1229001/" ]
Returning a type (not a reference) will make a *copy* of the object you're returning. Thus there's no need to cast it, the copy can be changed without affecting the original. The code will compile cleanly if you remove the `const_cast`. Edit: based on the latest edit to the question, I'd say this is an abuse of `const...
Generally speaking, casting a `T const` to a `T` with `const_cast<>` is almost always unnecessary. This is because the constant object is being converted into a non-constant temporary, and this can be safely accomplished without a cast. ``` int const n; // n is a constant int int x = n; // perfectly safe ``` T...
29,756,074
I'm trying to get a flot tooltip to appear, but nothing is happening. Can anyone tell me what I'm doing wrong, please? Maybe it doesn't recognize my points, they are appearing on the graph (number of people on y axis, the years on the x-axis). ``` $.post('php/myprogram.php', function(output){ ...
2015/04/20
[ "https://Stackoverflow.com/questions/29756074", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1229001/" ]
No, that is not a valid use of `const_cast`. Your function is not modifying the array, but it is granting rights to modify the array to the caller. As such, it should have those rights itself. You can't give someone access to something which you yourself don't have access. So the method should not be const, and the co...
you can just return `n_`, as it is ``` int n() const { return n_; } ```
29,756,074
I'm trying to get a flot tooltip to appear, but nothing is happening. Can anyone tell me what I'm doing wrong, please? Maybe it doesn't recognize my points, they are appearing on the graph (number of people on y axis, the years on the x-axis). ``` $.post('php/myprogram.php', function(output){ ...
2015/04/20
[ "https://Stackoverflow.com/questions/29756074", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1229001/" ]
No, that is not a valid use of `const_cast`. Your function is not modifying the array, but it is granting rights to modify the array to the caller. As such, it should have those rights itself. You can't give someone access to something which you yourself don't have access. So the method should not be const, and the co...
There is no need for using a cast. In the function, `this->n_` is a `const` pointer it does not point to `const int`. ``` int* n() const { // No need for a cast. return n_; } ``` It makes more sense to return a `const int*` from the `const` function. You don't want something like this: ``` const A a; a.n()[...
29,756,074
I'm trying to get a flot tooltip to appear, but nothing is happening. Can anyone tell me what I'm doing wrong, please? Maybe it doesn't recognize my points, they are appearing on the graph (number of people on y axis, the years on the x-axis). ``` $.post('php/myprogram.php', function(output){ ...
2015/04/20
[ "https://Stackoverflow.com/questions/29756074", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1229001/" ]
No, that is not a valid use of `const_cast`. Your function is not modifying the array, but it is granting rights to modify the array to the caller. As such, it should have those rights itself. You can't give someone access to something which you yourself don't have access. So the method should not be const, and the co...
Generally speaking, casting a `T const` to a `T` with `const_cast<>` is almost always unnecessary. This is because the constant object is being converted into a non-constant temporary, and this can be safely accomplished without a cast. ``` int const n; // n is a constant int int x = n; // perfectly safe ``` T...
59,147,042
Parent Component code: ``` const ParentPage = ({ }) => { const [filteredResults, setFilteredResults] = useState([]); ``` Inside render: ``` <ChildPage records={filteredResults}/> ``` ChildPage code: ``` const ChildPage= ({ records}) => { const [displayStore, setDisplayStores] = useState([]); ...
2019/12/02
[ "https://Stackoverflow.com/questions/59147042", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12209835/" ]
Create a new array `updatedRecords` from `records` using `.map` instead of updating it in-place using `.forEach`. ``` const updatedRecords = records.map(record => { if (record.total) { let hoverText = ''; if (!record.sum) { hoverText += '- Missing sumData'; } if (hoverText === '') { rec...
The problem is that you are passing an array, and arrays are passed by reference.if you don't want to change the state of the parent component, you need to pass a new array. this could be one solution: ``` <ChildPage records={[...filteredResults]}/> ```
59,147,042
Parent Component code: ``` const ParentPage = ({ }) => { const [filteredResults, setFilteredResults] = useState([]); ``` Inside render: ``` <ChildPage records={filteredResults}/> ``` ChildPage code: ``` const ChildPage= ({ records}) => { const [displayStore, setDisplayStores] = useState([]); ...
2019/12/02
[ "https://Stackoverflow.com/questions/59147042", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12209835/" ]
Create a new array `updatedRecords` from `records` using `.map` instead of updating it in-place using `.forEach`. ``` const updatedRecords = records.map(record => { if (record.total) { let hoverText = ''; if (!record.sum) { hoverText += '- Missing sumData'; } if (hoverText === '') { rec...
I used the below code in ChildPage which resolved the issue const updatedRecords = JSON.parse(JSON.stringify(records));
112,506
I'm new to photography and I'm working on this project where I need to find the right balance between ISO and exposure compensation, to take pictures in different environments. This is an App for android phones, so the options are limited. However I can use the **light sensor** of the phone to get the current ambient l...
2019/10/11
[ "https://photo.stackexchange.com/questions/112506", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/87410/" ]
I don't know what 'exposure compensation value' means (is it EV?), but there is no automatic way of being able to do this. Simple-mindedly there are four parameters which define how bright (a bit of) the image will be: * *b*, how bright the scene (or the bit of it corresponding to the bit of the image) is; * *s*, how ...
> > I believe some calculation method exists that has as an input the light level (lx) and as output the ISO and exposure compensation values? > > > There are plenty of existing methods to set exposure parameters (ISO, exposure duration, and aperture) based on the amount of light received by a brightness sensor (u...
801,627
In a Windows Explorer window where you browse files in Windows 7, I would like to add a new context menu that will allow me to open a file on my local Dev Server. So it would have to open a browser like Google Crome and the URL would have to be the file path but slightly different removing part of it and prepending my...
2014/08/22
[ "https://superuser.com/questions/801627", "https://superuser.com", "https://superuser.com/users/3700/" ]
Yes it is valid to have two nics on the same network. In the case of Windows, it has an algorithm to determine which interface is "best" when deciding how to send packets out to the network. Most likely, your wired connection will get precedence. DHCP servers work on a broadcast basis. At startup, the PC will issue a ...
More than one IP address in the same subnet on the same host (whether bound to the same adapter or to different adapters) are not only valid, but are routine in many applications (e.g. web servers). It is, though, quite unusual to configure more than one with DHCP - unusual being the key word, not invalid.
68,629,633
I have this vector with these numbers `{0, 1, 0, 3, 2, 3}` and I'm trying to use this approach to have the minimum number and its index: ``` int min_num = *min_element(nums.begin(), nums.end()); int min_num_idx = min_element(nums.begin(), nums.end()) - nums.begin(); ``` However, this returns the first smallest numbe...
2021/08/03
[ "https://Stackoverflow.com/questions/68629633", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16256986/" ]
> > However, this returns the first smallest number it found so the 0 in index 0. Is there a way to make it return the last smallest number instead? (the 0 in index 2 instead) > > > You can try [`std::vector<int>::reverse_iterator`](https://en.cppreference.com/w/cpp/iterator/reverse_iterator): ``` #include <vecto...
```cpp int min_num_idx = nums.size() - 1 - min_element(nums.rbegin(), nums.rend()) - nums.rbegin(); ```
36,196
Have any linguists studied/described a language that was totally foreign to them? ie the linguist has totally no idea of what the utterances and writing of a language mean. How did they do it - infer the meaning and grammar of utterances and writing - if they did not understand a single word at the start? What method...
2020/05/14
[ "https://linguistics.stackexchange.com/questions/36196", "https://linguistics.stackexchange.com", "https://linguistics.stackexchange.com/users/23964/" ]
There are two major variables in doing this: can you interact with a speaker, and do you have some common ground. If the answer to both questions is no, then you pretty much cannot figure the language out. You mentioned archaeologists: numerous texts of dead languages have been uncovered and deciphered. But you need s...
The film "The grammar of happiness" has a scene where Daniel Everett demonstrates how he learned the first words of Piraha without having any common language to the Piraha people. He starts presenting some things in order to learn the nouns depicting those things. Than he goes on with actions on the things and learns ...
36,196
Have any linguists studied/described a language that was totally foreign to them? ie the linguist has totally no idea of what the utterances and writing of a language mean. How did they do it - infer the meaning and grammar of utterances and writing - if they did not understand a single word at the start? What method...
2020/05/14
[ "https://linguistics.stackexchange.com/questions/36196", "https://linguistics.stackexchange.com", "https://linguistics.stackexchange.com/users/23964/" ]
For field linguists, this isn't unheard of, but in most cases there is a contact language or lingua franca in the region which allows more extensive communication. The University of Toronto [maintains a bibliography](http://projects.chass.utoronto.ca/lingfieldwork/) of fieldwork resources which you may find interesting...
The film "The grammar of happiness" has a scene where Daniel Everett demonstrates how he learned the first words of Piraha without having any common language to the Piraha people. He starts presenting some things in order to learn the nouns depicting those things. Than he goes on with actions on the things and learns ...
18,097,504
Please any one tell how to remove this error.![enter image description here](https://i.stack.imgur.com/B4YhD.png) Thanks
2013/08/07
[ "https://Stackoverflow.com/questions/18097504", "https://Stackoverflow.com", "https://Stackoverflow.com/users/921653/" ]
I have solved the issue. I have renamed the apk file to zip and explore the drawable folder and found there was some images which i have already deleted from project but they are still showing in apk. After deletion of those files the apk uploaded successfully. I do not why the deleted images still in apk's drawable f...
Do a clean build under `Build` in Android Studio it fixed the issue for me.
18,097,504
Please any one tell how to remove this error.![enter image description here](https://i.stack.imgur.com/B4YhD.png) Thanks
2013/08/07
[ "https://Stackoverflow.com/questions/18097504", "https://Stackoverflow.com", "https://Stackoverflow.com/users/921653/" ]
I faced that issue as well. I tried different builds, even old ones, previously uploaded without any issues. Rebuilding, cleaning and still got the same error. Nothing really helped. I think it's Google Play problem because it just started working after some time (uploading exactly the same apk which was earlier rejec...
I have solved the issue. I have renamed the apk file to zip and explore the drawable folder and found there was some images which i have already deleted from project but they are still showing in apk. After deletion of those files the apk uploaded successfully. I do not why the deleted images still in apk's drawable f...
18,097,504
Please any one tell how to remove this error.![enter image description here](https://i.stack.imgur.com/B4YhD.png) Thanks
2013/08/07
[ "https://Stackoverflow.com/questions/18097504", "https://Stackoverflow.com", "https://Stackoverflow.com/users/921653/" ]
I also ran into this problem. Our app was originally using an XML for the icon in the manifest: ``` <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/icon_default" /> </selector> ``` This has been working for years. Bu...
Do a clean build under `Build` in Android Studio it fixed the issue for me.
18,097,504
Please any one tell how to remove this error.![enter image description here](https://i.stack.imgur.com/B4YhD.png) Thanks
2013/08/07
[ "https://Stackoverflow.com/questions/18097504", "https://Stackoverflow.com", "https://Stackoverflow.com/users/921653/" ]
I faced that issue as well. I tried different builds, even old ones, previously uploaded without any issues. Rebuilding, cleaning and still got the same error. Nothing really helped. I think it's Google Play problem because it just started working after some time (uploading exactly the same apk which was earlier rejec...
I also ran into this problem. Our app was originally using an XML for the icon in the manifest: ``` <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/icon_default" /> </selector> ``` This has been working for years. Bu...
18,097,504
Please any one tell how to remove this error.![enter image description here](https://i.stack.imgur.com/B4YhD.png) Thanks
2013/08/07
[ "https://Stackoverflow.com/questions/18097504", "https://Stackoverflow.com", "https://Stackoverflow.com/users/921653/" ]
I faced that issue as well. I tried different builds, even old ones, previously uploaded without any issues. Rebuilding, cleaning and still got the same error. Nothing really helped. I think it's Google Play problem because it just started working after some time (uploading exactly the same apk which was earlier rejec...
Do a clean build under `Build` in Android Studio it fixed the issue for me.
18,097,504
Please any one tell how to remove this error.![enter image description here](https://i.stack.imgur.com/B4YhD.png) Thanks
2013/08/07
[ "https://Stackoverflow.com/questions/18097504", "https://Stackoverflow.com", "https://Stackoverflow.com/users/921653/" ]
Created a bug report for this: <https://code.google.com/p/android/issues/detail?id=229018> Tried very hard to not add any insults as to the quality of the error message and the coder who's responsible.
Do a clean build under `Build` in Android Studio it fixed the issue for me.
18,097,504
Please any one tell how to remove this error.![enter image description here](https://i.stack.imgur.com/B4YhD.png) Thanks
2013/08/07
[ "https://Stackoverflow.com/questions/18097504", "https://Stackoverflow.com", "https://Stackoverflow.com/users/921653/" ]
What worked for me today November 2016: 1. Created the application icon under "mipmap" using "new" > "image asset" dialog. 2. Then I removed the old icon from drawable floder. 3. Update the manifest to point to the newly created since the name and folder has changed.
Do a clean build under `Build` in Android Studio it fixed the issue for me.
18,097,504
Please any one tell how to remove this error.![enter image description here](https://i.stack.imgur.com/B4YhD.png) Thanks
2013/08/07
[ "https://Stackoverflow.com/questions/18097504", "https://Stackoverflow.com", "https://Stackoverflow.com/users/921653/" ]
I faced that issue as well. I tried different builds, even old ones, previously uploaded without any issues. Rebuilding, cleaning and still got the same error. Nothing really helped. I think it's Google Play problem because it just started working after some time (uploading exactly the same apk which was earlier rejec...
Created a bug report for this: <https://code.google.com/p/android/issues/detail?id=229018> Tried very hard to not add any insults as to the quality of the error message and the coder who's responsible.
18,097,504
Please any one tell how to remove this error.![enter image description here](https://i.stack.imgur.com/B4YhD.png) Thanks
2013/08/07
[ "https://Stackoverflow.com/questions/18097504", "https://Stackoverflow.com", "https://Stackoverflow.com/users/921653/" ]
I faced that issue as well. I tried different builds, even old ones, previously uploaded without any issues. Rebuilding, cleaning and still got the same error. Nothing really helped. I think it's Google Play problem because it just started working after some time (uploading exactly the same apk which was earlier rejec...
What worked for me today November 2016: 1. Created the application icon under "mipmap" using "new" > "image asset" dialog. 2. Then I removed the old icon from drawable floder. 3. Update the manifest to point to the newly created since the name and folder has changed.
47,055,098
Input JSON ``` { "digital-profiles": [{ "Id": "INTID1", "status": "ACTIVE", "cId": "12" }, { "dId": "INTID2", "status": "barred", "cId": "13" }, { "Id": "INTID3", "status": "...
2017/11/01
[ "https://Stackoverflow.com/questions/47055098", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6114085/" ]
Use [map](https://docs.mulesoft.com/mule-user-guide/v/3.8/dataweave-operators#map) and [joinBy](https://docs.mulesoft.com/mule-user-guide/v/3.8/dataweave-operators#join-by) to get desired output. This works for me ``` %dw 1.0 %output application/json --- Results : { NewId : payload.digital-profiles map ($.Id ++ ':...
this is one way you could do it ( code not tested but working on something very similar at the moment) ``` function ParseJSON(MyObject) { // parse incoming var into a JSON object. var MyObjectParsed= JSON.parse(MyObject); var i = 0; var NewJSONstring = "{/"Results/": {/"NewId/":"; // for each profile for(;MyObjectPa...
57,075,443
Consider the table: ``` CREATE TABLE event( event_id UUID PRIMARY KEY, user_id UUID NOT NULL, trigger_id UUID NOT NULL, name VARCHAR (255) NOT NULL, type VARCHAR (50) NOT NULL, trigger_name VARCHAR (255) NOT NULL, status smallint, date_created TIMESTAMP NOT NULL DEFAULT NOW(), ); ``` ...
2019/07/17
[ "https://Stackoverflow.com/questions/57075443", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3973406/" ]
[Window functions](https://www.postgresql.org/docs/current/tutorial-window.html) to your rescue (Edit: And `DISTINCT ON` as well): ``` SELECT DISTINCT ON (type, date_created) * FROM ( SELECT *, COUNT(*) OVER (PARTITION BY trigger_id, type, name) FROM event WHERE account_id = 'fd80059a-3...
You can check below query ``` SELECT * FROM ( SELECT a.*, COUNT(*) OVER (PARTITION BY trigger_id, type, name) cnt , row_number () over(PARTITION BY trigger_id, type, name order by date_created DESC ) rn FROM event a WHERE account_id = 'fd80059a-3a16-40fe-9f6b-ad2812875d92' ) s where rn < =...
47,536,813
I am writing a Korn shell script. I have two arrays (say, `arr1` and `arr2`), both containing strings, and I need to check which elements from `arr1` are present (as whole strings or substrings) in `arr2`. The most intuitive solution is having nested for loops, and checking if each element from `arr1` can be found in `...
2017/11/28
[ "https://Stackoverflow.com/questions/47536813", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2604472/" ]
Since version 4.0 Bash has associative arrays: ``` $ declare -A elements $ elements[hello]=world $ echo ${elements[hello]} world ``` You can use this in the same way you would a Java Map. ``` declare -A map for el in "${arr1[@]}"; do map[$el]="x" done for el in "${arr2[@]}"; do if [ -n "${map[$el]}" ] ; ...
Here's a `bash/awk` idea: ``` # some sample arrays $ arr1=( my first string "hello wolrd") $ arr2=( my last stringbean strings "well, hello world!) # break array elements into separate lines $ printf '%s\n' "${arr1[@]}" my first string hello world $ printf '%s\n' "${arr2[@]}" my last stringbean strings well, hell...
47,536,813
I am writing a Korn shell script. I have two arrays (say, `arr1` and `arr2`), both containing strings, and I need to check which elements from `arr1` are present (as whole strings or substrings) in `arr2`. The most intuitive solution is having nested for loops, and checking if each element from `arr1` can be found in `...
2017/11/28
[ "https://Stackoverflow.com/questions/47536813", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2604472/" ]
Since version 4.0 Bash has associative arrays: ``` $ declare -A elements $ elements[hello]=world $ echo ${elements[hello]} world ``` You can use this in the same way you would a Java Map. ``` declare -A map for el in "${arr1[@]}"; do map[$el]="x" done for el in "${arr2[@]}"; do if [ -n "${map[$el]}" ] ; ...
An `egrep` solution for substring/pattern matching ... ``` egrep -f <(printf '.*%s.*\n' "${arr1[@]}") \ <(printf '%s\n' "${arr2[@]}") ``` * `egrep -f` : take patterns to search from the file designated by the `-f`, which in this case is ... * `<(printf '.*%s.*\n' "${arr1[@]}")` : convert `arr1` elements...
47,536,813
I am writing a Korn shell script. I have two arrays (say, `arr1` and `arr2`), both containing strings, and I need to check which elements from `arr1` are present (as whole strings or substrings) in `arr2`. The most intuitive solution is having nested for loops, and checking if each element from `arr1` can be found in `...
2017/11/28
[ "https://Stackoverflow.com/questions/47536813", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2604472/" ]
Since you're OK with using `grep`, and since you want to match substrings as well as full strings, one approach is to write: ``` printf '%s\n' "${arr2[@]}" \ | grep -o -F "$(printf '%s\n' "${arr1[@]}") ``` and let `grep` optimize as it sees fit.
Here's a `bash/awk` idea: ``` # some sample arrays $ arr1=( my first string "hello wolrd") $ arr2=( my last stringbean strings "well, hello world!) # break array elements into separate lines $ printf '%s\n' "${arr1[@]}" my first string hello world $ printf '%s\n' "${arr2[@]}" my last stringbean strings well, hell...
47,536,813
I am writing a Korn shell script. I have two arrays (say, `arr1` and `arr2`), both containing strings, and I need to check which elements from `arr1` are present (as whole strings or substrings) in `arr2`. The most intuitive solution is having nested for loops, and checking if each element from `arr1` can be found in `...
2017/11/28
[ "https://Stackoverflow.com/questions/47536813", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2604472/" ]
Since you're OK with using `grep`, and since you want to match substrings as well as full strings, one approach is to write: ``` printf '%s\n' "${arr2[@]}" \ | grep -o -F "$(printf '%s\n' "${arr1[@]}") ``` and let `grep` optimize as it sees fit.
An `egrep` solution for substring/pattern matching ... ``` egrep -f <(printf '.*%s.*\n' "${arr1[@]}") \ <(printf '%s\n' "${arr2[@]}") ``` * `egrep -f` : take patterns to search from the file designated by the `-f`, which in this case is ... * `<(printf '.*%s.*\n' "${arr1[@]}")` : convert `arr1` elements...
47,536,813
I am writing a Korn shell script. I have two arrays (say, `arr1` and `arr2`), both containing strings, and I need to check which elements from `arr1` are present (as whole strings or substrings) in `arr2`. The most intuitive solution is having nested for loops, and checking if each element from `arr1` can be found in `...
2017/11/28
[ "https://Stackoverflow.com/questions/47536813", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2604472/" ]
[BashFAQ #36](http://mywiki.wooledge.org/BashFAQ/036) describes doing set arithmetic (unions, disjoint sets, etc) in bash with `comm`. Assuming your values can't contain literal newlines, the following will emit a line per item in both arr1 and arr2: ``` comm -12 <(printf '%s\n' "${arr1[@]}" | sort -u) \ <(p...
Here's a `bash/awk` idea: ``` # some sample arrays $ arr1=( my first string "hello wolrd") $ arr2=( my last stringbean strings "well, hello world!) # break array elements into separate lines $ printf '%s\n' "${arr1[@]}" my first string hello world $ printf '%s\n' "${arr2[@]}" my last stringbean strings well, hell...
47,536,813
I am writing a Korn shell script. I have two arrays (say, `arr1` and `arr2`), both containing strings, and I need to check which elements from `arr1` are present (as whole strings or substrings) in `arr2`. The most intuitive solution is having nested for loops, and checking if each element from `arr1` can be found in `...
2017/11/28
[ "https://Stackoverflow.com/questions/47536813", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2604472/" ]
[BashFAQ #36](http://mywiki.wooledge.org/BashFAQ/036) describes doing set arithmetic (unions, disjoint sets, etc) in bash with `comm`. Assuming your values can't contain literal newlines, the following will emit a line per item in both arr1 and arr2: ``` comm -12 <(printf '%s\n' "${arr1[@]}" | sort -u) \ <(p...
An `egrep` solution for substring/pattern matching ... ``` egrep -f <(printf '.*%s.*\n' "${arr1[@]}") \ <(printf '%s\n' "${arr2[@]}") ``` * `egrep -f` : take patterns to search from the file designated by the `-f`, which in this case is ... * `<(printf '.*%s.*\n' "${arr1[@]}")` : convert `arr1` elements...
35,098,534
so im following this tutorial: <https://devcenter.heroku.com/articles/paperclip-s3> I manage to deploy it to Heroku and App is working in the development. The app is running in Heroku but when i try to upload photo. it gives me this page > > We're sorry, but something went wrong. > > > I try to debug it by goin...
2016/01/30
[ "https://Stackoverflow.com/questions/35098534", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5213790/" ]
Add `region` and `s3_host_name`. ``` config.paperclip_defaults = { storage: :s3, s3_credentials: { bucket: ENV["S3_BUCKET_NAME"], access_key_id: ENV["AWS_ACCESS_KEY_ID"], secret_access_key: ENV["AWS_SECRET_ACCESS_KEY"], s3_region: ENV["S3_REGION"], s3_host_name: ENV["S3_HOST_NAME"...
For those facing the same problem, I solved this by renaming `:bucket => ENV['S3_BUCKET_NAME'],` to `:bucket => ENV['AWS_BUCKET'],` and downgrading `gem 'aws-sdk'` to gem `'aws-sdk', '~> 1.61.0'` and it fix my problem.
26,668,509
I want to save and retrieve some application settings in my Xamarin.Android project. I know that in Android (java), I use the class `SharedPreferences` to store this information, but I do not know how to convert that to Xamarin C#. When I type "SharedPreferences" into the Xamarin Studio IDE, there is no auto-comple...
2014/10/31
[ "https://Stackoverflow.com/questions/26668509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/383414/" ]
The Xamarin.Android equivalent of `SharedPreferences` is an interface called `ISharedPreferences`. Use it in the same way, and you will be able to easily port Android code across. --- For example, to save a true/false `bool` using some `Context` you can do the following: ``` ISharedPreferences prefs = PreferenceMan...
You can use this example for you SharedPreferences in Xamarin.Android First, you need to use: ``` ISharedPreferences //Interface for accessing and modifying preference data ISharedPreferencesEditor // Interface used for modifying values in a ISharedPreferences ``` You can create a similar class: ``` public class A...
26,668,509
I want to save and retrieve some application settings in my Xamarin.Android project. I know that in Android (java), I use the class `SharedPreferences` to store this information, but I do not know how to convert that to Xamarin C#. When I type "SharedPreferences" into the Xamarin Studio IDE, there is no auto-comple...
2014/10/31
[ "https://Stackoverflow.com/questions/26668509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/383414/" ]
The Xamarin.Android equivalent of `SharedPreferences` is an interface called `ISharedPreferences`. Use it in the same way, and you will be able to easily port Android code across. --- For example, to save a true/false `bool` using some `Context` you can do the following: ``` ISharedPreferences prefs = PreferenceMan...
I had trouble using PreferenceManager as the example shows. I added this code at the top and now I'm good using it. ``` using Android.Preferences; ``` Plus to get the preferences you have to add the default value as a second parameter or it will not compile ``` mInt = prefs.GetInt ("key_for_my_int_value", defaultIn...
26,668,509
I want to save and retrieve some application settings in my Xamarin.Android project. I know that in Android (java), I use the class `SharedPreferences` to store this information, but I do not know how to convert that to Xamarin C#. When I type "SharedPreferences" into the Xamarin Studio IDE, there is no auto-comple...
2014/10/31
[ "https://Stackoverflow.com/questions/26668509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/383414/" ]
The Xamarin.Android equivalent of `SharedPreferences` is an interface called `ISharedPreferences`. Use it in the same way, and you will be able to easily port Android code across. --- For example, to save a true/false `bool` using some `Context` you can do the following: ``` ISharedPreferences prefs = PreferenceMan...
Not sure if you still dont know or not, but make sure you **Dispose** your variables if they are inside a function: ``` prefs.Dispose(); prefEditor.Dispose(); ``` I had a crash/freeze on my app over some time because of not disposing the memory whenever it is not needed anymore.
26,668,509
I want to save and retrieve some application settings in my Xamarin.Android project. I know that in Android (java), I use the class `SharedPreferences` to store this information, but I do not know how to convert that to Xamarin C#. When I type "SharedPreferences" into the Xamarin Studio IDE, there is no auto-comple...
2014/10/31
[ "https://Stackoverflow.com/questions/26668509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/383414/" ]
You can use this example for you SharedPreferences in Xamarin.Android First, you need to use: ``` ISharedPreferences //Interface for accessing and modifying preference data ISharedPreferencesEditor // Interface used for modifying values in a ISharedPreferences ``` You can create a similar class: ``` public class A...
I had trouble using PreferenceManager as the example shows. I added this code at the top and now I'm good using it. ``` using Android.Preferences; ``` Plus to get the preferences you have to add the default value as a second parameter or it will not compile ``` mInt = prefs.GetInt ("key_for_my_int_value", defaultIn...
26,668,509
I want to save and retrieve some application settings in my Xamarin.Android project. I know that in Android (java), I use the class `SharedPreferences` to store this information, but I do not know how to convert that to Xamarin C#. When I type "SharedPreferences" into the Xamarin Studio IDE, there is no auto-comple...
2014/10/31
[ "https://Stackoverflow.com/questions/26668509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/383414/" ]
You can use this example for you SharedPreferences in Xamarin.Android First, you need to use: ``` ISharedPreferences //Interface for accessing and modifying preference data ISharedPreferencesEditor // Interface used for modifying values in a ISharedPreferences ``` You can create a similar class: ``` public class A...
Not sure if you still dont know or not, but make sure you **Dispose** your variables if they are inside a function: ``` prefs.Dispose(); prefEditor.Dispose(); ``` I had a crash/freeze on my app over some time because of not disposing the memory whenever it is not needed anymore.
26,668,509
I want to save and retrieve some application settings in my Xamarin.Android project. I know that in Android (java), I use the class `SharedPreferences` to store this information, but I do not know how to convert that to Xamarin C#. When I type "SharedPreferences" into the Xamarin Studio IDE, there is no auto-comple...
2014/10/31
[ "https://Stackoverflow.com/questions/26668509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/383414/" ]
I had trouble using PreferenceManager as the example shows. I added this code at the top and now I'm good using it. ``` using Android.Preferences; ``` Plus to get the preferences you have to add the default value as a second parameter or it will not compile ``` mInt = prefs.GetInt ("key_for_my_int_value", defaultIn...
Not sure if you still dont know or not, but make sure you **Dispose** your variables if they are inside a function: ``` prefs.Dispose(); prefEditor.Dispose(); ``` I had a crash/freeze on my app over some time because of not disposing the memory whenever it is not needed anymore.
13,212,366
I've recently tried to access the debug keystore created by the Eclipse SDK in order to use the Google maps API within my application. Now I know the file exists and have its path. However to access it and receive an MD5 fingerprint I have to use a keytool command. Now I've been told that this command has to be done ...
2012/11/03
[ "https://Stackoverflow.com/questions/13212366", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1796974/" ]
You need to enclose commands/directories that contain spaces (or special characters), with the double qoute **"** So to run your command, you would use: ``` C:\> "C:\Program Files\Java\jre6\bin\keytool" (option parameters) ``` So your complete command should look something like this then: ``` C:\> "C:\Program File...
I Accept the @chrkad answer but for generating MD5 certificate, you should always use the keytool.exe located in jdk5 or jdk6(Development kit) folder. jre6 will provide the runtime environment and problems raises when you use MD5 certificate generated by jre keytool to get maps api key. I faced such problem and sharing...
29,211,173
I created a subclass of list that writes to file every so often so that I can recover data even in the event of a catastrophic failure. However, I'm not sure I'm handling IO in the best way. ``` import cPickle class IOlist(list): def __init__(self, filename, sentinel): list.__init__(self) self.fil...
2015/03/23
[ "https://Stackoverflow.com/questions/29211173", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1858363/" ]
You should be able to load the pickle directly into the list using ``` def load(self): with open(self.filename, 'rb') as inf: self[:] = cPickle.load(inf) ``` One other observation, if something goes wrong during the save, you might obliterate the latest persisted list, leaving no method of recovery. You ...
You could use `extend()` to get your unpickled list loaded: ``` self.extend(cPickle.load(inf)) ```
29,211,173
I created a subclass of list that writes to file every so often so that I can recover data even in the event of a catastrophic failure. However, I'm not sure I'm handling IO in the best way. ``` import cPickle class IOlist(list): def __init__(self, filename, sentinel): list.__init__(self) self.fil...
2015/03/23
[ "https://Stackoverflow.com/questions/29211173", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1858363/" ]
You should be able to load the pickle directly into the list using ``` def load(self): with open(self.filename, 'rb') as inf: self[:] = cPickle.load(inf) ``` One other observation, if something goes wrong during the save, you might obliterate the latest persisted list, leaving no method of recovery. You ...
You actually want to replace the entire contents of the current list with that of the loaded one. For that you can use slicing: ``` self[:] = lst ```
61,679,902
I have a zsh config on MacOS Catalina which works well. No, I would like to get the same but for Debian 10 Buster. The issue occurs in the using of function for PROMPT that displays pink slashes that separate the PATH current working where directories are in blue. On MacOS, I do it like this (into my .zshrc) : ``` #...
2020/05/08
[ "https://Stackoverflow.com/questions/61679902", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1773603/" ]
Do not do: `printf something`. Always do `printf "%s", something`. The awk errors, because you passed invalid `printf` format specifiers `%{` and `%}`, yet you did not pass any arguments. Do: ``` printf "%s%s%s/", blue, $i, pink; ``` I think you can just: ``` {gsub("/", pink "/" blue)}1 ```
I would use a pre-command hook and simple parameter expansion instead of forking various external programs. ``` precmd () { bar='%F{13}|' prompt="$bar%F{green}%n@%F{cyan}%m$bar%f%T$bar%F{75}" prompt+=${PWD:gs./.%F{206}/%F{75}} prompt+="$bar%F{7} " } ``` Add this to your `.zshrc` file, and `prompt` wi...
26,378,704
We have string inputs of the format `hello_EP_-12.5_201414`, `welcome_EP_22.5_20345` etc We have to extract the double value `-12.5`, `22.5` from the above strings. The format `*_EP_double_*` is fixed. One way to extract is to split strings with '\_' and take the string next to 'EP' and convert it. The other way is ...
2014/10/15
[ "https://Stackoverflow.com/questions/26378704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1440973/" ]
I always prefer this regex for extracting the Double number from string ``` (-)?\d+\.\d+ ``` it does not have any constraint like `*_EP_double_*` <http://regex101.com/r/dN8sA5/16> But in your case, you want to extract the double that followed by `_EP_`, and in this test case `12.4345_hello_ES_34.5_4444` you want ...
Not that its any better, but I fail to see whats wrong with something similar to: ``` var parts = s.Split(new[] {"_EP_"}, StringSplitOptions.None); string dString = parts[1].Substring(0, parts[1].IndexOf('_')); double d = double.Parse(dString); ```
26,378,704
We have string inputs of the format `hello_EP_-12.5_201414`, `welcome_EP_22.5_20345` etc We have to extract the double value `-12.5`, `22.5` from the above strings. The format `*_EP_double_*` is fixed. One way to extract is to split strings with '\_' and take the string next to 'EP' and convert it. The other way is ...
2014/10/15
[ "https://Stackoverflow.com/questions/26378704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1440973/" ]
Try : ``` string input = "hello_EP_-12.5_201414"; int start = input.IndexOf("_EP_") + "_EP_".Length; int length = input.IndexOf('_', start + 1) - start; double d; double.TryParse(input.Substring(start, length), out d); ```
I always prefer this regex for extracting the Double number from string ``` (-)?\d+\.\d+ ``` it does not have any constraint like `*_EP_double_*` <http://regex101.com/r/dN8sA5/16> But in your case, you want to extract the double that followed by `_EP_`, and in this test case `12.4345_hello_ES_34.5_4444` you want ...
26,378,704
We have string inputs of the format `hello_EP_-12.5_201414`, `welcome_EP_22.5_20345` etc We have to extract the double value `-12.5`, `22.5` from the above strings. The format `*_EP_double_*` is fixed. One way to extract is to split strings with '\_' and take the string next to 'EP' and convert it. The other way is ...
2014/10/15
[ "https://Stackoverflow.com/questions/26378704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1440973/" ]
Try : ``` string input = "hello_EP_-12.5_201414"; int start = input.IndexOf("_EP_") + "_EP_".Length; int length = input.IndexOf('_', start + 1) - start; double d; double.TryParse(input.Substring(start, length), out d); ```
Not that its any better, but I fail to see whats wrong with something similar to: ``` var parts = s.Split(new[] {"_EP_"}, StringSplitOptions.None); string dString = parts[1].Substring(0, parts[1].IndexOf('_')); double d = double.Parse(dString); ```
59,156,333
I want to pause the playing audio if another one is played. I have this ``` <ul class="music-list"> <li *ngFor="let song of Songs"> <div class="music-panel"> <div class="music-image"> <img src="{{ song.song_image }}" a...
2019/12/03
[ "https://Stackoverflow.com/questions/59156333", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11066320/" ]
you need to get a reference of all element in the view then loop throw them an run pause method ``` @ViewChildren('audio') audioElms :ElementRef[]; ``` now on the template bind a method on the audio play event ``` <audio controls #audio (play)="paly(audio)"> <source src="{{ song.audio_file }}" type="audio/mpe...
Add listener to the play event in the capturing phase and pause all audio file except the target one: ``` document.addEventListener('play', function(e){ var audios = document.getElementsByTagName('audio'); for(var i = 0, len = audios.length; i < len;i++){ if(audios[i] != e.target){ ...
59,156,333
I want to pause the playing audio if another one is played. I have this ``` <ul class="music-list"> <li *ngFor="let song of Songs"> <div class="music-panel"> <div class="music-image"> <img src="{{ song.song_image }}" a...
2019/12/03
[ "https://Stackoverflow.com/questions/59156333", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11066320/" ]
You could omit the `<audio>` element from your template and move the player logic to a service: ``` export class AudioPlayerService { private globalPlayer: HTMLMediaElement = new Audio(); } ``` **UPDATE** Demo: <https://angular-eg8uik.stackblitz.io/> You can keep track of the player's state using `addEv...
Add listener to the play event in the capturing phase and pause all audio file except the target one: ``` document.addEventListener('play', function(e){ var audios = document.getElementsByTagName('audio'); for(var i = 0, len = audios.length; i < len;i++){ if(audios[i] != e.target){ ...
59,156,333
I want to pause the playing audio if another one is played. I have this ``` <ul class="music-list"> <li *ngFor="let song of Songs"> <div class="music-panel"> <div class="music-image"> <img src="{{ song.song_image }}" a...
2019/12/03
[ "https://Stackoverflow.com/questions/59156333", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11066320/" ]
you need to get a reference of all element in the view then loop throw them an run pause method ``` @ViewChildren('audio') audioElms :ElementRef[]; ``` now on the template bind a method on the audio play event ``` <audio controls #audio (play)="paly(audio)"> <source src="{{ song.audio_file }}" type="audio/mpe...
You could omit the `<audio>` element from your template and move the player logic to a service: ``` export class AudioPlayerService { private globalPlayer: HTMLMediaElement = new Audio(); } ``` **UPDATE** Demo: <https://angular-eg8uik.stackblitz.io/> You can keep track of the player's state using `addEv...
9,161,904
I'm relatively new to scala and made some really simple programs succesfully. However, now that I'am trying some real world problem resolution, things are getting a little bit harder... I want to read some files into 'Configuration' objects, using various 'FileTypeReader' subtypes that can 'accept' certain files (one ...
2012/02/06
[ "https://Stackoverflow.com/questions/9161904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/921177/" ]
If I understand correctly, your problem is that you have a `Set[Path]` and want to yield a `List[Option[Configuration]]`. As written, `configurations` will be a `Set[Option[Configuration]]`. To change this to a `List`, use the `toList` method i.e. ``` val configurations = (for { nextPath <- Path(someFolder).childr...
Are you trying to find the *first* configuration that it can extract? If not, what happens if multiple configurations are returned? In the first case, I'd just get the result of the for-comprehension and call `find` on it, which will return an `Option`.
39,971,831
Hello team I have a small issue and I would like to know the cause please see code below: `<input type="text" class="span6" id="item_title" value ="<?php echo set_value('$item_title'); ?>">` The preceding code gives me an validation error in Codeigniter however this code `<?php echo form_input('item_title', $item_t...
2016/10/11
[ "https://Stackoverflow.com/questions/39971831", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5811421/" ]
I find the code from [spring-cloud-sleuth](https://github.com/spring-cloud/spring-cloud-sleuth/tree/master/benchmarks/src/main/java/org/springframework/cloud/sleuth/benchmarks/jmh/benchmarks),it works for me ``` @State(Scope.Benchmark) @BenchmarkMode(Mode.AverageTime) @Warmup(iterations = 5, time = 1, timeUnit = TimeU...
I would opt for the `getAutowireCapableBeanFactory().autowire()` solution you already sketched out. There has to be some boilerplate code that loads the application context and triggers autowiring. If you prefer to specify your app config with annotations the setup method could look something like this: ``` Annotat...
39,971,831
Hello team I have a small issue and I would like to know the cause please see code below: `<input type="text" class="span6" id="item_title" value ="<?php echo set_value('$item_title'); ?>">` The preceding code gives me an validation error in Codeigniter however this code `<?php echo form_input('item_title', $item_t...
2016/10/11
[ "https://Stackoverflow.com/questions/39971831", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5811421/" ]
``` @State(Scope.Benchmark) public static class SpringState { AnnotationConfigApplicationContext context; @Setup(Level.Trial) public void setup() { context = new AnnotationConfigApplicationContext(); context.register(CLASSNAME.class); context.register(ANOTHER_CLASSNAME_TO_BE_LOADED...
I would opt for the `getAutowireCapableBeanFactory().autowire()` solution you already sketched out. There has to be some boilerplate code that loads the application context and triggers autowiring. If you prefer to specify your app config with annotations the setup method could look something like this: ``` Annotat...
39,971,831
Hello team I have a small issue and I would like to know the cause please see code below: `<input type="text" class="span6" id="item_title" value ="<?php echo set_value('$item_title'); ?>">` The preceding code gives me an validation error in Codeigniter however this code `<?php echo form_input('item_title', $item_t...
2016/10/11
[ "https://Stackoverflow.com/questions/39971831", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5811421/" ]
I find the code from [spring-cloud-sleuth](https://github.com/spring-cloud/spring-cloud-sleuth/tree/master/benchmarks/src/main/java/org/springframework/cloud/sleuth/benchmarks/jmh/benchmarks),it works for me ``` @State(Scope.Benchmark) @BenchmarkMode(Mode.AverageTime) @Warmup(iterations = 5, time = 1, timeUnit = TimeU...
``` @State(Scope.Benchmark) public static class SpringState { AnnotationConfigApplicationContext context; @Setup(Level.Trial) public void setup() { context = new AnnotationConfigApplicationContext(); context.register(CLASSNAME.class); context.register(ANOTHER_CLASSNAME_TO_BE_LOADED...
47,738,652
I just installed a fresh new Android Studio on a fresh new Windows 7. I created a new empty project and Android Studio keeps failing at project syncing. I tried few solutions people posted on SO, but none of them worked so I decided to show you my project structure hoping someone can help. So, this is my project's gra...
2017/12/10
[ "https://Stackoverflow.com/questions/47738652", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8789149/" ]
Issue could be caused by the following reasons 1. Gradle has not synced the libraries. 2. Android Studios offline mode is activated. See [this](https://stackoverflow.com/a/47114291/7702686) for more info
Go to File->Project Structure. In the Dependency Tab Choose Plus icon appears green then choose Library dependency. And add through that. If still problem appears update Support Repository through SDK Manager [![enter image description here](https://i.stack.imgur.com/wZLAi.png)](https://i.stack.imgur.com/wZLAi.png)
34,424,846
I already opened a [question on this topic](https://stackoverflow.com/questions/34362012/trouble-with-curve-fitting-lmfit-wont-produce-proper-fit-to-peak-data), but I wasn't sure, if I should post it there, so I opened a new question here. I have trouble again when fitting two or more peaks. First problem occurs with ...
2015/12/22
[ "https://Stackoverflow.com/questions/34424846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5500160/" ]
I have a somewhat tolerable solution for you. Since I don't know how variable your data is, I cannot say that it will work in a general sense but should get you started. If your data is along 0-1000 and has two peaks or dips along a line as you showed, then it should work. I used the scipy curve\_fit and put all of th...
In your first attempt: ``` pars['g1_fraction'].set(0, vary=True) ``` The fraction must be a value between 0 and 1, but I believe that cannot be zero. Try to put something like 0.000001, and it will work.
43,039,407
I would like to ask your assistance on how to calculate sha256 of large files in PHP. Currently, I used Amazon Glacier to store old files and use their API to upload the archive. Initially, I just used small files that cannot reach to MB-sized images. When I tried to upload more than 1MB, the API response said that the...
2017/03/27
[ "https://Stackoverflow.com/questions/43039407", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6729008/" ]
Glacier have theirs own way to count SHA256-TREE-HASH. Here you have working code on PHP. This function returns SHA256 hash created from 1MB parts as they want. It works perfect for me, even for large or small files. ``` private function getFinalHash($path, $MB = 1048576) { $fp = fopen($path, "rb"); $hashes =...
THe trick is, that the sha256 hash is computed by the AWS SDK for PHP which your are using. So you do not need to calculate the hash by yourself. Here is an example: ``` $client = new GlacierClient(array( 'key' => '[aws access key]', 'secret' => '[aws secret key]', 'region' => '[aws region]', // (e.g., ...
420,530
I'm looking into using log shipping for disaster recovery and I'm getting mixed messages about whether to use the built-in stuff or roll my own. Which do you recommend, please, and if you favour rolling your own what's wrong with the built-in stuff? If I'm going to reinvent the wheel I don't want to make the same mista...
2009/01/07
[ "https://Stackoverflow.com/questions/420530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43631/" ]
There's really two parts to your question: 1. Is native log shipping good enough? 2. If not, whose log shipping should I use? Here's my two cents, but like you're already discovering, a lot of this is based on opinions. About the first question - native log shipping is fine for small implementations - say, 1-2 serve...
I tried the built-in log shipping and found some real problems with it so I developed my own. I blogged about it [here](http://sqlblogcasts.com/blogs/davidwimbush/archive/2009/07/05/roll-your-own-log-shipping.aspx). PS: And just for the record, you definitely get log shipping in the Workgoup edition. I don't know wher...
420,530
I'm looking into using log shipping for disaster recovery and I'm getting mixed messages about whether to use the built-in stuff or roll my own. Which do you recommend, please, and if you favour rolling your own what's wrong with the built-in stuff? If I'm going to reinvent the wheel I don't want to make the same mista...
2009/01/07
[ "https://Stackoverflow.com/questions/420530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43631/" ]
There's really two parts to your question: 1. Is native log shipping good enough? 2. If not, whose log shipping should I use? Here's my two cents, but like you're already discovering, a lot of this is based on opinions. About the first question - native log shipping is fine for small implementations - say, 1-2 serve...
I would expect this to be close to the last place you'd want to save a few bucks, especially given the likely consequences if you screw up. Would you rather have your job on the line? I don't even think I'd admit it, if I felt I had a chance of getting this one right? What's your personal upside benefit in this?
420,530
I'm looking into using log shipping for disaster recovery and I'm getting mixed messages about whether to use the built-in stuff or roll my own. Which do you recommend, please, and if you favour rolling your own what's wrong with the built-in stuff? If I'm going to reinvent the wheel I don't want to make the same mista...
2009/01/07
[ "https://Stackoverflow.com/questions/420530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43631/" ]
Have you considered mirroring instead? Here is some [documentation](http://www.microsoft.com/technet/prodtechnol/sql/2005/dbmirror.mspx) to determine if you could do that instead
I would expect this to be close to the last place you'd want to save a few bucks, especially given the likely consequences if you screw up. Would you rather have your job on the line? I don't even think I'd admit it, if I felt I had a chance of getting this one right? What's your personal upside benefit in this?
420,530
I'm looking into using log shipping for disaster recovery and I'm getting mixed messages about whether to use the built-in stuff or roll my own. Which do you recommend, please, and if you favour rolling your own what's wrong with the built-in stuff? If I'm going to reinvent the wheel I don't want to make the same mista...
2009/01/07
[ "https://Stackoverflow.com/questions/420530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43631/" ]
I tried the built-in log shipping and found some real problems with it so I developed my own. I blogged about it [here](http://sqlblogcasts.com/blogs/davidwimbush/archive/2009/07/05/roll-your-own-log-shipping.aspx). PS: And just for the record, you definitely get log shipping in the Workgoup edition. I don't know wher...
I would expect this to be close to the last place you'd want to save a few bucks, especially given the likely consequences if you screw up. Would you rather have your job on the line? I don't even think I'd admit it, if I felt I had a chance of getting this one right? What's your personal upside benefit in this?
420,530
I'm looking into using log shipping for disaster recovery and I'm getting mixed messages about whether to use the built-in stuff or roll my own. Which do you recommend, please, and if you favour rolling your own what's wrong with the built-in stuff? If I'm going to reinvent the wheel I don't want to make the same mista...
2009/01/07
[ "https://Stackoverflow.com/questions/420530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43631/" ]
There's really two parts to your question: 1. Is native log shipping good enough? 2. If not, whose log shipping should I use? Here's my two cents, but like you're already discovering, a lot of this is based on opinions. About the first question - native log shipping is fine for small implementations - say, 1-2 serve...
I'm pretty sure it's available in Standard, since we're doing some shipping, but I'm not sure about the Workgroup edition - it's pretty stripped down. I'm always in favor of the packages solution, but mostly because I trust a whole team of MSFT developers more than I trust myself, but that comes with a price for sure....
420,530
I'm looking into using log shipping for disaster recovery and I'm getting mixed messages about whether to use the built-in stuff or roll my own. Which do you recommend, please, and if you favour rolling your own what's wrong with the built-in stuff? If I'm going to reinvent the wheel I don't want to make the same mista...
2009/01/07
[ "https://Stackoverflow.com/questions/420530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43631/" ]
Have you considered mirroring instead? Here is some [documentation](http://www.microsoft.com/technet/prodtechnol/sql/2005/dbmirror.mspx) to determine if you could do that instead
If you decide to roll your own, [here's a nice guide](http://searchsqlserver.techtarget.com/tip/0,289483,sid87_gci1327798,00.html). I'm assuming you're going this route because Enterprise Edition is so costly? If you don't need a "live-backup", but really just want a frequently updated backup, I think this approach m...
420,530
I'm looking into using log shipping for disaster recovery and I'm getting mixed messages about whether to use the built-in stuff or roll my own. Which do you recommend, please, and if you favour rolling your own what's wrong with the built-in stuff? If I'm going to reinvent the wheel I don't want to make the same mista...
2009/01/07
[ "https://Stackoverflow.com/questions/420530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43631/" ]
I tried the built-in log shipping and found some real problems with it so I developed my own. I blogged about it [here](http://sqlblogcasts.com/blogs/davidwimbush/archive/2009/07/05/roll-your-own-log-shipping.aspx). PS: And just for the record, you definitely get log shipping in the Workgoup edition. I don't know wher...
I'm pretty sure it's available in Standard, since we're doing some shipping, but I'm not sure about the Workgroup edition - it's pretty stripped down. I'm always in favor of the packages solution, but mostly because I trust a whole team of MSFT developers more than I trust myself, but that comes with a price for sure....
420,530
I'm looking into using log shipping for disaster recovery and I'm getting mixed messages about whether to use the built-in stuff or roll my own. Which do you recommend, please, and if you favour rolling your own what's wrong with the built-in stuff? If I'm going to reinvent the wheel I don't want to make the same mista...
2009/01/07
[ "https://Stackoverflow.com/questions/420530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43631/" ]
I tried the built-in log shipping and found some real problems with it so I developed my own. I blogged about it [here](http://sqlblogcasts.com/blogs/davidwimbush/archive/2009/07/05/roll-your-own-log-shipping.aspx). PS: And just for the record, you definitely get log shipping in the Workgoup edition. I don't know wher...
If you decide to roll your own, [here's a nice guide](http://searchsqlserver.techtarget.com/tip/0,289483,sid87_gci1327798,00.html). I'm assuming you're going this route because Enterprise Edition is so costly? If you don't need a "live-backup", but really just want a frequently updated backup, I think this approach m...
420,530
I'm looking into using log shipping for disaster recovery and I'm getting mixed messages about whether to use the built-in stuff or roll my own. Which do you recommend, please, and if you favour rolling your own what's wrong with the built-in stuff? If I'm going to reinvent the wheel I don't want to make the same mista...
2009/01/07
[ "https://Stackoverflow.com/questions/420530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43631/" ]
Have you considered mirroring instead? Here is some [documentation](http://www.microsoft.com/technet/prodtechnol/sql/2005/dbmirror.mspx) to determine if you could do that instead
I'm pretty sure it's available in Standard, since we're doing some shipping, but I'm not sure about the Workgroup edition - it's pretty stripped down. I'm always in favor of the packages solution, but mostly because I trust a whole team of MSFT developers more than I trust myself, but that comes with a price for sure....
420,530
I'm looking into using log shipping for disaster recovery and I'm getting mixed messages about whether to use the built-in stuff or roll my own. Which do you recommend, please, and if you favour rolling your own what's wrong with the built-in stuff? If I'm going to reinvent the wheel I don't want to make the same mista...
2009/01/07
[ "https://Stackoverflow.com/questions/420530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43631/" ]
There's really two parts to your question: 1. Is native log shipping good enough? 2. If not, whose log shipping should I use? Here's my two cents, but like you're already discovering, a lot of this is based on opinions. About the first question - native log shipping is fine for small implementations - say, 1-2 serve...
If you decide to roll your own, [here's a nice guide](http://searchsqlserver.techtarget.com/tip/0,289483,sid87_gci1327798,00.html). I'm assuming you're going this route because Enterprise Edition is so costly? If you don't need a "live-backup", but really just want a frequently updated backup, I think this approach m...
39,490
I have a PC where the desktop background options are disabled. I have tried resetting the ActiveDesktop - AllowChangingWallpaper (something like that) to no avail. There is no security enabled on the machine, it is running BitDefender after a recent trojan attack. That is all I know at the moment, but nowhere can I fin...
2009/09/11
[ "https://superuser.com/questions/39490", "https://superuser.com", "https://superuser.com/users/10670/" ]
Install XP **first**. After that install 7. When 7 is installed, its bootloader will also recognize XP; that way you'll be able to boot in both operating systems without needing to do anything else.
Why do you need to dual boot XP? If you have Ultimate just install Windows 7 then install XP mode in Windows 7 and it's all virtualized. Unless you have some specific reason for it which you could add to the question.
39,490
I have a PC where the desktop background options are disabled. I have tried resetting the ActiveDesktop - AllowChangingWallpaper (something like that) to no avail. There is no security enabled on the machine, it is running BitDefender after a recent trojan attack. That is all I know at the moment, but nowhere can I fin...
2009/09/11
[ "https://superuser.com/questions/39490", "https://superuser.com", "https://superuser.com/users/10670/" ]
Although the recommended method is to install XP and then Windows 7, there is no need to reinstall in your case. Follow this [guide](http://www.ehow.com/how_4900122_use-easybcd-windows-xp.html) (edited below) using a free tool called [EasyBCD](http://neosmart.net/dl.php?id=1). > > 1. Download and install [**EasyBCD*...
Install XP **first**. After that install 7. When 7 is installed, its bootloader will also recognize XP; that way you'll be able to boot in both operating systems without needing to do anything else.
39,490
I have a PC where the desktop background options are disabled. I have tried resetting the ActiveDesktop - AllowChangingWallpaper (something like that) to no avail. There is no security enabled on the machine, it is running BitDefender after a recent trojan attack. That is all I know at the moment, but nowhere can I fin...
2009/09/11
[ "https://superuser.com/questions/39490", "https://superuser.com", "https://superuser.com/users/10670/" ]
Install XP **first**. After that install 7. When 7 is installed, its bootloader will also recognize XP; that way you'll be able to boot in both operating systems without needing to do anything else.
Why don't you install and run XP from a VHD file? [Windows 7 is able to natively boot VHD files](http://edge.technet.com/Media/Windows-7-Boot-from-VHD/), so this might be the easiest way to get XP installed. If you still want to install XP and Win7 side by side, I'd install XP first, then Windows 7. Why? Because XPs i...
39,490
I have a PC where the desktop background options are disabled. I have tried resetting the ActiveDesktop - AllowChangingWallpaper (something like that) to no avail. There is no security enabled on the machine, it is running BitDefender after a recent trojan attack. That is all I know at the moment, but nowhere can I fin...
2009/09/11
[ "https://superuser.com/questions/39490", "https://superuser.com", "https://superuser.com/users/10670/" ]
Install XP **first**. After that install 7. When 7 is installed, its bootloader will also recognize XP; that way you'll be able to boot in both operating systems without needing to do anything else.
Also is installing xp completely needed why do you need xp for? First check if all of the programs if you could use all of those in either vista or win7. (for me I use a website called FileHippo is has an update checker to check all of you're programs for an update) Than if there is a reason you have to use win7 tha...
39,490
I have a PC where the desktop background options are disabled. I have tried resetting the ActiveDesktop - AllowChangingWallpaper (something like that) to no avail. There is no security enabled on the machine, it is running BitDefender after a recent trojan attack. That is all I know at the moment, but nowhere can I fin...
2009/09/11
[ "https://superuser.com/questions/39490", "https://superuser.com", "https://superuser.com/users/10670/" ]
Although the recommended method is to install XP and then Windows 7, there is no need to reinstall in your case. Follow this [guide](http://www.ehow.com/how_4900122_use-easybcd-windows-xp.html) (edited below) using a free tool called [EasyBCD](http://neosmart.net/dl.php?id=1). > > 1. Download and install [**EasyBCD*...
Why do you need to dual boot XP? If you have Ultimate just install Windows 7 then install XP mode in Windows 7 and it's all virtualized. Unless you have some specific reason for it which you could add to the question.
39,490
I have a PC where the desktop background options are disabled. I have tried resetting the ActiveDesktop - AllowChangingWallpaper (something like that) to no avail. There is no security enabled on the machine, it is running BitDefender after a recent trojan attack. That is all I know at the moment, but nowhere can I fin...
2009/09/11
[ "https://superuser.com/questions/39490", "https://superuser.com", "https://superuser.com/users/10670/" ]
Why do you need to dual boot XP? If you have Ultimate just install Windows 7 then install XP mode in Windows 7 and it's all virtualized. Unless you have some specific reason for it which you could add to the question.
Also is installing xp completely needed why do you need xp for? First check if all of the programs if you could use all of those in either vista or win7. (for me I use a website called FileHippo is has an update checker to check all of you're programs for an update) Than if there is a reason you have to use win7 tha...
39,490
I have a PC where the desktop background options are disabled. I have tried resetting the ActiveDesktop - AllowChangingWallpaper (something like that) to no avail. There is no security enabled on the machine, it is running BitDefender after a recent trojan attack. That is all I know at the moment, but nowhere can I fin...
2009/09/11
[ "https://superuser.com/questions/39490", "https://superuser.com", "https://superuser.com/users/10670/" ]
Although the recommended method is to install XP and then Windows 7, there is no need to reinstall in your case. Follow this [guide](http://www.ehow.com/how_4900122_use-easybcd-windows-xp.html) (edited below) using a free tool called [EasyBCD](http://neosmart.net/dl.php?id=1). > > 1. Download and install [**EasyBCD*...
Why don't you install and run XP from a VHD file? [Windows 7 is able to natively boot VHD files](http://edge.technet.com/Media/Windows-7-Boot-from-VHD/), so this might be the easiest way to get XP installed. If you still want to install XP and Win7 side by side, I'd install XP first, then Windows 7. Why? Because XPs i...