qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
59,208,214 | Value:
0.344
-0.124
0.880
0
0.910
-0.800 | 2019/12/06 | [
"https://Stackoverflow.com/questions/59208214",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4742655/"
] | This will help you understand lambda expressions better.
[Anatomy of the Lambda Expression](https://www.tutorialsteacher.com/linq/linq-lambda-expression)
And this is for [Linq](https://www.tutorialsteacher.com/linq/what-is-linq)
Hope this helps.
Thank you. | Where clause exists in Enumerable class which uses for querying in .net framework. it provides as boolean condition and return source. It will convert to respective sql query eventually.
so your linq
```
var salaries = customerList
.Where(c => c.Age > 30)
.Select(c => c.Salary... |
59,208,214 | Value:
0.344
-0.124
0.880
0
0.910
-0.800 | 2019/12/06 | [
"https://Stackoverflow.com/questions/59208214",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4742655/"
] | `Where` is probably implemented like this (note that this is a very rough implementation, just do give you an idea of what it is like):
```
public static IEnumerable<T> Where<T>(this IEnumerable<T> source, Func<T, bool> predicate) {
foreach (T t in source) {
if (predicate(t)) {
yield return t;
... | Where clause exists in Enumerable class which uses for querying in .net framework. it provides as boolean condition and return source. It will convert to respective sql query eventually.
so your linq
```
var salaries = customerList
.Where(c => c.Age > 30)
.Select(c => c.Salary... |
59,208,214 | Value:
0.344
-0.124
0.880
0
0.910
-0.800 | 2019/12/06 | [
"https://Stackoverflow.com/questions/59208214",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4742655/"
] | This will help you understand lambda expressions better.
[Anatomy of the Lambda Expression](https://www.tutorialsteacher.com/linq/linq-lambda-expression)
And this is for [Linq](https://www.tutorialsteacher.com/linq/what-is-linq)
Hope this helps.
Thank you. | >
> how does "Where" get access to the customerList and how does it define
> the type of "c"?
>
>
>
* customerList is of type List and `Where()` is an extension method of type List. So `Where()` method is accessible to customerList. `c => c.Age > 30` is a predicate define inside `Where()` clause. This predicate h... |
59,208,214 | Value:
0.344
-0.124
0.880
0
0.910
-0.800 | 2019/12/06 | [
"https://Stackoverflow.com/questions/59208214",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4742655/"
] | `Where` is probably implemented like this (note that this is a very rough implementation, just do give you an idea of what it is like):
```
public static IEnumerable<T> Where<T>(this IEnumerable<T> source, Func<T, bool> predicate) {
foreach (T t in source) {
if (predicate(t)) {
yield return t;
... | This will help you understand lambda expressions better.
[Anatomy of the Lambda Expression](https://www.tutorialsteacher.com/linq/linq-lambda-expression)
And this is for [Linq](https://www.tutorialsteacher.com/linq/what-is-linq)
Hope this helps.
Thank you. |
59,208,214 | Value:
0.344
-0.124
0.880
0
0.910
-0.800 | 2019/12/06 | [
"https://Stackoverflow.com/questions/59208214",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4742655/"
] | This will help you understand lambda expressions better.
[Anatomy of the Lambda Expression](https://www.tutorialsteacher.com/linq/linq-lambda-expression)
And this is for [Linq](https://www.tutorialsteacher.com/linq/what-is-linq)
Hope this helps.
Thank you. | The [link from @Amit](https://stackoverflow.com/questions/671235/how-linq-works-internally/671425#671425) can give a good idea.
Short answer is that LINQ is built on the compiler feature called Expressions. When you write something like `Where(c => c.Age > 18)` compiler doesn't actually compile the `c=> c.Age > 18` al... |
59,208,214 | Value:
0.344
-0.124
0.880
0
0.910
-0.800 | 2019/12/06 | [
"https://Stackoverflow.com/questions/59208214",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4742655/"
] | `Where` is probably implemented like this (note that this is a very rough implementation, just do give you an idea of what it is like):
```
public static IEnumerable<T> Where<T>(this IEnumerable<T> source, Func<T, bool> predicate) {
foreach (T t in source) {
if (predicate(t)) {
yield return t;
... | >
> how does "Where" get access to the customerList and how does it define
> the type of "c"?
>
>
>
* customerList is of type List and `Where()` is an extension method of type List. So `Where()` method is accessible to customerList. `c => c.Age > 30` is a predicate define inside `Where()` clause. This predicate h... |
59,208,214 | Value:
0.344
-0.124
0.880
0
0.910
-0.800 | 2019/12/06 | [
"https://Stackoverflow.com/questions/59208214",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4742655/"
] | `Where` is probably implemented like this (note that this is a very rough implementation, just do give you an idea of what it is like):
```
public static IEnumerable<T> Where<T>(this IEnumerable<T> source, Func<T, bool> predicate) {
foreach (T t in source) {
if (predicate(t)) {
yield return t;
... | The [link from @Amit](https://stackoverflow.com/questions/671235/how-linq-works-internally/671425#671425) can give a good idea.
Short answer is that LINQ is built on the compiler feature called Expressions. When you write something like `Where(c => c.Age > 18)` compiler doesn't actually compile the `c=> c.Age > 18` al... |
593,376 | I am currently studying electricity in my physics class, and am really confused about electric potential in a uniform electric field, like the one pictured. [](https://i.stack.imgur.com/y0Wmj.png)
What I don't understand is, how come many textbooks say that... | 2020/11/12 | [
"https://physics.stackexchange.com/questions/593376",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/276079/"
] | >
> The equation for electric potential is V=kq/r
>
>
>
Only for a point charge.
>
> so as a positive test charge gets closer and closer to the negative plate, wouldn't the electric potential be a huge negative number, because the radius is decreasing and the plate is negative? Please help me understand!
>
>
>... | The only quantity related to potential that is ever relevant to an electrostatics problem is *potential difference*. That is the difference between potential between two points. Because of that it doesn't matter where you set the potential to be zero.
Concerning the huge negative number: no, while the potential of a p... |
593,376 | I am currently studying electricity in my physics class, and am really confused about electric potential in a uniform electric field, like the one pictured. [](https://i.stack.imgur.com/y0Wmj.png)
What I don't understand is, how come many textbooks say that... | 2020/11/12 | [
"https://physics.stackexchange.com/questions/593376",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/276079/"
] | >
> The equation for electric potential is V=kq/r
>
>
>
Only for a point charge.
>
> so as a positive test charge gets closer and closer to the negative plate, wouldn't the electric potential be a huge negative number, because the radius is decreasing and the plate is negative? Please help me understand!
>
>
>... | The fact you can not define the potential at a point. All you can do is to define a potential difference between two points. In your figure, They have taken zero potential at the negative plate, and relative to this point they have written the potential at other point.
And this make sense, How? We know that charge wil... |
593,376 | I am currently studying electricity in my physics class, and am really confused about electric potential in a uniform electric field, like the one pictured. [](https://i.stack.imgur.com/y0Wmj.png)
What I don't understand is, how come many textbooks say that... | 2020/11/12 | [
"https://physics.stackexchange.com/questions/593376",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/276079/"
] | >
> The equation for electric potential is V=kq/r
>
>
>
Only for a point charge.
>
> so as a positive test charge gets closer and closer to the negative plate, wouldn't the electric potential be a huge negative number, because the radius is decreasing and the plate is negative? Please help me understand!
>
>
>... | You are correct. Strictly the potential of a stationary pont charge is kq/r so the potential at infinity should be zero. However, you can add a constant potential to any system without physical consequences. This allows you to redefine the potential such that it is zero at one of the plates. |
593,376 | I am currently studying electricity in my physics class, and am really confused about electric potential in a uniform electric field, like the one pictured. [](https://i.stack.imgur.com/y0Wmj.png)
What I don't understand is, how come many textbooks say that... | 2020/11/12 | [
"https://physics.stackexchange.com/questions/593376",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/276079/"
] | >
> The equation for electric potential is V=kq/r
>
>
>
Only for a point charge.
>
> so as a positive test charge gets closer and closer to the negative plate, wouldn't the electric potential be a huge negative number, because the radius is decreasing and the plate is negative? Please help me understand!
>
>
>... | allow me to explain a couple of concepts.
Firstly, you must understand what electric potential is. It is an abstract concept. A helpful way to think about it is by considering it's unit, that is Joules/Couloumb. That tells us that electric potential shows us the **potential energy per unit charge**. It is simply a num... |
3,945,233 | What's the point of using template structure like this:
```
templates/
app/
article_view.html # or view_article.html
category_view.html
```
vs
```
templates/
app/
article/
view.html
category/
view.html
```
It's easier to find particular template with... | 2010/10/15 | [
"https://Stackoverflow.com/questions/3945233",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/268774/"
] | This depends on the scale of the project; a small-scale thingie could be more easy to handle with the first approach, while a project with several hundred template files could use a better folder structure, i.e. the second approach | Generally speaking, templates are associated with views rather than models. A view pulls in one or more models as needed, then renders the appropriate template. Since an app usually consolidates views in one file, the template to app correspondence works well enough. |
27,853,657 | I am aware that there is a similar question to this [here](https://stackoverflow.com/questions/16188836/avoid-instanceof-in-a-composite-pattern). It considered a more generic question of class specific behaviour than my question here.
Consider the following simple implementation of a Composite pattern:
```
interface ... | 2015/01/09 | [
"https://Stackoverflow.com/questions/27853657",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3705127/"
] | I think I speak for any java person when I say that the visitor pattern is not exactly popular in java. So the above could be implemented like this (I will use interfaces here because in my experience they are more flexible):
```
interface Item { /* methods omitted */ }
interface SimpleItem extends Item { /* methods ... | Well it seems from the fact that no one has posted an answer that there are no better options than the 3 I put up.
So I'll post my preferred solution and see if anyone can improve on it. In my view the best option is a combination of options 2 and 3. I don't think it's too evil to have a `canAddItems` member of `Item... |
281,877 | In No Man's Sky planets and animals are found by the community and registered centrally. Is there a system such as an interstellar map for planets, or a "pokedex" for discovered animals by the community, so that I can view them and possibly plot a course for them?
Similarly, is it possible to view which animals I will... | 2016/08/15 | [
"https://gaming.stackexchange.com/questions/281877",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/152693/"
] | There is currently no online list available to the public - based on countless efforts to find one.
However, we do know that the [Hello Games team knows exactly what everyone has discovered and named](https://twitter.com/NoMansSky/status/762691001198796800). This could mean that eventually the Hello Games team will re... | The animal catalog, I'm not seeing one. You can see what discoveries you've made, in the interstellar map, to access it you have to be in space, and then press `M` or `dpad down`.
From the galactic map you can then scan for discoveries, which will list systems you've already discovered, however it will not list the an... |
25,039,084 | Say I have three div's which contain unique content;
* div1 = Is a Photoshop guide
* div2 = Contains a gallery of images
* div3 = Lists personal contact details
When my page loads they all need to be hidden;
* div1 = hidden
* div2 = hidden
* div3 = hidden
They are also laid ontop of one another (occupy the same spa... | 2014/07/30 | [
"https://Stackoverflow.com/questions/25039084",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3887181/"
] | The trick is add a `<label>` tag after a `<input type="checkbox">` and in CSS, add the selector `:checked` for the input, like a trigger.
**HTML**
```
<input class="trigger" id="1" type="checkbox">
<label for="1">Click me</label>
<div>Surprise!</div>
<br><br>
<input class="trigger" id="2" type="checkbox">
<label fo... | Try different CSS menus. You can grab a lot from google.
Here are some samples collected from web:
```
http://www.smashingapps.com/2013/02/18/48-free-dropdown-menu-in-html5-and-css3.html
http://css3menu.com/enterprise-green.html
``` |
45,188,043 | While typing code in XCode i have found the word LIST\_FOREACH. what is the purpose of LIST\_FOREACH in XCode? why its displayed?
Since there is no other function such as foreach in XCode - Objective C,then what is the use of LIST\_FOREACH?
Can anyone teach me what's the purpose of LIST\_FOREACH in Objective-c?.When ... | 2017/07/19 | [
"https://Stackoverflow.com/questions/45188043",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2455574/"
] | **For your information there is no loop like foreach in objective or swift, like c# or other language.**
But the same can be achieved by the following code
```
NSArray *a = [NSArray new]; // Any container class can be substituted
for(id obj in a) { // Note the dynamic typing (we do not need to k... | Are you attempting to do Fast Enumeration on arrays? You can do it as -
```
for (id tempObject in myArray) {
NSLog(@"Single element: %@", tempObject);
}
``` |
45,188,043 | While typing code in XCode i have found the word LIST\_FOREACH. what is the purpose of LIST\_FOREACH in XCode? why its displayed?
Since there is no other function such as foreach in XCode - Objective C,then what is the use of LIST\_FOREACH?
Can anyone teach me what's the purpose of LIST\_FOREACH in Objective-c?.When ... | 2017/07/19 | [
"https://Stackoverflow.com/questions/45188043",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2455574/"
] | **For your information there is no loop like foreach in objective or swift, like c# or other language.**
But the same can be achieved by the following code
```
NSArray *a = [NSArray new]; // Any container class can be substituted
for(id obj in a) { // Note the dynamic typing (we do not need to k... | Syntex of Fast Enumeration:
```
for (NSString* key in xyz) {
id value = [xyz objectForKey:key];
// do stuff
}
```
For more info:
>
> <https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/Collections/Articles/Enumerators.html>
>
>
> |
13,069 | I have a data frame which has three columns as shown below. There are about 10,000 entries in the data frame and there are duplicates as well.
```
Hospital_ID District_ID Employee
Hospital 1 District 19 5
Hospital 1 District 19 10
Hospital 1 District 19 6
Hospital 2 District 10 50
Hospital 2 ... | 2016/07/29 | [
"https://datascience.stackexchange.com/questions/13069",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/15412/"
] | As [Emre](https://datascience.stackexchange.com/users/381/emre) already mentioned, you may use the [groupby](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.groupby.html) function. After that, you should apply [reset\_index](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.r... | What you want to do is called [aggregation](https://en.wikipedia.org/wiki/Aggregate_function); deduplication or duplicate removal is something else. I think the code self-explanatory:
`df.groupby(['Hospital_ID', 'District_ID']).mean()` |
34,553,596 | My html is like:
```
<a class="title" href="">
<b>name
<span class="c-gray">position</span>
</b>
</a>
```
I want to get name and position string separately. So my script is like:
```
lia = soup.find('a',attrs={'class':'title'})
pos = lia.find('span').get_text()
lia.find('span').replace_with('')
name = ... | 2016/01/01 | [
"https://Stackoverflow.com/questions/34553596",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3145081/"
] | You can use `.contents` method this way:
```
person = lia.find('b').contents
name = person[0].strip()
position = person[1].text
``` | The idea is to locate the `a` element, then, for the `name` - get the first text node from an inner `b` element and, for the `position` - get the `span` element's text:
```
>>> a = soup.find("a", class_="title")
>>> name, position = a.b.find(text=True).strip(), a.b.span.get_text(strip=True)
>>> name, position
(u'name'... |
60,380,110 | After update to Angular 9 it does not work to use Hammer.js anymore. We have extended the Angular `HammerGestureConfig` like the following.:
```js
import {HammerGestureConfig} from '@angular/platform-browser';
import {Injectable} from '@angular/core';
@Injectable({providedIn: 'root'})
export class HammerConfig extend... | 2020/02/24 | [
"https://Stackoverflow.com/questions/60380110",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/183704/"
] | The `HammerModule` needs to be imported to the Angular app module.
```js
imports: [
...
HammerModule
],
providers: [
{
provide: HAMMER_GESTURE_CONFIG,
useClass: HammerConfig
},
...
],
...
```
>
> ivy: make Hammer support tree-shakable. Previously, in Ivy
> applications, Ha... | After upgrading to Angular 9, I had to re-npm-install `hammerjs` since it had been removed from my `package.json`. I would check that yours is still there. |
60,380,110 | After update to Angular 9 it does not work to use Hammer.js anymore. We have extended the Angular `HammerGestureConfig` like the following.:
```js
import {HammerGestureConfig} from '@angular/platform-browser';
import {Injectable} from '@angular/core';
@Injectable({providedIn: 'root'})
export class HammerConfig extend... | 2020/02/24 | [
"https://Stackoverflow.com/questions/60380110",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/183704/"
] | Comment out any imports for hammerjs that are likely in your main.ts file that were likely added in Angular 8 or earlier -- for me it was originally an Angular 4 project 2 years old that we have evolved. But Angular 9 can't use it there.
Move them all to app.module.ts in this order…
```
import { HammerModule, HammerG... | After upgrading to Angular 9, I had to re-npm-install `hammerjs` since it had been removed from my `package.json`. I would check that yours is still there. |
60,380,110 | After update to Angular 9 it does not work to use Hammer.js anymore. We have extended the Angular `HammerGestureConfig` like the following.:
```js
import {HammerGestureConfig} from '@angular/platform-browser';
import {Injectable} from '@angular/core';
@Injectable({providedIn: 'root'})
export class HammerConfig extend... | 2020/02/24 | [
"https://Stackoverflow.com/questions/60380110",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/183704/"
] | The `HammerModule` needs to be imported to the Angular app module.
```js
imports: [
...
HammerModule
],
providers: [
{
provide: HAMMER_GESTURE_CONFIG,
useClass: HammerConfig
},
...
],
...
```
>
> ivy: make Hammer support tree-shakable. Previously, in Ivy
> applications, Ha... | Comment out any imports for hammerjs that are likely in your main.ts file that were likely added in Angular 8 or earlier -- for me it was originally an Angular 4 project 2 years old that we have evolved. But Angular 9 can't use it there.
Move them all to app.module.ts in this order…
```
import { HammerModule, HammerG... |
2,546,295 | I have two projects in my Solution. One implements my business logic and has defined entity model of entity framework. When I want to work with classes defined within this project from another project I have some problems in runtime. Actually, the most concerning thing is why I can not instantiate my, so called, Ticket... | 2010/03/30 | [
"https://Stackoverflow.com/questions/2546295",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/255623/"
] | You need to copy the Connection string from the original app.config or web.config into the corresponding app.config / web.config in the new project.
Then everything should work.
Alex | Think about how you will make the treatment of transaction and make use the same connection between classes. |
14,209,145 | I have a UITableViewController that shows a list of items from NSMutableArray, along with a button that serves as a check box that the user can select/deselect. I am able to successfully display the table, as well as the checkboxes. However, I would like to have a tableheader at the very top of the table that would hav... | 2013/01/08 | [
"https://Stackoverflow.com/questions/14209145",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/458811/"
] | If you don't need to support windows RT, then you can go for iTextSharp(its free),
and if you want to support windows RT then there is no free library for C#, you might prefer to code your apps using HTML5 and Javascript and use Mozilla's pdf.js to read PDF files. | The Foxit SDK has support for UWP development. If I look into samples there is whole demo viewer UWP sample code. |
2,073 | I have a friend that just described her situation and I'm lost. Hopefully someone here can help me out. I'm a programmer so I'm using variables instead of names :)
* A = my friend
* B = her friend (female)
* C & D = her friend's children
* E & F = her friend's children's respective fathers
and the situation:
* B is ... | 2011/06/23 | [
"https://parenting.stackexchange.com/questions/2073",
"https://parenting.stackexchange.com",
"https://parenting.stackexchange.com/users/1210/"
] | Disclaimer .. IANAL, and **A needs a lawyer**.
I don't think there are inherent legal rights conferred by being a "god-parent".
However ... the real answer is it depends who is contesting. If no one contests, the court will award A custody. It will initially temporary, and she will need to petition for adoption afte... | Adding to tomjedrz...
Things to consider:
* Who currently has physical custody of the children? If it is A, make it official with the authorities, such as a family court or child protective services. If not we will need more information.
* What sort of documents are available to assert B's intentions? Find letters, e... |
2,073 | I have a friend that just described her situation and I'm lost. Hopefully someone here can help me out. I'm a programmer so I'm using variables instead of names :)
* A = my friend
* B = her friend (female)
* C & D = her friend's children
* E & F = her friend's children's respective fathers
and the situation:
* B is ... | 2011/06/23 | [
"https://parenting.stackexchange.com/questions/2073",
"https://parenting.stackexchange.com",
"https://parenting.stackexchange.com/users/1210/"
] | Disclaimer .. IANAL, and **A needs a lawyer**.
I don't think there are inherent legal rights conferred by being a "god-parent".
However ... the real answer is it depends who is contesting. If no one contests, the court will award A custody. It will initially temporary, and she will need to petition for adoption afte... | I will answer what I know as a foster parent in the U.S.
In the situation you describe, the children would probably be in foster care. This is one of the "scenarios" we had to deal with during our training.
The good news is, if that's true then A has got a great place to start. She should work with DCF in that area.... |
2,073 | I have a friend that just described her situation and I'm lost. Hopefully someone here can help me out. I'm a programmer so I'm using variables instead of names :)
* A = my friend
* B = her friend (female)
* C & D = her friend's children
* E & F = her friend's children's respective fathers
and the situation:
* B is ... | 2011/06/23 | [
"https://parenting.stackexchange.com/questions/2073",
"https://parenting.stackexchange.com",
"https://parenting.stackexchange.com/users/1210/"
] | Adding to tomjedrz...
Things to consider:
* Who currently has physical custody of the children? If it is A, make it official with the authorities, such as a family court or child protective services. If not we will need more information.
* What sort of documents are available to assert B's intentions? Find letters, e... | I will answer what I know as a foster parent in the U.S.
In the situation you describe, the children would probably be in foster care. This is one of the "scenarios" we had to deal with during our training.
The good news is, if that's true then A has got a great place to start. She should work with DCF in that area.... |
10,143,960 | Im using the following to retrieve a string from php, i would like to know how to make my string into an array.
**Jquery**
```
$.get("get.php", function(data){
alert(data);
//alert($.parseJSON(data));
}, "json");
```
the commented out section seems to have no effect, so I cant really tell what I am doing wr... | 2012/04/13 | [
"https://Stackoverflow.com/questions/10143960",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/360481/"
] | You likely want to set the `:ARCHIVE:` property on the parent headlines.
It allows you for headline specific `org-archive-location` settings. (See the [manual](http://orgmode.org/manual/Moving-subtrees.html#Moving-subtrees))
For example if your archive file is set as `%s_archive` you would want your original file to ... | I don't think `org-mode` has support for directly mirroring the current context inside your archive file.
There is a relevant variable, `org-archive-location` which can be used to specify a single heading to place your archived item, but multiple levels inside the tree is not supported. On [this page](http://orgmode.o... |
10,143,960 | Im using the following to retrieve a string from php, i would like to know how to make my string into an array.
**Jquery**
```
$.get("get.php", function(data){
alert(data);
//alert($.parseJSON(data));
}, "json");
```
the commented out section seems to have no effect, so I cant really tell what I am doing wr... | 2012/04/13 | [
"https://Stackoverflow.com/questions/10143960",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/360481/"
] | ```
;; org-archive-subtree-hierarchical.el
;; modified from https://lists.gnu.org/archive/html/emacs-orgmode/2014-08/msg00109.html
;; In orgmode
;; * A
;; ** AA
;; *** AAA
;; ** AB
;; *** ABA
;; Archiving AA will remove the subtree from the original file and create
;; it like that in archive target:
;; * AA
;; ** AAA... | I don't think `org-mode` has support for directly mirroring the current context inside your archive file.
There is a relevant variable, `org-archive-location` which can be used to specify a single heading to place your archived item, but multiple levels inside the tree is not supported. On [this page](http://orgmode.o... |
10,143,960 | Im using the following to retrieve a string from php, i would like to know how to make my string into an array.
**Jquery**
```
$.get("get.php", function(data){
alert(data);
//alert($.parseJSON(data));
}, "json");
```
the commented out section seems to have no effect, so I cant really tell what I am doing wr... | 2012/04/13 | [
"https://Stackoverflow.com/questions/10143960",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/360481/"
] | You likely want to set the `:ARCHIVE:` property on the parent headlines.
It allows you for headline specific `org-archive-location` settings. (See the [manual](http://orgmode.org/manual/Moving-subtrees.html#Moving-subtrees))
For example if your archive file is set as `%s_archive` you would want your original file to ... | ```
;; org-archive-subtree-hierarchical.el
;; modified from https://lists.gnu.org/archive/html/emacs-orgmode/2014-08/msg00109.html
;; In orgmode
;; * A
;; ** AA
;; *** AAA
;; ** AB
;; *** ABA
;; Archiving AA will remove the subtree from the original file and create
;; it like that in archive target:
;; * AA
;; ** AAA... |
47,375,568 | I have a little question. Can i in javascript use string.slice() = x?
Example: "Hello world!".slice(2,3) --> = x <-- can I use this?
```
^ the 3rd character in the string
```
So, can i change characters with a slice? (: | 2017/11/19 | [
"https://Stackoverflow.com/questions/47375568",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8965634/"
] | No, you can not assign a value to a part of a [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type):
>
> Unlike in languages like C, JavaScript strings are immutable. This means that once a string is created, it is not possible to modify it. However, it is still possible to cre... | Yes you can use [slice](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) to get the character.
```
var x = "Hello world!".slice(2,3);
console.log(x);
```
However, you can't change character with a slice. See [Nina's answer](https://stackoverflow.com/a/47375615/4154250)... |
9,375,598 | Need to help
1. How play video on `Surface(OpenGL)` in Android?
I tried playing video in `mySurfaceView extends SurfaceView` with help method `setSurface()` in `MediaPlayer`.
```
SurfaceTexture mTexture = new SurfaceTexture(texture_id);
Surface mSurface = new Surface(mTexture);
MediaPlayer mp = new MediaPlayer();
mp... | 2012/02/21 | [
"https://Stackoverflow.com/questions/9375598",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1221256/"
] | From android source code...
```
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;
import android.content.Context;
import android.graphics.SurfaceTexture;
imp... | I guess you can't. At least that's what i found out.
My plan was to have some sort of OpenGL scene (text ticker) while playing a video.
Since android uses HW decoding for displaying a video, it will not be done with OpenGL. I also tried to play the video in OpenGL using ffmpeg but i found out, that no device i tried wi... |
9,375,598 | Need to help
1. How play video on `Surface(OpenGL)` in Android?
I tried playing video in `mySurfaceView extends SurfaceView` with help method `setSurface()` in `MediaPlayer`.
```
SurfaceTexture mTexture = new SurfaceTexture(texture_id);
Surface mSurface = new Surface(mTexture);
MediaPlayer mp = new MediaPlayer();
mp... | 2012/02/21 | [
"https://Stackoverflow.com/questions/9375598",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1221256/"
] | I guess you can't. At least that's what i found out.
My plan was to have some sort of OpenGL scene (text ticker) while playing a video.
Since android uses HW decoding for displaying a video, it will not be done with OpenGL. I also tried to play the video in OpenGL using ffmpeg but i found out, that no device i tried wi... | ```
mMediaPlayer.setSurface(new Surface(mSurfaceTexture));
```
You can use above line of code to use it on your mediaPlayerObject over your desired surfaceTexture which is a applied texture over your surfaceview.
Hope that helps. |
9,375,598 | Need to help
1. How play video on `Surface(OpenGL)` in Android?
I tried playing video in `mySurfaceView extends SurfaceView` with help method `setSurface()` in `MediaPlayer`.
```
SurfaceTexture mTexture = new SurfaceTexture(texture_id);
Surface mSurface = new Surface(mTexture);
MediaPlayer mp = new MediaPlayer();
mp... | 2012/02/21 | [
"https://Stackoverflow.com/questions/9375598",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1221256/"
] | From android source code...
```
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;
import android.content.Context;
import android.graphics.SurfaceTexture;
imp... | ```
mMediaPlayer.setSurface(new Surface(mSurfaceTexture));
```
You can use above line of code to use it on your mediaPlayerObject over your desired surfaceTexture which is a applied texture over your surfaceview.
Hope that helps. |
9,375,598 | Need to help
1. How play video on `Surface(OpenGL)` in Android?
I tried playing video in `mySurfaceView extends SurfaceView` with help method `setSurface()` in `MediaPlayer`.
```
SurfaceTexture mTexture = new SurfaceTexture(texture_id);
Surface mSurface = new Surface(mTexture);
MediaPlayer mp = new MediaPlayer();
mp... | 2012/02/21 | [
"https://Stackoverflow.com/questions/9375598",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1221256/"
] | From android source code...
```
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;
import android.content.Context;
import android.graphics.SurfaceTexture;
imp... | I just converted the Java to Kotlin version
```
internal inline fun <T> glRun(message: String = "", block: (() -> T)): T {
return block().also {
var error: Int = GLES20.glGetError()
while (error != GLES20.GL_NO_ERROR) {
error = GLES20.glGetError()
Log.d("MOVIE_GL_ERROR", "$m... |
9,375,598 | Need to help
1. How play video on `Surface(OpenGL)` in Android?
I tried playing video in `mySurfaceView extends SurfaceView` with help method `setSurface()` in `MediaPlayer`.
```
SurfaceTexture mTexture = new SurfaceTexture(texture_id);
Surface mSurface = new Surface(mTexture);
MediaPlayer mp = new MediaPlayer();
mp... | 2012/02/21 | [
"https://Stackoverflow.com/questions/9375598",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1221256/"
] | I just converted the Java to Kotlin version
```
internal inline fun <T> glRun(message: String = "", block: (() -> T)): T {
return block().also {
var error: Int = GLES20.glGetError()
while (error != GLES20.GL_NO_ERROR) {
error = GLES20.glGetError()
Log.d("MOVIE_GL_ERROR", "$m... | ```
mMediaPlayer.setSurface(new Surface(mSurfaceTexture));
```
You can use above line of code to use it on your mediaPlayerObject over your desired surfaceTexture which is a applied texture over your surfaceview.
Hope that helps. |
475,762 | Suppose, I use Debian unstable or experimental version as guest OS. After installing new software it completely breaks the system. Can it also affect host OS? | 2012/09/16 | [
"https://superuser.com/questions/475762",
"https://superuser.com",
"https://superuser.com/users/34379/"
] | Depending on the virtual machine, it can be possible.
For example, if the VM software has 3D acceleration enabled, then it gives the guest much more access to your graphics card than you might expect. There also have been several bugs in various virtualization software that would allow the guest to obtain the same pri... | In normal circumstances, no. The virtual machine is completely separated from the host machine.
But it is sometimes possible to share a folder between the host and the guest, and in that way is it possible to do harmful things to the host. Or you could connect in the guest to the host via internet and do bad things th... |
475,762 | Suppose, I use Debian unstable or experimental version as guest OS. After installing new software it completely breaks the system. Can it also affect host OS? | 2012/09/16 | [
"https://superuser.com/questions/475762",
"https://superuser.com",
"https://superuser.com/users/34379/"
] | Most of the answers here discuss the virtual machine itself (as does your question) - but the real concern lies with the virtualization software. The concern is that virtualization software has a vulnerability in it's virtualized environment, or doesn't protect the host operating system. Most available virtualization p... | In normal circumstances, no. The virtual machine is completely separated from the host machine.
But it is sometimes possible to share a folder between the host and the guest, and in that way is it possible to do harmful things to the host. Or you could connect in the guest to the host via internet and do bad things th... |
475,762 | Suppose, I use Debian unstable or experimental version as guest OS. After installing new software it completely breaks the system. Can it also affect host OS? | 2012/09/16 | [
"https://superuser.com/questions/475762",
"https://superuser.com",
"https://superuser.com/users/34379/"
] | Depending on the virtual machine, it can be possible.
For example, if the VM software has 3D acceleration enabled, then it gives the guest much more access to your graphics card than you might expect. There also have been several bugs in various virtualization software that would allow the guest to obtain the same pri... | Most of the answers here discuss the virtual machine itself (as does your question) - but the real concern lies with the virtualization software. The concern is that virtualization software has a vulnerability in it's virtualized environment, or doesn't protect the host operating system. Most available virtualization p... |
72,786,603 | How do I compare several rows and find words/combination of words that are present in each row? Using pure python, nltk or anything else.
```py
few_strings = ('this is foo bar', 'this is not a foo bar', 'some other foo bar here')
# some magic
result = 'foo bar'
``` | 2022/06/28 | [
"https://Stackoverflow.com/questions/72786603",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4845952/"
] | Split each string at whitespaces and save the resulting words into sets. Then, compute the intersection of the three sets:
```py
few_strings = ('this is foo bar', 'this is not a foo bar', 'some other foo bar here')
sets = [set(s.split()) for s in few_strings]
common_words = sets[0].intersection(*sets[1:])
print(common... | ```
few_strings = ('this is foo bar', 'this is not a foo bar', 'some other foo bar here')
```
1. Create sets of words for each sentence splitting by space (`" "`)
2. Add the first string to results
3. Loop over the sentences and update `result` variable with the interesction of the current result and one sentence
``... |
72,786,603 | How do I compare several rows and find words/combination of words that are present in each row? Using pure python, nltk or anything else.
```py
few_strings = ('this is foo bar', 'this is not a foo bar', 'some other foo bar here')
# some magic
result = 'foo bar'
``` | 2022/06/28 | [
"https://Stackoverflow.com/questions/72786603",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4845952/"
] | Split each string at whitespaces and save the resulting words into sets. Then, compute the intersection of the three sets:
```py
few_strings = ('this is foo bar', 'this is not a foo bar', 'some other foo bar here')
sets = [set(s.split()) for s in few_strings]
common_words = sets[0].intersection(*sets[1:])
print(common... | You can do it without using libraries too
```
few_strings = ('this is foo bar', 'some other foo bar here', 'this is not a foo bar')
strings = [s.split() for s in few_strings]
strings.sort(key=len)
print(strings)
result = ''
for word in strings[0]:
count = 0
for string in strings:
if word not in string... |
72,786,603 | How do I compare several rows and find words/combination of words that are present in each row? Using pure python, nltk or anything else.
```py
few_strings = ('this is foo bar', 'this is not a foo bar', 'some other foo bar here')
# some magic
result = 'foo bar'
``` | 2022/06/28 | [
"https://Stackoverflow.com/questions/72786603",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4845952/"
] | You might want to use the standard library `difflib` for sequence comparisons including finding common substrings:
```py
from difflib import SequenceMatcher
list_of_str = ['this is foo bar', 'this is not a foo bar', 'some other foo bar here']
result = list_of_str[0]
for next_string in list_of_str:
match = Sequen... | ```
few_strings = ('this is foo bar', 'this is not a foo bar', 'some other foo bar here')
```
1. Create sets of words for each sentence splitting by space (`" "`)
2. Add the first string to results
3. Loop over the sentences and update `result` variable with the interesction of the current result and one sentence
``... |
72,786,603 | How do I compare several rows and find words/combination of words that are present in each row? Using pure python, nltk or anything else.
```py
few_strings = ('this is foo bar', 'this is not a foo bar', 'some other foo bar here')
# some magic
result = 'foo bar'
``` | 2022/06/28 | [
"https://Stackoverflow.com/questions/72786603",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4845952/"
] | You might want to use the standard library `difflib` for sequence comparisons including finding common substrings:
```py
from difflib import SequenceMatcher
list_of_str = ['this is foo bar', 'this is not a foo bar', 'some other foo bar here']
result = list_of_str[0]
for next_string in list_of_str:
match = Sequen... | You can do it without using libraries too
```
few_strings = ('this is foo bar', 'some other foo bar here', 'this is not a foo bar')
strings = [s.split() for s in few_strings]
strings.sort(key=len)
print(strings)
result = ''
for word in strings[0]:
count = 0
for string in strings:
if word not in string... |
55,183,295 | My ultimate goal is to achieve a mapping from a set of two character strings to corresponding data types:
```
"AA" --> char
"BB" --> int
"CC" --> float
"DD" --> std::complex<double>
and so on ...
```
The best "not quite working" solution I can come up with is two parts. The first part is using std::map to map betwee... | 2019/03/15 | [
"https://Stackoverflow.com/questions/55183295",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5144595/"
] | Since `std::map` does not have constexpr ctors, your template argument `str_map["BB"]` can not be evaluated at compile-time.
A simple and maintainable way to map **integers to types** would be using `std::tuple` and `std::tuple_element` as follows.
For instance, `StrType<0>` is `char`, `StrType<1>` is `int`, and so on... | I recentlly worked on something like that. My proposed solution was something like this (with a lot more stuff but here the main idea):
```
//Define a Type for ID
using TypeIdentifier = size_t;
//Define a ID generator
struct id_generator {
static TypeIdentifier create_id() {
static TypeIdentifier value = ... |
7,783,684 | I have a database of coordinates in the schema:
ID:Latitude:Longitude:name:desc
I've set up my google maps application to show the markers effectively on the screen. However I need to add another feature whereby the user can view all pointers that fall within the radius from a central point.
How would I write up a s... | 2011/10/16 | [
"https://Stackoverflow.com/questions/7783684",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/89752/"
] | The SQL below should work:
```
SELECT * FROM Table1 a
WHERE (
acos(sin(a.Latitude * 0.0175) * sin(YOUR_LATITUDE_X * 0.0175)
+ cos(a.Latitude * 0.0175) * cos(YOUR_LATITUDE_X * 0.0175) *
cos((YOUR_LONGITUDE_Y * 0.0175) - (a.Longitude * 0.0175))
) * 3959 <= YO... | You probably need to do this in two steps. Select the points that lie within a 20 mile square with it's centre at X,Y. Assuming you calculate the top,left and bottom,right coordinates of the square first you can get all the points inside the square from the database with:
```
select * from coordinates where longitude ... |
7,783,684 | I have a database of coordinates in the schema:
ID:Latitude:Longitude:name:desc
I've set up my google maps application to show the markers effectively on the screen. However I need to add another feature whereby the user can view all pointers that fall within the radius from a central point.
How would I write up a s... | 2011/10/16 | [
"https://Stackoverflow.com/questions/7783684",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/89752/"
] | You probably need to do this in two steps. Select the points that lie within a 20 mile square with it's centre at X,Y. Assuming you calculate the top,left and bottom,right coordinates of the square first you can get all the points inside the square from the database with:
```
select * from coordinates where longitude ... | This SQL gives more accurate answer:
```sql
SELECT *
FROM Table1 a
WHERE 1 = 1
AND 2 * 3961 * asin(sqrt( power((sin(radians((X - cast(a.latitude as decimal(10,8))) / 2))) , 2) + cast(cos(radians(cast(a.latitude as decimal(18,8)))) * cos(radians(X)) * power((sin(radians((Y - cast(a.long as decimal(18,8))) / 2))) , 2... |
7,783,684 | I have a database of coordinates in the schema:
ID:Latitude:Longitude:name:desc
I've set up my google maps application to show the markers effectively on the screen. However I need to add another feature whereby the user can view all pointers that fall within the radius from a central point.
How would I write up a s... | 2011/10/16 | [
"https://Stackoverflow.com/questions/7783684",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/89752/"
] | The SQL below should work:
```
SELECT * FROM Table1 a
WHERE (
acos(sin(a.Latitude * 0.0175) * sin(YOUR_LATITUDE_X * 0.0175)
+ cos(a.Latitude * 0.0175) * cos(YOUR_LATITUDE_X * 0.0175) *
cos((YOUR_LONGITUDE_Y * 0.0175) - (a.Longitude * 0.0175))
) * 3959 <= YO... | This SQL gives more accurate answer:
```sql
SELECT *
FROM Table1 a
WHERE 1 = 1
AND 2 * 3961 * asin(sqrt( power((sin(radians((X - cast(a.latitude as decimal(10,8))) / 2))) , 2) + cast(cos(radians(cast(a.latitude as decimal(18,8)))) * cos(radians(X)) * power((sin(radians((Y - cast(a.long as decimal(18,8))) / 2))) , 2... |
69,227,075 | Writing a simple selenium script to click on links on aa website. The script is written like so:
```
from selenium import webdriver
import time
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--headless")
chrome_options.add_argument("--disable-gpu")
browser = webdriver.Chrome(options=chrome_op... | 2021/09/17 | [
"https://Stackoverflow.com/questions/69227075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3937811/"
] | Compatibility issue.
Your `chrome driver` version is `94.0.4606.41` and this `driver` version supports `Chrome browser 94`
Please do anyone of the following.
* Update the `chrome browser` version to `94`
* Degrade the `driver` version to `93` (Download `93` version from here *<https://chromedriver.storage.googleapis... | I think there is another way to solve this problem. Uninstall the protarctor and reinstall it and see magic.
```
npm uninstall protractor
npm install protractor
```
[Session not created: This version of ChromeDriver only supports](https://medium.com/@prshannoct/session-not-created-this-version-of-chromedriver-only-s... |
69,227,075 | Writing a simple selenium script to click on links on aa website. The script is written like so:
```
from selenium import webdriver
import time
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--headless")
chrome_options.add_argument("--disable-gpu")
browser = webdriver.Chrome(options=chrome_op... | 2021/09/17 | [
"https://Stackoverflow.com/questions/69227075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3937811/"
] | Compatibility issue.
Your `chrome driver` version is `94.0.4606.41` and this `driver` version supports `Chrome browser 94`
Please do anyone of the following.
* Update the `chrome browser` version to `94`
* Degrade the `driver` version to `93` (Download `93` version from here *<https://chromedriver.storage.googleapis... | If you're using Mac run
```
brew reinstall chromedriver
``` |
69,227,075 | Writing a simple selenium script to click on links on aa website. The script is written like so:
```
from selenium import webdriver
import time
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--headless")
chrome_options.add_argument("--disable-gpu")
browser = webdriver.Chrome(options=chrome_op... | 2021/09/17 | [
"https://Stackoverflow.com/questions/69227075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3937811/"
] | Compatibility issue.
Your `chrome driver` version is `94.0.4606.41` and this `driver` version supports `Chrome browser 94`
Please do anyone of the following.
* Update the `chrome browser` version to `94`
* Degrade the `driver` version to `93` (Download `93` version from here *<https://chromedriver.storage.googleapis... | This made me go crazy I solved it like this we are using selenium npm module.
Run the code below and it will tell you what executable path you are using.
```
const { Builder, By, Key, util } = require("selenium-webdriver");
const chrome = require("selenium-webdriver/chrome");
console.log(chrome.getDefaultService().ex... |
69,227,075 | Writing a simple selenium script to click on links on aa website. The script is written like so:
```
from selenium import webdriver
import time
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--headless")
chrome_options.add_argument("--disable-gpu")
browser = webdriver.Chrome(options=chrome_op... | 2021/09/17 | [
"https://Stackoverflow.com/questions/69227075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3937811/"
] | This error occurred because you have different versions of Google Chrome and driver. It is better to update the driver, rather than install the old version of Google, since in the future it will be constantly updated (why do you want to use outdated technologies?).
I usually use :
```
ChromeDriverManager
```
because... | I think there is another way to solve this problem. Uninstall the protarctor and reinstall it and see magic.
```
npm uninstall protractor
npm install protractor
```
[Session not created: This version of ChromeDriver only supports](https://medium.com/@prshannoct/session-not-created-this-version-of-chromedriver-only-s... |
69,227,075 | Writing a simple selenium script to click on links on aa website. The script is written like so:
```
from selenium import webdriver
import time
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--headless")
chrome_options.add_argument("--disable-gpu")
browser = webdriver.Chrome(options=chrome_op... | 2021/09/17 | [
"https://Stackoverflow.com/questions/69227075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3937811/"
] | This error occurred because you have different versions of Google Chrome and driver. It is better to update the driver, rather than install the old version of Google, since in the future it will be constantly updated (why do you want to use outdated technologies?).
I usually use :
```
ChromeDriverManager
```
because... | If you're using Mac run
```
brew reinstall chromedriver
``` |
69,227,075 | Writing a simple selenium script to click on links on aa website. The script is written like so:
```
from selenium import webdriver
import time
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--headless")
chrome_options.add_argument("--disable-gpu")
browser = webdriver.Chrome(options=chrome_op... | 2021/09/17 | [
"https://Stackoverflow.com/questions/69227075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3937811/"
] | This error occurred because you have different versions of Google Chrome and driver. It is better to update the driver, rather than install the old version of Google, since in the future it will be constantly updated (why do you want to use outdated technologies?).
I usually use :
```
ChromeDriverManager
```
because... | This made me go crazy I solved it like this we are using selenium npm module.
Run the code below and it will tell you what executable path you are using.
```
const { Builder, By, Key, util } = require("selenium-webdriver");
const chrome = require("selenium-webdriver/chrome");
console.log(chrome.getDefaultService().ex... |
69,227,075 | Writing a simple selenium script to click on links on aa website. The script is written like so:
```
from selenium import webdriver
import time
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--headless")
chrome_options.add_argument("--disable-gpu")
browser = webdriver.Chrome(options=chrome_op... | 2021/09/17 | [
"https://Stackoverflow.com/questions/69227075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3937811/"
] | If you're using Mac run
```
brew reinstall chromedriver
``` | I think there is another way to solve this problem. Uninstall the protarctor and reinstall it and see magic.
```
npm uninstall protractor
npm install protractor
```
[Session not created: This version of ChromeDriver only supports](https://medium.com/@prshannoct/session-not-created-this-version-of-chromedriver-only-s... |
69,227,075 | Writing a simple selenium script to click on links on aa website. The script is written like so:
```
from selenium import webdriver
import time
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--headless")
chrome_options.add_argument("--disable-gpu")
browser = webdriver.Chrome(options=chrome_op... | 2021/09/17 | [
"https://Stackoverflow.com/questions/69227075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3937811/"
] | This made me go crazy I solved it like this we are using selenium npm module.
Run the code below and it will tell you what executable path you are using.
```
const { Builder, By, Key, util } = require("selenium-webdriver");
const chrome = require("selenium-webdriver/chrome");
console.log(chrome.getDefaultService().ex... | I think there is another way to solve this problem. Uninstall the protarctor and reinstall it and see magic.
```
npm uninstall protractor
npm install protractor
```
[Session not created: This version of ChromeDriver only supports](https://medium.com/@prshannoct/session-not-created-this-version-of-chromedriver-only-s... |
31,454,518 | I have a two Database class objects allocated on Stack. I inherit this database class in my personal defined class. Now Database class has a function named "Close()" which throws an exception if closing that instance of database fails. Now for client perspective i don't want Client to call close() everytime to close th... | 2015/07/16 | [
"https://Stackoverflow.com/questions/31454518",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3312772/"
] | you don't throw exception from the destructor what-so-ever!
See : <http://www.stroustrup.com/bs_faq2.html#ctor-exceptions>
Bjarne quote (can you throw exception from a d.tor):
>
> Not really: You can throw an exception in a destructor, but that exception must not leave the destructor; if a destructor exits by a t... | Chances are that if `close` fails, there is not good recovery path anyway, you are best off logging the error and then carrying on as if it succeeded. So I would suggest you call `close` in a `try` block in you destructor and just logging the error in the corresponding `catch` block. The destructor can then complete no... |
31,454,518 | I have a two Database class objects allocated on Stack. I inherit this database class in my personal defined class. Now Database class has a function named "Close()" which throws an exception if closing that instance of database fails. Now for client perspective i don't want Client to call close() everytime to close th... | 2015/07/16 | [
"https://Stackoverflow.com/questions/31454518",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3312772/"
] | you don't throw exception from the destructor what-so-ever!
See : <http://www.stroustrup.com/bs_faq2.html#ctor-exceptions>
Bjarne quote (can you throw exception from a d.tor):
>
> Not really: You can throw an exception in a destructor, but that exception must not leave the destructor; if a destructor exits by a t... | You probably should have a class for holding *one* database connection, and another class holding two instances of the first. Since I figure the *creation* of a database could fail as well, having each connection in its own class (with its own destructor) will handle partial construction / destruction quite nicely.
Be... |
31,454,518 | I have a two Database class objects allocated on Stack. I inherit this database class in my personal defined class. Now Database class has a function named "Close()" which throws an exception if closing that instance of database fails. Now for client perspective i don't want Client to call close() everytime to close th... | 2015/07/16 | [
"https://Stackoverflow.com/questions/31454518",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3312772/"
] | you don't throw exception from the destructor what-so-ever!
See : <http://www.stroustrup.com/bs_faq2.html#ctor-exceptions>
Bjarne quote (can you throw exception from a d.tor):
>
> Not really: You can throw an exception in a destructor, but that exception must not leave the destructor; if a destructor exits by a t... | Exceptions should never be thrown in destructor call.
You **should not** call anything that can cause them there, otherwise, you're crashing your class safety.
You should add a function that checks if database object can be "closed", not an exception. If you imagine that you just **can't** call function in destructor ... |
31,454,518 | I have a two Database class objects allocated on Stack. I inherit this database class in my personal defined class. Now Database class has a function named "Close()" which throws an exception if closing that instance of database fails. Now for client perspective i don't want Client to call close() everytime to close th... | 2015/07/16 | [
"https://Stackoverflow.com/questions/31454518",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3312772/"
] | you don't throw exception from the destructor what-so-ever!
See : <http://www.stroustrup.com/bs_faq2.html#ctor-exceptions>
Bjarne quote (can you throw exception from a d.tor):
>
> Not really: You can throw an exception in a destructor, but that exception must not leave the destructor; if a destructor exits by a t... | Do not throw exceptions from destructors, bad things happens, use a `shutdown()` method and call it ouside of destructor. Most C++ stuff is cleaned in destructors, if you throw from within a destructor you literally stop cleaning up things and you would end up having a C++ program in undefined state:
```
class Databas... |
31,454,518 | I have a two Database class objects allocated on Stack. I inherit this database class in my personal defined class. Now Database class has a function named "Close()" which throws an exception if closing that instance of database fails. Now for client perspective i don't want Client to call close() everytime to close th... | 2015/07/16 | [
"https://Stackoverflow.com/questions/31454518",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3312772/"
] | You probably should have a class for holding *one* database connection, and another class holding two instances of the first. Since I figure the *creation* of a database could fail as well, having each connection in its own class (with its own destructor) will handle partial construction / destruction quite nicely.
Be... | Chances are that if `close` fails, there is not good recovery path anyway, you are best off logging the error and then carrying on as if it succeeded. So I would suggest you call `close` in a `try` block in you destructor and just logging the error in the corresponding `catch` block. The destructor can then complete no... |
31,454,518 | I have a two Database class objects allocated on Stack. I inherit this database class in my personal defined class. Now Database class has a function named "Close()" which throws an exception if closing that instance of database fails. Now for client perspective i don't want Client to call close() everytime to close th... | 2015/07/16 | [
"https://Stackoverflow.com/questions/31454518",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3312772/"
] | Do not throw exceptions from destructors, bad things happens, use a `shutdown()` method and call it ouside of destructor. Most C++ stuff is cleaned in destructors, if you throw from within a destructor you literally stop cleaning up things and you would end up having a C++ program in undefined state:
```
class Databas... | Chances are that if `close` fails, there is not good recovery path anyway, you are best off logging the error and then carrying on as if it succeeded. So I would suggest you call `close` in a `try` block in you destructor and just logging the error in the corresponding `catch` block. The destructor can then complete no... |
31,454,518 | I have a two Database class objects allocated on Stack. I inherit this database class in my personal defined class. Now Database class has a function named "Close()" which throws an exception if closing that instance of database fails. Now for client perspective i don't want Client to call close() everytime to close th... | 2015/07/16 | [
"https://Stackoverflow.com/questions/31454518",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3312772/"
] | You probably should have a class for holding *one* database connection, and another class holding two instances of the first. Since I figure the *creation* of a database could fail as well, having each connection in its own class (with its own destructor) will handle partial construction / destruction quite nicely.
Be... | Exceptions should never be thrown in destructor call.
You **should not** call anything that can cause them there, otherwise, you're crashing your class safety.
You should add a function that checks if database object can be "closed", not an exception. If you imagine that you just **can't** call function in destructor ... |
31,454,518 | I have a two Database class objects allocated on Stack. I inherit this database class in my personal defined class. Now Database class has a function named "Close()" which throws an exception if closing that instance of database fails. Now for client perspective i don't want Client to call close() everytime to close th... | 2015/07/16 | [
"https://Stackoverflow.com/questions/31454518",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3312772/"
] | Do not throw exceptions from destructors, bad things happens, use a `shutdown()` method and call it ouside of destructor. Most C++ stuff is cleaned in destructors, if you throw from within a destructor you literally stop cleaning up things and you would end up having a C++ program in undefined state:
```
class Databas... | Exceptions should never be thrown in destructor call.
You **should not** call anything that can cause them there, otherwise, you're crashing your class safety.
You should add a function that checks if database object can be "closed", not an exception. If you imagine that you just **can't** call function in destructor ... |
49,070,467 | is it possible to create custom effects for JavaFX, based on a Pixle Shader? I found [this](http://lqd.hybird.org/journal/?p=196) article but what is Decora? I cannot find anything about it.
THX | 2018/03/02 | [
"https://Stackoverflow.com/questions/49070467",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1770962/"
] | Currently no - in the abstract base class Effect.java, there are abstract package-private methods like, copy(), sync(), update() etc.
The Decora project is discussed here: <http://labonnesoupe.org/static/code/> . I asked about opening JSL, to make some kind of public API in the developer OpenJFX thread perhaps 6 month... | Use libgdx. Its free and Works on Web HTML 5 webgl ,ios,android,all desktop and with full shader support |
49,070,467 | is it possible to create custom effects for JavaFX, based on a Pixle Shader? I found [this](http://lqd.hybird.org/journal/?p=196) article but what is Decora? I cannot find anything about it.
THX | 2018/03/02 | [
"https://Stackoverflow.com/questions/49070467",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1770962/"
] | Currently no - in the abstract base class Effect.java, there are abstract package-private methods like, copy(), sync(), update() etc.
The Decora project is discussed here: <http://labonnesoupe.org/static/code/> . I asked about opening JSL, to make some kind of public API in the developer OpenJFX thread perhaps 6 month... | Theoretically it IS POSSIBLE to create you custom effect in JavaFx however using way u probably won't like... Abstract class `javafx.scene.effect.Effect` has internal methods inside, that is right! But based on the fact that internal means "package private" we can do the following! In your project create a new package ... |
49,070,467 | is it possible to create custom effects for JavaFX, based on a Pixle Shader? I found [this](http://lqd.hybird.org/journal/?p=196) article but what is Decora? I cannot find anything about it.
THX | 2018/03/02 | [
"https://Stackoverflow.com/questions/49070467",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1770962/"
] | Theoretically it IS POSSIBLE to create you custom effect in JavaFx however using way u probably won't like... Abstract class `javafx.scene.effect.Effect` has internal methods inside, that is right! But based on the fact that internal means "package private" we can do the following! In your project create a new package ... | Use libgdx. Its free and Works on Web HTML 5 webgl ,ios,android,all desktop and with full shader support |
63,104,066 | here is my models.py file
```
class Customer(models.Model):
"""All Customers details goes here"""
name = models.CharField(max_length=255, null=False)
firm_name = models.CharField(max_length=255, null=False)
email = models.EmailField(null=False)
phone_number = models.CharField(max_length=255, null=... | 2020/07/26 | [
"https://Stackoverflow.com/questions/63104066",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13533308/"
] | You may use
```
[Validators.required, Validators.pattern("-?\\d+(?:\\.\\d+)?")]
```
Or,
```
[Validators.required, Validators.pattern(/^-?\d+(?:\.\d+)?$/)]
```
**NOTES**:
* If you define the regex with a string literal, `"..."`, remember that `^` and `$` are appended by angular automatically, you do not need to s... | check [this](https://www.regextester.com/) works for Integers or decimal numbers with or without the exponential form
```html
^[+-]?([0-9]*\.?[0-9]+|[0-9]+\.?[0-9]*)([eE][+-]?[0-9]+)?$
```
for more regex try this [website](https://regexlib.com/) |
19,702,779 | I want to use gzip for my mobile version of site. I tried to do it adding following line at the top of my php file
```
ob_start("ob_gzhandler");
```
But it gives me following error. 
I've been searching and trying number of ways but nothing could c... | 2013/10/31 | [
"https://Stackoverflow.com/questions/19702779",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1784822/"
] | May be you are using Apache's gzip compression that compress js/css files, again use of ob\_start('ob\_gzhandler') will compress that compression and browser will not handle that.
[check here](https://stackoverflow.com/questions/5441784/why-does-ob-startob-gzhandler-break-this-website) may be it will help you. | simply use double quotes as `"ob_start('ob_gzhandler')";` to avoid content encoding error |
19,702,779 | I want to use gzip for my mobile version of site. I tried to do it adding following line at the top of my php file
```
ob_start("ob_gzhandler");
```
But it gives me following error. 
I've been searching and trying number of ways but nothing could c... | 2013/10/31 | [
"https://Stackoverflow.com/questions/19702779",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1784822/"
] | Maybe you had the same problem as me and actually have **an utf-8 file WITH an UTF-8 BOM inside** \*.
I think gzip in combination with UTF-8 BOM gives an encoding problem.
***Notes:***
* Not all editors are able to show if the BOM is there or not. I had to actually use another editor, Notepad++, to realize there w... | May be you are using Apache's gzip compression that compress js/css files, again use of ob\_start('ob\_gzhandler') will compress that compression and browser will not handle that.
[check here](https://stackoverflow.com/questions/5441784/why-does-ob-startob-gzhandler-break-this-website) may be it will help you. |
19,702,779 | I want to use gzip for my mobile version of site. I tried to do it adding following line at the top of my php file
```
ob_start("ob_gzhandler");
```
But it gives me following error. 
I've been searching and trying number of ways but nothing could c... | 2013/10/31 | [
"https://Stackoverflow.com/questions/19702779",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1784822/"
] | Maybe you had the same problem as me and actually have **an utf-8 file WITH an UTF-8 BOM inside** \*.
I think gzip in combination with UTF-8 BOM gives an encoding problem.
***Notes:***
* Not all editors are able to show if the BOM is there or not. I had to actually use another editor, Notepad++, to realize there w... | simply use double quotes as `"ob_start('ob_gzhandler')";` to avoid content encoding error |
488,485 | I have two users, user1 and user2, that are both members of groupA. user2 has a folder in their home directory called folderA. If they wish to allow read-write-execute permissions for all members of groupA, how would they do this?
What if folderA contains many files and additional folders that also need to have read-w... | 2014/06/26 | [
"https://askubuntu.com/questions/488485",
"https://askubuntu.com",
"https://askubuntu.com/users/179016/"
] | **FolderA** will first need to be part of **groupA** - the folder's owner or root can perform this operation
```
chgrp groupA ./folderA
```
Then **groupA** will need rwx permissions of the folder
```
chmod g+rwx ./folderA
```
There are options in the `chgrp` and `chmod` commands to recurse into the directory if ... | My own experience in this area here. Tested on Ubuntu 18.04.
### Allow to write in the system folder
Give write permission to `/etc/nginx/` folder.
```sh
# Check 'webmasters' group doen't exist
cat /etc/group | grep webmasters
# Create 'webmasters' group
sudo addgroup webmasters
# Add users to 'webmasters' group
sud... |
635,632 | I am trying to get the revision number of a project and save it into a variable. I know I can get the revision number by svnversion command but I'm not sure how I can store it. I am using regular windows command prompt. Basically I'm trying to do something like :
set svnVersion= %svnversion% but I'm not sure how?? | 2009/03/11 | [
"https://Stackoverflow.com/questions/635632",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/62958/"
] | In bash (via Cygwin):
```
svn info | grep -i "Revision" | cut -d ' ' -f 2
```
You can then use that in a bash shell script to store the value in a variable. | The "svn info" subcommand will tell you the revision number in your working copy. |
635,632 | I am trying to get the revision number of a project and save it into a variable. I know I can get the revision number by svnversion command but I'm not sure how I can store it. I am using regular windows command prompt. Basically I'm trying to do something like :
set svnVersion= %svnversion% but I'm not sure how?? | 2009/03/11 | [
"https://Stackoverflow.com/questions/635632",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/62958/"
] | In bash (via Cygwin):
```
svn info | grep -i "Revision" | cut -d ' ' -f 2
```
You can then use that in a bash shell script to store the value in a variable. | Something like:
```
svn version > ver.txt
set /p ver= < ver.txt
del ver.txt
echo %ver%
``` |
635,632 | I am trying to get the revision number of a project and save it into a variable. I know I can get the revision number by svnversion command but I'm not sure how I can store it. I am using regular windows command prompt. Basically I'm trying to do something like :
set svnVersion= %svnversion% but I'm not sure how?? | 2009/03/11 | [
"https://Stackoverflow.com/questions/635632",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/62958/"
] | To set the output of variable to the output of svnversion in a batch file, you have to do this:
```
for /f "delims=" %%a in ('svnversion') do @set myvar=%%a
echo %myvar%
```
---
Different approach: If you have TortoiseSVN you can also use **SubWCRev.exe**. See
[get the project revision number into my project?](h... | Here is an alternative that uses a pipe to findstr to get a single line:
```
FOR /F "tokens=2" %%G IN ('svn info ^| findstr /B Revision:') DO SET SVN_REVISION=%%G
echo SVN_REVISION: %SVN_REVISION%
FOR /F "tokens=2" %%G IN ('svn info ^| findstr /B URL:') DO SET SVN_URL=%%G
echo SVN_URL: %SVN_URL%
``` |
635,632 | I am trying to get the revision number of a project and save it into a variable. I know I can get the revision number by svnversion command but I'm not sure how I can store it. I am using regular windows command prompt. Basically I'm trying to do something like :
set svnVersion= %svnversion% but I'm not sure how?? | 2009/03/11 | [
"https://Stackoverflow.com/questions/635632",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/62958/"
] | If you need this from a remote repository (as in not checked out localy) you can do this
```
for /f "delims=: tokens=1,2" %%a in ('svn info %SVN_REPO_URL%') do (
if "%%a"=="Revision" (
set /a RELEASE_REVISION=%%b
)
)
```
I use this in my release process to grab the revision number from a tag. | See if this help: [Change Revision Number](https://stackoverflow.com/questions/562087/change-revision-number-in-subversion-even-if-the-file-not-change-in-the-commit) |
635,632 | I am trying to get the revision number of a project and save it into a variable. I know I can get the revision number by svnversion command but I'm not sure how I can store it. I am using regular windows command prompt. Basically I'm trying to do something like :
set svnVersion= %svnversion% but I'm not sure how?? | 2009/03/11 | [
"https://Stackoverflow.com/questions/635632",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/62958/"
] | To set the output of variable to the output of svnversion in a batch file, you have to do this:
```
for /f "delims=" %%a in ('svnversion') do @set myvar=%%a
echo %myvar%
```
---
Different approach: If you have TortoiseSVN you can also use **SubWCRev.exe**. See
[get the project revision number into my project?](h... | In bash (via Cygwin):
```
svn info | grep -i "Revision" | cut -d ' ' -f 2
```
You can then use that in a bash shell script to store the value in a variable. |
635,632 | I am trying to get the revision number of a project and save it into a variable. I know I can get the revision number by svnversion command but I'm not sure how I can store it. I am using regular windows command prompt. Basically I'm trying to do something like :
set svnVersion= %svnversion% but I'm not sure how?? | 2009/03/11 | [
"https://Stackoverflow.com/questions/635632",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/62958/"
] | To set the output of variable to the output of svnversion in a batch file, you have to do this:
```
for /f "delims=" %%a in ('svnversion') do @set myvar=%%a
echo %myvar%
```
---
Different approach: If you have TortoiseSVN you can also use **SubWCRev.exe**. See
[get the project revision number into my project?](h... | The "svn info" subcommand will tell you the revision number in your working copy. |
635,632 | I am trying to get the revision number of a project and save it into a variable. I know I can get the revision number by svnversion command but I'm not sure how I can store it. I am using regular windows command prompt. Basically I'm trying to do something like :
set svnVersion= %svnversion% but I'm not sure how?? | 2009/03/11 | [
"https://Stackoverflow.com/questions/635632",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/62958/"
] | To set the output of variable to the output of svnversion in a batch file, you have to do this:
```
for /f "delims=" %%a in ('svnversion') do @set myvar=%%a
echo %myvar%
```
---
Different approach: If you have TortoiseSVN you can also use **SubWCRev.exe**. See
[get the project revision number into my project?](h... | If you need this from a remote repository (as in not checked out localy) you can do this
```
for /f "delims=: tokens=1,2" %%a in ('svn info %SVN_REPO_URL%') do (
if "%%a"=="Revision" (
set /a RELEASE_REVISION=%%b
)
)
```
I use this in my release process to grab the revision number from a tag. |
635,632 | I am trying to get the revision number of a project and save it into a variable. I know I can get the revision number by svnversion command but I'm not sure how I can store it. I am using regular windows command prompt. Basically I'm trying to do something like :
set svnVersion= %svnversion% but I'm not sure how?? | 2009/03/11 | [
"https://Stackoverflow.com/questions/635632",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/62958/"
] | If you need this from a remote repository (as in not checked out localy) you can do this
```
for /f "delims=: tokens=1,2" %%a in ('svn info %SVN_REPO_URL%') do (
if "%%a"=="Revision" (
set /a RELEASE_REVISION=%%b
)
)
```
I use this in my release process to grab the revision number from a tag. | Here is an alternative that uses a pipe to findstr to get a single line:
```
FOR /F "tokens=2" %%G IN ('svn info ^| findstr /B Revision:') DO SET SVN_REVISION=%%G
echo SVN_REVISION: %SVN_REVISION%
FOR /F "tokens=2" %%G IN ('svn info ^| findstr /B URL:') DO SET SVN_URL=%%G
echo SVN_URL: %SVN_URL%
``` |
635,632 | I am trying to get the revision number of a project and save it into a variable. I know I can get the revision number by svnversion command but I'm not sure how I can store it. I am using regular windows command prompt. Basically I'm trying to do something like :
set svnVersion= %svnversion% but I'm not sure how?? | 2009/03/11 | [
"https://Stackoverflow.com/questions/635632",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/62958/"
] | The "svn info" subcommand will tell you the revision number in your working copy. | See if this help: [Change Revision Number](https://stackoverflow.com/questions/562087/change-revision-number-in-subversion-even-if-the-file-not-change-in-the-commit) |
635,632 | I am trying to get the revision number of a project and save it into a variable. I know I can get the revision number by svnversion command but I'm not sure how I can store it. I am using regular windows command prompt. Basically I'm trying to do something like :
set svnVersion= %svnversion% but I'm not sure how?? | 2009/03/11 | [
"https://Stackoverflow.com/questions/635632",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/62958/"
] | In bash (via Cygwin):
```
svn info | grep -i "Revision" | cut -d ' ' -f 2
```
You can then use that in a bash shell script to store the value in a variable. | Here is an alternative that uses a pipe to findstr to get a single line:
```
FOR /F "tokens=2" %%G IN ('svn info ^| findstr /B Revision:') DO SET SVN_REVISION=%%G
echo SVN_REVISION: %SVN_REVISION%
FOR /F "tokens=2" %%G IN ('svn info ^| findstr /B URL:') DO SET SVN_URL=%%G
echo SVN_URL: %SVN_URL%
``` |
138,606 | I'm looking at Deligne-Rapoport p.175 Prop 1.5:
Suppose $p: C\rightarrow S$ is a proper, flat morphism of finite presentation and suppose that geometric fibers are reduced, pure of dimension 1, of arithmetic genus 1 and connected.
Question: Why is the locus of points $s \in S$ where a geometric fiber $C\_{\bar{s}}$ ... | 2013/08/05 | [
"https://mathoverflow.net/questions/138606",
"https://mathoverflow.net",
"https://mathoverflow.net/users/38209/"
] | Start with the sheaf of relative differentials, $\Omega\_{C/S}$. Next consider the Fitting ideal $\mathcal{I}$ of $\Omega\_{C/S}$ (measuring the deviation from being locally free of rank $1$). Consider the closed subscheme $C\_{\text{sing},p}$ of $C$ associated to $\mathcal{I}$. By hypothesis, the projection morphism $... | Perhaps I can point to a more explicit explanation at the end of my notes : <http://math.rutgers.edu/~hjn11/Notes/moduli%20space%20of%20curves.pdf> . Check out Proposition 5.1 there. It essentially deals with this same question, though coming from the point of view of construction the Hilbert scheme of stable curves. T... |
24,255 | Currently, the standard behaviour for viewing web pages on a mobile is that:
* If viewed in portrait the text is smaller because the width of the device is small and the whole page width needs to fit into view.
* If viewed in landscape the view 'zooms in' as the width is now wider so that the text is larger and more r... | 2012/08/02 | [
"https://ux.stackexchange.com/questions/24255",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/3865/"
] | Let me add a late answer: **after the content has loaded, do not let rotations trigger breakpoints**.
If the user rotates the device accidentally, their most immediate task is to reorient themselves and re-find the content they were viewing or reading at the time of rotation. But a breakpoint trigger, the user is sudd... | Personally I'm a supporter of sites with a mix of the two.
* *Fonts should keep the same size both in landscape and portrait. It should merely be distributed differently depending on the current screen width. As you've also showed in the mockup for A.*
I feel that also scaling the text is like surrendering to a notio... |
24,255 | Currently, the standard behaviour for viewing web pages on a mobile is that:
* If viewed in portrait the text is smaller because the width of the device is small and the whole page width needs to fit into view.
* If viewed in landscape the view 'zooms in' as the width is now wider so that the text is larger and more r... | 2012/08/02 | [
"https://ux.stackexchange.com/questions/24255",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/3865/"
] | Let me add a late answer: **after the content has loaded, do not let rotations trigger breakpoints**.
If the user rotates the device accidentally, their most immediate task is to reorient themselves and re-find the content they were viewing or reading at the time of rotation. But a breakpoint trigger, the user is sudd... | Design for the content to fit within nicely within a range of widths, but don't assume any specific viewport widths. The content should determine the breakpoints for rearrangement and adjustment, not the currently popular device sizes (which is constantly changing).
For some content/applications, the layout structure... |
24,255 | Currently, the standard behaviour for viewing web pages on a mobile is that:
* If viewed in portrait the text is smaller because the width of the device is small and the whole page width needs to fit into view.
* If viewed in landscape the view 'zooms in' as the width is now wider so that the text is larger and more r... | 2012/08/02 | [
"https://ux.stackexchange.com/questions/24255",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/3865/"
] | This is delicate, and should be a sound judgment by the designer. There is no right or wrong, neither is there a convention (yet) to rely on. But there are a few things to consider, like zooming in just widening the page, which I feel is useless. If I want to zoom I can snap-in on the text getting it in a more readable... | Design for the content to fit within nicely within a range of widths, but don't assume any specific viewport widths. The content should determine the breakpoints for rearrangement and adjustment, not the currently popular device sizes (which is constantly changing).
For some content/applications, the layout structure... |
24,255 | Currently, the standard behaviour for viewing web pages on a mobile is that:
* If viewed in portrait the text is smaller because the width of the device is small and the whole page width needs to fit into view.
* If viewed in landscape the view 'zooms in' as the width is now wider so that the text is larger and more r... | 2012/08/02 | [
"https://ux.stackexchange.com/questions/24255",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/3865/"
] | There are different approaches to device oriented design, and you can implement one of several design patterns to choose from. The first one that comes to mind is the **fluid** design, which (simply put) just reorganize the elements to a better view. Some, less important elements, are hidden as the screen width gets na... | Design for the content to fit within nicely within a range of widths, but don't assume any specific viewport widths. The content should determine the breakpoints for rearrangement and adjustment, not the currently popular device sizes (which is constantly changing).
For some content/applications, the layout structure... |
24,255 | Currently, the standard behaviour for viewing web pages on a mobile is that:
* If viewed in portrait the text is smaller because the width of the device is small and the whole page width needs to fit into view.
* If viewed in landscape the view 'zooms in' as the width is now wider so that the text is larger and more r... | 2012/08/02 | [
"https://ux.stackexchange.com/questions/24255",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/3865/"
] | Design for the content to fit within nicely within a range of widths, but don't assume any specific viewport widths. The content should determine the breakpoints for rearrangement and adjustment, not the currently popular device sizes (which is constantly changing).
For some content/applications, the layout structure... | So it is Jan 2017. This was a good question back in 2012 but I feel that our experience may have changed our opinion now. The responsiveness movement seems largely to prefer to follow a rule of
>
> use the space available
>
>
>
by re-organising the layout on orientation change. This seems to have become accepted... |
24,255 | Currently, the standard behaviour for viewing web pages on a mobile is that:
* If viewed in portrait the text is smaller because the width of the device is small and the whole page width needs to fit into view.
* If viewed in landscape the view 'zooms in' as the width is now wider so that the text is larger and more r... | 2012/08/02 | [
"https://ux.stackexchange.com/questions/24255",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/3865/"
] | Let me add a late answer: **after the content has loaded, do not let rotations trigger breakpoints**.
If the user rotates the device accidentally, their most immediate task is to reorient themselves and re-find the content they were viewing or reading at the time of rotation. But a breakpoint trigger, the user is sudd... | There are different approaches to device oriented design, and you can implement one of several design patterns to choose from. The first one that comes to mind is the **fluid** design, which (simply put) just reorganize the elements to a better view. Some, less important elements, are hidden as the screen width gets na... |
24,255 | Currently, the standard behaviour for viewing web pages on a mobile is that:
* If viewed in portrait the text is smaller because the width of the device is small and the whole page width needs to fit into view.
* If viewed in landscape the view 'zooms in' as the width is now wider so that the text is larger and more r... | 2012/08/02 | [
"https://ux.stackexchange.com/questions/24255",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/3865/"
] | Design for the content to fit within nicely within a range of widths, but don't assume any specific viewport widths. The content should determine the breakpoints for rearrangement and adjustment, not the currently popular device sizes (which is constantly changing).
For some content/applications, the layout structure... | For consistencies sake, I'd ensure that the page on a device that started in portrait and is rotated to landscape is the same as if I'd started on landscape in the first place. If a user visits your site on two different occasions and it's different because of what orientation the user started out with, she's going to ... |
24,255 | Currently, the standard behaviour for viewing web pages on a mobile is that:
* If viewed in portrait the text is smaller because the width of the device is small and the whole page width needs to fit into view.
* If viewed in landscape the view 'zooms in' as the width is now wider so that the text is larger and more r... | 2012/08/02 | [
"https://ux.stackexchange.com/questions/24255",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/3865/"
] | Personally I'm a supporter of sites with a mix of the two.
* *Fonts should keep the same size both in landscape and portrait. It should merely be distributed differently depending on the current screen width. As you've also showed in the mockup for A.*
I feel that also scaling the text is like surrendering to a notio... | Design for the content to fit within nicely within a range of widths, but don't assume any specific viewport widths. The content should determine the breakpoints for rearrangement and adjustment, not the currently popular device sizes (which is constantly changing).
For some content/applications, the layout structure... |
24,255 | Currently, the standard behaviour for viewing web pages on a mobile is that:
* If viewed in portrait the text is smaller because the width of the device is small and the whole page width needs to fit into view.
* If viewed in landscape the view 'zooms in' as the width is now wider so that the text is larger and more r... | 2012/08/02 | [
"https://ux.stackexchange.com/questions/24255",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/3865/"
] | Let me add a late answer: **after the content has loaded, do not let rotations trigger breakpoints**.
If the user rotates the device accidentally, their most immediate task is to reorient themselves and re-find the content they were viewing or reading at the time of rotation. But a breakpoint trigger, the user is sudd... | So it is Jan 2017. This was a good question back in 2012 but I feel that our experience may have changed our opinion now. The responsiveness movement seems largely to prefer to follow a rule of
>
> use the space available
>
>
>
by re-organising the layout on orientation change. This seems to have become accepted... |
24,255 | Currently, the standard behaviour for viewing web pages on a mobile is that:
* If viewed in portrait the text is smaller because the width of the device is small and the whole page width needs to fit into view.
* If viewed in landscape the view 'zooms in' as the width is now wider so that the text is larger and more r... | 2012/08/02 | [
"https://ux.stackexchange.com/questions/24255",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/3865/"
] | This is delicate, and should be a sound judgment by the designer. There is no right or wrong, neither is there a convention (yet) to rely on. But there are a few things to consider, like zooming in just widening the page, which I feel is useless. If I want to zoom I can snap-in on the text getting it in a more readable... | So it is Jan 2017. This was a good question back in 2012 but I feel that our experience may have changed our opinion now. The responsiveness movement seems largely to prefer to follow a rule of
>
> use the space available
>
>
>
by re-organising the layout on orientation change. This seems to have become accepted... |
11,353,545 | I have attached a zip with an FLA that you can run in CS 5.5. The animation contains a performance analyser and sliders to control various parameters.
Demo:
<http://sephardi.ehclients.com/alivetest/index.html>
Click anywhere to start the animation
Files:
<https://www.dropbox.com/s/4rcpvzo1h7br8fh/alivesource.zip>
I ... | 2012/07/05 | [
"https://Stackoverflow.com/questions/11353545",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1471866/"
] | Try this(not tested):
```
WITH FullData AS
(
SELECT a.*,
ROW_NUMBER() OVER(PARTITION BY acc_id2 ORDER BY acc_grp_id1 DESC) AS Position
FROM <YOUR-TABLE> a
), FilteredData AS
(
SELECT *
FROM FullData
WHERE Position = 1
AND acc_parameter_1 = 2
AND acc_parameter... | This should work :
```
SELECT AC.*
FROM (
SELECT T.acc_id1,max(acc_grp_id1) maxacc_grp_id1
FROM tbl T
GROUP by t.acc_id1
) M
INNER JOIN tbl Last on Last.acc_id1=M.acc_id1
AND Last.acc_grp_id1=M.maxacc_grp_id1
INNER JOIN tbl AC on AC.acc_id1=M.acc_id1
and ((Last.acc_parameter1 =2 and Last.acc_parameter2=166)... |
11,353,545 | I have attached a zip with an FLA that you can run in CS 5.5. The animation contains a performance analyser and sliders to control various parameters.
Demo:
<http://sephardi.ehclients.com/alivetest/index.html>
Click anywhere to start the animation
Files:
<https://www.dropbox.com/s/4rcpvzo1h7br8fh/alivesource.zip>
I ... | 2012/07/05 | [
"https://Stackoverflow.com/questions/11353545",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1471866/"
] | Try this solution:
```
SELECT
a.*
FROM
tbl a
INNER JOIN
(
SELECT
bb.*
FROM
(
SELECT acc_id2, MAX(acc_grp_id1) AS maxgrpid
FROM tbl
GROUP BY acc_id2
) aa
INNER JOIN
tbl bb ON
... | This should work :
```
SELECT AC.*
FROM (
SELECT T.acc_id1,max(acc_grp_id1) maxacc_grp_id1
FROM tbl T
GROUP by t.acc_id1
) M
INNER JOIN tbl Last on Last.acc_id1=M.acc_id1
AND Last.acc_grp_id1=M.maxacc_grp_id1
INNER JOIN tbl AC on AC.acc_id1=M.acc_id1
and ((Last.acc_parameter1 =2 and Last.acc_parameter2=166)... |
26,503,862 | I have this jQuery that is displaying content when a div is clicked...
Link 1
Link 2
Link 3
Link 4
Link 5
```
<div class="content-container">
<div id="content1">This is the test content for part 1</div>
<div id="content2">This is the test content for part 2</div>
<div id="content3">This is the test c... | 2014/10/22 | [
"https://Stackoverflow.com/questions/26503862",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/779681/"
] | There are a few problems here, but firstly, you have not said in what way your code isn’t working. Perhaps we can help more if you provide more information.
I would not recommend using `NSData`’s `dataWithContentsOfURL:`. This method loads data synchronously (code execution in the current function stops until it finis... | In the else part you are just returning image location path. Here you need to pass image name with that path.
So your `else` part should be like this
```
else {
// Load the Image From The File But Update If Needed
NSLog(@"Loading Image From Cache");
// e.g Some image name
NSString *ima... |
13,647,644 | I would like to create a package using package maker that when installed adds the .app to the dock.I have tried the below code which works fine when executed from the terminal:-
```
Apples-MacBook-Pro-2:~ apple$ defaults write com.apple.dock persistent-apps -array-add "<dict><key>tile-data</key><dict><key>file-data</k... | 2012/11/30 | [
"https://Stackoverflow.com/questions/13647644",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1632189/"
] | You can use a tool known as "packages" it comes with pre installed script with an option of adding the software to dock.
[use the following link for packages](http://s.sudre.free.fr/Software/Packages/about.html) | You can perform any additional actions from the `postinstall` script of your package. All you need to do is to include a postinstall script (shell script in your case) and add the command you mentioned in your question.
This will be executed after all the files are installed in the system and your dock icon will get a... |
1,138,313 | I am stuck on this related rates question:
The relation between distance $s$ and velocity $v$ is given by $v=\dfrac {150s} {3+s}$. Find the acceleration in terms of s.
So far I have:
$$\dfrac {dv} {dt}=\dfrac {\left( 3+s\right) \dfrac {d} {dt}\left( 150s\right) -150s\dfrac {d} {d t}\left( 3+s\right) } {\left( 3+s\ri... | 2015/02/07 | [
"https://math.stackexchange.com/questions/1138313",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/30074/"
] | here is another way to do this. $$ v = \frac{150s}{3+s} = 150 - \frac{450}{s+3}$$
now use chain rule $$\frac{dv}{dt} = \frac{dv}{ds} \frac{ds}{dt} =
\frac{450}{(s+3)^2} v = \frac{450\*150s}{(s+3)^3}$$ | The relation between distance s and velocity v is given by v=150s/(3+s). Find the acceleration in terms of s.
In order to find acceleration, a = dv/dt
$$v = 150s/(3+s)$$
Using the Quotient Rule:
$$dv/dt = ((150s)'\*(3+s)-150s\*(3+s)')/(3+s)^2$$
$$dv/dt = (150s'\*(3+s)-150s\*(s)')/(3+s)^2$$
and s'=v so:
$$dv/dt = ... |
5,972 | There are lots of small / mid sized software companies and there are lot of small / mid sized projects in this world.
The project management techniques we read in books are best suited for bigger projects. As we can not spend much time in PM related stuff that much, what technique best suits small / mid sized projects... | 2012/06/15 | [
"https://pm.stackexchange.com/questions/5972",
"https://pm.stackexchange.com",
"https://pm.stackexchange.com/users/4116/"
] | "The project management techniques we read in books [sic] are best suited for bigger projects." I think you made an erroneous conclusion here. The PM techniques are size and industry agnostic. What you seem to be missing is the tailoring of these techniques to fit the project and the environment in which you are workin... | All successful projects comply with a relatively short list of principles/themes:
1. Does the project make sense from a business point of view? If no then the project should be terminated.
2. Are team roles and responsibilities clearly defined? If no then confusion will ensue.
3. Are plans in place that are feasible, ... |
5,972 | There are lots of small / mid sized software companies and there are lot of small / mid sized projects in this world.
The project management techniques we read in books are best suited for bigger projects. As we can not spend much time in PM related stuff that much, what technique best suits small / mid sized projects... | 2012/06/15 | [
"https://pm.stackexchange.com/questions/5972",
"https://pm.stackexchange.com",
"https://pm.stackexchange.com/users/4116/"
] | "The project management techniques we read in books [sic] are best suited for bigger projects." I think you made an erroneous conclusion here. The PM techniques are size and industry agnostic. What you seem to be missing is the tailoring of these techniques to fit the project and the environment in which you are workin... | Project management really boils down to a few simple concepts.
Decide what needs to be done (scope).
How much do we have to spend (cost).
When does it have to be done by (schedule).
Anything beyond this is defined by your individual project.
Estimating, risk management, change control; all of it is dependent on y... |
5,972 | There are lots of small / mid sized software companies and there are lot of small / mid sized projects in this world.
The project management techniques we read in books are best suited for bigger projects. As we can not spend much time in PM related stuff that much, what technique best suits small / mid sized projects... | 2012/06/15 | [
"https://pm.stackexchange.com/questions/5972",
"https://pm.stackexchange.com",
"https://pm.stackexchange.com/users/4116/"
] | All successful projects comply with a relatively short list of principles/themes:
1. Does the project make sense from a business point of view? If no then the project should be terminated.
2. Are team roles and responsibilities clearly defined? If no then confusion will ensue.
3. Are plans in place that are feasible, ... | Project management really boils down to a few simple concepts.
Decide what needs to be done (scope).
How much do we have to spend (cost).
When does it have to be done by (schedule).
Anything beyond this is defined by your individual project.
Estimating, risk management, change control; all of it is dependent on y... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.