qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
41,283,816
Not able to grasp the concept behind these two different terms. Can anyone please help out with an example?
2016/12/22
[ "https://Stackoverflow.com/questions/41283816", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2739470/" ]
You can try with this code : ``` <?php $contact='[contact-form-7 id="1442" title="Service 1 "]'?> <?php echo do_shortcode($contact);?> ```
your method is correct but you can also try this `apply_filters('the_content','[contact-form-7 id="1442" title="Service 1"]')` also please make sure there is a contact form 7 exists with the id, '1442'
41,283,816
Not able to grasp the concept behind these two different terms. Can anyone please help out with an example?
2016/12/22
[ "https://Stackoverflow.com/questions/41283816", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2739470/" ]
I tried to insert an URL and it worked: <a href="https://[contact-form-7 id="10742" title="Register"]"> Hope it resolves your problem
your method is correct but you can also try this `apply_filters('the_content','[contact-form-7 id="1442" title="Service 1"]')` also please make sure there is a contact form 7 exists with the id, '1442'
41,283,816
Not able to grasp the concept behind these two different terms. Can anyone please help out with an example?
2016/12/22
[ "https://Stackoverflow.com/questions/41283816", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2739470/" ]
You can try with this code : ``` <?php $contact='[contact-form-7 id="1442" title="Service 1 "]'?> <?php echo do_shortcode($contact);?> ```
You can't embed it into a HTML file, you need to have a .PHP file connected to a server with wordpress installed on it so the php functions and wordpress functions could work.
41,283,816
Not able to grasp the concept behind these two different terms. Can anyone please help out with an example?
2016/12/22
[ "https://Stackoverflow.com/questions/41283816", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2739470/" ]
I tried to insert an URL and it worked: <a href="https://[contact-form-7 id="10742" title="Register"]"> Hope it resolves your problem
You can't embed it into a HTML file, you need to have a .PHP file connected to a server with wordpress installed on it so the php functions and wordpress functions could work.
41,283,816
Not able to grasp the concept behind these two different terms. Can anyone please help out with an example?
2016/12/22
[ "https://Stackoverflow.com/questions/41283816", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2739470/" ]
You can try with this code : ``` <?php $contact='[contact-form-7 id="1442" title="Service 1 "]'?> <?php echo do_shortcode($contact);?> ```
I tried to insert an URL and it worked: <a href="https://[contact-form-7 id="10742" title="Register"]"> Hope it resolves your problem
64,731
Why are questions allowed to have two similar tags? For example, the following question has two tags assigned, [.net](/questions/tagged/.net "show questions tagged '.net'") and [.net3.5](/questions/tagged/.net3.5 "show questions tagged '.net3.5'"). <https://stackoverflow.com/posts/3726446/revisions>, revision 5 or ea...
2010/09/16
[ "https://meta.stackexchange.com/questions/64731", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/147192/" ]
The `.net` tag is for questions generally concerning the .NET Framework, independent of the version, while the `.net3.5` tag should indicate a question is specific to that version. In this case I guess the OP wasn't certain whether his question applies to all versions or not, someone knowing should adequately retag.
Well the tags aren't the same are they. The `.net` refers to the .NET Framework as a whole. The `.net3.5` refers specifically to version 3.5 of the Framework. It should probably be retagged to just `.net3.5`
64,731
Why are questions allowed to have two similar tags? For example, the following question has two tags assigned, [.net](/questions/tagged/.net "show questions tagged '.net'") and [.net3.5](/questions/tagged/.net3.5 "show questions tagged '.net3.5'"). <https://stackoverflow.com/posts/3726446/revisions>, revision 5 or ea...
2010/09/16
[ "https://meta.stackexchange.com/questions/64731", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/147192/" ]
Contrary to the answers posted so far tagging with both tags is correct. * The `.net3.5` tag is needed to indicate that either the question is about a specific feature of the version 3.5 of the .NET framework or to indicate that the user is using that specific version, and thus solutions that are not compatible with i...
Well the tags aren't the same are they. The `.net` refers to the .NET Framework as a whole. The `.net3.5` refers specifically to version 3.5 of the Framework. It should probably be retagged to just `.net3.5`
64,731
Why are questions allowed to have two similar tags? For example, the following question has two tags assigned, [.net](/questions/tagged/.net "show questions tagged '.net'") and [.net3.5](/questions/tagged/.net3.5 "show questions tagged '.net3.5'"). <https://stackoverflow.com/posts/3726446/revisions>, revision 5 or ea...
2010/09/16
[ "https://meta.stackexchange.com/questions/64731", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/147192/" ]
Contrary to the answers posted so far tagging with both tags is correct. * The `.net3.5` tag is needed to indicate that either the question is about a specific feature of the version 3.5 of the .NET framework or to indicate that the user is using that specific version, and thus solutions that are not compatible with i...
The `.net` tag is for questions generally concerning the .NET Framework, independent of the version, while the `.net3.5` tag should indicate a question is specific to that version. In this case I guess the OP wasn't certain whether his question applies to all versions or not, someone knowing should adequately retag.
166,616
Is there a word to describe the fear of never again seeing one's mother (or at least any person)? I have already checked the list of phobias that Wikipedia offers but could not find anything that fits the specific meaning I am looking for; perhaps there is such a word, but it does not have the word *phobia* attached ...
2014/04/28
[ "https://english.stackexchange.com/questions/166616", "https://english.stackexchange.com", "https://english.stackexchange.com/users/60619/" ]
Is "[separation anxiety disorder](http://en.wikipedia.org/wiki/Separation_anxiety_disorder)" the expression you're looking for? > > *SAD (Separation Anxiety Disorder) is a condition in which an individual experiments excessive anxiety regarding separation from home or from people to whom the individual has a strong e...
The ***fear of not seeing one's mother ever again*** also refers to the ***fear of death or*** ***dead things*** and is called **NECROPHOBIA**.
7,914,579
Say I have a table of data that looks like: ``` ItemNo | ItemCount | Proportion ------------------------------------------ 1 3 0.15 2 2 0.10 3 3 0.15 4 0 0.00 5 2 0.10...
2011/10/27
[ "https://Stackoverflow.com/questions/7914579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/694652/" ]
``` select top 1 t1.ItemNo from MyTable t1 where ((select sum(t2.Proportion) from MyTable t2 where t2.ItemNo <= t1.ItemNo) >= 0.35) order by t1.ItemNo ```
A classic for a window function: ``` SELECT * FROM ( SELECT ItemNo ,ItemCount ,sum(Proportion) OVER (ORDER BY ItemNo) AS running_sum FROM tbl) y WHERE running_sum > 0.35 LIMIT 1; ``` Works in **PostgreSQL**, among others. Or, in **tSQL** notation (which you seem to use): SELECT...
16,716,474
I'm using SonataAdminBundle and I'm triying to change the edit link of and entity by the show link. I want to do this because I need the entity couldn't be modified but I want you can show the entity by clicking in the Identifier field of the list page. I need to show the entity by clicking in the Identifier, and n...
2013/05/23
[ "https://Stackoverflow.com/questions/16716474", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2132206/" ]
You can give the default action like this (in your admin classes): ``` protected function configureListFields(ListMapper $listMapper) { $listMapper ->addIdentifier('id', null, ['route' => ['name' => 'show']]) ; } ```
Finally, it works by: ``` protected function configureRoutes(RouteCollection $collection){ $collection->remove('edit'); $collection->add('edit', $this->getRouterIdParameter().'/show'); } ``` I don't know why I have to remove the edit link first... but it works.
4,151,589
When I define a dictionary which use list as key ``` collections.defaultdict(list) ``` When I print it out, it shows itself is using tuple as key. May I know why? ``` import collections tuple_as_dict_key = collections.defaultdict(tuple) tuple_as_dict_key['abc', 1, 2] = 999 tuple_as_dict_key['abc', 3, 4] = 999 tup...
2010/11/11
[ "https://Stackoverflow.com/questions/4151589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/72437/" ]
There's a nice article explaining the answer to why you can't use a list as key [here](http://wiki.python.org/moin/DictionaryKeys).
Dictionary keys can only be [immutable types](http://docs.python.org/tutorial/datastructures.html#tuples-and-sequences). Since a list is a mutable type it must be converted to an immutable type such as a tuple to be used as a dictionary key, and this conversion is being done automatically.
4,151,589
When I define a dictionary which use list as key ``` collections.defaultdict(list) ``` When I print it out, it shows itself is using tuple as key. May I know why? ``` import collections tuple_as_dict_key = collections.defaultdict(tuple) tuple_as_dict_key['abc', 1, 2] = 999 tuple_as_dict_key['abc', 3, 4] = 999 tup...
2010/11/11
[ "https://Stackoverflow.com/questions/4151589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/72437/" ]
When you're adding values to your dictionary you're doing it the same way in both cases and they're treated as a tuple. What you're passing to the constructor is the default value for any keys that are not present. Your default value in this case happens to be of type "type", but that has absolutely nothing to do with ...
Dictionary keys can only be [immutable types](http://docs.python.org/tutorial/datastructures.html#tuples-and-sequences). Since a list is a mutable type it must be converted to an immutable type such as a tuple to be used as a dictionary key, and this conversion is being done automatically.
4,151,589
When I define a dictionary which use list as key ``` collections.defaultdict(list) ``` When I print it out, it shows itself is using tuple as key. May I know why? ``` import collections tuple_as_dict_key = collections.defaultdict(tuple) tuple_as_dict_key['abc', 1, 2] = 999 tuple_as_dict_key['abc', 3, 4] = 999 tup...
2010/11/11
[ "https://Stackoverflow.com/questions/4151589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/72437/" ]
The parameter to `defaultdict` is not the type of the key, it is a function that creates default data. Your test cases don't exercise this because you're filling the dict with defined values and not using any defaults. If you were to try to get the value `list_as_dict_key['abc', 7, 8]` it would return an empty list, si...
Dictionary keys can only be [immutable types](http://docs.python.org/tutorial/datastructures.html#tuples-and-sequences). Since a list is a mutable type it must be converted to an immutable type such as a tuple to be used as a dictionary key, and this conversion is being done automatically.
4,151,589
When I define a dictionary which use list as key ``` collections.defaultdict(list) ``` When I print it out, it shows itself is using tuple as key. May I know why? ``` import collections tuple_as_dict_key = collections.defaultdict(tuple) tuple_as_dict_key['abc', 1, 2] = 999 tuple_as_dict_key['abc', 3, 4] = 999 tup...
2010/11/11
[ "https://Stackoverflow.com/questions/4151589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/72437/" ]
There's a nice article explaining the answer to why you can't use a list as key [here](http://wiki.python.org/moin/DictionaryKeys).
`defaultdict` is **not** setting the *key* as a list. It's setting the default *value*. ``` >>> from collections import defaultdict >>> d1 = collections.defaultdict(list) >>> d1['foo'] [] >>> d1['foo'] = 37 >>> d1['foo'] 37 >>> d1['bar'] [] >>> d1['bar'].append(37) >>> d1['bar'] [37] ``` The way that you're getting ...
4,151,589
When I define a dictionary which use list as key ``` collections.defaultdict(list) ``` When I print it out, it shows itself is using tuple as key. May I know why? ``` import collections tuple_as_dict_key = collections.defaultdict(tuple) tuple_as_dict_key['abc', 1, 2] = 999 tuple_as_dict_key['abc', 3, 4] = 999 tup...
2010/11/11
[ "https://Stackoverflow.com/questions/4151589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/72437/" ]
The parameter to `defaultdict` is not the type of the key, it is a function that creates default data. Your test cases don't exercise this because you're filling the dict with defined values and not using any defaults. If you were to try to get the value `list_as_dict_key['abc', 7, 8]` it would return an empty list, si...
There's a nice article explaining the answer to why you can't use a list as key [here](http://wiki.python.org/moin/DictionaryKeys).
4,151,589
When I define a dictionary which use list as key ``` collections.defaultdict(list) ``` When I print it out, it shows itself is using tuple as key. May I know why? ``` import collections tuple_as_dict_key = collections.defaultdict(tuple) tuple_as_dict_key['abc', 1, 2] = 999 tuple_as_dict_key['abc', 3, 4] = 999 tup...
2010/11/11
[ "https://Stackoverflow.com/questions/4151589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/72437/" ]
When you're adding values to your dictionary you're doing it the same way in both cases and they're treated as a tuple. What you're passing to the constructor is the default value for any keys that are not present. Your default value in this case happens to be of type "type", but that has absolutely nothing to do with ...
`defaultdict` is **not** setting the *key* as a list. It's setting the default *value*. ``` >>> from collections import defaultdict >>> d1 = collections.defaultdict(list) >>> d1['foo'] [] >>> d1['foo'] = 37 >>> d1['foo'] 37 >>> d1['bar'] [] >>> d1['bar'].append(37) >>> d1['bar'] [37] ``` The way that you're getting ...
4,151,589
When I define a dictionary which use list as key ``` collections.defaultdict(list) ``` When I print it out, it shows itself is using tuple as key. May I know why? ``` import collections tuple_as_dict_key = collections.defaultdict(tuple) tuple_as_dict_key['abc', 1, 2] = 999 tuple_as_dict_key['abc', 3, 4] = 999 tup...
2010/11/11
[ "https://Stackoverflow.com/questions/4151589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/72437/" ]
The parameter to `defaultdict` is not the type of the key, it is a function that creates default data. Your test cases don't exercise this because you're filling the dict with defined values and not using any defaults. If you were to try to get the value `list_as_dict_key['abc', 7, 8]` it would return an empty list, si...
When you're adding values to your dictionary you're doing it the same way in both cases and they're treated as a tuple. What you're passing to the constructor is the default value for any keys that are not present. Your default value in this case happens to be of type "type", but that has absolutely nothing to do with ...
4,151,589
When I define a dictionary which use list as key ``` collections.defaultdict(list) ``` When I print it out, it shows itself is using tuple as key. May I know why? ``` import collections tuple_as_dict_key = collections.defaultdict(tuple) tuple_as_dict_key['abc', 1, 2] = 999 tuple_as_dict_key['abc', 3, 4] = 999 tup...
2010/11/11
[ "https://Stackoverflow.com/questions/4151589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/72437/" ]
The parameter to `defaultdict` is not the type of the key, it is a function that creates default data. Your test cases don't exercise this because you're filling the dict with defined values and not using any defaults. If you were to try to get the value `list_as_dict_key['abc', 7, 8]` it would return an empty list, si...
`defaultdict` is **not** setting the *key* as a list. It's setting the default *value*. ``` >>> from collections import defaultdict >>> d1 = collections.defaultdict(list) >>> d1['foo'] [] >>> d1['foo'] = 37 >>> d1['foo'] 37 >>> d1['bar'] [] >>> d1['bar'].append(37) >>> d1['bar'] [37] ``` The way that you're getting ...
601,613
What I am attempting to do is combine all of the files within a subdirectory into a new file, and give the new combined file the same name as the subdirectory, and I have no idea how to do this in Bash. Here's how I approached it: I have a number of directories, each with a unique file name (with spaces!). Within each ...
2013/05/30
[ "https://superuser.com/questions/601613", "https://superuser.com", "https://superuser.com/users/227856/" ]
The POSIX way is to use `print . -type d ... | while read f; do`, but unless you're obsessed with 100% portability, I wouldn't bother with that. If you have bash 4+ and `pdfunite` (installed by default on my Ubuntu 13.04), you can do this in two lines: ``` shopt -s globstar for f in ./**/; do pdfunite "$f"/*.pdf "$f"/...
1. Create `for` loop with `find /home/ -type f -name "*.pdf"` as a variable 2. Copy files to where you need them to, take $VARIABLE and process it through sed/awk to remove "/". Post your script and we can help you to improve it. You can always run scripts with `bash -x` to debug them or you can set `!#/bin/bash -x` ...
1,021,338
Is there anyway by which we can read a value from an .xls file using nant scripts.The nant scripts should ask the input from the user and based on the inputs the nant.build should search the .xls file and when it sees the match,it should copy the corresponding mail ID and echo that mail ID to some other file and that e...
2009/06/20
[ "https://Stackoverflow.com/questions/1021338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You should write an NAnt extension. It is relatively easy to do. See this tutorial [here](http://www.atalasoft.com/cs/blogs/jake/archive/2008/05/07/writing-custom-nant-tasks.aspx) As an example project see my question [here](https://stackoverflow.com/questions/851203/nant-vault-windows-integrated-authentication) and ...
I'll re-phrase my answer : "Is there anyway by which we can read a value from an .xls file using nant scripts" If you are talking about using the 'core' NAnt functionality, which is that funcationality that is provided within the basic installation of NAnt, then I would say "No" or "Not very easily". You can however...
38,560,437
I'm making an android application that will inject touch events based on motions that I make. So far, I can use instrumentations to inject events but only within my application. I want to be able to use this service in other apps as well. I've read that this is possible with root but is there a way without it? Thank yo...
2016/07/25
[ "https://Stackoverflow.com/questions/38560437", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6633432/" ]
It is possible from a platform signed application/service to inject the keys/events to other applications. But I suppose the platform signatures change for different manufacturers !!
No, it isn't. And the reason for this is security. If you could do that, you could screw up or access all sorts of data in the other apps. They try to avoid that.
18,237,519
I am trying to print some Information to the Console in a Symfony Console Command. Regularly you would do something like this: ``` protected function execute(InputInterface $input, OutputInterface $output) { $name = $input->getArgument('name'); if ($name) { $text = 'Hello '.$name; } else { ...
2013/08/14
[ "https://Stackoverflow.com/questions/18237519", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1548788/" ]
Understanding the matter of ponctual debugging, you can always print debug messages with `echo` or `var_dump` If you plan to use a command without Symfony's application with global debug messages, here's a way to do this. Symfony offers 3 different `OutputInterface`s * [NullOutput](http://api.symfony.com/2.3/Symfony...
Look at JMSAopBundle <https://github.com/schmittjoh/JMSAopBundle> and check out this great article <http://php-and-symfony.matthiasnoback.nl/2013/07/symfony2-rich-console-command-output-using-aop/>
140
I have rabbits that routinely build nests in my yard. How can I get rid of the rabbits legally? I don't want some officer from the DNR knocking on my door because I improperly hunted or poisoned them. The rabbits cause several problems: 1. Our dog goes absolutely nuts barking at them through the window, chases them w...
2011/06/08
[ "https://gardening.stackexchange.com/questions/140", "https://gardening.stackexchange.com", "https://gardening.stackexchange.com/users/105/" ]
I've heard of dried blood working well as a repellent for rabbits as well as deer. If you were to plant a vegetable garden you could sprinkle some of this around the plants as a sort of combination fertilizer/pest deterrent.
To try to get rid of nature, is like living in a bubble. Try to work with it and you'll probably be surprised. Last summer I was fortunate enough to flush out 4 baby rabbits before I ran over them with the lawn mower! I got them one by one and put them over in the woods-phew! I've seen a few in the back yard, but none ...
140
I have rabbits that routinely build nests in my yard. How can I get rid of the rabbits legally? I don't want some officer from the DNR knocking on my door because I improperly hunted or poisoned them. The rabbits cause several problems: 1. Our dog goes absolutely nuts barking at them through the window, chases them w...
2011/06/08
[ "https://gardening.stackexchange.com/questions/140", "https://gardening.stackexchange.com", "https://gardening.stackexchange.com/users/105/" ]
After just reading the title, I was going to suggest get a dog. Our dog has killed a couple rabbits already this year. Perhaps you could simply leave your dog in the yard more often, letting him/her out when she's barking at them through the window. I guess this depends if your dog is fast enough to catch them. You cou...
Not to sound too glib, but we had rabbits and voles in our yard when we moved in 2.5 years ago. Then the foxes and owls came, and no more rabbits and voles. Maybe you can figure out some way to make that work for you.
140
I have rabbits that routinely build nests in my yard. How can I get rid of the rabbits legally? I don't want some officer from the DNR knocking on my door because I improperly hunted or poisoned them. The rabbits cause several problems: 1. Our dog goes absolutely nuts barking at them through the window, chases them w...
2011/06/08
[ "https://gardening.stackexchange.com/questions/140", "https://gardening.stackexchange.com", "https://gardening.stackexchange.com/users/105/" ]
Deer and rabbits both have a very keen sense of smell. I use a mixture of garlic powder, chili powder and water to keep the deer out of the garden. I am pretty sure that would work for rabbits as well. Spray it around where they are nesting and see if they move. If they do make up a large batch and spray the whole yard...
After just reading the title, I was going to suggest get a dog. Our dog has killed a couple rabbits already this year. Perhaps you could simply leave your dog in the yard more often, letting him/her out when she's barking at them through the window. I guess this depends if your dog is fast enough to catch them. You cou...
140
I have rabbits that routinely build nests in my yard. How can I get rid of the rabbits legally? I don't want some officer from the DNR knocking on my door because I improperly hunted or poisoned them. The rabbits cause several problems: 1. Our dog goes absolutely nuts barking at them through the window, chases them w...
2011/06/08
[ "https://gardening.stackexchange.com/questions/140", "https://gardening.stackexchange.com", "https://gardening.stackexchange.com/users/105/" ]
Every product I've tried hasn't worked for long. I finally put up chicken wire. That's the only thing that worked. What didn't work - Don't waste your money. An owl with light up eyes, moved every couple of days to a different spot. Many different brands of rabbit repellant, including Liquid Fence. Crushed up egg shel...
To try to get rid of nature, is like living in a bubble. Try to work with it and you'll probably be surprised. Last summer I was fortunate enough to flush out 4 baby rabbits before I ran over them with the lawn mower! I got them one by one and put them over in the woods-phew! I've seen a few in the back yard, but none ...
140
I have rabbits that routinely build nests in my yard. How can I get rid of the rabbits legally? I don't want some officer from the DNR knocking on my door because I improperly hunted or poisoned them. The rabbits cause several problems: 1. Our dog goes absolutely nuts barking at them through the window, chases them w...
2011/06/08
[ "https://gardening.stackexchange.com/questions/140", "https://gardening.stackexchange.com", "https://gardening.stackexchange.com/users/105/" ]
I've heard of dried blood working well as a repellent for rabbits as well as deer. If you were to plant a vegetable garden you could sprinkle some of this around the plants as a sort of combination fertilizer/pest deterrent.
Not to sound too glib, but we had rabbits and voles in our yard when we moved in 2.5 years ago. Then the foxes and owls came, and no more rabbits and voles. Maybe you can figure out some way to make that work for you.
140
I have rabbits that routinely build nests in my yard. How can I get rid of the rabbits legally? I don't want some officer from the DNR knocking on my door because I improperly hunted or poisoned them. The rabbits cause several problems: 1. Our dog goes absolutely nuts barking at them through the window, chases them w...
2011/06/08
[ "https://gardening.stackexchange.com/questions/140", "https://gardening.stackexchange.com", "https://gardening.stackexchange.com/users/105/" ]
After just reading the title, I was going to suggest get a dog. Our dog has killed a couple rabbits already this year. Perhaps you could simply leave your dog in the yard more often, letting him/her out when she's barking at them through the window. I guess this depends if your dog is fast enough to catch them. You cou...
Truly, having dogs around gets rid of rabbits, feral cats, deer, bobcat, fishers, voles, moles...etc. You don't have to allow the dogs to kill them. Helloooo! Rabies and all kinds of disease could be transferred. It takes a few months but works just fine! I have all of the above and more. That and freezing temperatures...
140
I have rabbits that routinely build nests in my yard. How can I get rid of the rabbits legally? I don't want some officer from the DNR knocking on my door because I improperly hunted or poisoned them. The rabbits cause several problems: 1. Our dog goes absolutely nuts barking at them through the window, chases them w...
2011/06/08
[ "https://gardening.stackexchange.com/questions/140", "https://gardening.stackexchange.com", "https://gardening.stackexchange.com/users/105/" ]
Truly, having dogs around gets rid of rabbits, feral cats, deer, bobcat, fishers, voles, moles...etc. You don't have to allow the dogs to kill them. Helloooo! Rabies and all kinds of disease could be transferred. It takes a few months but works just fine! I have all of the above and more. That and freezing temperatures...
To try to get rid of nature, is like living in a bubble. Try to work with it and you'll probably be surprised. Last summer I was fortunate enough to flush out 4 baby rabbits before I ran over them with the lawn mower! I got them one by one and put them over in the woods-phew! I've seen a few in the back yard, but none ...
140
I have rabbits that routinely build nests in my yard. How can I get rid of the rabbits legally? I don't want some officer from the DNR knocking on my door because I improperly hunted or poisoned them. The rabbits cause several problems: 1. Our dog goes absolutely nuts barking at them through the window, chases them w...
2011/06/08
[ "https://gardening.stackexchange.com/questions/140", "https://gardening.stackexchange.com", "https://gardening.stackexchange.com/users/105/" ]
I've heard of dried blood working well as a repellent for rabbits as well as deer. If you were to plant a vegetable garden you could sprinkle some of this around the plants as a sort of combination fertilizer/pest deterrent.
Truly, having dogs around gets rid of rabbits, feral cats, deer, bobcat, fishers, voles, moles...etc. You don't have to allow the dogs to kill them. Helloooo! Rabies and all kinds of disease could be transferred. It takes a few months but works just fine! I have all of the above and more. That and freezing temperatures...
140
I have rabbits that routinely build nests in my yard. How can I get rid of the rabbits legally? I don't want some officer from the DNR knocking on my door because I improperly hunted or poisoned them. The rabbits cause several problems: 1. Our dog goes absolutely nuts barking at them through the window, chases them w...
2011/06/08
[ "https://gardening.stackexchange.com/questions/140", "https://gardening.stackexchange.com", "https://gardening.stackexchange.com/users/105/" ]
Deer and rabbits both have a very keen sense of smell. I use a mixture of garlic powder, chili powder and water to keep the deer out of the garden. I am pretty sure that would work for rabbits as well. Spray it around where they are nesting and see if they move. If they do make up a large batch and spray the whole yard...
Every product I've tried hasn't worked for long. I finally put up chicken wire. That's the only thing that worked. What didn't work - Don't waste your money. An owl with light up eyes, moved every couple of days to a different spot. Many different brands of rabbit repellant, including Liquid Fence. Crushed up egg shel...
140
I have rabbits that routinely build nests in my yard. How can I get rid of the rabbits legally? I don't want some officer from the DNR knocking on my door because I improperly hunted or poisoned them. The rabbits cause several problems: 1. Our dog goes absolutely nuts barking at them through the window, chases them w...
2011/06/08
[ "https://gardening.stackexchange.com/questions/140", "https://gardening.stackexchange.com", "https://gardening.stackexchange.com/users/105/" ]
After just reading the title, I was going to suggest get a dog. Our dog has killed a couple rabbits already this year. Perhaps you could simply leave your dog in the yard more often, letting him/her out when she's barking at them through the window. I guess this depends if your dog is fast enough to catch them. You cou...
Every product I've tried hasn't worked for long. I finally put up chicken wire. That's the only thing that worked. What didn't work - Don't waste your money. An owl with light up eyes, moved every couple of days to a different spot. Many different brands of rabbit repellant, including Liquid Fence. Crushed up egg shel...
24,517
As title above, how to play vs. ``` [fen ""] 1.e4 e5 2.Nf3 Nc6 3.Bc4 d6 ``` I see that this move (3...d6) is generally considered inferior in books, or not even mentioned in books about 3.Bc4, but I cannot see a clear way to obtain advantage.
2019/05/18
[ "https://chess.stackexchange.com/questions/24517", "https://chess.stackexchange.com", "https://chess.stackexchange.com/users/8291/" ]
The game will get the characteristics of the Philidor Defense rather than the Italian Game. Wikipedia calls it the [Semi-Italian Opening](https://en.wikipedia.org/wiki/Semi-Italian_Opening). > > I. A. Horowitz called the defence "solid", also writing: "It does not seem quite sufficient for equality." > > > The Wi...
There is no way to "crush" that move. You just play! Develop your pieces, get space in the center and obtain a small advantage. Your opponent won't be losing a piece or something like that. I assume 3...d6 may have some ideas related to a pin on g4 (for instance, 4.d4 Bg4) A c3 pawn advance can be useful to prevent so...
24,517
As title above, how to play vs. ``` [fen ""] 1.e4 e5 2.Nf3 Nc6 3.Bc4 d6 ``` I see that this move (3...d6) is generally considered inferior in books, or not even mentioned in books about 3.Bc4, but I cannot see a clear way to obtain advantage.
2019/05/18
[ "https://chess.stackexchange.com/questions/24517", "https://chess.stackexchange.com", "https://chess.stackexchange.com/users/8291/" ]
1.e4 e5 2.Nf3 Nc6 3.Bc4 d6: 365chess.com database shows: ``` MOVE | games | year | White + Draw + Black -------+-------+------+--------+--------+------- 4. d4 | 491 | 2018 | 50.3 % | 24.4 % | 25.3 % 4. c3 | 359 | 2018 | 53.5 % | 20.6 % | 25.9 % 4. d3 | 357 | 2018 | 45.4 % | 22.7 % | 31.9 % 4. h3 | 323...
There is no way to "crush" that move. You just play! Develop your pieces, get space in the center and obtain a small advantage. Your opponent won't be losing a piece or something like that. I assume 3...d6 may have some ideas related to a pin on g4 (for instance, 4.d4 Bg4) A c3 pawn advance can be useful to prevent so...
72,902,209
how to create a regex that replaces a space with an underscore and adds spaces between semicolons? Replacing a space with a underscore in the entire text can be solved: ``` data.replace(/ /g, "_"); ``` But how to solve the situation with semicolons at the same time? The point is that I have a text file that separat...
2022/07/07
[ "https://Stackoverflow.com/questions/72902209", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12648892/" ]
You can call `.replace` twice: ```js const data = "red;;I WW2;123;;;error;more;;blue;;;;123;I love you"; var repl = data.replace(/ +/g, "_").replace(/;(?=;)/g, "$& "); console.log(repl); ``` But make sure to replace spaces with `_` before inserting spaces between `;`s. * `.replace(/ +/g, "_")`: Replace 1+ spaces wi...
If you want to do it with one regex, it can be done with a callback argument, but this will also cost execution time. Like I wrote in comments, it may turn out to be better to stick with 2 `replace` calls. Just see how it performs in your environment, and on your data. Here is how it would work with callback: ```js c...
72,902,209
how to create a regex that replaces a space with an underscore and adds spaces between semicolons? Replacing a space with a underscore in the entire text can be solved: ``` data.replace(/ /g, "_"); ``` But how to solve the situation with semicolons at the same time? The point is that I have a text file that separat...
2022/07/07
[ "https://Stackoverflow.com/questions/72902209", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12648892/" ]
You can call `.replace` twice: ```js const data = "red;;I WW2;123;;;error;more;;blue;;;;123;I love you"; var repl = data.replace(/ +/g, "_").replace(/;(?=;)/g, "$& "); console.log(repl); ``` But make sure to replace spaces with `_` before inserting spaces between `;`s. * `.replace(/ +/g, "_")`: Replace 1+ spaces wi...
this will help you to get your desire output. 1. Positive Lookbehind (?<=;) 2. Positive Lookahead (?=;) and we replace it with `" "` `space`. ```js const data = "red;;I WW2;123;;;error;more;;blue;;;;123;I love you"; const replaceData = data.replace(/(?<=;)(?=;)/g, " "); console.log(replaceData) ```
26,339
Every `Account` has its owner who is `Person` The bank has list of owners. I am not sure if my destructors are right and `delete bank` will delete all elements of `list<Account*>* v` nad the list itself. Please help. ``` #include <iostream> #include <vector> #include <list> using namespace std; class Person{ public: ...
2013/05/19
[ "https://codereview.stackexchange.com/questions/26339", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/25235/" ]
General Comment on Style ------------------------ This is probably not what you want. ``` Bank* bank = new Bank(); Person* thomas = new Person("thomas", 34); ``` You actually want: ``` Bank bank; Person thomas("thomas", 34); ``` This creates automatic variables. That are properly destroyed automatically at the...
Deleting the vector will only delete the pointers in the vector, not the things to which they point. You need to iterate though the vector deleting the accounts before deleting the vector.
27,070,425
I have been working on this form and can't get past the CalculateTotal. I am completely lost on how to get this to add up and display in the box. Can anyone help? Here is my jsfiddle <http://jsfiddle.net/clbacon70/x6kjqbop/1/> ```js var gc_fSandwichPrice = 5.99; // Price for each sandwich var gc_fExtrasPrice = 1.50...
2014/11/21
[ "https://Stackoverflow.com/questions/27070425", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3381376/" ]
You have a typo in your javascript. You are attempting to fetch an html element with id `textTotal`, when the field you're interesting in is actually given the id `txtTotal`. Fix that typo and it will work.
You have to add brackets after 'Init'. ``` window.addEventListener('load', Init()); ``` And also there was a typo in the end of CalculateTotal function. Here is working example: <http://jsfiddle.net/x6kjqbop/3/>
27,070,425
I have been working on this form and can't get past the CalculateTotal. I am completely lost on how to get this to add up and display in the box. Can anyone help? Here is my jsfiddle <http://jsfiddle.net/clbacon70/x6kjqbop/1/> ```js var gc_fSandwichPrice = 5.99; // Price for each sandwich var gc_fExtrasPrice = 1.50...
2014/11/21
[ "https://Stackoverflow.com/questions/27070425", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3381376/" ]
``` var textTotal = document.getElementById('textTotal'); ``` Your selector is wrong. The element id of your textbox is `txtTotal` so the following should work: ``` var textTotal = document.getElementById('txtTotal'); ```
You have to add brackets after 'Init'. ``` window.addEventListener('load', Init()); ``` And also there was a typo in the end of CalculateTotal function. Here is working example: <http://jsfiddle.net/x6kjqbop/3/>
27,070,425
I have been working on this form and can't get past the CalculateTotal. I am completely lost on how to get this to add up and display in the box. Can anyone help? Here is my jsfiddle <http://jsfiddle.net/clbacon70/x6kjqbop/1/> ```js var gc_fSandwichPrice = 5.99; // Price for each sandwich var gc_fExtrasPrice = 1.50...
2014/11/21
[ "https://Stackoverflow.com/questions/27070425", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3381376/" ]
Here's a fixed copy of your jsFiddle: <http://jsfiddle.net/dcseekcw/> What I fixed: * You were passing in `$` along with values you were trying to add as floats. Removed them from your title values and only put it back in after the total is calculated. * Put in parseFloat so values could be added together instead of ...
You have to add brackets after 'Init'. ``` window.addEventListener('load', Init()); ``` And also there was a typo in the end of CalculateTotal function. Here is working example: <http://jsfiddle.net/x6kjqbop/3/>
5,813,823
I am working for Translate animation of two images overlapping each other and both Images should translate from top to middle of the screen. plesee share some sample programmes for this Help is always appreciated, ....Thanks!
2011/04/28
[ "https://Stackoverflow.com/questions/5813823", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
anim.xml ``` <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"> <translate android:fromYDelta="0" android:toYDelta="50%p" android:duration="1000"/> </set> ``` in java file.. ``` Animation anim = AnimationUtils.loadAnimation(activity, R.anim.anim); anim.setInterpo...
To animate from **Top to middle** of screen it should be something like this **anmation.xml** ``` <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"> <translate android:fromYDelta="-50%p" android:toYDelta="0%p" android:duration="2000" /> </set>...
40,803,051
When i was run patch install command by CLI i see this below error. Please suggest me where i am wrong. I have install below version Patchs only here i am facing this problem. ``` sh PATCH_SUPEE-8788_CE_1.9.1.0_v2-2016-10-14-09-38-31.sh Checking if patch can be applied/reverted successfully... ERROR: Patch can't be ap...
2016/11/25
[ "https://Stackoverflow.com/questions/40803051", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2185477/" ]
These error you can see when you run the command. It means the file is conflicted with patches. You can replace with your version and again run your command. or Simply you can go through- <https://magentary.com/kb/install-supee-8788-without-ssh/> download file and implement to your magento in mage report 8788 not det...
**First read carefully after that apply following steps.** I got the solution if you have changed in core files then this error will come. here have very easy solution download any upgrated version of magento and replace your current core files with upgrated files, after that excute the frontend URL it will automatica...
7,588
hi, i was asked to do sound design / processing for a live performance-art act. specifically, i need to be able to pick up live sounds from several locations across the stage, mix and process them simultaneously. one challenging scenario is this: the performer/dancer will be crawling on the surface of some sort of rou...
2011/04/28
[ "https://sound.stackexchange.com/questions/7588", "https://sound.stackexchange.com", "https://sound.stackexchange.com/users/596/" ]
The only thing I'd put in a gravel pit is an SM-57 or 58. Those things are crazy durable. anything less robust will be seriously damaged. Sound quality is kind of crap though. My next thought is that you could rent 4 wireless mic kits and set them around the edge of the pool (or just two on opposite sides from each o...
for gravels, i would opt for contact mics / piezo strips. for breathings.. well, if you can't attach anything to the performer's body, you can only try with a shotgun mic placed on top of it (if he will stay in the same place for the whole performance).
7,588
hi, i was asked to do sound design / processing for a live performance-art act. specifically, i need to be able to pick up live sounds from several locations across the stage, mix and process them simultaneously. one challenging scenario is this: the performer/dancer will be crawling on the surface of some sort of rou...
2011/04/28
[ "https://sound.stackexchange.com/questions/7588", "https://sound.stackexchange.com", "https://sound.stackexchange.com/users/596/" ]
for gravels, i would opt for contact mics / piezo strips. for breathings.. well, if you can't attach anything to the performer's body, you can only try with a shotgun mic placed on top of it (if he will stay in the same place for the whole performance).
It might be worth discussing a wireless with the performer otherwise you are going to have cables everywhere. If they are really anti-wireless then you could rent a parabolic dish and connect it to a wireless transmitter and follow the artist round with that. When I have had to do unusual events like this I mic everyt...
7,588
hi, i was asked to do sound design / processing for a live performance-art act. specifically, i need to be able to pick up live sounds from several locations across the stage, mix and process them simultaneously. one challenging scenario is this: the performer/dancer will be crawling on the surface of some sort of rou...
2011/04/28
[ "https://sound.stackexchange.com/questions/7588", "https://sound.stackexchange.com", "https://sound.stackexchange.com/users/596/" ]
The only thing I'd put in a gravel pit is an SM-57 or 58. Those things are crazy durable. anything less robust will be seriously damaged. Sound quality is kind of crap though. My next thought is that you could rent 4 wireless mic kits and set them around the edge of the pool (or just two on opposite sides from each o...
It might be worth discussing a wireless with the performer otherwise you are going to have cables everywhere. If they are really anti-wireless then you could rent a parabolic dish and connect it to a wireless transmitter and follow the artist round with that. When I have had to do unusual events like this I mic everyt...
224,503
I bought a cheap Blackview BV5900 running on Android 9.0 (I assume a custom ROM) as I needed something rugged and with long battery life for testing purposes. I'm struggling to find any answers as to why apps won't auto start when they are supposed to. The app in question primarily is Grandstream Wave - Video which is ...
2020/04/29
[ "https://android.stackexchange.com/questions/224503", "https://android.stackexchange.com", "https://android.stackexchange.com/users/321904/" ]
I solved it by swiping down the lock icon on my android 10 device. Hope this helps
Not sure if you're still having this issue, but recently suffered the same (different app) and managed to resolve it completely by accident: Go to the recent apps menu (as shown in image) and simple do a (quick) swipe to the right on the app you want to lock/unlock, starting point doesn't seem to matter much but make ...
233,673
While I was investigating a problem I had with lexical closures in Javascript code, I came along this problem in Python: ``` flist = [] for i in xrange(3): def func(x): return x * i flist.append(func) for f in flist: print f(2) ``` Note that this example mindfully avoids `lambda`. It prints "4 4 4", wh...
2008/10/24
[ "https://Stackoverflow.com/questions/233673", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8206/" ]
What is happening is that the variable i is captured, and the functions are returning the value it is bound to at the time it is called. In functional languages this kind of situation never arises, as i wouldn't be rebound. However with python, and also as you've seen with lisp, this is no longer true. The difference ...
I'm still not entirely convinced why in some languages this works one way, and in some another way. In Common Lisp it's like Python: ``` (defvar *flist* '()) (dotimes (i 3 t) (setf *flist* (cons (lambda (x) (* x i)) *flist*))) (dolist (f *flist*) (format t "~a~%" (funcall f 2))) ``` Prints "6 6 6" (note...
233,673
While I was investigating a problem I had with lexical closures in Javascript code, I came along this problem in Python: ``` flist = [] for i in xrange(3): def func(x): return x * i flist.append(func) for f in flist: print f(2) ``` Note that this example mindfully avoids `lambda`. It prints "4 4 4", wh...
2008/10/24
[ "https://Stackoverflow.com/questions/233673", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8206/" ]
What is happening is that the variable i is captured, and the functions are returning the value it is bound to at the time it is called. In functional languages this kind of situation never arises, as i wouldn't be rebound. However with python, and also as you've seen with lisp, this is no longer true. The difference ...
I didn't like how solutions above created `wrappers` in the loop. Note: python 3.xx ``` flist = [] def func(i): return lambda x: x * i for i in range(3): flist.append(func(i)) for f in flist: print f(2) ```
233,673
While I was investigating a problem I had with lexical closures in Javascript code, I came along this problem in Python: ``` flist = [] for i in xrange(3): def func(x): return x * i flist.append(func) for f in flist: print f(2) ``` Note that this example mindfully avoids `lambda`. It prints "4 4 4", wh...
2008/10/24
[ "https://Stackoverflow.com/questions/233673", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8206/" ]
The functions defined in the loop keep accessing the same variable `i` while its value changes. At the end of the loop, all the functions point to the same variable, which is holding the last value in the loop: the effect is what reported in the example. In order to evaluate `i` and use its value, a common pattern is ...
I didn't like how solutions above created `wrappers` in the loop. Note: python 3.xx ``` flist = [] def func(i): return lambda x: x * i for i in range(3): flist.append(func(i)) for f in flist: print f(2) ```
233,673
While I was investigating a problem I had with lexical closures in Javascript code, I came along this problem in Python: ``` flist = [] for i in xrange(3): def func(x): return x * i flist.append(func) for f in flist: print f(2) ``` Note that this example mindfully avoids `lambda`. It prints "4 4 4", wh...
2008/10/24
[ "https://Stackoverflow.com/questions/233673", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8206/" ]
Python is actually behaving as defined. **Three separate functions** are created, but they each have the **closure of the environment they're defined in** - in this case, the global environment (or the outer function's environment if the loop is placed inside another function). This is exactly the problem, though - in ...
look at this: ``` for f in flist: print f.func_closure (<cell at 0x00C980B0: int object at 0x009864B4>,) (<cell at 0x00C980B0: int object at 0x009864B4>,) (<cell at 0x00C980B0: int object at 0x009864B4>,) ``` It means they all point to the same i variable instance, which will have a value of 2 once the loop is ...
233,673
While I was investigating a problem I had with lexical closures in Javascript code, I came along this problem in Python: ``` flist = [] for i in xrange(3): def func(x): return x * i flist.append(func) for f in flist: print f(2) ``` Note that this example mindfully avoids `lambda`. It prints "4 4 4", wh...
2008/10/24
[ "https://Stackoverflow.com/questions/233673", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8206/" ]
What is happening is that the variable i is captured, and the functions are returning the value it is bound to at the time it is called. In functional languages this kind of situation never arises, as i wouldn't be rebound. However with python, and also as you've seen with lisp, this is no longer true. The difference ...
The reasoning behind the behavior has already been explained, and multiple solutions have been posted, but I think this is the most pythonic (remember, everything in Python is an object!): ``` flist = [] for i in xrange(3): def func(x): return x * func.i func.i=i flist.append(func) for f in flist: pr...
233,673
While I was investigating a problem I had with lexical closures in Javascript code, I came along this problem in Python: ``` flist = [] for i in xrange(3): def func(x): return x * i flist.append(func) for f in flist: print f(2) ``` Note that this example mindfully avoids `lambda`. It prints "4 4 4", wh...
2008/10/24
[ "https://Stackoverflow.com/questions/233673", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8206/" ]
The problem is that all of the local functions bind to the same environment and thus to the same `i` variable. The solution (workaround) is to create separate environments (stack frames) for each function (or lambda): ``` t = [ (lambda x: lambda y : x*y)(x) for x in range(5)] >>> t[1](2) 2 >>> t[2](2) 4 ```
I didn't like how solutions above created `wrappers` in the loop. Note: python 3.xx ``` flist = [] def func(i): return lambda x: x * i for i in range(3): flist.append(func(i)) for f in flist: print f(2) ```
233,673
While I was investigating a problem I had with lexical closures in Javascript code, I came along this problem in Python: ``` flist = [] for i in xrange(3): def func(x): return x * i flist.append(func) for f in flist: print f(2) ``` Note that this example mindfully avoids `lambda`. It prints "4 4 4", wh...
2008/10/24
[ "https://Stackoverflow.com/questions/233673", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8206/" ]
Python is actually behaving as defined. **Three separate functions** are created, but they each have the **closure of the environment they're defined in** - in this case, the global environment (or the outer function's environment if the loop is placed inside another function). This is exactly the problem, though - in ...
What is happening is that the variable i is captured, and the functions are returning the value it is bound to at the time it is called. In functional languages this kind of situation never arises, as i wouldn't be rebound. However with python, and also as you've seen with lisp, this is no longer true. The difference ...
233,673
While I was investigating a problem I had with lexical closures in Javascript code, I came along this problem in Python: ``` flist = [] for i in xrange(3): def func(x): return x * i flist.append(func) for f in flist: print f(2) ``` Note that this example mindfully avoids `lambda`. It prints "4 4 4", wh...
2008/10/24
[ "https://Stackoverflow.com/questions/233673", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8206/" ]
Python is actually behaving as defined. **Three separate functions** are created, but they each have the **closure of the environment they're defined in** - in this case, the global environment (or the outer function's environment if the loop is placed inside another function). This is exactly the problem, though - in ...
The variable `i` is a global, whose value is 2 at each time the function `f` is called. I would be inclined to implement the behavior you're after as follows: ``` >>> class f: ... def __init__(self, multiplier): self.multiplier = multiplier ... def __call__(self, multiplicand): return self.multiplier*multiplicand ....
233,673
While I was investigating a problem I had with lexical closures in Javascript code, I came along this problem in Python: ``` flist = [] for i in xrange(3): def func(x): return x * i flist.append(func) for f in flist: print f(2) ``` Note that this example mindfully avoids `lambda`. It prints "4 4 4", wh...
2008/10/24
[ "https://Stackoverflow.com/questions/233673", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8206/" ]
Here's how you do it using the `functools` library (which I'm not sure was available at the time the question was posed). ``` from functools import partial flist = [] def func(i, x): return x * i for i in range(3): flist.append(partial(func, i)) for f in flist: print(f(2)) ``` Outputs 0 2 4, as expected.
What is happening is that the variable i is captured, and the functions are returning the value it is bound to at the time it is called. In functional languages this kind of situation never arises, as i wouldn't be rebound. However with python, and also as you've seen with lisp, this is no longer true. The difference ...
233,673
While I was investigating a problem I had with lexical closures in Javascript code, I came along this problem in Python: ``` flist = [] for i in xrange(3): def func(x): return x * i flist.append(func) for f in flist: print f(2) ``` Note that this example mindfully avoids `lambda`. It prints "4 4 4", wh...
2008/10/24
[ "https://Stackoverflow.com/questions/233673", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8206/" ]
look at this: ``` for f in flist: print f.func_closure (<cell at 0x00C980B0: int object at 0x009864B4>,) (<cell at 0x00C980B0: int object at 0x009864B4>,) (<cell at 0x00C980B0: int object at 0x009864B4>,) ``` It means they all point to the same i variable instance, which will have a value of 2 once the loop is ...
I didn't like how solutions above created `wrappers` in the loop. Note: python 3.xx ``` flist = [] def func(i): return lambda x: x * i for i in range(3): flist.append(func(i)) for f in flist: print f(2) ```
19,916,907
I need to handle a **large** list of objects (in that case, sprites in a game) **in a particular order**, determined by one of their property (in that case, the `zIndex` of the sprite). I acquire the objects one-by-one, in a random order, but not so far from the perfect one. At the moment, I push naively each object I...
2013/11/11
[ "https://Stackoverflow.com/questions/19916907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2057033/" ]
What about using `array.sort()`. The closer you get to the native browser JavaScript the quicker you're going to get. See <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort>
I wouldn't use a `for ... in` loop. From Mozilla: <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in> `Iterates over the enumerable properties of an object, in arbitrary order.` `for ... in` will usually iterate over an array in the order that the array properties were defined, whi...
2,370,273
I have a binary tree class that is created with a root node and nodes can be added to it as needed in the code, however I am having trouble in deleting the nodes because I point to them with TNodePtr and it is an incompatible type with TNode. At the moment I have this recursive method of deleting nodes which should wor...
2010/03/03
[ "https://Stackoverflow.com/questions/2370273", "https://Stackoverflow.com", "https://Stackoverflow.com/users/193785/" ]
``` Destructor TTree.Destroy; procedure FreeSubnodes(Node: TNodePtr); var ThisNode:TNode; begin ThisNode := Node^; if Assigned(ThisNode.Left) then FreeSubnodes(ThisNode.Left); if Assigned(ThisNode.Right) then FreeSubnodes(ThisNo...
to dereference the pointer use Node^
2,370,273
I have a binary tree class that is created with a root node and nodes can be added to it as needed in the code, however I am having trouble in deleting the nodes because I point to them with TNodePtr and it is an incompatible type with TNode. At the moment I have this recursive method of deleting nodes which should wor...
2010/03/03
[ "https://Stackoverflow.com/questions/2370273", "https://Stackoverflow.com", "https://Stackoverflow.com/users/193785/" ]
The error you see is because of a mistake I made in the answer I gave to [your previous question](https://stackoverflow.com/questions/2306696/creating-a-binary-tree-for-a-knockout-tournament). [I wrote `Delete`](https://stackoverflow.com/posts/2309918/revisions) when I should have written `Dispose`. I apologize. Here, ...
to dereference the pointer use Node^
2,370,273
I have a binary tree class that is created with a root node and nodes can be added to it as needed in the code, however I am having trouble in deleting the nodes because I point to them with TNodePtr and it is an incompatible type with TNode. At the moment I have this recursive method of deleting nodes which should wor...
2010/03/03
[ "https://Stackoverflow.com/questions/2370273", "https://Stackoverflow.com", "https://Stackoverflow.com/users/193785/" ]
The error you see is because of a mistake I made in the answer I gave to [your previous question](https://stackoverflow.com/questions/2306696/creating-a-binary-tree-for-a-knockout-tournament). [I wrote `Delete`](https://stackoverflow.com/posts/2309918/revisions) when I should have written `Dispose`. I apologize. Here, ...
``` Destructor TTree.Destroy; procedure FreeSubnodes(Node: TNodePtr); var ThisNode:TNode; begin ThisNode := Node^; if Assigned(ThisNode.Left) then FreeSubnodes(ThisNode.Left); if Assigned(ThisNode.Right) then FreeSubnodes(ThisNo...
2,370,273
I have a binary tree class that is created with a root node and nodes can be added to it as needed in the code, however I am having trouble in deleting the nodes because I point to them with TNodePtr and it is an incompatible type with TNode. At the moment I have this recursive method of deleting nodes which should wor...
2010/03/03
[ "https://Stackoverflow.com/questions/2370273", "https://Stackoverflow.com", "https://Stackoverflow.com/users/193785/" ]
``` Destructor TTree.Destroy; procedure FreeSubnodes(Node: TNodePtr); var ThisNode:TNode; begin ThisNode := Node^; if Assigned(ThisNode.Left) then FreeSubnodes(ThisNode.Left); if Assigned(ThisNode.Right) then FreeSubnodes(ThisNo...
use TComponent instead of Record. Record type(Pointer) is old and unsafe . TComponent is easier and more abstract. your issue similar to <https://stackoverflow.com/a/1032252/528588> .
2,370,273
I have a binary tree class that is created with a root node and nodes can be added to it as needed in the code, however I am having trouble in deleting the nodes because I point to them with TNodePtr and it is an incompatible type with TNode. At the moment I have this recursive method of deleting nodes which should wor...
2010/03/03
[ "https://Stackoverflow.com/questions/2370273", "https://Stackoverflow.com", "https://Stackoverflow.com/users/193785/" ]
The error you see is because of a mistake I made in the answer I gave to [your previous question](https://stackoverflow.com/questions/2306696/creating-a-binary-tree-for-a-knockout-tournament). [I wrote `Delete`](https://stackoverflow.com/posts/2309918/revisions) when I should have written `Dispose`. I apologize. Here, ...
use TComponent instead of Record. Record type(Pointer) is old and unsafe . TComponent is easier and more abstract. your issue similar to <https://stackoverflow.com/a/1032252/528588> .
44,557,759
Here is in Detail. I have a file which contains hidden BOM Characters as Shown Below 2225612|22225200240|STACKOVERFLOW|HELPSDEVELOPERS - LINE 1 **þÿ**2225612|22225200240|KIRK|CAPTAIN - LINE 2 2225612|22225200240|THANKS**þÿ**|INADVANCE - LINE 3 Now I have script where each row gets processed. As Per my assumption firs...
2017/06/15
[ "https://Stackoverflow.com/questions/44557759", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6807825/" ]
I think this regex should work: ``` if line =~ /\xEF\xBB\xBF/ # If line contains BOM character fail "Line contains a BOM char!" end ``` If you have encoding issues, it might help to force both the line and regex to UTF-8, something like this: ``` regexp = Regexp.new("\xEF\xBB\xBF".force_encoding("UTF-8"), Rege...
You can specify encoding with the File.read method. ``` File.read('your_file.txt', encoding: 'bom|utf-8') ``` or ``` File.readlines('your_file.txt', "r:utf-8") ```
12,912,770
How do I remove the white space that are in front and back of & <http://chemist.com:8080/eShop/search_results.jsp?IDNUMBER=BB55-7344> & Source=BuildingBlocks
2012/10/16
[ "https://Stackoverflow.com/questions/12912770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1310156/" ]
``` String newUrl = oldUrl.replaceAll(" ", ""); ``` Hope this helps.
``` if(result.contains(" and "){ resultnew = result.replace(" and ","&amp").toString(); } ``` You don't really need the "if" check, although it is faster (unless result ***always*** contains " and ") as replace() will return the input string if " and " is not found. You also don't need the toString() since r...
12,912,770
How do I remove the white space that are in front and back of & <http://chemist.com:8080/eShop/search_results.jsp?IDNUMBER=BB55-7344> & Source=BuildingBlocks
2012/10/16
[ "https://Stackoverflow.com/questions/12912770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1310156/" ]
Try : ``` urlString = urlString.replaceAll(" ", "%20"); ``` This code replaces all the white space.
``` String newUrl = oldUrl.replaceAll(" ", ""); ``` Hope this helps.
12,912,770
How do I remove the white space that are in front and back of & <http://chemist.com:8080/eShop/search_results.jsp?IDNUMBER=BB55-7344> & Source=BuildingBlocks
2012/10/16
[ "https://Stackoverflow.com/questions/12912770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1310156/" ]
Try: ``` String newURI = oldURI.replaceAll("\\s+", ""); ```
``` if(result.contains(" and "){ resultnew = result.replace(" and ","&amp").toString(); } ``` You don't really need the "if" check, although it is faster (unless result ***always*** contains " and ") as replace() will return the input string if " and " is not found. You also don't need the toString() since r...
12,912,770
How do I remove the white space that are in front and back of & <http://chemist.com:8080/eShop/search_results.jsp?IDNUMBER=BB55-7344> & Source=BuildingBlocks
2012/10/16
[ "https://Stackoverflow.com/questions/12912770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1310156/" ]
Try : ``` urlString = urlString.replaceAll(" ", "%20"); ``` This code replaces all the white space.
Try: ``` String newURI = oldURI.replaceAll("\\s+", ""); ```
12,912,770
How do I remove the white space that are in front and back of & <http://chemist.com:8080/eShop/search_results.jsp?IDNUMBER=BB55-7344> & Source=BuildingBlocks
2012/10/16
[ "https://Stackoverflow.com/questions/12912770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1310156/" ]
Try : ``` urlString = urlString.replaceAll(" ", "%20"); ``` This code replaces all the white space.
``` if(result.contains(" and "){ resultnew = result.replace(" and ","&amp").toString(); } ``` You don't really need the "if" check, although it is faster (unless result ***always*** contains " and ") as replace() will return the input string if " and " is not found. You also don't need the toString() since r...
1,163
How should I describe a guy who moves to a city or urban area, but does not know much about how things work in those cities, and make an ass of themselves? The closest word I came up with is *unsophisticated*, but it is a broad term.
2013/02/07
[ "https://ell.stackexchange.com/questions/1163", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/299/" ]
Interesting question! *Make* and *Let* have subtly different meanings in certain cases, and are not interchangeable at all in others. To look at your examples: > > Don't make me feel alone. > > > *Make* here implies that the person you're talking to is intentionally trying to cause you to feel alone. They are mak...
I would say the two have overlapping meanings, but *let* is more "passive," and *make* is more "active". IMPORTANT NOTE: by "passive" and "active," I am **not** referring to the [passive and active voice](http://owl.english.purdue.edu/owl/resource/539/01/). One definition of *passive* is "accepting or allowing what ha...
37,683
**Wave soldering** I am trying to understand how wave soldering works. Unfortunately the [Wikipedia article](http://en.wikipedia.org/wiki/Wave_soldering) has has left me unsure about the process: 1. Is the entire board with its components quasi-immersed in liquid solder while it passes through the wave? (If not, the ...
2012/08/11
[ "https://electronics.stackexchange.com/questions/37683", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/8534/" ]
The wave only contacts the bottom side of the PCB. Once upon a time, a wave solder machine was used to solder SMT parts on the bottom side of the PCB but this is not used as much anymore in favor of more modern techniques. Here is the rough process for soldering PCB's with SMT parts on both sides, and through hole (T...
I do not know what you have pictured in your mind about solder wave, but it is a relatively simple process. The circuit board is set between 2 conveyor chains. The chains are simple roller chains but have "fingers" about 2 inches long. One conveyor is movable to accept different size circuit boards. They are also inc...
37,683
**Wave soldering** I am trying to understand how wave soldering works. Unfortunately the [Wikipedia article](http://en.wikipedia.org/wiki/Wave_soldering) has has left me unsure about the process: 1. Is the entire board with its components quasi-immersed in liquid solder while it passes through the wave? (If not, the ...
2012/08/11
[ "https://electronics.stackexchange.com/questions/37683", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/8534/" ]
The wave only contacts the bottom side of the PCB. Once upon a time, a wave solder machine was used to solder SMT parts on the bottom side of the PCB but this is not used as much anymore in favor of more modern techniques. Here is the rough process for soldering PCB's with SMT parts on both sides, and through hole (T...
**wave soldering** For wave soldering the PCB passes over a bath of molten solder where the solder is pushed up so that it strikes along the bottom side of the PCB. You'll need a solder resist mask to prevent to have solder over all the copper. Note that also SMDs can be wave soldered, but then the orientation of ...
37,683
**Wave soldering** I am trying to understand how wave soldering works. Unfortunately the [Wikipedia article](http://en.wikipedia.org/wiki/Wave_soldering) has has left me unsure about the process: 1. Is the entire board with its components quasi-immersed in liquid solder while it passes through the wave? (If not, the ...
2012/08/11
[ "https://electronics.stackexchange.com/questions/37683", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/8534/" ]
The wave only contacts the bottom side of the PCB. Once upon a time, a wave solder machine was used to solder SMT parts on the bottom side of the PCB but this is not used as much anymore in favor of more modern techniques. Here is the rough process for soldering PCB's with SMT parts on both sides, and through hole (T...
This is a somewhat archaic method where the entire bottom of the board is drawn along a flowing pool of solder: <https://www.youtube.com/watch?v=inHzaJIE7-4> Newer methods include a small cnc solder fountain that is applied to the individual solder points on the board, rather than a bath that the entire unit runs thro...
37,683
**Wave soldering** I am trying to understand how wave soldering works. Unfortunately the [Wikipedia article](http://en.wikipedia.org/wiki/Wave_soldering) has has left me unsure about the process: 1. Is the entire board with its components quasi-immersed in liquid solder while it passes through the wave? (If not, the ...
2012/08/11
[ "https://electronics.stackexchange.com/questions/37683", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/8534/" ]
I do not know what you have pictured in your mind about solder wave, but it is a relatively simple process. The circuit board is set between 2 conveyor chains. The chains are simple roller chains but have "fingers" about 2 inches long. One conveyor is movable to accept different size circuit boards. They are also inc...
This is a somewhat archaic method where the entire bottom of the board is drawn along a flowing pool of solder: <https://www.youtube.com/watch?v=inHzaJIE7-4> Newer methods include a small cnc solder fountain that is applied to the individual solder points on the board, rather than a bath that the entire unit runs thro...
37,683
**Wave soldering** I am trying to understand how wave soldering works. Unfortunately the [Wikipedia article](http://en.wikipedia.org/wiki/Wave_soldering) has has left me unsure about the process: 1. Is the entire board with its components quasi-immersed in liquid solder while it passes through the wave? (If not, the ...
2012/08/11
[ "https://electronics.stackexchange.com/questions/37683", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/8534/" ]
**wave soldering** For wave soldering the PCB passes over a bath of molten solder where the solder is pushed up so that it strikes along the bottom side of the PCB. You'll need a solder resist mask to prevent to have solder over all the copper. Note that also SMDs can be wave soldered, but then the orientation of ...
This is a somewhat archaic method where the entire bottom of the board is drawn along a flowing pool of solder: <https://www.youtube.com/watch?v=inHzaJIE7-4> Newer methods include a small cnc solder fountain that is applied to the individual solder points on the board, rather than a bath that the entire unit runs thro...
694,723
I just built a PC for my wife; i3-4130 / B85 / 8GB RAM / Radeon 7730 1GB GDDR5 / 120GB Intel 330 SSD / 22" HP IPS Monitor. She's an interior designer and she uses this software, 20-20 Design. She's satisfied with its performance over her Samsung laptop with i5-2430M with integrated graphics (the new desktop renders si...
2013/12/30
[ "https://superuser.com/questions/694723", "https://superuser.com", "https://superuser.com/users/257654/" ]
Just looking at the [System Requirements](http://www.2020technologies.com/home/interior-design/kitchen-bath-and-home-organization/2020-design#&panel1-1), I would say that if you want it faster, I'd go for a CPU upgrade. However, an easy way to see if it's the CPU or GPU holding you back, you could have a peek in the t...
I almost commented on Lawrence's answer, but reconsidered as my thoughts stand as an answer on their own. I've been down this journey a few times via various paths... and I'm still not exactly satisfied with the results. *Now, on to the arms race of "graphics" performance:* **CPU** Start with Lawrence's advice on ...
49,825,329
I want to shuffle non-zero elements of each column in a matrix but keep the zero elements at the same place. Like I have this: ``` A = [10 0 30 40 50 60 11 0 31 41 0 61 0 22 32 42 0 62 13 23 0 43 0 63 0 24 34 44 54 64 15 ...
2018/04/13
[ "https://Stackoverflow.com/questions/49825329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7867604/" ]
This is a solution that works for one column: Making a new vector `C` containing the nonzero entries, shuffling those, and pasting them back into the nonzero entries of `B` should do exactly that. Now you can adjust this to work for matrices by looping over all columns. ```matlab A = [10, 11, 0, 13, 0, 15, 16]; B = A...
I wrote a function for you ``` function a=shuffle(src) [rows, cols] = size(src); a = zeros(rows,cols); for c = 1:cols lastIndex = 1; col = []; for r = 1:rows if(src(r,c) ~= 0) col(lastIndex) = src(r,c); lastIndex = lastIndex + 1; end end indexes = randper...
49,825,329
I want to shuffle non-zero elements of each column in a matrix but keep the zero elements at the same place. Like I have this: ``` A = [10 0 30 40 50 60 11 0 31 41 0 61 0 22 32 42 0 62 13 23 0 43 0 63 0 24 34 44 54 64 15 ...
2018/04/13
[ "https://Stackoverflow.com/questions/49825329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7867604/" ]
Here's an alternative to the explicit loop-over-columns approach: ``` [~, jj, vv] = find(A); s = accumarray(jj, vv, [], @(x){x(randperm(numel(x)))}); B = A; B(B~=0) = cell2mat(s); ```
This is a solution that works for one column: Making a new vector `C` containing the nonzero entries, shuffling those, and pasting them back into the nonzero entries of `B` should do exactly that. Now you can adjust this to work for matrices by looping over all columns. ```matlab A = [10, 11, 0, 13, 0, 15, 16]; B = A...
49,825,329
I want to shuffle non-zero elements of each column in a matrix but keep the zero elements at the same place. Like I have this: ``` A = [10 0 30 40 50 60 11 0 31 41 0 61 0 22 32 42 0 62 13 23 0 43 0 63 0 24 34 44 54 64 15 ...
2018/04/13
[ "https://Stackoverflow.com/questions/49825329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7867604/" ]
Here's an alternative to the explicit loop-over-columns approach: ``` [~, jj, vv] = find(A); s = accumarray(jj, vv, [], @(x){x(randperm(numel(x)))}); B = A; B(B~=0) = cell2mat(s); ```
I wrote a function for you ``` function a=shuffle(src) [rows, cols] = size(src); a = zeros(rows,cols); for c = 1:cols lastIndex = 1; col = []; for r = 1:rows if(src(r,c) ~= 0) col(lastIndex) = src(r,c); lastIndex = lastIndex + 1; end end indexes = randper...
57,830,632
i have a spinner in add new data, I want the selected data to be an image in the item of recyclerview anyone knows how to make like that like this but spinner that is from activity not item recycler view and thats the problem, how to get id spinner in adapter ``` holder.spinner.setOnItemSelectedListener(new AdapterVi...
2019/09/07
[ "https://Stackoverflow.com/questions/57830632", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11863128/" ]
Hi look updated answer ``` selectImageType.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) { if(i!=0) { selectedItem=binding.selectImageType.ge...
use Glide for image set in imageView check below code. add -> 'implementation 'com.github.bumptech.glide:glide:4.9.0' into your app.gradle yes check that item getting your desired values using log and use `if(item.equalsIgnoreCase(important))` to check your if condition. ``` holder.spinner.setOnItemSelectedListen...
15,405,667
The following applies: ``` var rounded = Decimal.Round(7.635m, 2); //rounded: 7.63 ``` This, to me, is wrong and unexpected behavior. I would assume the value of *rounded* to be **7.64**. To achieve this, I can do: ``` var rounded = Decimal.Round(7.635m, 2, MidpointRounding.AwayFromZero); //rounded: 7.64 ``` How...
2013/03/14
[ "https://Stackoverflow.com/questions/15405667", "https://Stackoverflow.com", "https://Stackoverflow.com/users/896348/" ]
> > How can this not be the default behavior of Decimal.Round? Any good > reason for this? > > > If you look at the documentation of [Decimal.Round Method (Decimal)](http://msdn.microsoft.com/en-us/library/k4e2bye2.aspx) > > The **behavior of this method follows IEEE Standard 754, section 4**. > This kind of r...
From [`Math.Round(Decimal, Int32)`](http://msdn.microsoft.com/en-us/library/vstudio/zy06z30k%28v=vs.90%29.aspx) Method > > The behavior of this method follows IEEE Standard 754, section 4. This > kind of rounding is sometimes called rounding to nearest, or banker's > rounding. It minimizes rounding errors that res...
15,405,667
The following applies: ``` var rounded = Decimal.Round(7.635m, 2); //rounded: 7.63 ``` This, to me, is wrong and unexpected behavior. I would assume the value of *rounded* to be **7.64**. To achieve this, I can do: ``` var rounded = Decimal.Round(7.635m, 2, MidpointRounding.AwayFromZero); //rounded: 7.64 ``` How...
2013/03/14
[ "https://Stackoverflow.com/questions/15405667", "https://Stackoverflow.com", "https://Stackoverflow.com/users/896348/" ]
> > How can this not be the default behavior of Decimal.Round? Any good > reason for this? > > > If you look at the documentation of [Decimal.Round Method (Decimal)](http://msdn.microsoft.com/en-us/library/k4e2bye2.aspx) > > The **behavior of this method follows IEEE Standard 754, section 4**. > This kind of r...
The reason is they implemented a method following IEEE Standard 754, section 4. This is called rounding to nearest or sometimes bankers rounding. It's just one of many ways to do rounding and they choose this one. See: <http://en.wikipedia.org/wiki/Bankers_rounding> And for more information: [Why does .NET use banker...
15,405,667
The following applies: ``` var rounded = Decimal.Round(7.635m, 2); //rounded: 7.63 ``` This, to me, is wrong and unexpected behavior. I would assume the value of *rounded* to be **7.64**. To achieve this, I can do: ``` var rounded = Decimal.Round(7.635m, 2, MidpointRounding.AwayFromZero); //rounded: 7.64 ``` How...
2013/03/14
[ "https://Stackoverflow.com/questions/15405667", "https://Stackoverflow.com", "https://Stackoverflow.com/users/896348/" ]
From [`Math.Round(Decimal, Int32)`](http://msdn.microsoft.com/en-us/library/vstudio/zy06z30k%28v=vs.90%29.aspx) Method > > The behavior of this method follows IEEE Standard 754, section 4. This > kind of rounding is sometimes called rounding to nearest, or banker's > rounding. It minimizes rounding errors that res...
The reason is they implemented a method following IEEE Standard 754, section 4. This is called rounding to nearest or sometimes bankers rounding. It's just one of many ways to do rounding and they choose this one. See: <http://en.wikipedia.org/wiki/Bankers_rounding> And for more information: [Why does .NET use banker...
20,378,733
I have building a web site but i have a error code and i couldnt fould a fix it Error > > Parse error: syntax error, unexpected T\_PAAMAYIM\_NEKUDOTAYIM in /home/eneskura/public\_html/administrator/components/com\_tz\_portfolio/helpers/tz\_portfolio.php on line 42 > > > line 42- ``` $class::addEntry(JText::('C...
2013/12/04
[ "https://Stackoverflow.com/questions/20378733", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The [scope resolution operator](http://www.php.net/manual/en/language.oop5.paamayim-nekudotayim.php) (::) can only be used on a class referenced using a variable from PHP 5.3 -- you're using 5.2. You'd have to do `JHtmlSidebar::addEntry` or `JSubMenuHelper::addEntry`; you can't do `$class::addEntry`.
`JText::('COM_TZ_PORTFOLIO_SUBMENU_GROUP_FIELDS')` is not calling a method. It should be: ``` JText::_('COM_TZ_PORTFOLIO_SUBMENU_GROUP_FIELDS') ``` See [`JText`](http://docs.joomla.org/JText/).
20,378,733
I have building a web site but i have a error code and i couldnt fould a fix it Error > > Parse error: syntax error, unexpected T\_PAAMAYIM\_NEKUDOTAYIM in /home/eneskura/public\_html/administrator/components/com\_tz\_portfolio/helpers/tz\_portfolio.php on line 42 > > > line 42- ``` $class::addEntry(JText::('C...
2013/12/04
[ "https://Stackoverflow.com/questions/20378733", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The [scope resolution operator](http://www.php.net/manual/en/language.oop5.paamayim-nekudotayim.php) (::) can only be used on a class referenced using a variable from PHP 5.3 -- you're using 5.2. You'd have to do `JHtmlSidebar::addEntry` or `JSubMenuHelper::addEntry`; you can't do `$class::addEntry`.
`T_PAAMAYIM_NEKUDOTAYIM` refers to the two colons in a row like this `::`. Looking at your code sample: ``` $class::addEntry( JText::('COM_TZ_PORTFOLIO_SUBMENU_GROUP_FIELDS'), 'index.php?option=com_tz_portfolio&view=fieldsgroup', $vName == 'fieldsgroup'); ``` I believe the issue is with `JText::(`. As per [Joomla do...
68,589,876
I have API endpoint /department/getManagersList?department\_name=IT which is returning this ``` { "status": "success", "managersList": [ { "id": "6103d29974535fac35286aff", "name": "axe deo", "role": "Associate React Developer" }, { "id": "6103d1e274535fac35286afe", ...
2021/07/30
[ "https://Stackoverflow.com/questions/68589876", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15556024/" ]
To remove the last item from your array you could use: ``` const arr = [1,2,3]; arr.pop(); // arr -> [1,2] ```
Generally speaking you already answered your question here: > > The purpose is to return the names of all the employees of the department excluding the newly created user so that the new user can choose his/her reporting manager. > > > So that you need find all employees who do not have managers yet. I assume tha...
4,444,870
I recently just started to migrate over a CI application to Amazon's EC2 service. To test I set up a micro instance of ubuntu and a LAMP stack. PHP, MySQL, HTTPD are all working beautifully. The one issue i'm having now is that when I run my application I receive an error saying that my helpers won't load. The helpers ...
2010/12/14
[ "https://Stackoverflow.com/questions/4444870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135881/" ]
I ran into the same issue while trying to install MySQL 5.5.15 in Lion using homebrew and resolved the issue with: ``` mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp ``` and creating a the file ~/my.cnf with the content: ``` [mysqld] b...
1. `brew postinstall mysql` 2. `delete document /opt/homebrew/var/mysql` 3. `brew postinstall mysql`
4,444,870
I recently just started to migrate over a CI application to Amazon's EC2 service. To test I set up a micro instance of ubuntu and a LAMP stack. PHP, MySQL, HTTPD are all working beautifully. The one issue i'm having now is that when I run my application I receive an error saying that my helpers won't load. The helpers ...
2010/12/14
[ "https://Stackoverflow.com/questions/4444870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135881/" ]
I ran into this same problem when installing via homebrew. Make sure you run these commands (which are listed during install but easy to miss): ``` unset TMPDIR mysql_install_db ```
Nothing else really helped, but the following worked: ``` $ ps aux | grep mysql tagir 27260 0.0 1.0 3562356 175120 ?? S 2:52PM 0:00.42 mysqld --skip-grant-tables tagir 42704 0.0 0.0 2434840 784 s000 S+ 3:04PM 0:00.00 grep mysql $ kill 27260 # Careful! This might erase your...
4,444,870
I recently just started to migrate over a CI application to Amazon's EC2 service. To test I set up a micro instance of ubuntu and a LAMP stack. PHP, MySQL, HTTPD are all working beautifully. The one issue i'm having now is that when I run my application I receive an error saying that my helpers won't load. The helpers ...
2010/12/14
[ "https://Stackoverflow.com/questions/4444870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135881/" ]
I ran into this same problem when installing via homebrew. Make sure you run these commands (which are listed during install but easy to miss): ``` unset TMPDIR mysql_install_db ```
I am adding this here because I encountered this problem several times after installing other software. MySQL was working fine for days, then suddenly I get this error. It seems to happen when I install something (eg. elasticsearch or Puma web server). The MySql permissions get reverted again (back to me, and not `_my...
4,444,870
I recently just started to migrate over a CI application to Amazon's EC2 service. To test I set up a micro instance of ubuntu and a LAMP stack. PHP, MySQL, HTTPD are all working beautifully. The one issue i'm having now is that when I run my application I receive an error saying that my helpers won't load. The helpers ...
2010/12/14
[ "https://Stackoverflow.com/questions/4444870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135881/" ]
Nothing else really helped, but the following worked: ``` $ ps aux | grep mysql tagir 27260 0.0 1.0 3562356 175120 ?? S 2:52PM 0:00.42 mysqld --skip-grant-tables tagir 42704 0.0 0.0 2434840 784 s000 S+ 3:04PM 0:00.00 grep mysql $ kill 27260 # Careful! This might erase your...
1. `brew postinstall mysql` 2. `delete document /opt/homebrew/var/mysql` 3. `brew postinstall mysql`
4,444,870
I recently just started to migrate over a CI application to Amazon's EC2 service. To test I set up a micro instance of ubuntu and a LAMP stack. PHP, MySQL, HTTPD are all working beautifully. The one issue i'm having now is that when I run my application I receive an error saying that my helpers won't load. The helpers ...
2010/12/14
[ "https://Stackoverflow.com/questions/4444870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135881/" ]
These following two commands should solve your issue. ``` > unset TMPDIR > mysql_install_db --verbose --user=\`whoami\` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp ```
1. `brew postinstall mysql` 2. `delete document /opt/homebrew/var/mysql` 3. `brew postinstall mysql`
4,444,870
I recently just started to migrate over a CI application to Amazon's EC2 service. To test I set up a micro instance of ubuntu and a LAMP stack. PHP, MySQL, HTTPD are all working beautifully. The one issue i'm having now is that when I run my application I receive an error saying that my helpers won't load. The helpers ...
2010/12/14
[ "https://Stackoverflow.com/questions/4444870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135881/" ]
You probably need to ensure that you're running mysql as the `root` user -- otherwise it won't have permission to write the PID file (thus the error you're receiving). Try this: ``` sudo mysql.server start ``` You'll be prompted for your password. (this assumes that your user account has permissions to "sudo" -- wh...
1. `brew postinstall mysql` 2. `delete document /opt/homebrew/var/mysql` 3. `brew postinstall mysql`
4,444,870
I recently just started to migrate over a CI application to Amazon's EC2 service. To test I set up a micro instance of ubuntu and a LAMP stack. PHP, MySQL, HTTPD are all working beautifully. The one issue i'm having now is that when I run my application I receive an error saying that my helpers won't load. The helpers ...
2010/12/14
[ "https://Stackoverflow.com/questions/4444870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135881/" ]
I ran into this same problem when installing via homebrew. Make sure you run these commands (which are listed during install but easy to miss): ``` unset TMPDIR mysql_install_db ```
It appears that for whatever reason I can't comment below Immendes above, but on 10.8.2 with mySQL 5.6.10, in addition to verifying the db\_install and adding the my.cnf, I also had to chown -R myusername /tmp/mysql.sock. It appears that allowing mySQL to run under the user (as apposed to root or www as I woudl do on...
4,444,870
I recently just started to migrate over a CI application to Amazon's EC2 service. To test I set up a micro instance of ubuntu and a LAMP stack. PHP, MySQL, HTTPD are all working beautifully. The one issue i'm having now is that when I run my application I receive an error saying that my helpers won't load. The helpers ...
2010/12/14
[ "https://Stackoverflow.com/questions/4444870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135881/" ]
I ran into this same problem when installing via homebrew. Make sure you run these commands (which are listed during install but easy to miss): ``` unset TMPDIR mysql_install_db ```
These following two commands should solve your issue. ``` > unset TMPDIR > mysql_install_db --verbose --user=\`whoami\` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp ```
4,444,870
I recently just started to migrate over a CI application to Amazon's EC2 service. To test I set up a micro instance of ubuntu and a LAMP stack. PHP, MySQL, HTTPD are all working beautifully. The one issue i'm having now is that when I run my application I receive an error saying that my helpers won't load. The helpers ...
2010/12/14
[ "https://Stackoverflow.com/questions/4444870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135881/" ]
You probably need to ensure that you're running mysql as the `root` user -- otherwise it won't have permission to write the PID file (thus the error you're receiving). Try this: ``` sudo mysql.server start ``` You'll be prompted for your password. (this assumes that your user account has permissions to "sudo" -- wh...
Nothing else really helped, but the following worked: ``` $ ps aux | grep mysql tagir 27260 0.0 1.0 3562356 175120 ?? S 2:52PM 0:00.42 mysqld --skip-grant-tables tagir 42704 0.0 0.0 2434840 784 s000 S+ 3:04PM 0:00.00 grep mysql $ kill 27260 # Careful! This might erase your...
4,444,870
I recently just started to migrate over a CI application to Amazon's EC2 service. To test I set up a micro instance of ubuntu and a LAMP stack. PHP, MySQL, HTTPD are all working beautifully. The one issue i'm having now is that when I run my application I receive an error saying that my helpers won't load. The helpers ...
2010/12/14
[ "https://Stackoverflow.com/questions/4444870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135881/" ]
I ran into this same problem when installing via homebrew. Make sure you run these commands (which are listed during install but easy to miss): ``` unset TMPDIR mysql_install_db ```
I ran into the same issue while trying to install MySQL 5.5.15 in Lion using homebrew and resolved the issue with: ``` mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp ``` and creating a the file ~/my.cnf with the content: ``` [mysqld] b...
17,654,302
Range slider ``` $("#slider-range").slider({ range: true, min: 0, max: 420, values: [0, 420], slide: slideTime, change: toSpin }); ``` and text fields ``` $('#min').val(ui.values[ 0 ]); $('#max').val(ui.values[ 1 ]); ``` and I would like to call a function when the value of each field changes, like ...
2013/07/15
[ "https://Stackoverflow.com/questions/17654302", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1877124/" ]
Sitecore confirmed that they can reproduce the issue. When setting dynamicCompressionBeforeCache="true", the encoding does not work correctly for some reason. One solution is to remove this setting. After applying dynamicCompressionBeforeCache="false" it works fine.
You should probably enable gzip in your web.config ``` <system.webServer> <httpCompression directory="%SystemDrive%\inetpub\ temp\IIS Temporary Compressed Files"> <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll"/> <dynamicTypes> <add mimeType="text/*" enabled="true"/> <add mimeType="m...
9,119,572
I am using bootstrap-sass, formtastic-bootstrap, rails 3.2, and ruby 1.9.3p0 on a new project. I want create a multi-column form and multi-column media grid for the list of products. Code below. I used two separate methods. The first is using the row < .span for the form and the second is by adding my own multi-column ...
2012/02/02
[ "https://Stackoverflow.com/questions/9119572", "https://Stackoverflow.com", "https://Stackoverflow.com/users/793116/" ]
Do you have a `float:left` on anything in there? I was just playing around with a multi-column thing in Twitter Bootstrap today and noticed that that broke it.
I'm currently working on a helper to do this for rails, im extracting from the following code: ``` - (0..items.size - 1).each do |i| - if i % 3 == 0 \<div class="row"> =render "items/show_small", item: items.at(i) - if i % 3 == 2 || i == items.size - 1 \</div> ``` and ``` .span4.show-small ``` i th...
43,540,159
I am trying to build an executable out of my .py script using Pyinstaller. The problem is that it builds it using Python 2.7 instead of Python 3.5, so my executable won't even run. ``` cali@californiki-pc ~/Desktop $ pyinstaller --onefile Vocabulary.py 25 INFO: PyInstaller: 3.2.1 25 INFO: Python: 2.7.12 26 INFO: Plat...
2017/04/21
[ "https://Stackoverflow.com/questions/43540159", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
To overcome the problem you face install PyInstaller using: > > pip3 install pyinstaller > > > Then take care that you run the right one (there will then be two of them in different locations, one in the path of Python2.7 modules and one in the path of Python3.5 modules) Just installed PyInstaller for Python 3.5...
Just set an option -upx-dir in pyinstaller specifying your path for python 3.5. It can be the virtual environment too. For instance: ``` pyinstaller --upx-dir="$HOME/virtual-envs/<your-virtual-env>/lib/python3.5/site-packages/" <your-script>.py' ```
43,540,159
I am trying to build an executable out of my .py script using Pyinstaller. The problem is that it builds it using Python 2.7 instead of Python 3.5, so my executable won't even run. ``` cali@californiki-pc ~/Desktop $ pyinstaller --onefile Vocabulary.py 25 INFO: PyInstaller: 3.2.1 25 INFO: Python: 2.7.12 26 INFO: Plat...
2017/04/21
[ "https://Stackoverflow.com/questions/43540159", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Try: ``` py -3.5 -m PyInstaller Vocabulary.py --onefile ``` I think it is case sensitive
Just set an option -upx-dir in pyinstaller specifying your path for python 3.5. It can be the virtual environment too. For instance: ``` pyinstaller --upx-dir="$HOME/virtual-envs/<your-virtual-env>/lib/python3.5/site-packages/" <your-script>.py' ```