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
4,476,870
I want to find the fundamental units of $K = \mathbb{Q}(\sqrt[3]{12})$. The extension degree is $n = 3$, we have $r\_1 = 1$ real embedding and $2r\_2 = 2$ complex embeddings. So by Dirichlet's theorem, $\mathbb{Z}\_K^\times \cong \mu\_K \oplus \mathbb{Z}u$ where $\mathbb{Z}\_K$ is $K$'s ring of integers and $\mu\_K$ is...
2022/06/20
[ "https://math.stackexchange.com/questions/4476870", "https://math.stackexchange.com", "https://math.stackexchange.com/users/742733/" ]
To answer the first discrepancy with the textbook, note that $$\left( \frac{1 - \cos(2x)}{2} \right)^2 = \frac{1- 2 \cos(2x) + \cos^2(2x)}{4}$$ Hence the middle term indeed has a factor of $-1/2$. Textbooks are just as prone to errors as anything else, being made by humans; it happens. Not much one can do but contac...
I like to rewrite things so as to reduce errors; as $\sin^4 x$ is even of small degree (as a polynomial in $\sin, \cos$), it can be written in terms of $\cos 2 x$ and $\cos 4x.$ After that the integral is immediate, finally we may wish to expand that back into a polynolial in sine and cosine. First $$ \cos 2x = 2 \cos...
4,476,870
I want to find the fundamental units of $K = \mathbb{Q}(\sqrt[3]{12})$. The extension degree is $n = 3$, we have $r\_1 = 1$ real embedding and $2r\_2 = 2$ complex embeddings. So by Dirichlet's theorem, $\mathbb{Z}\_K^\times \cong \mu\_K \oplus \mathbb{Z}u$ where $\mathbb{Z}\_K$ is $K$'s ring of integers and $\mu\_K$ is...
2022/06/20
[ "https://math.stackexchange.com/questions/4476870", "https://math.stackexchange.com", "https://math.stackexchange.com/users/742733/" ]
To answer the first discrepancy with the textbook, note that $$\left( \frac{1 - \cos(2x)}{2} \right)^2 = \frac{1- 2 \cos(2x) + \cos^2(2x)}{4}$$ Hence the middle term indeed has a factor of $-1/2$. Textbooks are just as prone to errors as anything else, being made by humans; it happens. Not much one can do but contac...
An alternative approach: A complex variable identity reduces the problem to an exercise in the Binomial Theorem. $$\begin{align} \sin^4 x &= \left( \frac{1}{2i} (e^{ix}-e^{-ix})\right)^4 \\ &= \frac{1}{16} \left( e^{4ix} -4 e^{2ix} +6 -4 e^{-2ix} + e^{-4ix} \right) \end{align}$$ so $$\begin{align} \int \sin^4 x \;dx &...
4,476,870
I want to find the fundamental units of $K = \mathbb{Q}(\sqrt[3]{12})$. The extension degree is $n = 3$, we have $r\_1 = 1$ real embedding and $2r\_2 = 2$ complex embeddings. So by Dirichlet's theorem, $\mathbb{Z}\_K^\times \cong \mu\_K \oplus \mathbb{Z}u$ where $\mathbb{Z}\_K$ is $K$'s ring of integers and $\mu\_K$ is...
2022/06/20
[ "https://math.stackexchange.com/questions/4476870", "https://math.stackexchange.com", "https://math.stackexchange.com/users/742733/" ]
I like to rewrite things so as to reduce errors; as $\sin^4 x$ is even of small degree (as a polynomial in $\sin, \cos$), it can be written in terms of $\cos 2 x$ and $\cos 4x.$ After that the integral is immediate, finally we may wish to expand that back into a polynolial in sine and cosine. First $$ \cos 2x = 2 \cos...
An alternative approach: A complex variable identity reduces the problem to an exercise in the Binomial Theorem. $$\begin{align} \sin^4 x &= \left( \frac{1}{2i} (e^{ix}-e^{-ix})\right)^4 \\ &= \frac{1}{16} \left( e^{4ix} -4 e^{2ix} +6 -4 e^{-2ix} + e^{-4ix} \right) \end{align}$$ so $$\begin{align} \int \sin^4 x \;dx &...
50,493,160
Currently I am working on an application that needs to extract the innerHTML of Body and then take the text out of it in a JSON. That JSON will be used for translation and then the translated JSON will be used as input to create the same HTML markup but with translated text. Please see the snippet below. HTML Input --...
2018/05/23
[ "https://Stackoverflow.com/questions/50493160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9835171/" ]
You need to collect all values in a string variable and then set it. ``` String text = ""; for(int i=0;i<Queue.length;i++){ text += Queue.push()+" "; } JLabel.setText(text.trim()); ``` Probably it would be better to show it as HTML. So you can make the line-break ``` String text = "<html>"; for(int i=0;i<Queue.l...
You have to add the text to the existing text: ``` for(int i=0;i<Queue.length;i++){ JLabel.setText(JLabel.getText() + Queue.push()+ " "); } ``` Or you can store the data and set it to the JLabel at the end: ``` String s = ""; for(int i=0;i<Queue.length;i++){ s = (s + Queue.push() + " ") } JLabel.setText(s...
32,591,557
Is there any way to see if a command is currently being executed in the PyCharm console? Running an interactive python session in the terminal, after executing a command, the prompt disappears until execution has finished. For example when I call `time.sleep(5)`, it takes 5 seconds until the `>>>` appears again, so I ...
2015/09/15
[ "https://Stackoverflow.com/questions/32591557", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3392896/" ]
I've found the best way to do when using IPython is to the `%time` magic command whenever you need to run a long command. For details, see <https://ipython.org/ipython-doc/3/interactive/magics.html#magic-time> Usage: ``` In[1]: %time time.sleep(5) Wall time: 5 s ``` The second line will appear when the code finishe...
[This is resolved in the latest builds of PyCharm.](https://youtrack.jetbrains.com/issue/PY-15727)
2,615,596
I am writing a greasemonkey script. The site is using jquery, i need a function in a newer version. In my GM script i have ``` // @require http://ajax.microsoft.com/ajax/jQuery/jquery-1.3.2.min.js ... var $ = unsafeWindow.jQuery; ``` However after using alert($().jquery); i see it is still the old version. Ho...
2010/04/11
[ "https://Stackoverflow.com/questions/2615596", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You can do it the same way you can have your `create` and `edit` views showing the same form with a partial. \_tab.html.erb ``` <div class="tab" id="<%= tab.id %>"> <p>whatever</p> </div> ``` show.html.erb ``` <%= render 'tab', :tab => TabObject %> ``` show.js.erb ``` $('#tabs.').... $('something').append("<...
Loading JS dynamically can introduce all sorts of complexity that I think is often best avoided. I think it's better to load all of your JS at once in a single file on page load - this way you can have a single minified script request which facilitates caching and performance. Creating tabs can then trigger the appro...
41,740,804
This is quite frustrating. I was happily working on `Xcode` project and everything was working fine. All of sudden, when I again ran the project, got this error : > > Did not find storyboard named "MyStoryboard" referenced from > Main.storyboard > > > Haven't touched anything which should bring up this issue. Ra...
2017/01/19
[ "https://Stackoverflow.com/questions/41740804", "https://Stackoverflow.com", "https://Stackoverflow.com/users/541786/" ]
I also had this issue, and solved it by checking target from my ViewController. [![enter image description here](https://i.stack.imgur.com/GmaGj.jpg)](https://i.stack.imgur.com/GmaGj.jpg)
I had the same problem and I tried like you all the suggested solutions but it was not enough. My problem was the some of my storyboards were localized, and some others not. So by localizing all my storyboard it resolved the issue. I guess it's because it's now in the same folder.
41,740,804
This is quite frustrating. I was happily working on `Xcode` project and everything was working fine. All of sudden, when I again ran the project, got this error : > > Did not find storyboard named "MyStoryboard" referenced from > Main.storyboard > > > Haven't touched anything which should bring up this issue. Ra...
2017/01/19
[ "https://Stackoverflow.com/questions/41740804", "https://Stackoverflow.com", "https://Stackoverflow.com/users/541786/" ]
I had the same problem and I tried like you all the suggested solutions but it was not enough. My problem was the some of my storyboards were localized, and some others not. So by localizing all my storyboard it resolved the issue. I guess it's because it's now in the same folder.
I was able to solve this problem by making sure the Localization checks had a match between the two storyboards: [![Storyboard Localization](https://i.stack.imgur.com/VlH5g.png)](https://i.stack.imgur.com/VlH5g.png)
41,740,804
This is quite frustrating. I was happily working on `Xcode` project and everything was working fine. All of sudden, when I again ran the project, got this error : > > Did not find storyboard named "MyStoryboard" referenced from > Main.storyboard > > > Haven't touched anything which should bring up this issue. Ra...
2017/01/19
[ "https://Stackoverflow.com/questions/41740804", "https://Stackoverflow.com", "https://Stackoverflow.com/users/541786/" ]
I also had this issue, and solved it by checking target from my ViewController. [![enter image description here](https://i.stack.imgur.com/GmaGj.jpg)](https://i.stack.imgur.com/GmaGj.jpg)
If anyone stumbles across this in the future: the issue for me was that while I had moved/re-added/un-localized a Storyboard file, when it was re-imported it did not get added back to the main target of my app, so check that too.
41,740,804
This is quite frustrating. I was happily working on `Xcode` project and everything was working fine. All of sudden, when I again ran the project, got this error : > > Did not find storyboard named "MyStoryboard" referenced from > Main.storyboard > > > Haven't touched anything which should bring up this issue. Ra...
2017/01/19
[ "https://Stackoverflow.com/questions/41740804", "https://Stackoverflow.com", "https://Stackoverflow.com/users/541786/" ]
If anyone stumbles across this in the future: the issue for me was that while I had moved/re-added/un-localized a Storyboard file, when it was re-imported it did not get added back to the main target of my app, so check that too.
I was able to solve this problem by making sure the Localization checks had a match between the two storyboards: [![Storyboard Localization](https://i.stack.imgur.com/VlH5g.png)](https://i.stack.imgur.com/VlH5g.png)
41,740,804
This is quite frustrating. I was happily working on `Xcode` project and everything was working fine. All of sudden, when I again ran the project, got this error : > > Did not find storyboard named "MyStoryboard" referenced from > Main.storyboard > > > Haven't touched anything which should bring up this issue. Ra...
2017/01/19
[ "https://Stackoverflow.com/questions/41740804", "https://Stackoverflow.com", "https://Stackoverflow.com/users/541786/" ]
I also had this issue, and solved it by checking target from my ViewController. [![enter image description here](https://i.stack.imgur.com/GmaGj.jpg)](https://i.stack.imgur.com/GmaGj.jpg)
I was able to solve this problem by making sure the Localization checks had a match between the two storyboards: [![Storyboard Localization](https://i.stack.imgur.com/VlH5g.png)](https://i.stack.imgur.com/VlH5g.png)
73,359,179
I have an alphabets list: ``` alpha_list = ['a', 'b', 'c', 'd', 'e'] ``` For a given alphabet(considering it will always be present in alpha\_list) I want to get an alphabet whose index is garter by a given number, consider below function for example: ``` def get_replacing_letter(alphabet, number): index = alph...
2022/08/15
[ "https://Stackoverflow.com/questions/73359179", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10868312/" ]
You can make new index take the modulo of the length of the list: ``` return alpha_list[(index + number) % len(alpha_list)] ```
At the moment I achieved it by extending the alpha\_list with itself: ``` alpha_list.extend(alpha_list) ``` This way as index method gives first index of occurance, I could manage to get it working. However I am wondering if there is any better way to achieve this.
48,770,240
Im using BIML to dynamically create load packages for SSIS to load data from Informix to SQL Server. The problem is that this BIML code produces the SQL below ``` <DirectInput>SELECT <#=table.GetColumnList()#> FROM <#=table.GetTag("SourceSchemaQualifiedName")#></DirectInput> SELECT [column1], [column2], [column3], FR...
2018/02/13
[ "https://Stackoverflow.com/questions/48770240", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1810355/" ]
You should be able to use the overloaded method of [GetColumnList](https://www.varigence.com/Documentation/Api/Method/AstTableNode/GetColumnList(String%2CString%2CString)) ``` <#=table.GetColumnList(string.Empty, "\"", "\"")#> ``` which should produce a double quote wrapped column name with no table alias - which I...
This works for both column names and table name: ``` <OdbcSource Name="Data from informix" Connection="Source_Informix"> <DirectInput>SELECT <#=table.GetColumnList(string.Empty, "", "")#> FROM schema.<#=table.Name#></DirectInput> </OdbcSource>...
41,187,175
I am trying to test an application on standalone cluster. Here is my scenario. I started a spark master on a node A and also 1 worker on the same node A. I am trying to run the application from node B(this means I think this acts as driver). I have added jars to the sparkconf using setJars("jar1","jar2") When I star...
2016/12/16
[ "https://Stackoverflow.com/questions/41187175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7307306/" ]
I have also faces this type of weird behaviors with cakePhp 3.x.I manage to solve this problem. **Below is the code to solve the asked question** ``` $validator ->notEmpty('company_name', 'Prename and lastname OR company name must be set.', function ($context){ if((!empty($context['data...
We have the following code running in production, which is much alike yours: ``` $validator ->add('various_fee_text', 'custom', [ 'rule' => [$this, 'variousFieldsChecker'], 'message' => __('Udfyld både Tekst og DKK feltet'), ]) ->allowEmpty('various_fee_text'); ``` Vaildation rule: ``` /...
41,187,175
I am trying to test an application on standalone cluster. Here is my scenario. I started a spark master on a node A and also 1 worker on the same node A. I am trying to run the application from node B(this means I think this acts as driver). I have added jars to the sparkconf using setJars("jar1","jar2") When I star...
2016/12/16
[ "https://Stackoverflow.com/questions/41187175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7307306/" ]
The provided answers all did not work 100%, so I am going to post what I have come up with. I am using [conditional validation](http://book.cakephp.org/3.0/en/core-libraries/validation.html#conditional-validation) as described in the CakePHP 3 docs. **CustomersTable.php:** ``` public function validationDefault(Valida...
We have the following code running in production, which is much alike yours: ``` $validator ->add('various_fee_text', 'custom', [ 'rule' => [$this, 'variousFieldsChecker'], 'message' => __('Udfyld både Tekst og DKK feltet'), ]) ->allowEmpty('various_fee_text'); ``` Vaildation rule: ``` /...
41,187,175
I am trying to test an application on standalone cluster. Here is my scenario. I started a spark master on a node A and also 1 worker on the same node A. I am trying to run the application from node B(this means I think this acts as driver). I have added jars to the sparkconf using setJars("jar1","jar2") When I star...
2016/12/16
[ "https://Stackoverflow.com/questions/41187175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7307306/" ]
I have also faces this type of weird behaviors with cakePhp 3.x.I manage to solve this problem. **Below is the code to solve the asked question** ``` $validator ->notEmpty('company_name', 'Prename and lastname OR company name must be set.', function ($context){ if((!empty($context['data...
For this CakePhp provide create custom validation. You need to create two validation function on your model class and call them conditionally on controller function. You can create validation function like as ``` public function validationName($validator){ $validator ->requirePresence('prename') ...
41,187,175
I am trying to test an application on standalone cluster. Here is my scenario. I started a spark master on a node A and also 1 worker on the same node A. I am trying to run the application from node B(this means I think this acts as driver). I have added jars to the sparkconf using setJars("jar1","jar2") When I star...
2016/12/16
[ "https://Stackoverflow.com/questions/41187175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7307306/" ]
The provided answers all did not work 100%, so I am going to post what I have come up with. I am using [conditional validation](http://book.cakephp.org/3.0/en/core-libraries/validation.html#conditional-validation) as described in the CakePHP 3 docs. **CustomersTable.php:** ``` public function validationDefault(Valida...
For this CakePhp provide create custom validation. You need to create two validation function on your model class and call them conditionally on controller function. You can create validation function like as ``` public function validationName($validator){ $validator ->requirePresence('prename') ...
41,187,175
I am trying to test an application on standalone cluster. Here is my scenario. I started a spark master on a node A and also 1 worker on the same node A. I am trying to run the application from node B(this means I think this acts as driver). I have added jars to the sparkconf using setJars("jar1","jar2") When I star...
2016/12/16
[ "https://Stackoverflow.com/questions/41187175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7307306/" ]
The provided answers all did not work 100%, so I am going to post what I have come up with. I am using [conditional validation](http://book.cakephp.org/3.0/en/core-libraries/validation.html#conditional-validation) as described in the CakePHP 3 docs. **CustomersTable.php:** ``` public function validationDefault(Valida...
I have also faces this type of weird behaviors with cakePhp 3.x.I manage to solve this problem. **Below is the code to solve the asked question** ``` $validator ->notEmpty('company_name', 'Prename and lastname OR company name must be set.', function ($context){ if((!empty($context['data...
50,061,638
In my CloudFormation template, I am having 78 parameters. That is why I am getting an error because we cannot have more than 60 parameters. I wanted to club some of my parameters into map. Has anyone done this? I am not getting a proper example of how to have parameters in a map then use them in CF template.
2018/04/27
[ "https://Stackoverflow.com/questions/50061638", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6656693/" ]
I don't think you can use a `Map` as a parameter type. But you can use a [`CommaDelimitedList`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html#aws-specific-parameter-types) instead? 78 paramaters seems to be a lot, can't you use any of the `Mappings`/`Conditions` secti...
Following the [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/mappings-section-structure.html) The maps are defined like this: ``` "RegionMap" : { "us-east-1" : { "32" : "ami-6411e20d", "64" : "ami-7a11e213" }, "us-west-1" : { "32" : "ami-c9c7978c", "64" : "ami-cfc7978...
9,745,899
So basically I have two classes, **Book** and **Author**. Books can have multiple authors and authors can have multiple books. Books have the following default scope. ``` default_scope :order => "publish_at DESC" ``` On the Author show page I want to list all the books associated with that author so I say the follow...
2012/03/16
[ "https://Stackoverflow.com/questions/9745899", "https://Stackoverflow.com", "https://Stackoverflow.com/users/834216/" ]
You should be able to use [`reorder`](http://api.rubyonrails.org/classes/ActiveRecord/QueryMethods.html#method-i-reorder) to completely replace the existing ORDER BY: > > **reorder(\*args)** > > Replaces any existing order defined on the relation with the specified order. > > > So something like this: ``` de...
You can do it without losing `default_scope` or other ordering ``` @books.order_values.prepend 'popularity ASC' ```
5,444,814
I am fairly new to C#, but I'm trying to write a program. For said program, I need to have multiple windows inside of the ClientBounds. <http://videoproductiontips.com/video-editing/editing-computers-and-video-editing-software/> As you can see in the link, this program is split into several different sections that a...
2011/03/26
[ "https://Stackoverflow.com/questions/5444814", "https://Stackoverflow.com", "https://Stackoverflow.com/users/678334/" ]
If i understood you correctly all you need to do is to add a new form (right click on the project, add > new item > windows form (or something like that)) And then make a button in your original form and in his event type Form2 myform = new Form2(); myform.Show(); (when form2 is the name of your second form)
Check this [link out as a starting point](http://www.codeproject.com/KB/WPF/WPFdockinglib.aspx). You are looking for "Docking" windows. I'm assuming you're using WPF. If not, do a search for > > Docking Windows WinForms > > > for more information.
5,444,814
I am fairly new to C#, but I'm trying to write a program. For said program, I need to have multiple windows inside of the ClientBounds. <http://videoproductiontips.com/video-editing/editing-computers-and-video-editing-software/> As you can see in the link, this program is split into several different sections that a...
2011/03/26
[ "https://Stackoverflow.com/questions/5444814", "https://Stackoverflow.com", "https://Stackoverflow.com/users/678334/" ]
If i understood you correctly all you need to do is to add a new form (right click on the project, add > new item > windows form (or something like that)) And then make a button in your original form and in his event type Form2 myform = new Form2(); myform.Show(); (when form2 is the name of your second form)
Docking is what you're looking for I think? If you're using WPF and searching for docking options, try [Avalon Dock](http://avalondock.codeplex.com/). It's open source and pretty easy to incorporate than most other docking libraries I've tried. In fact, I've used it and would recommend it too. :)
38,486,923
If I have 2 items with 1-1 strong dependency then one is an attribute i.e. column in the other one's table. E.g. if we have a movie database and each movie must have a review score (*review score is a number that represents the average score from X number of viewers*) and each review score belongs to a movie then th...
2016/07/20
[ "https://Stackoverflow.com/questions/38486923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1197249/" ]
You can use the [General Sibling Selector](https://www.sitepoint.com/web-foundations/general-sibling-selector-css-selector/) `~` selector instead of the [Adjacent Sibling Selector](https://www.sitepoint.com/web-foundations/adjacent-sibling-selector-css-selector/) `+` selector, like this: ``` #hover:hover ~ #squash { ...
Please try this ``` <h1 id="hover">Hover over me</h1> <img id="squash" src="http://askflorine.com/wp-content/uploads/2013/10/temp_quash.jpg" width="100%"> #squash { display: none; } #hover:hover ~ #squash { display: block; } ```
38,486,923
If I have 2 items with 1-1 strong dependency then one is an attribute i.e. column in the other one's table. E.g. if we have a movie database and each movie must have a review score (*review score is a number that represents the average score from X number of viewers*) and each review score belongs to a movie then th...
2016/07/20
[ "https://Stackoverflow.com/questions/38486923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1197249/" ]
You can use the [General Sibling Selector](https://www.sitepoint.com/web-foundations/general-sibling-selector-css-selector/) `~` selector instead of the [Adjacent Sibling Selector](https://www.sitepoint.com/web-foundations/adjacent-sibling-selector-css-selector/) `+` selector, like this: ``` #hover:hover ~ #squash { ...
Depends on what you put in between the 2 parts. If text encase squash inside the ``` <p> text here <div id="squash"...> </div> </p> ``` Then css changes to ``` #hover:hover + p #squash { ```
38,486,923
If I have 2 items with 1-1 strong dependency then one is an attribute i.e. column in the other one's table. E.g. if we have a movie database and each movie must have a review score (*review score is a number that represents the average score from X number of viewers*) and each review score belongs to a movie then th...
2016/07/20
[ "https://Stackoverflow.com/questions/38486923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1197249/" ]
Please try this ``` <h1 id="hover">Hover over me</h1> <img id="squash" src="http://askflorine.com/wp-content/uploads/2013/10/temp_quash.jpg" width="100%"> #squash { display: none; } #hover:hover ~ #squash { display: block; } ```
Depends on what you put in between the 2 parts. If text encase squash inside the ``` <p> text here <div id="squash"...> </div> </p> ``` Then css changes to ``` #hover:hover + p #squash { ```
56,843,205
So the output of my webpage currently looks like this: ``` FOLDER1 images/FOLDER1/folder1_img.jpg images/FOLDER2/folder2_img.jpg images/FOLDER3/folder3_img.jpg FOLDER2 images/FOLDER2/folder2_img.jpg images/FOLDER3/folder3_img.jpg FOLDER3 images/FOLDER3/folder3_img.jpg ``` But what I want to achieve is this: ``` F...
2019/07/01
[ "https://Stackoverflow.com/questions/56843205", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11564873/" ]
wasn't able to test everything completely, but the idea is that instead iterating through the folders in php, we instead store them as a global variable in javascript. we then create function that will take a number as an index to get the folder name from the folders array and will make the javascript call to get the ...
If all your images are named like the example, probably these changes in your script solve your problem: ``` <script> var floder = '<?php echo $item; ?>'; var path = `images/${folder}/`; $.ajax({ async: false, url : path, success: function (data) { $(data).find("a").a...
9,702,032
We normally use abstract function/Interfaces in our projects. Why it is really needed? Why can't we just go for Business logic Layer, Data Access Layer and Presentation Layer only **Function in Presentation Layer:** ``` abc(); ``` --- **Function in Business Logic Layer:** ``` public void abc() { //Prep...
2012/03/14
[ "https://Stackoverflow.com/questions/9702032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/726802/" ]
The easiest way to understand this, imo, is an abstraction over `DataLayer`. You have set a functions to retrieve a data from `xml` file. But one day your product scales out and `xml` is not enough like a data storage. So you pass to some embeded database: `sqlite`. But one day you need to reuse your library in some e...
The abstraction helps create functionality, be it through a base class, an interface, or composition which, when used properly, does wonders for maintenance, readability, and reusability of code. In regards to the code posted in the question, the code marked "Data Access Layer" acts as a common abstraction for the bus...
9,702,032
We normally use abstract function/Interfaces in our projects. Why it is really needed? Why can't we just go for Business logic Layer, Data Access Layer and Presentation Layer only **Function in Presentation Layer:** ``` abc(); ``` --- **Function in Business Logic Layer:** ``` public void abc() { //Prep...
2012/03/14
[ "https://Stackoverflow.com/questions/9702032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/726802/" ]
The abstract class or interface is not really a separate layer - it should be part of your business logic layer and it defines the interface that the actual data access layer (SQL data repository, for example) needs to implement to provide the data access service to your business layer. Without this interface your bus...
All of the previous answers may explain the needs of abstract layers, but I still want to add some of my thoughts. Let's say that in our project we just have one implementation of a service in each layer. For instance, I have a contact DAL and a contact BLL service , and we could do something like this ``` namespace ...
9,702,032
We normally use abstract function/Interfaces in our projects. Why it is really needed? Why can't we just go for Business logic Layer, Data Access Layer and Presentation Layer only **Function in Presentation Layer:** ``` abc(); ``` --- **Function in Business Logic Layer:** ``` public void abc() { //Prep...
2012/03/14
[ "https://Stackoverflow.com/questions/9702032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/726802/" ]
Generally, if you use interfaces in your code, then you will gain code manuverability in the form of Dependency Injection. This will help you replace parts of your implementation in certain situations for example providing Mock objects during Unit Testing.
All of the previous answers may explain the needs of abstract layers, but I still want to add some of my thoughts. Let's say that in our project we just have one implementation of a service in each layer. For instance, I have a contact DAL and a contact BLL service , and we could do something like this ``` namespace ...
9,702,032
We normally use abstract function/Interfaces in our projects. Why it is really needed? Why can't we just go for Business logic Layer, Data Access Layer and Presentation Layer only **Function in Presentation Layer:** ``` abc(); ``` --- **Function in Business Logic Layer:** ``` public void abc() { //Prep...
2012/03/14
[ "https://Stackoverflow.com/questions/9702032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/726802/" ]
Why interfaces : Have you ever used **using** in c# : using (Form f = new Form()) { } Here you will see that you can use only those classes inside **using** which implements IDisposable interface . Two things which does not know each other can interact with each other using Interfaces only. Interface gurantees ...
I think you are talking about Facade layer. It is an **optional layer** which will simplify the functions of Business Layer. Let's imagine, you have a ProductManager and CategoryManager and you want to do a particular action which involves using both (for example, get me top 5 products in all categories) then you cou...
9,702,032
We normally use abstract function/Interfaces in our projects. Why it is really needed? Why can't we just go for Business logic Layer, Data Access Layer and Presentation Layer only **Function in Presentation Layer:** ``` abc(); ``` --- **Function in Business Logic Layer:** ``` public void abc() { //Prep...
2012/03/14
[ "https://Stackoverflow.com/questions/9702032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/726802/" ]
The easiest way to understand this, imo, is an abstraction over `DataLayer`. You have set a functions to retrieve a data from `xml` file. But one day your product scales out and `xml` is not enough like a data storage. So you pass to some embeded database: `sqlite`. But one day you need to reuse your library in some e...
Why interfaces : Have you ever used **using** in c# : using (Form f = new Form()) { } Here you will see that you can use only those classes inside **using** which implements IDisposable interface . Two things which does not know each other can interact with each other using Interfaces only. Interface gurantees ...
9,702,032
We normally use abstract function/Interfaces in our projects. Why it is really needed? Why can't we just go for Business logic Layer, Data Access Layer and Presentation Layer only **Function in Presentation Layer:** ``` abc(); ``` --- **Function in Business Logic Layer:** ``` public void abc() { //Prep...
2012/03/14
[ "https://Stackoverflow.com/questions/9702032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/726802/" ]
The abstract class or interface is not really a separate layer - it should be part of your business logic layer and it defines the interface that the actual data access layer (SQL data repository, for example) needs to implement to provide the data access service to your business layer. Without this interface your bus...
I think you are talking about Facade layer. It is an **optional layer** which will simplify the functions of Business Layer. Let's imagine, you have a ProductManager and CategoryManager and you want to do a particular action which involves using both (for example, get me top 5 products in all categories) then you cou...
9,702,032
We normally use abstract function/Interfaces in our projects. Why it is really needed? Why can't we just go for Business logic Layer, Data Access Layer and Presentation Layer only **Function in Presentation Layer:** ``` abc(); ``` --- **Function in Business Logic Layer:** ``` public void abc() { //Prep...
2012/03/14
[ "https://Stackoverflow.com/questions/9702032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/726802/" ]
The abstract class or interface is not really a separate layer - it should be part of your business logic layer and it defines the interface that the actual data access layer (SQL data repository, for example) needs to implement to provide the data access service to your business layer. Without this interface your bus...
The abstraction helps create functionality, be it through a base class, an interface, or composition which, when used properly, does wonders for maintenance, readability, and reusability of code. In regards to the code posted in the question, the code marked "Data Access Layer" acts as a common abstraction for the bus...
9,702,032
We normally use abstract function/Interfaces in our projects. Why it is really needed? Why can't we just go for Business logic Layer, Data Access Layer and Presentation Layer only **Function in Presentation Layer:** ``` abc(); ``` --- **Function in Business Logic Layer:** ``` public void abc() { //Prep...
2012/03/14
[ "https://Stackoverflow.com/questions/9702032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/726802/" ]
Generally, if you use interfaces in your code, then you will gain code manuverability in the form of Dependency Injection. This will help you replace parts of your implementation in certain situations for example providing Mock objects during Unit Testing.
The abstraction helps create functionality, be it through a base class, an interface, or composition which, when used properly, does wonders for maintenance, readability, and reusability of code. In regards to the code posted in the question, the code marked "Data Access Layer" acts as a common abstraction for the bus...
9,702,032
We normally use abstract function/Interfaces in our projects. Why it is really needed? Why can't we just go for Business logic Layer, Data Access Layer and Presentation Layer only **Function in Presentation Layer:** ``` abc(); ``` --- **Function in Business Logic Layer:** ``` public void abc() { //Prep...
2012/03/14
[ "https://Stackoverflow.com/questions/9702032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/726802/" ]
Generally, if you use interfaces in your code, then you will gain code manuverability in the form of Dependency Injection. This will help you replace parts of your implementation in certain situations for example providing Mock objects during Unit Testing.
The abstract class or interface is not really a separate layer - it should be part of your business logic layer and it defines the interface that the actual data access layer (SQL data repository, for example) needs to implement to provide the data access service to your business layer. Without this interface your bus...
9,702,032
We normally use abstract function/Interfaces in our projects. Why it is really needed? Why can't we just go for Business logic Layer, Data Access Layer and Presentation Layer only **Function in Presentation Layer:** ``` abc(); ``` --- **Function in Business Logic Layer:** ``` public void abc() { //Prep...
2012/03/14
[ "https://Stackoverflow.com/questions/9702032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/726802/" ]
The easiest way to understand this, imo, is an abstraction over `DataLayer`. You have set a functions to retrieve a data from `xml` file. But one day your product scales out and `xml` is not enough like a data storage. So you pass to some embeded database: `sqlite`. But one day you need to reuse your library in some e...
Abstraction enables you to do refactoring quickly. Think of instead of using SQL server, you decide to use some other provider; if you do not have a data access layer, then you to do a huge refactor because you are calling data access methods directly. But if you have a data access layer, you only write a new data acce...
65,336,955
my current branch is staging\_kei20201211, I want to fetch the latest code from origin/staging branch, I type the following command ``` git fetch origin staging ``` and it said [![fetch output](https://i.stack.imgur.com/EaUNB.jpg)](https://i.stack.imgur.com/EaUNB.jpg) 1) then I go to visual studio to see the histor...
2020/12/17
[ "https://Stackoverflow.com/questions/65336955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1169587/" ]
As the [comment by @Thomas](https://stackoverflow.com/questions/65336932/how-to-use-split-array-in-java#comment115509420_65336932) wisely suggests above, a good [CSV](https://en.wikipedia.org/wiki/Comma-separated_values) parser which can be instructed that double quote is an escape character is probably the best way to...
```java String data = "12-Jan,TRSF E-BANKING CR 12/01 95031 NABUNG" + " M1 DES AGUS JENI ,0,\"50,000.00 CR\",\"3,583,090.00\" "; // any sequence of characters // between quotes, or a single comma String pattern = "\".*?\"|,+"; String[] arr1 = data // append substrings that matches the given ...
8,335,499
I'm setting up my visual studio project to use CMake, but I got two issues I haven't been able to solve yet. 1 How can I set a preprocessor define for Release and another for Debug? 2 I have a project with opengl and directx so for DebugOpenGL and ReleaseOpenGL i want to exclude all directx cpp/h files from the buld....
2011/12/01
[ "https://Stackoverflow.com/questions/8335499", "https://Stackoverflow.com", "https://Stackoverflow.com/users/912403/" ]
``` if(CMAKE_BUILD_TYPE STREQUAL "Debug") add_definitions(/DYOURDEFINITION) endif() ``` won't work within an MSVS multi-config solution context. For that you need ``` set(MY_DEFINITION $<$<CONFIG:Debug>:definition_for_debug> $<$<CONFIG:RelWithDebInfo>:definition_for_rel_with_debug> $<$<CONFIG:Release...
1: ``` if(CMAKE_BUILD_TYPE STREQUAL "Debug") add_definitions(/DYOURDEFINITION) endif() ``` 2: If i understood you right, you need to create an option variable ``` option(USE_OPENGL "Use OpenGL or DirectX") ``` And then check for it when you are adding new target: ``` if(USE_OPENGL) add_subdirectory(OpenGL) els...
8,335,499
I'm setting up my visual studio project to use CMake, but I got two issues I haven't been able to solve yet. 1 How can I set a preprocessor define for Release and another for Debug? 2 I have a project with opengl and directx so for DebugOpenGL and ReleaseOpenGL i want to exclude all directx cpp/h files from the buld....
2011/12/01
[ "https://Stackoverflow.com/questions/8335499", "https://Stackoverflow.com", "https://Stackoverflow.com/users/912403/" ]
> > 1. How can I set a preprocessor define for Release and another for Debug? > > > The proper way to do this is to set the COMPILE\_DEFINITIONS property at the correct scope using generator expressions. If you want to add definitions to all targets like `add_definitions()` does then use: ``` set_property(DIRE...
1: ``` if(CMAKE_BUILD_TYPE STREQUAL "Debug") add_definitions(/DYOURDEFINITION) endif() ``` 2: If i understood you right, you need to create an option variable ``` option(USE_OPENGL "Use OpenGL or DirectX") ``` And then check for it when you are adding new target: ``` if(USE_OPENGL) add_subdirectory(OpenGL) els...
8,335,499
I'm setting up my visual studio project to use CMake, but I got two issues I haven't been able to solve yet. 1 How can I set a preprocessor define for Release and another for Debug? 2 I have a project with opengl and directx so for DebugOpenGL and ReleaseOpenGL i want to exclude all directx cpp/h files from the buld....
2011/12/01
[ "https://Stackoverflow.com/questions/8335499", "https://Stackoverflow.com", "https://Stackoverflow.com/users/912403/" ]
> > 1. How can I set a preprocessor define for Release and another for Debug? > > > The proper way to do this is to set the COMPILE\_DEFINITIONS property at the correct scope using generator expressions. If you want to add definitions to all targets like `add_definitions()` does then use: ``` set_property(DIRE...
``` if(CMAKE_BUILD_TYPE STREQUAL "Debug") add_definitions(/DYOURDEFINITION) endif() ``` won't work within an MSVS multi-config solution context. For that you need ``` set(MY_DEFINITION $<$<CONFIG:Debug>:definition_for_debug> $<$<CONFIG:RelWithDebInfo>:definition_for_rel_with_debug> $<$<CONFIG:Release...
31,724
Most large airplanes flying today are mostly metal, which has a relatively big coefficient of thermal expansion. Cruising altitudes of commercial jets can reach 10 km or more, where the air gets down to about -50 Celsius. Room temperature is more like +25 Celsius, and I would not be surprised if that large fuselage, si...
2016/09/22
[ "https://aviation.stackexchange.com/questions/31724", "https://aviation.stackexchange.com", "https://aviation.stackexchange.com/users/3674/" ]
Not thermal contraction but condensation of vapor is a problem. Immediately, [fuselage pressurization](https://aviation.stackexchange.com/questions/15779/why-do-airplanes-have-curved-windows) is the far bigger problem that comes with the altitude changes. But if you operate in hot and moist weather, the moisture in al...
The temperature range the aicraft is dealing with is actually smaller. Indeed, airliners cruise around Mach 0.85, but the velocity on the fuselage is zero. Hence a part of air kinetic energy is transfered into thermal energy. This is called the ram effect. You can find tables that give you the stagnation temperature as...
222,159
I am currently using the MSP430FR4133 in order to make an ultrasonic measurement system for the volume of a room and would like to be able to check the temperature of a room to work out the speed of sound before I carry out any calculations. I am trying to use the code in the "Out-the-Box Software Example" that uses t...
2016/03/02
[ "https://electronics.stackexchange.com/questions/222159", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/106186/" ]
The variable `tempSensorRunning` is set to 1 in the line: `*tempSensorRunning = 1;` and never (at least in this code) cleared to 0, so that's where your infinite loop comes from. This device is a 16-bit MCU, so `int` in this case is 16-bits long. In any case, this is confusing, so to be sure you're using the correct...
I assume the warning comes from this line: ``` volatile int *degC = &BAKMEM5; ``` Apparently BAKMEM5 is a short, not an int. The way to correct it is to change the type of degC to `volatile short *`. This fix may have ripple effects. You have to use the right types consistently. This is likely an actual bug and not...
3,231,209
The Lebesgue measure $\lambda^1$ is defined on generators $(a,b]$ of the Borel-sigma algebra as $b-a$. How does this explain $$\lambda^1(\{x\})=0$$ for all real $x$? I can not write this one-element set in the form $(a,b]$.
2019/05/19
[ "https://math.stackexchange.com/questions/3231209", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Consider the intervals $I\_n:=\left(x-\frac{1}{n},x\right]$. Clearly, $\{x\}\subseteq I\_n$ for all $n\in\mathbb{N}$. Then, by monotony $$0\le\lambda^1(\{x\})\le\lambda^1(I\_n)=x-\left(x-\frac{1}{n}\right)=\frac{1}{n}.$$ Since this holds for every $n\in\mathbb{N}$, we must have $\lambda^1(\{x\})=0$. Now, if you want to...
As far as I am concerned, the easiest way to prove that a set $S$ has measure zero is to prove that for each $\varepsilon\in\mathbb{R}\_{++}$, we have $\lambda^1(S)\leq\varepsilon$. In your case, it suffices to note that $\{x\}\subseteq [x-\frac{\varepsilon}{2},x+\frac{\varepsilon}{2}]$ for each $\varepsilon\in\mathbb...
1,619,902
Going through Larson's *Problem Solving Through Problems*, I am asked to give a geometric interpretation of the result below. I have been sketching it, and only got so far as to note that there must be a local minimum or maximum at $c$, although I cannot get very much further then that. Let $f$ be differentiable with...
2016/01/20
[ "https://math.stackexchange.com/questions/1619902", "https://math.stackexchange.com", "https://math.stackexchange.com/users/295394/" ]
The other cases are just not of interest to get the contradiction, they still exist. Assume $$ \frac{f(x)-f(c)}{x-c}>ε\text{ for }|x-c|<δ $$ Then for $x>c$ we get $x-c>0$ so that the inequality can be transformed as $$ f(x)-f(c)>ε·(x-c)>0 $$ which gives the contradiction. On the other hand, $x<c$ results in $(x-c)<0$...
Neighbourhoods in the usual topology of the real numbers extend on both sides of the point of which they are a neighbourhood. The neighbourhood $V\_\delta$ must contain elements $x$ that are greater than $c$ and these elements lead to a contradiction. So the contradiction follows from the established fact that such a...
28,041
I know that there is one place where we can actually maintain our keyword in Joomla Global Configuration-> Metadata Settings -> Site Meta Keywords, but is more like a place to dump all keyword of our website. Is it possible for us to maintain our keyword by each page? Will there be any effect on SEO?
2020/05/12
[ "https://joomla.stackexchange.com/questions/28041", "https://joomla.stackexchange.com", "https://joomla.stackexchange.com/users/14095/" ]
Yes you can. Joomla! provides a mechanism that starts from the general to the particular, the metadata management is a clear example, let me explain you how this works: * The small modular part here is the article. If you go to each one, inside you have this option in the tab called **"Publishing"**, this replace the ...
Effect would be normal SEO effect for metadata on a web page, nothing special above that. Every menu item has a metadata tab, and every content item has a place for metadata on the Publishing tab. You can use those for page-specific keys. IIRC, the menu item one overrides the content item one, but I'll leave testing t...
62,522,624
I'm trying to create an invoice that will generate data from related tables, but I'm not sure how to proceed. In essence, an `Invoice` instance should capture logged hours found in a `Timesheet` model and be multiplied by a rate found in another table (`ProjectUser`) I have attached what the database schema looks like:...
2020/06/22
[ "https://Stackoverflow.com/questions/62522624", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7264422/" ]
If I understand what you are trying to do, would something like this work?: ``` cost_data = [] grand_total = 0.00 for user_timesheet in Timesheet.objects.filter(week=1).all(): # or whatever date range you want, etc. # you can optimize this by joining the Timesheet and ProjectUser queries as an alternative pro...
A simple, and easy to read answer would be to make multiple database calls (equal to number of users in a project + 1) to get the overall result. For this, you can do the following * Make a DB Join of `Project` and `ProjectUser` table over `project_id`, so you will get all users in project, all their `per_hour` cost....
59,721,890
I have learned that, JavaScript is always single-threaded. If you're executing a JavaScript block of code on a page then no other JavaScript on that page will currently be executed. If this is the case then how Javascript manage Ajax call? If a single thread is busy and currently executing other Javascript on that page...
2020/01/13
[ "https://Stackoverflow.com/questions/59721890", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12619068/" ]
The javascript *engine* itself is single threaded, but javascript executes in a **hosting environment** that includes more than just the js engine. A hosting environment would be something such as a browser, a server, etc. Within the hosting environment is something called an event loop. This event loop manages when c...
JavaScript is actually single threaded because every JavaScript code will run in a single thread (that's not true anymore in the modern web because [Web workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers) allow JavaScript code to run in separate threads, though). That means ther...
59,721,890
I have learned that, JavaScript is always single-threaded. If you're executing a JavaScript block of code on a page then no other JavaScript on that page will currently be executed. If this is the case then how Javascript manage Ajax call? If a single thread is busy and currently executing other Javascript on that page...
2020/01/13
[ "https://Stackoverflow.com/questions/59721890", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12619068/" ]
The javascript *engine* itself is single threaded, but javascript executes in a **hosting environment** that includes more than just the js engine. A hosting environment would be something such as a browser, a server, etc. Within the hosting environment is something called an event loop. This event loop manages when c...
JavaScript is single-threaded with respect to the code that is executed within one context. So in a JavaScrip Engine code of the same context cannot run in parallel. You can have multiple contexts running in parallel (like WebWorkers), but different contexts cannot share objects (or only in a clearly define and limited...
59,721,890
I have learned that, JavaScript is always single-threaded. If you're executing a JavaScript block of code on a page then no other JavaScript on that page will currently be executed. If this is the case then how Javascript manage Ajax call? If a single thread is busy and currently executing other Javascript on that page...
2020/01/13
[ "https://Stackoverflow.com/questions/59721890", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12619068/" ]
JavaScript is single-threaded with respect to the code that is executed within one context. So in a JavaScrip Engine code of the same context cannot run in parallel. You can have multiple contexts running in parallel (like WebWorkers), but different contexts cannot share objects (or only in a clearly define and limited...
JavaScript is actually single threaded because every JavaScript code will run in a single thread (that's not true anymore in the modern web because [Web workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers) allow JavaScript code to run in separate threads, though). That means ther...
28,119,411
i'm writing a script that generates random data. i have two tables, one that stores first names, and second that stores surnames. i want to get e.g. 1000 random pairs of first name and surname. i can achieve it using following code: ``` with x as ( select top 1000 f.firstName from dbo.firstNames f order by new...
2015/01/23
[ "https://Stackoverflow.com/questions/28119411", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1665729/" ]
If you want 1000 random pairs then 32 from each table should suffice (32\*32=1024): ``` WITH f1 AS ( SELECT TOP 32 firstName FROM dbo.firstName ORDER BY newid() ), s1 AS SELECT TOP 32 surName FROM dbo.surName ORDER BY newid() ) SELECT f1.firstName, s1.surName FROM f1 CROSS JOIN s1; ``` If that's not random...
You could do the randomization *after* the cross join: ``` select top 1000 fn.firstname, sn.surname from firstnames fn cross join surnames sn order by newid(); ``` I'm the first to admit that the problem with this approach is performance, but it does work in theory. And performance is probably fine if the table...
35,815,927
I created a project that uses Web API. I want to have the controller a constructor that accepts one argument for contsructor injection. In startup, I added this: **Startup.cs:** ``` public class Startup { // Other codes ommitted public void ConfigureServices(IServiceCollection services) { // Othe...
2016/03/05
[ "https://Stackoverflow.com/questions/35815927", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3591953/" ]
Something is not right with what you are showing. To add your own transient service to your controller: * Define your interface * Define your class implementing your interface * Add `services.AddTransient<IYourInterface, YourClass>();` to `ConfigureServices` in *Startup.cs* * Add a constructor to your controller that...
Try putting FromServicesAttribute, for example: ``` public ValuesController([FromServices]IStudentDataAccess studentDataAccess) { _studentDataAccess = studentDataAccess; } ``` this worked for me :)
26,529,652
Simple question, hard answer to find. So I have 3 div's. ``` <div style="position: relative;" class="div-1"> <div style="position: relative;" class="div-2"> <div style="position: absolute;" class="div-3"> Target Div-1's position relative. </div> </div> ...
2014/10/23
[ "https://Stackoverflow.com/questions/26529652", "https://Stackoverflow.com", "https://Stackoverflow.com/users/366758/" ]
The [**MDN's docs on POSITION**](https://developer.mozilla.org/en-US/docs/Web/CSS/position) states: > > **absolute** > > Do not leave space for the element. Instead, position it at a specified position relative to its closest positioned ancestor or to the containing block. Absolutely positioned boxes can have mar...
Because div-2 is relative, the third div will absolute position itself relative to its parent container. If you want to position it relative to div-1, you will need to move it out of div-2 and into div-1. Remember that when you absolute-position an element, it will not displace its sibling elements, so the positioning...
11,437,442
I'm trying to restart the while loop. I've declared variable keepGoing of boolean type. If int variable x is off the window, keepGoing changes to false. Then the reset() method have to keepGoing=true. It works but the while loop isn't working. Class with reset() and checkWin(): ``` private void reset() { b.x = 25...
2012/07/11
[ "https://Stackoverflow.com/questions/11437442", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1508920/" ]
Use the keyword `continue` to go to the next iteration of the loop. For example: ``` while(true) { // ... if(!condition) continue; // this will go to the beginning of the while loop. // ... } ```
If the `keepGoing` flag is accessed from different threads (which I think your example is showing, it's not clear), then you need to use synchronization to ensure that when you update the `keepGoing` flag in the reset() method, it is visible to the thread in your runnable. You might want to check out the `AtomicBoolean...
7,849,196
I've got two ItemsControls, which use the same collection as an ItemsSource. ItemTemplates for both ItemsControls are very similar: there is a ScrollViewer inside both DataTemplates. **Question:** If I change HorizontalOffset in one of the ScrollViewers generated in the first ItemsControl, how can I scroll the Scroll...
2011/10/21
[ "https://Stackoverflow.com/questions/7849196", "https://Stackoverflow.com", "https://Stackoverflow.com/users/723626/" ]
If you do a Google search for `WPF ScrollViewer Synchronization` you'll get a lot of good results, such as [this codeproject article](http://www.codeproject.com/KB/WPF/ScrollSynchronization.aspx)
As Rachel mentioned, there may be lots of solutions about your problem. However, the things that I have seen are a little complex or not simple for me. So, I thought this way, which is very simple and can apply all the control which has ScrollViewer in VisualTree. The following code assumes that the two controls, havi...
3,260,378
Hi im trying to use Sql within MySql to sort some values and this is what I have: Select from my table the rows where the value in column status equals online and the value in column tags equals museum, order them by name and in ascending order. ``` SELECT * FROM tech WHERE `STATUS` = 'online' AND `TAGS` = 'mus...
2010/07/15
[ "https://Stackoverflow.com/questions/3260378", "https://Stackoverflow.com", "https://Stackoverflow.com/users/133641/" ]
Try ``` SELECT * FROM tech WHERE `STATUS` = 'online' AND `TAGS` like '%museum%' ORDER BY NAME ASC ```
Sounds like you want to use [LIKE](http://www.mysqltutorial.org/sql-like-mysql.aspx): ``` SELECT * FROM tech WHERE `STATUS` = 'online' AND `TAGS` LIKE '%museum%' ORDER BY NAME ASC ```
3,260,378
Hi im trying to use Sql within MySql to sort some values and this is what I have: Select from my table the rows where the value in column status equals online and the value in column tags equals museum, order them by name and in ascending order. ``` SELECT * FROM tech WHERE `STATUS` = 'online' AND `TAGS` = 'mus...
2010/07/15
[ "https://Stackoverflow.com/questions/3260378", "https://Stackoverflow.com", "https://Stackoverflow.com/users/133641/" ]
Try ``` SELECT * FROM tech WHERE `STATUS` = 'online' AND `TAGS` like '%museum%' ORDER BY NAME ASC ```
You just have to use `LIKE` and `%`. See [this site](http://www.techonthenet.com/sql/like.php). So something like this ``` ..AND `TAGS` like '%museum%'... ```
3,260,378
Hi im trying to use Sql within MySql to sort some values and this is what I have: Select from my table the rows where the value in column status equals online and the value in column tags equals museum, order them by name and in ascending order. ``` SELECT * FROM tech WHERE `STATUS` = 'online' AND `TAGS` = 'mus...
2010/07/15
[ "https://Stackoverflow.com/questions/3260378", "https://Stackoverflow.com", "https://Stackoverflow.com/users/133641/" ]
Try ``` SELECT * FROM tech WHERE `STATUS` = 'online' AND `TAGS` like '%museum%' ORDER BY NAME ASC ```
`Try this: ``` SELECT * FROM Tech WHERE `STATUS` = 'online' AND `TAGS` LIKE '%Museum%' ORDER BY Name ASC ```
3,260,378
Hi im trying to use Sql within MySql to sort some values and this is what I have: Select from my table the rows where the value in column status equals online and the value in column tags equals museum, order them by name and in ascending order. ``` SELECT * FROM tech WHERE `STATUS` = 'online' AND `TAGS` = 'mus...
2010/07/15
[ "https://Stackoverflow.com/questions/3260378", "https://Stackoverflow.com", "https://Stackoverflow.com/users/133641/" ]
Try ``` SELECT * FROM tech WHERE `STATUS` = 'online' AND `TAGS` like '%museum%' ORDER BY NAME ASC ```
Rather than creating multiple tags in a single column, you should consider splitting the tags off into another table. This is known as [database normalization](http://en.wikipedia.org/wiki/Database_normalization). It will make working with your data much easier, and will avoid having to perform `LIKE` searches, which c...
55,742,881
I'm trying to set up a server with ansible and I'd like to use [this galaxy role](https://github.com/geerlingguy/ansible-role-passenger). It defines a [template](https://github.com/geerlingguy/ansible-role-passenger/blob/master/templates/passenger.j2) that I'd like to customize, but I don't know how. Right now I defi...
2019/04/18
[ "https://Stackoverflow.com/questions/55742881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/193665/" ]
Your findings are unfortunately true. Overriding a hardcoded template in a role from a calling playbook is merely impossible **unless the role's author implemented that as a feature**. Note that this is also true for simple files in the `files` directory. The best way I have found so far: given that the role contains ...
The reply from @Zeitounator above is totally legit. But in the case where the author of an Ansible role is not responsive or playing dumb, there is another simpler approach. **Steps:** 1) Execute the role as you would do, don't change anything 2) Write a small piece of Ansible code to simply override any file or te...
55,742,881
I'm trying to set up a server with ansible and I'd like to use [this galaxy role](https://github.com/geerlingguy/ansible-role-passenger). It defines a [template](https://github.com/geerlingguy/ansible-role-passenger/blob/master/templates/passenger.j2) that I'd like to customize, but I don't know how. Right now I defi...
2019/04/18
[ "https://Stackoverflow.com/questions/55742881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/193665/" ]
Your findings are unfortunately true. Overriding a hardcoded template in a role from a calling playbook is merely impossible **unless the role's author implemented that as a feature**. Note that this is also true for simple files in the `files` directory. The best way I have found so far: given that the role contains ...
@Zeitounator response helped me a lot, and I'd like to give more details here (in a comment, the format is too limited), but big thanks to @Zeitounator! :) To give a concrete example, in your role: ``` roles `-- passenger |-- defaults | `-- main.yml |-- tasks | `-- main.yml `-- templates ...
55,742,881
I'm trying to set up a server with ansible and I'd like to use [this galaxy role](https://github.com/geerlingguy/ansible-role-passenger). It defines a [template](https://github.com/geerlingguy/ansible-role-passenger/blob/master/templates/passenger.j2) that I'd like to customize, but I don't know how. Right now I defi...
2019/04/18
[ "https://Stackoverflow.com/questions/55742881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/193665/" ]
The reply from @Zeitounator above is totally legit. But in the case where the author of an Ansible role is not responsive or playing dumb, there is another simpler approach. **Steps:** 1) Execute the role as you would do, don't change anything 2) Write a small piece of Ansible code to simply override any file or te...
@Zeitounator response helped me a lot, and I'd like to give more details here (in a comment, the format is too limited), but big thanks to @Zeitounator! :) To give a concrete example, in your role: ``` roles `-- passenger |-- defaults | `-- main.yml |-- tasks | `-- main.yml `-- templates ...
69,441,982
I am trying to get the value of a useState hook variable without having that new variable hooked when the useState variable updates ( avoiding newVariable value update when stateVariable value changes ). For example, I have two components, App and Edit. App.js ``` ... import Edit from './edit' ... function App() { ...
2021/10/04
[ "https://Stackoverflow.com/questions/69441982", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11269158/" ]
profile.dart ``` getProfilePosts() async { setState(() { isLoading=true; }); QuerySnapshot snapshot= await userPostRef .document(widget.profileId) .collection('userPosts') .getDocuments(); setState(() { isLoading=false; postCount=snapshot.documents.length; pos...
Try these changes, **change your code from**, ``` posts=snapshot.documents.map((doc) =>Post.fromDocument(doc)).toList() ``` **to**, ``` posts=snapshot.documents.map((doc) =>Post.fromDocument(doc)) ``` As firestore already returns list of objects for your request and you are again converting that to list so it mi...
69,441,982
I am trying to get the value of a useState hook variable without having that new variable hooked when the useState variable updates ( avoiding newVariable value update when stateVariable value changes ). For example, I have two components, App and Edit. App.js ``` ... import Edit from './edit' ... function App() { ...
2021/10/04
[ "https://Stackoverflow.com/questions/69441982", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11269158/" ]
There is way too much going on. Please strip your example. I am unable to copy and execute the code because dependencies are missing (like the `User` class). The code is very messy, you're mixing view logic, application logic, models, and view models everywhere which makes it hard to grasp, where and why the exception...
profile.dart ``` getProfilePosts() async { setState(() { isLoading=true; }); QuerySnapshot snapshot= await userPostRef .document(widget.profileId) .collection('userPosts') .getDocuments(); setState(() { isLoading=false; postCount=snapshot.documents.length; pos...
69,441,982
I am trying to get the value of a useState hook variable without having that new variable hooked when the useState variable updates ( avoiding newVariable value update when stateVariable value changes ). For example, I have two components, App and Edit. App.js ``` ... import Edit from './edit' ... function App() { ...
2021/10/04
[ "https://Stackoverflow.com/questions/69441982", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11269158/" ]
There is way too much going on. Please strip your example. I am unable to copy and execute the code because dependencies are missing (like the `User` class). The code is very messy, you're mixing view logic, application logic, models, and view models everywhere which makes it hard to grasp, where and why the exception...
Try these changes, **change your code from**, ``` posts=snapshot.documents.map((doc) =>Post.fromDocument(doc)).toList() ``` **to**, ``` posts=snapshot.documents.map((doc) =>Post.fromDocument(doc)) ``` As firestore already returns list of objects for your request and you are again converting that to list so it mi...
8,551
> > **Possible Duplicate:** > > [Adding support for math notation](https://meta.stackexchange.com/questions/4152/adding-support-for-math-notation) > > > CS is close enough to math that you tend to get a few questions and answers with equations in them. Also, another topic that would be cool to have [a stack ex...
2009/07/23
[ "https://meta.stackexchange.com/questions/8551", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/1343/" ]
You could just try one of the sites listed here: > > <http://sixthform.info/steve/wordpress/?p=59> > > > I see no reason otherwise for SO.com to embed this functionality.
The problem with math formatting is that a lot of it requires something like rendering LaTeX images (like Wikipedia does), which is expensive on the server side (especially for live editing), or using something like MathML, which some browsers don't support.
23,930,258
I have a file named "output.txt" having data in format: ``` 400949703|2000025967912|20130614010652|20130614131543 355949737|2144050263|20120407100407|20120407101307 355499738|2144500262|20110911010901|20110911135601 ``` I am executing an awk command as shown below: ``` awk -F"|" '{num1="`echo $3| cut -c1-8`"; print...
2014/05/29
[ "https://Stackoverflow.com/questions/23930258", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1025317/" ]
The IDE will display the escape characters (\") but when the string is used they won't be there Try writing it to the console and checking if it's correct
I'd prefer to use code like this: ``` var demo = string.Join( ",", Enumerable.Range(1, count) .Select(n => string.Format("\"{0}\"", n))); ``` Breaking it down a bit... ``` Enumerable.Range(1, count) //Gives a list of integers from 1 to count .Select(n => string.Format("\"{0}"\"", n) //Surrounds ea...
23,930,258
I have a file named "output.txt" having data in format: ``` 400949703|2000025967912|20130614010652|20130614131543 355949737|2144050263|20120407100407|20120407101307 355499738|2144500262|20110911010901|20110911135601 ``` I am executing an awk command as shown below: ``` awk -F"|" '{num1="`echo $3| cut -c1-8`"; print...
2014/05/29
[ "https://Stackoverflow.com/questions/23930258", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1025317/" ]
The IDE will display the escape characters (\") but when the string is used they won't be there Try writing it to the console and checking if it's correct
string template = "\"{0}\""; ``` while (i < (count - 1)) { string temp = null; if (i == 0) { temp = string.Format(template, arry[i]); } else { temp = "," + string.Format(template, arry[i]); ...
23,930,258
I have a file named "output.txt" having data in format: ``` 400949703|2000025967912|20130614010652|20130614131543 355949737|2144050263|20120407100407|20120407101307 355499738|2144500262|20110911010901|20110911135601 ``` I am executing an awk command as shown below: ``` awk -F"|" '{num1="`echo $3| cut -c1-8`"; print...
2014/05/29
[ "https://Stackoverflow.com/questions/23930258", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1025317/" ]
I'd prefer to use code like this: ``` var demo = string.Join( ",", Enumerable.Range(1, count) .Select(n => string.Format("\"{0}\"", n))); ``` Breaking it down a bit... ``` Enumerable.Range(1, count) //Gives a list of integers from 1 to count .Select(n => string.Format("\"{0}"\"", n) //Surrounds ea...
string template = "\"{0}\""; ``` while (i < (count - 1)) { string temp = null; if (i == 0) { temp = string.Format(template, arry[i]); } else { temp = "," + string.Format(template, arry[i]); ...
16,217
I currently use "Stay," and have tried other tools (haven't really loved any of them), but I am looking for a window management tool that does the following: 1. Store my window locations 2. Have a separate profile for different monitor setups 3. Allow me to quickly modify the location with hotkeys 4. Automatically loa...
2011/06/20
[ "https://apple.stackexchange.com/questions/16217", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/6789/" ]
I never used stay but I am using Moom (Apple store) and pretty happy with it. It stores windows positions and has configurable hotkeys. There is no automatic settings for different displays but since you can assign hotkeys to configuration is not a big issue. It is very stable.
[Moom](http://manytricks.com/moom/) ![Moom](https://i.stack.imgur.com/vsVX9.png) [Divvy](http://mizage.com/divvy/) ![Divvy](https://i.stack.imgur.com/GQMoH.png)
16,217
I currently use "Stay," and have tried other tools (haven't really loved any of them), but I am looking for a window management tool that does the following: 1. Store my window locations 2. Have a separate profile for different monitor setups 3. Allow me to quickly modify the location with hotkeys 4. Automatically loa...
2011/06/20
[ "https://apple.stackexchange.com/questions/16217", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/6789/" ]
I never used stay but I am using Moom (Apple store) and pretty happy with it. It stores windows positions and has configurable hotkeys. There is no automatic settings for different displays but since you can assign hotkeys to configuration is not a big issue. It is very stable.
I prefer [DoublePane](http://itunes.apple.com/us/app/doublepane/id409737246?mt=12). It's $2.99 on Mac App Store.
16,217
I currently use "Stay," and have tried other tools (haven't really loved any of them), but I am looking for a window management tool that does the following: 1. Store my window locations 2. Have a separate profile for different monitor setups 3. Allow me to quickly modify the location with hotkeys 4. Automatically loa...
2011/06/20
[ "https://apple.stackexchange.com/questions/16217", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/6789/" ]
I never used stay but I am using Moom (Apple store) and pretty happy with it. It stores windows positions and has configurable hotkeys. There is no automatic settings for different displays but since you can assign hotkeys to configuration is not a big issue. It is very stable.
I like [Spectacle](https://www.spectacleapp.com/). It's super simple, just a few options, but they do the trick for me. I mostly just use left/right/upper/lower half and fullscreen (calling halves multiple times flips through several options). [![Spectacle options screenshot](https://i.stack.imgur.com/jq3mV.png)](http...
16,217
I currently use "Stay," and have tried other tools (haven't really loved any of them), but I am looking for a window management tool that does the following: 1. Store my window locations 2. Have a separate profile for different monitor setups 3. Allow me to quickly modify the location with hotkeys 4. Automatically loa...
2011/06/20
[ "https://apple.stackexchange.com/questions/16217", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/6789/" ]
[Moom](http://manytricks.com/moom/) ![Moom](https://i.stack.imgur.com/vsVX9.png) [Divvy](http://mizage.com/divvy/) ![Divvy](https://i.stack.imgur.com/GQMoH.png)
I prefer [DoublePane](http://itunes.apple.com/us/app/doublepane/id409737246?mt=12). It's $2.99 on Mac App Store.
16,217
I currently use "Stay," and have tried other tools (haven't really loved any of them), but I am looking for a window management tool that does the following: 1. Store my window locations 2. Have a separate profile for different monitor setups 3. Allow me to quickly modify the location with hotkeys 4. Automatically loa...
2011/06/20
[ "https://apple.stackexchange.com/questions/16217", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/6789/" ]
[Moom](http://manytricks.com/moom/) ![Moom](https://i.stack.imgur.com/vsVX9.png) [Divvy](http://mizage.com/divvy/) ![Divvy](https://i.stack.imgur.com/GQMoH.png)
I like [Spectacle](https://www.spectacleapp.com/). It's super simple, just a few options, but they do the trick for me. I mostly just use left/right/upper/lower half and fullscreen (calling halves multiple times flips through several options). [![Spectacle options screenshot](https://i.stack.imgur.com/jq3mV.png)](http...
16,217
I currently use "Stay," and have tried other tools (haven't really loved any of them), but I am looking for a window management tool that does the following: 1. Store my window locations 2. Have a separate profile for different monitor setups 3. Allow me to quickly modify the location with hotkeys 4. Automatically loa...
2011/06/20
[ "https://apple.stackexchange.com/questions/16217", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/6789/" ]
I like [Spectacle](https://www.spectacleapp.com/). It's super simple, just a few options, but they do the trick for me. I mostly just use left/right/upper/lower half and fullscreen (calling halves multiple times flips through several options). [![Spectacle options screenshot](https://i.stack.imgur.com/jq3mV.png)](http...
I prefer [DoublePane](http://itunes.apple.com/us/app/doublepane/id409737246?mt=12). It's $2.99 on Mac App Store.
46,449,858
I have SDK version 25, when i import a project in android studio this error occurs. > > "Install missing platform(s) and sync project". > > > If I click this link, I get another error, which says: > > "The following packages are not available: - Package id > platforms;android-23". > > > [sdk error](https:...
2017/09/27
[ "https://Stackoverflow.com/questions/46449858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7956355/" ]
This can happen if you are using an Anaconda virtual environment and did both `conda install pyqt`(1) *and* `pip install opencv-python`. This creates a conflict between the two PyQt versions (`opencv-python` ships with its own) and causes the errors. The solution is to install PyQt via `pip`, i.e. `pip install PyQt5`....
The issue is with OpenCV version, The following version solved all issues for me. ``` pip uninstall opencv-python pip install opencv-python==4.1.2.30 ``` I am using - Python 3.8.5 with conda I tried with upgrading pyqt too but it didn't work
46,449,858
I have SDK version 25, when i import a project in android studio this error occurs. > > "Install missing platform(s) and sync project". > > > If I click this link, I get another error, which says: > > "The following packages are not available: - Package id > platforms;android-23". > > > [sdk error](https:...
2017/09/27
[ "https://Stackoverflow.com/questions/46449858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7956355/" ]
Downgrade the python version from 3.9.13 to 3.8.10 ``` conda install python=3.8.10 pip install opencv-python==4.5.2.54 ``` worked for me.
The answer of @Mateen works great if you have Ubuntu version 17 and above. For Ubuntu 16, it's better to compile from sources your opencv python. As @Varun mentioned, follow the [opencv tutorial](https://docs.opencv.org/3.4.1/d2/de6/tutorial_py_setup_in_ubuntu.html). However, to successfully compile opencv with python ...
46,449,858
I have SDK version 25, when i import a project in android studio this error occurs. > > "Install missing platform(s) and sync project". > > > If I click this link, I get another error, which says: > > "The following packages are not available: - Package id > platforms;android-23". > > > [sdk error](https:...
2017/09/27
[ "https://Stackoverflow.com/questions/46449858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7956355/" ]
This problem is due to the conflict between opencv-python's own Qt5 and the one used by other packages. In my case, `matplotlib` is installed via `conda`, then `pyqt` is also installed as a `matplotlib`'s dependency. My solution is as follows: 1. Uninstall `matplotlib`: `conda remove matplotlib` 2. Install `opencv-pyt...
I fixed this under Ubuntu 18.04 LTS by uninstalling any OpenCV packages from `pip` and `apt` and installing OpenCV directly from source. Maybe this tutorial will help: <https://www.pyimagesearch.com/2018/08/15/how-to-install-opencv-4-on-ubuntu/>
46,449,858
I have SDK version 25, when i import a project in android studio this error occurs. > > "Install missing platform(s) and sync project". > > > If I click this link, I get another error, which says: > > "The following packages are not available: - Package id > platforms;android-23". > > > [sdk error](https:...
2017/09/27
[ "https://Stackoverflow.com/questions/46449858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7956355/" ]
This error occurs in higher versions of openCv like 4.3.0.38 or higher, i tried 4.3.0.36 version with pip and this problem solved for me, but in lower version i were facing lots of problems, like window not loading correctly,If are using Ubuntu i would recommend you to uninstall opencv from your system completely and t...
I had the same problem. Using opencv imshow function raised the moving thread error. Eventually, I found that Ubuntu 16.04 has a preinstalled pyqt5 while OpenCV needs pqty4. Therefore, this may be caused by conflicting installations of Qt libraries. The following command fixed it for me: ``` sudo apt-get remove libqt5...
46,449,858
I have SDK version 25, when i import a project in android studio this error occurs. > > "Install missing platform(s) and sync project". > > > If I click this link, I get another error, which says: > > "The following packages are not available: - Package id > platforms;android-23". > > > [sdk error](https:...
2017/09/27
[ "https://Stackoverflow.com/questions/46449858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7956355/" ]
First, uninstall any versions of OpenCV you may have installed. If you installed using `pip`: ``` sudo pip uninstall opencv-python ``` Next, try installing OpenCV using your Linux distro's package manager. For Ubuntu/Debian, this is: ``` sudo apt-get install libopencv-dev python-opencv ```
Downgrade the python version from 3.9.13 to 3.8.10 ``` conda install python=3.8.10 pip install opencv-python==4.5.2.54 ``` worked for me.
46,449,858
I have SDK version 25, when i import a project in android studio this error occurs. > > "Install missing platform(s) and sync project". > > > If I click this link, I get another error, which says: > > "The following packages are not available: - Package id > platforms;android-23". > > > [sdk error](https:...
2017/09/27
[ "https://Stackoverflow.com/questions/46449858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7956355/" ]
This error occurs in higher versions of openCv like 4.3.0.38 or higher, i tried 4.3.0.36 version with pip and this problem solved for me, but in lower version i were facing lots of problems, like window not loading correctly,If are using Ubuntu i would recommend you to uninstall opencv from your system completely and t...
I don't know why, but installation of matplotlib solved for me the problem with the error ``` QObject::moveToThread: Current thread (0x1d2c9cf0) is not the object's thread (0x1d347b20). Cannot move to target thread (0x1d2c9cf0) ``` I emphasize that I prepared fresh conda environment where matplotlib was installed. O...
46,449,858
I have SDK version 25, when i import a project in android studio this error occurs. > > "Install missing platform(s) and sync project". > > > If I click this link, I get another error, which says: > > "The following packages are not available: - Package id > platforms;android-23". > > > [sdk error](https:...
2017/09/27
[ "https://Stackoverflow.com/questions/46449858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7956355/" ]
The openCv author says that this problem comes from different Qt versions in openCv and the linux distro. That is: openCv comes with Qt4, but Qt5 is already installed.
This may be caused by conflicting installations of Qt libraries. The following command fixed it for me: sudo apt-get remove libqt5x11extras5 libqt5x11extras5-dev
46,449,858
I have SDK version 25, when i import a project in android studio this error occurs. > > "Install missing platform(s) and sync project". > > > If I click this link, I get another error, which says: > > "The following packages are not available: - Package id > platforms;android-23". > > > [sdk error](https:...
2017/09/27
[ "https://Stackoverflow.com/questions/46449858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7956355/" ]
The issue is with OpenCV version, The following version solved all issues for me. ``` pip uninstall opencv-python pip install opencv-python==4.1.2.30 ``` I am using - Python 3.8.5 with conda I tried with upgrading pyqt too but it didn't work
Downgrade the python version from 3.9.13 to 3.8.10 ``` conda install python=3.8.10 pip install opencv-python==4.5.2.54 ``` worked for me.
46,449,858
I have SDK version 25, when i import a project in android studio this error occurs. > > "Install missing platform(s) and sync project". > > > If I click this link, I get another error, which says: > > "The following packages are not available: - Package id > platforms;android-23". > > > [sdk error](https:...
2017/09/27
[ "https://Stackoverflow.com/questions/46449858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7956355/" ]
Just reinstall opencv-python lib, it's OK. ``` pip uninstall opencv-python pip install opencv-python=4.2.0.34 ``` The version 4.2 is the latest opencv python that don't throw this error. I tried 4.3 or 4.4 +, it's don't work. The main reason of this question may be the confliction between PyQt5 and Opencv.
I followed the solution suggested by @Varun and it worked for me (using Python 3). However, I didn't install the built files, as I do not have the admin rights on the system where I need the cv package. A `cmake`, followed by `make` was enough, I then took the `cv2.*.gnu` file from `../build/lib/python3` folder and rep...
46,449,858
I have SDK version 25, when i import a project in android studio this error occurs. > > "Install missing platform(s) and sync project". > > > If I click this link, I get another error, which says: > > "The following packages are not available: - Package id > platforms;android-23". > > > [sdk error](https:...
2017/09/27
[ "https://Stackoverflow.com/questions/46449858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7956355/" ]
I solved this issue and I posted my solution [in related issue on OpenCV github page](https://github.com/skvark/opencv-python/issues/46#issuecomment-518642701). But for your convenience, I will post it here also. In my case, I did almost all the solutions: * installing using pip3 install opencv-python * installing u...
I know the thread is a bit old but posting for anyone else out there, I faced the same problem and it was because even after running ``` pip3 uninstall opencv-python ``` there was another version of open-cv in my system which I checked by ``` pip list ``` (I'm guessing that pip only removes the first version it f...
35,584,214
The update section of Player class doesn't work when I run the program. It displays the picture, but I can't get it to move right or left when the keys are pressed. It stays motionless. What am I missing? ``` import pygame import random import os pygame.init() pygame.mixer.init() display_width = 460 display_height =...
2016/02/23
[ "https://Stackoverflow.com/questions/35584214", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5969968/" ]
The call to `pygame.event.get` consumes all events in the queue. That means that it should be done ina single place - when you do `for event in pygame.event.get():` in the main boyd, just bellow the while loop, you swallow all `keydown` events that might be read inside your `update` method. The remedy to this is to *...
Your problem is that your event handling is in two different places, and pygame can only run one event handler at a time. I assume from your code that you only want your guy to move 7 pixels once each time is pressed. If you want him to keep moving, you'll need to add more ``` import pygame import random import os py...
28,600,442
I retrieve products by doing the following. ``` Template.Bag.helpers({ bagged_products: function () { var bag = Session.get("shoppingBag") || {}; var bagged_product_ids = Object.keys(bag); var bagged_products = Products.find({_id: {$in: bagged_product_ids}}); return bagged_products; } ...
2015/02/19
[ "https://Stackoverflow.com/questions/28600442", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1815412/" ]
You can use a transform in your helper: ``` var bag = Session.get("shoppingBag") || {} var transform = function(product) { product.qty = bag[product._id] || 0; return product; } return Products.find({_id: {$in: bagged_product_ids}}, {transform: transform}); ``` Then just use `{{qty}}` or anything else you ...
I ended up declaring a new local collection before returning the documents. ``` Template.Bag.helpers({ bagged_products: function () { var bag = Session.get("shoppingBag") || {}; var tmpBag = new Mongo.Collection(null); for (var p_id in bag) { var p = Products.findOne({_id: p_id}); ...
24,841,397
I have a jsfiddle here - <http://jsfiddle.net/qYR6U/8/> - where I set the `font-family` with jQuery and read it back with jQuery. If the `font-family` I set is "Arial . . ." it comes back okay, in a single set of double quotes. But if the `font-family` I set is "Comic . . ." it comes back in a set of double quotes encl...
2014/07/19
[ "https://Stackoverflow.com/questions/24841397", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1008834/" ]
It's because when a font name has spaces, the browser is interpreting any string requiring quoting as needing quotes, and hence the quotes are added (which is appropriate for the browser to do). Why only Chrome appears to do this (normal) quoting when it's property is read back, you got me. Try [`Times New Roman`](htt...
You are using single quotes for the JS function arguments. To set `font-family` with a font that's name has multiple words, you should enclose the name in quotes, too. So instead of using `'Comic Sans MS'` in your code, try `'"Comic Sans MS"'`. (Single and double quotes). I believe the `Arial` one works because that's...
7,670,792
Coming from a strong background in ActionScript 3, the process of requiring/importing a class that will be referenced / used / extended in another class is as follows: ``` import package.inner.ClassName; ``` This is required at the top of every external class file that will make use of `ClassName`, meaning it's requ...
2011/10/06
[ "https://Stackoverflow.com/questions/7670792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/699632/" ]
You can use the `require_once()` statement. It functions just like the require statement, but will check to make sure that the base class hasn't been included yet and will load it if needed. <http://php.net/manual/en/function.require-once.php> You may also want to look into web frameworks depending on the size of you...
You need to use `require_once` instead of `require`. That way PHP will only include the file if it has not already done so.
7,670,792
Coming from a strong background in ActionScript 3, the process of requiring/importing a class that will be referenced / used / extended in another class is as follows: ``` import package.inner.ClassName; ``` This is required at the top of every external class file that will make use of `ClassName`, meaning it's requ...
2011/10/06
[ "https://Stackoverflow.com/questions/7670792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/699632/" ]
You can use the `require_once()` statement. It functions just like the require statement, but will check to make sure that the base class hasn't been included yet and will load it if needed. <http://php.net/manual/en/function.require-once.php> You may also want to look into web frameworks depending on the size of you...
You should use [`require_once`](http://php.net/manual/en/function.require-once.php)
7,670,792
Coming from a strong background in ActionScript 3, the process of requiring/importing a class that will be referenced / used / extended in another class is as follows: ``` import package.inner.ClassName; ``` This is required at the top of every external class file that will make use of `ClassName`, meaning it's requ...
2011/10/06
[ "https://Stackoverflow.com/questions/7670792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/699632/" ]
You can use the `require_once()` statement. It functions just like the require statement, but will check to make sure that the base class hasn't been included yet and will load it if needed. <http://php.net/manual/en/function.require-once.php> You may also want to look into web frameworks depending on the size of you...
If you just want to hack your problem above use `require_once`. But just like egis said, an autoloader is much better because it includes your classes on the fly as needed. Saves you from manually including classes in a lot of places. What if your class depended on so many other classes? Here's [a tutorial on how t...
7,670,792
Coming from a strong background in ActionScript 3, the process of requiring/importing a class that will be referenced / used / extended in another class is as follows: ``` import package.inner.ClassName; ``` This is required at the top of every external class file that will make use of `ClassName`, meaning it's requ...
2011/10/06
[ "https://Stackoverflow.com/questions/7670792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/699632/" ]
You can use the `require_once()` statement. It functions just like the require statement, but will check to make sure that the base class hasn't been included yet and will load it if needed. <http://php.net/manual/en/function.require-once.php> You may also want to look into web frameworks depending on the size of you...
If you want to not even have to care, you should use [\_\_autoload](http://www.php.net/manual/en/function.spl-autoload-register.php) and let php do all the heavy lifting for you.
7,670,792
Coming from a strong background in ActionScript 3, the process of requiring/importing a class that will be referenced / used / extended in another class is as follows: ``` import package.inner.ClassName; ``` This is required at the top of every external class file that will make use of `ClassName`, meaning it's requ...
2011/10/06
[ "https://Stackoverflow.com/questions/7670792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/699632/" ]
You should read about how [spl\_autoload\_register](http://www.php.net/manual/en/function.spl-autoload-register.php) works. It would solve your issue in a bit more reusable manner. Additionally, you should stop doing "work" in the `__construct` method. Use it only for assignment. And if your `Website` class requires a...
You need to use `require_once` instead of `require`. That way PHP will only include the file if it has not already done so.
7,670,792
Coming from a strong background in ActionScript 3, the process of requiring/importing a class that will be referenced / used / extended in another class is as follows: ``` import package.inner.ClassName; ``` This is required at the top of every external class file that will make use of `ClassName`, meaning it's requ...
2011/10/06
[ "https://Stackoverflow.com/questions/7670792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/699632/" ]
You should read about how [spl\_autoload\_register](http://www.php.net/manual/en/function.spl-autoload-register.php) works. It would solve your issue in a bit more reusable manner. Additionally, you should stop doing "work" in the `__construct` method. Use it only for assignment. And if your `Website` class requires a...
You should use [`require_once`](http://php.net/manual/en/function.require-once.php)
7,670,792
Coming from a strong background in ActionScript 3, the process of requiring/importing a class that will be referenced / used / extended in another class is as follows: ``` import package.inner.ClassName; ``` This is required at the top of every external class file that will make use of `ClassName`, meaning it's requ...
2011/10/06
[ "https://Stackoverflow.com/questions/7670792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/699632/" ]
You should read about how [spl\_autoload\_register](http://www.php.net/manual/en/function.spl-autoload-register.php) works. It would solve your issue in a bit more reusable manner. Additionally, you should stop doing "work" in the `__construct` method. Use it only for assignment. And if your `Website` class requires a...
If you just want to hack your problem above use `require_once`. But just like egis said, an autoloader is much better because it includes your classes on the fly as needed. Saves you from manually including classes in a lot of places. What if your class depended on so many other classes? Here's [a tutorial on how t...
7,670,792
Coming from a strong background in ActionScript 3, the process of requiring/importing a class that will be referenced / used / extended in another class is as follows: ``` import package.inner.ClassName; ``` This is required at the top of every external class file that will make use of `ClassName`, meaning it's requ...
2011/10/06
[ "https://Stackoverflow.com/questions/7670792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/699632/" ]
You should read about how [spl\_autoload\_register](http://www.php.net/manual/en/function.spl-autoload-register.php) works. It would solve your issue in a bit more reusable manner. Additionally, you should stop doing "work" in the `__construct` method. Use it only for assignment. And if your `Website` class requires a...
If you want to not even have to care, you should use [\_\_autoload](http://www.php.net/manual/en/function.spl-autoload-register.php) and let php do all the heavy lifting for you.
68,017,523
First of all I beg your pardon if this question already exists, I deeply searched for a solution here but I've been able to find it, nevertheless I feel it's a problem so common that is seems so strange to not find anything here... My struggle is the following: given an hash, I need to return all the PATHS to each lea...
2021/06/17
[ "https://Stackoverflow.com/questions/68017523", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2250752/" ]
If the user is the authentified user, use the Auth::class ``` public function update($post_id, Request $request){ $request->validate([ 'text' => 'string|...', ]); Post::findOrFail($post_id)->update([ 'user_id' => \Auth::id(), 'text' => $request->text, ]); } ``` You can even make sur...
I suggest another way for you. Work with [`middlewares`](https://laravel.com/docs/8.x/middleware#introduction). In the `gate` you can check the type of `user`, so `users` should be able to edit if they are the owner. In this case you can add some other rules just in one file and user everywhere you want. In `app/Prov...
109,927
Regardless of the format of encryption, what is the best way to store an encryption key on an AWS EC2 server? I am storing encrypted information in a MySQL database and my cryptography key is stored in code. Data is encoded/decoded using this key when saving/retrieving from the database. Obviously, I do not want anyon...
2016/01/07
[ "https://security.stackexchange.com/questions/109927", "https://security.stackexchange.com", "https://security.stackexchange.com/users/96221/" ]
I do not notice anywhere in your description that you are encrypting your traffic. Are you sending your hash in the clear? If so, I am thinking, what would prevent an eavesdropper from intercepting the hash and reuse it? Another question is, how do you attempt to keep your list of allowable passwords which "keep chang...
First vulnerability is around using SHA1 hashes. SHA1 hash based collisions are relatively highly probable with modern compute power. See [SHA1-collisions](https://www.schneier.com/blog/archives/2012/10/when_will_we_se.html) What this means is the rogue party can capture those hashes on the wire and brute force them. ...
109,927
Regardless of the format of encryption, what is the best way to store an encryption key on an AWS EC2 server? I am storing encrypted information in a MySQL database and my cryptography key is stored in code. Data is encoded/decoded using this key when saving/retrieving from the database. Obviously, I do not want anyon...
2016/01/07
[ "https://security.stackexchange.com/questions/109927", "https://security.stackexchange.com", "https://security.stackexchange.com/users/96221/" ]
If an attacker is able to perform a man in the middle attack (and he can perform it, if the wifi connection is insecure), then it's not secure: If I take your example: When the UPS courier scans the package, the attacker can drop the message with hash but keep the hash for later. The module will deny the UPS courier...
First vulnerability is around using SHA1 hashes. SHA1 hash based collisions are relatively highly probable with modern compute power. See [SHA1-collisions](https://www.schneier.com/blog/archives/2012/10/when_will_we_se.html) What this means is the rogue party can capture those hashes on the wire and brute force them. ...
109,927
Regardless of the format of encryption, what is the best way to store an encryption key on an AWS EC2 server? I am storing encrypted information in a MySQL database and my cryptography key is stored in code. Data is encoded/decoded using this key when saving/retrieving from the database. Obviously, I do not want anyon...
2016/01/07
[ "https://security.stackexchange.com/questions/109927", "https://security.stackexchange.com", "https://security.stackexchange.com/users/96221/" ]
If an attacker is able to perform a man in the middle attack (and he can perform it, if the wifi connection is insecure), then it's not secure: If I take your example: When the UPS courier scans the package, the attacker can drop the message with hash but keep the hash for later. The module will deny the UPS courier...
I do not notice anywhere in your description that you are encrypting your traffic. Are you sending your hash in the clear? If so, I am thinking, what would prevent an eavesdropper from intercepting the hash and reuse it? Another question is, how do you attempt to keep your list of allowable passwords which "keep chang...
186,307
I currently use a 13" Mid 2011 MacBook Air, and the thing I dislike most about it is that it can get very hot. I'm particularly physically sensitive to the heat for some reason, and at its hottest it makes me uncomfortable even to just sit at a desk with my hands on it. Anyway, I'm in the market for a new laptop, and ...
2015/05/08
[ "https://apple.stackexchange.com/questions/186307", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/87124/" ]
It all depends on your usage (the load). For normal uses (the CPU newer runs at 100% for long times) the MacBook Air would be the colder solution. The MacBook Pro is the more power hungry machine (retina display) and could run hotter. One way to see this is in the Battery life. MacBook Air can go up to 10 hours on a...
It is a truism that the more applications you run, plus the intensity of those applications' operations, will cause a certain amount of heat dissipation in the given device. So assuming that the applications you need will be used regardless, you need to consider the hardware components within each device, since this d...