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 |
|---|---|---|---|---|---|
15,882 | Just like the newly presented iMessage but instead of just between iOS devices, with the Mac too.
I've looked at Handoff. It can only send links to the iPhone from the Mac.
I've looked at Droplr. It requires public sharing on a Twitter account. Not what I want.
I've been using email and have been recommended Evernot... | 2011/06/13 | [
"https://apple.stackexchange.com/questions/15882",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/4729/"
] | Apple OSX Mountain Lion has been announced, it includes a few of the iOS apps on the mac desktop such as Notes, Game Center, reminders, twitter and message.
<http://www.apple.com/macosx/mountain-lion/> | RE: ".. I just want an app/application pair that can quickly share links, notes, and pictures between devices, like iMessage."
There is nothing I know of that does everything you require as simply as iMessage, but I can give you my solution for this (since this is something that I also require).
For quickly sharing l... |
15,882 | Just like the newly presented iMessage but instead of just between iOS devices, with the Mac too.
I've looked at Handoff. It can only send links to the iPhone from the Mac.
I've looked at Droplr. It requires public sharing on a Twitter account. Not what I want.
I've been using email and have been recommended Evernot... | 2011/06/13 | [
"https://apple.stackexchange.com/questions/15882",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/4729/"
] | Looks like Apple answered my prayers themselves:
<http://www.apple.com/macosx/mountain-lion/messages-beta/>
What a lot of posters weren't getting is that I don't want to use synced notes and email because that requires a tedious "compose" stage and also leaves behind a bunch of clutter that I either have to search th... | Currently, the best app for this is [DeskConnect](http://deskconnect.com/). |
15,882 | Just like the newly presented iMessage but instead of just between iOS devices, with the Mac too.
I've looked at Handoff. It can only send links to the iPhone from the Mac.
I've looked at Droplr. It requires public sharing on a Twitter account. Not what I want.
I've been using email and have been recommended Evernot... | 2011/06/13 | [
"https://apple.stackexchange.com/questions/15882",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/4729/"
] | The best solution I have found for quick and seamless transfer of clips, pictures and links is [PasteBot](http://tapbots.com/software/pastebot/).
Currently it works for WiFi sync, but in practice, my phone is always with me when I get home and I don't really need the data to get to the mac sooner than when I'm back ho... | [Evernote](http://www.evernote.com/) does this. Photos, notes, screenshots, audio memos, etc. can be captured and shared between your Mac and iPhone. |
15,882 | Just like the newly presented iMessage but instead of just between iOS devices, with the Mac too.
I've looked at Handoff. It can only send links to the iPhone from the Mac.
I've looked at Droplr. It requires public sharing on a Twitter account. Not what I want.
I've been using email and have been recommended Evernot... | 2011/06/13 | [
"https://apple.stackexchange.com/questions/15882",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/4729/"
] | I agree iMessage is the best solution. For those that (for whatever reason, may not be able to use this) here is a solution for quick notes sync. I created a contact on my iPhone called "My Notes" and put what text I want on the notes section and it instantly syncs with Address Book on my mac. And at the desktop I do t... | There is no need for third-party apps whether free or paid.
Notes on iOS syncs with Mail.app on OS X across accounts; iCloud not required.
As far as pictures, they do require iCloud syncing. The photos part are synced to ~/Library/Application Support/iLifeAssetManagement/assets/sub each photo into a file. There exis... |
15,882 | Just like the newly presented iMessage but instead of just between iOS devices, with the Mac too.
I've looked at Handoff. It can only send links to the iPhone from the Mac.
I've looked at Droplr. It requires public sharing on a Twitter account. Not what I want.
I've been using email and have been recommended Evernot... | 2011/06/13 | [
"https://apple.stackexchange.com/questions/15882",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/4729/"
] | Apple OSX Mountain Lion has been announced, it includes a few of the iOS apps on the mac desktop such as Notes, Game Center, reminders, twitter and message.
<http://www.apple.com/macosx/mountain-lion/> | I don't know iMessage and I can't see why you need this, but there is [Syncopy](http://appshopper.com/productivity/syncopy). Hope this does it. |
15,882 | Just like the newly presented iMessage but instead of just between iOS devices, with the Mac too.
I've looked at Handoff. It can only send links to the iPhone from the Mac.
I've looked at Droplr. It requires public sharing on a Twitter account. Not what I want.
I've been using email and have been recommended Evernot... | 2011/06/13 | [
"https://apple.stackexchange.com/questions/15882",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/4729/"
] | RE: ".. I just want an app/application pair that can quickly share links, notes, and pictures between devices, like iMessage."
There is nothing I know of that does everything you require as simply as iMessage, but I can give you my solution for this (since this is something that I also require).
For quickly sharing l... | Currently, the best app for this is [DeskConnect](http://deskconnect.com/). |
15,882 | Just like the newly presented iMessage but instead of just between iOS devices, with the Mac too.
I've looked at Handoff. It can only send links to the iPhone from the Mac.
I've looked at Droplr. It requires public sharing on a Twitter account. Not what I want.
I've been using email and have been recommended Evernot... | 2011/06/13 | [
"https://apple.stackexchange.com/questions/15882",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/4729/"
] | I agree iMessage is the best solution. For those that (for whatever reason, may not be able to use this) here is a solution for quick notes sync. I created a contact on my iPhone called "My Notes" and put what text I want on the notes section and it instantly syncs with Address Book on my mac. And at the desktop I do t... | [Evernote](http://www.evernote.com/) does this. Photos, notes, screenshots, audio memos, etc. can be captured and shared between your Mac and iPhone. |
32,842,494 | ```
@EActivity(R.layout.data_layout)
public class MyActivity extendsActivity
{
@Bean MyEbean bean;
@AfterViews
public void setupView()
{
bean.loadData("Test name");
}
}
@EBean public class MyEbean
{
@RootContext context;
@Vi... | 2015/09/29 | [
"https://Stackoverflow.com/questions/32842494",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2413160/"
] | I don't know the reason why it doesn't work but if you need it just works, the solution is pretty easy:
```java
@EActivity(R.layout.data_layout)
public class MyActivity extends Activity {
@Bean MyEbean bean;
}
@EBean
public class MyEbean {
@ViewById Button previewButton;
@AfterViews void init() ... | -Agree with above answer
The **key point** is ....
```
@AfterViews void init() {
previewButton.setText("Blah");
}
```
* this shows that views are fetched so you will not get null pointer . |
20,720,398 | How does :as works in the rails routing. Say, I have following code
```
get '/patients/:id', to: 'patients#show', as: 'patient'
```
I understand that when rails get `/patients/:id` it will perform show action of patient controller but what to do with as here? I already read the guide but didn't understand it. | 2013/12/21 | [
"https://Stackoverflow.com/questions/20720398",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3128796/"
] | When you declare `as: 'patient'` you can reference this route in you view as: `patient_path` or `patient_url`, in other words it's a named route. | `:as` forms a named route.
`as: patient` will create `patient_path` and `patient_url` as named helpers in your application. Calling `patient_path` will redirect to show page.
in view you can use it like this
```
<%= link_to "Show patient", patient_path %>
```
[naming-routes](http://guides.rubyonrails.org/routing.h... |
53,648,866 | I'm working on extension method like this:
```
infix fun <T> T.isNullOr(other: T): Boolean {
if (this == null) return true
return this == other
}
```
and I'm trying to use this method like this.
```
val thisShouldWork = true isNullOr true // this is true
val thisShouldNotWork = true isNullOr 0 // No compila... | 2018/12/06 | [
"https://Stackoverflow.com/questions/53648866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3152652/"
] | Here, `val thisShouldNotWork = true isNullOr 0` is equal to `val thisShouldNotWork: Boolean = true.isNullOr<Any>(0)`. Type parameter as inferred as the closest parent.
And function's return type is based on **logical expression evaluation**: `this == other`. Let's see `==` function declaration: `public open operator ... | I think in this case the generics don't really matter. You only call `equals` in the method, which you can do on any type. It's basically the same as:
```
infix fun Any.isNullOr(other: Any): Boolean {
return this == other
}
```
It compiles without problems because you can always call `equals` with anything: `oth... |
53,648,866 | I'm working on extension method like this:
```
infix fun <T> T.isNullOr(other: T): Boolean {
if (this == null) return true
return this == other
}
```
and I'm trying to use this method like this.
```
val thisShouldWork = true isNullOr true // this is true
val thisShouldNotWork = true isNullOr 0 // No compila... | 2018/12/06 | [
"https://Stackoverflow.com/questions/53648866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3152652/"
] | Here, `val thisShouldNotWork = true isNullOr 0` is equal to `val thisShouldNotWork: Boolean = true.isNullOr<Any>(0)`. Type parameter as inferred as the closest parent.
And function's return type is based on **logical expression evaluation**: `this == other`. Let's see `==` function declaration: `public open operator ... | Thank for answers. I think there is no way to prevent this at compilation level, so I decided to check type for `other`.
```
inline infix fun <reified T> T.isNullOr(other: T): Boolean {
if (this == null) return true
if (other !is T) return false
return this == other
}
``` |
53,648,866 | I'm working on extension method like this:
```
infix fun <T> T.isNullOr(other: T): Boolean {
if (this == null) return true
return this == other
}
```
and I'm trying to use this method like this.
```
val thisShouldWork = true isNullOr true // this is true
val thisShouldNotWork = true isNullOr 0 // No compila... | 2018/12/06 | [
"https://Stackoverflow.com/questions/53648866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3152652/"
] | Here, `val thisShouldNotWork = true isNullOr 0` is equal to `val thisShouldNotWork: Boolean = true.isNullOr<Any>(0)`. Type parameter as inferred as the closest parent.
And function's return type is based on **logical expression evaluation**: `this == other`. Let's see `==` function declaration: `public open operator ... | If you really want to prevent it, you can:
```
class IsNullOr<T>(val x: T) {
operator fun invoke(other: T): Boolean {
if (x == null) return true
return x == other
}
}
fun <T> T.isNullOr() = IsNullOr(this)
fun main(args: Array<String>) {
val thisShouldWork = true.isNullOr()(true) /... |
53,648,866 | I'm working on extension method like this:
```
infix fun <T> T.isNullOr(other: T): Boolean {
if (this == null) return true
return this == other
}
```
and I'm trying to use this method like this.
```
val thisShouldWork = true isNullOr true // this is true
val thisShouldNotWork = true isNullOr 0 // No compila... | 2018/12/06 | [
"https://Stackoverflow.com/questions/53648866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3152652/"
] | I think in this case the generics don't really matter. You only call `equals` in the method, which you can do on any type. It's basically the same as:
```
infix fun Any.isNullOr(other: Any): Boolean {
return this == other
}
```
It compiles without problems because you can always call `equals` with anything: `oth... | Thank for answers. I think there is no way to prevent this at compilation level, so I decided to check type for `other`.
```
inline infix fun <reified T> T.isNullOr(other: T): Boolean {
if (this == null) return true
if (other !is T) return false
return this == other
}
``` |
53,648,866 | I'm working on extension method like this:
```
infix fun <T> T.isNullOr(other: T): Boolean {
if (this == null) return true
return this == other
}
```
and I'm trying to use this method like this.
```
val thisShouldWork = true isNullOr true // this is true
val thisShouldNotWork = true isNullOr 0 // No compila... | 2018/12/06 | [
"https://Stackoverflow.com/questions/53648866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3152652/"
] | I think in this case the generics don't really matter. You only call `equals` in the method, which you can do on any type. It's basically the same as:
```
infix fun Any.isNullOr(other: Any): Boolean {
return this == other
}
```
It compiles without problems because you can always call `equals` with anything: `oth... | If you really want to prevent it, you can:
```
class IsNullOr<T>(val x: T) {
operator fun invoke(other: T): Boolean {
if (x == null) return true
return x == other
}
}
fun <T> T.isNullOr() = IsNullOr(this)
fun main(args: Array<String>) {
val thisShouldWork = true.isNullOr()(true) /... |
53,648,866 | I'm working on extension method like this:
```
infix fun <T> T.isNullOr(other: T): Boolean {
if (this == null) return true
return this == other
}
```
and I'm trying to use this method like this.
```
val thisShouldWork = true isNullOr true // this is true
val thisShouldNotWork = true isNullOr 0 // No compila... | 2018/12/06 | [
"https://Stackoverflow.com/questions/53648866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3152652/"
] | Just remember that generic type information is erased at runtime and whenever you try to put something into a method that accepts generics, then the common denominator is assumed, e.g.:
```
listOf("one", 123) // -> assumes T:Any and therefore gives List<Any>
```
Now for your example that would mean `"one".isNullOr(1... | I think in this case the generics don't really matter. You only call `equals` in the method, which you can do on any type. It's basically the same as:
```
infix fun Any.isNullOr(other: Any): Boolean {
return this == other
}
```
It compiles without problems because you can always call `equals` with anything: `oth... |
53,648,866 | I'm working on extension method like this:
```
infix fun <T> T.isNullOr(other: T): Boolean {
if (this == null) return true
return this == other
}
```
and I'm trying to use this method like this.
```
val thisShouldWork = true isNullOr true // this is true
val thisShouldNotWork = true isNullOr 0 // No compila... | 2018/12/06 | [
"https://Stackoverflow.com/questions/53648866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3152652/"
] | Just remember that generic type information is erased at runtime and whenever you try to put something into a method that accepts generics, then the common denominator is assumed, e.g.:
```
listOf("one", 123) // -> assumes T:Any and therefore gives List<Any>
```
Now for your example that would mean `"one".isNullOr(1... | Thank for answers. I think there is no way to prevent this at compilation level, so I decided to check type for `other`.
```
inline infix fun <reified T> T.isNullOr(other: T): Boolean {
if (this == null) return true
if (other !is T) return false
return this == other
}
``` |
53,648,866 | I'm working on extension method like this:
```
infix fun <T> T.isNullOr(other: T): Boolean {
if (this == null) return true
return this == other
}
```
and I'm trying to use this method like this.
```
val thisShouldWork = true isNullOr true // this is true
val thisShouldNotWork = true isNullOr 0 // No compila... | 2018/12/06 | [
"https://Stackoverflow.com/questions/53648866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3152652/"
] | Just remember that generic type information is erased at runtime and whenever you try to put something into a method that accepts generics, then the common denominator is assumed, e.g.:
```
listOf("one", 123) // -> assumes T:Any and therefore gives List<Any>
```
Now for your example that would mean `"one".isNullOr(1... | If you really want to prevent it, you can:
```
class IsNullOr<T>(val x: T) {
operator fun invoke(other: T): Boolean {
if (x == null) return true
return x == other
}
}
fun <T> T.isNullOr() = IsNullOr(this)
fun main(args: Array<String>) {
val thisShouldWork = true.isNullOr()(true) /... |
3,412,268 | 1. What is API?
2. What is Importance of it?
3. give me example of it?
4. how can developer use API? | 2010/08/05 | [
"https://Stackoverflow.com/questions/3412268",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/174761/"
] | For a broad answer to your question you can check wikipedia:
<http://en.wikipedia.org/wiki/Application_programming_interface>
>
> An API is an abstraction that describes an interface for the interaction with a set of functions used by components of a software system. The software providing the functions described b... | An application programming interface (API) is an interface implemented by a software program which enables it to interact with other software. It facilitates interaction between different software programs similar to the way the user interface facilitates interaction between humans and computers. An API is implemented ... |
36,633,463 | I'm doing a grade average script for my class and I can't figure how to get my cross check section to repeat until I have a valid value (Code is listed below). When ran, it allows me to make the correction if the original input is invalid but does this only once. How can I loop until I get a proper response? Thanks in ... | 2016/04/14 | [
"https://Stackoverflow.com/questions/36633463",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6206154/"
] | consider
```
grade = -1;
System.out.println("Enter a grade:\n");
grade1 = kb.nextDouble();
if (grade1 >= 0 && grade1 <= 100)
{
System.out.println("First grade valid.\n");
}
else
{
while (grade1 < 0 || grade1 > 100)
{
System.out.println("Grade invalid. Re-enter first grade:");
grade1 = kb.n... | Try this:
```
while ((grade = Integer.parseInt(JOptionPane.showInputDialog("Enter a grade"))) < 0 || grade > 100) {
System.out.println("Invalid grade of: " + grade);
}
```
It doesnt handle letters nicely though, if you enter "a" itll complain and yell at you |
36,633,463 | I'm doing a grade average script for my class and I can't figure how to get my cross check section to repeat until I have a valid value (Code is listed below). When ran, it allows me to make the correction if the original input is invalid but does this only once. How can I loop until I get a proper response? Thanks in ... | 2016/04/14 | [
"https://Stackoverflow.com/questions/36633463",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6206154/"
] | consider
```
grade = -1;
System.out.println("Enter a grade:\n");
grade1 = kb.nextDouble();
if (grade1 >= 0 && grade1 <= 100)
{
System.out.println("First grade valid.\n");
}
else
{
while (grade1 < 0 || grade1 > 100)
{
System.out.println("Grade invalid. Re-enter first grade:");
grade1 = kb.n... | Chara, as the method executed originally, I setup it up so user plugs in their inputs and cross checks the validity after they've been entered (see first excerpt below). Figured it would be best to save the space if I could just actively cross check upon initial input (see second excerpt below). Lew Bloch, I understand... |
36,633,463 | I'm doing a grade average script for my class and I can't figure how to get my cross check section to repeat until I have a valid value (Code is listed below). When ran, it allows me to make the correction if the original input is invalid but does this only once. How can I loop until I get a proper response? Thanks in ... | 2016/04/14 | [
"https://Stackoverflow.com/questions/36633463",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6206154/"
] | consider
```
grade = -1;
System.out.println("Enter a grade:\n");
grade1 = kb.nextDouble();
if (grade1 >= 0 && grade1 <= 100)
{
System.out.println("First grade valid.\n");
}
else
{
while (grade1 < 0 || grade1 > 100)
{
System.out.println("Grade invalid. Re-enter first grade:");
grade1 = kb.n... | ```
try (Scanner scanner = new Scanner(System.in)) {
System.out.println("Enter a grade:\n");
double grade1 = scanner.nextDouble();
if (grade1 >= 0 && grade1 <= 100)
{
System.out.println("First grade valid.\n");
}
else
{
while (grade1 < 0 || grade1 > 100)
{
... |
47,979,200 | I'm currently using Laravel 5.5, as you know Laravel by default offers authentication by email, but in my case I want to change its behaviour and allow the user to login using the mobile number. so Where would I have to do the modifications? | 2017/12/26 | [
"https://Stackoverflow.com/questions/47979200",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6363688/"
] | From [the docs](https://laravel.com/docs/5.5/authentication#included-authenticating):
>
> By default, Laravel uses the email field for authentication. If you would like to customize this, you may define a username method on your `LoginController`:
>
>
>
```
public function username()
{
return 'mobile_number';... | LoginController
```
public function username()
{
return 'mobile';
}
```
also can validate
```
protected function validateLogin(Request $request)
{
$this->validate($request, [
$this->username() => 'required|string',
'password' => 'required|string',
]);
}
``` |
2,854,442 | Given the indexed sets $(X\_i)\_{i\in I}$, one usually defines their Cartesian product as:
$$\prod\_{i\in I} X\_i =\_\text{def}\;
\left\{ f: f\in \left(\bigcup\_{i\in I} X\_i\right)^I \wedge\; \forall i \in I\; f(i)\in X\_i\right\}
\label{cart1}\tag{1}$$
For $I=\{1,2\}$, it seems natural to set:
$$
X\_1\times X\_2 =\_... | 2018/07/17 | [
"https://math.stackexchange.com/questions/2854442",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/75616/"
] | The equality
$$\prod\_{i=1}^{n} X\_i = \left(\prod\_{i=1}^{n-1} X\_i\right) \times X\_n$$
is simply not true in general (the counter example you provided is valid).
What people usually do is to implicitly identify those two sets using the natural bijection $F : \prod\_{i=1}^{n} X\_i \longrightarrow \left(\prod\_{i=1}... | Note that your definition of $X\_1\times X\_2$ to mean $\prod\_{i\in\{1,2\}} X\_i$ is at odds with the usual definition in a standard development of set theory, where
$$ X\_1\times X\_2 = \{ \langle x,y\rangle \mid x\in X\_1, y\in X\_2 \} $$
You may now try to fix that up by defining that $\langle x,y\rangle$ actually ... |
239,139 | Assuming I have the following PHP. I want to add different effects to each of the ajax commands
```
function my_ajax_callback($form, $form_state) {
$result = array(
'#type' => 'ajax',
'#commands' => array(
ajax_command_replace($selector1, $html1),
ajax_command_replace($selector2, $html2),
),
... | 2017/06/23 | [
"https://drupal.stackexchange.com/questions/239139",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/44569/"
] | I found the best solution to this was using ajax\_command\_invoke() and layering the required ajax effects together.
For example, you won't be able to directly fade in an element, but you can use replace or prepend, etc., then hide the element, then fade it in.
```
function my_ajax_callback($form, $form_state) {
$r... | You can add effects to command like this:
```
$command = ajax_command_replace($selector, $html);
$command['effect'] = 'fade';
$command['speed'] = 2000; // Speed in ms.
``` |
30,819,738 | I got something like this:
```
dict = {}
dict["p1"] = [.1,.2,.3,.4]
dict["p2"] = [.4,.3,.2,.1]
dict["p3"] = [.5,.6,.7,.8]
```
How I can dump this dictionary into csv like this structure? :
```
.1 .4 .5
.2 .3 .6
.3 .2 .7
.4 .1 .8
```
Really appreciated ! | 2015/06/13 | [
"https://Stackoverflow.com/questions/30819738",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1764104/"
] | `dict`s have no order so you would need an [`OrderedDict`](https://docs.python.org/2/library/collections.html#collections.OrderedDict) and to transpose the values:
```
import csv
from collections import OrderedDict
d = OrderedDict()
d["p1"] = [.1,.2,.3,.4]
d["p2"] = [.4,.3,.2,.1]
d["p3"] = [.5,.6,.7,.8]
with open("ou... | Basically the same thing but without using the `csv` module:
```
from __future__ import print_function
from collections import OrderedDict
data = OrderedDict()
data["p1"] = [.1, .2, .3, .4]
data["p2"] = [.4, .3, .2, .1]
data["p3"] = [.5, .6, .7, .8]
print(",".join(data.keys()))
print("\n".join(",".join(map(str, x))... |
86,810 | What should we look for in a gaming mouse that would also be used for other stuff?
Obviously any gaming mouse will work fine for anything else, but, for instance, I wish to have 2 axis wheel for horizontal scrolling (use it a lot on internet browsing and image manipulation and yes, I'm on a mac). So, which other featu... | 2012/10/05 | [
"https://gaming.stackexchange.com/questions/86810",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/2349/"
] | ### Tracking technology
Laser mice are generally the best, though their extreme precision occasionally causes problems with awkward surfaces. But I play on a rough wooden table with my laser mouse and I rarely notice when I'm moving over the wood instead of my mousepad. Optical doesn't work well with reflective or bla... | Part 1: The lasers will be more accurate then the infra-red. Also they are extremely useful for anyone doing work with Art of Photos
Part 2: The higher the DPI that you have, the more precise the movements with the mouse, but also increased mouse sensitivity. Most manufactures have built in buttons on their mouses tha... |
55,936,347 | I have a table which contains two fields. The first is `name` of type `string`. The second contains one or more strings separated by comma (but it can contain a single string with no commas at all)
I want to construct a query to know if the string in the `name` field **does not** exist in **every** comma separated str... | 2019/05/01 | [
"https://Stackoverflow.com/questions/55936347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9371654/"
] | Solution for Hive:
```
insert overwrite table laundry
select
item, wash1,
case when rn=1 then wash2
else date_sub(wash2,1)
end wash2
from
(
select item, wash1, wash2,
row_number() over(partition by item order by wash2 desc) rn --latest=1
from laundry
)s;
``` | In MYSQL DBMS,use like this simple code:
```
SELECT DATE_SUB("2017-06-15", INTERVAL 1 DAY);
```
Set your column in the part one, like:
```
SELECT DATE_SUB(wash2, INTERVAL 1 DAY)
from laundry
Where wash2 <> MAX(wash2);
```
This function isn't work in the SQL server |
3,360,993 | am trying to remove a div inserted by jquery onclick. for some reason its just not working i tried remove(); hide(); css(); empty(); they all are just not working.. so here's my js function
```
function callme()
{
var content = '<div id="floating_box" class="fb">'
'sdfsdfsdfsdfsfsddsfsfsdfsdfsdfsfsdfsdfsdfsfsdfsd'
'</... | 2010/07/29 | [
"https://Stackoverflow.com/questions/3360993",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/389422/"
] | use `jQuery('#floating_box')`
You are using an id, but are not referencing it as one ..
You need to use the `.remove()` method, because with the `.empty()` you are creating multiple elements with the same id which is **invalid**
Have a look at this [demo](http://www.jsfiddle.net/WJf75/)
---
***Update***
After the... | ```
var content = '<div id="floating_box" class="fb">' +
'sdfsdfsdfsdfsfsddsfsfsdfsdfsdfsfsdfsdfsdfsfsdfsd' +
'</div>';
```
See the **+** ??
```
jQuery('body.floating_box').remove(); // edit: sorry my mistake
jQuery('body #floating_box').remove(); // better? should remove all elements within <body> with the id "floa... |
3,360,993 | am trying to remove a div inserted by jquery onclick. for some reason its just not working i tried remove(); hide(); css(); empty(); they all are just not working.. so here's my js function
```
function callme()
{
var content = '<div id="floating_box" class="fb">'
'sdfsdfsdfsdfsfsddsfsfsdfsdfsdfsfsdfsdfsdfsfsdfsd'
'</... | 2010/07/29 | [
"https://Stackoverflow.com/questions/3360993",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/389422/"
] | [demo](http://fiddle.jshell.net/3y7Cz/show/light/)
==================================================
```
function callme()
{
var content = '<div id="floating_box" class="fb">' +
'sdfsdfsdfsdfsfsddsfsfsdfsdfsdfsfsdfsdfsdfsfsdfsd' +
'</div>';
jQuery('#floating_box').toggle();
if (!$('#floating_box')... | ```
var content = '<div id="floating_box" class="fb">' +
'sdfsdfsdfsdfsfsddsfsfsdfsdfsdfsfsdfsdfsdfsfsdfsd' +
'</div>';
```
See the **+** ??
```
jQuery('body.floating_box').remove(); // edit: sorry my mistake
jQuery('body #floating_box').remove(); // better? should remove all elements within <body> with the id "floa... |
3,360,993 | am trying to remove a div inserted by jquery onclick. for some reason its just not working i tried remove(); hide(); css(); empty(); they all are just not working.. so here's my js function
```
function callme()
{
var content = '<div id="floating_box" class="fb">'
'sdfsdfsdfsdfsfsddsfsfsdfsdfsdfsfsdfsdfsdfsfsdfsd'
'</... | 2010/07/29 | [
"https://Stackoverflow.com/questions/3360993",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/389422/"
] | use `jQuery('#floating_box')`
You are using an id, but are not referencing it as one ..
You need to use the `.remove()` method, because with the `.empty()` you are creating multiple elements with the same id which is **invalid**
Have a look at this [demo](http://www.jsfiddle.net/WJf75/)
---
***Update***
After the... | You are not seeing the floating\_box being removed because a new version of the floating\_box div is added whenever you call the callme function.
```
function callme() {
var $floatingbox = jQuery("#floating_box");
if ( $floatingbox.length ) {
$floatingbox.remove();
}
else {
var co... |
3,360,993 | am trying to remove a div inserted by jquery onclick. for some reason its just not working i tried remove(); hide(); css(); empty(); they all are just not working.. so here's my js function
```
function callme()
{
var content = '<div id="floating_box" class="fb">'
'sdfsdfsdfsdfsfsddsfsfsdfsdfsdfsfsdfsdfsdfsfsdfsd'
'</... | 2010/07/29 | [
"https://Stackoverflow.com/questions/3360993",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/389422/"
] | [demo](http://fiddle.jshell.net/3y7Cz/show/light/)
==================================================
```
function callme()
{
var content = '<div id="floating_box" class="fb">' +
'sdfsdfsdfsdfsfsddsfsfsdfsdfsdfsfsdfsdfsdfsfsdfsd' +
'</div>';
jQuery('#floating_box').toggle();
if (!$('#floating_box')... | You are not seeing the floating\_box being removed because a new version of the floating\_box div is added whenever you call the callme function.
```
function callme() {
var $floatingbox = jQuery("#floating_box");
if ( $floatingbox.length ) {
$floatingbox.remove();
}
else {
var co... |
13,572,897 | I am using a `XMLWriter` to create a basic XML, the XML file has one element that everything is in, for the sake of explaining it lets say this is just `people` then inside that there needs to be multiple elements inside of it, lets call them `person` then inside of them we have elements called `names`.
So it would lo... | 2012/11/26 | [
"https://Stackoverflow.com/questions/13572897",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1174869/"
] | If you want to try [LinqToXml](http://msdn.microsoft.com/en-us/library/bb387061.aspx)
```
var xDoc = XDocument.Load(fileName);
var people = xDoc.Element("people");
people.Add(new XElement("person", new XElement("name", "name4")));
xDoc.Save(fileName, SaveOptions.None);
``` | The answer provided by L.B is what I would personally use. In regards to the xml writer, I'm not sure if this will work, but it's worth a shot. Try creating the filestream in append mode.
```
Stream xmlFile = new FileStream(@"c:\path",FileMode.Append);
XmlTextWriter xmlWriter = new XmlTextWriter(xmlFile, Encoding.Defa... |
41,839,297 | I have a project that was originally build on Typescript 1.4
It has a primary file setup like so:
```
/// <reference path="typedefinitions/jquery/jquery.d.ts" />
/// <reference path="typedefinitions/jqueryui/jqueryui.d.ts" />
/// <reference path="typedefinitions/moment/moment.d.ts" />
module myApp {
...
}
```
Wh... | 2017/01/24 | [
"https://Stackoverflow.com/questions/41839297",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30006/"
] | You have a couple of options here.
The recommended approach
------------------------
These days the option with the least friction is including a bundler to handle your single file needs and using the ES6-style module system to establish dependencies (what used to be known as external modules). The namespace system ... | Paarth, I think I'm going to go about handling the issue in a similar way angular 2 does, where I'll register child components in their parent components:
hello.component.ts:
```
import Component from './component.decorator';
@Component('hello', {
controllerAs: 'vm',
template: '<div>Hi</div>'
})
export defau... |
164,739 | I have read in a maintenance manual that the ideal temperature for incoming water to a dishwasher is 150F.
In my house, the hot water heater is currently set to 135F and it cools on traveling around the house, so the typical faucet temperature is around 120F.
I have considered up the temperature of the water heater t... | 2019/05/09 | [
"https://diy.stackexchange.com/questions/164739",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/19543/"
] | ### You don't. Let the dishwasher do it for you.
>
> I have read in a maintenance manual that the ideal temperature for incoming water to a dishwasher is 150F.
>
>
>
Was it a maintenance manual for *your actual dishwasher*? If not, I would ignore random advice (no better than advice from some stranger on the inte... | If your dishwasher is already connected to the hot water line you can get a few degrees hotter water by insulating the water line. The greater the distance from the water heater, the greater impact this will have. |
164,739 | I have read in a maintenance manual that the ideal temperature for incoming water to a dishwasher is 150F.
In my house, the hot water heater is currently set to 135F and it cools on traveling around the house, so the typical faucet temperature is around 120F.
I have considered up the temperature of the water heater t... | 2019/05/09 | [
"https://diy.stackexchange.com/questions/164739",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/19543/"
] | ### You don't. Let the dishwasher do it for you.
>
> I have read in a maintenance manual that the ideal temperature for incoming water to a dishwasher is 150F.
>
>
>
Was it a maintenance manual for *your actual dishwasher*? If not, I would ignore random advice (no better than advice from some stranger on the inte... | An on-demand water heater is perfect for this
---------------------------------------------
The key is to regulate the rate-of-flow down ***quite*** low, so you can get sufficient temperature rise without having to provision a huge amount of electrical service.
Regardless, this is like trying to air-condition a gazeb... |
4,573,246 | Total newbie here on iPhone/iPad development, so forgive me if this seems like a strange question.
Given that most objects (or group of objects) in a view within a `UIViewController` need to have an event callback defined, would it seem reasonable to group the callbacks into separate .m files and then `#import` them a... | 2011/01/01 | [
"https://Stackoverflow.com/questions/4573246",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/559641/"
] | **Getting child tag's attribute value in a XML using ElementTree**
Parse the XML file and get the `root` tag and then using `[0]` will give us first child tag. Similarly `[1], [2]` gives us subsequent child tags. After getting child tag use `.attrib[attribute_name]` to get value of that attribute.
```
>>> import xml.... | By following method you can get all attributes from xml (in Dictionary)
```
import xml.etree.ElementTree as etree
xmlString= "<feed xml:lang='en'><title>World Wide Web</title><subtitle lang='en'>Programming challenges</subtitle><link rel='alternate' type='text/html' href='http://google.com/'/><updated>2019-12-25T12:00... |
4,573,246 | Total newbie here on iPhone/iPad development, so forgive me if this seems like a strange question.
Given that most objects (or group of objects) in a view within a `UIViewController` need to have an event callback defined, would it seem reasonable to group the callbacks into separate .m files and then `#import` them a... | 2011/01/01 | [
"https://Stackoverflow.com/questions/4573246",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/559641/"
] | Your expression:
>
> ./bar[@key]
>
>
>
It means: *`bar` children having `key` attribute*
If you want to select the attribute, use this relative expression:
```
bar/@key
```
It means: *the `key` attribute of `bar` children*
Of course, you need to consider to use a fully compliant XPath engine like [lxml](ht... | dipenparmar12 function will not return the childrens child attributes. Because the function is recursive the attributes list will be set to a empty list for each call. This function will has return the childrens child.
```
import xml.etree.ElementTree as etree
xml= etree.fromstring(xmlString)
def get_attr(xml, attr... |
4,573,246 | Total newbie here on iPhone/iPad development, so forgive me if this seems like a strange question.
Given that most objects (or group of objects) in a view within a `UIViewController` need to have an event callback defined, would it seem reasonable to group the callbacks into separate .m files and then `#import` them a... | 2011/01/01 | [
"https://Stackoverflow.com/questions/4573246",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/559641/"
] | **Getting child tag's attribute value in a XML using ElementTree**
Parse the XML file and get the `root` tag and then using `[0]` will give us first child tag. Similarly `[1], [2]` gives us subsequent child tags. After getting child tag use `.attrib[attribute_name]` to get value of that attribute.
```
>>> import xml.... | Your expression:
>
> ./bar[@key]
>
>
>
It means: *`bar` children having `key` attribute*
If you want to select the attribute, use this relative expression:
```
bar/@key
```
It means: *the `key` attribute of `bar` children*
Of course, you need to consider to use a fully compliant XPath engine like [lxml](ht... |
4,573,246 | Total newbie here on iPhone/iPad development, so forgive me if this seems like a strange question.
Given that most objects (or group of objects) in a view within a `UIViewController` need to have an event callback defined, would it seem reasonable to group the callbacks into separate .m files and then `#import` them a... | 2011/01/01 | [
"https://Stackoverflow.com/questions/4573246",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/559641/"
] | This will find the first instance of an element named `bar` and return the value of the attribute `key`.
```
In [52]: import xml.etree.ElementTree as ET
In [53]: xml=ET.fromstring(contents)
In [54]: xml.find('./bar').attrib['key']
Out[54]: 'value'
``` | **Getting child tag's attribute value in a XML using ElementTree**
Parse the XML file and get the `root` tag and then using `[0]` will give us first child tag. Similarly `[1], [2]` gives us subsequent child tags. After getting child tag use `.attrib[attribute_name]` to get value of that attribute.
```
>>> import xml.... |
4,573,246 | Total newbie here on iPhone/iPad development, so forgive me if this seems like a strange question.
Given that most objects (or group of objects) in a view within a `UIViewController` need to have an event callback defined, would it seem reasonable to group the callbacks into separate .m files and then `#import` them a... | 2011/01/01 | [
"https://Stackoverflow.com/questions/4573246",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/559641/"
] | **Getting child tag's attribute value in a XML using ElementTree**
Parse the XML file and get the `root` tag and then using `[0]` will give us first child tag. Similarly `[1], [2]` gives us subsequent child tags. After getting child tag use `.attrib[attribute_name]` to get value of that attribute.
```
>>> import xml.... | dipenparmar12 function will not return the childrens child attributes. Because the function is recursive the attributes list will be set to a empty list for each call. This function will has return the childrens child.
```
import xml.etree.ElementTree as etree
xml= etree.fromstring(xmlString)
def get_attr(xml, attr... |
4,573,246 | Total newbie here on iPhone/iPad development, so forgive me if this seems like a strange question.
Given that most objects (or group of objects) in a view within a `UIViewController` need to have an event callback defined, would it seem reasonable to group the callbacks into separate .m files and then `#import` them a... | 2011/01/01 | [
"https://Stackoverflow.com/questions/4573246",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/559641/"
] | By following method you can get all attributes from xml (in Dictionary)
```
import xml.etree.ElementTree as etree
xmlString= "<feed xml:lang='en'><title>World Wide Web</title><subtitle lang='en'>Programming challenges</subtitle><link rel='alternate' type='text/html' href='http://google.com/'/><updated>2019-12-25T12:00... | dipenparmar12 function will not return the childrens child attributes. Because the function is recursive the attributes list will be set to a empty list for each call. This function will has return the childrens child.
```
import xml.etree.ElementTree as etree
xml= etree.fromstring(xmlString)
def get_attr(xml, attr... |
4,573,246 | Total newbie here on iPhone/iPad development, so forgive me if this seems like a strange question.
Given that most objects (or group of objects) in a view within a `UIViewController` need to have an event callback defined, would it seem reasonable to group the callbacks into separate .m files and then `#import` them a... | 2011/01/01 | [
"https://Stackoverflow.com/questions/4573246",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/559641/"
] | This will find the first instance of an element named `bar` and return the value of the attribute `key`.
```
In [52]: import xml.etree.ElementTree as ET
In [53]: xml=ET.fromstring(contents)
In [54]: xml.find('./bar').attrib['key']
Out[54]: 'value'
``` | By following method you can get all attributes from xml (in Dictionary)
```
import xml.etree.ElementTree as etree
xmlString= "<feed xml:lang='en'><title>World Wide Web</title><subtitle lang='en'>Programming challenges</subtitle><link rel='alternate' type='text/html' href='http://google.com/'/><updated>2019-12-25T12:00... |
4,573,246 | Total newbie here on iPhone/iPad development, so forgive me if this seems like a strange question.
Given that most objects (or group of objects) in a view within a `UIViewController` need to have an event callback defined, would it seem reasonable to group the callbacks into separate .m files and then `#import` them a... | 2011/01/01 | [
"https://Stackoverflow.com/questions/4573246",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/559641/"
] | **Getting child tag's attribute value in a XML using ElementTree**
Parse the XML file and get the `root` tag and then using `[0]` will give us first child tag. Similarly `[1], [2]` gives us subsequent child tags. After getting child tag use `.attrib[attribute_name]` to get value of that attribute.
```
>>> import xml.... | For going deeper into the tree this type of functions can be used.
```
root[1][2][0].tag # For displaying the nodes
root[1][2][0].text # For showing what's inside the node
``` |
4,573,246 | Total newbie here on iPhone/iPad development, so forgive me if this seems like a strange question.
Given that most objects (or group of objects) in a view within a `UIViewController` need to have an event callback defined, would it seem reasonable to group the callbacks into separate .m files and then `#import` them a... | 2011/01/01 | [
"https://Stackoverflow.com/questions/4573246",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/559641/"
] | By following method you can get all attributes from xml (in Dictionary)
```
import xml.etree.ElementTree as etree
xmlString= "<feed xml:lang='en'><title>World Wide Web</title><subtitle lang='en'>Programming challenges</subtitle><link rel='alternate' type='text/html' href='http://google.com/'/><updated>2019-12-25T12:00... | For going deeper into the tree this type of functions can be used.
```
root[1][2][0].tag # For displaying the nodes
root[1][2][0].text # For showing what's inside the node
``` |
4,573,246 | Total newbie here on iPhone/iPad development, so forgive me if this seems like a strange question.
Given that most objects (or group of objects) in a view within a `UIViewController` need to have an event callback defined, would it seem reasonable to group the callbacks into separate .m files and then `#import` them a... | 2011/01/01 | [
"https://Stackoverflow.com/questions/4573246",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/559641/"
] | Your expression:
>
> ./bar[@key]
>
>
>
It means: *`bar` children having `key` attribute*
If you want to select the attribute, use this relative expression:
```
bar/@key
```
It means: *the `key` attribute of `bar` children*
Of course, you need to consider to use a fully compliant XPath engine like [lxml](ht... | For going deeper into the tree this type of functions can be used.
```
root[1][2][0].tag # For displaying the nodes
root[1][2][0].text # For showing what's inside the node
``` |
1,306,803 | Find the smallest divisor of $ 12!+6!+12!\cdots6!+1!$ except 1
I know this has to do something with Wilson's theorem which states the if $n$ is a prime number $n$ will divide $(n-1)!+1$. | 2015/05/31 | [
"https://math.stackexchange.com/questions/1306803",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/241800/"
] | It is straightforward to check that 1 to 6 are no divisors of the expression, since they are factors of $12!$, $6!$ and $12!6!$.
Further, 7 is a divisior of both $12!$ and $12!6!$. Because $$12!=1\cdot2\cdot3\ldots6\cdot\color{blue}{7}\cdot8\ldots 11\cdot12$$
By Wilson's theorem, we have $$ 6! \equiv -1 \mod 7$$
so ... | $12!+6!+12!6!+1!=(12!+1)(6!+1)=(13^2\cdot 2834329)(7\cdot 103)$. |
42,899,641 | **UPDATE:** I reproduced the error in a plunkr: See <http://plnkr.co/BpYfCNBESUT6ZkiSZHgx>
The problem occurs when you do following:
Open [website](http://satest.solvisoft.nl/). Refresh website, while you see the page is loading in the browser tab, `when you see the spinner in the tab`.
[![enter image description he... | 2017/03/20 | [
"https://Stackoverflow.com/questions/42899641",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6018747/"
] | In the newer version of chrome this is related to visibility of the tab and your function is breaking due to that. you can use visibility API to know that tab is visible to the user or not.
Please have a look at this link which i found :
<http://dystroy.org/demos/vis-en.html> | ```
$scope.continue = function () {
$timeout(function () {
$pageloaderbar.animate({
width: "100%"
}, {
duration: 500,
complete: function () {
$scope.PageIsLoading = false;
$("body").css("overflow", ... |
42,899,641 | **UPDATE:** I reproduced the error in a plunkr: See <http://plnkr.co/BpYfCNBESUT6ZkiSZHgx>
The problem occurs when you do following:
Open [website](http://satest.solvisoft.nl/). Refresh website, while you see the page is loading in the browser tab, `when you see the spinner in the tab`.
[![enter image description he... | 2017/03/20 | [
"https://Stackoverflow.com/questions/42899641",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6018747/"
] | This is being caused by the jQuery `animate` function, which passes the animate options object to a function called `speed`. This function checks to see if the `document` is `hidden` - which it will be if the tab is inactive. If it is hidden, (or `fx.off` is set to `true`), all animation durations are set to `0`.
You ... | ```
$scope.continue = function () {
$timeout(function () {
$pageloaderbar.animate({
width: "100%"
}, {
duration: 500,
complete: function () {
$scope.PageIsLoading = false;
$("body").css("overflow", ... |
42,899,641 | **UPDATE:** I reproduced the error in a plunkr: See <http://plnkr.co/BpYfCNBESUT6ZkiSZHgx>
The problem occurs when you do following:
Open [website](http://satest.solvisoft.nl/). Refresh website, while you see the page is loading in the browser tab, `when you see the spinner in the tab`.
[![enter image description he... | 2017/03/20 | [
"https://Stackoverflow.com/questions/42899641",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6018747/"
] | This is being caused by the jQuery `animate` function, which passes the animate options object to a function called `speed`. This function checks to see if the `document` is `hidden` - which it will be if the tab is inactive. If it is hidden, (or `fx.off` is set to `true`), all animation durations are set to `0`.
You ... | In the newer version of chrome this is related to visibility of the tab and your function is breaking due to that. you can use visibility API to know that tab is visible to the user or not.
Please have a look at this link which i found :
<http://dystroy.org/demos/vis-en.html> |
1,012,229 | What are the possible reasons what Nullable<> types are disallowed to be passed as TModel parameter of System.Web.Mvc.ViewPage<TModel> generic? This could be handy sometimes.
In ASP.NET MVC source defined what TModel should be a class:
```
public class ViewPage<TModel> : ViewPage where TModel : class
```
but Nullab... | 2009/06/18 | [
"https://Stackoverflow.com/questions/1012229",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11256/"
] | It wouldn't make sense for this to work at the moment, as the ViewPage<T> internally always verifies that the model is an instance of T. You'd never be able to pass null because of this check.
As for why structure types weren't allowed in the first place, there were a multitude of reasons. Among them: (a) it might enc... | A single value isn't really a "model" - you could just use the dictionary and cast? |
7,786,177 | I've got a QListWidget and I've got a custom widget class, which I'm creating an instance of for each item appearing in the list widget.
But I can't figure out how to make my custom widget expand to fill all the available space of each row in the list widget.
My custom widget is created in Qt Designer, and I've set i... | 2011/10/16 | [
"https://Stackoverflow.com/questions/7786177",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/106658/"
] | I'm assuming you're putting items in here using QListWidget::setItemWidget()?
If that's the case, then you usually need to set the sizeHint() of your QListWidgetItem to that of your custom widget:
```
myListWidget->setItemWidget( myListWidgetItem, customWidget );
myListWidgetItem->setSizeHint( customWidget->sizeHint(... | As an update, since Qt 5.2. you can set the `QListWidget`'s `sizeAdjustPolicy`:
`listWidget-setSizeAdjustPolicy(QListWidget::AdjustToContents);`
This would resize the QListWidget every time a new item is added to it (whose width exceeds the current width).
Reference: <http://doc.qt.io/qt-5/qabstractscrollarea.html#s... |
32,058,116 | I'm trying to implement a FlipView control in a Win10 UWP app, but I don't seem to be able to animate the transition between the open and closed states like in the Windows 10 calendar app. If I look at the default style of the SplitView, it seems that the panel size is altered by animating the Width property of a Colum... | 2015/08/17 | [
"https://Stackoverflow.com/questions/32058116",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1662317/"
] | In the DefaultStyle, look for the **ClosedCompactLeft** visual state. Then modify the **Duration** for the animation on **PaneClipRectangleTransform**. Look for this animation (which is the one you will modify):
```
<DoubleAnimation Storyboard.TargetName="PaneClipRectangleTransform"
... | You can define a `Storyboard` inside a `VisualState`. If the trigger is fired, the story will begin automatically.
Example structure of code:
```
<VisualStateManager.VisualStateGroups>
<VisualStateGroup>
<VisualState>
<VisualState.StateTriggers>
... |
617,797 | This might turn out to be a very stupid question, so I apologize in advance, but it is confusing me a little bit.
I know in general that if $$M'\rightarrow M\rightarrow M''\rightarrow 0$$ is an exact sequence of $A-$modules, then $$M'\otimes\_AN\rightarrow M\otimes\_AN \rightarrow M''\otimes\_AN \rightarrow 0$$ is an ... | 2013/12/25 | [
"https://math.stackexchange.com/questions/617797",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/84054/"
] | Ok so we have an exact sequence
$$
M''' \to M' \to M \to M'' \to 0
$$
Let's break it up a bit. I'm going to denote by $\alpha$ the map $M' \to M$ and by $\beta$ the map $M \to M''$. Then we can break up the exact sequence above as two exact sequences
$$
M''' \to M' \to \operatorname{im} \alpha \to 0
$$
and
$$
0 ... | If I understand the question correctly, you already knew that, when
$$
M'''\to M'\to M\to M''\to 0
$$
is exact,
$$
M'''\otimes\_AN\to M'\otimes\_AN\to M\otimes\_AN\to M''\otimes\_AN\to 0
$$
could fail to be exact when $M'''=0$, and you tried to avoid that difficulty by assuming that $M'''\neq0$. Unfortunately, that do... |
617,797 | This might turn out to be a very stupid question, so I apologize in advance, but it is confusing me a little bit.
I know in general that if $$M'\rightarrow M\rightarrow M''\rightarrow 0$$ is an exact sequence of $A-$modules, then $$M'\otimes\_AN\rightarrow M\otimes\_AN \rightarrow M''\otimes\_AN \rightarrow 0$$ is an ... | 2013/12/25 | [
"https://math.stackexchange.com/questions/617797",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/84054/"
] | Ok so we have an exact sequence
$$
M''' \to M' \to M \to M'' \to 0
$$
Let's break it up a bit. I'm going to denote by $\alpha$ the map $M' \to M$ and by $\beta$ the map $M \to M''$. Then we can break up the exact sequence above as two exact sequences
$$
M''' \to M' \to \operatorname{im} \alpha \to 0
$$
and
$$
0 ... | Some Counterexamples
--------------------
There are many counterexamples to this statement - clearly, there has to be, for otherwise flat modules would be everywhere. And perhaps the best way to see why it fails is to examine some examples. Here is a class of examples that have two advantages: they are easy to compute... |
66,722,971 | EDIT: Now solved, solution below.
I've been given a function for R which I need to run multiple times for different inputs, and extract the outputs (which will later go into a data frame). Reproducible example below.
The two issues are:
1. I can't tell how to output the data from the function below to something that... | 2021/03/20 | [
"https://Stackoverflow.com/questions/66722971",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15440009/"
] | Since it may not have been defined inline, you need the computed style:
I use Click here, because it is easier to demo
```js
document.addEventListener('click', e => {
const tgt = e.target;
const inline = tgt.style.cursor || "Not defined"
const computed = window.getComputedStyle(tgt)["cursor"]
console.log("Inl... | You could get it from the CSS property "cursor" like this:
```
document.addEventListener('mouseover',function(e){
var cursor = e.target.style.cursor;
console.log(cursor);
},false);
``` |
66,722,971 | EDIT: Now solved, solution below.
I've been given a function for R which I need to run multiple times for different inputs, and extract the outputs (which will later go into a data frame). Reproducible example below.
The two issues are:
1. I can't tell how to output the data from the function below to something that... | 2021/03/20 | [
"https://Stackoverflow.com/questions/66722971",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15440009/"
] | Since it may not have been defined inline, you need the computed style:
I use Click here, because it is easier to demo
```js
document.addEventListener('click', e => {
const tgt = e.target;
const inline = tgt.style.cursor || "Not defined"
const computed = window.getComputedStyle(tgt)["cursor"]
console.log("Inl... | Try logging `e.target.style.cursor`. I think that will give you the cursor type on mouseover of a DOM element. |
24,885,304 | I use the following sed command in order to replace string in CSV line
( the condition to replace the string is to match the number in the beginning of the CSV file )
```
SERIAL_NUM=1
sed "/$SERIAL_NUM/ s//OK/g" file.csv
```
the problem is that I want to match only the number that start in the beginning of the li... | 2014/07/22 | [
"https://Stackoverflow.com/questions/24885304",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You can use anchor `^` to make sure `$SERIAL_NUM` only matches at start and use `,` after that to make sure there is a comma followed by this number:
```
sed "/^$SERIAL_NUM,/s/STATUS/OK/g" file.csv
``` | Since this answer was ranked fifth in the [Stackoverflow perl report](http://niceperl.blogspot.ca/2014/07/cxliii-stackoverflow-perl-report.html) but had no perl content, I thought it would be useful to add the following - instead of removing the perl tag **:-)**
```
#!/usr/bin/env perl
use strict;
use warnings;
whil... |
31,679,305 | I have a `QLineEdit` for Date in `mm/dd/yyyy` format. I am getting input using the keyboard and not using `QDateEdit` because of the requirement. And when the `lineEdit` comes to view, it has to show to the user the current date. I need the following for the `lineEdit`.
1. I need the two slashes always to be displayed... | 2015/07/28 | [
"https://Stackoverflow.com/questions/31679305",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/990883/"
] | [QDateEdit](http://doc.qt.io/qt-5/qdateedit.html) will serve your purpose.
1. use `setDisplayFormat("dd/MM/yyyy")`.
2. `QDateEdit` wont allow invalid dates
3. You can use `QDateEdit::setDate()` obtained from
`QDateTime::currentDateTime()` | For setting text into `QLineEdit` with `setInputMask("99/99/9999")` you should format text depending on your mask:
```
lineEdit.setText("{:02d}/{:02d}/{:04d}".format(m, d, y))
```
Alternatively, you can temporary disable InputMask, format your date without `/`, set it and re-enable InputMask. *But make sure that num... |
8,017,121 | I am building a rails app where there is an image gallery and users will be able to hit the facebook like button for each image they open. Each image can have its seperate page URL. I plan to use the facebook like plugin so that users can like the photos as web-pages. So far I was able to find that if I do `https://gra... | 2011/11/05 | [
"https://Stackoverflow.com/questions/8017121",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/860844/"
] | you have to use FQL.
see this example in php, im sure you know how to handle it in ruby:
```
$fql = 'SELECT url, share_count, like_count, comment_count, total_count
FROM link_stat WHERE url="http://stackoverflow.com"';
$json = file_get_contents('https://api.facebook.com/method/fql.query?format=json&query=' .... | For those who don't know how to modify the code seen in the previous answer by yourself, you mostly have two choices:
* Use facebook gems available that support running FQL queries (for example: [fb\_graph](https://github.com/nov/fb_graph))
*Sample code:*
```
require 'fb_graph'
array = FbGraph::Query.new(
'SELECT... |
15,348,647 | I'm working on a proxy that will relay connections to another server. I had implemented a `IHttpHandler` that takes requests for a specific address and sends them to my proxy.
My proxy basically starts a sockect connection to the proxied server and reads the original request:
```
var requestString = new StreamReader(... | 2013/03/11 | [
"https://Stackoverflow.com/questions/15348647",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/147507/"
] | I don't know of a definitive one-liner in ASP .NET, but you can get pretty close, as shown in [this](http://forums.asp.net/t/1128496.aspx/) forum post. What is suggested there is to build the first line out of HttpRequest properties, then add `ServerVariables["ALL_RAW"]`, then the request body in the `InputStream` as y... | The only way to get the 'full HTTP Request' object is to actually reconstruct it in some way. I'm not sure you need the whole object for this process though. Perhaps you could just grab a subset of the items in HttpRequest for processing? You could manually concatenate the various portions of the object you need into s... |
6,176,453 | There are some really good resources on HTML5 on the web such as [Dive Into HTML5](http://diveintohtml5.info/) and <http://slides.html5rocks.com> and I have used many of the features mentioned in my own applications, so I'm not new to using HTML5.
But as I get further along in my study of HTML5 features, I keep uncove... | 2011/05/30 | [
"https://Stackoverflow.com/questions/6176453",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/348716/"
] | I highly recommend the [specification for developers](http://developers.whatwg.org/).
Basically its what it says on the tin. But to clarify, this is from the press release at the time:
>
> It features find-as-you-type search,
> offline access, beautiful typography,
> technical references pulled inline,
> and alte... | [W3C: HTML5 Differences from HTML4](http://www.w3.org/TR/html5-diff/) |
50,993,649 | I've 2 array list having the same size named as "name" and "path" containing the name and path of the files respectively (which I got from reading external storage using a search function which I made).).
Now after, I've sorted the "name" array list according to alphabetical order case insensitive but the "path" array... | 2018/06/22 | [
"https://Stackoverflow.com/questions/50993649",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9979766/"
] | First, don't try and manipulate CSV (or XML or HTML) with regexes. While CSV might seem simple, it can be subtle. Instead use [Text::CSV](https://metacpan.org/pod/Text::CSV). The exception is if your CSV is malformed and you're fixing it.
Now, for what your regex is doing. First, let's translate it it from `s//` to `s... | *Edited this to second Schwern (also upvoted): regular expressions seem to be a poor fit for manipulating CSV.*
As for the regular expression in question, let's dissect it. Starting with the top level:
`'s/(,\h*"[^\n"]*)\n/$1 /g'`
The `s/part1/part2/g` expression means "substitute the first part with the second part... |
50,993,649 | I've 2 array list having the same size named as "name" and "path" containing the name and path of the files respectively (which I got from reading external storage using a search function which I made).).
Now after, I've sorted the "name" array list according to alphabetical order case insensitive but the "path" array... | 2018/06/22 | [
"https://Stackoverflow.com/questions/50993649",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9979766/"
] | First, don't try and manipulate CSV (or XML or HTML) with regexes. While CSV might seem simple, it can be subtle. Instead use [Text::CSV](https://metacpan.org/pod/Text::CSV). The exception is if your CSV is malformed and you're fixing it.
Now, for what your regex is doing. First, let's translate it it from `s//` to `s... | ***The best way to fix newlines in quoted fields that masquerade as End-Of-Record :***
First, don't try and manipulate CSV (or XML or HTML) with modules. While CSV might seem tricky, it is extremely simple. Don't use Text::CSV. Instead, use a substitute regex with a callback.
Also, you can use the regex to just cor... |
4,315,826 | Suppose you throw a regular and perfectly fair six-sided die $n$ times ($n\geq6$) to obtain a series of random numbers. What is the probability that the series is not biased at all, i.e., that the frequency of every number in the series is exactly $\frac{1}{6}$?
This question came up when I was thinking about an examp... | 2021/11/25 | [
"https://math.stackexchange.com/questions/4315826",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/62282/"
] | In this metric space every singleton set is open : $\{x\}=B(x,1)$. Hence, every subset is open which makes every subset is closed. So the closure of a countable set is itself and $\mathbb R $ is not countable. | If $D$ is dense in $(\Bbb R,d)$ it must intersect **every** open ball, i.e. every $\{x\}=B\_d(x,1)$. What can you conclude about how many dense sets we have? |
2,826,137 | Here, what I mean closed and open sets are those in real analysis sense. $[a,b]$ is a closed interval, and $(a,b)$ is an open interval.
My reasoning:
By the axioms for a topology, any infinite or finite union of members in a topology needs to be in the topology. On another hand, only finite intersection of members in... | 2018/06/20 | [
"https://math.stackexchange.com/questions/2826137",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/564971/"
] | >
> Is this why the closed intervals do not construct a topology but the open intervals do?
>
>
>
Not really. Neither closed nor open intervals form a topology. Is $[0,1]\cup[3,4]$ an interval? Or $(0,1)\cup(3,4)$?
So I assume that what you are asking is "is this why closed subsets do not form a topology unlike o... | The open intervals form a [*base*](https://en.wikipedia.org/wiki/Base_(topology)) for the (usual) topology on $\mathbb{R}$, because every open set is a union of open intervals.
A family of subsets of $X$ is the base for a topology on $X$ if and only if
1. the family is a cover for $X$ (the union of the family is $X$)... |
22,575,733 | I'm converting some code from C++ to C# as a method to learn C#. In my C++ code I have
```
struct ChArray{
char ch[8];
};
bool operator < (const ChArray& arrA, const ChArray& arrB);
```
In my C++, I can do things like:
```
map<ChArray, double>::iterator s;
for(s = settings.begin(); s != settings.end(); s++){
... | 2014/03/22 | [
"https://Stackoverflow.com/questions/22575733",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1940394/"
] | C# e.g. provides `BinaryReader` and `BinaryWriter` that allowes you to read and write Byte arrays from and to a file.
I believe your problem is, that you try to convert c++ to c# code on too low a level, where systemIO is concerned
EDIT: Maybe I missunderstand you, but If you want to directly translate your c++ code ... | I think you can use class ChArray instead of structure ChArray
And in your default contructor you can allocate a array of char with size = 8. |
22,575,733 | I'm converting some code from C++ to C# as a method to learn C#. In my C++ code I have
```
struct ChArray{
char ch[8];
};
bool operator < (const ChArray& arrA, const ChArray& arrB);
```
In my C++, I can do things like:
```
map<ChArray, double>::iterator s;
for(s = settings.begin(); s != settings.end(); s++){
... | 2014/03/22 | [
"https://Stackoverflow.com/questions/22575733",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1940394/"
] | I recommend that you try to work at a higher level in C#. Especially if you want to get to know the language. C# trades of some low-level capabilities for vastly increased productivity. Embrace that.
What you want is directly translatable to C# using [Fixed Size Buffers](http://msdn.microsoft.com/en-us/library/zycewsy... | I think you can use class ChArray instead of structure ChArray
And in your default contructor you can allocate a array of char with size = 8. |
22,575,733 | I'm converting some code from C++ to C# as a method to learn C#. In my C++ code I have
```
struct ChArray{
char ch[8];
};
bool operator < (const ChArray& arrA, const ChArray& arrB);
```
In my C++, I can do things like:
```
map<ChArray, double>::iterator s;
for(s = settings.begin(); s != settings.end(); s++){
... | 2014/03/22 | [
"https://Stackoverflow.com/questions/22575733",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1940394/"
] | C# e.g. provides `BinaryReader` and `BinaryWriter` that allowes you to read and write Byte arrays from and to a file.
I believe your problem is, that you try to convert c++ to c# code on too low a level, where systemIO is concerned
EDIT: Maybe I missunderstand you, but If you want to directly translate your c++ code ... | I recommend that you try to work at a higher level in C#. Especially if you want to get to know the language. C# trades of some low-level capabilities for vastly increased productivity. Embrace that.
What you want is directly translatable to C# using [Fixed Size Buffers](http://msdn.microsoft.com/en-us/library/zycewsy... |
14,770,047 | i would like to share my snippets for validating a yii bootstrap ajax form and highlight the error and valid fields. The form should have disabled the validations. | 2013/02/08 | [
"https://Stackoverflow.com/questions/14770047",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1456215/"
] | i would like to share my snippets for validating a yii bootstrap ajax form and highlight the error and valid fields. The form should have disabled the validations.
Form:
```
$form = $this -> beginWidget('bootstrap.widgets.TbActiveForm', array(
'id' => 'user-time-form',
'type' => 'horizontal',
));... | add this parameter to your TbActiveForm
```
'enableAjaxValidation'=>true,
``` |
1,360,518 | I want to have a route that looks something like: www.abc.com/companyName/Controller/Action/Id
However, all the company names need to map to the same "base" controllers, regardles of what the name is. I only need the companyName for authentication purposes.
Also, if there's no companyName provided, I need to map to a ... | 2009/09/01 | [
"https://Stackoverflow.com/questions/1360518",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/781/"
] | ```
routes.MapRoute(
"CompanyRoute",
"{companyName}/{controller}/{action}/{id}",
new { controller = "MyBaseCompanyController", action = "Index", id = "" }
);
routes.MapRoute(
"NoCompanyRoute",
"{controller}/{action}/{id}",
new {controller = "... | Go to Global.asax.cs, and add the following route in the RegisterRoutes() method before the "Default" route:
```
routes.MapRoute(
"Vanity", // Route name
"{company}/{controller}/{action}/{id}", // URL with parameters
new { company = "",... |
1,360,518 | I want to have a route that looks something like: www.abc.com/companyName/Controller/Action/Id
However, all the company names need to map to the same "base" controllers, regardles of what the name is. I only need the companyName for authentication purposes.
Also, if there's no companyName provided, I need to map to a ... | 2009/09/01 | [
"https://Stackoverflow.com/questions/1360518",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/781/"
] | ```
routes.MapRoute(
"CompanyRoute",
"{companyName}/{controller}/{action}/{id}",
new { controller = "MyBaseCompanyController", action = "Index", id = "" }
);
routes.MapRoute(
"NoCompanyRoute",
"{controller}/{action}/{id}",
new {controller = "... | In case if you wish to Resolve the errors caused due to routing . i suggest the following tool , which i found to be extremely useful.
[Route Debugger](http://haacked.com/archive/0001/01/01/url-routing-debugger.aspx) |
1,360,518 | I want to have a route that looks something like: www.abc.com/companyName/Controller/Action/Id
However, all the company names need to map to the same "base" controllers, regardles of what the name is. I only need the companyName for authentication purposes.
Also, if there's no companyName provided, I need to map to a ... | 2009/09/01 | [
"https://Stackoverflow.com/questions/1360518",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/781/"
] | In case if you wish to Resolve the errors caused due to routing . i suggest the following tool , which i found to be extremely useful.
[Route Debugger](http://haacked.com/archive/0001/01/01/url-routing-debugger.aspx) | Go to Global.asax.cs, and add the following route in the RegisterRoutes() method before the "Default" route:
```
routes.MapRoute(
"Vanity", // Route name
"{company}/{controller}/{action}/{id}", // URL with parameters
new { company = "",... |
52,881,604 | Consider an SVG with two partly overlapping circles, both with `fill="currentColor"`. I do not control the value of the current color, it could be set to anything by code I have no control over.
I want the whole figure to have the same solid color. That works great if the images happends to have e.g. `color: red`. How... | 2018/10/18 | [
"https://Stackoverflow.com/questions/52881604",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2200659/"
] | A simple way, to achieve what you want, is just to turn the circles into a clipping path.
```html
<svg viewBox="0 0 10 10" style="color: rgba(0,0,0,50%); width: 100px;">
<defs>
<clipPath id="myClip">
<circle cx="3" cy="5" r="3"></circle>
<circle cx="7" cy="5" r="3"></circle>
</clipPath>
<... | If your aim is to simply move the color to full opacity, this can be achieved with a relatively simple filter:
```html
<svg viewBox="0 0 10 10" style="color: rgba(0,0,0,50%); width: 100px;">
<filter id="filter">
<feComponentTransfer in="SourceGraphic">
<feFuncA type="linear" slope="100"/>
... |
16,863,158 | I have an Ubuntu workstation and i'm trying to bootstrap a windows node. The windows node has ssh open on port 2222. I've been following <http://docs.opscode.com/plugin_knife_windows.html>.
```
ateetor@ateetor-virtual-machine:~/chef/chef-repo$ sudo gem install knife-windows --http-proxy=[REMOVED]
Successfully installe... | 2013/05/31 | [
"https://Stackoverflow.com/questions/16863158",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/898902/"
] | If you look at the output it's running the generic bootstrap template.
>
> Looking for bootstrap template in /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/knife/bootstrap
>
>
>
Most likely there is an installation or ruby environment issue resolving the knife-windows gem.
When correctly config... | The only fix I have found is to use knife from a windows workstation instead of a linux one. |
16,863,158 | I have an Ubuntu workstation and i'm trying to bootstrap a windows node. The windows node has ssh open on port 2222. I've been following <http://docs.opscode.com/plugin_knife_windows.html>.
```
ateetor@ateetor-virtual-machine:~/chef/chef-repo$ sudo gem install knife-windows --http-proxy=[REMOVED]
Successfully installe... | 2013/05/31 | [
"https://Stackoverflow.com/questions/16863158",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/898902/"
] | If you look at the output it's running the generic bootstrap template.
>
> Looking for bootstrap template in /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/knife/bootstrap
>
>
>
Most likely there is an installation or ruby environment issue resolving the knife-windows gem.
When correctly config... | ```
knife bootstrap windows winrm 111.22.33.44.compute-1.amazonaws.com -x Administrator -P "asdklfj329" -N "windows-2008-551"
```
Enjoy :) |
16,863,158 | I have an Ubuntu workstation and i'm trying to bootstrap a windows node. The windows node has ssh open on port 2222. I've been following <http://docs.opscode.com/plugin_knife_windows.html>.
```
ateetor@ateetor-virtual-machine:~/chef/chef-repo$ sudo gem install knife-windows --http-proxy=[REMOVED]
Successfully installe... | 2013/05/31 | [
"https://Stackoverflow.com/questions/16863158",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/898902/"
] | If you look at the output it's running the generic bootstrap template.
>
> Looking for bootstrap template in /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/knife/bootstrap
>
>
>
Most likely there is an installation or ruby environment issue resolving the knife-windows gem.
When correctly config... | I have faced the similar issue.One of the reasons for this might be you knife-windows gem package is not installed in expected location.
knife-windows resolves target hostname ,if its not properly installed winrm knife cant resolve targetname.So to overcome this install knife-windows as below
To install the knife win... |
174,257 | I want to put boxed text/block in Beamer and my LaTeX source is
```
\documentclass[pdf]{beamer}
\begin{document}
\begin{frame}
\begin{block}{Observation 1}
Simmons Hall is composed of metal and concrete.
\end{block}
\begin{block}{Observation 2}
Simmons Dormitory is composed of brick.
\end{block}
\begin{block}{Conclusi... | 2014/04/29 | [
"https://tex.stackexchange.com/questions/174257",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/50117/"
] | Your MWE is using the default beamer theme, which doesn't define the blocks to have the colors you want. Try using a different theme, as below. Also, to get blue/green/red use block/exampleblock/alertblock, respectively.
```
\documentclass[pdf]{beamer}
\usetheme{Copenhagen}
\begin{document}
\begin{frame}
\frametitle{F... | You need to use a theme to have blocks appearing this way. Here is an example with "Boadilla"
```
\documentclass[10pt,a4paper]{beamer}
\usepackage[utf8]{inputenc}
\usetheme[secheader]{Boadilla}
\begin{document}
\begin{frame}{Title Frame}
Introduction sentece
\begin{block}{Title Block 1}
{
\begin... |
174,257 | I want to put boxed text/block in Beamer and my LaTeX source is
```
\documentclass[pdf]{beamer}
\begin{document}
\begin{frame}
\begin{block}{Observation 1}
Simmons Hall is composed of metal and concrete.
\end{block}
\begin{block}{Observation 2}
Simmons Dormitory is composed of brick.
\end{block}
\begin{block}{Conclusi... | 2014/04/29 | [
"https://tex.stackexchange.com/questions/174257",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/50117/"
] | Your MWE is using the default beamer theme, which doesn't define the blocks to have the colors you want. Try using a different theme, as below. Also, to get blue/green/red use block/exampleblock/alertblock, respectively.
```
\documentclass[pdf]{beamer}
\usetheme{Copenhagen}
\begin{document}
\begin{frame}
\frametitle{F... | This has already been answered but I should like to add that you can still use whichever theme you want with invisible blocks, and then set the colors to make blocks apparent. In the preamble you could include those parameters for instance,
```
\setbeamercolor{block body alerted}{bg=alerted text.fg!10}
\setbeamercolor... |
174,257 | I want to put boxed text/block in Beamer and my LaTeX source is
```
\documentclass[pdf]{beamer}
\begin{document}
\begin{frame}
\begin{block}{Observation 1}
Simmons Hall is composed of metal and concrete.
\end{block}
\begin{block}{Observation 2}
Simmons Dormitory is composed of brick.
\end{block}
\begin{block}{Conclusi... | 2014/04/29 | [
"https://tex.stackexchange.com/questions/174257",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/50117/"
] | This has already been answered but I should like to add that you can still use whichever theme you want with invisible blocks, and then set the colors to make blocks apparent. In the preamble you could include those parameters for instance,
```
\setbeamercolor{block body alerted}{bg=alerted text.fg!10}
\setbeamercolor... | You need to use a theme to have blocks appearing this way. Here is an example with "Boadilla"
```
\documentclass[10pt,a4paper]{beamer}
\usepackage[utf8]{inputenc}
\usetheme[secheader]{Boadilla}
\begin{document}
\begin{frame}{Title Frame}
Introduction sentece
\begin{block}{Title Block 1}
{
\begin... |
6,636,004 | I have a user control on a page and I'd like to load another custom user control within it's grid. However I want the user control type to be dynamic - e.g selecting "Calculator" from a drop down list would display my custom calculator control and selecting "Currency Converter" would load my currency converter. Can any... | 2011/07/09 | [
"https://Stackoverflow.com/questions/6636004",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/836872/"
] | One way is to define multiple `DataTemplates` one for each child. As user selects the option set the corresponding `ViewModel` to a `ContentControl's DataContext` present in parent view and framework will pick the corresponding view for you. | John Papa has written a great blog post on exactly how to do this [here](http://johnpapa.net/loader-custom-control-dynamically-loading-user-controls-in-silverlight-2).
The basic strategy is to instantiate a new instance of a class that derives from UserControl once selected from the drop down.
In other words, the Sel... |
28,490,429 | Can anyone explain to me why it is not possible to define an XML-like element using a context-free grammar (Chomsky, EBNF or syntax charts)? | 2015/02/13 | [
"https://Stackoverflow.com/questions/28490429",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4030244/"
] | [This thread](https://math.stackexchange.com/a/722772) says:
>
> XML is a language defined by SGML, which is a restricted form of context free grammar (essentially a Dyck language with many types of parentesis)
>
>
> | Actually, XML is a context-free language that can be parsed with anything capable of parsing CFLs. CFLs are Chomsky Level 2.
It's actually already been done. [W3](https://www.w3.org/TR/REC-xml/#sec-notation) uses EBNF notation to "completely describe" (or define) XML:
>
> `symbol ::= expression`
>
>
>
A subset o... |
4,564,940 | Calculate:
$\displaystyle \lim\_{n \rightarrow \infty} \left( \frac{n \pi}{4} - \left( \frac{n^2}{n^2+1^2} + \frac{n^2}{n^2+2^2} + \cdots \frac{n^2}{n^2+n^2} \right) \right)$.
I solved it by taking into account that $\displaystyle \int\_0^{1} \frac{1}{1+x^2} \mathrm{d}x = \frac{\pi}{4}$ and let the given sequence be:... | 2022/10/30 | [
"https://math.stackexchange.com/questions/4564940",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/1095982/"
] | *This is more of an extended comment with gestures at what the answer might be and what the right question should be.*
---
The first problem stated - find $\phi$ and $\omega$ - is not plausible to even imagine solving, because there's so many different possible vertex placements that result in the same data recorded ... | This problem is concerned with finding the inverse of a homeomorphism of graphs, namely the inverse of a quotient graph.
This problem appears to admit many solutions in the general case, and even in a restricted scenario, it is NP-complete.
<https://www.sciencedirect.com/science/article/pii/S0166218X00002201?via%3Dih... |
54,597,867 | Align bottom does not seem to be working for me in Bootstrap 4.
Below is my code. I want the text to appear align to the line at the bottom. I can't use margin/padding, as sometimes, this text will be multiple lines.
How can I vertically align to the bottom?
```
<div style="height:55px !important;">
<span class="a... | 2019/02/08 | [
"https://Stackoverflow.com/questions/54597867",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/749798/"
] | **Bootstrap 5 (update 2021)**
`mt-auto` or `align-self-end` can still be used to bottom align content in a flexbox (`d-flex`) div.
**Bootstrap 4 (original answer)**
As [explained here](https://stackoverflow.com/questions/7420324/vertical-align-bottom-not-working), align bottom doesn't work inside a `display:block`.
... | You can align text at bottom as follows:
```
<div style="height:55px !important; position: relative;">
<span class="align-bottom" style="position: absolute;bottom:0;">
This text should align to bottom, closer to the line
</span>
</div>
<div class="border-top">
Other content
</div>
```
Working jsfiddle li... |
18,834,466 | I have written this regex but this is not working as expected.
```
((?:[A-Z][\w]+)?),[\s]([A-Z]{2})
```
Following are sample inputs.
```
Fort Worth, TX
This is Forth Worth, TX
We are looking for someone from Columbus, MS.
```
I expect City and State out of above string samples with regex in python but this is ju... | 2013/09/16 | [
"https://Stackoverflow.com/questions/18834466",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/355507/"
] | You have two things wrong with your code. First of all you need to lay it out like so
```
.menu li a:active strong{color:#00f !important;}
```
Secondly you need to use `a` CSS in the correct order. You have them the wrong way around currently. This is the correct way:
DEMO <http://jsfiddle.net/kevinPHPkevin/XfsvV/>... | It should be `.menu li a:active strong` and `.menu > li a:hover strong` |
10,435,449 | I created a form in `C#` where there is a image which is being converted into a boolean array. I am trying to generate a thread with a timer where the image is converted 4 times a second.
When I debug it, it works, I can trace the ticks from the timer. But when the form is running the application quits without giving... | 2012/05/03 | [
"https://Stackoverflow.com/questions/10435449",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1350184/"
] | Is this image being stored in a Control like PictureBox? If so, make sure you're only accessing it on the control's thread. Check out [Control.Invoke()](http://msdn.microsoft.com/en-us/library/zyzhdc6b.aspx). | The callback from `System.Threading.Timer` runs on a `ThreadPool` thread. In that callback you are accessing a `Form` instance. You simply cannot do this. Well, you *can*, but it will not work correctly. It will fail unpredictable and sometimes spectacularly.
Use `System.Windows.Forms.Timer` instead. Have it tick ever... |
10,435,449 | I created a form in `C#` where there is a image which is being converted into a boolean array. I am trying to generate a thread with a timer where the image is converted 4 times a second.
When I debug it, it works, I can trace the ticks from the timer. But when the form is running the application quits without giving... | 2012/05/03 | [
"https://Stackoverflow.com/questions/10435449",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1350184/"
] | Is this image being stored in a Control like PictureBox? If so, make sure you're only accessing it on the control's thread. Check out [Control.Invoke()](http://msdn.microsoft.com/en-us/library/zyzhdc6b.aspx). | After some searching on the internet I found this out, I needed to make another function to return the `bool[,]`, this is what I came up with:
```
public bool[,] invokeBitmap(uint treshold) {
if (this.InvokeRequired) {
return (bool[,])this.Invoke((Func<bool[,]>)delegate {
return get... |
6,153,273 | I want to build and deploy my first Java EE 6 multi-tier application, with web and business tiers running on separate physical servers on Glassfish 3.1.
I think I understand what's required from a theoretical hi-level view but am not clear on the specifics and small details.
My current plan as is follows:
* Create a... | 2011/05/27 | [
"https://Stackoverflow.com/questions/6153273",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/516011/"
] | You have chosen a hard path, as others have pointed out in comments and answers...
Let's start with the structure of your app(s). You are going to end up with four achives... two that you will deploy:
1. a "regular" jar for the Remote interface of your EJB (jar-of-interfaces)
2. an EJB jar that has the implementatio... | Unless you know you will be serving many requests per second, or have very data and/or CPU-heavy business logic, then you should be perfectly fine starting out by deploying both tiers on the same application server. Starting out by deploying to a single Glassfish application server using local interfaces lets you skip ... |
6,803,072 | I am just starting with SQLAlchemy and I have been wondering... I am going to have a lot of tables in my model. I would like to have own file for each table I will have in my model.
I am currently using following code:
```
from sqlalchemy import MetaData
from sqlalchemy.orm import scoped_session, sessionmaker
from sq... | 2011/07/23 | [
"https://Stackoverflow.com/questions/6803072",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/858183/"
] | Marek,do one thing try defining the foreign key along with the schema name i.e 'test.t\_vfilers.filer\_id'(here 'test' is the schema name),this will solve the problem. | Have you remembered to import the different modules containing the models.
In my **init**.py I have at the bottom a ton of:
```
from comparty3.model.users import User, UserGroup, Permission
from comparty3.model.pages import PageGroup, Page
etc...
```
If that's not the issue then I'm not sure; however have you tried ... |
333,274 | When trying to fix an error in the code example of an old question for posterity, the editor will not let me save the change because the `'Body cannot contain "http://tinyurl.com/api"`. The TinyURL string is being used in a code example and it not actually linking to content outside of StackOverflow.
Although I imagin... | 2016/08/26 | [
"https://meta.stackoverflow.com/questions/333274",
"https://meta.stackoverflow.com",
"https://meta.stackoverflow.com/users/3723225/"
] | As a workaround you should be able to use a `<pre></pre>` block instead of the usual 4 space indent and then break up the URL with an HTML comment. Something like:
```
<pre>
var tinyAPI = 'http://tiny<!---->url.com/api-create.php?url=';
</pre>
```
Which would end up looking like this:
```
var tinyAPI = 'http://tin... | Yes, legitimate cases of link shorteners were something that I ran into quite a lot while I was [Removing link shorteners from posts!](https://meta.stackoverflow.com/questions/321494/removing-link-shorteners-from-posts)
Obviously, I never finished that project (there's just too much for me alone, especially once you c... |
578,238 | I am new to bash scripting and the part of my script below doesn't give me any output.
```
check=""
while [ "$check"=="" ]
do
read -p "Signature Correct?(Yes/No): " check
if [ "$check" != "Y" || "$check" != "y" || "$check" != "Yes" || "$check" != "yes" || "$check" != "N" || "$check" != "n" || "$check" != "No" || ... | 2020/04/06 | [
"https://unix.stackexchange.com/questions/578238",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/400102/"
] | Assuming the structure of `date.txt` is always the same and the directory names don't contain newlines, something like this should do the trick:
```bsh
for d in /backups/*/date.txt; do
printf '%s\t%s\n' "$(grep creation_time "$d")" "$(basename "$(dirname "$d")")"
done | sort | cut -f2-
```
Output:
```
full
incr... | Working with the last-modified timestamp of the `date.txt` files in the `zsh` shell:
```none
for backupdir in /backup/*/date.txt(ome['REPLY=$REPLY:h']); do
# do whatever you need to do
# with the directory path in $backupdir
done
```
This uses a globbing pattern to match all the `date.txt` files. The globbin... |
1,042,218 | Years ago i installed ubuntu on a hard drive in my computer. A few days ago, after the release of 18.04, i bought a ssd and reinstalled everything on that. The old hdd is still linked in the computer - just to look up things.
GRUB does index the old hdd as secondary boot option. But i will never ever boot the old syst... | 2018/05/31 | [
"https://askubuntu.com/questions/1042218",
"https://askubuntu.com",
"https://askubuntu.com/users/249982/"
] | I found my notes on this.
Edit `/etc/default/grub` and add the line
`GRUB_DISABLE_OS_PROBER=true`
Exit, saving changes, then run
`sudo update-grub`
From the grub [wiki](https://help.ubuntu.com/community/Grub2/Setup) (item 16)
>
> This entry is used to prevent GRUB from adding the results of
> os-prober to the m... | The easiest (GUI) way is to run **grub-customizer**
```
$ sudo add-apt-repository ppa:danielrichter2007/grub-customizer
$ sudo apt-get update
$ sudo apt-get install grub-customizer
``` |
1,042,218 | Years ago i installed ubuntu on a hard drive in my computer. A few days ago, after the release of 18.04, i bought a ssd and reinstalled everything on that. The old hdd is still linked in the computer - just to look up things.
GRUB does index the old hdd as secondary boot option. But i will never ever boot the old syst... | 2018/05/31 | [
"https://askubuntu.com/questions/1042218",
"https://askubuntu.com",
"https://askubuntu.com/users/249982/"
] | I found my notes on this.
Edit `/etc/default/grub` and add the line
`GRUB_DISABLE_OS_PROBER=true`
Exit, saving changes, then run
`sudo update-grub`
From the grub [wiki](https://help.ubuntu.com/community/Grub2/Setup) (item 16)
>
> This entry is used to prevent GRUB from adding the results of
> os-prober to the m... | You can use the `GRUB_OS_PROBER_SKIP_LIST` option to selectively disable scanning devices. So for example, if you want to exclude /dev/sdb1 and /dev/sdc1, first you need to find out their `UUID`:
```
blkid | grep -E 'sdb1|sdc1'
```
Will output something like:
```
/dev/sdb1: LABEL="bkp_root" UUID="1-2-3-4-5" TYPE="e... |
1,042,218 | Years ago i installed ubuntu on a hard drive in my computer. A few days ago, after the release of 18.04, i bought a ssd and reinstalled everything on that. The old hdd is still linked in the computer - just to look up things.
GRUB does index the old hdd as secondary boot option. But i will never ever boot the old syst... | 2018/05/31 | [
"https://askubuntu.com/questions/1042218",
"https://askubuntu.com",
"https://askubuntu.com/users/249982/"
] | Short Answer
------------
If you don't want third party utilities you can do it with a move command:
```
sudo mv /mnt/extra_distro/boot /mnt/extra_distro/boot.old
```
Then `sudo update-grub` of course.
Long Answer
-----------
Grub's OS\_Prober checks each mounted drive for presence of `/boot/*` entries of `vmlinu... | The easiest (GUI) way is to run **grub-customizer**
```
$ sudo add-apt-repository ppa:danielrichter2007/grub-customizer
$ sudo apt-get update
$ sudo apt-get install grub-customizer
``` |
1,042,218 | Years ago i installed ubuntu on a hard drive in my computer. A few days ago, after the release of 18.04, i bought a ssd and reinstalled everything on that. The old hdd is still linked in the computer - just to look up things.
GRUB does index the old hdd as secondary boot option. But i will never ever boot the old syst... | 2018/05/31 | [
"https://askubuntu.com/questions/1042218",
"https://askubuntu.com",
"https://askubuntu.com/users/249982/"
] | The easiest (GUI) way is to run **grub-customizer**
```
$ sudo add-apt-repository ppa:danielrichter2007/grub-customizer
$ sudo apt-get update
$ sudo apt-get install grub-customizer
``` | You can use the `GRUB_OS_PROBER_SKIP_LIST` option to selectively disable scanning devices. So for example, if you want to exclude /dev/sdb1 and /dev/sdc1, first you need to find out their `UUID`:
```
blkid | grep -E 'sdb1|sdc1'
```
Will output something like:
```
/dev/sdb1: LABEL="bkp_root" UUID="1-2-3-4-5" TYPE="e... |
1,042,218 | Years ago i installed ubuntu on a hard drive in my computer. A few days ago, after the release of 18.04, i bought a ssd and reinstalled everything on that. The old hdd is still linked in the computer - just to look up things.
GRUB does index the old hdd as secondary boot option. But i will never ever boot the old syst... | 2018/05/31 | [
"https://askubuntu.com/questions/1042218",
"https://askubuntu.com",
"https://askubuntu.com/users/249982/"
] | Short Answer
------------
If you don't want third party utilities you can do it with a move command:
```
sudo mv /mnt/extra_distro/boot /mnt/extra_distro/boot.old
```
Then `sudo update-grub` of course.
Long Answer
-----------
Grub's OS\_Prober checks each mounted drive for presence of `/boot/*` entries of `vmlinu... | You can use the `GRUB_OS_PROBER_SKIP_LIST` option to selectively disable scanning devices. So for example, if you want to exclude /dev/sdb1 and /dev/sdc1, first you need to find out their `UUID`:
```
blkid | grep -E 'sdb1|sdc1'
```
Will output something like:
```
/dev/sdb1: LABEL="bkp_root" UUID="1-2-3-4-5" TYPE="e... |
59,702 | It's my 17th birthday and you're invited to my party!
And as always at parties, there will be cake.
One cake...
And you need as much of it as possible.
As this is a fair party, each of us will say how much of my cake we want and the person who said the smallest amount will get it. Then everyone else gets to repeat... | 2015/10/05 | [
"https://codegolf.stackexchange.com/questions/59702",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/32686/"
] | Dieter, Java
============
```
public class Dieter {
public static void main(String... args){
System.out.println("4");
}
}
```
It doesn't want to bid for too much cake, so it chooses a small but [guaranteed random](https://xkcd.com/221/) slice. | EatTheπ, Node.js
================
```
var π = Math.PI, e = Math.E;
var [totalπ, πLeft, totalPeople, peopleLeft] = process.argv.slice(2);
console.log(Math.min(totalπ * Date.now() * π % (πLeft * totalPeople / peopleLeft) % totalπ, πLeft / e * π, πLeft) | 0);
```
Really likes π, and thinks that cake ~~means~~ **is** π. |
59,702 | It's my 17th birthday and you're invited to my party!
And as always at parties, there will be cake.
One cake...
And you need as much of it as possible.
As this is a fair party, each of us will say how much of my cake we want and the person who said the smallest amount will get it. Then everyone else gets to repeat... | 2015/10/05 | [
"https://codegolf.stackexchange.com/questions/59702",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/32686/"
] | AlCakeSurfer, Python
--------------------
```
import sys, math
total_degrees, degrees_left, total_people, people_left = map(int, sys.argv[1:])
fraction_left = (degrees_left + 0.0)/ total_degrees
fraction_gone = 1.0 - fraction_left
fair_share = fraction_left/people_left
modified_fair_share = fair_share + 0.05
weight... | Moses, Java
===========
```
public class Moses {
public static void main(String[] args) {
double[] arguments = new double[4];
for (int i = 0; i < 4; i++) {
arguments[i] = Double.parseDouble(args[i]);
}
if (arguments[3] == 1) {
System.out.println((int)argument... |
59,702 | It's my 17th birthday and you're invited to my party!
And as always at parties, there will be cake.
One cake...
And you need as much of it as possible.
As this is a fair party, each of us will say how much of my cake we want and the person who said the smallest amount will get it. Then everyone else gets to repeat... | 2015/10/05 | [
"https://codegolf.stackexchange.com/questions/59702",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/32686/"
] | CoffeeJunkie, Coffeescript
==========================
```
#!/usr/bin/env node
# Require node fs
fs = require("fs")
# Happy birthday ;)
CAKECONSTANT = Math.round("""
/
,( ),
Y
|-|
| |
_..--''''| |''''--.._
.' @_/-//-//>/>'/... | Hungry, Java
============
```
public class Hungry {
public static void main(String[] args) {
double[] arguments = new double[4];
for (int i = 0; i < 4; i++) {
arguments[i] = Double.parseDouble(args[i]);
}
int myCake = (int) Math.ceil(arguments[1]/arguments[3]);
S... |
59,702 | It's my 17th birthday and you're invited to my party!
And as always at parties, there will be cake.
One cake...
And you need as much of it as possible.
As this is a fair party, each of us will say how much of my cake we want and the person who said the smallest amount will get it. Then everyone else gets to repeat... | 2015/10/05 | [
"https://codegolf.stackexchange.com/questions/59702",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/32686/"
] | Flaming Chainsaw, Java
======================
```
public class FlamingChainsaw
{
public static void main(String[]args)
{
if(args.length<4){return;}
if(Integer.parseInt(args[3])<3){System.out.println(0);}
else{System.out.println(args[1]);}
}
}
```
Have you ever tried holding a cake... | MyFairPlusAThird, sh
--------------------
```
#!/bin/sh
fair=$(expr $2 / $4)
myextra=$(expr $2 / 3)
want=$(expr $fair + $myextra)
echo $(($want<$2?$want:$2))
``` |
59,702 | It's my 17th birthday and you're invited to my party!
And as always at parties, there will be cake.
One cake...
And you need as much of it as possible.
As this is a fair party, each of us will say how much of my cake we want and the person who said the smallest amount will get it. Then everyone else gets to repeat... | 2015/10/05 | [
"https://codegolf.stackexchange.com/questions/59702",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/32686/"
] | Slim, Python 2
==============
```
print 0
```
This bot's on a diet. | **Give me the cake, Bash**
```
#!/bin/bash
echo 3594
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.