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
45,988
On Windows I can use Utilu Firefox collection (there also ie collection on his site). How can I use multiple browser versions to see how my website works in different versions of different browsers in OS X? For example I want to install [browsers with biggest market share](https://en.wikipedia.org/wiki/Browser_market...
2012/03/26
[ "https://apple.stackexchange.com/questions/45988", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/14692/" ]
Firefox ------- [Firefoxes](https://github.com/omgmog/install-all-firefox) is a shell scripts that will install all major versions of Firefox on OS X, and set up separate profiles so you can use them simultaneously. Currently it installs: * Firefox 2.0.0.20 * Firefox 3.0.19 * Firefox 3.5.9 * Firefox 3.6.28 * Firefox ...
While not actually on your machine, you can also use a web application like [BrowserShots.org](http://browsershots.org/) to deliver you screenshots of the page rendered in a multitude of browsers or something like [Adobe's BrowserLab](https://browserlab.adobe.com/en-us/index.html#).
38,210,037
I have a console script in a Yii2 advanced installation from which I can successfully use several models under 'common\models\modelName', but when I try to use a model from under 'backend\models\db\AuthAssignment' I get the following error: > > Exception 'yii\base\UnknownClassException' with message 'Unable to find '...
2016/07/05
[ "https://Stackoverflow.com/questions/38210037", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3197616/" ]
Turns out that I needed to produce a duplicate of the specific model under 'frontend\models\db\AuthAssignment' because frontend and backend have similar functionality while running different databases. Called it accordingly and it works: ``` <?php namespace console\controllers; use Yii; use yii\console\Controller; u...
You can not directly extend/use models from backend directory. To use models as per you requirements you need to add those models classes under console/models directory. and then in your console controller use like: ``` use app/models/Classname; ``` Try this link for more details <http://latcoding.com/2015/08/27/r...
47,820,182
I have a query (below) that uses ldap connection to retrieve AD related info. However, the issue is this query provide all of the employees. I am only looking for current employees. I was told to use following information to pull "Active only" employees: > > OU=CompanyName Users,DC=CompanyName,DC=local > > > I tr...
2017/12/14
[ "https://Stackoverflow.com/questions/47820182", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2055916/" ]
To prevent error you have now - just make `sort` parameter non optional (move it to the beginning of parameter list and remove = `null`). If it fails to bind (for example, no sort is specified in query string) - it will have `null` value anyway, so there is no reason to have `= null` default in this case. Now, your so...
I suggest you refactor your API method. Instead of feeding it route parameters, use a DTO like this: ``` public IHttpActionResult GetTrades(GetTradesRequestDTO model) { // method body } ``` This is a best-practice anyway, and model-binding issues are minimized. Also I'm not sure why you're giving default values ...
11,121,193
I found a way to write the `if` statement in another way (I think) while searching in the source code of a website. Instead of: ``` if(a)b; ``` or: ``` a?b:''; ``` I read: ``` !a||b; ``` Is the third way the same as the first two? And if yes, why we would use the third way?
2012/06/20
[ "https://Stackoverflow.com/questions/11121193", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1365010/" ]
The third way is the same as the previous ones. One argument to use it is saving bytes. A strong argument against using it is readability. You'd better focus on readability in writing code, and use a minimizer (such as [Google Closure Compiler](http://closure-compiler.appspot.com)) to save bytes. It can be even shorte...
Welcome to the concept of [short-circuit evaluation](https://developer.mozilla.org/en/JavaScript/Reference/Operators/Logical_Operators). This is well known property of logical operators, employed in different languages. Most often this'll be used as subexpression inside proper `if` or any other flow control statement, ...
11,121,193
I found a way to write the `if` statement in another way (I think) while searching in the source code of a website. Instead of: ``` if(a)b; ``` or: ``` a?b:''; ``` I read: ``` !a||b; ``` Is the third way the same as the first two? And if yes, why we would use the third way?
2012/06/20
[ "https://Stackoverflow.com/questions/11121193", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1365010/" ]
The third way is the same as the previous ones. One argument to use it is saving bytes. A strong argument against using it is readability. You'd better focus on readability in writing code, and use a minimizer (such as [Google Closure Compiler](http://closure-compiler.appspot.com)) to save bytes. It can be even shorte...
The result of the boolean expression sometimes can be evaluated without evaluating all the sub-expressions. If we have `A||B`, and `A` is true there's no need to even evaluate `B`, because the result will be true anyway. This behavior is called "shortcut boolean evaluation" and is defacto standard in most programming l...
11,121,193
I found a way to write the `if` statement in another way (I think) while searching in the source code of a website. Instead of: ``` if(a)b; ``` or: ``` a?b:''; ``` I read: ``` !a||b; ``` Is the third way the same as the first two? And if yes, why we would use the third way?
2012/06/20
[ "https://Stackoverflow.com/questions/11121193", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1365010/" ]
Welcome to the concept of [short-circuit evaluation](https://developer.mozilla.org/en/JavaScript/Reference/Operators/Logical_Operators). This is well known property of logical operators, employed in different languages. Most often this'll be used as subexpression inside proper `if` or any other flow control statement, ...
The result of the boolean expression sometimes can be evaluated without evaluating all the sub-expressions. If we have `A||B`, and `A` is true there's no need to even evaluate `B`, because the result will be true anyway. This behavior is called "shortcut boolean evaluation" and is defacto standard in most programming l...
59,584,189
My problem: Want to display every letter after 1 second, but instead of this I display all the letters immediately. I have tried many ways to do this but still can't. My code: ``` const [parrot, setParrot] = useState({ content: ' ' }); const displayText = () => { let text = 'Parrot'; let freeLetters = [...t...
2020/01/03
[ "https://Stackoverflow.com/questions/59584189", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11449471/" ]
Your timeouts are all set to 1000 milliseconds, you should multiply the timeout by the current index of the loop. What you need to do is increase the setTimeout wait value on each iteration of your loop. See a working example below. ``` const [parrot, setParrot] = useState({ content: ' ' }); const displayText = () =...
You're loop is just firing off an function that says in 1000ms do something. The loop will just continue to iterate and until the condition meets and then in your 1000ms, all of the setTimeouts will trigger almost back to back. You could either use the setInterval or maybe rewrite this to use a recursion loop based on ...
55,454
It's 2016, but for some reason, the Cold War never ended. You've been inspired by your (for some inexplicable reason) favorite movie, Indiana Jones 4, to start a new business: building refrigerators. However, the market is so saturated that in order to distinguish yourself with a nice marketing campaign, you decide to ...
2016/09/15
[ "https://worldbuilding.stackexchange.com/questions/55454", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/26768/" ]
While the it's-not-possible answers are correct for the question you intended to ask lets try another approach: For colder climates it's technically possible (but economic insanity) to build a refrigerator that contains no cooling element at all. Lets make the Green Fridge (tm): No ozone-destroying Freon! No toxic am...
Add an asterisk to "Protect": > > Protect\* one person from up to 1.2 megatonnes of a TNT nuke at a minimum distance of 2 km from the explosion. > > > \* Protect: the explosion will not kill you and the nuke will leave no lasting ill effects. Protection may also apply to others near fridge. Simply make a normal ...
55,454
It's 2016, but for some reason, the Cold War never ended. You've been inspired by your (for some inexplicable reason) favorite movie, Indiana Jones 4, to start a new business: building refrigerators. However, the market is so saturated that in order to distinguish yourself with a nice marketing campaign, you decide to ...
2016/09/15
[ "https://worldbuilding.stackexchange.com/questions/55454", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/26768/" ]
**It's Not Possible** You have asked for a **Science-Based** answer, and it's just not going to happen. Despite what Indiana Jones says, it's impossible to build a nuke-proof fridge. Even if the fridge itself is basically OK, the concussive force it went under would jar it severely (and rattle anyone inside of it to d...
Well, I'm going to say, my refrigerator is a SpaceX dragon launch abort system with a baggy of ice inside. The total volume of the capsule is 25 cubic meters, which is the equivalent of a 2.9m x 2.9m x 3.0m cube, or a refrigerated room, as seen in grocery stores. According to the spaceX website, the capsule can move ...
55,454
It's 2016, but for some reason, the Cold War never ended. You've been inspired by your (for some inexplicable reason) favorite movie, Indiana Jones 4, to start a new business: building refrigerators. However, the market is so saturated that in order to distinguish yourself with a nice marketing campaign, you decide to ...
2016/09/15
[ "https://worldbuilding.stackexchange.com/questions/55454", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/26768/" ]
GrinningX has quite a good answer but I would like to amend it slightly. The stats quoted appear to refer to a ground burst. Ground bursts are not thought to be targeted against cities because air bursts are more damaging to them. Ground bursts are expected to be used against hardened targets like ICBM silos. However...
The it's not possible answers are correct if you interpret the requirements strictly in light of the scene from the movie, where the fridge is directly exposed to the nuclear explosion. Having said that, your company could legitimately market a fridge that would be of benefit, within certain limitations. 1. The fridge...
55,454
It's 2016, but for some reason, the Cold War never ended. You've been inspired by your (for some inexplicable reason) favorite movie, Indiana Jones 4, to start a new business: building refrigerators. However, the market is so saturated that in order to distinguish yourself with a nice marketing campaign, you decide to ...
2016/09/15
[ "https://worldbuilding.stackexchange.com/questions/55454", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/26768/" ]
It's George Lucas's marketing manager here. We are now working on a new Indiana Jones movie: Indiana Jones and the Blastproof Fridge, where Indiana Jones goes for a quest to find the sacred Superfridge, made by God himself. We're now developing a new blastproof fridge, which will not only be used in our movie, but also...
While the it's-not-possible answers are correct for the question you intended to ask lets try another approach: For colder climates it's technically possible (but economic insanity) to build a refrigerator that contains no cooling element at all. Lets make the Green Fridge (tm): No ozone-destroying Freon! No toxic am...
55,454
It's 2016, but for some reason, the Cold War never ended. You've been inspired by your (for some inexplicable reason) favorite movie, Indiana Jones 4, to start a new business: building refrigerators. However, the market is so saturated that in order to distinguish yourself with a nice marketing campaign, you decide to ...
2016/09/15
[ "https://worldbuilding.stackexchange.com/questions/55454", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/26768/" ]
GrinningX has quite a good answer but I would like to amend it slightly. The stats quoted appear to refer to a ground burst. Ground bursts are not thought to be targeted against cities because air bursts are more damaging to them. Ground bursts are expected to be used against hardened targets like ICBM silos. However...
Your customers will need to: Put your fridge underground in the cellar; Reinforce the cellar walls to withstand the shockwave of the blast and the collapse of the house on top. Add shielding in 2 layers, preferably tungsten, 0.5" each layer, since lead is just messy, on the outer side of the body, and on the insid...
55,454
It's 2016, but for some reason, the Cold War never ended. You've been inspired by your (for some inexplicable reason) favorite movie, Indiana Jones 4, to start a new business: building refrigerators. However, the market is so saturated that in order to distinguish yourself with a nice marketing campaign, you decide to ...
2016/09/15
[ "https://worldbuilding.stackexchange.com/questions/55454", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/26768/" ]
Your customers will need to: Put your fridge underground in the cellar; Reinforce the cellar walls to withstand the shockwave of the blast and the collapse of the house on top. Add shielding in 2 layers, preferably tungsten, 0.5" each layer, since lead is just messy, on the outer side of the body, and on the insid...
Add an asterisk to "Protect": > > Protect\* one person from up to 1.2 megatonnes of a TNT nuke at a minimum distance of 2 km from the explosion. > > > \* Protect: the explosion will not kill you and the nuke will leave no lasting ill effects. Protection may also apply to others near fridge. Simply make a normal ...
55,454
It's 2016, but for some reason, the Cold War never ended. You've been inspired by your (for some inexplicable reason) favorite movie, Indiana Jones 4, to start a new business: building refrigerators. However, the market is so saturated that in order to distinguish yourself with a nice marketing campaign, you decide to ...
2016/09/15
[ "https://worldbuilding.stackexchange.com/questions/55454", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/26768/" ]
Well, I'm going to say, my refrigerator is a SpaceX dragon launch abort system with a baggy of ice inside. The total volume of the capsule is 25 cubic meters, which is the equivalent of a 2.9m x 2.9m x 3.0m cube, or a refrigerated room, as seen in grocery stores. According to the spaceX website, the capsule can move ...
GrinningX has quite a good answer but I would like to amend it slightly. The stats quoted appear to refer to a ground burst. Ground bursts are not thought to be targeted against cities because air bursts are more damaging to them. Ground bursts are expected to be used against hardened targets like ICBM silos. However...
55,454
It's 2016, but for some reason, the Cold War never ended. You've been inspired by your (for some inexplicable reason) favorite movie, Indiana Jones 4, to start a new business: building refrigerators. However, the market is so saturated that in order to distinguish yourself with a nice marketing campaign, you decide to ...
2016/09/15
[ "https://worldbuilding.stackexchange.com/questions/55454", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/26768/" ]
Well, I'm going to say, my refrigerator is a SpaceX dragon launch abort system with a baggy of ice inside. The total volume of the capsule is 25 cubic meters, which is the equivalent of a 2.9m x 2.9m x 3.0m cube, or a refrigerated room, as seen in grocery stores. According to the spaceX website, the capsule can move ...
While the it's-not-possible answers are correct for the question you intended to ask lets try another approach: For colder climates it's technically possible (but economic insanity) to build a refrigerator that contains no cooling element at all. Lets make the Green Fridge (tm): No ozone-destroying Freon! No toxic am...
55,454
It's 2016, but for some reason, the Cold War never ended. You've been inspired by your (for some inexplicable reason) favorite movie, Indiana Jones 4, to start a new business: building refrigerators. However, the market is so saturated that in order to distinguish yourself with a nice marketing campaign, you decide to ...
2016/09/15
[ "https://worldbuilding.stackexchange.com/questions/55454", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/26768/" ]
It's George Lucas's marketing manager here. We are now working on a new Indiana Jones movie: Indiana Jones and the Blastproof Fridge, where Indiana Jones goes for a quest to find the sacred Superfridge, made by God himself. We're now developing a new blastproof fridge, which will not only be used in our movie, but also...
Your customers will need to: Put your fridge underground in the cellar; Reinforce the cellar walls to withstand the shockwave of the blast and the collapse of the house on top. Add shielding in 2 layers, preferably tungsten, 0.5" each layer, since lead is just messy, on the outer side of the body, and on the insid...
55,454
It's 2016, but for some reason, the Cold War never ended. You've been inspired by your (for some inexplicable reason) favorite movie, Indiana Jones 4, to start a new business: building refrigerators. However, the market is so saturated that in order to distinguish yourself with a nice marketing campaign, you decide to ...
2016/09/15
[ "https://worldbuilding.stackexchange.com/questions/55454", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/26768/" ]
GrinningX has quite a good answer but I would like to amend it slightly. The stats quoted appear to refer to a ground burst. Ground bursts are not thought to be targeted against cities because air bursts are more damaging to them. Ground bursts are expected to be used against hardened targets like ICBM silos. However...
While the it's-not-possible answers are correct for the question you intended to ask lets try another approach: For colder climates it's technically possible (but economic insanity) to build a refrigerator that contains no cooling element at all. Lets make the Green Fridge (tm): No ozone-destroying Freon! No toxic am...
206,671
**EDIT** After a good amount of thinking and self-reflection on the topic, I realised that most of the issues I raised in this question was coming only from a personal, rather than a professional perspective. Hence the moderators put this question on hold because of the highly personal, subjective nature of the proble...
2013/07/31
[ "https://softwareengineering.stackexchange.com/questions/206671", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/30439/" ]
**No, not typical**, why are you solving their problems for free? (4 hours) 1 hour is typical for a programming test. In the past our programming test was 4 questions. First 3 questions took 1/2 hour, last one 1/2 hour. We also gave the test to existing hires in house to make sure we were in the expected timeframe and...
I find coding tests in interview are a load of tosh anyway. No-one codes anything but the simplest routine under pressure without the usual environment and tools, so the results you get are dubious at best. What I have found to be really good tests of a programmer's ability is to give him some project code and ask him...
206,671
**EDIT** After a good amount of thinking and self-reflection on the topic, I realised that most of the issues I raised in this question was coming only from a personal, rather than a professional perspective. Hence the moderators put this question on hold because of the highly personal, subjective nature of the proble...
2013/07/31
[ "https://softwareengineering.stackexchange.com/questions/206671", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/30439/" ]
Let me take the company's side for a moment, since the other answers haven't so far. It would be nearly impossible to build a usable code base out of a conglomeration of 4-hour coding test submissions from people whose qualifications are completely unknown. Creating a detailed enough specification, vetting the response...
**No, not typical**, why are you solving their problems for free? (4 hours) 1 hour is typical for a programming test. In the past our programming test was 4 questions. First 3 questions took 1/2 hour, last one 1/2 hour. We also gave the test to existing hires in house to make sure we were in the expected timeframe and...
206,671
**EDIT** After a good amount of thinking and self-reflection on the topic, I realised that most of the issues I raised in this question was coming only from a personal, rather than a professional perspective. Hence the moderators put this question on hold because of the highly personal, subjective nature of the proble...
2013/07/31
[ "https://softwareengineering.stackexchange.com/questions/206671", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/30439/" ]
**No, not typical**, why are you solving their problems for free? (4 hours) 1 hour is typical for a programming test. In the past our programming test was 4 questions. First 3 questions took 1/2 hour, last one 1/2 hour. We also gave the test to existing hires in house to make sure we were in the expected timeframe and...
I took a 6 hour coding test at one point. When I took this test I had fairly high confidence I would be hired - while it came true, I wasn't all that satisfied with the follow-on. Obviously having lots of employers each asking for 4 hours is excessive. What the person was looking for in the test I took was my coding s...
206,671
**EDIT** After a good amount of thinking and self-reflection on the topic, I realised that most of the issues I raised in this question was coming only from a personal, rather than a professional perspective. Hence the moderators put this question on hold because of the highly personal, subjective nature of the proble...
2013/07/31
[ "https://softwareengineering.stackexchange.com/questions/206671", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/30439/" ]
**No, not typical**, why are you solving their problems for free? (4 hours) 1 hour is typical for a programming test. In the past our programming test was 4 questions. First 3 questions took 1/2 hour, last one 1/2 hour. We also gave the test to existing hires in house to make sure we were in the expected timeframe and...
You may not have 4 hours, but somebody more interested in their company certainly will. I was essentially hired based on a similar task that a company asked me to do beforehand on the task alone. Apparently, writing clean and understandable code, thorough test cases and understandable and coherent design documentation ...
206,671
**EDIT** After a good amount of thinking and self-reflection on the topic, I realised that most of the issues I raised in this question was coming only from a personal, rather than a professional perspective. Hence the moderators put this question on hold because of the highly personal, subjective nature of the proble...
2013/07/31
[ "https://softwareengineering.stackexchange.com/questions/206671", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/30439/" ]
Let me take the company's side for a moment, since the other answers haven't so far. It would be nearly impossible to build a usable code base out of a conglomeration of 4-hour coding test submissions from people whose qualifications are completely unknown. Creating a detailed enough specification, vetting the response...
I find coding tests in interview are a load of tosh anyway. No-one codes anything but the simplest routine under pressure without the usual environment and tools, so the results you get are dubious at best. What I have found to be really good tests of a programmer's ability is to give him some project code and ask him...
206,671
**EDIT** After a good amount of thinking and self-reflection on the topic, I realised that most of the issues I raised in this question was coming only from a personal, rather than a professional perspective. Hence the moderators put this question on hold because of the highly personal, subjective nature of the proble...
2013/07/31
[ "https://softwareengineering.stackexchange.com/questions/206671", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/30439/" ]
I find coding tests in interview are a load of tosh anyway. No-one codes anything but the simplest routine under pressure without the usual environment and tools, so the results you get are dubious at best. What I have found to be really good tests of a programmer's ability is to give him some project code and ask him...
I took a 6 hour coding test at one point. When I took this test I had fairly high confidence I would be hired - while it came true, I wasn't all that satisfied with the follow-on. Obviously having lots of employers each asking for 4 hours is excessive. What the person was looking for in the test I took was my coding s...
206,671
**EDIT** After a good amount of thinking and self-reflection on the topic, I realised that most of the issues I raised in this question was coming only from a personal, rather than a professional perspective. Hence the moderators put this question on hold because of the highly personal, subjective nature of the proble...
2013/07/31
[ "https://softwareengineering.stackexchange.com/questions/206671", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/30439/" ]
I find coding tests in interview are a load of tosh anyway. No-one codes anything but the simplest routine under pressure without the usual environment and tools, so the results you get are dubious at best. What I have found to be really good tests of a programmer's ability is to give him some project code and ask him...
You may not have 4 hours, but somebody more interested in their company certainly will. I was essentially hired based on a similar task that a company asked me to do beforehand on the task alone. Apparently, writing clean and understandable code, thorough test cases and understandable and coherent design documentation ...
206,671
**EDIT** After a good amount of thinking and self-reflection on the topic, I realised that most of the issues I raised in this question was coming only from a personal, rather than a professional perspective. Hence the moderators put this question on hold because of the highly personal, subjective nature of the proble...
2013/07/31
[ "https://softwareengineering.stackexchange.com/questions/206671", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/30439/" ]
Let me take the company's side for a moment, since the other answers haven't so far. It would be nearly impossible to build a usable code base out of a conglomeration of 4-hour coding test submissions from people whose qualifications are completely unknown. Creating a detailed enough specification, vetting the response...
I took a 6 hour coding test at one point. When I took this test I had fairly high confidence I would be hired - while it came true, I wasn't all that satisfied with the follow-on. Obviously having lots of employers each asking for 4 hours is excessive. What the person was looking for in the test I took was my coding s...
206,671
**EDIT** After a good amount of thinking and self-reflection on the topic, I realised that most of the issues I raised in this question was coming only from a personal, rather than a professional perspective. Hence the moderators put this question on hold because of the highly personal, subjective nature of the proble...
2013/07/31
[ "https://softwareengineering.stackexchange.com/questions/206671", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/30439/" ]
Let me take the company's side for a moment, since the other answers haven't so far. It would be nearly impossible to build a usable code base out of a conglomeration of 4-hour coding test submissions from people whose qualifications are completely unknown. Creating a detailed enough specification, vetting the response...
You may not have 4 hours, but somebody more interested in their company certainly will. I was essentially hired based on a similar task that a company asked me to do beforehand on the task alone. Apparently, writing clean and understandable code, thorough test cases and understandable and coherent design documentation ...
206,671
**EDIT** After a good amount of thinking and self-reflection on the topic, I realised that most of the issues I raised in this question was coming only from a personal, rather than a professional perspective. Hence the moderators put this question on hold because of the highly personal, subjective nature of the proble...
2013/07/31
[ "https://softwareengineering.stackexchange.com/questions/206671", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/30439/" ]
You may not have 4 hours, but somebody more interested in their company certainly will. I was essentially hired based on a similar task that a company asked me to do beforehand on the task alone. Apparently, writing clean and understandable code, thorough test cases and understandable and coherent design documentation ...
I took a 6 hour coding test at one point. When I took this test I had fairly high confidence I would be hired - while it came true, I wasn't all that satisfied with the follow-on. Obviously having lots of employers each asking for 4 hours is excessive. What the person was looking for in the test I took was my coding s...
10,739
I'm currently working on a novel, in which one of the POV characters is a slave. He was born to a slave (so he was born a slave) of a rich merchant family and was treated well most of his life. One day he travels with his master to a foreign country where slavery had been abolished. The interaction with the foreign "fr...
2014/04/16
[ "https://writers.stackexchange.com/questions/10739", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/8048/" ]
If you're looking for first-hand accounts, I'd recommend [Ten Years a Slave](http://www.amazon.co.uk/gp/product/1499102534/ref=as_li_ss_il?ie=UTF8&camp=1634&creative=19450&creativeASIN=1499102534&linkCode=as2&tag=nonshewro0a-21). It's an autobiographical account of a free black man who was forced into slavery, and it's...
Although not a slave in the sense you're describing, I would recommend reading Nelson Mandela's first volume of his auto biography, Long Walk To Freedom. What is quite interesting in this book is that he starts off not really seeing the injustice of his situation, or that of his people, primarily because of where he i...
10,739
I'm currently working on a novel, in which one of the POV characters is a slave. He was born to a slave (so he was born a slave) of a rich merchant family and was treated well most of his life. One day he travels with his master to a foreign country where slavery had been abolished. The interaction with the foreign "fr...
2014/04/16
[ "https://writers.stackexchange.com/questions/10739", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/8048/" ]
Sounds like from the description, you are writing a "slave narrative." This was a popular literary genre in the US around the Civil War. It can either be fiction or non-fiction. One of the most famous examples and my personal suggestion is the *Life of Fredrick Douglas*. He was born a slave and later became a leader in...
Although not a slave in the sense you're describing, I would recommend reading Nelson Mandela's first volume of his auto biography, Long Walk To Freedom. What is quite interesting in this book is that he starts off not really seeing the injustice of his situation, or that of his people, primarily because of where he i...
10,739
I'm currently working on a novel, in which one of the POV characters is a slave. He was born to a slave (so he was born a slave) of a rich merchant family and was treated well most of his life. One day he travels with his master to a foreign country where slavery had been abolished. The interaction with the foreign "fr...
2014/04/16
[ "https://writers.stackexchange.com/questions/10739", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/8048/" ]
Although not a slave in the sense you're describing, I would recommend reading Nelson Mandela's first volume of his auto biography, Long Walk To Freedom. What is quite interesting in this book is that he starts off not really seeing the injustice of his situation, or that of his people, primarily because of where he i...
I recently read a novel with this very theme: ["The Story of Jonas"](https://www.kirkusreviews.com/book-reviews/maurine-f-dahlberg/the-story-of-jonas/). However, while the book was quite well written, I personally found that aspect of it --the slave who doesn't initially question his servitude --to be implausible. A be...
10,739
I'm currently working on a novel, in which one of the POV characters is a slave. He was born to a slave (so he was born a slave) of a rich merchant family and was treated well most of his life. One day he travels with his master to a foreign country where slavery had been abolished. The interaction with the foreign "fr...
2014/04/16
[ "https://writers.stackexchange.com/questions/10739", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/8048/" ]
If you're looking for first-hand accounts, I'd recommend [Ten Years a Slave](http://www.amazon.co.uk/gp/product/1499102534/ref=as_li_ss_il?ie=UTF8&camp=1634&creative=19450&creativeASIN=1499102534&linkCode=as2&tag=nonshewro0a-21). It's an autobiographical account of a free black man who was forced into slavery, and it's...
I recently read a novel with this very theme: ["The Story of Jonas"](https://www.kirkusreviews.com/book-reviews/maurine-f-dahlberg/the-story-of-jonas/). However, while the book was quite well written, I personally found that aspect of it --the slave who doesn't initially question his servitude --to be implausible. A be...
10,739
I'm currently working on a novel, in which one of the POV characters is a slave. He was born to a slave (so he was born a slave) of a rich merchant family and was treated well most of his life. One day he travels with his master to a foreign country where slavery had been abolished. The interaction with the foreign "fr...
2014/04/16
[ "https://writers.stackexchange.com/questions/10739", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/8048/" ]
Sounds like from the description, you are writing a "slave narrative." This was a popular literary genre in the US around the Civil War. It can either be fiction or non-fiction. One of the most famous examples and my personal suggestion is the *Life of Fredrick Douglas*. He was born a slave and later became a leader in...
I recently read a novel with this very theme: ["The Story of Jonas"](https://www.kirkusreviews.com/book-reviews/maurine-f-dahlberg/the-story-of-jonas/). However, while the book was quite well written, I personally found that aspect of it --the slave who doesn't initially question his servitude --to be implausible. A be...
1,331,178
I'm new to DDD and NHibernate. In my current project, I have an entity Person, that contains a value object, let's say Address. Today, this is fine. But maybe one day I will have a requirement that my value object (in this case Address), will have to become an entity. Before trying to model this on a DDD-way, in a mo...
2009/08/25
[ "https://Stackoverflow.com/questions/1331178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/150339/" ]
In the system we are building, we put Value-Objects in separate tables. As far as I know, NHibernate requires that an `id` must added to the object, but we ignore this and treat the object as a Value-Object in the system. As you probably know, a Value-Object is an object that you don't need to track, so we simply overl...
You can Join and make it a Component allowing nHibernate to map it as a proper value object instead of an entity. This way you won't need any virtual properties nor an empty protected ctor (it can be private). ``` Join("PROPOSAL_PRODUCT", product => { product.Schema(IsaSchema.PROPOSALOWN); product.KeyColumn("...
51,710,761
I'm new to mongodb , and i try to insert data in database through my html page using post method. and i use mongoose in server side. here is my code look like. ``` var LoginInfoSchema = new mongoose.Schema ({ _id : String, user: String, password: String }); var user = mongoose.model('user',LoginInf...
2018/08/06
[ "https://Stackoverflow.com/questions/51710761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7611778/" ]
First I would use mongoose.connect() on top of your file and outside from the route handler. Then when you use user.save(), you have already saved data into your DB and thanks to the callback function you can handle potential errors or display some success message. So db.collection.("users").insertOne() is kind of red...
I spent the last two weeks with this error and just got it resolved. I am using kotlin on jetty and the official MongoDB drive. This link in stackoverflow was the closest result I got. In the end, I was missing the to call `documentCodec?.encode(writer, document, encoderContext)` at the end of the "encode" funcion. *...
51,710,761
I'm new to mongodb , and i try to insert data in database through my html page using post method. and i use mongoose in server side. here is my code look like. ``` var LoginInfoSchema = new mongoose.Schema ({ _id : String, user: String, password: String }); var user = mongoose.model('user',LoginInf...
2018/08/06
[ "https://Stackoverflow.com/questions/51710761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7611778/" ]
First I would use mongoose.connect() on top of your file and outside from the route handler. Then when you use user.save(), you have already saved data into your DB and thanks to the callback function you can handle potential errors or display some success message. So db.collection.("users").insertOne() is kind of red...
I too also got stuck in the same error for quite a long. The above answers are perfect to solve the error but I would also suggest you to check the sequence of the parameters(object & callback function) you have sent to the MongoDB connect function. MongoClient.connect(function(parameters)) From controllers to the mod...
51,710,761
I'm new to mongodb , and i try to insert data in database through my html page using post method. and i use mongoose in server side. here is my code look like. ``` var LoginInfoSchema = new mongoose.Schema ({ _id : String, user: String, password: String }); var user = mongoose.model('user',LoginInf...
2018/08/06
[ "https://Stackoverflow.com/questions/51710761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7611778/" ]
First I would use mongoose.connect() on top of your file and outside from the route handler. Then when you use user.save(), you have already saved data into your DB and thanks to the callback function you can handle potential errors or display some success message. So db.collection.("users").insertOne() is kind of red...
The MongoDB error "Write batch sizes must be between 1 and 100000. Got 0 operations." results from trying to apply a write operation to no arguments, e.g. update an array of zero documents: ``` db.runCommand( { update: 'some-collection', updates: [], // Uh-oh, no documents! comment: 'this is gon...
51,710,761
I'm new to mongodb , and i try to insert data in database through my html page using post method. and i use mongoose in server side. here is my code look like. ``` var LoginInfoSchema = new mongoose.Schema ({ _id : String, user: String, password: String }); var user = mongoose.model('user',LoginInf...
2018/08/06
[ "https://Stackoverflow.com/questions/51710761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7611778/" ]
I spent the last two weeks with this error and just got it resolved. I am using kotlin on jetty and the official MongoDB drive. This link in stackoverflow was the closest result I got. In the end, I was missing the to call `documentCodec?.encode(writer, document, encoderContext)` at the end of the "encode" funcion. *...
I too also got stuck in the same error for quite a long. The above answers are perfect to solve the error but I would also suggest you to check the sequence of the parameters(object & callback function) you have sent to the MongoDB connect function. MongoClient.connect(function(parameters)) From controllers to the mod...
51,710,761
I'm new to mongodb , and i try to insert data in database through my html page using post method. and i use mongoose in server side. here is my code look like. ``` var LoginInfoSchema = new mongoose.Schema ({ _id : String, user: String, password: String }); var user = mongoose.model('user',LoginInf...
2018/08/06
[ "https://Stackoverflow.com/questions/51710761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7611778/" ]
I spent the last two weeks with this error and just got it resolved. I am using kotlin on jetty and the official MongoDB drive. This link in stackoverflow was the closest result I got. In the end, I was missing the to call `documentCodec?.encode(writer, document, encoderContext)` at the end of the "encode" funcion. *...
The MongoDB error "Write batch sizes must be between 1 and 100000. Got 0 operations." results from trying to apply a write operation to no arguments, e.g. update an array of zero documents: ``` db.runCommand( { update: 'some-collection', updates: [], // Uh-oh, no documents! comment: 'this is gon...
51,710,761
I'm new to mongodb , and i try to insert data in database through my html page using post method. and i use mongoose in server side. here is my code look like. ``` var LoginInfoSchema = new mongoose.Schema ({ _id : String, user: String, password: String }); var user = mongoose.model('user',LoginInf...
2018/08/06
[ "https://Stackoverflow.com/questions/51710761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7611778/" ]
The MongoDB error "Write batch sizes must be between 1 and 100000. Got 0 operations." results from trying to apply a write operation to no arguments, e.g. update an array of zero documents: ``` db.runCommand( { update: 'some-collection', updates: [], // Uh-oh, no documents! comment: 'this is gon...
I too also got stuck in the same error for quite a long. The above answers are perfect to solve the error but I would also suggest you to check the sequence of the parameters(object & callback function) you have sent to the MongoDB connect function. MongoClient.connect(function(parameters)) From controllers to the mod...
61,925
I am having troubles understanding utilitarianism a little bit, and have posed this question to a number of people and been met mostly with bafflement about how I cannot see the error in my proposed claim. But, when they explain against it, I cannot see the soundness of their argument. So, I am willing to accept that t...
2019/04/17
[ "https://philosophy.stackexchange.com/questions/61925", "https://philosophy.stackexchange.com", "https://philosophy.stackexchange.com/users/30741/" ]
The difference is that a utilitarian who endorses inalienable rights can conceive of a world in which that endorsement ends up morally wrong, even if our actual world endorses inalienable rights. By contrast, deontologists about rights say such a world is quite literally inconceivable. Indeed, on a basic utilitarian an...
Your objection of inalienable rights against utilitarianism is perfectly sound. I would be very interested in reading about the opposite arguments that did not convince you. One very common trait of utilitarian thought experiment is that they put their subject in the acting role: the one who chooses who gets under the...
21,824,701
I want to traverse through .gz file and read the contents of file. My folder structure: 1) ABC.gz 1.1) ABC 1.1.1) Sample1.txt 1.1.2) Sample2.txt 1.1.3) Test1.txt I wanted to traverse through .gz , then read and print the contents of Sample\*.txt file. Test\*.txt should be ignored. Importantly i do not want to c...
2014/02/17
[ "https://Stackoverflow.com/questions/21824701", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3318108/" ]
First of all a gzip file is a compressed version of a single file. From your description you most likely have a tar archive which was then compressed. The second point is that you will have to decompress it, either in memory or a temporary file. You will definitely not be able to read it row by row. Take a look at [...
Maybe something like this: ``` #!/usr/bin/perl -w use IPC::System::Simple "capture"; use File::Path qw[ make_path remove_tree ]; use warnings; use strict; my $tar = "/path/to/archive.tar.gz"; my @list = capture("tar tzf $tar | awk '{print \$NF}'"); my $tmp_path = "/your/tmp/path"; make_path($tmp_path) if not -...
8,754,159
I am using VS2005 C# I have a GridView and I have enabled row editing. However, I have some columns which will have a larger input, such as *Comments* column, which will contain more words. Is there a way to adjust the textbox sizes?
2012/01/06
[ "https://Stackoverflow.com/questions/8754159", "https://Stackoverflow.com", "https://Stackoverflow.com/users/872370/" ]
If you want control over width *and* height, as well as other properties, you can reference the TextBox in your GridView's RowDataBound event and set its height and width as well as setting the TextMode to MultiLine: ``` protected void RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == Data...
Set the `ItemStyle-Width` and `ControlStyle-Width`, and if you want wrap the text use `ItemStyle-Wrap`. Hope this helps.
8,754,159
I am using VS2005 C# I have a GridView and I have enabled row editing. However, I have some columns which will have a larger input, such as *Comments* column, which will contain more words. Is there a way to adjust the textbox sizes?
2012/01/06
[ "https://Stackoverflow.com/questions/8754159", "https://Stackoverflow.com", "https://Stackoverflow.com/users/872370/" ]
Set the `ItemStyle-Width` and `ControlStyle-Width`, and if you want wrap the text use `ItemStyle-Wrap`. Hope this helps.
Brissles answer is correct but DataControlRowState can have multiple states ORed together so you may need to check for edit state like this: ``` (e.Row.RowState & DataControlRowState.Edit) != 0 ```
8,754,159
I am using VS2005 C# I have a GridView and I have enabled row editing. However, I have some columns which will have a larger input, such as *Comments* column, which will contain more words. Is there a way to adjust the textbox sizes?
2012/01/06
[ "https://Stackoverflow.com/questions/8754159", "https://Stackoverflow.com", "https://Stackoverflow.com/users/872370/" ]
If you want control over width *and* height, as well as other properties, you can reference the TextBox in your GridView's RowDataBound event and set its height and width as well as setting the TextMode to MultiLine: ``` protected void RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == Data...
Brissles answer is correct but DataControlRowState can have multiple states ORed together so you may need to check for edit state like this: ``` (e.Row.RowState & DataControlRowState.Edit) != 0 ```
20,652,297
I have 100 machines to be automatically controlled using passwordless ssh. However, since passwordless ssh requires id\_rsa handshaking, it takes some time for controlling a machine as we can see in the following. ``` $ time ssh remote hostname remote real 0m0.294s user 0m0.020s sys 0m0.000s ``` It takes ...
2013/12/18
[ "https://Stackoverflow.com/questions/20652297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1023045/" ]
There is a way: use [telnet](http://en.wikipedia.org/wiki/Telnet). It provides the same as ssh without authentication and encryption.
The delay may be caused by the host doing a reverse DNS lookup when the client connects, to verify that the client's hostname reverses to the same IP that the client is connecting from. If you disable this option on your server's sshd, you may see less delay when connecting. See the links below for more info: <http://...
20,652,297
I have 100 machines to be automatically controlled using passwordless ssh. However, since passwordless ssh requires id\_rsa handshaking, it takes some time for controlling a machine as we can see in the following. ``` $ time ssh remote hostname remote real 0m0.294s user 0m0.020s sys 0m0.000s ``` It takes ...
2013/12/18
[ "https://Stackoverflow.com/questions/20652297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1023045/" ]
There is a way: use [telnet](http://en.wikipedia.org/wiki/Telnet). It provides the same as ssh without authentication and encryption.
`You can try using sshpass` For example, when password is in password.txt file: `sshpass -fpassword.txt ssh username@hostname`
9,497
So, a teacher explained to me that 究竟 is a more formal way of saying 到底. However, I'm still curious if there are there any other usage differences between the two? Is 究竟 only used in examples that are relatively “夸张” > > E.g. 你究竟为什么要离开我。 > > >
2014/09/10
[ "https://chinese.stackexchange.com/questions/9497", "https://chinese.stackexchange.com", "https://chinese.stackexchange.com/users/6003/" ]
1) "究竟" is more formal than "到底". In everyday spoken Chinese, "究竟" is rarely used. It is used almost only in drama and written Chinese. 2) Well, I would say that the magnitude of "究竟" is equal to that of "到底". They are all equivalent to "on the earth".
When used as an intensive, they are synomymous. Both translated as "on earth," "exactly." --- 究竟, 穷尽. literally means "investigate to the end." It can also be used as a noun which means "outcome," "final truth." 究 谋划;研究;探求. Study, investigate. Originally means "exhaust," "limit." See <http://xh.5156edu.com/html3/159...
9,497
So, a teacher explained to me that 究竟 is a more formal way of saying 到底. However, I'm still curious if there are there any other usage differences between the two? Is 究竟 only used in examples that are relatively “夸张” > > E.g. 你究竟为什么要离开我。 > > >
2014/09/10
[ "https://chinese.stackexchange.com/questions/9497", "https://chinese.stackexchange.com", "https://chinese.stackexchange.com/users/6003/" ]
1) "究竟" is more formal than "到底". In everyday spoken Chinese, "究竟" is rarely used. It is used almost only in drama and written Chinese. 2) Well, I would say that the magnitude of "究竟" is equal to that of "到底". They are all equivalent to "on the earth".
There's another meaning for [到底](https://youdao.com/w/%E5%88%B0%E5%BA%95), i.e., "to the end", while [究竟](https://youdao.com/w/%E7%A9%B6%E7%AB%9F) does not have this meaning. E.g.: > > We must fight on until the end. > > 我们必须继续斗争**到底**。 > > > This is described in more detail in the textbook *标准教程HSK4下* on page...
9,497
So, a teacher explained to me that 究竟 is a more formal way of saying 到底. However, I'm still curious if there are there any other usage differences between the two? Is 究竟 only used in examples that are relatively “夸张” > > E.g. 你究竟为什么要离开我。 > > >
2014/09/10
[ "https://chinese.stackexchange.com/questions/9497", "https://chinese.stackexchange.com", "https://chinese.stackexchange.com/users/6003/" ]
1) "究竟" is more formal than "到底". In everyday spoken Chinese, "究竟" is rarely used. It is used almost only in drama and written Chinese. 2) Well, I would say that the magnitude of "究竟" is equal to that of "到底". They are all equivalent to "on the earth".
1 When used as adverbs Both 到底 and 究竟 can be used as adverbs, and they are nearly the same when they are used to emphasize or to express strong emotion(normally negative ones). In this situation, the only difference is 究竟 is more formal than 到底. Here are a few examples. 你究竟去不去? 他们究竟是谁? 你们到底想干什么? 他们到底是怎么考虑的? When ...
9,497
So, a teacher explained to me that 究竟 is a more formal way of saying 到底. However, I'm still curious if there are there any other usage differences between the two? Is 究竟 only used in examples that are relatively “夸张” > > E.g. 你究竟为什么要离开我。 > > >
2014/09/10
[ "https://chinese.stackexchange.com/questions/9497", "https://chinese.stackexchange.com", "https://chinese.stackexchange.com/users/6003/" ]
When used as an intensive, they are synomymous. Both translated as "on earth," "exactly." --- 究竟, 穷尽. literally means "investigate to the end." It can also be used as a noun which means "outcome," "final truth." 究 谋划;研究;探求. Study, investigate. Originally means "exhaust," "limit." See <http://xh.5156edu.com/html3/159...
There's another meaning for [到底](https://youdao.com/w/%E5%88%B0%E5%BA%95), i.e., "to the end", while [究竟](https://youdao.com/w/%E7%A9%B6%E7%AB%9F) does not have this meaning. E.g.: > > We must fight on until the end. > > 我们必须继续斗争**到底**。 > > > This is described in more detail in the textbook *标准教程HSK4下* on page...
9,497
So, a teacher explained to me that 究竟 is a more formal way of saying 到底. However, I'm still curious if there are there any other usage differences between the two? Is 究竟 only used in examples that are relatively “夸张” > > E.g. 你究竟为什么要离开我。 > > >
2014/09/10
[ "https://chinese.stackexchange.com/questions/9497", "https://chinese.stackexchange.com", "https://chinese.stackexchange.com/users/6003/" ]
When used as an intensive, they are synomymous. Both translated as "on earth," "exactly." --- 究竟, 穷尽. literally means "investigate to the end." It can also be used as a noun which means "outcome," "final truth." 究 谋划;研究;探求. Study, investigate. Originally means "exhaust," "limit." See <http://xh.5156edu.com/html3/159...
1 When used as adverbs Both 到底 and 究竟 can be used as adverbs, and they are nearly the same when they are used to emphasize or to express strong emotion(normally negative ones). In this situation, the only difference is 究竟 is more formal than 到底. Here are a few examples. 你究竟去不去? 他们究竟是谁? 你们到底想干什么? 他们到底是怎么考虑的? When ...
95,010
I'm trying to understand different methods of calculating interest on installment loans. I keep coming across the terms "simple interest" and "actuarial method". They seem to be related but I haven't found a clear explanation. Here's an example of something I read on another website that has me confused: > > **Simple...
2018/05/01
[ "https://money.stackexchange.com/questions/95010", "https://money.stackexchange.com", "https://money.stackexchange.com/users/42805/" ]
Definitions of simple interest differ, e.g. the naïve version here: [What is 'Simple Interest'](https://www.investopedia.com/terms/s/simple_interest.asp). ``` Simple Interest = P x I x N where P is the principal I is the periodic interest rate N is the number of periods ``` (*an example is include...
The actuarial method, in relation to a loan (as you mentioned) and its repayment is generally associated with repayment of loan at reducing balance (the method though can be used for many other purpose, on some cases on appreciating balance). For example, let's say you have borrowed $1000 at an interest rate of 10% to...
39,515,915
I want to make sure if there are better way of my below code , a way to send data to server the below is working , but can be better? ``` class SendPostReqAsyncTask extends AsyncTask<String, Void, String> { @Override protected String doInBackground(String... params) { String json = ""; String ...
2016/09/15
[ "https://Stackoverflow.com/questions/39515915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2291869/" ]
You can use [AutoMapper](http://automapper.org/): ``` public Dog UsingAMR(Person prs) { var config = new MapperConfiguration(cfg => { cfg.CreateMap<Person, Dog>(); }); IMapper mapper = config.CreateMapper(); return mapper.Map<Person, Dog>(prs); } ``` Then you can easily: ``` Person ps = ...
Install `AutoMapper` package in your project. As a best practice (for web applications) you can create new class (should derives from `Profile`) in your `App_Start` folder, that will contain all your mappings for your project. ``` namespace MyApp.App_Start { public class MyAppMapping : Profile { publi...
39,515,915
I want to make sure if there are better way of my below code , a way to send data to server the below is working , but can be better? ``` class SendPostReqAsyncTask extends AsyncTask<String, Void, String> { @Override protected String doInBackground(String... params) { String json = ""; String ...
2016/09/15
[ "https://Stackoverflow.com/questions/39515915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2291869/" ]
You can use [AutoMapper](http://automapper.org/): ``` public Dog UsingAMR(Person prs) { var config = new MapperConfiguration(cfg => { cfg.CreateMap<Person, Dog>(); }); IMapper mapper = config.CreateMapper(); return mapper.Map<Person, Dog>(prs); } ``` Then you can easily: ``` Person ps = ...
An object oriented approach. ``` public class Mammal { public Mammal(Mammal toCopy) { Name = toCopy.Name; Number = toCopy.Number; } public string Name {get; set;} public int Number {get; set;} } public class Person: Mammal { public Person(Mammal toCopy) {} /* will default to bas...
39,515,915
I want to make sure if there are better way of my below code , a way to send data to server the below is working , but can be better? ``` class SendPostReqAsyncTask extends AsyncTask<String, Void, String> { @Override protected String doInBackground(String... params) { String json = ""; String ...
2016/09/15
[ "https://Stackoverflow.com/questions/39515915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2291869/" ]
You can use [AutoMapper](http://automapper.org/): ``` public Dog UsingAMR(Person prs) { var config = new MapperConfiguration(cfg => { cfg.CreateMap<Person, Dog>(); }); IMapper mapper = config.CreateMapper(); return mapper.Map<Person, Dog>(prs); } ``` Then you can easily: ``` Person ps = ...
If you don't work with big generic list, you can do it using LinQ. ``` var persons = new List<Person>(); // populate data [...] var dogs = persons.Select(p=>new Dog{Name=p.Name,Number=p.Number}).ToList(); ``` It's easy to remember, and you can filter data previously.
21,814,672
I am using spring framework for writing a web service application. There are not html or jsp pages in the application. It is purely web service. **This is my Controller class** ``` @RequestMapping("/*") public class Opinion { private FeedbackService fs; public Opinion(FeedbackService fs){ this.f...
2014/02/16
[ "https://Stackoverflow.com/questions/21814672", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1139023/" ]
Downloading java dependencies is possible, if you actually really need to download them into a folder. Example: ``` apply plugin: 'java' dependencies { runtime group: 'com.netflix.exhibitor', name: 'exhibitor-standalone', version: '1.5.2' runtime group: 'org.apache.zookeeper', name: 'zookeeper', version: '3.4.6...
I have found this answer <https://stackoverflow.com/a/47107135/3067148> also very helpful: > > `gradle dependencies` will list the dependencies and download them as a > side-effect. > > >
21,814,672
I am using spring framework for writing a web service application. There are not html or jsp pages in the application. It is purely web service. **This is my Controller class** ``` @RequestMapping("/*") public class Opinion { private FeedbackService fs; public Opinion(FeedbackService fs){ this.f...
2014/02/16
[ "https://Stackoverflow.com/questions/21814672", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1139023/" ]
A slightly lighter task that doesn't unnecessarily copy files to a dir: ``` task downloadDependencies(type: Exec) { configurations.testRuntime.files commandLine 'echo', 'Downloaded all dependencies' } ``` Updated for kotlin & gradle 6.2.0, with buildscript dependency resolution added: ```kotlin fun Configur...
You should try this one : ``` task getDeps(type: Copy) { from configurations.runtime into 'runtime/' } ``` I was was looking for it some time ago when working on a project in which we had to download all dependencies into current working directory at some point in our provisioning script. I guess you're tryi...
21,814,672
I am using spring framework for writing a web service application. There are not html or jsp pages in the application. It is purely web service. **This is my Controller class** ``` @RequestMapping("/*") public class Opinion { private FeedbackService fs; public Opinion(FeedbackService fs){ this.f...
2014/02/16
[ "https://Stackoverflow.com/questions/21814672", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1139023/" ]
For Intellij go to View > Tool Windows > Gradle > Refresh All Projects (the blue circular arrows at the top of the Gradle window. [![enter image description here](https://i.stack.imgur.com/DEOqt.jpg)](https://i.stack.imgur.com/DEOqt.jpg)
This version builds on Robert Elliot's, but I'm not 100% sure of its efficacy. ``` // There are a few dependencies added by one of the Scala plugins that this cannot reach. task downloadDependencies { description "Pre-downloads *most* dependencies" doLast { configurations.getAsMap().each { name, config -> ...
21,814,672
I am using spring framework for writing a web service application. There are not html or jsp pages in the application. It is purely web service. **This is my Controller class** ``` @RequestMapping("/*") public class Opinion { private FeedbackService fs; public Opinion(FeedbackService fs){ this.f...
2014/02/16
[ "https://Stackoverflow.com/questions/21814672", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1139023/" ]
You should try this one : ``` task getDeps(type: Copy) { from configurations.runtime into 'runtime/' } ``` I was was looking for it some time ago when working on a project in which we had to download all dependencies into current working directory at some point in our provisioning script. I guess you're tryi...
There is no task to download dependencies; they are downloaded on demand. To learn how to manage dependencies with Gradle, see "Chapter 8. Dependency Management Basics" in the [Gradle User Guide](http://gradle.org/docs/current/userguide/userguide_single.html).
21,814,672
I am using spring framework for writing a web service application. There are not html or jsp pages in the application. It is purely web service. **This is my Controller class** ``` @RequestMapping("/*") public class Opinion { private FeedbackService fs; public Opinion(FeedbackService fs){ this.f...
2014/02/16
[ "https://Stackoverflow.com/questions/21814672", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1139023/" ]
Downloading java dependencies is possible, if you actually really need to download them into a folder. Example: ``` apply plugin: 'java' dependencies { runtime group: 'com.netflix.exhibitor', name: 'exhibitor-standalone', version: '1.5.2' runtime group: 'org.apache.zookeeper', name: 'zookeeper', version: '3.4.6...
You should try this one : ``` task getDeps(type: Copy) { from configurations.runtime into 'runtime/' } ``` I was was looking for it some time ago when working on a project in which we had to download all dependencies into current working directory at some point in our provisioning script. I guess you're tryi...
21,814,672
I am using spring framework for writing a web service application. There are not html or jsp pages in the application. It is purely web service. **This is my Controller class** ``` @RequestMapping("/*") public class Opinion { private FeedbackService fs; public Opinion(FeedbackService fs){ this.f...
2014/02/16
[ "https://Stackoverflow.com/questions/21814672", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1139023/" ]
Downloading java dependencies is possible, if you actually really need to download them into a folder. Example: ``` apply plugin: 'java' dependencies { runtime group: 'com.netflix.exhibitor', name: 'exhibitor-standalone', version: '1.5.2' runtime group: 'org.apache.zookeeper', name: 'zookeeper', version: '3.4.6...
A slightly lighter task that doesn't unnecessarily copy files to a dir: ``` task downloadDependencies(type: Exec) { configurations.testRuntime.files commandLine 'echo', 'Downloaded all dependencies' } ``` Updated for kotlin & gradle 6.2.0, with buildscript dependency resolution added: ```kotlin fun Configur...
21,814,672
I am using spring framework for writing a web service application. There are not html or jsp pages in the application. It is purely web service. **This is my Controller class** ``` @RequestMapping("/*") public class Opinion { private FeedbackService fs; public Opinion(FeedbackService fs){ this.f...
2014/02/16
[ "https://Stackoverflow.com/questions/21814672", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1139023/" ]
I have found this answer <https://stackoverflow.com/a/47107135/3067148> also very helpful: > > `gradle dependencies` will list the dependencies and download them as a > side-effect. > > >
It is hard to figure out exactly what you are trying to do from the question. I'll take a guess and say that you want to add an extra compile task in addition to those provided out of the box by the java plugin. The easiest way to do this is probably to specify a new `sourceSet` called 'speedTest'. This will generate ...
21,814,672
I am using spring framework for writing a web service application. There are not html or jsp pages in the application. It is purely web service. **This is my Controller class** ``` @RequestMapping("/*") public class Opinion { private FeedbackService fs; public Opinion(FeedbackService fs){ this.f...
2014/02/16
[ "https://Stackoverflow.com/questions/21814672", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1139023/" ]
A slightly lighter task that doesn't unnecessarily copy files to a dir: ``` task downloadDependencies(type: Exec) { configurations.testRuntime.files commandLine 'echo', 'Downloaded all dependencies' } ``` Updated for kotlin & gradle 6.2.0, with buildscript dependency resolution added: ```kotlin fun Configur...
Building on top of Robert Elliot's answer. For whatever reason, if one is interested in downloading the dependencies to Gradle cache then copying to a local repository like maven's (by default `~/.m2/repository`): ```scala task downloadDependencies(type: Exec) { configurations.implementation.files + configurations...
21,814,672
I am using spring framework for writing a web service application. There are not html or jsp pages in the application. It is purely web service. **This is my Controller class** ``` @RequestMapping("/*") public class Opinion { private FeedbackService fs; public Opinion(FeedbackService fs){ this.f...
2014/02/16
[ "https://Stackoverflow.com/questions/21814672", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1139023/" ]
Downloading java dependencies is possible, if you actually really need to download them into a folder. Example: ``` apply plugin: 'java' dependencies { runtime group: 'com.netflix.exhibitor', name: 'exhibitor-standalone', version: '1.5.2' runtime group: 'org.apache.zookeeper', name: 'zookeeper', version: '3.4.6...
This version builds on Robert Elliot's, but I'm not 100% sure of its efficacy. ``` // There are a few dependencies added by one of the Scala plugins that this cannot reach. task downloadDependencies { description "Pre-downloads *most* dependencies" doLast { configurations.getAsMap().each { name, config -> ...
21,814,672
I am using spring framework for writing a web service application. There are not html or jsp pages in the application. It is purely web service. **This is my Controller class** ``` @RequestMapping("/*") public class Opinion { private FeedbackService fs; public Opinion(FeedbackService fs){ this.f...
2014/02/16
[ "https://Stackoverflow.com/questions/21814672", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1139023/" ]
You should try this one : ``` task getDeps(type: Copy) { from configurations.runtime into 'runtime/' } ``` I was was looking for it some time ago when working on a project in which we had to download all dependencies into current working directory at some point in our provisioning script. I guess you're tryi...
It is hard to figure out exactly what you are trying to do from the question. I'll take a guess and say that you want to add an extra compile task in addition to those provided out of the box by the java plugin. The easiest way to do this is probably to specify a new `sourceSet` called 'speedTest'. This will generate ...
23,565,370
I have a question regarding something I'm seeing in some VB.NET code on a project that I've had to take over. In a form the developer has declared a very simple 15sec timer. ``` Private WithEvents mtmrManualDecision As New System.Timers.Timer(15000) ``` Now, I know that this timer will trigger the mtmrManualDecision...
2014/05/09
[ "https://Stackoverflow.com/questions/23565370", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1218207/" ]
> > I believe this is basically stopping the timer. > > > No, it does not stop the timer. The timer does not stop until your program stops it, or disposes of it. Once you remove the handler, the timer will stop delivering the events to your program, but it would continue "ticking" in the background. For example, ...
> > I believe this is basically stopping the timer > > > No, it's removing a single handler. If there are any *other* handlers, those will keep firing. Or maybe the developer wants to be able to re-add the handler later on, with the timer keeping going with its original schedule (rather than stopping/starting whic...
20,596,588
I would like to be able to insert a row into an SQL table, giving it a specified id. The trouble is that the id is unique and for it to work I'd have to update the rows after the inserted row, increasing the id's by 1. So, say I have a table like the following ![enter image description here](https://i.stack.imgur.co...
2013/12/15
[ "https://Stackoverflow.com/questions/20596588", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1997661/" ]
Firstly, best practice is to **never ever** modify the primary key of a row once it is inserted (I assume `id` is your primary key?). *Just Don't Do It™*. **Instead**, create an additional column (called `importance`/`priority`/something, and modify that field as necessary. --- That said, the query would look someth...
Something is wrong with your design. An `id` column typically has a unique value that represents each row. The nice thing about `id`s is that the value does *not* change, which means that they can be referenced by other tables or even an application. It sounds like you want some sort of "sort order" or something like ...
42,845,942
Good afternoon, I'm learning and using pyttsx for speech, the thing is that I want to use it as a "female" voice but I can not do it using this code: ``` import pyttsx as pt from pyttsx import voice engine = pt.init() voices = engine.getProperty('voices') #engine.setProperty('gender', 'female') # also does not work en...
2017/03/16
[ "https://Stackoverflow.com/questions/42845942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7724033/" ]
Use `sound=getProperty ('voices'); engine.setProperty('voice','sound [1].id')` This will definitely work. 0 for male and 1 for female.
You have to check whether your computer has other narrator options or not for that go to control panel -> Ease of Access center -> Narrator options there will be option how many narrators you have. other option go to windows search for narrator. if you don't have other narrator that you have written in code, default na...
42,845,942
Good afternoon, I'm learning and using pyttsx for speech, the thing is that I want to use it as a "female" voice but I can not do it using this code: ``` import pyttsx as pt from pyttsx import voice engine = pt.init() voices = engine.getProperty('voices') #engine.setProperty('gender', 'female') # also does not work en...
2017/03/16
[ "https://Stackoverflow.com/questions/42845942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7724033/" ]
if you use linux/espeak... change the code here `engine.setProperty('voice', 'english+f1')` you can change the voice by adding f1 until f4
Use `sound=getProperty ('voices'); engine.setProperty('voice','sound [1].id')` This will definitely work. 0 for male and 1 for female.
42,845,942
Good afternoon, I'm learning and using pyttsx for speech, the thing is that I want to use it as a "female" voice but I can not do it using this code: ``` import pyttsx as pt from pyttsx import voice engine = pt.init() voices = engine.getProperty('voices') #engine.setProperty('gender', 'female') # also does not work en...
2017/03/16
[ "https://Stackoverflow.com/questions/42845942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7724033/" ]
I use this helper function, that iterates over the voices. If a voice for a specific language and gender exists, it will change to this voice otherwise an exception will be raised. ``` # language : en_US, de_DE, ... # gender : VoiceGenderFemale, VoiceGenderMale def change_voice(engine, language, gender='VoiceGende...
``` import pyttsx as pt from pyttsx import voice engine = pt.init() voices = engine.getProperty('voices') #engine.setProperty('gender', 'female') # also does not work #engine.setProperty('female', voice.Voice.gender) #not even #engine.setProperty('female', voice.gender) #does not work engine.setProperty('voice', voices...
42,845,942
Good afternoon, I'm learning and using pyttsx for speech, the thing is that I want to use it as a "female" voice but I can not do it using this code: ``` import pyttsx as pt from pyttsx import voice engine = pt.init() voices = engine.getProperty('voices') #engine.setProperty('gender', 'female') # also does not work en...
2017/03/16
[ "https://Stackoverflow.com/questions/42845942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7724033/" ]
I used the following code to iterate through the voices to find the female voice ``` import pyttsx engine = pyttsx.init() voices = engine.getProperty('voices') for voice in voices: engine.setProperty('voice', voice.id) print voice.id engine.say('The quick brown fox jumped over the lazy dog.') engine.runAndWa...
Use `sound=getProperty ('voices'); engine.setProperty('voice','sound [1].id')` This will definitely work. 0 for male and 1 for female.
42,845,942
Good afternoon, I'm learning and using pyttsx for speech, the thing is that I want to use it as a "female" voice but I can not do it using this code: ``` import pyttsx as pt from pyttsx import voice engine = pt.init() voices = engine.getProperty('voices') #engine.setProperty('gender', 'female') # also does not work en...
2017/03/16
[ "https://Stackoverflow.com/questions/42845942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7724033/" ]
This is a simpler solution: ``` engine = pyttsx.init() voices = engine.getProperty('voices') engine.setProperty('voice', voices[1].id) ```
``` import pyttsx as pt from pyttsx import voice engine = pt.init() voices = engine.getProperty('voices') #engine.setProperty('gender', 'female') # also does not work #engine.setProperty('female', voice.Voice.gender) #not even #engine.setProperty('female', voice.gender) #does not work engine.setProperty('voice', voices...
42,845,942
Good afternoon, I'm learning and using pyttsx for speech, the thing is that I want to use it as a "female" voice but I can not do it using this code: ``` import pyttsx as pt from pyttsx import voice engine = pt.init() voices = engine.getProperty('voices') #engine.setProperty('gender', 'female') # also does not work en...
2017/03/16
[ "https://Stackoverflow.com/questions/42845942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7724033/" ]
Use `sound=getProperty ('voices'); engine.setProperty('voice','sound [1].id')` This will definitely work. 0 for male and 1 for female.
``` import pyttsx as pt from pyttsx import voice engine = pt.init() voices = engine.getProperty('voices') #engine.setProperty('gender', 'female') # also does not work #engine.setProperty('female', voice.Voice.gender) #not even #engine.setProperty('female', voice.gender) #does not work engine.setProperty('voice', voices...
42,845,942
Good afternoon, I'm learning and using pyttsx for speech, the thing is that I want to use it as a "female" voice but I can not do it using this code: ``` import pyttsx as pt from pyttsx import voice engine = pt.init() voices = engine.getProperty('voices') #engine.setProperty('gender', 'female') # also does not work en...
2017/03/16
[ "https://Stackoverflow.com/questions/42845942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7724033/" ]
I used the following code to iterate through the voices to find the female voice ``` import pyttsx engine = pyttsx.init() voices = engine.getProperty('voices') for voice in voices: engine.setProperty('voice', voice.id) print voice.id engine.say('The quick brown fox jumped over the lazy dog.') engine.runAndWa...
``` import pyttsx as pt from pyttsx import voice engine = pt.init() voices = engine.getProperty('voices') #engine.setProperty('gender', 'female') # also does not work #engine.setProperty('female', voice.Voice.gender) #not even #engine.setProperty('female', voice.gender) #does not work engine.setProperty('voice', voices...
42,845,942
Good afternoon, I'm learning and using pyttsx for speech, the thing is that I want to use it as a "female" voice but I can not do it using this code: ``` import pyttsx as pt from pyttsx import voice engine = pt.init() voices = engine.getProperty('voices') #engine.setProperty('gender', 'female') # also does not work en...
2017/03/16
[ "https://Stackoverflow.com/questions/42845942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7724033/" ]
This is a simpler solution: ``` engine = pyttsx.init() voices = engine.getProperty('voices') engine.setProperty('voice', voices[1].id) ```
Use `sound=getProperty ('voices'); engine.setProperty('voice','sound [1].id')` This will definitely work. 0 for male and 1 for female.
42,845,942
Good afternoon, I'm learning and using pyttsx for speech, the thing is that I want to use it as a "female" voice but I can not do it using this code: ``` import pyttsx as pt from pyttsx import voice engine = pt.init() voices = engine.getProperty('voices') #engine.setProperty('gender', 'female') # also does not work en...
2017/03/16
[ "https://Stackoverflow.com/questions/42845942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7724033/" ]
Use `sound=getProperty ('voices'); engine.setProperty('voice','sound [1].id')` This will definitely work. 0 for male and 1 for female.
I use this helper function, that iterates over the voices. If a voice for a specific language and gender exists, it will change to this voice otherwise an exception will be raised. ``` # language : en_US, de_DE, ... # gender : VoiceGenderFemale, VoiceGenderMale def change_voice(engine, language, gender='VoiceGende...
42,845,942
Good afternoon, I'm learning and using pyttsx for speech, the thing is that I want to use it as a "female" voice but I can not do it using this code: ``` import pyttsx as pt from pyttsx import voice engine = pt.init() voices = engine.getProperty('voices') #engine.setProperty('gender', 'female') # also does not work en...
2017/03/16
[ "https://Stackoverflow.com/questions/42845942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7724033/" ]
if you use linux/espeak... change the code here `engine.setProperty('voice', 'english+f1')` you can change the voice by adding f1 until f4
You have to check whether your computer has other narrator options or not for that go to control panel -> Ease of Access center -> Narrator options there will be option how many narrators you have. other option go to windows search for narrator. if you don't have other narrator that you have written in code, default na...
206,614
After re-installing Lubuntu 12.04 system on my laptop an older problem re-emerged after a few days and installation of different programs: without apparent reason the external mouse and sometimes other usb connected devices (including hdd) stop working. The hdd shows it has tension as it has a light there, and the exte...
2012/10/26
[ "https://askubuntu.com/questions/206614", "https://askubuntu.com", "https://askubuntu.com/users/-1/" ]
kernel vs hardware issues ------------------------- If you have ruled out possible hardware issues such as voltage/current problems, failing USB ports/hubs then this is probably a kernel problem. If you feel comfortable with possible non-booting issues/black screen issues on boot, you could try installing the quantal...
A **fast solution** that works at least in my case (Linux Mint KDE, on a Lenovo Yoga 3 Pro laptop): With the laptop on, just **press the power button for about 30 seconds**, that is shutting down and still pressing for a while after this. I did it with the charger unplugged. After turning on the laptop, the USB ports ...
206,614
After re-installing Lubuntu 12.04 system on my laptop an older problem re-emerged after a few days and installation of different programs: without apparent reason the external mouse and sometimes other usb connected devices (including hdd) stop working. The hdd shows it has tension as it has a light there, and the exte...
2012/10/26
[ "https://askubuntu.com/questions/206614", "https://askubuntu.com", "https://askubuntu.com/users/-1/" ]
Old post, and replies are not relevant to USB 3.0. So here's how to reset a 3.0 Bus that stopped serving data: ``` su - ``` and as root: ``` echo -n "0000:06:00.0" | tee /sys/bus/pci/drivers/xhci_hcd/unbind echo -n "0000:06:00.0" | tee /sys/bus/pci/drivers/xhci_hcd/bind ``` After this, USB should start to work co...
A **fast solution** that works at least in my case (Linux Mint KDE, on a Lenovo Yoga 3 Pro laptop): With the laptop on, just **press the power button for about 30 seconds**, that is shutting down and still pressing for a while after this. I did it with the charger unplugged. After turning on the laptop, the USB ports ...
206,614
After re-installing Lubuntu 12.04 system on my laptop an older problem re-emerged after a few days and installation of different programs: without apparent reason the external mouse and sometimes other usb connected devices (including hdd) stop working. The hdd shows it has tension as it has a light there, and the exte...
2012/10/26
[ "https://askubuntu.com/questions/206614", "https://askubuntu.com", "https://askubuntu.com/users/-1/" ]
Power issues for USB 2.0 ------------------------ USB 2.0 has a maximum current draw available of 500mA, however it should be noted that the +5V on several ports may actually be on the same bus. For example on a desktop case the USB ports on the front of the machine may all be on the same bus, while the ports on the b...
Base on `lsusb` ``` #lsusb Bus 002 Device 002: ID 04f3:0230 Elan Microelectronics Corp. 3D Optical Mouse Bus 003 Device 002: ID 04f3:0103 Elan Microelectronics Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 001: ID 1d6...
206,614
After re-installing Lubuntu 12.04 system on my laptop an older problem re-emerged after a few days and installation of different programs: without apparent reason the external mouse and sometimes other usb connected devices (including hdd) stop working. The hdd shows it has tension as it has a light there, and the exte...
2012/10/26
[ "https://askubuntu.com/questions/206614", "https://askubuntu.com", "https://askubuntu.com/users/-1/" ]
Base on `lsusb` ``` #lsusb Bus 002 Device 002: ID 04f3:0230 Elan Microelectronics Corp. 3D Optical Mouse Bus 003 Device 002: ID 04f3:0103 Elan Microelectronics Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 001: ID 1d6...
A **fast solution** that works at least in my case (Linux Mint KDE, on a Lenovo Yoga 3 Pro laptop): With the laptop on, just **press the power button for about 30 seconds**, that is shutting down and still pressing for a while after this. I did it with the charger unplugged. After turning on the laptop, the USB ports ...
206,614
After re-installing Lubuntu 12.04 system on my laptop an older problem re-emerged after a few days and installation of different programs: without apparent reason the external mouse and sometimes other usb connected devices (including hdd) stop working. The hdd shows it has tension as it has a light there, and the exte...
2012/10/26
[ "https://askubuntu.com/questions/206614", "https://askubuntu.com", "https://askubuntu.com/users/-1/" ]
Something similar to this was happening to me. [This blog post](http://billauer.co.il/blog/2013/02/usb-reset-ehci-uhci-linux/) provided a partial solution. This is what worked for me: ``` sudo -s cd /sys/bus/pci/drivers/xhci_hcd/ for file in ????:??:??.? ; do echo -n "$file" > unbind echo -n "$file" > bind done ``...
Old post, and replies are not relevant to USB 3.0. So here's how to reset a 3.0 Bus that stopped serving data: ``` su - ``` and as root: ``` echo -n "0000:06:00.0" | tee /sys/bus/pci/drivers/xhci_hcd/unbind echo -n "0000:06:00.0" | tee /sys/bus/pci/drivers/xhci_hcd/bind ``` After this, USB should start to work co...
206,614
After re-installing Lubuntu 12.04 system on my laptop an older problem re-emerged after a few days and installation of different programs: without apparent reason the external mouse and sometimes other usb connected devices (including hdd) stop working. The hdd shows it has tension as it has a light there, and the exte...
2012/10/26
[ "https://askubuntu.com/questions/206614", "https://askubuntu.com", "https://askubuntu.com/users/-1/" ]
Something similar to this was happening to me. [This blog post](http://billauer.co.il/blog/2013/02/usb-reset-ehci-uhci-linux/) provided a partial solution. This is what worked for me: ``` sudo -s cd /sys/bus/pci/drivers/xhci_hcd/ for file in ????:??:??.? ; do echo -n "$file" > unbind echo -n "$file" > bind done ``...
FWIW - If you're having USB problems on ubuntu due to conflicts or power issues, save yourself some trouble and get a powered USB expander - these are cheap devices that plug into your USB port and turn it into 5 or 10 or whatever you need to buy and have a separate power supply and go for about 30$ USD on amazon. I ...
206,614
After re-installing Lubuntu 12.04 system on my laptop an older problem re-emerged after a few days and installation of different programs: without apparent reason the external mouse and sometimes other usb connected devices (including hdd) stop working. The hdd shows it has tension as it has a light there, and the exte...
2012/10/26
[ "https://askubuntu.com/questions/206614", "https://askubuntu.com", "https://askubuntu.com/users/-1/" ]
kernel vs hardware issues ------------------------- If you have ruled out possible hardware issues such as voltage/current problems, failing USB ports/hubs then this is probably a kernel problem. If you feel comfortable with possible non-booting issues/black screen issues on boot, you could try installing the quantal...
Old post, and replies are not relevant to USB 3.0. So here's how to reset a 3.0 Bus that stopped serving data: ``` su - ``` and as root: ``` echo -n "0000:06:00.0" | tee /sys/bus/pci/drivers/xhci_hcd/unbind echo -n "0000:06:00.0" | tee /sys/bus/pci/drivers/xhci_hcd/bind ``` After this, USB should start to work co...
206,614
After re-installing Lubuntu 12.04 system on my laptop an older problem re-emerged after a few days and installation of different programs: without apparent reason the external mouse and sometimes other usb connected devices (including hdd) stop working. The hdd shows it has tension as it has a light there, and the exte...
2012/10/26
[ "https://askubuntu.com/questions/206614", "https://askubuntu.com", "https://askubuntu.com/users/-1/" ]
kernel vs hardware issues ------------------------- If you have ruled out possible hardware issues such as voltage/current problems, failing USB ports/hubs then this is probably a kernel problem. If you feel comfortable with possible non-booting issues/black screen issues on boot, you could try installing the quantal...
FWIW - If you're having USB problems on ubuntu due to conflicts or power issues, save yourself some trouble and get a powered USB expander - these are cheap devices that plug into your USB port and turn it into 5 or 10 or whatever you need to buy and have a separate power supply and go for about 30$ USD on amazon. I ...
206,614
After re-installing Lubuntu 12.04 system on my laptop an older problem re-emerged after a few days and installation of different programs: without apparent reason the external mouse and sometimes other usb connected devices (including hdd) stop working. The hdd shows it has tension as it has a light there, and the exte...
2012/10/26
[ "https://askubuntu.com/questions/206614", "https://askubuntu.com", "https://askubuntu.com/users/-1/" ]
Something similar to this was happening to me. [This blog post](http://billauer.co.il/blog/2013/02/usb-reset-ehci-uhci-linux/) provided a partial solution. This is what worked for me: ``` sudo -s cd /sys/bus/pci/drivers/xhci_hcd/ for file in ????:??:??.? ; do echo -n "$file" > unbind echo -n "$file" > bind done ``...
A **fast solution** that works at least in my case (Linux Mint KDE, on a Lenovo Yoga 3 Pro laptop): With the laptop on, just **press the power button for about 30 seconds**, that is shutting down and still pressing for a while after this. I did it with the charger unplugged. After turning on the laptop, the USB ports ...
206,614
After re-installing Lubuntu 12.04 system on my laptop an older problem re-emerged after a few days and installation of different programs: without apparent reason the external mouse and sometimes other usb connected devices (including hdd) stop working. The hdd shows it has tension as it has a light there, and the exte...
2012/10/26
[ "https://askubuntu.com/questions/206614", "https://askubuntu.com", "https://askubuntu.com/users/-1/" ]
Old post, and replies are not relevant to USB 3.0. So here's how to reset a 3.0 Bus that stopped serving data: ``` su - ``` and as root: ``` echo -n "0000:06:00.0" | tee /sys/bus/pci/drivers/xhci_hcd/unbind echo -n "0000:06:00.0" | tee /sys/bus/pci/drivers/xhci_hcd/bind ``` After this, USB should start to work co...
FWIW - If you're having USB problems on ubuntu due to conflicts or power issues, save yourself some trouble and get a powered USB expander - these are cheap devices that plug into your USB port and turn it into 5 or 10 or whatever you need to buy and have a separate power supply and go for about 30$ USD on amazon. I ...
23,759,319
I found this tabbed content and so far set it up but for the life of me cannot figure out how to change the colour of the tab to a difference colour when you hover over it. I thought it would be the tabs label:hover but it doesn't seem to be. My code is here: ``` body, html { height: 100%; ...
2014/05/20
[ "https://Stackoverflow.com/questions/23759319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3319013/" ]
``` .tabs label:hover { background: #9eab05; top: 1px; } ``` there is a ")" <-- remove it fiddle <http://jsfiddle.net/n5ura/> ``` body, html { height: 100%; margin: 0; -webkit-font-smoothing: antialiased; font-weight: 100; ...
maybe change this ? ``` .tabs label:hover { background: #9eab05; top: 1px; } ``` into : ``` .tabs label:hover { background: #9eab05; color:#000; top: 1px; } ``` if you want to change the color of the text. Or else change background ...
23,759,319
I found this tabbed content and so far set it up but for the life of me cannot figure out how to change the colour of the tab to a difference colour when you hover over it. I thought it would be the tabs label:hover but it doesn't seem to be. My code is here: ``` body, html { height: 100%; ...
2014/05/20
[ "https://Stackoverflow.com/questions/23759319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3319013/" ]
``` .tabs label:hover { background: #9eab05; top: 1px; } ``` there is a ")" <-- remove it fiddle <http://jsfiddle.net/n5ura/> ``` body, html { height: 100%; margin: 0; -webkit-font-smoothing: antialiased; font-weight: 100; ...
Use hover instead checked, example on the find me button ``` [id^=tabfindme]:hover + label { background: red color: white; top: 0; } ```
44,236,756
How do I scroll through a modal window that is created using Bootstrap's modal class? Generally we use the JavascriptExecutor and use the window.scroll/scrollBy method. But when I tried the same when a modal is popped up with long content, the scroll is happening in the actual webpage which is not focused. How do I scr...
2017/05/29
[ "https://Stackoverflow.com/questions/44236756", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2110723/" ]
This script captures the `-i` command, while still allowing `unittest.main` to do its own commandline parsing: ``` import unittest class Testclass(unittest.TestCase): @classmethod def setUpClass(cls): print "Hello Class" def test_addnum(self): print "Execute the test case" #parse...
Your code is setting up your argument parser using ``` argparse.ArgumentParser() parser.add_argument('-i', help='input file', dest='inputfile') ``` in a method of your test class. But I see no indication that the code is actually calling the method. So at the time you start the program, the parser does not yet ex...
44,236,756
How do I scroll through a modal window that is created using Bootstrap's modal class? Generally we use the JavascriptExecutor and use the window.scroll/scrollBy method. But when I tried the same when a modal is popped up with long content, the scroll is happening in the actual webpage which is not focused. How do I scr...
2017/05/29
[ "https://Stackoverflow.com/questions/44236756", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2110723/" ]
Thanks hpaulj, your solution really helped me and I found one more solution for this problem. Hope it helps someone else facing the same issue. ``` import unittest import argparse import sys class Testclass(unittest.TestCase): @classmethod def setUpClass(cls): print "Hello Class" def test_addnum...
Your code is setting up your argument parser using ``` argparse.ArgumentParser() parser.add_argument('-i', help='input file', dest='inputfile') ``` in a method of your test class. But I see no indication that the code is actually calling the method. So at the time you start the program, the parser does not yet ex...
44,236,756
How do I scroll through a modal window that is created using Bootstrap's modal class? Generally we use the JavascriptExecutor and use the window.scroll/scrollBy method. But when I tried the same when a modal is popped up with long content, the scroll is happening in the actual webpage which is not focused. How do I scr...
2017/05/29
[ "https://Stackoverflow.com/questions/44236756", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2110723/" ]
This script captures the `-i` command, while still allowing `unittest.main` to do its own commandline parsing: ``` import unittest class Testclass(unittest.TestCase): @classmethod def setUpClass(cls): print "Hello Class" def test_addnum(self): print "Execute the test case" #parse...
You are running `unittest.main()` as the main program. So it's complaining rightfully that it does not know about the option you wrote: ``` "option -i not recognized" ``` If you want to create your own test suite launcher you should look into [TextTestRunner](https://docs.python.org/dev/library/unittest.html#unitte...
44,236,756
How do I scroll through a modal window that is created using Bootstrap's modal class? Generally we use the JavascriptExecutor and use the window.scroll/scrollBy method. But when I tried the same when a modal is popped up with long content, the scroll is happening in the actual webpage which is not focused. How do I scr...
2017/05/29
[ "https://Stackoverflow.com/questions/44236756", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2110723/" ]
Thanks hpaulj, your solution really helped me and I found one more solution for this problem. Hope it helps someone else facing the same issue. ``` import unittest import argparse import sys class Testclass(unittest.TestCase): @classmethod def setUpClass(cls): print "Hello Class" def test_addnum...
You are running `unittest.main()` as the main program. So it's complaining rightfully that it does not know about the option you wrote: ``` "option -i not recognized" ``` If you want to create your own test suite launcher you should look into [TextTestRunner](https://docs.python.org/dev/library/unittest.html#unitte...
44,236,756
How do I scroll through a modal window that is created using Bootstrap's modal class? Generally we use the JavascriptExecutor and use the window.scroll/scrollBy method. But when I tried the same when a modal is popped up with long content, the scroll is happening in the actual webpage which is not focused. How do I scr...
2017/05/29
[ "https://Stackoverflow.com/questions/44236756", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2110723/" ]
This script captures the `-i` command, while still allowing `unittest.main` to do its own commandline parsing: ``` import unittest class Testclass(unittest.TestCase): @classmethod def setUpClass(cls): print "Hello Class" def test_addnum(self): print "Execute the test case" #parse...
Thanks hpaulj, your solution really helped me and I found one more solution for this problem. Hope it helps someone else facing the same issue. ``` import unittest import argparse import sys class Testclass(unittest.TestCase): @classmethod def setUpClass(cls): print "Hello Class" def test_addnum...
17,069,514
We have two tables. ``` 1. information title body name title1 body1 author1 title2 body2 author1 title1 body1 author2 title1 body1 author3 2. interactions name favorited user_favorited_by author1 yes user1 author2 yes user1 author1 yes ...
2013/06/12
[ "https://Stackoverflow.com/questions/17069514", "https://Stackoverflow.com", "https://Stackoverflow.com/users/235532/" ]
Here is a JOIN that works: ``` SELECT DISTINCT user_favorited_by, a.name FROM information a JOIN interactions b ON a.name = b.name WHERE favorited = 'yes' ``` Since you only have 'name' to join on, you need DISTINCT, or you could GROUP BY selected fields to remove duplicate lines from your output. And her...
May I suggest: ``` select user_favorited_by, author from information a inner join interaction b on a.name = b.name where b.favorited = 'yes' ```
17,069,514
We have two tables. ``` 1. information title body name title1 body1 author1 title2 body2 author1 title1 body1 author2 title1 body1 author3 2. interactions name favorited user_favorited_by author1 yes user1 author2 yes user1 author1 yes ...
2013/06/12
[ "https://Stackoverflow.com/questions/17069514", "https://Stackoverflow.com", "https://Stackoverflow.com/users/235532/" ]
Here is a JOIN that works: ``` SELECT DISTINCT user_favorited_by, a.name FROM information a JOIN interactions b ON a.name = b.name WHERE favorited = 'yes' ``` Since you only have 'name' to join on, you need DISTINCT, or you could GROUP BY selected fields to remove duplicate lines from your output. And her...
I think the following should work ``` SELECT DISTINCT user_favorited_by, a.name FROM information a, interactions b WHERE a.name = b.name AND favorited = 'yes' ```
64,195,427
The following code compiles: ``` val collection = listOf("a", "b") val filter = { x: String -> x.isEmpty() } collection.filter(filter) ``` Is it possible to define the filter using a function interface? For example the following code doesn't compile: ``` fun interface MyFilter { fun execute(string: String): Bo...
2020/10/04
[ "https://Stackoverflow.com/questions/64195427", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4680812/" ]
You can inherit `MyFilter` from `(String) -> Boolean` ``` fun interface MyFilter : (String) -> Boolean fun main() { val collection = listOf("a", "b") val filter = MyFilter { x -> x.isEmpty() } val newCollection = collection.filter(filter) } ``` With your custom method: ``` fun interface MyFilter : (Str...
You can use **member reference** operator `::` to pass the function of interface by reference: ``` val collection = listOf("a", "b") val filter = MyFilter { x -> x.isEmpty() } collection.filter(filter::execute) fun interface MyFilter { fun execute(string: String): Boolean } ```
32,116,842
I have subroutine in my module which checks (regular) user password age using regex search on `shadow` file: **Module.pm** ``` my $pwdsetts_dump = "tmp/shadow_dump.txt"; system("cat /etc/shadow > $pwdsetts_dump"); open (my $fh1, "<", $pwdsetts_dump) or die "Could not open file '$pwdsetts_dump': $!"; sub CollectP...
2015/08/20
[ "https://Stackoverflow.com/questions/32116842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I've just run your regex against my `/etc/shadow` and got no matches. If I drop the leading `1` I get a few hits. E.g.: ``` $array =~ /^(\S+)[:][$]\S+[:]([0-9]{4})/ ``` But personally - I would suggest not trying to regex, and instead rely on the fact that [`/etc/shadow`](http://linux.die.net/man/5/shadow) is defi...
I think your regex pattern is the main problem. Don't forget that `\S` matches any non-space character including colons `:`, and `\S+` will try to match as much as possible so it will happily skip over multiple fields of the file I think using [`split`](http://perldoc.perl.org/functions/split.html) to separate each re...
67,366,685
I am running an Angular Application I am getting these popup in vs code whenever I am opening it. However, the ng serve command is working fine and it's serving(running) the app successfully. But I am getting this error in console. [![console error](https://i.stack.imgur.com/mX73o.png)](https://i.stack.imgur.com/mX73o...
2021/05/03
[ "https://Stackoverflow.com/questions/67366685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13975105/" ]
Angular Language Service Extension has one bug which is reported to their git repository. My solution will work for Angular Projects which is running < Version 9.0 To resolve this issue you have two ways. Solution 1: Downgrade extension version 1. Downgrade [https://marketplace.visualstudio.com/items?itemName=Angula...
it might be some version inconsistency problem. It was in my case. Had same symptoms: I opened a folder in Visual Studio Code and after few secons I got the same message, but also VSC did not recognize any of angular tags. On the other hand, it did run without problems on my other computer... I reinstalled VS, angula...
67,366,685
I am running an Angular Application I am getting these popup in vs code whenever I am opening it. However, the ng serve command is working fine and it's serving(running) the app successfully. But I am getting this error in console. [![console error](https://i.stack.imgur.com/mX73o.png)](https://i.stack.imgur.com/mX73o...
2021/05/03
[ "https://Stackoverflow.com/questions/67366685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13975105/" ]
Angular Language Service Extension has one bug which is reported to their git repository. My solution will work for Angular Projects which is running < Version 9.0 To resolve this issue you have two ways. Solution 1: Downgrade extension version 1. Downgrade [https://marketplace.visualstudio.com/items?itemName=Angula...
reinstall vscode extension Angular Language Service@v11.2.14 resolve my problem.