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 |
|---|---|---|---|---|---|
6,810,036 | What is typically regarded as more Pythonic/better/faster to use, the reverse method or the reversed built-in function?
Both in action:
```
_list = list(xrange(4))
print _list
rlist = list(reversed(_list))
print rlist
_list.reverse()
print _list
``` | 2011/07/24 | [
"https://Stackoverflow.com/questions/6810036",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/433417/"
] | There seems to be a great difference. I really thought it's the other way round.
Why is rearranging the values in a list faster than creating a new one from an iterator ?
```
from decorators import bench
_list = range(10 ** 6)
@ bench
def foo():
list(reversed(_list))
@ bench
def bar():
_list.reverse()
foo()
ba... | * \_list.reverse() does an in-place reversal and does not return a value
* reversed(\_list) does not change \_list, but returns a reverse iterable
object
* \_list[::-1] does not change \_list, but returns reversed slice
example:
```
_list = [1,2,3]
ret1 = list(reversed(_list))
ret2 = _list[::-1] #reverse order slice
... |
6,810,036 | What is typically regarded as more Pythonic/better/faster to use, the reverse method or the reversed built-in function?
Both in action:
```
_list = list(xrange(4))
print _list
rlist = list(reversed(_list))
print rlist
_list.reverse()
print _list
``` | 2011/07/24 | [
"https://Stackoverflow.com/questions/6810036",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/433417/"
] | Depends on whether you want to reverse the list in-place (i.e. change the list) or not. No other real difference.
Often using `reversed` leads to nicer code. | There seems to be a great difference. I really thought it's the other way round.
Why is rearranging the values in a list faster than creating a new one from an iterator ?
```
from decorators import bench
_list = range(10 ** 6)
@ bench
def foo():
list(reversed(_list))
@ bench
def bar():
_list.reverse()
foo()
ba... |
6,810,036 | What is typically regarded as more Pythonic/better/faster to use, the reverse method or the reversed built-in function?
Both in action:
```
_list = list(xrange(4))
print _list
rlist = list(reversed(_list))
print rlist
_list.reverse()
print _list
``` | 2011/07/24 | [
"https://Stackoverflow.com/questions/6810036",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/433417/"
] | There seems to be a great difference. I really thought it's the other way round.
Why is rearranging the values in a list faster than creating a new one from an iterator ?
```
from decorators import bench
_list = range(10 ** 6)
@ bench
def foo():
list(reversed(_list))
@ bench
def bar():
_list.reverse()
foo()
ba... | It is always better to use reversed() if eventually you are going to modify the list in iterator making list immutable and working with immutable data is always better especially when your doing functional programming. |
2,680,388 | Let $\mathcal H$ be some finite dimensional Hilbert space and $\mathbb H(\mathcal H)$ the real vector space of Hermitian operators on $\mathcal H$. The authors of this paper: <https://arxiv.org/pdf/quant-ph/0404137.pdf> claim on page 2 that if $\{F\_c \}$ is a set of positive semi-definite operators which span the spac... | 2018/03/07 | [
"https://math.stackexchange.com/questions/2680388",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/396818/"
] | $\langle x,Gx \rangle \geq0$. If $\langle x,Gx \rangle = 0$ then $\langle x,F\_c x \rangle = 0$ for each c in which case $\{F\_c\}$ cannot span the space of Hermitian operators; in fact the identity operator is not in the span. Hence $\langle x,Gx \rangle > 0$ and G is invertible. | This is an answer to the original question in which the operators $F\_c$ were stipulated to be positive:
If $A$ is a bounded operator on $\mathcal H$ such that
$\langle x, Ax \rangle > 0 \tag 1$
for all $x \in \mathcal H$, then $A$ must be invertible, since otherwise there exists $y \in \mathcal H$ with
$Ay = 0 \Lo... |
34,217,228 | ```
struct
{
int m,s,l;
union
{
char c[10];
};
float p;
} a;
int main()
{
printf("%d",sizeof(a));
return 0;
}
```
according to the calculations ans must be 4\*3+10+4=26 but DEV C++ compiler showing the output 28. | 2015/12/11 | [
"https://Stackoverflow.com/questions/34217228",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5652768/"
] | The principles of allocating local variables on stack are roughly the same for all systems
1 -- Stack grows from high addresses to low addresses
2 -- The order of declaration of your variables in your program corresponds to growth of stack
3 -- Each type has alignment - the address of any variable must be divisible ... | The members in the structure arranged as a group of 4 bytes in 32 bit processor.So you are getting 28 bytes as size.
for more details see [here](http://fresh2refresh.com/c/c-structure-padding/)
It is due to padding |
7,477,979 | I have a decent programming practice with languages such as ASM, C, C++, PHP, JS, even ActionScript for Flash, and now I feel a strong need to learn Java. But I prefer to explore new languages in practise, and it seems like, if you want to write something worthwile in Java, you have to know this, and this, and that, an... | 2011/09/19 | [
"https://Stackoverflow.com/questions/7477979",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/942817/"
] | Try [the official *Java Tutorials*](http://download.oracle.com/javase/tutorial/). They are actually quite good. | Most of the languages you have learned are Imperative programming languages. Make sure you divide your task into two; learning object oriented thinking and learning the Java language.
I've heard good things about [Object Oriented software Construction, 2nd Edition](http://docs.eiffel.com/book/method/object-oriented-so... |
7,477,979 | I have a decent programming practice with languages such as ASM, C, C++, PHP, JS, even ActionScript for Flash, and now I feel a strong need to learn Java. But I prefer to explore new languages in practise, and it seems like, if you want to write something worthwile in Java, you have to know this, and this, and that, an... | 2011/09/19 | [
"https://Stackoverflow.com/questions/7477979",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/942817/"
] | Try [the official *Java Tutorials*](http://download.oracle.com/javase/tutorial/). They are actually quite good. | Try this book : Its on point
>
> Deitel : How to Program Java : [Book](http://www.deitel.com/Books/Java/JavaHowtoProgram7e/tabid/1191/Default.aspx)
>
>
> |
37,868,138 | I'm very new to programming and have been asked to solve a program for work. Right now we are dealing with a typical 0/1 Knapsack problem, in which the benefit/value is maximized given mass and volume constraints.
My task is to basically reverse this and minimize either the volume or mass given a value constraint. In... | 2016/06/16 | [
"https://Stackoverflow.com/questions/37868138",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6476333/"
] | Let's call the weight of item i w(i), and its value v(i). Order the items arbitrarily, and define f(i, j) to be the minimum possible capacity of a knapsack that holds a subset of the first i items totalling at least a value of j.
To calculate f(i, j), we can either include the ith item or not in the knapsack, so
```
... | If I understand your question correctly, the problem you wish to solve is on the form:
```
let mass_i be the mass of item i, let vol_i the volume, and let val_i be its value.
Let x_i be a binary variable, where x_i is one if and only if the item is in the knapsack.
minimize (mass_1 * x_1 + ... + mass_n * x_n) //The c... |
22,624,232 | I have an instance in a method that is like this
```
@existinguser = User.where("trial_account_made_by = !nil? ")
```
I want to return all users where the trial\_account\_made\_by ( a column in users table) is not nil. How do I pass that to where? | 2014/03/25 | [
"https://Stackoverflow.com/questions/22624232",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1336855/"
] | Using reactivity for dealing with hover states is, slightly speaking, an overkill. Such things are easily handled by css alone:
```
<div class="box">
<div class="boxContent">...</div>
<div class="boxExtra">...</div>
</div>
.boxExtra {
display: none;
}
.box:hover .boxExtra {
display: block;
}
``` | What you are trying to do sounds very similar to how a 'selected' player gets highlighted in the [leaderboard example](https://github.com/meteor/meteor/tree/devel/examples/leaderboard).
Since both your helper and your mouseover event have access to some context from the template calling them you can make use of that ... |
12,172,962 | I have a subform which displays the results from a saved query.
Now I want to change to another query.
```
Me.SF_Results.Form.RecordSource = "NewQuery"
```
It works but the columns which were in the old query and are not in the new query are still displayed and show #Name? in every cell.
How can I update the column... | 2012/08/29 | [
"https://Stackoverflow.com/questions/12172962",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1119505/"
] | ```
dependent: :destroy
```
is alternate syntax for:
```
:dependent => :destroy
```
It's [new in Ruby 1.9](http://nuclearsquid.com/writings/ruby-1-9-what-s-new-what-s-changed/#new-stuff-in-ruby-19).
`:dependent`, `:destroy` and `:bonus_card` are all [symbols](http://www.robertsosinski.com/2009/01/11/the-differenc... | it is new syntax in ruby 1.9
```
dependent: :destroy
```
which is alternative of this
```
:dependent => :destroy
```
i think you are new in ruby because experienced person has idea about it and if you scaffold then dependent: :destroy this code is generated by rails by default now.
:dependent ,:destroy and ... |
12,172,962 | I have a subform which displays the results from a saved query.
Now I want to change to another query.
```
Me.SF_Results.Form.RecordSource = "NewQuery"
```
It works but the columns which were in the old query and are not in the new query are still displayed and show #Name? in every cell.
How can I update the column... | 2012/08/29 | [
"https://Stackoverflow.com/questions/12172962",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1119505/"
] | ```
dependent: :destroy
```
is alternate syntax for:
```
:dependent => :destroy
```
It's [new in Ruby 1.9](http://nuclearsquid.com/writings/ruby-1-9-what-s-new-what-s-changed/#new-stuff-in-ruby-19).
`:dependent`, `:destroy` and `:bonus_card` are all [symbols](http://www.robertsosinski.com/2009/01/11/the-differenc... | In Ruby, `:something` is a symbol. A symbol is a reference kept in memory and looked up quickly, so that it is a nice data type to use as hash keys. A Ruby Hash usually looks like:
```
{ :some_key => "some data", :other_key => 65536, :yet_another_key => :symbol_as_data }
```
Ruby 1.9 introduced a shorthand notation ... |
4,077,175 | I'm looking for a way to dynamically change an elements properties.
For example I want the user of my app to be able to enter a value within my program that will change android:layout\_marginTop="blabla" to whatever I want. It doesn't specifically have to be that property, I want to be able to change any property of ... | 2010/11/02 | [
"https://Stackoverflow.com/questions/4077175",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/494661/"
] | Depends which kind of property you are willing to change.
For some you have methods in the `View` object and for other using `LayoutParameters`.
You can check the following questions which answers similar stuff:
* [Set margins in a LinearLayout programmatically](https://stackoverflow.com/questions/2481455/set-margins... | You can use this way by defining layout params and define it in your view.
```
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT);
lp.setMargins(30, 0, 0, 0);
lp.height = "100";
lp.width = "100";
button.setLayoutParams(lp)... |
264,753 | Introduce the $2^{n-1}\times 2^{n-1}$ matrix $B\_n$ recursively as follows: $B\_1(b\_1)=\begin{pmatrix} b\_1\end{pmatrix}$ and
$$B\_n(b\_1,\dots,b\_n)=\begin{pmatrix} B\_{n-1}(b\_1,\dots,b\_{n-1})& b\_nJ\_{n-1}\\ b\_nJ\_{n-1}&B\_{n-1}(b\_1,\dots,b\_{n-1})
\end{pmatrix}.$$
Here $J\_n$ is a $2^{n-1}\times 2^{n-1}$ matrix... | 2017/03/16 | [
"https://mathoverflow.net/questions/264753",
"https://mathoverflow.net",
"https://mathoverflow.net/users/66131/"
] | For a vector $v$ of length $2^{n-2}$, denote by $v'$ the "mirrored" vector $J\_{n-1}v$.
If $v$ is an eigenvector of $B\_{n-1}$ for the eigenvalue $\lambda$, then $B\_n\binom v{\pm v'}=(\lambda\pm b\_n)\binom v{\pm v'}$. So this gives you all the eigenvalues of $B\_n$ as the sums $ b\_1\pm\cdots\pm b\_n$ (note that $ b... | Yes and No. On the one hand, you can prove by a simple induction that $B\_n$ commutes with $J\_n$. Now, $B\_n$ appears to be given blockwise, where all the blocks commute with each other. This allows you to write that the determinant of $B\_n$ is the ``determinant of determinants'' (this is false for non-commuting bloc... |
37,892,340 | As I said in title my problem is I can't hover just one element. I gave some effect but each element is affected. I know it's a simple question and I search google and stackoverflow, I found. But any solution is working.
İn the codes are here: <https://jsfiddle.net/dty0wth0/>
Also I tried that too:
```
$("sectio... | 2016/06/18 | [
"https://Stackoverflow.com/questions/37892340",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4319103/"
] | You have an addressing problem.
This hovers the div (entire image), and only works with the span.
```
$("section#box div").hover(
function() {
$('span', this).css({'transition':'1s','top':'80px'})
},
function() {
$('span', this).css({'transition':'1s','top':'-80px'});
}
);
```
Although, fran... | use jQuerys hover which handles both the mouse in function and hte mouse out function:
```
$("section #box").hover(
function() {
$('section #box span').css({'transition':'1s','top':'80px'})}
,function() {
$('section #box span').css({'transition':'1s','top':'-80px'});
}
);
```
also you could proaba... |
37,892,340 | As I said in title my problem is I can't hover just one element. I gave some effect but each element is affected. I know it's a simple question and I search google and stackoverflow, I found. But any solution is working.
İn the codes are here: <https://jsfiddle.net/dty0wth0/>
Also I tried that too:
```
$("sectio... | 2016/06/18 | [
"https://Stackoverflow.com/questions/37892340",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4319103/"
] | You have an addressing problem.
This hovers the div (entire image), and only works with the span.
```
$("section#box div").hover(
function() {
$('span', this).css({'transition':'1s','top':'80px'})
},
function() {
$('span', this).css({'transition':'1s','top':'-80px'});
}
);
```
Although, fran... | 1. You have a lot of syntax errors (missing comma after function, extra parentheses)
2. You have a lot of unnecessary code (section selector, extra *this* context)
3. You need to include a library that has that method (for instance, jQuery) as you did not attach jQuery to your fiddle
### [jsFiddle](https://jsfiddle.ne... |
37,892,340 | As I said in title my problem is I can't hover just one element. I gave some effect but each element is affected. I know it's a simple question and I search google and stackoverflow, I found. But any solution is working.
İn the codes are here: <https://jsfiddle.net/dty0wth0/>
Also I tried that too:
```
$("sectio... | 2016/06/18 | [
"https://Stackoverflow.com/questions/37892340",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4319103/"
] | You have an addressing problem.
This hovers the div (entire image), and only works with the span.
```
$("section#box div").hover(
function() {
$('span', this).css({'transition':'1s','top':'80px'})
},
function() {
$('span', this).css({'transition':'1s','top':'-80px'});
}
);
```
Although, fran... | I cannot comment so Ill do it here...
I guess you will need to do is showen here:
<https://css-tricks.com/text-blocks-over-image/> |
37,892,340 | As I said in title my problem is I can't hover just one element. I gave some effect but each element is affected. I know it's a simple question and I search google and stackoverflow, I found. But any solution is working.
İn the codes are here: <https://jsfiddle.net/dty0wth0/>
Also I tried that too:
```
$("sectio... | 2016/06/18 | [
"https://Stackoverflow.com/questions/37892340",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4319103/"
] | You have an addressing problem.
This hovers the div (entire image), and only works with the span.
```
$("section#box div").hover(
function() {
$('span', this).css({'transition':'1s','top':'80px'})
},
function() {
$('span', this).css({'transition':'1s','top':'-80px'});
}
);
```
Although, fran... | You should add the span to your main selector then your mouseenterer and mouseleave will be wrapped in that context.
```
$("section #box span").mouseenter(function() {
$(this).css({'transition':'1s','top':'80px','text-size':'25px'});
}).mouseleave(function() {
$(this).css({'transiti... |
110,122 | I previously installed Ubuntu on a USB drive. I have since lost it or deleted the data and when I go to try to install it says it is already installed on the usb drive letter. How can I fix this?
This is the error that I'm getting. I do not have the USB drive or it is deleted. I have 10-15 usb drives and have no clue... | 2012/03/05 | [
"https://askubuntu.com/questions/110122",
"https://askubuntu.com",
"https://askubuntu.com/users/49252/"
] | >
> Its look like you have a grub entry which is created using bcdedit ?!
> Go to Windows control panel and check whether there is "Wubi
> uninstaller" menu or not. If it is there then use it to completely
> uninstall previous Ubuntu. Use CCleaner to clean the registry
> afterwards.
>
>
>
– [Curious Apprentice... | Just do a low-level format on that USB drive. |
110,122 | I previously installed Ubuntu on a USB drive. I have since lost it or deleted the data and when I go to try to install it says it is already installed on the usb drive letter. How can I fix this?
This is the error that I'm getting. I do not have the USB drive or it is deleted. I have 10-15 usb drives and have no clue... | 2012/03/05 | [
"https://askubuntu.com/questions/110122",
"https://askubuntu.com",
"https://askubuntu.com/users/49252/"
] | >
> Its look like you have a grub entry which is created using bcdedit ?!
> Go to Windows control panel and check whether there is "Wubi
> uninstaller" menu or not. If it is there then use it to completely
> uninstall previous Ubuntu. Use CCleaner to clean the registry
> afterwards.
>
>
>
– [Curious Apprentice... | with some download installs, windows installs from a temp folder (not the download location), it deletes the files after. Look in `C:\Users\%username%\AppData\Local\Temp`, `%\AppData\%` is a hidden folder so you might need to change your `Folder options`. In `%\Temp` you can find `{7a113f87 ....` and delete it, then ru... |
15,470,233 | I am having problems when I call this code in my webpage:
```
<?php $chat->printChat(); ?>
```
This line of code calls the chatroom ( phpfreechat ) that uses prototype.js 1.6.0.2
After I call this, my jQuery.js stops working. But when I call my jQuery.js after the calling of chat the jQuery works but the Chat doesnt... | 2013/03/18 | [
"https://Stackoverflow.com/questions/15470233",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2180264/"
] | use `jQuery.noConflict()` because you are using `prototype` so that is conflicting with `jQuery`.
>
> **Description:** Relinquish jQuery's control of the `$` variable.
>
>
> Many JavaScript libraries use `$` as a function or variable name, just as `jQuery` does. In `jQuery's` case, `$` is just an alias for `jQuery`... | Best way is to wrap your all jQuery code inside self executing function in which jQuery is passed as argument.
```
(function ($) {
// Your jQuery code which can safely use `$`
..
..
}(jQuery));
```
You can also use,
```
jQuery(document).ready(function($) {
...
//Your jQuery code with which can safely u... |
48,221,748 | I'm working on jest unit testing using `react-test-renderer`.The test cases fails and showing this error
>
> "TypeError: this.props.myMaterials.fetch is not a function"
>
>
>
where `this.props.notes.fetch` is inside the `componentWillMount`.Is there any solution to fix this without using enzyme?
myComponent.jsx... | 2018/01/12 | [
"https://Stackoverflow.com/questions/48221748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7701101/"
] | Its pretty evident from the error that while testing you are not supplying the prop `notes` which is being used in your `componentWillMount` function. Pass it when you are creating an instance for testing and it should work.
All you need to do is this
```
const notes = {
fetch: jest.fn()
}
const tree = renderer.... | Have you tried giving your component a stub notes.fetch function?
```
Let isFetched = false;
const fakeNotes = {
fetch: () => isFetched = true
}
```
That way you can test that fetch is called without making a request. I'm not sure, but the test runner is running in node, and I think you may need to require fetch i... |
48,221,748 | I'm working on jest unit testing using `react-test-renderer`.The test cases fails and showing this error
>
> "TypeError: this.props.myMaterials.fetch is not a function"
>
>
>
where `this.props.notes.fetch` is inside the `componentWillMount`.Is there any solution to fix this without using enzyme?
myComponent.jsx... | 2018/01/12 | [
"https://Stackoverflow.com/questions/48221748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7701101/"
] | Have you tried giving your component a stub notes.fetch function?
```
Let isFetched = false;
const fakeNotes = {
fetch: () => isFetched = true
}
```
That way you can test that fetch is called without making a request. I'm not sure, but the test runner is running in node, and I think you may need to require fetch i... | Pass notes as props to your component like `<myComponent.WrappedComponent notes={<here>} />` and also put a check like `this.props.notes && this.props.notes.fetch` so that even if your props aren't passed you don't get an error. |
48,221,748 | I'm working on jest unit testing using `react-test-renderer`.The test cases fails and showing this error
>
> "TypeError: this.props.myMaterials.fetch is not a function"
>
>
>
where `this.props.notes.fetch` is inside the `componentWillMount`.Is there any solution to fix this without using enzyme?
myComponent.jsx... | 2018/01/12 | [
"https://Stackoverflow.com/questions/48221748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7701101/"
] | Its pretty evident from the error that while testing you are not supplying the prop `notes` which is being used in your `componentWillMount` function. Pass it when you are creating an instance for testing and it should work.
All you need to do is this
```
const notes = {
fetch: jest.fn()
}
const tree = renderer.... | Pass notes as props to your component like `<myComponent.WrappedComponent notes={<here>} />` and also put a check like `this.props.notes && this.props.notes.fetch` so that even if your props aren't passed you don't get an error. |
63,613,571 | **This is not about Spring Boot at all.**
*My English could be better.*
Using below Config for Spring Data I'm trying to execute DML requests.
Exactly `CrudRepository#save` method.
However executing Spring's CrudRepository#save method I'm getting next:
1. ONLY Selects are logged by `hibernate.show_sql` feature.
2.... | 2020/08/27 | [
"https://Stackoverflow.com/questions/63613571",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11814208/"
] | Finally, I've found a solution for my case.
Since I'm using Spring without its Boot part
I had to configure custom *WebApplicationInitializer* to let Spring manage application entry point:
```
public class MainWebAppInitializer implements WebApplicationInitializer
{
@Override
public void onStartup(final Servl... | I didnot get this, how you are initializing the datasource properties ? I could not see in your given code.
```
factory.setDataSource(dataSource());
```
You should be designing you Configuration class like below. Use both the :
```
entityManagerFactoryRef="entityManagerFactory",
transactionManagerRef="jpaTransactio... |
273,457 | I've been using Mint for 2 years but am still new to Linux. I had the default QGIS version (2.0 I think) installed and it worked great, but I tried to upgrade and lost even that. After experimenting I finally got rid of these 2 dependency problems
cpp-4.8 : Depends: gcc-4.8-base (= 4.8.4-2ubuntu1~14.04.3) but 4.8.4-2u... | 2018/03/03 | [
"https://gis.stackexchange.com/questions/273457",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/115690/"
] | Strange. I just updated from 2.14.11 to 2.18.17 on Mint 17.3 using `https://qgis.org/ubuntugis-ltr trusty main` as an additional repo without errors.
Disabling the qgis.org repo, and using only the ubuntugis unstable ppa throws the same error as you got. Seems to be a packaging error.
The dependent package is availa... | This is a Virtual Machine of Linux Mint 18.1 for QGIS 3.0.
[](https://i.stack.imgur.com/l6Ka2.png)
```
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
If qgis installed:
sudo apt-get upgrade
If you do not have qgis instal... |
359,976 | Let $N=\operatorname{GL}\_n(\mathbb{R})$ and $M=\operatorname{SL}\_n(\mathbb{R})$. Is $M$ normal subgroup in $N$? Why or why not?
I know how to do this with $\operatorname{GL}\_2(\mathbb{R})$ and $\operatorname{SL}\_2(\mathbb{R})$ but with $N=\operatorname{GL}\_n(\mathbb{R})$ and $M=\operatorname{SL}\_n(\mathbb{R})$ I... | 2013/04/13 | [
"https://math.stackexchange.com/questions/359976",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/70868/"
] | Remember that $H$ is normal in $G$ if $ghg^{-1} \in H$ for all $g \in G$, $h \in H$. Also note that for square matrices $A, B$ we have $\det(AB) = \det(A)\det(B)$. | Hint:
Is the determinant map
$$\det:GL\_n(\Bbb R)\to\Bbb R^\*\,$$
a homomorphism....? |
37,672,277 | Is there any free social login modules (for twitter and facebook) available for drupal 8? I have checked OpenID Connect module, but it does not support facebook and twitter logins. Please advice, if there are any stable modules available for this.
Thanks, | 2016/06/07 | [
"https://Stackoverflow.com/questions/37672277",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6409841/"
] | You can use oneAll social login. It covers 25+ social networks and works well. Download [here](https://www.drupal.org/project/social_login) | For facebook login module in d8 you can use <https://www.drupal.org/project/simple_fb_connect>
For twitter login <https://www.drupal.org/project/twitter>.
But twitter module is in dev version so it is not functional yet.You can take inspiration from d7 version and try to upgrade |
37,672,277 | Is there any free social login modules (for twitter and facebook) available for drupal 8? I have checked OpenID Connect module, but it does not support facebook and twitter logins. Please advice, if there are any stable modules available for this.
Thanks, | 2016/06/07 | [
"https://Stackoverflow.com/questions/37672277",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6409841/"
] | There are two different modules
* social\_auth\_facebook
* social\_auth\_twitter
Which are based on `social_api` and `social_auth` modules. Create app in twitter and facebook and get the app\_id and secret key and configure them under configuration> Social API Setting> Twitter/Facebook | For facebook login module in d8 you can use <https://www.drupal.org/project/simple_fb_connect>
For twitter login <https://www.drupal.org/project/twitter>.
But twitter module is in dev version so it is not functional yet.You can take inspiration from d7 version and try to upgrade |
649,738 | Show that the equation
$$\{x^3\}+\{y^3\}=\{z^3\}$$
has infinitely many rational non-integers solutions,Here,$\{a\}$ denotes the fractional part of $a$
I have solve this follow two problem
**the equation 1:**
$$\{x\}+\{y\}=\{z\}$$
has infinitely many rational non-integers solutions.
I take $$x=n+0.2,y=n+0.3,z=n+0.5... | 2014/01/24 | [
"https://math.stackexchange.com/questions/649738",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/58742/"
] | For any $n > 2$, pick any $m > 1$ such that $\gcd(m,n) = 1$. Notice
$$\gcd(m,n) = 1 \implies \gcd(m^n,n) = 1$$
We can define a number $\lambda$ by
$$\lambda = \text{mod}( n^{\varphi(m^n)-1}, m^n )$$
where $\varphi(x)$ is the [Euler's totient function](http://en.wikipedia.org/wiki/Euler%27s_totient_function) and $\lamb... | **Hint**
$$\{80.8^3\}+\{36.9^3\}=\{24.1^3\}$$
$$\{8.8^3\}+\{3.9^3\}=\{3.1^3\}$$ |
649,738 | Show that the equation
$$\{x^3\}+\{y^3\}=\{z^3\}$$
has infinitely many rational non-integers solutions,Here,$\{a\}$ denotes the fractional part of $a$
I have solve this follow two problem
**the equation 1:**
$$\{x\}+\{y\}=\{z\}$$
has infinitely many rational non-integers solutions.
I take $$x=n+0.2,y=n+0.3,z=n+0.5... | 2014/01/24 | [
"https://math.stackexchange.com/questions/649738",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/58742/"
] | For any $n > 2$, pick any $m > 1$ such that $\gcd(m,n) = 1$. Notice
$$\gcd(m,n) = 1 \implies \gcd(m^n,n) = 1$$
We can define a number $\lambda$ by
$$\lambda = \text{mod}( n^{\varphi(m^n)-1}, m^n )$$
where $\varphi(x)$ is the [Euler's totient function](http://en.wikipedia.org/wiki/Euler%27s_totient_function) and $\lamb... | Consider any prime $p$ such that $p \equiv\_3 2 \\$.
**Claim:** Every number in $\mathbb{F}\_{p^3 \setminus pZ}$ is a cubic residue.
**Proof:** Consider primitive root $g$ modulo $p^3$,by its definition it generates all of $\mathbb{F}\_{p^3 \setminus pZ}$.Let $h=g^3$ as$(3,\phi(p^3))=1$ $\implies$ $h$ is also a primi... |
2,936,403 | This is the function:
$$ f(x)=\begin{cases}\sin x& \text{if $x$ is rational}\\x &\text{if $x$ is irrational}\end{cases} $$
My attempt:
It is continuous at $x=0$ which is easily verified using the sequential definition of continuity.
I claim that $f$ is differentiable at $x=0$ and $f'(0)=1$.
Proof of claim:
Let $\var... | 2018/09/30 | [
"https://math.stackexchange.com/questions/2936403",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/151611/"
] | Well done. This is OK. You need not write that $f$ is continuous at $0$ becase you have proved considerably more. Differentiability implies continuity. | Your proof is correct. But you also asked for alternative approaches. Here is one.
Define $g$ by $g(x)=x$. Then $f-g$ is $O(x^2)$ as $x\to 0$ (because $\sin x=x+O(x^2)$ as $x\to0$).
[Therefore](https://math.stackexchange.com/questions/1867893/if-fx-ox2-as-x-to0-does-it-follow-that-f0-0-and-that-f-is-differ) $f-g$ is ... |
7,504,967 | I am looking at the Honeycomb Gallery sample code ([here](http://developer.android.com/resources/samples/HoneycombGallery/index.html)) and I ran across the following code while trying to add action items in my own app:
```
<item android:id="@+id/camera"
android:title="Camera"
android:icon="?attr/menuIconCamera... | 2011/09/21 | [
"https://Stackoverflow.com/questions/7504967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/451037/"
] | I know this post is very old, but I feel the following explanation will help beginners understand it easily.
So in layman's terms,
`someAttribute="?attr/attributeName"` means -
>
> set the value of **someAttribute** to whatever is the value of **attributeName** in current theme
>
>
>
A common example occurs in ... | This blog post does an amazing job going over how to reference values for style-attributes that are defined in the current theme:
<https://trickyandroid.com/android-resources-and-style-attributes-cheatsheet/>
* When you see `?` notation - it means that we are trying to reference a style attribute - a value
which may v... |
7,504,967 | I am looking at the Honeycomb Gallery sample code ([here](http://developer.android.com/resources/samples/HoneycombGallery/index.html)) and I ran across the following code while trying to add action items in my own app:
```
<item android:id="@+id/camera"
android:title="Camera"
android:icon="?attr/menuIconCamera... | 2011/09/21 | [
"https://Stackoverflow.com/questions/7504967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/451037/"
] | The `?attr/menuIconCamera` value means that an icon from `menuIconCamera` attribute of the current theme will be used.
There must be a drawable assigned to the `menuIconCamera` attribute somewhere in the `themes.xml` file. If there're two themes with different values of this attribute then actual icon will depend on a... | This blog post does an amazing job going over how to reference values for style-attributes that are defined in the current theme:
<https://trickyandroid.com/android-resources-and-style-attributes-cheatsheet/>
* When you see `?` notation - it means that we are trying to reference a style attribute - a value
which may v... |
7,504,967 | I am looking at the Honeycomb Gallery sample code ([here](http://developer.android.com/resources/samples/HoneycombGallery/index.html)) and I ran across the following code while trying to add action items in my own app:
```
<item android:id="@+id/camera"
android:title="Camera"
android:icon="?attr/menuIconCamera... | 2011/09/21 | [
"https://Stackoverflow.com/questions/7504967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/451037/"
] | The `?attr/menuIconCamera` value means that an icon from `menuIconCamera` attribute of the current theme will be used.
There must be a drawable assigned to the `menuIconCamera` attribute somewhere in the `themes.xml` file. If there're two themes with different values of this attribute then actual icon will depend on a... | The `?attr:` syntax is used for accessing attributes of current theme. See [referencing style attributes](http://developer.android.com/guide/topics/resources/accessing-resources.html#ReferencesToThemeAttributes). |
7,504,967 | I am looking at the Honeycomb Gallery sample code ([here](http://developer.android.com/resources/samples/HoneycombGallery/index.html)) and I ran across the following code while trying to add action items in my own app:
```
<item android:id="@+id/camera"
android:title="Camera"
android:icon="?attr/menuIconCamera... | 2011/09/21 | [
"https://Stackoverflow.com/questions/7504967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/451037/"
] | The `?attr:` syntax is used for accessing attributes of current theme. See [referencing style attributes](http://developer.android.com/guide/topics/resources/accessing-resources.html#ReferencesToThemeAttributes). | I know this post is very old, but I feel the following explanation will help beginners understand it easily.
So in layman's terms,
`someAttribute="?attr/attributeName"` means -
>
> set the value of **someAttribute** to whatever is the value of **attributeName** in current theme
>
>
>
A common example occurs in ... |
7,504,967 | I am looking at the Honeycomb Gallery sample code ([here](http://developer.android.com/resources/samples/HoneycombGallery/index.html)) and I ran across the following code while trying to add action items in my own app:
```
<item android:id="@+id/camera"
android:title="Camera"
android:icon="?attr/menuIconCamera... | 2011/09/21 | [
"https://Stackoverflow.com/questions/7504967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/451037/"
] | The `?attr/menuIconCamera` value means that an icon from `menuIconCamera` attribute of the current theme will be used.
There must be a drawable assigned to the `menuIconCamera` attribute somewhere in the `themes.xml` file. If there're two themes with different values of this attribute then actual icon will depend on a... | This is for refering style Attributes. see R.attr
```
?[<package_name>:][<resource_type>/]<resource_name>
```
[Referencing style attributes](http://developer.android.com/guide/topics/resources/accessing-resources.html#ReferencesToThemeAttributes) |
7,504,967 | I am looking at the Honeycomb Gallery sample code ([here](http://developer.android.com/resources/samples/HoneycombGallery/index.html)) and I ran across the following code while trying to add action items in my own app:
```
<item android:id="@+id/camera"
android:title="Camera"
android:icon="?attr/menuIconCamera... | 2011/09/21 | [
"https://Stackoverflow.com/questions/7504967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/451037/"
] | The `?attr/menuIconCamera` value means that an icon from `menuIconCamera` attribute of the current theme will be used.
There must be a drawable assigned to the `menuIconCamera` attribute somewhere in the `themes.xml` file. If there're two themes with different values of this attribute then actual icon will depend on a... | I know this post is very old, but I feel the following explanation will help beginners understand it easily.
So in layman's terms,
`someAttribute="?attr/attributeName"` means -
>
> set the value of **someAttribute** to whatever is the value of **attributeName** in current theme
>
>
>
A common example occurs in ... |
7,504,967 | I am looking at the Honeycomb Gallery sample code ([here](http://developer.android.com/resources/samples/HoneycombGallery/index.html)) and I ran across the following code while trying to add action items in my own app:
```
<item android:id="@+id/camera"
android:title="Camera"
android:icon="?attr/menuIconCamera... | 2011/09/21 | [
"https://Stackoverflow.com/questions/7504967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/451037/"
] | I know this post is very old, but I feel the following explanation will help beginners understand it easily.
So in layman's terms,
`someAttribute="?attr/attributeName"` means -
>
> set the value of **someAttribute** to whatever is the value of **attributeName** in current theme
>
>
>
A common example occurs in ... | This is for refering style Attributes. see R.attr
```
?[<package_name>:][<resource_type>/]<resource_name>
```
[Referencing style attributes](http://developer.android.com/guide/topics/resources/accessing-resources.html#ReferencesToThemeAttributes) |
7,504,967 | I am looking at the Honeycomb Gallery sample code ([here](http://developer.android.com/resources/samples/HoneycombGallery/index.html)) and I ran across the following code while trying to add action items in my own app:
```
<item android:id="@+id/camera"
android:title="Camera"
android:icon="?attr/menuIconCamera... | 2011/09/21 | [
"https://Stackoverflow.com/questions/7504967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/451037/"
] | The `?attr:` syntax is used for accessing attributes of current theme. See [referencing style attributes](http://developer.android.com/guide/topics/resources/accessing-resources.html#ReferencesToThemeAttributes). | My English is not good, sorry. But I know this question
`android:icon="?attr/menuIconCamera"` want use
attrs.xml
```
<resources>
<declare-styleable name="AppTheme">
<attr name="listDragShadowBackground" format="reference" />
<attr name="menuIconCamera" format="reference" />
<attr name="m... |
7,504,967 | I am looking at the Honeycomb Gallery sample code ([here](http://developer.android.com/resources/samples/HoneycombGallery/index.html)) and I ran across the following code while trying to add action items in my own app:
```
<item android:id="@+id/camera"
android:title="Camera"
android:icon="?attr/menuIconCamera... | 2011/09/21 | [
"https://Stackoverflow.com/questions/7504967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/451037/"
] | The `?attr/menuIconCamera` value means that an icon from `menuIconCamera` attribute of the current theme will be used.
There must be a drawable assigned to the `menuIconCamera` attribute somewhere in the `themes.xml` file. If there're two themes with different values of this attribute then actual icon will depend on a... | My English is not good, sorry. But I know this question
`android:icon="?attr/menuIconCamera"` want use
attrs.xml
```
<resources>
<declare-styleable name="AppTheme">
<attr name="listDragShadowBackground" format="reference" />
<attr name="menuIconCamera" format="reference" />
<attr name="m... |
7,504,967 | I am looking at the Honeycomb Gallery sample code ([here](http://developer.android.com/resources/samples/HoneycombGallery/index.html)) and I ran across the following code while trying to add action items in my own app:
```
<item android:id="@+id/camera"
android:title="Camera"
android:icon="?attr/menuIconCamera... | 2011/09/21 | [
"https://Stackoverflow.com/questions/7504967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/451037/"
] | The `?attr:` syntax is used for accessing attributes of current theme. See [referencing style attributes](http://developer.android.com/guide/topics/resources/accessing-resources.html#ReferencesToThemeAttributes). | This is for refering style Attributes. see R.attr
```
?[<package_name>:][<resource_type>/]<resource_name>
```
[Referencing style attributes](http://developer.android.com/guide/topics/resources/accessing-resources.html#ReferencesToThemeAttributes) |
33,850,169 | I have a function which returns an nxk matrix. Suppose I wanted to take each column of the matrix into a different variable, is there a one line way I can do this?
Currently I am doing (for k=3)
```
A = MyFunc(...);
x1 = A(:, 1);
x2 = A(:, 2);
x3 = A(:, 3);
```
I notice that doing
```
[x1, x2, x3] = MyFunc(...);
... | 2015/11/22 | [
"https://Stackoverflow.com/questions/33850169",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3701257/"
] | NDK is just a set of libraries and binary tools.
Normally, you do not need to "uninstall" it.
To "remove" it, you can:
* delete the ndk folder
* remove NDK environnent variable you have set previously | I am using Android Studio 3.5.3 and could remove or uninstall the obsolete NDK following the procedure listed below:
1. Use Tools->SDK Manager.
2. Go to the "SDK Tools" page in the "Android SDK" menu. REMEMBER to check the checkbox "Show Package Details" at the lower right corner.
3. You'll see all the NDK's you had i... |
37,155,251 | [](https://i.stack.imgur.com/B6KHS.png)
How can I get cell A3 to reflect the the highest value in terms of the bigger numerical number of cloumn A be it a positive or negative value? | 2016/05/11 | [
"https://Stackoverflow.com/questions/37155251",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1570670/"
] | Every eventEmitter object you create is a new instance so events fired from the first one won't be triggered in the second, so the answer to your question is - no, it's not possible.
However, there are other solutions:
I think the best one is to create a centralized common eventEmitter, like so:
```
//firstFile.js
v... | The event listener and emitter can be in two different files. Please see a simple example below:
The first file, let's call it *eventEx.js*
```
var EventEmitter = require('events').EventEmitter
var myEmitter = new EventEmitter();
myEmitter.on('print', (arg) => {
console.log(arg);
})
exports.myEmi... |
37,155,251 | [](https://i.stack.imgur.com/B6KHS.png)
How can I get cell A3 to reflect the the highest value in terms of the bigger numerical number of cloumn A be it a positive or negative value? | 2016/05/11 | [
"https://Stackoverflow.com/questions/37155251",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1570670/"
] | Every eventEmitter object you create is a new instance so events fired from the first one won't be triggered in the second, so the answer to your question is - no, it's not possible.
However, there are other solutions:
I think the best one is to create a centralized common eventEmitter, like so:
```
//firstFile.js
v... | So this is how I use in my testing. I use it with Class semantics
One caveat to note that is, it is always required to register a listener before an event is emitted, because when an event is emitted, it looks for already registered set of listeners and then emits the flow over there.
```
//emitter.js
// The core mod... |
37,155,251 | [](https://i.stack.imgur.com/B6KHS.png)
How can I get cell A3 to reflect the the highest value in terms of the bigger numerical number of cloumn A be it a positive or negative value? | 2016/05/11 | [
"https://Stackoverflow.com/questions/37155251",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1570670/"
] | Every eventEmitter object you create is a new instance so events fired from the first one won't be triggered in the second, so the answer to your question is - no, it's not possible.
However, there are other solutions:
I think the best one is to create a centralized common eventEmitter, like so:
```
//firstFile.js
v... | just another example of node.js event listener in another source file typescript styles.
```
// file 1 (whatever.ts)
import EventEmitter from "events";
const MyEvent = new EventEmitter();
...
// somewhere fire event
MyEvent.emit('push', 'message', {
data: somedata
})
// end of file
export const MyEvents = MyEvent;
... |
37,155,251 | [](https://i.stack.imgur.com/B6KHS.png)
How can I get cell A3 to reflect the the highest value in terms of the bigger numerical number of cloumn A be it a positive or negative value? | 2016/05/11 | [
"https://Stackoverflow.com/questions/37155251",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1570670/"
] | The event listener and emitter can be in two different files. Please see a simple example below:
The first file, let's call it *eventEx.js*
```
var EventEmitter = require('events').EventEmitter
var myEmitter = new EventEmitter();
myEmitter.on('print', (arg) => {
console.log(arg);
})
exports.myEmi... | just another example of node.js event listener in another source file typescript styles.
```
// file 1 (whatever.ts)
import EventEmitter from "events";
const MyEvent = new EventEmitter();
...
// somewhere fire event
MyEvent.emit('push', 'message', {
data: somedata
})
// end of file
export const MyEvents = MyEvent;
... |
37,155,251 | [](https://i.stack.imgur.com/B6KHS.png)
How can I get cell A3 to reflect the the highest value in terms of the bigger numerical number of cloumn A be it a positive or negative value? | 2016/05/11 | [
"https://Stackoverflow.com/questions/37155251",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1570670/"
] | So this is how I use in my testing. I use it with Class semantics
One caveat to note that is, it is always required to register a listener before an event is emitted, because when an event is emitted, it looks for already registered set of listeners and then emits the flow over there.
```
//emitter.js
// The core mod... | just another example of node.js event listener in another source file typescript styles.
```
// file 1 (whatever.ts)
import EventEmitter from "events";
const MyEvent = new EventEmitter();
...
// somewhere fire event
MyEvent.emit('push', 'message', {
data: somedata
})
// end of file
export const MyEvents = MyEvent;
... |
58,068,392 | I have a list (list.txt) which consists of names like so:
James
Heather
Daniel
Peter
The list goes on up to 100 people, my goal is to number the first 3 (x) '1.' the next 3 (x) '2.' and so on.
I have managed to number each person but the number increases as expected with no repetition.
Preferably I want to print th... | 2019/09/23 | [
"https://Stackoverflow.com/questions/58068392",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11927686/"
] | ```
f = open('list.txt', 'w')
c = open('test.txt')
lines = c.readlines()
counter = 0
for i in range(len(lines)):
if i%3 == 0:
counter+=1
f.write("{}.{}".format(counter, lines[i]))
f.close()
```
Here is what you want. It works exactly as you said. | Not the most straightforward way, but at least it works:
```
string = 'James Heather Daniel Peter Frank Sam Jeff'
string_list = string.split() #Turn string into list
k = 3 #Group size
needed_numbers =range(int(np.ceil(len(string_list)/k))) #Divide len by k and round upwards
numbers_list = [y+1 for x in needed_numbers ... |
58,068,392 | I have a list (list.txt) which consists of names like so:
James
Heather
Daniel
Peter
The list goes on up to 100 people, my goal is to number the first 3 (x) '1.' the next 3 (x) '2.' and so on.
I have managed to number each person but the number increases as expected with no repetition.
Preferably I want to print th... | 2019/09/23 | [
"https://Stackoverflow.com/questions/58068392",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11927686/"
] | Simply using `index // group_size` as the key gives what you want:
```
f = open('list.txt', 'w')
c = open('Groups.txt')
group_size = 3
for index, value in enumerate(f, group_size):
f.write("{}.{}".format(index // group_size, value))
f.close()
``` | Not the most straightforward way, but at least it works:
```
string = 'James Heather Daniel Peter Frank Sam Jeff'
string_list = string.split() #Turn string into list
k = 3 #Group size
needed_numbers =range(int(np.ceil(len(string_list)/k))) #Divide len by k and round upwards
numbers_list = [y+1 for x in needed_numbers ... |
58,068,392 | I have a list (list.txt) which consists of names like so:
James
Heather
Daniel
Peter
The list goes on up to 100 people, my goal is to number the first 3 (x) '1.' the next 3 (x) '2.' and so on.
I have managed to number each person but the number increases as expected with no repetition.
Preferably I want to print th... | 2019/09/23 | [
"https://Stackoverflow.com/questions/58068392",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11927686/"
] | ```
f = open('list.txt', 'w')
c = open('test.txt')
lines = c.readlines()
counter = 0
for i in range(len(lines)):
if i%3 == 0:
counter+=1
f.write("{}.{}".format(counter, lines[i]))
f.close()
```
Here is what you want. It works exactly as you said. | ```
index = 0
group = 1
for _ in range(0, 10):
index += 1
print(f"{group}:{index}")
if index % 3 == 0:
group += 1
```
<https://docs.python.org/3.7/library/functions.html#divmod> |
58,068,392 | I have a list (list.txt) which consists of names like so:
James
Heather
Daniel
Peter
The list goes on up to 100 people, my goal is to number the first 3 (x) '1.' the next 3 (x) '2.' and so on.
I have managed to number each person but the number increases as expected with no repetition.
Preferably I want to print th... | 2019/09/23 | [
"https://Stackoverflow.com/questions/58068392",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11927686/"
] | ```
f = open('list.txt', 'w')
c = open('test.txt')
lines = c.readlines()
counter = 0
for i in range(len(lines)):
if i%3 == 0:
counter+=1
f.write("{}.{}".format(counter, lines[i]))
f.close()
```
Here is what you want. It works exactly as you said. | Simply using `index // group_size` as the key gives what you want:
```
f = open('list.txt', 'w')
c = open('Groups.txt')
group_size = 3
for index, value in enumerate(f, group_size):
f.write("{}.{}".format(index // group_size, value))
f.close()
``` |
58,068,392 | I have a list (list.txt) which consists of names like so:
James
Heather
Daniel
Peter
The list goes on up to 100 people, my goal is to number the first 3 (x) '1.' the next 3 (x) '2.' and so on.
I have managed to number each person but the number increases as expected with no repetition.
Preferably I want to print th... | 2019/09/23 | [
"https://Stackoverflow.com/questions/58068392",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11927686/"
] | Simply using `index // group_size` as the key gives what you want:
```
f = open('list.txt', 'w')
c = open('Groups.txt')
group_size = 3
for index, value in enumerate(f, group_size):
f.write("{}.{}".format(index // group_size, value))
f.close()
``` | ```
index = 0
group = 1
for _ in range(0, 10):
index += 1
print(f"{group}:{index}")
if index % 3 == 0:
group += 1
```
<https://docs.python.org/3.7/library/functions.html#divmod> |
11,936,216 | I found out that render targets in c# / xna are not automatically disposed of, and you have to call the .dispose() member to get rid of them.
I thought garbage collection was suppose to automatically get rid of things after all their references are gone, what gives?
Is there anything else that is not disposed of auto... | 2012/08/13 | [
"https://Stackoverflow.com/questions/11936216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1587463/"
] | Even with automatic garbage collecting it is still a good idea to call `Dispose` when you are sure you won't use the instance again.
Or use the `using` statement.
That way you can choose when you want to have the object "disposed" instead of waiting until the garbage collector does it. | My opinion is that if an object has a Dispose method, it probably needs to be disposed. I usually try to put it in a block with a 'using' statement. This will automatically call the Dispose method at the end of the block. |
11,936,216 | I found out that render targets in c# / xna are not automatically disposed of, and you have to call the .dispose() member to get rid of them.
I thought garbage collection was suppose to automatically get rid of things after all their references are gone, what gives?
Is there anything else that is not disposed of auto... | 2012/08/13 | [
"https://Stackoverflow.com/questions/11936216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1587463/"
] | >
> I thought garbage collection was suppose to automatically get rid of things after all their references are gone, what gives?
>
>
>
This is incorrect in two ways.
Garbage collection collects **managed memory** that it is safe to collect, and is needed. That's it.
Think of garbage collection as a way to simula... | Even with automatic garbage collecting it is still a good idea to call `Dispose` when you are sure you won't use the instance again.
Or use the `using` statement.
That way you can choose when you want to have the object "disposed" instead of waiting until the garbage collector does it. |
11,936,216 | I found out that render targets in c# / xna are not automatically disposed of, and you have to call the .dispose() member to get rid of them.
I thought garbage collection was suppose to automatically get rid of things after all their references are gone, what gives?
Is there anything else that is not disposed of auto... | 2012/08/13 | [
"https://Stackoverflow.com/questions/11936216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1587463/"
] | The reason that `IDisposable` exists is to support exceptional cases where the garbage collection can't [effectively] manage an objects memory. The primary reason for it's existence is for releasing unmanaged resources.
One of the common cases of this is interaction with unmanaged memory. When an object is doing some... | My opinion is that if an object has a Dispose method, it probably needs to be disposed. I usually try to put it in a block with a 'using' statement. This will automatically call the Dispose method at the end of the block. |
11,936,216 | I found out that render targets in c# / xna are not automatically disposed of, and you have to call the .dispose() member to get rid of them.
I thought garbage collection was suppose to automatically get rid of things after all their references are gone, what gives?
Is there anything else that is not disposed of auto... | 2012/08/13 | [
"https://Stackoverflow.com/questions/11936216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1587463/"
] | >
> I thought garbage collection was suppose to automatically get rid of things after all their references are gone, what gives?
>
>
>
This is incorrect in two ways.
Garbage collection collects **managed memory** that it is safe to collect, and is needed. That's it.
Think of garbage collection as a way to simula... | My opinion is that if an object has a Dispose method, it probably needs to be disposed. I usually try to put it in a block with a 'using' statement. This will automatically call the Dispose method at the end of the block. |
11,936,216 | I found out that render targets in c# / xna are not automatically disposed of, and you have to call the .dispose() member to get rid of them.
I thought garbage collection was suppose to automatically get rid of things after all their references are gone, what gives?
Is there anything else that is not disposed of auto... | 2012/08/13 | [
"https://Stackoverflow.com/questions/11936216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1587463/"
] | >
> I thought garbage collection was suppose to automatically get rid of things after all their references are gone, what gives?
>
>
>
This is incorrect in two ways.
Garbage collection collects **managed memory** that it is safe to collect, and is needed. That's it.
Think of garbage collection as a way to simula... | The reason that `IDisposable` exists is to support exceptional cases where the garbage collection can't [effectively] manage an objects memory. The primary reason for it's existence is for releasing unmanaged resources.
One of the common cases of this is interaction with unmanaged memory. When an object is doing some... |
26,284,331 | I'm been scratching my head on this one for a while now and am hoping there's a solution out there somewhere..
I have some HTML strings similar to this:
```
'<a href="link.com">Lorem ipsum</a> dolor sit amet, consectetur adipiscing elit. Ut lobortis luctus leo, non porta nisi euismod ut. <a href="anotherlink.com">Nul... | 2014/10/09 | [
"https://Stackoverflow.com/questions/26284331",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2509767/"
] | You can use it like this:
```
var s = '<a href="link.com">Lorem ipsum</a> dolor sit amet, consectetur adipiscing elit. Ut lobortis luctus leo, non porta nisi euismod ut. <a href="anotherlink.com">Nulla tristique</a> scelerisque fringilla.'
var div = document.createElement("div");
div.innerHTML = s;
var text = div.tex... | If your string structure is consistent as you showed; then, this might work:
1.Split your original string by white space
2.Get the first (shift) or last (pop) of the spitted
>
> var longString = "Lorem ipsum dolor sit amet";
>
>
> shortString = longString.split(" ").shift(); --> //Lorem
>
>
> |
1,426,396 | In the formula typed into say cell A2:
```
=if(A1<0, do something 1, do something 2)
```
Is it possible to have the condition statement ie `A1<0` referenced from another cell (say C1 which contains text "A1<0")?
So the final formula would take the condition from another cell
```
=if(text in C1 which is the entire ... | 2019/04/17 | [
"https://superuser.com/questions/1426396",
"https://superuser.com",
"https://superuser.com/users/1022825/"
] | The IF statement only needs something that returns TRUE or FALSE for the condition. So, if you have a formula in cell C1 that evaluates to TRUE or FALSE, then you can refer to C1 as the condition. You don't have to "copy" that condition into the IF statement.
See the screenshot. C1 has a formula that returns either T... | teylyn beat me to that example, which is really the only kind of thing that comes close.
What you're asking is related to a question that has been asked before -- is there a way to store an expression as text and then evaluate it as if it was a formula. That can be done with VBA, using the EVALUATE function, but then... |
58,306 | I am making chocolate brownies without sugar using the following ingredients:
* cocoa nibs, 1 & 1/4 cups
* carob powder, 1/4 cup
* margarine, 125 g
* flour, 50 g
* stevia, 1 tablespoon
* vanilla essence, 2 teaspoon
* baking powder, 1/2 teaspoon
* 2 eggs
How can I make the brownie less dry and have more flavor? I don'... | 2015/06/16 | [
"https://cooking.stackexchange.com/questions/58306",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/36231/"
] | That 1/4th cup margarine and the 2 eggs are not enough to give those brownies the moisture they need.
I suspect you want something low in sugar and fat. Evelyn Tribole, MS, RD created two books that talk about substitutions for fat and sugar in recipes. One technique to replace fat (like butter) in a recipe is to use... | First, I agree with Tarak'ha's suggestions because it looks like you're trying to keep things somewhat healthy.
Since it looks like you're trying to make healthier brownies, I just wanted to mention yet another less heard of healthy fat replacement in baking: *Finely shredded / pureed beetroot*. I learned this trick f... |
58,306 | I am making chocolate brownies without sugar using the following ingredients:
* cocoa nibs, 1 & 1/4 cups
* carob powder, 1/4 cup
* margarine, 125 g
* flour, 50 g
* stevia, 1 tablespoon
* vanilla essence, 2 teaspoon
* baking powder, 1/2 teaspoon
* 2 eggs
How can I make the brownie less dry and have more flavor? I don'... | 2015/06/16 | [
"https://cooking.stackexchange.com/questions/58306",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/36231/"
] | That 1/4th cup margarine and the 2 eggs are not enough to give those brownies the moisture they need.
I suspect you want something low in sugar and fat. Evelyn Tribole, MS, RD created two books that talk about substitutions for fat and sugar in recipes. One technique to replace fat (like butter) in a recipe is to use... | Hi I use dates for sugar. I use only 4 ingredients and they are bakeless. You put the ingredients in the food processor and then just press into pan and cut into squares. They are really good and you don't get that sugar rush feeling. I think I found the recipe on Pinterest. |
58,306 | I am making chocolate brownies without sugar using the following ingredients:
* cocoa nibs, 1 & 1/4 cups
* carob powder, 1/4 cup
* margarine, 125 g
* flour, 50 g
* stevia, 1 tablespoon
* vanilla essence, 2 teaspoon
* baking powder, 1/2 teaspoon
* 2 eggs
How can I make the brownie less dry and have more flavor? I don'... | 2015/06/16 | [
"https://cooking.stackexchange.com/questions/58306",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/36231/"
] | That 1/4th cup margarine and the 2 eggs are not enough to give those brownies the moisture they need.
I suspect you want something low in sugar and fat. Evelyn Tribole, MS, RD created two books that talk about substitutions for fat and sugar in recipes. One technique to replace fat (like butter) in a recipe is to use... | you could use shredded zucchini, about a 1/4 cup---you will never taste any of it, but it will add moistness to your brownies and not the sugar. |
58,306 | I am making chocolate brownies without sugar using the following ingredients:
* cocoa nibs, 1 & 1/4 cups
* carob powder, 1/4 cup
* margarine, 125 g
* flour, 50 g
* stevia, 1 tablespoon
* vanilla essence, 2 teaspoon
* baking powder, 1/2 teaspoon
* 2 eggs
How can I make the brownie less dry and have more flavor? I don'... | 2015/06/16 | [
"https://cooking.stackexchange.com/questions/58306",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/36231/"
] | First, I agree with Tarak'ha's suggestions because it looks like you're trying to keep things somewhat healthy.
Since it looks like you're trying to make healthier brownies, I just wanted to mention yet another less heard of healthy fat replacement in baking: *Finely shredded / pureed beetroot*. I learned this trick f... | Hi I use dates for sugar. I use only 4 ingredients and they are bakeless. You put the ingredients in the food processor and then just press into pan and cut into squares. They are really good and you don't get that sugar rush feeling. I think I found the recipe on Pinterest. |
58,306 | I am making chocolate brownies without sugar using the following ingredients:
* cocoa nibs, 1 & 1/4 cups
* carob powder, 1/4 cup
* margarine, 125 g
* flour, 50 g
* stevia, 1 tablespoon
* vanilla essence, 2 teaspoon
* baking powder, 1/2 teaspoon
* 2 eggs
How can I make the brownie less dry and have more flavor? I don'... | 2015/06/16 | [
"https://cooking.stackexchange.com/questions/58306",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/36231/"
] | First, I agree with Tarak'ha's suggestions because it looks like you're trying to keep things somewhat healthy.
Since it looks like you're trying to make healthier brownies, I just wanted to mention yet another less heard of healthy fat replacement in baking: *Finely shredded / pureed beetroot*. I learned this trick f... | you could use shredded zucchini, about a 1/4 cup---you will never taste any of it, but it will add moistness to your brownies and not the sugar. |
56,959,154 | I'm getting this error when running "git stash"
```
Cannot save the current status
```
with no other information.
Why is that? | 2019/07/09 | [
"https://Stackoverflow.com/questions/56959154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6592293/"
] | Found the solution here: [Git stash fails 'error: unable to resolve reference refs/stash: No such file or directory'](https://stackoverflow.com/questions/18480174/git-stash-fails-error-unable-to-resolve-reference-refs-stash-no-such-file-or)
```
rm -f .git/refs/stash
```
That fixed it | Run this
```
git reset --mixed
```
and then
```
git stash
```
before pull. |
56,959,154 | I'm getting this error when running "git stash"
```
Cannot save the current status
```
with no other information.
Why is that? | 2019/07/09 | [
"https://Stackoverflow.com/questions/56959154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6592293/"
] | For me,
```
cd .git/
sudo chmod -R 777 *
sudo chown -R owner:owner *
git add . && git stash
```
Worked | In my case, I had Visual Studio using git and was trying to stash using the command line.
Closing Visual Studio solved the problem. |
56,959,154 | I'm getting this error when running "git stash"
```
Cannot save the current status
```
with no other information.
Why is that? | 2019/07/09 | [
"https://Stackoverflow.com/questions/56959154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6592293/"
] | I solve this problem by `git stash clear`. | I had the same problem because some files changed their permissions (in ubuntu). I fixed it by running the command git stash with "sudo"
```
sudo git stash
```
I hope you can fix the problem |
56,959,154 | I'm getting this error when running "git stash"
```
Cannot save the current status
```
with no other information.
Why is that? | 2019/07/09 | [
"https://Stackoverflow.com/questions/56959154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6592293/"
] | For me,
```
cd .git/
sudo chmod -R 777 *
sudo chown -R owner:owner *
git add . && git stash
```
Worked | This is an old question, but this may help Mac users.
If you are copying files from Time Machine manually, instead of restoring them through Time Machine, it'll add [ACLs](http://www.techrepublic.com/blog/apple-in-the-enterprise/introduction-to-os-x-access-control-lists-acls/) to everything, which can mess up your per... |
56,959,154 | I'm getting this error when running "git stash"
```
Cannot save the current status
```
with no other information.
Why is that? | 2019/07/09 | [
"https://Stackoverflow.com/questions/56959154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6592293/"
] | In my case, `.git/refs/stash` was owned by `root`.
Simply running `chown -R <user>:<group> .git` (Linux) fixed it.
Note that you might only need to `chown -R <user>:<group> .git/refs/stash`, though.
Replace `<user>` and `<group>` with your user name and main group. | In my case, I had Visual Studio using git and was trying to stash using the command line.
Closing Visual Studio solved the problem. |
56,959,154 | I'm getting this error when running "git stash"
```
Cannot save the current status
```
with no other information.
Why is that? | 2019/07/09 | [
"https://Stackoverflow.com/questions/56959154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6592293/"
] | I solve this problem by `git stash clear`. | This is an old question, but this may help Mac users.
If you are copying files from Time Machine manually, instead of restoring them through Time Machine, it'll add [ACLs](http://www.techrepublic.com/blog/apple-in-the-enterprise/introduction-to-os-x-access-control-lists-acls/) to everything, which can mess up your per... |
56,959,154 | I'm getting this error when running "git stash"
```
Cannot save the current status
```
with no other information.
Why is that? | 2019/07/09 | [
"https://Stackoverflow.com/questions/56959154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6592293/"
] | I solve this problem by `git stash clear`. | Run this
```
git reset --mixed
```
and then
```
git stash
```
before pull. |
56,959,154 | I'm getting this error when running "git stash"
```
Cannot save the current status
```
with no other information.
Why is that? | 2019/07/09 | [
"https://Stackoverflow.com/questions/56959154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6592293/"
] | Found the solution here: [Git stash fails 'error: unable to resolve reference refs/stash: No such file or directory'](https://stackoverflow.com/questions/18480174/git-stash-fails-error-unable-to-resolve-reference-refs-stash-no-such-file-or)
```
rm -f .git/refs/stash
```
That fixed it | I solve this problem by `git stash clear`. |
56,959,154 | I'm getting this error when running "git stash"
```
Cannot save the current status
```
with no other information.
Why is that? | 2019/07/09 | [
"https://Stackoverflow.com/questions/56959154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6592293/"
] | I solve this problem by `git stash clear`. | I solved it in Windows by right clicking on the shortcut to Git Bash and choosing "Run as administrator" before I run `git stash`.
I can verify that running Git Fork as administrator also solves this problem if using Git Fork to stash, so there is a good chance it will solve it in other git tools such as Git for Windo... |
56,959,154 | I'm getting this error when running "git stash"
```
Cannot save the current status
```
with no other information.
Why is that? | 2019/07/09 | [
"https://Stackoverflow.com/questions/56959154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6592293/"
] | In my case, I had Visual Studio using git and was trying to stash using the command line.
Closing Visual Studio solved the problem. | I had the same problem because some files changed their permissions (in ubuntu). I fixed it by running the command git stash with "sudo"
```
sudo git stash
```
I hope you can fix the problem |
2,925,555 | I need to develop a tool for web log data mining.
Having many sequences of urls, requested in a particular user session (retrieved from web-application logs), I need to figure out the patterns of usage and groups (clusters) of users of the website.
I am new to Data Mining, and now examining Google a lot.
Found some u... | 2010/05/27 | [
"https://Stackoverflow.com/questions/2925555",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/37511/"
] | 1&2: Orange has a frequent pattern mining module. It also supports clustering.
3.I have just check the content of the book. There is not a chapter for frequent pattern mining. Anyway, it is generally a good book for beginners in data mining. You will find it very useful to help you define your problem precisely.
4.... | The Pattern module might be what you are looking for.
<http://www.clips.ua.ac.be/pages/pattern> |
2,424 | When looking through the questions I saw one which was edited by community, I read somewhere that community bot does this to bring attention to old unanswered questions I always thought it was bad to answer questions that aren't that recent.
Is there a cutoff point where you shouldn't answer a question? Or is it still... | 2015/02/19 | [
"https://graphicdesign.meta.stackexchange.com/questions/2424",
"https://graphicdesign.meta.stackexchange.com",
"https://graphicdesign.meta.stackexchange.com/users/38462/"
] | By all means.. answer **anything and everything** if you can. Don't even look at dates :)
Questions get bumped for a number of reasons. I think the only "annoying" reason is when some random person posts a "thank you" as an answer. Other than that... I wouldn't worry about bumping anything.
While old questions have a... | If you have an answer to a question that adds quality to the question by all means provide an answer. There is no time length on answering questions. We do frown upon reviving old questions with a crappy answer and usually people adding answers to an old question are either new, one line answers, or spam aka link only ... |
12,296,605 | could anyone tell me what's the background theories in The Definition of Standard ML, found very interesting and beautiful, i did learn some sml a little, but i want more while don't know how to start (to understand TDSML)
3x in advance | 2012/09/06 | [
"https://Stackoverflow.com/questions/12296605",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1650725/"
] | For the old version of the Definition (SML'90) there actually was a separate book called "Commentary on Standard ML", which explained how to interpret the Definition. Both the SML'90 Definition and the Commentary are long out of print, but fortunately, are available as [free PDFs](http://www.itu.dk/people/tofte/publ/19... | This is off the top of my head: In order to understand the methods employed in The Definition of Standard ML, you should some basic understanding of:
* [set theory](http://en.wikipedia.org/wiki/Set_theory)
* [functions](http://en.wikipedia.org/wiki/Function_%28mathematics%29)
* [first-order logic](http://en.wikipedia.... |
2,862,994 | I want to develop a web Application to manage school administration. But I am not clear, which technology should I use to create Rich Internet Application. At present, develeopment company is going with ASP.net tools and say this is a web app.
However, there is page refresh on every click. Which I don't like. Please ... | 2010/05/19 | [
"https://Stackoverflow.com/questions/2862994",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/344741/"
] | In a plain ol ASP.NET application, the screen refresh can be eliminated by using update panels in webforms, or by using more of the AJAX capabilities of the MVC Framework. (Wikiplex on Codeplex has a crazy simple example of this that I love in their example application).
Between Silverlight and Flash, however, Silverl... | ASP.NET does provide some special sauce for AJAX, so it's entirely possible to eliminate the page load without leaving ASP.NET. If you leave ASP.NET, the options are endless: Java, Silverlight, JQuery, Flash, etc. ad infinitum. |
2,862,994 | I want to develop a web Application to manage school administration. But I am not clear, which technology should I use to create Rich Internet Application. At present, develeopment company is going with ASP.net tools and say this is a web app.
However, there is page refresh on every click. Which I don't like. Please ... | 2010/05/19 | [
"https://Stackoverflow.com/questions/2862994",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/344741/"
] | It's a little late for a response to the initiator. But I didn't agree with some of the answers I read here, and since google is popping this up in the search returns I felt compelled to align my answer on this board.
First off, a lot of developers create applications in ASP.NET and AJAX because they are comfortable w... | ASP.NET does provide some special sauce for AJAX, so it's entirely possible to eliminate the page load without leaving ASP.NET. If you leave ASP.NET, the options are endless: Java, Silverlight, JQuery, Flash, etc. ad infinitum. |
2,862,994 | I want to develop a web Application to manage school administration. But I am not clear, which technology should I use to create Rich Internet Application. At present, develeopment company is going with ASP.net tools and say this is a web app.
However, there is page refresh on every click. Which I don't like. Please ... | 2010/05/19 | [
"https://Stackoverflow.com/questions/2862994",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/344741/"
] | In a plain ol ASP.NET application, the screen refresh can be eliminated by using update panels in webforms, or by using more of the AJAX capabilities of the MVC Framework. (Wikiplex on Codeplex has a crazy simple example of this that I love in their example application).
Between Silverlight and Flash, however, Silverl... | Silverlight and Flash are great for richer user interfaces, however I dont think they should be used for the "whole" interface or application. Its best to narrow down these parts and decide how rich these need to be, then evaluate which technology to use. If you just want to prevent full round trips to the server on a ... |
2,862,994 | I want to develop a web Application to manage school administration. But I am not clear, which technology should I use to create Rich Internet Application. At present, develeopment company is going with ASP.net tools and say this is a web app.
However, there is page refresh on every click. Which I don't like. Please ... | 2010/05/19 | [
"https://Stackoverflow.com/questions/2862994",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/344741/"
] | In a plain ol ASP.NET application, the screen refresh can be eliminated by using update panels in webforms, or by using more of the AJAX capabilities of the MVC Framework. (Wikiplex on Codeplex has a crazy simple example of this that I love in their example application).
Between Silverlight and Flash, however, Silverl... | It's a little late for a response to the initiator. But I didn't agree with some of the answers I read here, and since google is popping this up in the search returns I felt compelled to align my answer on this board.
First off, a lot of developers create applications in ASP.NET and AJAX because they are comfortable w... |
2,862,994 | I want to develop a web Application to manage school administration. But I am not clear, which technology should I use to create Rich Internet Application. At present, develeopment company is going with ASP.net tools and say this is a web app.
However, there is page refresh on every click. Which I don't like. Please ... | 2010/05/19 | [
"https://Stackoverflow.com/questions/2862994",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/344741/"
] | It's a little late for a response to the initiator. But I didn't agree with some of the answers I read here, and since google is popping this up in the search returns I felt compelled to align my answer on this board.
First off, a lot of developers create applications in ASP.NET and AJAX because they are comfortable w... | Silverlight and Flash are great for richer user interfaces, however I dont think they should be used for the "whole" interface or application. Its best to narrow down these parts and decide how rich these need to be, then evaluate which technology to use. If you just want to prevent full round trips to the server on a ... |
14,675 | I'm flying soon to Mongolia for a few weeks and I'm still somewhat of a beginner to photography, at least equipment-wise! So, I'm looking for equipment advice mostly. I currently have a Canon EOS 400D with an 18-55mm lens, and I recently purchased a 50mm F/1.8 prime (can't wait for it to arrive!), but I realize that to... | 2011/08/08 | [
"https://photo.stackexchange.com/questions/14675",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/6225/"
] | Personally I would stick with the 18-55 as it will be good enough, and instead invest in A) a good camera bag
B) a good tripod
C) a polarising filter
D) a set of full and graduated neutral density filters
If you're travelling around you want a well-made bag to keep your stuff safe, preferably one you can lock with a p... | what about fish-eye lens? I have Samyang 8 mm for few weeks and found it absolutely fantastic for stitched panoramas and also for those "planet" panoramas.
Ken Rockwell wrote a nice review about this lens here:
<http://www.kenrockwell.com/tech/8mm-f35.htm>
the lens is not so expensive, costs about 360 USD. |
14,675 | I'm flying soon to Mongolia for a few weeks and I'm still somewhat of a beginner to photography, at least equipment-wise! So, I'm looking for equipment advice mostly. I currently have a Canon EOS 400D with an 18-55mm lens, and I recently purchased a 50mm F/1.8 prime (can't wait for it to arrive!), but I realize that to... | 2011/08/08 | [
"https://photo.stackexchange.com/questions/14675",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/6225/"
] | I spent a while in Mongolia and frankly I think that what you (will) have is fine, with some minor tweaks.
I'd add a good quality circular polarising filter for your kit lens as well (cheap ones have weird colour casts, good ones are colour-neutral at all angles).
For super-wide shots, I was quite happy with stitched... | what about fish-eye lens? I have Samyang 8 mm for few weeks and found it absolutely fantastic for stitched panoramas and also for those "planet" panoramas.
Ken Rockwell wrote a nice review about this lens here:
<http://www.kenrockwell.com/tech/8mm-f35.htm>
the lens is not so expensive, costs about 360 USD. |
14,675 | I'm flying soon to Mongolia for a few weeks and I'm still somewhat of a beginner to photography, at least equipment-wise! So, I'm looking for equipment advice mostly. I currently have a Canon EOS 400D with an 18-55mm lens, and I recently purchased a 50mm F/1.8 prime (can't wait for it to arrive!), but I realize that to... | 2011/08/08 | [
"https://photo.stackexchange.com/questions/14675",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/6225/"
] | For that price range, your best bet is to upgrade to a single lens that has a wider range then your 18-55mm kit lens. Landscape photography typically requires a **wide angle as well as a telephoto lens**, so by having only 55mm as your longest focal length right now, you are going to be limited in what you can achieve.... | what about fish-eye lens? I have Samyang 8 mm for few weeks and found it absolutely fantastic for stitched panoramas and also for those "planet" panoramas.
Ken Rockwell wrote a nice review about this lens here:
<http://www.kenrockwell.com/tech/8mm-f35.htm>
the lens is not so expensive, costs about 360 USD. |
14,675 | I'm flying soon to Mongolia for a few weeks and I'm still somewhat of a beginner to photography, at least equipment-wise! So, I'm looking for equipment advice mostly. I currently have a Canon EOS 400D with an 18-55mm lens, and I recently purchased a 50mm F/1.8 prime (can't wait for it to arrive!), but I realize that to... | 2011/08/08 | [
"https://photo.stackexchange.com/questions/14675",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/6225/"
] | I spent a while in Mongolia and frankly I think that what you (will) have is fine, with some minor tweaks.
I'd add a good quality circular polarising filter for your kit lens as well (cheap ones have weird colour casts, good ones are colour-neutral at all angles).
For super-wide shots, I was quite happy with stitched... | Personally I would stick with the 18-55 as it will be good enough, and instead invest in A) a good camera bag
B) a good tripod
C) a polarising filter
D) a set of full and graduated neutral density filters
If you're travelling around you want a well-made bag to keep your stuff safe, preferably one you can lock with a p... |
14,675 | I'm flying soon to Mongolia for a few weeks and I'm still somewhat of a beginner to photography, at least equipment-wise! So, I'm looking for equipment advice mostly. I currently have a Canon EOS 400D with an 18-55mm lens, and I recently purchased a 50mm F/1.8 prime (can't wait for it to arrive!), but I realize that to... | 2011/08/08 | [
"https://photo.stackexchange.com/questions/14675",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/6225/"
] | I spent a while in Mongolia and frankly I think that what you (will) have is fine, with some minor tweaks.
I'd add a good quality circular polarising filter for your kit lens as well (cheap ones have weird colour casts, good ones are colour-neutral at all angles).
For super-wide shots, I was quite happy with stitched... | For that price range, your best bet is to upgrade to a single lens that has a wider range then your 18-55mm kit lens. Landscape photography typically requires a **wide angle as well as a telephoto lens**, so by having only 55mm as your longest focal length right now, you are going to be limited in what you can achieve.... |
38,630,892 | Is it possible to write something like this?
```
[](std::index_sequence<std::size_t ...I> s) {
};
```
Or this?
```
[]<std::size_t ...I>(std::index_sequence<I...> s) {
}
```
How is the syntax for this in C++14 or C++17? Or is it not possible at all? Basically, I just want to have the `I` as a template parameter... | 2016/07/28 | [
"https://Stackoverflow.com/questions/38630892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34509/"
] | You can inspect the error trying to see the JSON. In Google Chrome you can see it inspecting the element, reloading the page and then in the Network tab, XHR filter. You can see it in the next image
[](https://i.stack.imgur.com/9iiQw.png) | Change your query like this, in `where` or `orWhere` first param shuould be column name also add `%` around `$term` and remove unnecessary where conditions.
```
public function search(Request $request) {
$term = $request->input('term');
$members = DB::table('members as m')
->where('m.member_first_name', 'L... |
38,630,892 | Is it possible to write something like this?
```
[](std::index_sequence<std::size_t ...I> s) {
};
```
Or this?
```
[]<std::size_t ...I>(std::index_sequence<I...> s) {
}
```
How is the syntax for this in C++14 or C++17? Or is it not possible at all? Basically, I just want to have the `I` as a template parameter... | 2016/07/28 | [
"https://Stackoverflow.com/questions/38630892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34509/"
] | As per your update you need to include `Input` within your controller simply using
```
use App\Http\Controllers\Input;
```
at the top of the file after namespace. Instead of using `Input` facade you can use [**`Request`**](https://laravel.com/docs/5.1/requests) facade for better coding standards | Change your query like this, in `where` or `orWhere` first param shuould be column name also add `%` around `$term` and remove unnecessary where conditions.
```
public function search(Request $request) {
$term = $request->input('term');
$members = DB::table('members as m')
->where('m.member_first_name', 'L... |
1,596,704 | I am programming a DLL. I have to return an instance of TBitmap to the host application.
The DLL has another UNIT, wich is a Form, that it has a TImageList for storing images. I wrote a function that I want to return an Image from the TImageList (from the DLL to the host application. How can I do this?
Thanks,
Yulién. | 2009/10/20 | [
"https://Stackoverflow.com/questions/1596704",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/188513/"
] | Objects are combinations of code and data. A normal DLL does not support that, because it only supports the C Application Binary Interface (C ABI) but there is a kind of DLLs that does: BPL files. In other words, you need to create a .bpl file and not a .dll file. This requires both that file and the user to be Delphi,... | You can't return an object per se, but you can return a pointer to an object. Refer to [Mastering Delphi 6](http://books.google.com/books?id=YbS3dPcobl8C&pg=PA836&lpg=PA836&dq=delphi+vmt+dll&source=bl&ots=wmWQbhn8p7&sig=bfSB6Y22UrUyw4ZtcG3S9r4sQrg&hl=en&ei=oizeSrGUDYTQtgPZuLyIDg&sa=X&oi=book_result&ct=result&resnum=5&v... |
1,596,704 | I am programming a DLL. I have to return an instance of TBitmap to the host application.
The DLL has another UNIT, wich is a Form, that it has a TImageList for storing images. I wrote a function that I want to return an Image from the TImageList (from the DLL to the host application. How can I do this?
Thanks,
Yulién. | 2009/10/20 | [
"https://Stackoverflow.com/questions/1596704",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/188513/"
] | Read this old thread on borland.public.delphi.nativeapi: [Delphi Object in DLL - does this work?](http://groups.google.com/group/borland.public.delphi.nativeapi/browse_frm/thread/9dd5708d25ac5544/).
The link to a .pdf in the last message is gone, but thanks to Internet Archive Wayback Machine one can [download it](htt... | You can't return an object per se, but you can return a pointer to an object. Refer to [Mastering Delphi 6](http://books.google.com/books?id=YbS3dPcobl8C&pg=PA836&lpg=PA836&dq=delphi+vmt+dll&source=bl&ots=wmWQbhn8p7&sig=bfSB6Y22UrUyw4ZtcG3S9r4sQrg&hl=en&ei=oizeSrGUDYTQtgPZuLyIDg&sa=X&oi=book_result&ct=result&resnum=5&v... |
1,596,704 | I am programming a DLL. I have to return an instance of TBitmap to the host application.
The DLL has another UNIT, wich is a Form, that it has a TImageList for storing images. I wrote a function that I want to return an Image from the TImageList (from the DLL to the host application. How can I do this?
Thanks,
Yulién. | 2009/10/20 | [
"https://Stackoverflow.com/questions/1596704",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/188513/"
] | Basically what you need to do is not return an object. In this case you want to return bitmap, why not just return HBitmap handle? | You can't return an object per se, but you can return a pointer to an object. Refer to [Mastering Delphi 6](http://books.google.com/books?id=YbS3dPcobl8C&pg=PA836&lpg=PA836&dq=delphi+vmt+dll&source=bl&ots=wmWQbhn8p7&sig=bfSB6Y22UrUyw4ZtcG3S9r4sQrg&hl=en&ei=oizeSrGUDYTQtgPZuLyIDg&sa=X&oi=book_result&ct=result&resnum=5&v... |
1,596,704 | I am programming a DLL. I have to return an instance of TBitmap to the host application.
The DLL has another UNIT, wich is a Form, that it has a TImageList for storing images. I wrote a function that I want to return an Image from the TImageList (from the DLL to the host application. How can I do this?
Thanks,
Yulién. | 2009/10/20 | [
"https://Stackoverflow.com/questions/1596704",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/188513/"
] | Read this old thread on borland.public.delphi.nativeapi: [Delphi Object in DLL - does this work?](http://groups.google.com/group/borland.public.delphi.nativeapi/browse_frm/thread/9dd5708d25ac5544/).
The link to a .pdf in the last message is gone, but thanks to Internet Archive Wayback Machine one can [download it](htt... | Objects are combinations of code and data. A normal DLL does not support that, because it only supports the C Application Binary Interface (C ABI) but there is a kind of DLLs that does: BPL files. In other words, you need to create a .bpl file and not a .dll file. This requires both that file and the user to be Delphi,... |
1,596,704 | I am programming a DLL. I have to return an instance of TBitmap to the host application.
The DLL has another UNIT, wich is a Form, that it has a TImageList for storing images. I wrote a function that I want to return an Image from the TImageList (from the DLL to the host application. How can I do this?
Thanks,
Yulién. | 2009/10/20 | [
"https://Stackoverflow.com/questions/1596704",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/188513/"
] | Basically what you need to do is not return an object. In this case you want to return bitmap, why not just return HBitmap handle? | Objects are combinations of code and data. A normal DLL does not support that, because it only supports the C Application Binary Interface (C ABI) but there is a kind of DLLs that does: BPL files. In other words, you need to create a .bpl file and not a .dll file. This requires both that file and the user to be Delphi,... |
27,259,449 | I have a question about nesting Mongoose schema.
Here is a simple code snippet
```
var aSchema = new Schema({bar: String});
var bSchema = new Schema({a: aSchema, foo: String});
var cSchema = new Schema({as: [aSchema], foo:String});
```
This will throw `TypeError` on `bSchema`: `TypeError: Undefined type at 's' Did ... | 2014/12/02 | [
"https://Stackoverflow.com/questions/27259449",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1122547/"
] | MongoDB is **not** a relational database. This can cause confusion for some who are used to the RDBS model (I still get tripped up occasionally...but I'm really not a DB guy).
Oftentimes, you'll find it beneficial to reference other *documents* in your Mongo entities. Mongoose schemas provide a very simple and effecti... | I was facing this issue as I was completely new to the **MongoDB**. Later I found we need to use the relationship as below with the help of **Mongoose**.
Below is my country schema.
```
var mongoose = require("mongoose");
var Schema = mongoose.Schema;
var ObjectId = Schema.Types.ObjectId;
var CountrySchema = new Sc... |
3,288,111 | I'm trying to figure out the difference between Where(Expression) and Single(Expression).
Is the Expression passed into single forwarded to a Where function?
eg, are these two statements the same?
```
var result = context.Persons.Single(p => p.ID == 5);
var result2 = context.Persons.Where(p => p.ID == 5).Single();
... | 2010/07/20 | [
"https://Stackoverflow.com/questions/3288111",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/162694/"
] | `Single` returns you a `Person`, whereas the `Where` will return you an `IEnumerable<Person>`.
Passing the where expression into the single is just syntactic sugar.
Both the lines are functionally equivalent. The first I imagine could be ever so marginally more efficient. It's also easier on the eye in my opinion. | There is another difference though. Single() will throw an exception if the predicate used returns more than one element. In case the filter, when applied on an enumerable returns only one element, it returns that element without throwing an exception.
```
int[] a = {1, 2, 3};
var odd_Nos = a.Single(num => num % 2 !=... |
56,460,974 | I already received the data in `ajax` and then I used that jquery to add that data to the blade template.
```
<table class="table table-hover">
<thead>
</thead>
<tbody id="transRecords">
</tbody>
</tab... | 2019/06/05 | [
"https://Stackoverflow.com/questions/56460974",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11565931/"
] | There can not be an easy example of it than [google example here](https://github.com/googleads/googleads-mobile-android-examples/tree/master/java/advanced/BannerRecyclerViewExample/app/src/main/java/com/google/android/gms/example/bannerrecyclerviewexample)
The only difference is that it takes it data from XML file save... | the first step must be declared a field in the adapter like blew
```
private val ADS_ITEM = 0
private val NORMAL_ITEM = 1
```
so, the next step you must create two type instance viewHolder
```
inner class MyViewHolder(itemView: View) : ViewHolder(itemView) {
var title: TextView = itemView.item_text
}
inner cl... |
56,460,974 | I already received the data in `ajax` and then I used that jquery to add that data to the blade template.
```
<table class="table table-hover">
<thead>
</thead>
<tbody id="transRecords">
</tbody>
</tab... | 2019/06/05 | [
"https://Stackoverflow.com/questions/56460974",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11565931/"
] | You can have a list of ads in the adapter like this:
```
private val nativeAds = mutableListOf<UnifiedNativeAd>()
```
Then your `onBindViewHolder` will look like this:
```
override fun onBindViewHolder(holder: BaseViewHolder<Any>, position: Int) {
when (getItemViewType(position)) {
NATIVE_AD -> {... | the first step must be declared a field in the adapter like blew
```
private val ADS_ITEM = 0
private val NORMAL_ITEM = 1
```
so, the next step you must create two type instance viewHolder
```
inner class MyViewHolder(itemView: View) : ViewHolder(itemView) {
var title: TextView = itemView.item_text
}
inner cl... |
46,479,945 | This question is more of a *why* does this particular code work this way than a *how* can I make this code work this way.
Im going through the codecademy tutorials for JavaScript and I came across a lesson that I conceptually can make use of in my own code because I can see the pattern of this particular code - but it... | 2017/09/29 | [
"https://Stackoverflow.com/questions/46479945",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6660756/"
] | Try this code out and it will help. This stuff was tricky for me too. It's just using a variable and calculating it at the same time.
```
let myArray = ['First','Second','Third'];
var last = myArray[myArray.length - 1];
console.log(last);
```
First, we have to note that `myArray.length` is 3 because there are 3 item... | `array.length` is a number of items in it, there are 3 items. But array indexes starts from 0 and the last index will be 2, not 3. So if you want to get array element using `array.length`, you need to decrease this length by 1 if you want to get the last element, by 2 if you want to get the previous one and so on. |
46,479,945 | This question is more of a *why* does this particular code work this way than a *how* can I make this code work this way.
Im going through the codecademy tutorials for JavaScript and I came across a lesson that I conceptually can make use of in my own code because I can see the pattern of this particular code - but it... | 2017/09/29 | [
"https://Stackoverflow.com/questions/46479945",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6660756/"
] | Try this code out and it will help. This stuff was tricky for me too. It's just using a variable and calculating it at the same time.
```
let myArray = ['First','Second','Third'];
var last = myArray[myArray.length - 1];
console.log(last);
```
First, we have to note that `myArray.length` is 3 because there are 3 item... | Array.length returns the **number of items** in an array. It has no bearing on the index.
Length - 1 will always be the final index in array though, simply because arrays are 0 indexed in practice. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.