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 |
|---|---|---|---|---|---|
59,976,256 | So the little nav section is at the bottom and the other two sections are at the top of the footer.
Also how would I remove the tiny bit of white space left at the bottom of the page?
Thank you for any help, code is below.
```css
.footer{
display: flex;
justify-content: space-around;
flex-direction: row;
mar... | 2020/01/29 | [
"https://Stackoverflow.com/questions/59976256",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12808925/"
] | like so
```css
footer{
position:fixed;
bottom:0%;
left:20%;
right:20%;
}
/*style*/
footer{
background-color:black;
color:white;
}
```
```html
<footer><center><p>Copyright Company 2020 - your date </p> </center></footer>
```
note you can put anything inside the center tag to center it and then the left 20 ... | ```
footer{
position:fixed;
bottom:0%;
left:0%;
right:0%;
background-color:black;
color:white;
}
``` |
59,976,256 | So the little nav section is at the bottom and the other two sections are at the top of the footer.
Also how would I remove the tiny bit of white space left at the bottom of the page?
Thank you for any help, code is below.
```css
.footer{
display: flex;
justify-content: space-around;
flex-direction: row;
mar... | 2020/01/29 | [
"https://Stackoverflow.com/questions/59976256",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12808925/"
] | like so
```css
footer{
position:fixed;
bottom:0%;
left:20%;
right:20%;
}
/*style*/
footer{
background-color:black;
color:white;
}
```
```html
<footer><center><p>Copyright Company 2020 - your date </p> </center></footer>
```
note you can put anything inside the center tag to center it and then the left 20 ... | ```
.footer-nav {
margin: 10px auto;
float: left;
padding: 0;
}
.footer-nav li {
float: left;
padding: 0 10px;
list-style-type: none;
}
``` |
4,779,203 | I have a list of Account objects in `self.accounts`, and I know that only one of them will have a `type` attribute equal to 'equity'. What is the best (most pythonic) way to get only that object from the list?
Currently I have the following, but I'm wondering if the `[0]` at the end is superfluous. Is there a more suc... | 2011/01/24 | [
"https://Stackoverflow.com/questions/4779203",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/212443/"
] | ```
return next(account for account in self.accounts if account.type == 'equity')
```
or
```
return (account for account in self.accounts if account.type == 'equity').next()
``` | "Pythonic" means nothing. There is probably not any more "Succinct" solution than yours, no.
Ignacios solution has the benefit of stopping once it finds the item. Another way of doing it would be:
```
def get_equity_account(self):
for item in self.accounts:
if item.type == 'equity':
return it... |
4,779,203 | I have a list of Account objects in `self.accounts`, and I know that only one of them will have a `type` attribute equal to 'equity'. What is the best (most pythonic) way to get only that object from the list?
Currently I have the following, but I'm wondering if the `[0]` at the end is superfluous. Is there a more suc... | 2011/01/24 | [
"https://Stackoverflow.com/questions/4779203",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/212443/"
] | ```
return next(account for account in self.accounts if account.type == 'equity')
```
or
```
return (account for account in self.accounts if account.type == 'equity').next()
``` | It's such a common need in Python but afaik there is no built in way to do it. You could also do:
```
return next(filter(lambda x: x.type == 'equity', self.accounts))
``` |
4,779,203 | I have a list of Account objects in `self.accounts`, and I know that only one of them will have a `type` attribute equal to 'equity'. What is the best (most pythonic) way to get only that object from the list?
Currently I have the following, but I'm wondering if the `[0]` at the end is superfluous. Is there a more suc... | 2011/01/24 | [
"https://Stackoverflow.com/questions/4779203",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/212443/"
] | "Pythonic" means nothing. There is probably not any more "Succinct" solution than yours, no.
Ignacios solution has the benefit of stopping once it finds the item. Another way of doing it would be:
```
def get_equity_account(self):
for item in self.accounts:
if item.type == 'equity':
return it... | It's such a common need in Python but afaik there is no built in way to do it. You could also do:
```
return next(filter(lambda x: x.type == 'equity', self.accounts))
``` |
51,293,224 | I'm trying to get my modal to close (have a class that sets it to `display: block` removed) on an esc press. Here's what I tried (which doesn't work and breaks the rest of my code):
```
if (modal.classList.contains('modal-visible')) {
document.addEventListener('keypress', function(e) {
let keyCode = e.keyCode;
... | 2018/07/11 | [
"https://Stackoverflow.com/questions/51293224",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8888320/"
] | Add an event listener for the modal when the page loads, not if the modal is visible. Also, use the `keydown` event instead of `keypress` as in some browsers the keypress event is only fired if the key outputs a character
```css
.modal {
display: none;
width: 33%;
height: 30%;
margin: 0 auto;
background... | If you only create the event listener if the modal is visible, it will simply never be created. Making the modal visible *afterward* will not re-execute your code. The if check has already occurred, already failed, and the event listener for keydown has already *not* been created. At no point will it be created.
```
v... |
17,809,599 | when accessing a website, you are asked to wait 10 minutes for example in order to make another request, suppose you are using a router as a mean to access internet (192.168.xxx.xxx), with "renewing" just the local ip address would the 10 minutes be skipped or the address given to the router is the one that should be c... | 2013/07/23 | [
"https://Stackoverflow.com/questions/17809599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2463937/"
] | If variables you are going to pass are request-independent - then just give it a name `*.js.erb`.
For request-specific data (like controller name in your example) that's impossible. Javascript files are loaded independently from application requests and normally they are served as static assets by application server ... | I believe if you have a javascript file with the extension `.js.erb` or `.js.coffee.erb`, all the extensions would be parsed from right to left, thus your code should understand some `erb` tags inside it, before parsing the `coffeescript` and ultimately the `js` part. |
17,809,599 | when accessing a website, you are asked to wait 10 minutes for example in order to make another request, suppose you are using a router as a mean to access internet (192.168.xxx.xxx), with "renewing" just the local ip address would the 10 minutes be skipped or the address given to the router is the one that should be c... | 2013/07/23 | [
"https://Stackoverflow.com/questions/17809599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2463937/"
] | I believe if you have a javascript file with the extension `.js.erb` or `.js.coffee.erb`, all the extensions would be parsed from right to left, thus your code should understand some `erb` tags inside it, before parsing the `coffeescript` and ultimately the `js` part. | I'm not sure why you would want to use the controller name when DEFINING your function, but if you really do, then
* change your JS file from a .js extension to .js.erb
* rename the file to match the correct route/action (i.e. create, update, destroy, et...) that it should respond to
* place it in your view folder
* ... |
17,809,599 | when accessing a website, you are asked to wait 10 minutes for example in order to make another request, suppose you are using a router as a mean to access internet (192.168.xxx.xxx), with "renewing" just the local ip address would the 10 minutes be skipped or the address given to the router is the one that should be c... | 2013/07/23 | [
"https://Stackoverflow.com/questions/17809599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2463937/"
] | If variables you are going to pass are request-independent - then just give it a name `*.js.erb`.
For request-specific data (like controller name in your example) that's impossible. Javascript files are loaded independently from application requests and normally they are served as static assets by application server ... | I'm not sure why you would want to use the controller name when DEFINING your function, but if you really do, then
* change your JS file from a .js extension to .js.erb
* rename the file to match the correct route/action (i.e. create, update, destroy, et...) that it should respond to
* place it in your view folder
* ... |
6,982,883 | We are migrating database structures, so I have one database with the old structure and one database with the new structure (both on the same server). I want to write queries to copy data from one to the other. I am expecting to go table-by-table as the schema is different. How do I do this? | 2011/08/08 | [
"https://Stackoverflow.com/questions/6982883",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/539211/"
] | You need to provide more details to get a more specific answer, but in general you just use the three-part name:
```
INSERT INTO NewDB.dbo.TableName
SELECT <columns>
FROM OldDB.dbo.Tablename
```
Are you looking for a way to do this automatically for all the tables? | you can probably use Import data under tasks.Right Click the Target DB -> Tasks ->Import Data .You can also specify the source-> target mapping here.. and also write queries |
6,982,883 | We are migrating database structures, so I have one database with the old structure and one database with the new structure (both on the same server). I want to write queries to copy data from one to the other. I am expecting to go table-by-table as the schema is different. How do I do this? | 2011/08/08 | [
"https://Stackoverflow.com/questions/6982883",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/539211/"
] | You can write cross database queries like so
```
INSERT INTO NewDatabase.Schema.Table
SELECT Column1, Column2
FROM OldDatabase.Schema.Table
``` | you can probably use Import data under tasks.Right Click the Target DB -> Tasks ->Import Data .You can also specify the source-> target mapping here.. and also write queries |
6,982,883 | We are migrating database structures, so I have one database with the old structure and one database with the new structure (both on the same server). I want to write queries to copy data from one to the other. I am expecting to go table-by-table as the schema is different. How do I do this? | 2011/08/08 | [
"https://Stackoverflow.com/questions/6982883",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/539211/"
] | You need to provide more details to get a more specific answer, but in general you just use the three-part name:
```
INSERT INTO NewDB.dbo.TableName
SELECT <columns>
FROM OldDB.dbo.Tablename
```
Are you looking for a way to do this automatically for all the tables? | You can write cross database queries like so
```
INSERT INTO NewDatabase.Schema.Table
SELECT Column1, Column2
FROM OldDatabase.Schema.Table
``` |
1,668,502 | I'm given a curve $g = 0$ in 2D specified by g(x,y) = f(x) - y. The normal to the curve is the gradient of $g$ - $(f', -1)$. Now I want express the change in the angle $\theta$ of the normal as I move along the curve. However, I'm not sure how to express this quantity. (For instance if $f$ is linear, this means that $d... | 2016/02/23 | [
"https://math.stackexchange.com/questions/1668502",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/39340/"
] | It's because $2\cdot 6 \equiv 1 \mod 11$ | You have $2\times 6=12$ which is $1$ mod $11$. Hence, we see that that $2\times 6=1$ mod $11$.
Now the set of congruence numbers modulo $11$ (often noted $\mathbb{Z}/11$) is a ring with addition and multiplication coming from $\mathbb{Z}$.
Saying that $6^{-1}\text{ mod }11=2$ is saying that $6$ mod $11$ is invertibl... |
1,668,502 | I'm given a curve $g = 0$ in 2D specified by g(x,y) = f(x) - y. The normal to the curve is the gradient of $g$ - $(f', -1)$. Now I want express the change in the angle $\theta$ of the normal as I move along the curve. However, I'm not sure how to express this quantity. (For instance if $f$ is linear, this means that $d... | 2016/02/23 | [
"https://math.stackexchange.com/questions/1668502",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/39340/"
] | It's because $2\cdot 6 \equiv 1 \mod 11$ | First, we need to understand what $2^{-1}\mod 11$ stands for. Raising to the power $-1$ is usually used to denote the *multiplicative inverse*. That is, $b$ is a multiplicative inverse of $a$ if and only if $a\cdot b=1$. Thus, $2^{-1}\mod 11$ denotes the number such that $$2^{-1}\cdot2\equiv1\mod11$$ Since $2\cdot 6\eq... |
1,668,502 | I'm given a curve $g = 0$ in 2D specified by g(x,y) = f(x) - y. The normal to the curve is the gradient of $g$ - $(f', -1)$. Now I want express the change in the angle $\theta$ of the normal as I move along the curve. However, I'm not sure how to express this quantity. (For instance if $f$ is linear, this means that $d... | 2016/02/23 | [
"https://math.stackexchange.com/questions/1668502",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/39340/"
] | It's because $2\cdot 6 \equiv 1 \mod 11$ | The notation $2^{-1} \pmod{11}$ means the *multiplicative inverse* of $2$ modulo $11$, that is, a number $x$ satisfying the equation $2x \equiv 1 \pmod{11}$.
Since $2 \cdot 6 \equiv 12 \equiv 1 \pmod{11}$, $2^{-1} \equiv 6 \pmod{11}$. The same calculation shows that $6^{-1} \equiv 2 \pmod{11}$.
The multiplicative i... |
1,668,502 | I'm given a curve $g = 0$ in 2D specified by g(x,y) = f(x) - y. The normal to the curve is the gradient of $g$ - $(f', -1)$. Now I want express the change in the angle $\theta$ of the normal as I move along the curve. However, I'm not sure how to express this quantity. (For instance if $f$ is linear, this means that $d... | 2016/02/23 | [
"https://math.stackexchange.com/questions/1668502",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/39340/"
] | It's because $2\cdot 6 \equiv 1 \mod 11$ | It is part of the collection of integer pairs such that:
$$xy\equiv1\mod p$$
in this case with $p=11$.
For $p=11$, they are $1\cdot1,2\cdot6,3\cdot4,5\cdot9,7\cdot8$ and $10\cdot10$
Except for $1$ and $p-1$, each $x$ is paired to a unique $y$. |
1,668,502 | I'm given a curve $g = 0$ in 2D specified by g(x,y) = f(x) - y. The normal to the curve is the gradient of $g$ - $(f', -1)$. Now I want express the change in the angle $\theta$ of the normal as I move along the curve. However, I'm not sure how to express this quantity. (For instance if $f$ is linear, this means that $d... | 2016/02/23 | [
"https://math.stackexchange.com/questions/1668502",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/39340/"
] | First, we need to understand what $2^{-1}\mod 11$ stands for. Raising to the power $-1$ is usually used to denote the *multiplicative inverse*. That is, $b$ is a multiplicative inverse of $a$ if and only if $a\cdot b=1$. Thus, $2^{-1}\mod 11$ denotes the number such that $$2^{-1}\cdot2\equiv1\mod11$$ Since $2\cdot 6\eq... | You have $2\times 6=12$ which is $1$ mod $11$. Hence, we see that that $2\times 6=1$ mod $11$.
Now the set of congruence numbers modulo $11$ (often noted $\mathbb{Z}/11$) is a ring with addition and multiplication coming from $\mathbb{Z}$.
Saying that $6^{-1}\text{ mod }11=2$ is saying that $6$ mod $11$ is invertibl... |
1,668,502 | I'm given a curve $g = 0$ in 2D specified by g(x,y) = f(x) - y. The normal to the curve is the gradient of $g$ - $(f', -1)$. Now I want express the change in the angle $\theta$ of the normal as I move along the curve. However, I'm not sure how to express this quantity. (For instance if $f$ is linear, this means that $d... | 2016/02/23 | [
"https://math.stackexchange.com/questions/1668502",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/39340/"
] | You have $2\times 6=12$ which is $1$ mod $11$. Hence, we see that that $2\times 6=1$ mod $11$.
Now the set of congruence numbers modulo $11$ (often noted $\mathbb{Z}/11$) is a ring with addition and multiplication coming from $\mathbb{Z}$.
Saying that $6^{-1}\text{ mod }11=2$ is saying that $6$ mod $11$ is invertibl... | It is part of the collection of integer pairs such that:
$$xy\equiv1\mod p$$
in this case with $p=11$.
For $p=11$, they are $1\cdot1,2\cdot6,3\cdot4,5\cdot9,7\cdot8$ and $10\cdot10$
Except for $1$ and $p-1$, each $x$ is paired to a unique $y$. |
1,668,502 | I'm given a curve $g = 0$ in 2D specified by g(x,y) = f(x) - y. The normal to the curve is the gradient of $g$ - $(f', -1)$. Now I want express the change in the angle $\theta$ of the normal as I move along the curve. However, I'm not sure how to express this quantity. (For instance if $f$ is linear, this means that $d... | 2016/02/23 | [
"https://math.stackexchange.com/questions/1668502",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/39340/"
] | First, we need to understand what $2^{-1}\mod 11$ stands for. Raising to the power $-1$ is usually used to denote the *multiplicative inverse*. That is, $b$ is a multiplicative inverse of $a$ if and only if $a\cdot b=1$. Thus, $2^{-1}\mod 11$ denotes the number such that $$2^{-1}\cdot2\equiv1\mod11$$ Since $2\cdot 6\eq... | The notation $2^{-1} \pmod{11}$ means the *multiplicative inverse* of $2$ modulo $11$, that is, a number $x$ satisfying the equation $2x \equiv 1 \pmod{11}$.
Since $2 \cdot 6 \equiv 12 \equiv 1 \pmod{11}$, $2^{-1} \equiv 6 \pmod{11}$. The same calculation shows that $6^{-1} \equiv 2 \pmod{11}$.
The multiplicative i... |
1,668,502 | I'm given a curve $g = 0$ in 2D specified by g(x,y) = f(x) - y. The normal to the curve is the gradient of $g$ - $(f', -1)$. Now I want express the change in the angle $\theta$ of the normal as I move along the curve. However, I'm not sure how to express this quantity. (For instance if $f$ is linear, this means that $d... | 2016/02/23 | [
"https://math.stackexchange.com/questions/1668502",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/39340/"
] | First, we need to understand what $2^{-1}\mod 11$ stands for. Raising to the power $-1$ is usually used to denote the *multiplicative inverse*. That is, $b$ is a multiplicative inverse of $a$ if and only if $a\cdot b=1$. Thus, $2^{-1}\mod 11$ denotes the number such that $$2^{-1}\cdot2\equiv1\mod11$$ Since $2\cdot 6\eq... | It is part of the collection of integer pairs such that:
$$xy\equiv1\mod p$$
in this case with $p=11$.
For $p=11$, they are $1\cdot1,2\cdot6,3\cdot4,5\cdot9,7\cdot8$ and $10\cdot10$
Except for $1$ and $p-1$, each $x$ is paired to a unique $y$. |
1,668,502 | I'm given a curve $g = 0$ in 2D specified by g(x,y) = f(x) - y. The normal to the curve is the gradient of $g$ - $(f', -1)$. Now I want express the change in the angle $\theta$ of the normal as I move along the curve. However, I'm not sure how to express this quantity. (For instance if $f$ is linear, this means that $d... | 2016/02/23 | [
"https://math.stackexchange.com/questions/1668502",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/39340/"
] | The notation $2^{-1} \pmod{11}$ means the *multiplicative inverse* of $2$ modulo $11$, that is, a number $x$ satisfying the equation $2x \equiv 1 \pmod{11}$.
Since $2 \cdot 6 \equiv 12 \equiv 1 \pmod{11}$, $2^{-1} \equiv 6 \pmod{11}$. The same calculation shows that $6^{-1} \equiv 2 \pmod{11}$.
The multiplicative i... | It is part of the collection of integer pairs such that:
$$xy\equiv1\mod p$$
in this case with $p=11$.
For $p=11$, they are $1\cdot1,2\cdot6,3\cdot4,5\cdot9,7\cdot8$ and $10\cdot10$
Except for $1$ and $p-1$, each $x$ is paired to a unique $y$. |
24,174,525 | I am implementing a generic class for be the base class for my service classes, where I should have one for each entity class in my application. Besides methods for Insert, Update or Delete items (all already done), I have a method to return a list of items, where I need sort this list, and return a sub-set correspondi... | 2014/06/12 | [
"https://Stackoverflow.com/questions/24174525",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2692962/"
] | Make your entity classes implement [Comparable](http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html).
Thus you'll have
```
v.get(i).compareTo(pivo)
```
instead of
```
v.get(i).toString().compareTo(pivo.toString());
``` | Make a [Comparator](http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html) for each entity class and use [Collections.sort()](http://docs.oracle.com/javase/6/docs/api/java/util/Collections.html#sort%28java.util.List,%20java.util.Comparator%29) to sort the lists.
Your generic base class could define an abs... |
24,174,525 | I am implementing a generic class for be the base class for my service classes, where I should have one for each entity class in my application. Besides methods for Insert, Update or Delete items (all already done), I have a method to return a list of items, where I need sort this list, and return a sub-set correspondi... | 2014/06/12 | [
"https://Stackoverflow.com/questions/24174525",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2692962/"
] | Make your entity classes implement [Comparable](http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html).
Thus you'll have
```
v.get(i).compareTo(pivo)
```
instead of
```
v.get(i).toString().compareTo(pivo.toString());
``` | You Could...
------------
Require the entities to implement the [`Comparator`](http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html) interface, this means you'd need to change your classes generics to handle the entities implementation requirements...
```
public class SomeClass<E extends Comparable> ...... |
8,773,915 | In the below code I have a couple of unordered lists, and in the plugin I am attempting to fire a click event when the `li` element is clicked. How can I do this inside the plugin and still have access to the main `ul` jquery object?
See comments in code for further explanation
```
<ul class="testing">
<... | 2012/01/07 | [
"https://Stackoverflow.com/questions/8773915",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/429909/"
] | ```
(function($) {
$.fn.myPlugin = function(options) {
return this.find('li').click(onClick)
function onClick(){
console.log('you clicked an li');
$(this).parent(); // This is the <ul>
}
}
})(jQuery);
$(".testing").myPlugin()
``` | Copy the following example and see if this helps solidify what you are attempting to accomplish.
The proof of getting to the main ul tags are the alerts. You will see I have created 'testing1' and 'testing2' classes. Depending on which li tag is clicked, the user will receive an alert of what class is associated to th... |
71,232,879 | I want to download/scrape 50 million log records from a site. Instead of downloading 50 million in one go, I was trying to download it in parts like 10 million at a time using the following code but it's only handling 20,000 at a time (more than that throws an error) so it becomes time-consuming to download that much d... | 2022/02/23 | [
"https://Stackoverflow.com/questions/71232879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3189570/"
] | Bottleneck: number of simultaneous connections
==============================================
First, the bottleneck is the total number of simultaneous connections in the TCP connector.
That default for `aiohttp.TCPConnector` is `limit=100`. On most systems (tested on macOS), you should be able to double that by pass... | If it's not the bandwidth that limits you (but I cannot check this), there is a solution less complicated than the celery and rabbitmq but it is not as scalable as the celery and rabbitmq, it will be limited by your number of CPU.
Instead of splitting calls on celery workers, you split them on multiple processes.
I m... |
174,653 | I'd like to use the Wiimote (accelerometers, gyroscopes, infrared camera, etc, etc, etc) on various applications.
It's a bluetooth device, and I know others have connected it to their computer.
* What's the easiest way to start using it in my software - are there libraries for C#, for instance?
* I want my software t... | 2008/10/06 | [
"https://Stackoverflow.com/questions/174653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2915/"
] | Have you seen [Johnny Chung Lee's 'Procrastineering' Blog](http://procrastineering.blogspot.com/)? He's written a lot on the subject of using wii remotes and has some fantastic demonstration videos. **[Edit]** I just found out Mr Lee did [a TED talk](http://www.ted.com/index.php/talks/johnny_lee_demos_wii_remote_hacks.... | Coding4Fun had a managed C# library up that would allow you to interface with it but it seems their site is down right now. Though I think they used the Robotics Studio so that may be a place to start.
Found it... <http://www.codeplex.com/WiimoteLib>
Oh and I forgot to post a link to these videos I saw quite some tim... |
174,653 | I'd like to use the Wiimote (accelerometers, gyroscopes, infrared camera, etc, etc, etc) on various applications.
It's a bluetooth device, and I know others have connected it to their computer.
* What's the easiest way to start using it in my software - are there libraries for C#, for instance?
* I want my software t... | 2008/10/06 | [
"https://Stackoverflow.com/questions/174653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2915/"
] | Coding4Fun had a managed C# library up that would allow you to interface with it but it seems their site is down right now. Though I think they used the Robotics Studio so that may be a place to start.
Found it... <http://www.codeplex.com/WiimoteLib>
Oh and I forgot to post a link to these videos I saw quite some tim... | If you use WiimoteLib (from Coding4Fun as mentioned in another answer), there is an example application called WiimoteTest. This tests all of the Wiimote inputs and outputs, including for multiple Wiimotes at the same time, so it is a good starting point for your own Wiimote code as it gives you an example of how to do... |
174,653 | I'd like to use the Wiimote (accelerometers, gyroscopes, infrared camera, etc, etc, etc) on various applications.
It's a bluetooth device, and I know others have connected it to their computer.
* What's the easiest way to start using it in my software - are there libraries for C#, for instance?
* I want my software t... | 2008/10/06 | [
"https://Stackoverflow.com/questions/174653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2915/"
] | Coding4Fun had a managed C# library up that would allow you to interface with it but it seems their site is down right now. Though I think they used the Robotics Studio so that may be a place to start.
Found it... <http://www.codeplex.com/WiimoteLib>
Oh and I forgot to post a link to these videos I saw quite some tim... | >
> what's the current easiest way to
> connect a wiimote to the computer?
>
>
>
I not found solution for connect wiimote within my software, you have to connect manually into Windows, but on Windows register bluetooth device it very take time, Try Toshiba bluetooth stack it more convenient. |
174,653 | I'd like to use the Wiimote (accelerometers, gyroscopes, infrared camera, etc, etc, etc) on various applications.
It's a bluetooth device, and I know others have connected it to their computer.
* What's the easiest way to start using it in my software - are there libraries for C#, for instance?
* I want my software t... | 2008/10/06 | [
"https://Stackoverflow.com/questions/174653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2915/"
] | Have you seen [Johnny Chung Lee's 'Procrastineering' Blog](http://procrastineering.blogspot.com/)? He's written a lot on the subject of using wii remotes and has some fantastic demonstration videos. **[Edit]** I just found out Mr Lee did [a TED talk](http://www.ted.com/index.php/talks/johnny_lee_demos_wii_remote_hacks.... | If you use WiimoteLib (from Coding4Fun as mentioned in another answer), there is an example application called WiimoteTest. This tests all of the Wiimote inputs and outputs, including for multiple Wiimotes at the same time, so it is a good starting point for your own Wiimote code as it gives you an example of how to do... |
174,653 | I'd like to use the Wiimote (accelerometers, gyroscopes, infrared camera, etc, etc, etc) on various applications.
It's a bluetooth device, and I know others have connected it to their computer.
* What's the easiest way to start using it in my software - are there libraries for C#, for instance?
* I want my software t... | 2008/10/06 | [
"https://Stackoverflow.com/questions/174653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2915/"
] | Have you seen [Johnny Chung Lee's 'Procrastineering' Blog](http://procrastineering.blogspot.com/)? He's written a lot on the subject of using wii remotes and has some fantastic demonstration videos. **[Edit]** I just found out Mr Lee did [a TED talk](http://www.ted.com/index.php/talks/johnny_lee_demos_wii_remote_hacks.... | >
> what's the current easiest way to
> connect a wiimote to the computer?
>
>
>
I not found solution for connect wiimote within my software, you have to connect manually into Windows, but on Windows register bluetooth device it very take time, Try Toshiba bluetooth stack it more convenient. |
174,653 | I'd like to use the Wiimote (accelerometers, gyroscopes, infrared camera, etc, etc, etc) on various applications.
It's a bluetooth device, and I know others have connected it to their computer.
* What's the easiest way to start using it in my software - are there libraries for C#, for instance?
* I want my software t... | 2008/10/06 | [
"https://Stackoverflow.com/questions/174653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2915/"
] | If you use WiimoteLib (from Coding4Fun as mentioned in another answer), there is an example application called WiimoteTest. This tests all of the Wiimote inputs and outputs, including for multiple Wiimotes at the same time, so it is a good starting point for your own Wiimote code as it gives you an example of how to do... | >
> what's the current easiest way to
> connect a wiimote to the computer?
>
>
>
I not found solution for connect wiimote within my software, you have to connect manually into Windows, but on Windows register bluetooth device it very take time, Try Toshiba bluetooth stack it more convenient. |
1,776,761 | I'm trying to get started with an iPhone application, I had a look around at other questions but i'm still sorta stuck so hopefully someone can help...
First thing is I'm totally confused with the whole view concept, I'm more used to visual studio so I'm going to use the term 'form' to describe what I have in my head.... | 2009/11/21 | [
"https://Stackoverflow.com/questions/1776761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/216228/"
] | [File::ChangeNotify](http://search.cpan.org/dist/File-ChangeNotify/) sounds like a cross-platform way to do this. | While I don't know of a specific cross platform solution there is inotify on linux (well on modern kernels from 2.6.13) and from the [Inotify](http://search.cpan.org/dist/Linux-Inotify) module from CPAN. As for OS X, there is apparently the `kqueue` syscall but I have no experience of using it. |
1,776,761 | I'm trying to get started with an iPhone application, I had a look around at other questions but i'm still sorta stuck so hopefully someone can help...
First thing is I'm totally confused with the whole view concept, I'm more used to visual studio so I'm going to use the term 'form' to describe what I have in my head.... | 2009/11/21 | [
"https://Stackoverflow.com/questions/1776761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/216228/"
] | [File::ChangeNotify](http://search.cpan.org/dist/File-ChangeNotify/) sounds like a cross-platform way to do this. | For systems where [famd](http://en.wikipedia.org/wiki/File_alteration_monitor "famd") can run (Irix, Linux, BSDs, most Unices) there is [SGI::FAM](http://search.cpan.org/~jglick/SGI-FAM-1.002/lib/SGI/FAM.pm "SGI::FAM") and [Sys::Gamin](http://search.cpan.org/~garnacho/Sys-Gamin-0.1/lib/Sys/Gamin.pm "Sys::Gamin"), both ... |
27,705,912 | I have a table like this
```
|---------|--------------------|---------------------|-------------------|
| id | first_name | last_name | timestamp |
|------------------------------------------------------------------------|
| 1 | Saswat | Routroy | 1209834... | 2014/12/30 | [
"https://Stackoverflow.com/questions/27705912",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1170507/"
] | You have, if you want to use strtotime :
```
$last = strtotime('last week');
$month = strtotime('this month');
```
You have documentation here : <http://php.net/manual/en/function.strtotime.php> | use DATE and CURDATE()
SELECT \* FROM `table` WHERE DATE(`timestamp`) = CURDATE()
I guess using DATE still uses INDEX.
[see the execution plan on the DEMO](http://www.sqlfiddle.com/#!2/72440/2) |
109,223 | Seems to be a minhag that a fiance shall not sleep at his future in-law's house. Even just *as a guest for one night*. And obviously, even if there is no problem of yichud.
Is there a reference in posqim about this minhag? | 2019/10/27 | [
"https://judaism.stackexchange.com/questions/109223",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/13791/"
] | This opinion comes from the Rama in EH 55:1, and Rav Soloveitchik was makpid on this (Nefesh HaRav pg.255).
Text of Rama:
>
> הארוסה, אסורה לבעלה מדברי סופרים, כל זמן שהיא בבית אביה; והבא על
> ארוסתו בבית חמיו, מכין אותו מכת מרדות.
>
>
> הגה: ואפילו ביחוד אסורים; ולכן ארוס שהוא עם ארוסתו בבית אחד, מברכין
> שבע בר... | I can see two sources in the talmud:
A. Avodah Zarah 58b
>
> מאי א"ל אסור משום לך לך אמרין נזירא סחור סחור לכרמא לא תקרב
>
>
> Rabbi Asi repeated his question: What is the halakha? Rabbi Yoḥanan
> said to Rabbi Asi: Although the gentile did not touch the wine when
> diluting it, it is prohibited by rabbinic decr... |
109,223 | Seems to be a minhag that a fiance shall not sleep at his future in-law's house. Even just *as a guest for one night*. And obviously, even if there is no problem of yichud.
Is there a reference in posqim about this minhag? | 2019/10/27 | [
"https://judaism.stackexchange.com/questions/109223",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/13791/"
] | This opinion comes from the Rama in EH 55:1, and Rav Soloveitchik was makpid on this (Nefesh HaRav pg.255).
Text of Rama:
>
> הארוסה, אסורה לבעלה מדברי סופרים, כל זמן שהיא בבית אביה; והבא על
> ארוסתו בבית חמיו, מכין אותו מכת מרדות.
>
>
> הגה: ואפילו ביחוד אסורים; ולכן ארוס שהוא עם ארוסתו בבית אחד, מברכין
> שבע בר... | **[Igrot Moshe Y.D. 1:90](http://hebrewbooks.org/pdfpager.aspx?req=917&st=&pgnum=150)**
>
> וברוצים פנוי ופנויה להכיר זה את זו לתכלית נישואין אם ימצאו חן אם רשאים לשכור שני חדרי לינה בבית אחד שגם בעה"ב ואשתו דרים שם הנה אם יודיעו זה להבעה"ב ואשתו שאינם איש ואשתו יש להקל אבל כשלא הודיעו להם שאפשר שיחשבו שהם איש ואשתו ... |
109,223 | Seems to be a minhag that a fiance shall not sleep at his future in-law's house. Even just *as a guest for one night*. And obviously, even if there is no problem of yichud.
Is there a reference in posqim about this minhag? | 2019/10/27 | [
"https://judaism.stackexchange.com/questions/109223",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/13791/"
] | I can see two sources in the talmud:
A. Avodah Zarah 58b
>
> מאי א"ל אסור משום לך לך אמרין נזירא סחור סחור לכרמא לא תקרב
>
>
> Rabbi Asi repeated his question: What is the halakha? Rabbi Yoḥanan
> said to Rabbi Asi: Although the gentile did not touch the wine when
> diluting it, it is prohibited by rabbinic decr... | **[Igrot Moshe Y.D. 1:90](http://hebrewbooks.org/pdfpager.aspx?req=917&st=&pgnum=150)**
>
> וברוצים פנוי ופנויה להכיר זה את זו לתכלית נישואין אם ימצאו חן אם רשאים לשכור שני חדרי לינה בבית אחד שגם בעה"ב ואשתו דרים שם הנה אם יודיעו זה להבעה"ב ואשתו שאינם איש ואשתו יש להקל אבל כשלא הודיעו להם שאפשר שיחשבו שהם איש ואשתו ... |
41,127,585 | I want to check if I do have enough space before executing my script.
I thought about
```
#!/bin/bash
set -e
cd
Home=$(pwd)
reqSpace=100000000
if [ (available Space) < reqSpace ]
echo "not enough Space"
exit 1
fi
do something
```
The space I want to check via
```
df | grep $Home
```
Any suggestions? | 2016/12/13 | [
"https://Stackoverflow.com/questions/41127585",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4174358/"
] | Bringing it all together (`set -e` and `cd` omitted for brevity; Bash-specific syntax - not POSIX-compliant):
```
#!/bin/bash
# Note: Numbers are 1024-byte units on Linux,
# and 512-byte units on macOS.
reqSpace=100000000
availSpace=$(df "$HOME" | awk 'NR==2 { print $4 }')
if (( availSpace < reqSpace )); then
... | Here's one way to do it
```
df "$Home" | awk 'END{print $4}'
```
Code:
```
#!/bin/bash
set -e
cd
Home=$PWD
reqSpace=100000000
SPACE=`df "$Home" | awk 'END{print $4}'`
if [[ $SPACE -le reqSpace ]]
then
echo "not enough Space"
exit 1
fi
do something
``` |
5,840 | There are a few games, like [TIS-100](http://www.zachtronics.com/tis-100/) that are based on programming. We've had a couple questions that ask for a review of code written in games like these, and all of them have been tagged [game](https://codereview.stackexchange.com/questions/tagged/game "show questions tagged 'gam... | 2015/08/01 | [
"https://codereview.meta.stackexchange.com/questions/5840",
"https://codereview.meta.stackexchange.com",
"https://codereview.meta.stackexchange.com/users/53251/"
] | No. Code written for the [tis-100](https://codereview.stackexchange.com/questions/tagged/tis-100 "show questions tagged 'tis-100'") game should not be tagged with [game](https://codereview.stackexchange.com/questions/tagged/game "show questions tagged 'game'"). The game tag should be reserved for its typical use of dev... | Yes, questions like this should be tagged [game](https://codereview.stackexchange.com/questions/tagged/game "show questions tagged 'game'"). Here is the tag excerpt for [game](https://codereview.stackexchange.com/questions/tagged/game "show questions tagged 'game'"):
>
> For questions requesting reviews of game-theme... |
25,700,427 | I am trying to get a very simple statement working.
```
Node.where("nodeid = ?", nstart).select('id')
```
Results in
```
Parameters: {"utf8"=>"✓", "authenticity_token"=>"WpSpzLzaFUx8QgFbwEfygQUkkqvbUgZl8Hh0UxJvT8E=", "edge"=>{"kind"=>"IsA", "start_id"=>"blabla", "end_id"=>"bliblib", "property1"=>"bloblbo"}, "commit... | 2014/09/06 | [
"https://Stackoverflow.com/questions/25700427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4011761/"
] | If you just want the `id` value you could do this
```
Node.where("nodeid = ?", nstart).limit(1).pluck(:id).first
```
This would return 1 integer with the value
**EDIT**:
ok scratch that, i guess you don't really need to use `limit` so a simple `first` would just do
```
Node.where("nodeid = ?", nstart).first[:id]
... | You're making a query:
```
Node.where("nodeid = ?", nstart).select('id')
```
will return an array of objects (or empty array if there's no suitable records) \*not array actually. Activerecord::Relation
If you use 'first' like Mohammad AbuShady told:
```
Node.where("nodeid = ?", nstart).select('id').first
```
you... |
60,624,767 | I am trying to parse a line based on location of characters into properties , something like what an external library like beanIo does but without really using beanIo(<http://beanio.org/2.1/docs/reference/index.html#BuilderApiAndAnnotations>)
I would like to use annotations and this is where I am struggling, I don't t... | 2020/03/10 | [
"https://Stackoverflow.com/questions/60624767",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1295276/"
] | I did not put my answer to let you figure it out, but since there is already one I show how I did it too. It seems to work. (Only the changed part).
```
for(j=1; j<stars*2; j++){
if (j < stars)
if (i < rows) // upper left triangle
printf("%c", '0' + ((j + i - 1) % 10));
... | I found one solution to your problem as below...
```
#include <stdio.h>
int main()
{
int i, j, k, x, rows, half_row=1;
int stars, spaces;
printf("Enter rows to print : ");
scanf("%d", &rows);
int a;
stars = 1;
spaces = rows - 1;
/* Iterate through rows */
for(i=1; i<rows*2; i++)... |
60,624,767 | I am trying to parse a line based on location of characters into properties , something like what an external library like beanIo does but without really using beanIo(<http://beanio.org/2.1/docs/reference/index.html#BuilderApiAndAnnotations>)
I would like to use annotations and this is where I am struggling, I don't t... | 2020/03/10 | [
"https://Stackoverflow.com/questions/60624767",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1295276/"
] | Actually there are only two parts that need to be changed. (Since other people have posted answers)
Note: the following solution requires some knowledge on the absolute value function.
First, before the forloop, you declare another variable which stores the value of rows
```
int totalRows = rows;
```
then, inside ... | I found one solution to your problem as below...
```
#include <stdio.h>
int main()
{
int i, j, k, x, rows, half_row=1;
int stars, spaces;
printf("Enter rows to print : ");
scanf("%d", &rows);
int a;
stars = 1;
spaces = rows - 1;
/* Iterate through rows */
for(i=1; i<rows*2; i++)... |
3,848,108 | Based on this original idea, that many of you have probably seen before:
<http://rogeralsing.com/2008/12/07/genetic-programming-evolution-of-mona-lisa/>
I wanted to try taking a different approach:
You have a target image. Let's say you can add one triangle at a time. There exists some triangle (or triangles in case ... | 2010/10/03 | [
"https://Stackoverflow.com/questions/3848108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/90308/"
] | I would start experimenting with vertex-colours (have a different RGBA value for each vertex), this will slightly increase the complexity but massively increase the ability to quickly match the target image (assuming photographic images which tend to have natural gradients in them).
Your question seems to suggest movi... | An idea using multiple runs:
* Use your original algorithm as the first run, and stop it after a predetermined number of steps.
+ Analyze the first run's result. If the result is pretty good on most part of the image but was doing badly in a small part of the image, increase the emphasis of this part.
* When running ... |
3,848,108 | Based on this original idea, that many of you have probably seen before:
<http://rogeralsing.com/2008/12/07/genetic-programming-evolution-of-mona-lisa/>
I wanted to try taking a different approach:
You have a target image. Let's say you can add one triangle at a time. There exists some triangle (or triangles in case ... | 2010/10/03 | [
"https://Stackoverflow.com/questions/3848108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/90308/"
] | An idea using multiple runs:
* Use your original algorithm as the first run, and stop it after a predetermined number of steps.
+ Analyze the first run's result. If the result is pretty good on most part of the image but was doing badly in a small part of the image, increase the emphasis of this part.
* When running ... | Very interesting problem indeed ! My way of analyzing such problem was usage of [evolutionary strategy optimization algorithm](http://coding-experiments.blogspot.com/2009/02/evolving-first-lady-of-internet.html). It's not fast and is suitable if number of triangles is small. I've not achieved good approximations of ori... |
3,848,108 | Based on this original idea, that many of you have probably seen before:
<http://rogeralsing.com/2008/12/07/genetic-programming-evolution-of-mona-lisa/>
I wanted to try taking a different approach:
You have a target image. Let's say you can add one triangle at a time. There exists some triangle (or triangles in case ... | 2010/10/03 | [
"https://Stackoverflow.com/questions/3848108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/90308/"
] | An idea using multiple runs:
* Use your original algorithm as the first run, and stop it after a predetermined number of steps.
+ Analyze the first run's result. If the result is pretty good on most part of the image but was doing badly in a small part of the image, increase the emphasis of this part.
* When running ... | i think that algorithm is at real very simple.
```
P = 200 # size of population
max_steps = 100
def iteration
create P totally random triangles (random points and colors)
select one triangle that has best fittness
#fitness computing is described here: http://rogeralsing.com/2008/12/09/genetic-programming-mona-... |
3,848,108 | Based on this original idea, that many of you have probably seen before:
<http://rogeralsing.com/2008/12/07/genetic-programming-evolution-of-mona-lisa/>
I wanted to try taking a different approach:
You have a target image. Let's say you can add one triangle at a time. There exists some triangle (or triangles in case ... | 2010/10/03 | [
"https://Stackoverflow.com/questions/3848108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/90308/"
] | I would start experimenting with vertex-colours (have a different RGBA value for each vertex), this will slightly increase the complexity but massively increase the ability to quickly match the target image (assuming photographic images which tend to have natural gradients in them).
Your question seems to suggest movi... | Very interesting problem indeed ! My way of analyzing such problem was usage of [evolutionary strategy optimization algorithm](http://coding-experiments.blogspot.com/2009/02/evolving-first-lady-of-internet.html). It's not fast and is suitable if number of triangles is small. I've not achieved good approximations of ori... |
3,848,108 | Based on this original idea, that many of you have probably seen before:
<http://rogeralsing.com/2008/12/07/genetic-programming-evolution-of-mona-lisa/>
I wanted to try taking a different approach:
You have a target image. Let's say you can add one triangle at a time. There exists some triangle (or triangles in case ... | 2010/10/03 | [
"https://Stackoverflow.com/questions/3848108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/90308/"
] | I would start experimenting with vertex-colours (have a different RGBA value for each vertex), this will slightly increase the complexity but massively increase the ability to quickly match the target image (assuming photographic images which tend to have natural gradients in them).
Your question seems to suggest movi... | i think that algorithm is at real very simple.
```
P = 200 # size of population
max_steps = 100
def iteration
create P totally random triangles (random points and colors)
select one triangle that has best fittness
#fitness computing is described here: http://rogeralsing.com/2008/12/09/genetic-programming-mona-... |
18,295,532 | i created an angular application with yeoman, when i executed grunt command i got the following error
```
Running "karma:unit" (karma) task
WARN [config]: JASMINE is not supported anymore.
Please use `frameworks = ["jasmine"];` instead.
WARN [config]: JASMINE_ADAPTER is not supported anymore.
Please us... | 2013/08/18 | [
"https://Stackoverflow.com/questions/18295532",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2686105/"
] | >
> It's just those two predefined terms (JASMINE and JASMINE\_ADAPTER)
> that should not be used any more. All you have to do is open the
> config file ./config/karma.conf.js and comment out those terms and add
> frameworks = ["jasmine"];.
>
>
>
Via [Yasuhiro Yoshida](http://yasuhiroyoshida.github.io/2013/05/2... | apart from @sheplu's answer, there are additional changes that need to be done in karma.conf.js, you can see it in <https://gist.github.com/sivakumar-kailasam/6421378>
this gist solves your problem of **'Config file must be a export a function!'**
The official docs has these changes as well <http://karma-runner.gith... |
20,281,884 | I am trying to align to input text boxes of a form side by side but i not able to do so. Please help.
Fiddle: [here](http://jsfiddle.net/rHh3w/1/)
HTML:
```
<p>Your Name
<br>
<span class="wpcf7-form-control-wrap your-name">
<input type="text" name="your-name" value="" size="40" class="wpcf7-form-control wpcf7-te... | 2013/11/29 | [
"https://Stackoverflow.com/questions/20281884",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2798091/"
] | <http://jsfiddle.net/rHh3w/12/show>
Just need to set your `p` element to "`display:inline;`" by default they are block elements and will not align next to each other.
also deleted two `br` tags
```
p {display:inline;}
``` | Remove `<br />` from your HTML markup.
Write:
```
p{
display:inline-block;
width:50%;
}
.wpcf7-form-control-wrap input[type="text"],.wpcf7-form-control-wrap input[type="email"] {
background-color: #fff;
color: #000;
width: 50%;
}
```
Note:
`inline-block` leaves white space between elements. Wri... |
20,281,884 | I am trying to align to input text boxes of a form side by side but i not able to do so. Please help.
Fiddle: [here](http://jsfiddle.net/rHh3w/1/)
HTML:
```
<p>Your Name
<br>
<span class="wpcf7-form-control-wrap your-name">
<input type="text" name="your-name" value="" size="40" class="wpcf7-form-control wpcf7-te... | 2013/11/29 | [
"https://Stackoverflow.com/questions/20281884",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2798091/"
] | [Try this](http://jsfiddle.net/LHE4W/)
What I have done is added the following:
```
p {
float: left;
}
```
That's all you need to do, it also means that if your container width goes below the fixed width of the two input boxes together, they will float down over two lines rather than breaking and spil... | Just add this to your CSS code : `p{width:40%;border:1px solid #000;float:left}`
**Fiddle :**<http://jsfiddle.net/logintomyk/PSQ7u/> |
20,281,884 | I am trying to align to input text boxes of a form side by side but i not able to do so. Please help.
Fiddle: [here](http://jsfiddle.net/rHh3w/1/)
HTML:
```
<p>Your Name
<br>
<span class="wpcf7-form-control-wrap your-name">
<input type="text" name="your-name" value="" size="40" class="wpcf7-form-control wpcf7-te... | 2013/11/29 | [
"https://Stackoverflow.com/questions/20281884",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2798091/"
] | Remove `<br />` from your HTML markup.
Write:
```
p{
display:inline-block;
width:50%;
}
.wpcf7-form-control-wrap input[type="text"],.wpcf7-form-control-wrap input[type="email"] {
background-color: #fff;
color: #000;
width: 50%;
}
```
Note:
`inline-block` leaves white space between elements. Wri... | Just add this to your CSS code : `p{width:40%;border:1px solid #000;float:left}`
**Fiddle :**<http://jsfiddle.net/logintomyk/PSQ7u/> |
20,281,884 | I am trying to align to input text boxes of a form side by side but i not able to do so. Please help.
Fiddle: [here](http://jsfiddle.net/rHh3w/1/)
HTML:
```
<p>Your Name
<br>
<span class="wpcf7-form-control-wrap your-name">
<input type="text" name="your-name" value="" size="40" class="wpcf7-form-control wpcf7-te... | 2013/11/29 | [
"https://Stackoverflow.com/questions/20281884",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2798091/"
] | <http://jsfiddle.net/rHh3w/12/show>
Just need to set your `p` element to "`display:inline;`" by default they are block elements and will not align next to each other.
also deleted two `br` tags
```
p {display:inline;}
``` | [Try this](http://jsfiddle.net/LHE4W/)
What I have done is added the following:
```
p {
float: left;
}
```
That's all you need to do, it also means that if your container width goes below the fixed width of the two input boxes together, they will float down over two lines rather than breaking and spil... |
20,281,884 | I am trying to align to input text boxes of a form side by side but i not able to do so. Please help.
Fiddle: [here](http://jsfiddle.net/rHh3w/1/)
HTML:
```
<p>Your Name
<br>
<span class="wpcf7-form-control-wrap your-name">
<input type="text" name="your-name" value="" size="40" class="wpcf7-form-control wpcf7-te... | 2013/11/29 | [
"https://Stackoverflow.com/questions/20281884",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2798091/"
] | [Try this](http://jsfiddle.net/LHE4W/)
What I have done is added the following:
```
p {
float: left;
}
```
That's all you need to do, it also means that if your container width goes below the fixed width of the two input boxes together, they will float down over two lines rather than breaking and spil... | HTML example:
```
<div class="myForm">
<div>
<label for="name">Your name</label>
<input name="name" id="name" type="text" />
</div>
<div>
<label for="email">your email</label>
<input name="email" id="email" type="text" />
</div>
</div>
```
CSS:
```
.myForm div {
w... |
20,281,884 | I am trying to align to input text boxes of a form side by side but i not able to do so. Please help.
Fiddle: [here](http://jsfiddle.net/rHh3w/1/)
HTML:
```
<p>Your Name
<br>
<span class="wpcf7-form-control-wrap your-name">
<input type="text" name="your-name" value="" size="40" class="wpcf7-form-control wpcf7-te... | 2013/11/29 | [
"https://Stackoverflow.com/questions/20281884",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2798091/"
] | <http://jsfiddle.net/rHh3w/12/show>
Just need to set your `p` element to "`display:inline;`" by default they are block elements and will not align next to each other.
also deleted two `br` tags
```
p {display:inline;}
``` | Try below `CSS` for p tag
```
p
{
width:auto;
float:left;
margin-right:10px;
}
```
If you need some space between text box then u can set margin-right to the same. |
20,281,884 | I am trying to align to input text boxes of a form side by side but i not able to do so. Please help.
Fiddle: [here](http://jsfiddle.net/rHh3w/1/)
HTML:
```
<p>Your Name
<br>
<span class="wpcf7-form-control-wrap your-name">
<input type="text" name="your-name" value="" size="40" class="wpcf7-form-control wpcf7-te... | 2013/11/29 | [
"https://Stackoverflow.com/questions/20281884",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2798091/"
] | <http://jsfiddle.net/rHh3w/12/show>
Just need to set your `p` element to "`display:inline;`" by default they are block elements and will not align next to each other.
also deleted two `br` tags
```
p {display:inline;}
``` | How about display them like a table.
```
.myForm {
width:100%;
display:table;
}
.myForm div {
margin:0;
padding:0;
display:table-cell;
}
.myForm div:last-of-type{
text-align:right;
}
```
`.myForm div:last-of-type` Align text to the right side.
Check it on <http://jsfiddle.net/463QF/> |
20,281,884 | I am trying to align to input text boxes of a form side by side but i not able to do so. Please help.
Fiddle: [here](http://jsfiddle.net/rHh3w/1/)
HTML:
```
<p>Your Name
<br>
<span class="wpcf7-form-control-wrap your-name">
<input type="text" name="your-name" value="" size="40" class="wpcf7-form-control wpcf7-te... | 2013/11/29 | [
"https://Stackoverflow.com/questions/20281884",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2798091/"
] | Remove `<br />` from your HTML markup.
Write:
```
p{
display:inline-block;
width:50%;
}
.wpcf7-form-control-wrap input[type="text"],.wpcf7-form-control-wrap input[type="email"] {
background-color: #fff;
color: #000;
width: 50%;
}
```
Note:
`inline-block` leaves white space between elements. Wri... | Try below `CSS` for p tag
```
p
{
width:auto;
float:left;
margin-right:10px;
}
```
If you need some space between text box then u can set margin-right to the same. |
20,281,884 | I am trying to align to input text boxes of a form side by side but i not able to do so. Please help.
Fiddle: [here](http://jsfiddle.net/rHh3w/1/)
HTML:
```
<p>Your Name
<br>
<span class="wpcf7-form-control-wrap your-name">
<input type="text" name="your-name" value="" size="40" class="wpcf7-form-control wpcf7-te... | 2013/11/29 | [
"https://Stackoverflow.com/questions/20281884",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2798091/"
] | Remove `<br />` from your HTML markup.
Write:
```
p{
display:inline-block;
width:50%;
}
.wpcf7-form-control-wrap input[type="text"],.wpcf7-form-control-wrap input[type="email"] {
background-color: #fff;
color: #000;
width: 50%;
}
```
Note:
`inline-block` leaves white space between elements. Wri... | HTML example:
```
<div class="myForm">
<div>
<label for="name">Your name</label>
<input name="name" id="name" type="text" />
</div>
<div>
<label for="email">your email</label>
<input name="email" id="email" type="text" />
</div>
</div>
```
CSS:
```
.myForm div {
w... |
20,281,884 | I am trying to align to input text boxes of a form side by side but i not able to do so. Please help.
Fiddle: [here](http://jsfiddle.net/rHh3w/1/)
HTML:
```
<p>Your Name
<br>
<span class="wpcf7-form-control-wrap your-name">
<input type="text" name="your-name" value="" size="40" class="wpcf7-form-control wpcf7-te... | 2013/11/29 | [
"https://Stackoverflow.com/questions/20281884",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2798091/"
] | <http://jsfiddle.net/rHh3w/12/show>
Just need to set your `p` element to "`display:inline;`" by default they are block elements and will not align next to each other.
also deleted two `br` tags
```
p {display:inline;}
``` | HTML example:
```
<div class="myForm">
<div>
<label for="name">Your name</label>
<input name="name" id="name" type="text" />
</div>
<div>
<label for="email">your email</label>
<input name="email" id="email" type="text" />
</div>
</div>
```
CSS:
```
.myForm div {
w... |
98,844 | Yesterday I went out to take some pictures of a field of poppies next to my home. There seems to be something wrong with the color in most of the pictures. The first one of the following 3 pictures is more or less ok, while the other two look bad (besides being out of focus). I'm not sure what it is. I think they're no... | 2018/05/20 | [
"https://photo.stackexchange.com/questions/98844",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/75495/"
] | What is going on?
-----------------
[](https://i.stack.imgur.com/fJn50.jpg)
I compared both pictures of the field (left out the one with the tractor, as it suffers from the same problem as the other over-exposed picture, IMHO) in After effects. The image above is a co... | The first one appears, to my eyes, to be slightly oversaturated, particularly in the red color band (which is the more narrow color we call "red", rather than the entire red color channel that include "magenta" and parts of "orange"). Many digital cameras tend to do this to very red objects in a photo when "Auto White ... |
43,214,978 | I'm looking to see how to do two things in Seaborn with using a bar chart to display values that are in the dataframe, but not in the graph.
1. I'm looking to display the values of one field in a dataframe while graphing another. For example, below, I'm graphing 'tip', but I would like to place the value of `'total_bi... | 2017/04/04 | [
"https://Stackoverflow.com/questions/43214978",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5837992/"
] | Stick to the solution from [Changing color scale in seaborn bar plot](https://stackoverflow.com/questions/36271302/changing-color-scale-in-seaborn-bar-plot), which uses `argsort` to determine the order of the bar colors. In the linked question, `argsort` is applied to a `Series` object, while here you have a `DataFrame... | A simple way to do so is to add the below code (for Seaborn):
```
for p in splot.patches:
splot.annotate(format(p.get_height(), '.1f'),
(p.get_x() + p.get_width() / 2., p.get_height()),
ha = 'center', va = 'center',
xytext = (0, 9),
textco... |
43,214,978 | I'm looking to see how to do two things in Seaborn with using a bar chart to display values that are in the dataframe, but not in the graph.
1. I'm looking to display the values of one field in a dataframe while graphing another. For example, below, I'm graphing 'tip', but I would like to place the value of `'total_bi... | 2017/04/04 | [
"https://Stackoverflow.com/questions/43214978",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5837992/"
] | Stick to the solution from [Changing color scale in seaborn bar plot](https://stackoverflow.com/questions/36271302/changing-color-scale-in-seaborn-bar-plot), which uses `argsort` to determine the order of the bar colors. In the linked question, `argsort` is applied to a `Series` object, while here you have a `DataFrame... | ```
import seaborn as sns
fig = plt.figure(figsize = (12, 8))
ax = plt.subplot(111)
ax = sns.barplot(x="Knowledge_type", y="Percentage", hue="Distance", data=knowledge)
for p in ax.patches:
ax.annotate(format(p.get_height(), '.2f'), (p.get_x() + p.get_width() / 2., p.get_height()),
ha = 'center', va = 'c... |
43,214,978 | I'm looking to see how to do two things in Seaborn with using a bar chart to display values that are in the dataframe, but not in the graph.
1. I'm looking to display the values of one field in a dataframe while graphing another. For example, below, I'm graphing 'tip', but I would like to place the value of `'total_bi... | 2017/04/04 | [
"https://Stackoverflow.com/questions/43214978",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5837992/"
] | ```
plt.figure(figsize=(15, 10))
graph = sns.barplot(x='name_column_x_axis', y="name_column_x_axis", data=dataframe_name, color="salmon")
for p in graph.patches:
graph.annotate('{:.0f}'.format(p.get_height()),
(p.get_x() + 0.3, p.get_height()),
ha='center',
v... | A simple way to do so is to add the below code (for Seaborn):
```
for p in splot.patches:
splot.annotate(format(p.get_height(), '.1f'),
(p.get_x() + p.get_width() / 2., p.get_height()),
ha = 'center', va = 'center',
xytext = (0, 9),
textco... |
43,214,978 | I'm looking to see how to do two things in Seaborn with using a bar chart to display values that are in the dataframe, but not in the graph.
1. I'm looking to display the values of one field in a dataframe while graphing another. For example, below, I'm graphing 'tip', but I would like to place the value of `'total_bi... | 2017/04/04 | [
"https://Stackoverflow.com/questions/43214978",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5837992/"
] | This works with a single ax or with a matrix of ax (subplots):
```
from matplotlib import pyplot as plt
import numpy as np
def show_values_on_bars(axs):
def _show_on_single_plot(ax):
for p in ax.patches:
_x = p.get_x() + p.get_width() / 2
_y = p.get_y() + p.get_height()
... | I hope this helps for item #2:
a) You can sort by total bill and then reset the index to this column
b) Use palette="Blue" to use this color to scale your chart from light blue to dark blue (if dark blue to light blue then use palette="Blues\_d")
```
import pandas as pd
import seaborn as sns
%matplotlib inline
d... |
43,214,978 | I'm looking to see how to do two things in Seaborn with using a bar chart to display values that are in the dataframe, but not in the graph.
1. I'm looking to display the values of one field in a dataframe while graphing another. For example, below, I'm graphing 'tip', but I would like to place the value of `'total_bi... | 2017/04/04 | [
"https://Stackoverflow.com/questions/43214978",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5837992/"
] | Just in case if anyone is interested in labeling **horizontal barplot graph**, I modified [Sharon's answer](https://stackoverflow.com/a/51535326/7898385) as below:
```
def show_values_on_bars(axs, h_v="v", space=0.4):
def _show_on_single_plot(ax):
if h_v == "v":
for p in ax.patches:
... | ```
import seaborn as sns
fig = plt.figure(figsize = (12, 8))
ax = plt.subplot(111)
ax = sns.barplot(x="Knowledge_type", y="Percentage", hue="Distance", data=knowledge)
for p in ax.patches:
ax.annotate(format(p.get_height(), '.2f'), (p.get_x() + p.get_width() / 2., p.get_height()),
ha = 'center', va = 'c... |
43,214,978 | I'm looking to see how to do two things in Seaborn with using a bar chart to display values that are in the dataframe, but not in the graph.
1. I'm looking to display the values of one field in a dataframe while graphing another. For example, below, I'm graphing 'tip', but I would like to place the value of `'total_bi... | 2017/04/04 | [
"https://Stackoverflow.com/questions/43214978",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5837992/"
] | Stick to the solution from [Changing color scale in seaborn bar plot](https://stackoverflow.com/questions/36271302/changing-color-scale-in-seaborn-bar-plot), which uses `argsort` to determine the order of the bar colors. In the linked question, `argsort` is applied to a `Series` object, while here you have a `DataFrame... | Just in case if anyone is interested in labeling **horizontal barplot graph**, I modified [Sharon's answer](https://stackoverflow.com/a/51535326/7898385) as below:
```
def show_values_on_bars(axs, h_v="v", space=0.4):
def _show_on_single_plot(ax):
if h_v == "v":
for p in ax.patches:
... |
43,214,978 | I'm looking to see how to do two things in Seaborn with using a bar chart to display values that are in the dataframe, but not in the graph.
1. I'm looking to display the values of one field in a dataframe while graphing another. For example, below, I'm graphing 'tip', but I would like to place the value of `'total_bi... | 2017/04/04 | [
"https://Stackoverflow.com/questions/43214978",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5837992/"
] | ```
plt.figure(figsize=(15, 10))
graph = sns.barplot(x='name_column_x_axis', y="name_column_x_axis", data=dataframe_name, color="salmon")
for p in graph.patches:
graph.annotate('{:.0f}'.format(p.get_height()),
(p.get_x() + 0.3, p.get_height()),
ha='center',
v... | I hope this helps for item #2:
a) You can sort by total bill and then reset the index to this column
b) Use palette="Blue" to use this color to scale your chart from light blue to dark blue (if dark blue to light blue then use palette="Blues\_d")
```
import pandas as pd
import seaborn as sns
%matplotlib inline
d... |
43,214,978 | I'm looking to see how to do two things in Seaborn with using a bar chart to display values that are in the dataframe, but not in the graph.
1. I'm looking to display the values of one field in a dataframe while graphing another. For example, below, I'm graphing 'tip', but I would like to place the value of `'total_bi... | 2017/04/04 | [
"https://Stackoverflow.com/questions/43214978",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5837992/"
] | New in matplotlib 3.4.0
-----------------------
There is now a built-in [`Axes.bar_label`](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.bar_label.html) to automatically label bar containers:
* For **single-group** bar plots, pass the single bar container:
```py
ax = sns.barplot(x='day', y='tip', da... | This works with a single ax or with a matrix of ax (subplots):
```
from matplotlib import pyplot as plt
import numpy as np
def show_values_on_bars(axs):
def _show_on_single_plot(ax):
for p in ax.patches:
_x = p.get_x() + p.get_width() / 2
_y = p.get_y() + p.get_height()
... |
43,214,978 | I'm looking to see how to do two things in Seaborn with using a bar chart to display values that are in the dataframe, but not in the graph.
1. I'm looking to display the values of one field in a dataframe while graphing another. For example, below, I'm graphing 'tip', but I would like to place the value of `'total_bi... | 2017/04/04 | [
"https://Stackoverflow.com/questions/43214978",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5837992/"
] | New in matplotlib 3.4.0
-----------------------
There is now a built-in [`Axes.bar_label`](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.bar_label.html) to automatically label bar containers:
* For **single-group** bar plots, pass the single bar container:
```py
ax = sns.barplot(x='day', y='tip', da... | I hope this helps for item #2:
a) You can sort by total bill and then reset the index to this column
b) Use palette="Blue" to use this color to scale your chart from light blue to dark blue (if dark blue to light blue then use palette="Blues\_d")
```
import pandas as pd
import seaborn as sns
%matplotlib inline
d... |
43,214,978 | I'm looking to see how to do two things in Seaborn with using a bar chart to display values that are in the dataframe, but not in the graph.
1. I'm looking to display the values of one field in a dataframe while graphing another. For example, below, I'm graphing 'tip', but I would like to place the value of `'total_bi... | 2017/04/04 | [
"https://Stackoverflow.com/questions/43214978",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5837992/"
] | New in matplotlib 3.4.0
-----------------------
There is now a built-in [`Axes.bar_label`](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.bar_label.html) to automatically label bar containers:
* For **single-group** bar plots, pass the single bar container:
```py
ax = sns.barplot(x='day', y='tip', da... | A simple way to do so is to add the below code (for Seaborn):
```
for p in splot.patches:
splot.annotate(format(p.get_height(), '.1f'),
(p.get_x() + p.get_width() / 2., p.get_height()),
ha = 'center', va = 'center',
xytext = (0, 9),
textco... |
26,119,778 | Well so I'm trying to parse a bit of JSon. I succeeded to parse:
Member.json:
```
{"member":{"id":585897,"name":"PhPeter","profileIconId":691,"age":99,"email":"peter@adress.com "}}
```
but what if I need to parse:
```
{"Members":[{"id":585897,"name":"PhPeter","profileIconId":691,"age":99,"email":"peter@adress.... | 2014/09/30 | [
"https://Stackoverflow.com/questions/26119778",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1517079/"
] | Start new `Activity` and give `overridePendingTransition(R.anim.zoom_enter, R.anim.zoom_exit);`
where zoom\_enter.xml has
```
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/decelerate_interpolator">
<scale android:fromXScal... | I am thinking of animating only the grid (zoom in and fade out, same time), and when the grid is full screen, tren replace fragment with a fade in new fragment animation. |
26,119,778 | Well so I'm trying to parse a bit of JSon. I succeeded to parse:
Member.json:
```
{"member":{"id":585897,"name":"PhPeter","profileIconId":691,"age":99,"email":"peter@adress.com "}}
```
but what if I need to parse:
```
{"Members":[{"id":585897,"name":"PhPeter","profileIconId":691,"age":99,"email":"peter@adress.... | 2014/09/30 | [
"https://Stackoverflow.com/questions/26119778",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1517079/"
] | That's called **Shared Element Activity Transition**.
[](https://i.stack.imgur.com/zZoaZ.gif)
Note that the shared element transitions require Android 5.0 (API level 21) and above.
You need to do is to provide a transition name that both Activites can use to create a tr... | Start new `Activity` and give `overridePendingTransition(R.anim.zoom_enter, R.anim.zoom_exit);`
where zoom\_enter.xml has
```
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/decelerate_interpolator">
<scale android:fromXScal... |
26,119,778 | Well so I'm trying to parse a bit of JSon. I succeeded to parse:
Member.json:
```
{"member":{"id":585897,"name":"PhPeter","profileIconId":691,"age":99,"email":"peter@adress.com "}}
```
but what if I need to parse:
```
{"Members":[{"id":585897,"name":"PhPeter","profileIconId":691,"age":99,"email":"peter@adress.... | 2014/09/30 | [
"https://Stackoverflow.com/questions/26119778",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1517079/"
] | That's called **Shared Element Activity Transition**.
[](https://i.stack.imgur.com/zZoaZ.gif)
Note that the shared element transitions require Android 5.0 (API level 21) and above.
You need to do is to provide a transition name that both Activites can use to create a tr... | I am thinking of animating only the grid (zoom in and fade out, same time), and when the grid is full screen, tren replace fragment with a fade in new fragment animation. |
10,976,771 | I have some resultset data as follows :
```
+-------+-------+-------+-------+
| Code1 | Code2 | Code3 | Code4 |
+-------+-------+-------+-------+
| 1 | 11 | 111 | 1111 |
| 2 | 21 | 211 | 2111 |
| 2 | 22 | 221 | 2211 |
| 2 | 21 | 212 | 2121 |
+-------+-------+-------+-------+
`... | 2012/06/11 | [
"https://Stackoverflow.com/questions/10976771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/632173/"
] | **NOTE**
The name in name/value pair of [JSON](https://www.json.org) should be string (not a number in your question).
[](https://i.stack.imgur.com/MWrpJ.gif)
(source: [json.org](http://www.json.org/object.gif))
Sample code
-----------
As mentioned in @josnidhi... | You have to build a tree structure first. Then each level of the tree, you output as JSON. This is basically a minute change of BFS (also called level order traversal). |
19,368 | Is it possible to store each animation frame as a new object? I searched quite a long time now on google and was wondering that I cannot find any information about this.
I just have a simple model with a simple pose animation and I'm looking for a way to get each frame stored as a new object, that I end up with maybe ... | 2014/11/30 | [
"https://blender.stackexchange.com/questions/19368",
"https://blender.stackexchange.com",
"https://blender.stackexchange.com/users/8255/"
] | You should avoid operators whenever possible:
```
import bpy
scene = bpy.context.scene
frame_current = scene.frame_current
for f in range(scene.frame_start, scene.frame_end + 1):
scene.frame_set(f)
meshes = []
for ob in scene.objects:
if ob.type == 'MESH' and ob.name.startswith("model"):
... | Following is an example script that converts the mesh (animated by an armature) to separate objects. To keep the code simple, the assumption is that there is only one modifier (Armature) and the mesh was bound to armature using vertex groups. There are 5 frames of animation (frames 1, 2, 3, 4, 5)
```
import bpy
# Sel... |
3,161,430 | I just started learning about cardinality in my math fundamentals class, and in particular I've just learned that $\aleph \_0$ can be thought of as an equivalence class as follows: any set with cardinality equal to it are in its class. For instance, $\mathbb{N} \in \aleph \_0$, and likewise, $\mathbb{Q} \in \aleph \_0$... | 2019/03/25 | [
"https://math.stackexchange.com/questions/3161430",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/324783/"
] | **Part $1$: The cardinality is uncountable, with a caveat:**
The cardinality of this equivalence class is, at first glance, uncountable. For notation's sake, let us denote this class by $\overline{\aleph\_0}$, to avoid confusion with the cardinal.
It is known that the cardinality of the reals - that of the continuum ... | That depends on what your universe is. If you're considering all possible sets (as described by, say, ZF set theory), then the number of sets of cardinality $\aleph\_0$ is too large to be described as a cardinal, for the same reason that the total number of sets (without size restrictions) is bigger than any cardinal. |
3,161,430 | I just started learning about cardinality in my math fundamentals class, and in particular I've just learned that $\aleph \_0$ can be thought of as an equivalence class as follows: any set with cardinality equal to it are in its class. For instance, $\mathbb{N} \in \aleph \_0$, and likewise, $\mathbb{Q} \in \aleph \_0$... | 2019/03/25 | [
"https://math.stackexchange.com/questions/3161430",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/324783/"
] | **Part $1$: The cardinality is uncountable, with a caveat:**
The cardinality of this equivalence class is, at first glance, uncountable. For notation's sake, let us denote this class by $\overline{\aleph\_0}$, to avoid confusion with the cardinal.
It is known that the cardinality of the reals - that of the continuum ... | However we define cardinals or cardinalities, $\aleph\_0$ will be that of the set $\omega$. With the axiom of choice, the cardinality of a set $S$ is definable as the least ordinal equipollent to $S$ (i.e. with which it has a bijection).
Without the axiom of choice, another approach focuses on sets equipollent to $S$.... |
46,377,571 | I try to perform some Cucumber tests of a Spring boot application.
It seems like Spring Boot is not started before tests are running.
What am i missing?
<https://bitbucket.org/oakstair/spring-boot-cucumber-example> | 2017/09/23 | [
"https://Stackoverflow.com/questions/46377571",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2276754/"
] | My Cucumber repo still runs without doing all the above steps:
<https://github.com/BarathArivazhagan/Cucumber-spring-integration>
Docs : <https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-testing.html>
To add more:
1. `@SpringBootTest` takes care of loading the application context in th... | I found the problem and has updated the repo.
I did the following to get it working:
* Added `RANDOM_PORT` to `@SpringBootTest`
* Added `@ContextConfiguration`
* Switched from `RestTemplate` to `TestRestTemplate` |
46,377,571 | I try to perform some Cucumber tests of a Spring boot application.
It seems like Spring Boot is not started before tests are running.
What am i missing?
<https://bitbucket.org/oakstair/spring-boot-cucumber-example> | 2017/09/23 | [
"https://Stackoverflow.com/questions/46377571",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2276754/"
] | Let's say you have a feature file, `feature1`, and `glueCode` in `org.xyz.feature1`
```
@RunWith(Cucumber.class)
@CucumberOptions(
plugin = {"pretty"},
features = "src/test/java/resources/feature/feature1",
glue = {"org.xyz.feature1"})
public class CucumberTest {
}
@RunWith(SpringRunner.class)
@SpringBoo... | I found the problem and has updated the repo.
I did the following to get it working:
* Added `RANDOM_PORT` to `@SpringBootTest`
* Added `@ContextConfiguration`
* Switched from `RestTemplate` to `TestRestTemplate` |
46,377,571 | I try to perform some Cucumber tests of a Spring boot application.
It seems like Spring Boot is not started before tests are running.
What am i missing?
<https://bitbucket.org/oakstair/spring-boot-cucumber-example> | 2017/09/23 | [
"https://Stackoverflow.com/questions/46377571",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2276754/"
] | My Cucumber repo still runs without doing all the above steps:
<https://github.com/BarathArivazhagan/Cucumber-spring-integration>
Docs : <https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-testing.html>
To add more:
1. `@SpringBootTest` takes care of loading the application context in th... | Let's say you have a feature file, `feature1`, and `glueCode` in `org.xyz.feature1`
```
@RunWith(Cucumber.class)
@CucumberOptions(
plugin = {"pretty"},
features = "src/test/java/resources/feature/feature1",
glue = {"org.xyz.feature1"})
public class CucumberTest {
}
@RunWith(SpringRunner.class)
@SpringBoo... |
27,525,657 | I have a universal application being developed in iOS8 (XCode 6.1.1). It will support all the 4 orientations (left, right, portrait & upside down).
The problem is that, although in XCode the four options for supported orientations are checked, only left, right & portrait are working properly. So, is there a bug on XCo... | 2014/12/17 | [
"https://Stackoverflow.com/questions/27525657",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4100075/"
] | Well, I have figured out the purpose of the the options on project configuration... Within the options you're saying "my app support these orientations" and not "my app must use these four options"... So, on iPhone you must explicity say that a particular ViewController support all orientations (the upsidedown doesn't ... | With Swift 2.1, you can simplify @Cleversou’s answer to:
```
override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask
{
return .All
}
```
With Swift 2.3
```
override var supportedInterfaceOrientations : UIInterfaceOrientationMask {
return .all
}
``` |
27,525,657 | I have a universal application being developed in iOS8 (XCode 6.1.1). It will support all the 4 orientations (left, right, portrait & upside down).
The problem is that, although in XCode the four options for supported orientations are checked, only left, right & portrait are working properly. So, is there a bug on XCo... | 2014/12/17 | [
"https://Stackoverflow.com/questions/27525657",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4100075/"
] | Well, I have figured out the purpose of the the options on project configuration... Within the options you're saying "my app support these orientations" and not "my app must use these four options"... So, on iPhone you must explicity say that a particular ViewController support all orientations (the upsidedown doesn't ... | If you are running inside of a navigation controller or tab bar controller, you will need to do the same override in your subclass or override all instances with an extension:
```
extension UINavigationController {
override public func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
return .All
... |
31,856,234 | In Code I am trying to send both the header and cookies in same request
below is the code
```
@result = RestClient.post(
'url',
{:billingSourceCode => "code"},
{:cookies => {:session_id => "1234"}},
{:headers => {'Content-Type' =>'application/json',
... | 2015/08/06 | [
"https://Stackoverflow.com/questions/31856234",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/808233/"
] | Cookies are part of headers. Here in `RestClient` :
```
@cookies = @headers.delete(:cookies) || args[:cookies] || {}
```
See in `initialize` method in <https://github.com/rest-client/rest-client/blob/master/lib/restclient/request.rb>
Do this -
```
@result = RestClient.post(
'url',
{:billin... | Try
```
RestClient::Request.execute(
method: :post,
url: 'whatever',
cookies: {:session_id => "1234"},
headers: {'Content-Type' =>'application/json',
"Authorization" => "key",
"Accept" => "application/json"})
``` |
15,126,971 | I am using codeigniter validation library...for a international number i am trying to accept a Numeric 15 digits..also white space shud be allowed.. but below does not work for some reason...it does not accept whitespace...
```
if(isset($data['perfume_int_contact']))
{
//$this->form_v... | 2013/02/28 | [
"https://Stackoverflow.com/questions/15126971",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1322791/"
] | PHP is being executed server-side, so it does not have any access to the client's computer. Furthermore, it would be a major security issue if *any* website could run an exe on an innocent client's computer.
You will need to acquire users' mac addresses using client-side means that the user allows to run. | bljak windows
but its not possible to take the clinent macaddress to do that you need some java applet to take it and send to you
anyay maybe you want server mac-address this sis the way
```
$ipconfiguration= exec('ifconfig');
```
you shoud get
eth0 Link encap:Ethernet HWaddr 00:23:13:55:79:78
inet addr:xxx... |
20,948 | In Matthew 23 Jesus goes into a lengthy rebuke of the scribes and Pharisees. In verses 13, 14, 15, 23, 25, 27, 29 (some translations omit 14), He begins by saying:
>
> “But woe to you, scribes and Pharisees, hypocrites!..." (ESV)
>
>
>
Is it clear that Jesus is calling the scribes and Pharisees hypocrites? Or is ... | 2015/12/16 | [
"https://hermeneutics.stackexchange.com/questions/20948",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/8450/"
] | As a stub answer that someone can fill out later with a Masters' thesis, it's improbable that there are three classes being addressed here (scribes, Pharisees, and hypocrites).
If the author had intended there to be three terms, there are two common Greek idioms for that with fancy names: one would be "polysyndeton", ... | Strictly speaking, Jesus could not have called anyone a hypocrite, as the word did not exist either in Aramaic or Hebrew. The word 'hypocrites' comes from the Greek ὑποκριταί, which refers to a play-actor. Frank Stern (*[A Rabbi Looks at Jesus' Parables](https://books.google.com.au/books?id=FF4N2auokDQC&pg=PA81&lpg=PA8... |
70,905,747 | As we know the range of a char variable is from -128 to 127 and the maximum value is 255 (in case of unsigned char). So kindly clear the below doubts of mine:
1. `char c=255;` As it is exceeding the range so why it wraps up 255 instead of giving errors?
2. Why is there no ascii values of negative char values (-128 to ... | 2022/01/29 | [
"https://Stackoverflow.com/questions/70905747",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12280634/"
] | >
> As we know the range of a char variable is from -128 to 127 and the maximum value is 255 (in case of unsigned char)
>
>
>
The C standard requires the range of `unsigned char` to be at least 0 to 255. You can make a C implementation with a larger range for `unsigned char`, with more than eight bits for it.
`ch... | Programming is all about rules — following them, or at least knowing what they are.
And one of the rules is that, sometimes, there are no rules.
>
> As we know the range of a char variable is from -128 to 127 and the maximum value is 255 (in case of unsigned char)
>
>
>
Well, actually, no, we don't know that. Th... |
83,720 | I have sixteen students in my class who sit in four rows of four. Each week they sit in a different order.
After a number of weeks every student has sat next to every other student, next meaning side by side, one behind the other, or sitting diagonally together. What is the fewest number of weeks in which this can ha... | 2019/05/07 | [
"https://puzzling.stackexchange.com/questions/83720",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/19026/"
] | As a starting point for Question 2, here it is done in
>
> 7 weeks
>
>
>
Solution
>
>
> ```
>
> 01234 IG968 HCFA1 97HEP BA92H HDCE0 EB095
> 56789 B1HKJ 3P4JD MF8AK L3CJ8 8K1F2 GN46H
> ABCDE P4307 E20BM N3LI4 KDGN7 GMBNI 3IACK
> FGHIJ D5MAL 7698K J50D6 50461 P6LJA... | The first question i believe it's
>
> 256
>
>
>
and the second one it's
>
> 625
>
>
>
I think the solution of this one is to multiply the two numbers given. An other example is:find all the combinations of these words `PANEL`(wich i'll use the same equation). |
83,720 | I have sixteen students in my class who sit in four rows of four. Each week they sit in a different order.
After a number of weeks every student has sat next to every other student, next meaning side by side, one behind the other, or sitting diagonally together. What is the fewest number of weeks in which this can ha... | 2019/05/07 | [
"https://puzzling.stackexchange.com/questions/83720",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/19026/"
] | Partial answer to Question 1.
>
> First, the average number of friends a student gets per week is
> $$\frac{4\times 3 +8\times 5+4\times 8}{16}=5.25$$
> (there are $4$ corners each of which has $3$ friends, and so on).
>
>
>
> At the end of the day, we want each student to have had $15$ different friends, so ... | The first question i believe it's
>
> 256
>
>
>
and the second one it's
>
> 625
>
>
>
I think the solution of this one is to multiply the two numbers given. An other example is:find all the combinations of these words `PANEL`(wich i'll use the same equation). |
83,720 | I have sixteen students in my class who sit in four rows of four. Each week they sit in a different order.
After a number of weeks every student has sat next to every other student, next meaning side by side, one behind the other, or sitting diagonally together. What is the fewest number of weeks in which this can ha... | 2019/05/07 | [
"https://puzzling.stackexchange.com/questions/83720",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/19026/"
] | Continuing from Arnaud Mortier's observations,
>
> I noticed that each student in the always-on-the-edge group will sit by one student from each rotating group while the rotating students are in the corners, and two more students from each rotating group while they are in the center. So each student in the always-on... | Here's 16 students in
>
> 4
>
>
>
weeks.
>
>
> ```
>
> 0123 A8B9 CAD0 135E
> 4567 2031 B179 A2BC
> 89AB ECFD 58E4 94D0
> CDEF 6475 F263 7F68
>
> ```
>
>
>
> |
83,720 | I have sixteen students in my class who sit in four rows of four. Each week they sit in a different order.
After a number of weeks every student has sat next to every other student, next meaning side by side, one behind the other, or sitting diagonally together. What is the fewest number of weeks in which this can ha... | 2019/05/07 | [
"https://puzzling.stackexchange.com/questions/83720",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/19026/"
] | Here's 16 students in
>
> 4
>
>
>
weeks.
>
>
> ```
>
> 0123 A8B9 CAD0 135E
> 4567 2031 B179 A2BC
> 89AB ECFD 58E4 94D0
> CDEF 6475 F263 7F68
>
> ```
>
>
>
> | As a starting point for Question 2, here it is done in
>
> 7 weeks
>
>
>
Solution
>
>
> ```
>
> 01234 IG968 HCFA1 97HEP BA92H HDCE0 EB095
> 56789 B1HKJ 3P4JD MF8AK L3CJ8 8K1F2 GN46H
> ABCDE P4307 E20BM N3LI4 KDGN7 GMBNI 3IACK
> FGHIJ D5MAL 7698K J50D6 50461 P6LJA... |
83,720 | I have sixteen students in my class who sit in four rows of four. Each week they sit in a different order.
After a number of weeks every student has sat next to every other student, next meaning side by side, one behind the other, or sitting diagonally together. What is the fewest number of weeks in which this can ha... | 2019/05/07 | [
"https://puzzling.stackexchange.com/questions/83720",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/19026/"
] | Continuing from Arnaud Mortier's observations,
>
> I noticed that each student in the always-on-the-edge group will sit by one student from each rotating group while the rotating students are in the corners, and two more students from each rotating group while they are in the center. So each student in the always-on... | A quick intuitive answer:
For 16 students:
>
> 6 weeks
>
>
>
Reasoning (edited to account for the corner case, as pointed out by hexomino);
>
> 2nd week: swap 1st and 3rd columns. 3rd week: swap 2nd and 4th columns. Do the same operations with the rows over the next two weeks. Before swapping, either the firs... |
83,720 | I have sixteen students in my class who sit in four rows of four. Each week they sit in a different order.
After a number of weeks every student has sat next to every other student, next meaning side by side, one behind the other, or sitting diagonally together. What is the fewest number of weeks in which this can ha... | 2019/05/07 | [
"https://puzzling.stackexchange.com/questions/83720",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/19026/"
] | A quick intuitive answer:
For 16 students:
>
> 6 weeks
>
>
>
Reasoning (edited to account for the corner case, as pointed out by hexomino);
>
> 2nd week: swap 1st and 3rd columns. 3rd week: swap 2nd and 4th columns. Do the same operations with the rows over the next two weeks. Before swapping, either the firs... | The first question i believe it's
>
> 256
>
>
>
and the second one it's
>
> 625
>
>
>
I think the solution of this one is to multiply the two numbers given. An other example is:find all the combinations of these words `PANEL`(wich i'll use the same equation). |
83,720 | I have sixteen students in my class who sit in four rows of four. Each week they sit in a different order.
After a number of weeks every student has sat next to every other student, next meaning side by side, one behind the other, or sitting diagonally together. What is the fewest number of weeks in which this can ha... | 2019/05/07 | [
"https://puzzling.stackexchange.com/questions/83720",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/19026/"
] | Continuing from Arnaud Mortier's observations,
>
> I noticed that each student in the always-on-the-edge group will sit by one student from each rotating group while the rotating students are in the corners, and two more students from each rotating group while they are in the center. So each student in the always-on... | Partial answer to Question 1.
>
> First, the average number of friends a student gets per week is
> $$\frac{4\times 3 +8\times 5+4\times 8}{16}=5.25$$
> (there are $4$ corners each of which has $3$ friends, and so on).
>
>
>
> At the end of the day, we want each student to have had $15$ different friends, so ... |
83,720 | I have sixteen students in my class who sit in four rows of four. Each week they sit in a different order.
After a number of weeks every student has sat next to every other student, next meaning side by side, one behind the other, or sitting diagonally together. What is the fewest number of weeks in which this can ha... | 2019/05/07 | [
"https://puzzling.stackexchange.com/questions/83720",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/19026/"
] | Partial answer to Question 1.
>
> First, the average number of friends a student gets per week is
> $$\frac{4\times 3 +8\times 5+4\times 8}{16}=5.25$$
> (there are $4$ corners each of which has $3$ friends, and so on).
>
>
>
> At the end of the day, we want each student to have had $15$ different friends, so ... | As a starting point for Question 2, here it is done in
>
> 7 weeks
>
>
>
Solution
>
>
> ```
>
> 01234 IG968 HCFA1 97HEP BA92H HDCE0 EB095
> 56789 B1HKJ 3P4JD MF8AK L3CJ8 8K1F2 GN46H
> ABCDE P4307 E20BM N3LI4 KDGN7 GMBNI 3IACK
> FGHIJ D5MAL 7698K J50D6 50461 P6LJA... |
83,720 | I have sixteen students in my class who sit in four rows of four. Each week they sit in a different order.
After a number of weeks every student has sat next to every other student, next meaning side by side, one behind the other, or sitting diagonally together. What is the fewest number of weeks in which this can ha... | 2019/05/07 | [
"https://puzzling.stackexchange.com/questions/83720",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/19026/"
] | Continuing from Arnaud Mortier's observations,
>
> I noticed that each student in the always-on-the-edge group will sit by one student from each rotating group while the rotating students are in the corners, and two more students from each rotating group while they are in the center. So each student in the always-on... | As a starting point for Question 2, here it is done in
>
> 7 weeks
>
>
>
Solution
>
>
> ```
>
> 01234 IG968 HCFA1 97HEP BA92H HDCE0 EB095
> 56789 B1HKJ 3P4JD MF8AK L3CJ8 8K1F2 GN46H
> ABCDE P4307 E20BM N3LI4 KDGN7 GMBNI 3IACK
> FGHIJ D5MAL 7698K J50D6 50461 P6LJA... |
83,720 | I have sixteen students in my class who sit in four rows of four. Each week they sit in a different order.
After a number of weeks every student has sat next to every other student, next meaning side by side, one behind the other, or sitting diagonally together. What is the fewest number of weeks in which this can ha... | 2019/05/07 | [
"https://puzzling.stackexchange.com/questions/83720",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/19026/"
] | As a starting point for Question 2, here it is done in
>
> 7 weeks
>
>
>
Solution
>
>
> ```
>
> 01234 IG968 HCFA1 97HEP BA92H HDCE0 EB095
> 56789 B1HKJ 3P4JD MF8AK L3CJ8 8K1F2 GN46H
> ABCDE P4307 E20BM N3LI4 KDGN7 GMBNI 3IACK
> FGHIJ D5MAL 7698K J50D6 50461 P6LJA... | A quick intuitive answer:
For 16 students:
>
> 6 weeks
>
>
>
Reasoning (edited to account for the corner case, as pointed out by hexomino);
>
> 2nd week: swap 1st and 3rd columns. 3rd week: swap 2nd and 4th columns. Do the same operations with the rows over the next two weeks. Before swapping, either the firs... |
8,334,602 | i'm starting now on Rails, i looked in the forum, but i didn't find anything that could solve my problem.
Here it goes, I have a Category table, and it has only name for a column (there is no repetition in categories) so i would like name to be the primary key, then i have a Product table that has name, main\_photo, ... | 2011/11/30 | [
"https://Stackoverflow.com/questions/8334602",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1074432/"
] | Foreign key constraints in Active Record aren't used very often as the ideology behind Active Record says that this kind of logic should belong in the model and not in the database - the database is just a dumb store: <http://guides.rubyonrails.org/migrations.html#active-record-and-referential-integrity>.
The Rails wa... | There are many valid reasons to have foreign keys in your database. See [Does Rails need database-level constraints?](https://stackoverflow.com/questions/2589509/does-rails-need-database-level-constraints/2589875#2589875)
I recommend [Foreigner](https://github.com/matthuhiggins/foreigner) if you want to easily add for... |
1,418,613 | I would like to know how to declare a variable in jQuery
The code I am currently using is
```
$.name = 'anirudha';
alert($.name);
```
That code works fine, but if I write it as
```
$.name = document.myForm.txtname.value;
alert($.name);
```
Then my code does not work. | 2009/09/13 | [
"https://Stackoverflow.com/questions/1418613",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | jQuery is just a javascript library that makes some extra stuff available when writing javascript - so there is no reason to use jQuery for declaring variables. Use "regular" javascript:
```
var name = document.myForm.txtname.value;
alert(name);
```
EDIT: As Canavar points out in his example, it is also possible to ... | In jquery, u can delcare variable two styles.
One is,
```
$.name = 'anirudha';
alert($.name);
```
Second is,
```
var hText = $("#head1").text();
```
Second is used when you read data from `textbox`, `label`, etc. |
1,418,613 | I would like to know how to declare a variable in jQuery
The code I am currently using is
```
$.name = 'anirudha';
alert($.name);
```
That code works fine, but if I write it as
```
$.name = document.myForm.txtname.value;
alert($.name);
```
Then my code does not work. | 2009/09/13 | [
"https://Stackoverflow.com/questions/1418613",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You can also use `text()` to set or get the text content of selected elements
```
var text1 = $("#idName").text();
``` | ```
var name = 'john';
document.write(name);
```
it will write the **variable** you have declared upper |
1,418,613 | I would like to know how to declare a variable in jQuery
The code I am currently using is
```
$.name = 'anirudha';
alert($.name);
```
That code works fine, but if I write it as
```
$.name = document.myForm.txtname.value;
alert($.name);
```
Then my code does not work. | 2009/09/13 | [
"https://Stackoverflow.com/questions/1418613",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | jQuery is just a javascript library that makes some extra stuff available when writing javascript - so there is no reason to use jQuery for declaring variables. Use "regular" javascript:
```
var name = document.myForm.txtname.value;
alert(name);
```
EDIT: As Canavar points out in his example, it is also possible to ... | You can also use `text()` to set or get the text content of selected elements
```
var text1 = $("#idName").text();
``` |
1,418,613 | I would like to know how to declare a variable in jQuery
The code I am currently using is
```
$.name = 'anirudha';
alert($.name);
```
That code works fine, but if I write it as
```
$.name = document.myForm.txtname.value;
alert($.name);
```
Then my code does not work. | 2009/09/13 | [
"https://Stackoverflow.com/questions/1418613",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Try this :
```
var name = $("#txtname").val();
alert(name);
``` | You can also use `text()` to set or get the text content of selected elements
```
var text1 = $("#idName").text();
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.