qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
26,812 | ЕГЭ говорит, что суффиксальным.
Объясните, пожалуйста, от какого слова оно образовано и как?
Спасибо. | 2013/11/30 | [
"https://rus.stackexchange.com/questions/26812",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/665/"
] | Глагол *заканчивать* образован от глагола *закончить* суффиксальным способом (суффикс -ива-) | Если мы имеем видовую пару глаголов, то один глагол образуется от другого.
Закончить (сов.) - заканчивать (несов.) - это регулярное образование в языке с характерными особенностями: чередование О/А в корне и отсечение глагольного суффикса.
Чтобы не ошибиться при определении главного (мотивирующего) слова для видово... |
26,812 | ЕГЭ говорит, что суффиксальным.
Объясните, пожалуйста, от какого слова оно образовано и как?
Спасибо. | 2013/11/30 | [
"https://rus.stackexchange.com/questions/26812",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/665/"
] | Словообразовательный разбор начинают с определения лексического значения слова. На экзамене словарей нет, поэтому придётся определять "своими словами".
"Заканчивать" -- то же самое, что и "закончить".Только процесс ещё не завершён,поэтому глагол "заканчивать" несовершенного вида.
Строим цепочку: закончить--и-- + ива = ... | Заканчивать. Вот его строение: За - канч -ива- ть (несовершенный вид)
за-кон-чить (совершенный вид) происходит чередование А-О в корне. Образовано слово от кончить - при помощи приставки ЗА- и суффикса -ИВА- (ТЬ -окончание) |
26,812 | ЕГЭ говорит, что суффиксальным.
Объясните, пожалуйста, от какого слова оно образовано и как?
Спасибо. | 2013/11/30 | [
"https://rus.stackexchange.com/questions/26812",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/665/"
] | Да, Лорана и Янна дали правильные ответы. Слово "заканчивать" образуется суффиксальным способом от слова "закончить"
Чтобы обосновать, надо обратиться к понятию видовой пары. Вот что сказано в с словаре лингвистических терминов.
**"видовая пара**
**Пара, образуемая глаголом несовершенного вида и глаголом совершенног... | Заканчивать. Вот его строение: За - канч -ива- ть (несовершенный вид)
за-кон-чить (совершенный вид) происходит чередование А-О в корне. Образовано слово от кончить - при помощи приставки ЗА- и суффикса -ИВА- (ТЬ -окончание) |
26,812 | ЕГЭ говорит, что суффиксальным.
Объясните, пожалуйста, от какого слова оно образовано и как?
Спасибо. | 2013/11/30 | [
"https://rus.stackexchange.com/questions/26812",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/665/"
] | Если мы имеем видовую пару глаголов, то один глагол образуется от другого.
Закончить (сов.) - заканчивать (несов.) - это регулярное образование в языке с характерными особенностями: чередование О/А в корне и отсечение глагольного суффикса.
Чтобы не ошибиться при определении главного (мотивирующего) слова для видово... | Заканчивать. Вот его строение: За - канч -ива- ть (несовершенный вид)
за-кон-чить (совершенный вид) происходит чередование А-О в корне. Образовано слово от кончить - при помощи приставки ЗА- и суффикса -ИВА- (ТЬ -окончание) |
26,812 | ЕГЭ говорит, что суффиксальным.
Объясните, пожалуйста, от какого слова оно образовано и как?
Спасибо. | 2013/11/30 | [
"https://rus.stackexchange.com/questions/26812",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/665/"
] | Да, Лорана и Янна дали правильные ответы. Слово "заканчивать" образуется суффиксальным способом от слова "закончить"
Чтобы обосновать, надо обратиться к понятию видовой пары. Вот что сказано в с словаре лингвистических терминов.
**"видовая пара**
**Пара, образуемая глаголом несовершенного вида и глаголом совершенног... | Словообразовательный разбор начинают с определения лексического значения слова. На экзамене словарей нет, поэтому придётся определять "своими словами".
"Заканчивать" -- то же самое, что и "закончить".Только процесс ещё не завершён,поэтому глагол "заканчивать" несовершенного вида.
Строим цепочку: закончить--и-- + ива = ... |
26,812 | ЕГЭ говорит, что суффиксальным.
Объясните, пожалуйста, от какого слова оно образовано и как?
Спасибо. | 2013/11/30 | [
"https://rus.stackexchange.com/questions/26812",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/665/"
] | Словообразовательный разбор начинают с определения лексического значения слова. На экзамене словарей нет, поэтому придётся определять "своими словами".
"Заканчивать" -- то же самое, что и "закончить".Только процесс ещё не завершён,поэтому глагол "заканчивать" несовершенного вида.
Строим цепочку: закончить--и-- + ива = ... | Если мы имеем видовую пару глаголов, то один глагол образуется от другого.
Закончить (сов.) - заканчивать (несов.) - это регулярное образование в языке с характерными особенностями: чередование О/А в корне и отсечение глагольного суффикса.
Чтобы не ошибиться при определении главного (мотивирующего) слова для видово... |
26,812 | ЕГЭ говорит, что суффиксальным.
Объясните, пожалуйста, от какого слова оно образовано и как?
Спасибо. | 2013/11/30 | [
"https://rus.stackexchange.com/questions/26812",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/665/"
] | Да, Лорана и Янна дали правильные ответы. Слово "заканчивать" образуется суффиксальным способом от слова "закончить"
Чтобы обосновать, надо обратиться к понятию видовой пары. Вот что сказано в с словаре лингвистических терминов.
**"видовая пара**
**Пара, образуемая глаголом несовершенного вида и глаголом совершенног... | Если мы имеем видовую пару глаголов, то один глагол образуется от другого.
Закончить (сов.) - заканчивать (несов.) - это регулярное образование в языке с характерными особенностями: чередование О/А в корне и отсечение глагольного суффикса.
Чтобы не ошибиться при определении главного (мотивирующего) слова для видово... |
534,590 | I'm currently a first year grad student in an applied math program. I really love modeling, but everything in my modeling course is flying way over my head. Where can I look for a decent introduction to this subject? We didn't offer the course in my undergrad school, so I'm kind of trying to learn on the fly. | 2013/10/21 | [
"https://math.stackexchange.com/questions/534590",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/102323/"
] | Let us put $1200=a$ as @DepeHb suggested so we have:
$$\int\_0^a\int\_0^{a-x}(1/a^2)e^{-x/a}e^{-y/a}dydx=(1/a^2)\int\_0^ae^{-x/a}dx\int\_0^{a-x}e^{-y/a}dy\\=(1/a^2)\int\_0^ae^{-x/a}dx[-ae^{-y/a}]\_0^{a-x}=(-1/a)\int\_0^ae^{-x/a}(1-e^{x/a-1})dx\\=(-1/a)(ae^{-x/a}+xe^{-1})\_0^a=1-2e^{-1}$$ | I think you made a mistake in the first integration step : only "y" varies from 0 to 1200-x. What Wolfram Alpha gives is correct. |
50,212,497 | When I do:
```
apartments = Apartment.where(apart_params).delete_if{|x| x.floor == x.max_floor }
```
Ruby's array method `delete_if` on Active record Relation object results in
```
NoMethodError (undefined method `delete_if' for #<Apartment::ActiveRecord_Relation:0x00000006d84ea0>
Did you mean? delete
... | 2018/05/07 | [
"https://Stackoverflow.com/questions/50212497",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6162996/"
] | The relation can be converted to an array and then `delete_if` can be called:
```
Apartment.where(apart_params).to_a.delete_if {|x| x.floor == x.max_floor }
```
About a smarter way, it depends if the `floor` and `max_floor` methods are columns. If so, then:
```
Apartment.where(apart_params).where.not("floor = max_f... | Even if the `Apartment.where(apart_params)` looks like a Array object, it isn't! As the error says, it returns a ActiveRecordRelation, that is not a Array. So, if you want to use array methods on a ActiveRecordRelation, you have to convert your object to a array with `to_a`
```
apartments = Apartment.where(apart_param... |
50,212,497 | When I do:
```
apartments = Apartment.where(apart_params).delete_if{|x| x.floor == x.max_floor }
```
Ruby's array method `delete_if` on Active record Relation object results in
```
NoMethodError (undefined method `delete_if' for #<Apartment::ActiveRecord_Relation:0x00000006d84ea0>
Did you mean? delete
... | 2018/05/07 | [
"https://Stackoverflow.com/questions/50212497",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6162996/"
] | The relation can be converted to an array and then `delete_if` can be called:
```
Apartment.where(apart_params).to_a.delete_if {|x| x.floor == x.max_floor }
```
About a smarter way, it depends if the `floor` and `max_floor` methods are columns. If so, then:
```
Apartment.where(apart_params).where.not("floor = max_f... | I would suggest switching your `apartments` assignment to the following:
`apartments = Apartment.where(apart_params).map{|x| x.floor == x.max_floor ? x.delete : x }` |
29,788,205 | I use this library <https://github.com/jdamcd/android-crop> to crop image but i have a problem with the preview which is too small.i have this result:
<http://i.stack.imgur.com/FxVKA.png>
How to fix this ? i used a samsung galaxy s4 and a samsung tab 3, and i also used other crop library but same problem.
Here is al... | 2015/04/22 | [
"https://Stackoverflow.com/questions/29788205",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3424349/"
] | I recommend another Image Crop library.
<https://github.com/naver/android-imagecropview>
please try this :) | If anyone is still stucked with this problem, here is the solution. The reason, why you are getting a small preview in the android-crop library, is that you are trying to work with a thumbnail of image, which you extract like `intent.getData()`. Don't do this, create a new empty file and set it's Uri in intent's extra ... |
15,512,427 | I have the task of 'wiring up' an input box and a submit button on a web page to allow a user to enter their own message. I am new to programming and was curious as to what the 'wiring up' part in JQuery means. Any advice or examples will help. Thanks in advanced! | 2013/03/19 | [
"https://Stackoverflow.com/questions/15512427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2097966/"
] | After some time of searching and few personal attempts I have found a solution, this isn't my own, but sadly I have forgot where did I took it from:
```
private static Image cropImage(Image img, Rectangle cropArea)
{
Bitmap bmpImage = new Bitmap(img);
Bitmap bmpCrop = bmpImage.Clone(cropArea,
... | Thank you for your good answer.
It is better to p.Image:
```
P.Image = cropImage(ImageThatBeCropped, new Rectangle(0, 0, 50,50));
```
To see image in real size. |
14,963,335 | I am getting a EXEC\_BAD\_ACCESS Error when I attempt to run this code, and the user has not allowed access to the calendar. Does requestAccessToEntityType run on a separate thread, if thats the case how do I access the main thread to display the UIAlertView?
```
EKEventStore *store = [[EKEventStore alloc] init];
if (... | 2013/02/19 | [
"https://Stackoverflow.com/questions/14963335",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1011055/"
] | According to the [docs for requestAccessToEntityType](http://developer.apple.com/library/ios/#documentation/EventKit/Reference/EKEventStoreClassRef/Reference/Reference.html)
>
> When the user taps to grant or deny access, the completion handler
> will be called on an arbitrary queue.
>
>
>
So, yes, it could be o... | Reason why your app is crashing because you are trying to deal with your GUI elements i.e UIAlertView in background thread, you need to run it on the main thread or try to use dispatch queues
Using Dispatch Queues
```
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul);
dispatch... |
75,763 | Like in my [fifth](https://puzzling.stackexchange.com/questions/75512/anime-guess-riddle-5) part, I'm searching for the name of an anime. There is no knowledge about this anime needed to solve it, but it helps! I hope you have fun :)
This time I made a rebus riddle:
[ for "Online"
>
>
>
I may be wrong about how I reached the second ... | Alright, well let's just throw one out there to get the ball rolling:
>
> Dragon Ball Super
>
>
>
Thoughts: (slight potential spoilers. Be warned)
>
> 1. S + makes me think of super
>
> 2. abc combinations: Iterations of dragon ball have used letters to denote series differences (z, gt)
>
> 3. combina... |
2,869,746 | I have a custom dll (not registered) that I need to access via c#. How do I do this without registering the DLL?
Edit: It is a C++ dll. | 2010/05/19 | [
"https://Stackoverflow.com/questions/2869746",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/99999/"
] | See [Registration-Free COM Interop](http://msdn.microsoft.com/en-us/library/fh1h056h.aspx):
>
> Registration-free COM interop
> activates a component without using
> the Windows registry to store assembly
> information. Instead of registering a
> component on a computer during
> deployment, you create Win32-styl... | I assume you want to use the functions exported from this dll via P/Invoke? If so, you only need to copy the dll to the same folder as your exe file. Then write C# declarations for the functions in the C++ dll that you want to use. See [DllImportAttribute](http://msdn.microsoft.com/en-us/library/system.runtime.interops... |
49,699,326 | I am working on julia set in java. Following is my code:
```
public class ColorJulia {
// return number of iterations to check z is in the Julia set of c
static int julia(Complex c, Complex z, int maximumIterations) {
for (int t = 0; t < maximumIterations; t++) {
if (z.abs() > 2.0) return t;
z = z... | 2018/04/06 | [
"https://Stackoverflow.com/questions/49699326",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7649001/"
] | **First of all**, creating a new `MaybeBuilder` every time you need it is kinda wasteful. You should do that once, preferably right next to the definition of `MaybeBuilder` itself, and then just use the same instance everywhere. This is how most computation builders work.
**Second:** you can cut down on the amount of ... | I understand this might be just a simplification for the purpose of asking the question here - but what do you actually want to do when none of the keys is found and how often do you expect that the first lookup will fails?
There are good reasons to avoid exceptions in F# - they are slower (I don't know how much exact... |
17,252 | Carsim proposed an architecture where a system takes a natural language description, converts it into a formal description and instantiates corresponding scene elements. This was done in 2002, before Microsoft issued this patent.
Reference: <http://doc.utwente.nl/36659/1/00000051.pdf>
Let alone that Stanford's Wordsey... | 2017/02/17 | [
"https://patents.stackexchange.com/questions/17252",
"https://patents.stackexchange.com",
"https://patents.stackexchange.com/users/18515/"
] | The patent has been issued with narrowed claims:
<https://www.google.ch/patents/US7512537?hl=de>
The examination went through some steps and prior art was considered.
You can find the docket here:
<https://register.epo.org/ipfwretrieve?apn=US.8688005.A&lng=en>
The documents named (non)-final rejection and the resp... | The cited Microsoft document is a patent application, not yet a patent. Applications are often written with broad claims that get narrowed as the patent is prosecuted. You should review this question and answer to understand better the patent process: [Is this patent valid? Granted? Which countries does it cover? Are t... |
43,244,205 | How can I do a select, filter and agg all in one statement...(pieces below)
```
df = df.loc[df['Gender'] == ('M'),['Name','Gender','Weight']]
df = df.groupby(['Name','Gender']).agg({'Weight': np.sum})
``` | 2017/04/06 | [
"https://Stackoverflow.com/questions/43244205",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7823861/"
] | The meaning of LSP is very simple: Subtype must not act in a way that violates its supertype behavior. That "supertype" behavior is based on design definitions, but in general, it just means that one can continue using that object as if it was the supertype anywhere in the project.
So, in your case, it should obey to ... | No, the JavaScript event system does not violate the Liskov Substitution Principle (LSP).
Put simply the LSP imposes the following constraint "objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program"
In the specific example of the JavaScript event s... |
43,244,205 | How can I do a select, filter and agg all in one statement...(pieces below)
```
df = df.loc[df['Gender'] == ('M'),['Name','Gender','Weight']]
df = df.groupby(['Name','Gender']).agg({'Weight': np.sum})
``` | 2017/04/06 | [
"https://Stackoverflow.com/questions/43244205",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7823861/"
] | No, the JavaScript event system does not violate the Liskov Substitution Principle (LSP).
Put simply the LSP imposes the following constraint "objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program"
In the specific example of the JavaScript event s... | In this case, JavaScript and the browser event API do not *violate* the Liskov Substitution Principle, but neither do they make an effort to *enforce* it.
Languages like Java and C# attempt to prevent the programmer from violating the LSP by requiring values to be cast as a given type, or as its sub-type, in order fo... |
43,244,205 | How can I do a select, filter and agg all in one statement...(pieces below)
```
df = df.loc[df['Gender'] == ('M'),['Name','Gender','Weight']]
df = df.groupby(['Name','Gender']).agg({'Weight': np.sum})
``` | 2017/04/06 | [
"https://Stackoverflow.com/questions/43244205",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7823861/"
] | The meaning of LSP is very simple: Subtype must not act in a way that violates its supertype behavior. That "supertype" behavior is based on design definitions, but in general, it just means that one can continue using that object as if it was the supertype anywhere in the project.
So, in your case, it should obey to ... | In this case, JavaScript and the browser event API do not *violate* the Liskov Substitution Principle, but neither do they make an effort to *enforce* it.
Languages like Java and C# attempt to prevent the programmer from violating the LSP by requiring values to be cast as a given type, or as its sub-type, in order fo... |
758,584 | **The Problem:** The task manager dropdown menus are all transparent and not readable at all. The same goes for all the dropdown menus of libre office. I have tried to change the desktop theme but the transparency kept on appearing on all those menus hindering me from reading them. Disabling all the effects of the desk... | 2016/04/18 | [
"https://askubuntu.com/questions/758584",
"https://askubuntu.com",
"https://askubuntu.com/users/529048/"
] | Head to
```
System Settings > Workspace Theme > Desktop Theme > Theme
```
Choose style you like, `Oxygen` seems to be darkest
[](https://i.stack.imgur.com/L8nQK.png) | In my case it was the Application Colour Scheme in: `Settings` -> `Appearance` -> `Colour`.
Change the Theme with a Darker one and see how it goes. My menus were white and my theme dark so no menus were visible when I click on a drop-down menu.
[](h... |
51,372,269 | I have in my parent component, where I want to detect the emitted event.
child.component.ts
```
@Component({
selector: 'child-component',
templateUrl: './child.component.html',
styleUrls: ['./child.component.scss']
})
export class ChildComponent implements OnInit {
@Input() public state: String =... | 2018/07/17 | [
"https://Stackoverflow.com/questions/51372269",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2251652/"
] | `<router-outlet></router-outlet>` considered to be a `placeholder` with the purpose of adding `routed components`. It does not have support to any kind of bindings.
But there is an update to `<router-outlet></router-outlet>` with an event that allows getting added component : [Source](https://stackoverflow.com/a/37662... | No you cannot have event Emitter on **`router-outlet`**.
I would suggest you to have your own componnet with input property and use the even on that
`<list [list]="list" (onStateChanged)="stateChanged($event)"></list>` |
20,045,657 | This is a very basic javascript question:
after defining a function:
```
function a(){
alert("A!");
return function(){
alert("B!")
};
}
```
If i call the function:
```
a();
```
Only "A!" is alert;
But if i recreate a new function:
```
var newFunc = a();
newFunc();
```
Both "A!" and "B!" ar... | 2013/11/18 | [
"https://Stackoverflow.com/questions/20045657",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2988464/"
] | It's quite simple:
```
function a()
{
alert("A!");
return function()
{
alert("B!");
};
}
a();
```
In this case, you invoke `a`, and its function body alerts `A!`, and then *returns* a function. The return value (the function that alserts B) is simply ignored.
When you write
```
var newF = a... | It should be fairly obvious.
The return value of the function is not executed, but rather returned. Anything before the return statement will of course be executed.
So essentially, the code: `var newFunc = a();` assigns the return value of the function `a()` (in this case an anonymous function) to `newFunc`. Thus, ca... |
20,045,657 | This is a very basic javascript question:
after defining a function:
```
function a(){
alert("A!");
return function(){
alert("B!")
};
}
```
If i call the function:
```
a();
```
Only "A!" is alert;
But if i recreate a new function:
```
var newFunc = a();
newFunc();
```
Both "A!" and "B!" ar... | 2013/11/18 | [
"https://Stackoverflow.com/questions/20045657",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2988464/"
] | It's quite simple:
```
function a()
{
alert("A!");
return function()
{
alert("B!");
};
}
a();
```
In this case, you invoke `a`, and its function body alerts `A!`, and then *returns* a function. The return value (the function that alserts B) is simply ignored.
When you write
```
var newF = a... | when you do:
```
var newFunc = a();
```
function a execute,so "A!" alerted, and function a return value assign to variable newFunc:
`newfunc = function(){
alert("B!");
}`
so when you execute newfunc,"B!" alerted.
Reference:
[Functions that return a function - Javascript](https://stackoverflow.com/questions/7629... |
20,045,657 | This is a very basic javascript question:
after defining a function:
```
function a(){
alert("A!");
return function(){
alert("B!")
};
}
```
If i call the function:
```
a();
```
Only "A!" is alert;
But if i recreate a new function:
```
var newFunc = a();
newFunc();
```
Both "A!" and "B!" ar... | 2013/11/18 | [
"https://Stackoverflow.com/questions/20045657",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2988464/"
] | It's quite simple:
```
function a()
{
alert("A!");
return function()
{
alert("B!");
};
}
a();
```
In this case, you invoke `a`, and its function body alerts `A!`, and then *returns* a function. The return value (the function that alserts B) is simply ignored.
When you write
```
var newF = a... | The return value is just that -- a *return* value. It is not executed.
Try this for fun:
```
a = a();
a();
``` |
20,045,657 | This is a very basic javascript question:
after defining a function:
```
function a(){
alert("A!");
return function(){
alert("B!")
};
}
```
If i call the function:
```
a();
```
Only "A!" is alert;
But if i recreate a new function:
```
var newFunc = a();
newFunc();
```
Both "A!" and "B!" ar... | 2013/11/18 | [
"https://Stackoverflow.com/questions/20045657",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2988464/"
] | It's quite simple:
```
function a()
{
alert("A!");
return function()
{
alert("B!");
};
}
a();
```
In this case, you invoke `a`, and its function body alerts `A!`, and then *returns* a function. The return value (the function that alserts B) is simply ignored.
When you write
```
var newF = a... | In the first call a(); you are calling the function and it returns another function. But you do not call it.
In the second example, you call the function and store the return-value (the function it returns) in a variable, then call that, which will call the function that was returned.
```
function a() {
alert("A!... |
20,045,657 | This is a very basic javascript question:
after defining a function:
```
function a(){
alert("A!");
return function(){
alert("B!")
};
}
```
If i call the function:
```
a();
```
Only "A!" is alert;
But if i recreate a new function:
```
var newFunc = a();
newFunc();
```
Both "A!" and "B!" ar... | 2013/11/18 | [
"https://Stackoverflow.com/questions/20045657",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2988464/"
] | Calling the following will execute both alerts:
```
a()();
```
<http://jsfiddle.net/pKLNW/>
---
Your function, `a`, is being executed, and returning a function. But you are not executing that returned function.
In your second example, that's exactly what you are doing, but spread across two lines (hence why you h... | In the first call a(); you are calling the function and it returns another function. But you do not call it.
In the second example, you call the function and store the return-value (the function it returns) in a variable, then call that, which will call the function that was returned.
```
function a() {
alert("A!... |
20,045,657 | This is a very basic javascript question:
after defining a function:
```
function a(){
alert("A!");
return function(){
alert("B!")
};
}
```
If i call the function:
```
a();
```
Only "A!" is alert;
But if i recreate a new function:
```
var newFunc = a();
newFunc();
```
Both "A!" and "B!" ar... | 2013/11/18 | [
"https://Stackoverflow.com/questions/20045657",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2988464/"
] | Calling the following will execute both alerts:
```
a()();
```
<http://jsfiddle.net/pKLNW/>
---
Your function, `a`, is being executed, and returning a function. But you are not executing that returned function.
In your second example, that's exactly what you are doing, but spread across two lines (hence why you h... | When called, a does two things:
1. alerts 'A!'
2. creates a function that alerts 'B!' when called and also returns that function.
Your first example, `a()` is a call to `a`, so it alerts 'A!', creates a function that alerts 'B!' when called returns that function and discards it (because the returned value is not use... |
20,045,657 | This is a very basic javascript question:
after defining a function:
```
function a(){
alert("A!");
return function(){
alert("B!")
};
}
```
If i call the function:
```
a();
```
Only "A!" is alert;
But if i recreate a new function:
```
var newFunc = a();
newFunc();
```
Both "A!" and "B!" ar... | 2013/11/18 | [
"https://Stackoverflow.com/questions/20045657",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2988464/"
] | Calling the following will execute both alerts:
```
a()();
```
<http://jsfiddle.net/pKLNW/>
---
Your function, `a`, is being executed, and returning a function. But you are not executing that returned function.
In your second example, that's exactly what you are doing, but spread across two lines (hence why you h... | when you do:
```
var newFunc = a();
```
function a execute,so "A!" alerted, and function a return value assign to variable newFunc:
`newfunc = function(){
alert("B!");
}`
so when you execute newfunc,"B!" alerted.
Reference:
[Functions that return a function - Javascript](https://stackoverflow.com/questions/7629... |
20,045,657 | This is a very basic javascript question:
after defining a function:
```
function a(){
alert("A!");
return function(){
alert("B!")
};
}
```
If i call the function:
```
a();
```
Only "A!" is alert;
But if i recreate a new function:
```
var newFunc = a();
newFunc();
```
Both "A!" and "B!" ar... | 2013/11/18 | [
"https://Stackoverflow.com/questions/20045657",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2988464/"
] | It's quite simple:
```
function a()
{
alert("A!");
return function()
{
alert("B!");
};
}
a();
```
In this case, you invoke `a`, and its function body alerts `A!`, and then *returns* a function. The return value (the function that alserts B) is simply ignored.
When you write
```
var newF = a... | When called, a does two things:
1. alerts 'A!'
2. creates a function that alerts 'B!' when called and also returns that function.
Your first example, `a()` is a call to `a`, so it alerts 'A!', creates a function that alerts 'B!' when called returns that function and discards it (because the returned value is not use... |
20,045,657 | This is a very basic javascript question:
after defining a function:
```
function a(){
alert("A!");
return function(){
alert("B!")
};
}
```
If i call the function:
```
a();
```
Only "A!" is alert;
But if i recreate a new function:
```
var newFunc = a();
newFunc();
```
Both "A!" and "B!" ar... | 2013/11/18 | [
"https://Stackoverflow.com/questions/20045657",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2988464/"
] | Calling the following will execute both alerts:
```
a()();
```
<http://jsfiddle.net/pKLNW/>
---
Your function, `a`, is being executed, and returning a function. But you are not executing that returned function.
In your second example, that's exactly what you are doing, but spread across two lines (hence why you h... | The return value is just that -- a *return* value. It is not executed.
Try this for fun:
```
a = a();
a();
``` |
20,045,657 | This is a very basic javascript question:
after defining a function:
```
function a(){
alert("A!");
return function(){
alert("B!")
};
}
```
If i call the function:
```
a();
```
Only "A!" is alert;
But if i recreate a new function:
```
var newFunc = a();
newFunc();
```
Both "A!" and "B!" ar... | 2013/11/18 | [
"https://Stackoverflow.com/questions/20045657",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2988464/"
] | Calling the following will execute both alerts:
```
a()();
```
<http://jsfiddle.net/pKLNW/>
---
Your function, `a`, is being executed, and returning a function. But you are not executing that returned function.
In your second example, that's exactly what you are doing, but spread across two lines (hence why you h... | Your first example, `a()`, executes the `a` function, which executes an alert function and returns the function `b` (but does not execute it).
The second example, `var newFunc = a()`, executes `a`, and saves it's value to the variable `newFunc`, meaning it is now equal to `b`. Then you execute newFunc, and it alerts '... |
80,225 | Recently in Britain the Food Standards Agency issued advice that food items may be offered for sale labelled as "sunflower oil" (a product that has become scarcer owing to the Russo-Ukrainian war) which do not actually contain any sunflower oil
.
See for example [this notice](https://www.food.gov.uk/news-alerts/news/fs... | 2022/05/14 | [
"https://law.stackexchange.com/questions/80225",
"https://law.stackexchange.com",
"https://law.stackexchange.com/users/-1/"
] | Executive discretion
--------------------
In common law jurisdictions the executive has the prerogative to enforce or not enforce particular laws. The courts will not interfere provided that prerogative is executed for proper purposes.
It is that prerogative that allows governments to have a “blitz” on speeding or se... | **What statutory or prerogative authority is the FSA exercising when it allows such false labelling?**
The [Food Standards Act; 1,2](https://www.legislation.gov.uk/ukpga/1999/28#:%7E:text=The%20main%20objective,relation%20to%20food.) grants the Agency *the right to act in the public interest to protect consumers.*
> ... |
80,225 | Recently in Britain the Food Standards Agency issued advice that food items may be offered for sale labelled as "sunflower oil" (a product that has become scarcer owing to the Russo-Ukrainian war) which do not actually contain any sunflower oil
.
See for example [this notice](https://www.food.gov.uk/news-alerts/news/fs... | 2022/05/14 | [
"https://law.stackexchange.com/questions/80225",
"https://law.stackexchange.com",
"https://law.stackexchange.com/users/-1/"
] | >
> What statutory or prerogative authority is the FSA exercising when it allows such false labelling?
>
>
>
As other answers have noted, they have executive discretion to "turn a blind eye" to what would normally be a violation of food safety laws and just decide that, right now, their government-mandated priorit... | Executive discretion
--------------------
In common law jurisdictions the executive has the prerogative to enforce or not enforce particular laws. The courts will not interfere provided that prerogative is executed for proper purposes.
It is that prerogative that allows governments to have a “blitz” on speeding or se... |
80,225 | Recently in Britain the Food Standards Agency issued advice that food items may be offered for sale labelled as "sunflower oil" (a product that has become scarcer owing to the Russo-Ukrainian war) which do not actually contain any sunflower oil
.
See for example [this notice](https://www.food.gov.uk/news-alerts/news/fs... | 2022/05/14 | [
"https://law.stackexchange.com/questions/80225",
"https://law.stackexchange.com",
"https://law.stackexchange.com/users/-1/"
] | >
> What statutory or prerogative authority is the FSA exercising when it allows such false labelling?
>
>
>
As other answers have noted, they have executive discretion to "turn a blind eye" to what would normally be a violation of food safety laws and just decide that, right now, their government-mandated priorit... | **What statutory or prerogative authority is the FSA exercising when it allows such false labelling?**
The [Food Standards Act; 1,2](https://www.legislation.gov.uk/ukpga/1999/28#:%7E:text=The%20main%20objective,relation%20to%20food.) grants the Agency *the right to act in the public interest to protect consumers.*
> ... |
37,865,777 | I have table name `nybruker_trheim` it have lot of fields but right now i am dealing with 2 fields which are `brukergr` and `sperret` the data in these fields looks like this
```
brukergr sperret
S1 Nei
S2 Nei
S1 je
S3 Nei
S4 Nei
S5 je
S5 je
S4 Nei
S3 ... | 2016/06/16 | [
"https://Stackoverflow.com/questions/37865777",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6475890/"
] | There are coding style rules such as to restrict variables' scope and lifetime to their usage. Another one is to declare variable closest to its usage.
The most idiomatic form of the `for` loop would be:
```
for (int i = 0; i < 10; i++) // do something
```
Using the:
```
for(in=0; in<10; in++) // do something... | You can reuse it if you really want to but you are not saving much for a simple variables (you save same space on the stack).
For maintenance purposes all variables (as wells as functions and structures) should have a meaningful names. |
37,865,777 | I have table name `nybruker_trheim` it have lot of fields but right now i am dealing with 2 fields which are `brukergr` and `sperret` the data in these fields looks like this
```
brukergr sperret
S1 Nei
S2 Nei
S1 je
S3 Nei
S4 Nei
S5 je
S5 je
S4 Nei
S3 ... | 2016/06/16 | [
"https://Stackoverflow.com/questions/37865777",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6475890/"
] | There are coding style rules such as to restrict variables' scope and lifetime to their usage. Another one is to declare variable closest to its usage.
The most idiomatic form of the `for` loop would be:
```
for (int i = 0; i < 10; i++) // do something
```
Using the:
```
for(in=0; in<10; in++) // do something... | I'm assuming that the reason you would want to do this would be for efficiency. You may think that by reusing variables, you are avoid extra unnecessary memory allocations and technically you would be right. The above code you provided would work fine however reusing declared variables to store unrelated data is genera... |
37,865,777 | I have table name `nybruker_trheim` it have lot of fields but right now i am dealing with 2 fields which are `brukergr` and `sperret` the data in these fields looks like this
```
brukergr sperret
S1 Nei
S2 Nei
S1 je
S3 Nei
S4 Nei
S5 je
S5 je
S4 Nei
S3 ... | 2016/06/16 | [
"https://Stackoverflow.com/questions/37865777",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6475890/"
] | There are coding style rules such as to restrict variables' scope and lifetime to their usage. Another one is to declare variable closest to its usage.
The most idiomatic form of the `for` loop would be:
```
for (int i = 0; i < 10; i++) // do something
```
Using the:
```
for(in=0; in<10; in++) // do something... | This depends on variable name. When both pieces of code performs similar operation and variable name is still good, you can reuse it (as long as you make sure code is still correct). But if variable was used for completely different purpose, this will make code much harder to read. So for example this is acceptable:
`... |
37,865,777 | I have table name `nybruker_trheim` it have lot of fields but right now i am dealing with 2 fields which are `brukergr` and `sperret` the data in these fields looks like this
```
brukergr sperret
S1 Nei
S2 Nei
S1 je
S3 Nei
S4 Nei
S5 je
S5 je
S4 Nei
S3 ... | 2016/06/16 | [
"https://Stackoverflow.com/questions/37865777",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6475890/"
] | There are coding style rules such as to restrict variables' scope and lifetime to their usage. Another one is to declare variable closest to its usage.
The most idiomatic form of the `for` loop would be:
```
for (int i = 0; i < 10; i++) // do something
```
Using the:
```
for(in=0; in<10; in++) // do something... | This depend, as always, on the performance, size and maintenance/readability of your code.
In most case you probably need maintenance and readability so you keep your code clear with explicit variable name and don't reuse them to avoid confusion.
In time critical code and/or on low resource system you probably want to... |
37,865,777 | I have table name `nybruker_trheim` it have lot of fields but right now i am dealing with 2 fields which are `brukergr` and `sperret` the data in these fields looks like this
```
brukergr sperret
S1 Nei
S2 Nei
S1 je
S3 Nei
S4 Nei
S5 je
S5 je
S4 Nei
S3 ... | 2016/06/16 | [
"https://Stackoverflow.com/questions/37865777",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6475890/"
] | I'm assuming that the reason you would want to do this would be for efficiency. You may think that by reusing variables, you are avoid extra unnecessary memory allocations and technically you would be right. The above code you provided would work fine however reusing declared variables to store unrelated data is genera... | You can reuse it if you really want to but you are not saving much for a simple variables (you save same space on the stack).
For maintenance purposes all variables (as wells as functions and structures) should have a meaningful names. |
37,865,777 | I have table name `nybruker_trheim` it have lot of fields but right now i am dealing with 2 fields which are `brukergr` and `sperret` the data in these fields looks like this
```
brukergr sperret
S1 Nei
S2 Nei
S1 je
S3 Nei
S4 Nei
S5 je
S5 je
S4 Nei
S3 ... | 2016/06/16 | [
"https://Stackoverflow.com/questions/37865777",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6475890/"
] | I'm assuming that the reason you would want to do this would be for efficiency. You may think that by reusing variables, you are avoid extra unnecessary memory allocations and technically you would be right. The above code you provided would work fine however reusing declared variables to store unrelated data is genera... | This depends on variable name. When both pieces of code performs similar operation and variable name is still good, you can reuse it (as long as you make sure code is still correct). But if variable was used for completely different purpose, this will make code much harder to read. So for example this is acceptable:
`... |
37,865,777 | I have table name `nybruker_trheim` it have lot of fields but right now i am dealing with 2 fields which are `brukergr` and `sperret` the data in these fields looks like this
```
brukergr sperret
S1 Nei
S2 Nei
S1 je
S3 Nei
S4 Nei
S5 je
S5 je
S4 Nei
S3 ... | 2016/06/16 | [
"https://Stackoverflow.com/questions/37865777",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6475890/"
] | I'm assuming that the reason you would want to do this would be for efficiency. You may think that by reusing variables, you are avoid extra unnecessary memory allocations and technically you would be right. The above code you provided would work fine however reusing declared variables to store unrelated data is genera... | This depend, as always, on the performance, size and maintenance/readability of your code.
In most case you probably need maintenance and readability so you keep your code clear with explicit variable name and don't reuse them to avoid confusion.
In time critical code and/or on low resource system you probably want to... |
6,011,408 | I'm using jQuery to automatically fetch the most recent post on a blog. jQuery.get() goes to the blog's RSS feed and returns the most recent post:
Here's what I'm using:
```
$.get('http://url.to/feed', function(feed) {data = $(feed).find('item:first').text(); $('#testbox').html(data);}, 'xml');
```
Here's the probl... | 2011/05/15 | [
"https://Stackoverflow.com/questions/6011408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/515160/"
] | Hum... Take a look if your content can't just be wrapped with `< (I know, CDATA abuse and everything, but OP don't want to parse the XML at all, just append it directly to the DOM).
**... | Try returning the node, and not the text...
```
$.get('http://url.to/feed', function(feed) {
data = $(feed).find('item:first');
$('#testbox').html(data);
}, 'xml');
``` |
6,011,408 | I'm using jQuery to automatically fetch the most recent post on a blog. jQuery.get() goes to the blog's RSS feed and returns the most recent post:
Here's what I'm using:
```
$.get('http://url.to/feed', function(feed) {data = $(feed).find('item:first').text(); $('#testbox').html(data);}, 'xml');
```
Here's the probl... | 2011/05/15 | [
"https://Stackoverflow.com/questions/6011408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/515160/"
] | If you append it, it works.
```
$(feed).find('item:first > *').appendTo('#testbox');
``` | Try returning the node, and not the text...
```
$.get('http://url.to/feed', function(feed) {
data = $(feed).find('item:first');
$('#testbox').html(data);
}, 'xml');
``` |
6,011,408 | I'm using jQuery to automatically fetch the most recent post on a blog. jQuery.get() goes to the blog's RSS feed and returns the most recent post:
Here's what I'm using:
```
$.get('http://url.to/feed', function(feed) {data = $(feed).find('item:first').text(); $('#testbox').html(data);}, 'xml');
```
Here's the probl... | 2011/05/15 | [
"https://Stackoverflow.com/questions/6011408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/515160/"
] | Try returning the node, and not the text...
```
$.get('http://url.to/feed', function(feed) {
data = $(feed).find('item:first');
$('#testbox').html(data);
}, 'xml');
``` | How about trying something like this (It worked for me)...
Create a PHP file (get\_xml.php) with the following:
```
$xml = file_get_contents($_GET['url']);
header("Content-Type: text/xml");
echo $xml;
```
Then use the following jQuery:
```
$.get("get_xml.php",{url:'http://url.to/feed/'}, function(data){
... |
6,011,408 | I'm using jQuery to automatically fetch the most recent post on a blog. jQuery.get() goes to the blog's RSS feed and returns the most recent post:
Here's what I'm using:
```
$.get('http://url.to/feed', function(feed) {data = $(feed).find('item:first').text(); $('#testbox').html(data);}, 'xml');
```
Here's the probl... | 2011/05/15 | [
"https://Stackoverflow.com/questions/6011408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/515160/"
] | Hum... Take a look if your content can't just be wrapped with `< (I know, CDATA abuse and everything, but OP don't want to parse the XML at all, just append it directly to the DOM).
**... | If you append it, it works.
```
$(feed).find('item:first > *').appendTo('#testbox');
``` |
6,011,408 | I'm using jQuery to automatically fetch the most recent post on a blog. jQuery.get() goes to the blog's RSS feed and returns the most recent post:
Here's what I'm using:
```
$.get('http://url.to/feed', function(feed) {data = $(feed).find('item:first').text(); $('#testbox').html(data);}, 'xml');
```
Here's the probl... | 2011/05/15 | [
"https://Stackoverflow.com/questions/6011408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/515160/"
] | Hum... Take a look if your content can't just be wrapped with `< (I know, CDATA abuse and everything, but OP don't want to parse the XML at all, just append it directly to the DOM).
**... | How about trying something like this (It worked for me)...
Create a PHP file (get\_xml.php) with the following:
```
$xml = file_get_contents($_GET['url']);
header("Content-Type: text/xml");
echo $xml;
```
Then use the following jQuery:
```
$.get("get_xml.php",{url:'http://url.to/feed/'}, function(data){
... |
6,011,408 | I'm using jQuery to automatically fetch the most recent post on a blog. jQuery.get() goes to the blog's RSS feed and returns the most recent post:
Here's what I'm using:
```
$.get('http://url.to/feed', function(feed) {data = $(feed).find('item:first').text(); $('#testbox').html(data);}, 'xml');
```
Here's the probl... | 2011/05/15 | [
"https://Stackoverflow.com/questions/6011408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/515160/"
] | If you append it, it works.
```
$(feed).find('item:first > *').appendTo('#testbox');
``` | How about trying something like this (It worked for me)...
Create a PHP file (get\_xml.php) with the following:
```
$xml = file_get_contents($_GET['url']);
header("Content-Type: text/xml");
echo $xml;
```
Then use the following jQuery:
```
$.get("get_xml.php",{url:'http://url.to/feed/'}, function(data){
... |
43,844,232 | I've got NullPointerException during deployment on of .ear on JBoss. Have you got any idea how to fix this?
```
10:57:06,308 ERROR [fail] MSC000001: Failed to start service jboss.deployment.unit."XXX.ear".DEPENDENCIES: org.jboss.msc.service.StartException in service jboss.deployment.unit."XXX.ear".DEPENDENCIES: JBAS01... | 2017/05/08 | [
"https://Stackoverflow.com/questions/43844232",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2751391/"
] | There was an issue with JaxrsSpringProcessor, <https://issues.jboss.org/browse/WFLY-4075>. It is fixed on Wildfly 9. There's a reproducer application attachment on the link. | My application is only Spring, I don't need to use resteasy and deploy to jboss eap 6.3. Exclude resteasy using the jboss-deployment-structure.xml file. For me solved.
```
<jboss-deployment-structure>
<deployment
<exclude-subsystems>
<subsystem name="jaxrs" />
</excl... |
48,063,038 | I think the most easiest way is to extract the raster values within each polygon and calculate the proportion. Is it possible to do so without reading the entire grid as an array?
---
I have 23 yearly global classified raster (resolution = 0.00277778 degree) from 1992 - 2015 and a polygon vector with 354 shapes (whic... | 2018/01/02 | [
"https://Stackoverflow.com/questions/48063038",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8944845/"
] | I have managed to do it with Python "rasterio" and "geopandas"
It now creates a table like:
[example result](https://i.stack.imgur.com/qwOe0.jpg)
since i did not found something similar like the extract comand in R "raster" it took more than only 2 lines but instead of calculating half the night it now takes only 2 m... | I can do it with the R command extract and summaries it with table as explained by "Spacedman" see: <https://gis.stackexchange.com/questions/23614/get-raster-values-from-a-polygon-overlay-in-opensource-gis-solutions>
```
shapes <- readOGR("C://data/.../shape)
LClass_1992 <- raster("C://.../LClass_1992.tif")
value_list... |
73,534,184 | I want to use "#ifdef MYFLAG" in my C code to exclude certain code parts when the keyword "MYFLAG" is passed to the compiler. So far so good. The project is compiled with a makefile.
Now, I can't figure out yet if it is correct to write
$ ./project/ make -MYFLAG
and then set the #ifdef as true. It compiles the files... | 2022/08/29 | [
"https://Stackoverflow.com/questions/73534184",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15513157/"
] | There is a neat function in the data.table package called dcast( ) that allows you to transform your data from long to wide. In this case, you can use the Period variable to create 2 new columns, Period 1 and Period 2, where the values are the Grades.
```
library(data.table)
> data <- data.table(
+ Team = c("Team 1... | In tidyverse syntax, we would use `pivot_wider` and `mutate`:
```r
library(tidyverse)
df %>%
pivot_wider(names_from = `Time Period`, values_from = Grade) %>%
mutate(difference = P2 - P1)
#> # A tibble: 3 x 4
#> Team P1 P2 difference
#> <chr> <dbl> <dbl> <dbl>
#> 1 Team 1 75 87 12
#... |
57,299,095 | I'm trying to perform a `pivot_table` function on a dataset, with 'userID' as the index but it gives an `Indexerror: index 640985038 is out of bounds for axis 0 with size 640958005`
but the highest 'userID' is only 278854. I don't understand why this error is coming up at all anyways.
```
rating_crosstab = combined_... | 2019/07/31 | [
"https://Stackoverflow.com/questions/57299095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11069614/"
] | There is no such option in prefix query **to return only the results where prefix matched for words (or inverted indices to be more specific) which are greater than or equal to length (say) 5**. I even tried the [index-prefix](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-prefixes.html) which wo... | You can use [length filter](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-length-tokenfilter.html) with `min: 5` parameter to achieve this.
But I feel here you need [stop filter](https://www.elastic.co/guide/en/elasticsearch/reference/7.9/analysis-stop-tokenfilter.html#analysis-stop-tokenfilt... |
68,585,118 | I have a gatsby project where I need to make an API request to fetch a list of cars that I will use to dynamically create pages for each car. The API response data is like so:
```
{
"Fleet_Data": [
{
"Make": "Honda",
"Model": "Pilot"
},
{
"Make": "Honda",
"Mo... | 2021/07/30 | [
"https://Stackoverflow.com/questions/68585118",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1688359/"
] | >
> Any idea how I could extract this data from the table? How would I
> make it so that if you entered Barbados (1246), then Lime is selected
> instead of AT&T?
>
>
>
**carriers.xlsx**
| countryCode | Carrier |
| --- | --- |
| 1246 | LIME |
| 1 | AT&T |
| 81 | Softbank |
| 52 | Telmex |
| 966 | Zain |
**script.... | I can think only of an inefficient solution.
First, sort the data frame of carriers in the reverse alphabetical order of country codes. That way, longer prefixes will be closer to the beginning.
```
codes = xl_2.sort_values('countryCode', ascending=False)
```
Next, define a function that matches a number with each ... |
68,585,118 | I have a gatsby project where I need to make an API request to fetch a list of cars that I will use to dynamically create pages for each car. The API response data is like so:
```
{
"Fleet_Data": [
{
"Make": "Honda",
"Model": "Pilot"
},
{
"Make": "Honda",
"Mo... | 2021/07/30 | [
"https://Stackoverflow.com/questions/68585118",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1688359/"
] | >
> Any idea how I could extract this data from the table? How would I
> make it so that if you entered Barbados (1246), then Lime is selected
> instead of AT&T?
>
>
>
**carriers.xlsx**
| countryCode | Carrier |
| --- | --- |
| 1246 | LIME |
| 1 | AT&T |
| 81 | Softbank |
| 52 | Telmex |
| 966 | Zain |
**script.... | If I understand it correctly, you just want to get the first characters from the input column (Number) and then match this with the second dataframe from carriers.xlsx.
Extract first characters of a Number column. Hint: The nbr\_of\_chars variable should be based on the maximum character length of the column countryCo... |
68,585,118 | I have a gatsby project where I need to make an API request to fetch a list of cars that I will use to dynamically create pages for each car. The API response data is like so:
```
{
"Fleet_Data": [
{
"Make": "Honda",
"Model": "Pilot"
},
{
"Make": "Honda",
"Mo... | 2021/07/30 | [
"https://Stackoverflow.com/questions/68585118",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1688359/"
] | Let's assume the following input:
```
>>> df1
Number
0 8155555555
1 12465555555
2 12135555555
3 96655555555
4 525555555555
>>> df2
countryCode Carrier
0 1246 LIME
1 1 AT&T
2 81 Softbank
3 52 Telmex
4 966 Zain
```
First we nee... | I can think only of an inefficient solution.
First, sort the data frame of carriers in the reverse alphabetical order of country codes. That way, longer prefixes will be closer to the beginning.
```
codes = xl_2.sort_values('countryCode', ascending=False)
```
Next, define a function that matches a number with each ... |
68,585,118 | I have a gatsby project where I need to make an API request to fetch a list of cars that I will use to dynamically create pages for each car. The API response data is like so:
```
{
"Fleet_Data": [
{
"Make": "Honda",
"Model": "Pilot"
},
{
"Make": "Honda",
"Mo... | 2021/07/30 | [
"https://Stackoverflow.com/questions/68585118",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1688359/"
] | Let's assume the following input:
```
>>> df1
Number
0 8155555555
1 12465555555
2 12135555555
3 96655555555
4 525555555555
>>> df2
countryCode Carrier
0 1246 LIME
1 1 AT&T
2 81 Softbank
3 52 Telmex
4 966 Zain
```
First we nee... | If I understand it correctly, you just want to get the first characters from the input column (Number) and then match this with the second dataframe from carriers.xlsx.
Extract first characters of a Number column. Hint: The nbr\_of\_chars variable should be based on the maximum character length of the column countryCo... |
80,482 | In my production environment I have ArcGIS Server 10.0 Enterprise, ArcSDE 9.3, and ArcIMS. I want to shut down ArcIMS as soon as possible for obvious reasons, and upgrade ArcSDE 9.3 to 10.1 and ArcGIS for Server 10.0 to 10.1. As I am new to ArcGIS for Server 10.1, I would like to set up a test environment just to get t... | 2013/12/14 | [
"https://gis.stackexchange.com/questions/80482",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/5636/"
] | 1. Read through installation guide for installing ArcGIS Server on the chosen OS. Here is the [link](http://resources.arcgis.com/en/help/install-guides/arcgis-server/10.1/index.html#/Installing_ArcGIS_10_1_SP1_for_Server/01nm0000002m000000/) for Windows. Go for ArcGIS 10.1 SP1 directly, no need to install 10.1 first si... | When creating the virtual machine I would chose bridging mode for the network interface card. This way, when you install the test operating system it will get an IP from the same newtork subnet -- like having another computer on your lan. (e.g. if you currently have the ip 192.168.1.33 the guest will get an ip like 192... |
55,528,087 | My main application component interacts with sub components through `@Output` decorated properties on the subcomponent. The output properties use and `EventEmitter<>()`. Often the property emits a simple boolean or number. I would like to bind this output directly to properties in the main application. But am failing t... | 2019/04/05 | [
"https://Stackoverflow.com/questions/55528087",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10340388/"
] | I believe the best you can do is this:
```
(subProperty)="mainProperty = $event"
``` | Add the suffix `Change` to the end of your property so you can use the banana/football in the box syntax. A matching input is not required and will be ignored.
```
//In your sub component:
@Output() subPropertyChange = new EventEmitter<boolean>();
```
```
//In your main template:
<sub-component [(subProperty)]="main... |
56,201,259 | I have written the following plot command:
```
Stripped_DATA <- structure(list(Epoch = structure(c(1110925802, 1110929408, 1110933014,
1110936616, 1110940217),
class = c("POSIXct", "POSIXt"),
... | 2019/05/18 | [
"https://Stackoverflow.com/questions/56201259",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11109553/"
] | Use [`numpy.where`](https://docs.scipy.org/doc/numpy/reference/generated/numpy.where.html):
```
df['Hired'] = pd.np.where(df.Hired == 'Y', 1, 0)
```
Or [`pandas.Series.map`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.map.html):
```
df['Hired'] = df.Hired.map({'Y': 1, 'N', 0})
```
Whi... | I think you're looking for the `apply` method, [pandas.Series.apply](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.apply.html#pandas.Series.apply), which can be used to run a function for each value in the Series.
In your case, using an anonymous function...
```
df['Hired'] = df['Hired'].ap... |
56,201,259 | I have written the following plot command:
```
Stripped_DATA <- structure(list(Epoch = structure(c(1110925802, 1110929408, 1110933014,
1110936616, 1110940217),
class = c("POSIXct", "POSIXt"),
... | 2019/05/18 | [
"https://Stackoverflow.com/questions/56201259",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11109553/"
] | Use [`numpy.where`](https://docs.scipy.org/doc/numpy/reference/generated/numpy.where.html):
```
df['Hired'] = pd.np.where(df.Hired == 'Y', 1, 0)
```
Or [`pandas.Series.map`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.map.html):
```
df['Hired'] = df.Hired.map({'Y': 1, 'N', 0})
```
Whi... | More like
```
df['Hired'] = df.Hired.eq('Y').astype(int)
``` |
2,727,074 | Let the line that goes through the points $(1,0)$ and $(-1,2)$ be a tangent to the curve defined by $x^2-2y^2=C\in\mathbb{R}$. I need to determine the value of $C$. My strategy thus far has been to find the point of intersection $(a,b)$ and then use that to determine the value of $C$. Thus far I have that $ax-2by=C$ an... | 2018/04/07 | [
"https://math.stackexchange.com/questions/2727074",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/377524/"
] | You don't need derivatives. Note that the equation for your line is
$$y=1-x$$
So you need to find the intersection point. When replacing this into the conic equation, you have
$$x^2-2(1-x)^2= C$$
Therefore
$$x^2-4x+2+C=0$$
You can now solve for the tangent points and draw conclusions. | If you don’t happen to recognize that the curve is a conic section, allowing you to solve this by examining the discriminant of a quadratic, you can proceed more generically as follows: If a line is tangent to a curve, it is orthogonal to the curve’s normal at the point of tangency. The direction of the normal to this ... |
194,175 | When I create new Dropbox folders, Spotlight does not see them. When does Spotlight index new folders? Or better yet, can I force Spotlight to index new folders? | 2015/07/02 | [
"https://apple.stackexchange.com/questions/194175",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/71157/"
] | From Apple Support: [How to rebuild the Spotlight index on your Mac](https://support.apple.com/en-us/HT201716)
>
> 1. Choose Apple menu () > System Preferences, then click Spotlight.
> 2. Click the Privacy tab.
> 3. Drag the folder or disk that you want to index again to the list of locations that Spotlight is preve... | There are two ways to force indexing on a folder/directory:
**mdimport**
If the directory is new and has not been indexed before (or even if it resides within a directory structure that has previously been excluded from indexing), `mdimport` is your tool of choice:
From a terminal window, type `mdimport /path/to/direc... |
194,175 | When I create new Dropbox folders, Spotlight does not see them. When does Spotlight index new folders? Or better yet, can I force Spotlight to index new folders? | 2015/07/02 | [
"https://apple.stackexchange.com/questions/194175",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/71157/"
] | From Apple Support: [How to rebuild the Spotlight index on your Mac](https://support.apple.com/en-us/HT201716)
>
> 1. Choose Apple menu () > System Preferences, then click Spotlight.
> 2. Click the Privacy tab.
> 3. Drag the folder or disk that you want to index again to the list of locations that Spotlight is preve... | I was also having trouble with indexing when I installed Dropbox. Here is what I recommend.
1. Don't use Spotlight for file/folder searches. Use [Alfred](https://www.alfredapp.com/).
2. Install Alfred. Go to Alfred Preferences. Go to Features --> Default Results. In Search Scope, add the folders you want to be indexed... |
194,175 | When I create new Dropbox folders, Spotlight does not see them. When does Spotlight index new folders? Or better yet, can I force Spotlight to index new folders? | 2015/07/02 | [
"https://apple.stackexchange.com/questions/194175",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/71157/"
] | There are two ways to force indexing on a folder/directory:
**mdimport**
If the directory is new and has not been indexed before (or even if it resides within a directory structure that has previously been excluded from indexing), `mdimport` is your tool of choice:
From a terminal window, type `mdimport /path/to/direc... | I was also having trouble with indexing when I installed Dropbox. Here is what I recommend.
1. Don't use Spotlight for file/folder searches. Use [Alfred](https://www.alfredapp.com/).
2. Install Alfred. Go to Alfred Preferences. Go to Features --> Default Results. In Search Scope, add the folders you want to be indexed... |
687 | Hi all,
The [new design](https://softwareengineering.meta.stackexchange.com/questions/655/site-design-round-2) has been deployed just now and I want to congratulate you guys for the official launch!
A few tweaks on the final design from the mockup I posted:
* I decided not to use the Yanone font since it is a bit n... | 2010/12/16 | [
"https://softwareengineering.meta.stackexchange.com/questions/687",
"https://softwareengineering.meta.stackexchange.com",
"https://softwareengineering.meta.stackexchange.com/users/1685/"
] | Love it!
========
Except the logo. In my opinion the logo [should be what was voted](https://softwareengineering.meta.stackexchange.com/questions/4/what-should-our-logo-and-site-design-look-like) rather then a few comments.
Also when loading a new page there is a *very* noticeable lag when swapping the fonts out. Th... | Blood cell badges? I liked the little "sunken" versions in the mockup
 |
687 | Hi all,
The [new design](https://softwareengineering.meta.stackexchange.com/questions/655/site-design-round-2) has been deployed just now and I want to congratulate you guys for the official launch!
A few tweaks on the final design from the mockup I posted:
* I decided not to use the Yanone font since it is a bit n... | 2010/12/16 | [
"https://softwareengineering.meta.stackexchange.com/questions/687",
"https://softwareengineering.meta.stackexchange.com",
"https://softwareengineering.meta.stackexchange.com/users/1685/"
] | I really like the semi-erased white board background | Love it!
========
Except the logo. In my opinion the logo [should be what was voted](https://softwareengineering.meta.stackexchange.com/questions/4/what-should-our-logo-and-site-design-look-like) rather then a few comments.
Also when loading a new page there is a *very* noticeable lag when swapping the fonts out. Th... |
687 | Hi all,
The [new design](https://softwareengineering.meta.stackexchange.com/questions/655/site-design-round-2) has been deployed just now and I want to congratulate you guys for the official launch!
A few tweaks on the final design from the mockup I posted:
* I decided not to use the Yanone font since it is a bit n... | 2010/12/16 | [
"https://softwareengineering.meta.stackexchange.com/questions/687",
"https://softwareengineering.meta.stackexchange.com",
"https://softwareengineering.meta.stackexchange.com/users/1685/"
] | I was only vaguely aware a site appearance redesign was in the offing, and so when I clicked on a question I had displaying to see if anyone had added anything, suddenly everything changed! I was like "Whoa!" After a moment it all came clear, and I was ENLIGHTENED!
NICE! MUCH BETTER!
I didn't have a problem with th... | Blood cell badges? I liked the little "sunken" versions in the mockup
 |
687 | Hi all,
The [new design](https://softwareengineering.meta.stackexchange.com/questions/655/site-design-round-2) has been deployed just now and I want to congratulate you guys for the official launch!
A few tweaks on the final design from the mockup I posted:
* I decided not to use the Yanone font since it is a bit n... | 2010/12/16 | [
"https://softwareengineering.meta.stackexchange.com/questions/687",
"https://softwareengineering.meta.stackexchange.com",
"https://softwareengineering.meta.stackexchange.com/users/1685/"
] | I really like the semi-erased white board background | Blood cell badges? I liked the little "sunken" versions in the mockup
 |
687 | Hi all,
The [new design](https://softwareengineering.meta.stackexchange.com/questions/655/site-design-round-2) has been deployed just now and I want to congratulate you guys for the official launch!
A few tweaks on the final design from the mockup I posted:
* I decided not to use the Yanone font since it is a bit n... | 2010/12/16 | [
"https://softwareengineering.meta.stackexchange.com/questions/687",
"https://softwareengineering.meta.stackexchange.com",
"https://softwareengineering.meta.stackexchange.com/users/1685/"
] | It's quite harder to read,
--------------------------
at least for me. | Blood cell badges? I liked the little "sunken" versions in the mockup
 |
687 | Hi all,
The [new design](https://softwareengineering.meta.stackexchange.com/questions/655/site-design-round-2) has been deployed just now and I want to congratulate you guys for the official launch!
A few tweaks on the final design from the mockup I posted:
* I decided not to use the Yanone font since it is a bit n... | 2010/12/16 | [
"https://softwareengineering.meta.stackexchange.com/questions/687",
"https://softwareengineering.meta.stackexchange.com",
"https://softwareengineering.meta.stackexchange.com/users/1685/"
] | I really like the semi-erased white board background | I was only vaguely aware a site appearance redesign was in the offing, and so when I clicked on a question I had displaying to see if anyone had added anything, suddenly everything changed! I was like "Whoa!" After a moment it all came clear, and I was ENLIGHTENED!
NICE! MUCH BETTER!
I didn't have a problem with th... |
687 | Hi all,
The [new design](https://softwareengineering.meta.stackexchange.com/questions/655/site-design-round-2) has been deployed just now and I want to congratulate you guys for the official launch!
A few tweaks on the final design from the mockup I posted:
* I decided not to use the Yanone font since it is a bit n... | 2010/12/16 | [
"https://softwareengineering.meta.stackexchange.com/questions/687",
"https://softwareengineering.meta.stackexchange.com",
"https://softwareengineering.meta.stackexchange.com/users/1685/"
] | I really like the semi-erased white board background | It's quite harder to read,
--------------------------
at least for me. |
174 | While I don't know much about drones yet, I've seen people use them to make awesome photographs and videos, and I want to be able to do that too.
Since I've never flown a drone, I'm looking for a drone that I can use to learn how to fly, it should probably also be able to hover. I like seeing the videos of drones that... | 2020/04/15 | [
"https://drones.stackexchange.com/questions/174",
"https://drones.stackexchange.com",
"https://drones.stackexchange.com/users/94/"
] | An important first step to take when getting into drones is learning to fly them. The very first drone I would recommend to someone is a cheap drone that can be used to learn to fly. It can be disheartening to buy an expensive drone only to crash it and have lost hundreds or thousands of dollars which is why **learning... | That's part of the journey to figure that out! And also part of the fun. There are a lot of different trends in the quad market.
I would recommend that you buy a very small and light drone for the beginning. The Whoop class would be perfect. I have a lot of fun with my **BetaFpv Meteor65**. It can be flown in line-of-... |
174 | While I don't know much about drones yet, I've seen people use them to make awesome photographs and videos, and I want to be able to do that too.
Since I've never flown a drone, I'm looking for a drone that I can use to learn how to fly, it should probably also be able to hover. I like seeing the videos of drones that... | 2020/04/15 | [
"https://drones.stackexchange.com/questions/174",
"https://drones.stackexchange.com",
"https://drones.stackexchange.com/users/94/"
] | An important first step to take when getting into drones is learning to fly them. The very first drone I would recommend to someone is a cheap drone that can be used to learn to fly. It can be disheartening to buy an expensive drone only to crash it and have lost hundreds or thousands of dollars which is why **learning... | I personally recommend the **S49** quadcopter as it was my first drone:
[](https://i.stack.imgur.com/mNLkD.jpg)
Features:
* It has an FPV camera, so you can take pictures with it from your phone (they're not the worst pictures as well, quite good quality)
* It is not tha... |
2,824,583 | I don't understand the concept of expected value in probability (<https://en.wikipedia.org/wiki/Expected_value>). I don't understand why one should multiply the value of an event, to the probability of it occurring, to find the expected value, and what this expected value means.
My guess is that it means the average v... | 2018/06/19 | [
"https://math.stackexchange.com/questions/2824583",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/559662/"
] | >
> Namely, what would the expected value of playing 1 game be? It can't
> be $5, because that's the average of 6 games! If you only play 1 game,
> that wouldn't make any sense. Same applies for playing any number of
> games that is not a multiple of 6. How would it make sense to have 5
> dollars your expected val... | Some recap of definitions:
[The expected value](https://en.wikipedia.org/wiki/Expected_value) is a property of a [random variable](https://en.wikipedia.org/wiki/Random_variable), also known as its mean. It gives us info about the distribution of the variable.
The expected value of a discrete random variable is the p... |
36,525 | I'm currently planning on retiring before the 59 1/2 year old milestone where 401k's and IRA's become accessible penalty free. One workaround I've heard of to access your retirement funds early is to do conversions out of your 401k accounts into Roth IRA's. After a 5 year seasoning period, you can withdraw the principa... | 2014/08/29 | [
"https://money.stackexchange.com/questions/36525",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/12887/"
] | The plan is perfectly valid and legal as tax rules currently stand. There is no limit to the amount you can rollover or convert to Roth. Assuming your 401(k) is traditional pre-tax, you'll have to pay income taxes on the amount you convert above personal exemption + standard deduction, which is currently about $10k/yea... | You cannot roll over your 401k money in an employer's 401k plan into an IRA (of any kind) while you are still employed by that employer. The only way you can start on the conversion before you retire (as Craig W suggests) is to change employers
and start rolling over money in the previous employer's 401k into your Roth... |
36,525 | I'm currently planning on retiring before the 59 1/2 year old milestone where 401k's and IRA's become accessible penalty free. One workaround I've heard of to access your retirement funds early is to do conversions out of your 401k accounts into Roth IRA's. After a 5 year seasoning period, you can withdraw the principa... | 2014/08/29 | [
"https://money.stackexchange.com/questions/36525",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/12887/"
] | The plan is perfectly valid and legal as tax rules currently stand. There is no limit to the amount you can rollover or convert to Roth. Assuming your 401(k) is traditional pre-tax, you'll have to pay income taxes on the amount you convert above personal exemption + standard deduction, which is currently about $10k/yea... | If you leave your employer at age 55 or older, you can withdraw with no penalty. Mandatory 20% withholding, but no penalty. You reconcile in April, and may get it all back.
If you are sub 55, the option is a Sec 72t withdrawal. The author of the article got it right. I am a fan of his. |
64,874,441 | Im currently trying to make a function that pops the last element from a list/string, but cant seem to make it work. I can make it work without a function by using:
var sport = ["fodbold", "håndbold", "golf"];
console.log(sport.pop());
But i need it to be a function. Also if possible, i want it to return a message i... | 2020/11/17 | [
"https://Stackoverflow.com/questions/64874441",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14654507/"
] | You can use `findResults` to "filter" and "map" in one go. e.g.
```
def lines = """!!file-number1:
!!123.sql
!!123.jpeg
!!333.jpeg
!!texttextext.jpeg"""
println lines.readLines().findResults{ def m = it =~ /!!(.*\.jpeg)/; m ? m[0][1] : null }
// → [123.jpeg, 333.jpeg, texttextext.jpeg]
``` | Or a little bit easier to read, without using the Matcher object:
```
String filePath = "path/to/file.txt"
def lines = new File(filePath)
.collect()
.findAll { it ==~ /.*jpeg/ }
.collect { it[2..-1] }
println lines
```
In your example, retainAll() modifies the initial collection ... |
1,528,793 | It was given to integrate $$I=\int\sqrt{\frac{\sin(x-\alpha)}{\sin(x+\alpha)}} \; dx.$$
Attempt:
========
\begin{align}I&= \int\sqrt{\frac{\sin((x+\alpha)-2\alpha)}{\sin(x+\alpha)}}\; dx\\&= \sqrt{\sin 2\alpha}\int\sqrt{\cot 2\alpha - \cot (x+\alpha)}\;dx\; .\end{align}
Then I took \begin{align}\cot 2\alpha - \cot (... | 2015/11/14 | [
"https://math.stackexchange.com/questions/1528793",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | HINTS:
We have $$\frac{\sin(x-\alpha)}{\sin(x+\alpha)}=\frac{\sin x\cos\alpha-\sin\alpha\cos x}{\sin x\cos\alpha+\sin\alpha\cos x}=\frac{(\sin x\cos\alpha-\sin\alpha\cos x)^2}{\sin^2x\cos^2\alpha-\sin^2\alpha\cos^2x}=\frac{(\sin x\cos\alpha-\sin\alpha\cos x)^2}{\sin^2x-\sin^2\alpha}$$
and $$u=(\sin^2x-\sin^2\alpha)^{1... | \begin{align}\int\sqrt{\cot 2\alpha - \cot (x+\alpha)}\; dx\\ &= \int \frac{\left(1+ \dfrac{\sqrt{(1+ \cot^2 2\alpha)}}{z^2}\right)+ \left(1- \dfrac{\sqrt{(1+ \cot^2 2\alpha)}}{z^2}\right)}{\dfrac{(1+ \cot^2 2\alpha)}{z^2} + z^2 -2\cot2\alpha}\; dz\\ \\ &= \int\frac{\left(1+ \dfrac{\sqrt{(1+ \cot^2 2\alpha)}}{z^2}\righ... |
400,583 | While reviewing questions in the *Close Votes* review queue, I notice regularly - but not always - that clicking on the *Close* button does not bring up the *Why should this question be closed?* popup dialog.
This happens when reviewing a duplicate question, and showing the *Duplicate* 'tab'. Clicking on the *Close* b... | 2020/08/23 | [
"https://meta.stackoverflow.com/questions/400583",
"https://meta.stackoverflow.com",
"https://meta.stackoverflow.com/users/466862/"
] | This is fixed in a manner of speaking, as you can no longer click the close button when looking at a duplicate. More at <https://meta.stackexchange.com/a/361581/235711>. | We'll take a look at this as part of the [review queue visual overhaul](https://meta.stackexchange.com/questions/360198/visual-design-changes-to-the-review-queues) currently in progress and make sure things are working as intended. Thanks for the report!
We'll post an update here once that's done. |
32,824,792 | How do i border of the textareafield, surrounding the text.
```
Ext.create('Ext.form.FormPanel', {
title : 'Sample TextArea',
width : 400,
border : false,
bodyPadding: 10,
renderTo : Ext.getBody(),
items: [{
xtype : 'textareafield',
grow : true,
name... | 2015/09/28 | [
"https://Stackoverflow.com/questions/32824792",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5117936/"
] | ```
CREATE FUNCTION test()
RETURNS my_table AS
$BODY$
DECLARE
q4 my_table;
BEGIN
-- add brackets to get a value
-- select row as one value, as q4 is of the type my_table
-- and limit result to one row
q4 := (SELECT my_table FROM my_table ORDER BY 1 LIMIT 1);
RETURN q4;
END;$BODY$
-- change lan... | PostgreSQL has not table variables. So you cannot to return table via any variable. When you create any table, then PostgreSQL creates composite type with same name. But it isn't table type - it is composite type - record.
```
CREATE TABLE xx(a int, b int);
CREATE OR REPLACE FUNCTION foo()
RETURNS xx AS $$
DECLARE v... |
32,824,792 | How do i border of the textareafield, surrounding the text.
```
Ext.create('Ext.form.FormPanel', {
title : 'Sample TextArea',
width : 400,
border : false,
bodyPadding: 10,
renderTo : Ext.getBody(),
items: [{
xtype : 'textareafield',
grow : true,
name... | 2015/09/28 | [
"https://Stackoverflow.com/questions/32824792",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5117936/"
] | ```
CREATE FUNCTION test()
RETURNS my_table AS
$BODY$
DECLARE
q4 my_table;
BEGIN
-- add brackets to get a value
-- select row as one value, as q4 is of the type my_table
-- and limit result to one row
q4 := (SELECT my_table FROM my_table ORDER BY 1 LIMIT 1);
RETURN q4;
END;$BODY$
-- change lan... | Maybe too late for the original OP but may help others. You can simply return SETOF tabletype instead. I modified the original code as an example.
```
CREATE FUNCTION test() RETURNS SETOF my_table AS
$$
DECLARE
q4 my_table;
BEGIN
FOR q4 IN SELECT * FROM my_table LOOP
RETURN NEXT q4... |
32,824,792 | How do i border of the textareafield, surrounding the text.
```
Ext.create('Ext.form.FormPanel', {
title : 'Sample TextArea',
width : 400,
border : false,
bodyPadding: 10,
renderTo : Ext.getBody(),
items: [{
xtype : 'textareafield',
grow : true,
name... | 2015/09/28 | [
"https://Stackoverflow.com/questions/32824792",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5117936/"
] | PostgreSQL has not table variables. So you cannot to return table via any variable. When you create any table, then PostgreSQL creates composite type with same name. But it isn't table type - it is composite type - record.
```
CREATE TABLE xx(a int, b int);
CREATE OR REPLACE FUNCTION foo()
RETURNS xx AS $$
DECLARE v... | Maybe too late for the original OP but may help others. You can simply return SETOF tabletype instead. I modified the original code as an example.
```
CREATE FUNCTION test() RETURNS SETOF my_table AS
$$
DECLARE
q4 my_table;
BEGIN
FOR q4 IN SELECT * FROM my_table LOOP
RETURN NEXT q4... |
13,977,878 | I want to read Sitemap with XPath but it doesn't work.
here is my code :
```
private void evaluate2(String src){
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
try{
DocumentBuilder builder = factory.newDocumentBuilder();
Document do... | 2012/12/20 | [
"https://Stackoverflow.com/questions/13977878",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/877529/"
] | You parse the sitemap with a namespace-aware parser (that's what `factory.setNamespaceAware(true)` does), but then attempt to access it using an XPath that does not usea namespace resolver (or reference any namespaces).
The simplest solution is to configure the parser as not namespace aware. As long as you're just par... | I can't see any errors in your code so I gues the problem is the source.
Are you sure that the source file contains this element?
Maybe you could try to use this code to parse the String in an Document
```
builder.parse(new InputSource(new StringReader(xml)));
``` |
13,977,878 | I want to read Sitemap with XPath but it doesn't work.
here is my code :
```
private void evaluate2(String src){
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
try{
DocumentBuilder builder = factory.newDocumentBuilder();
Document do... | 2012/12/20 | [
"https://Stackoverflow.com/questions/13977878",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/877529/"
] | I think the input has namespace. So you would have to initialize the namespaceContext for the xpath object and change your xpath with prefixes. i.e. //usr/loc should be //ns:url/ns:loc
and then add the namespace prefix binding in the namespace object.
You can find an NamespaceContext implementation available with apac... | I can't see any errors in your code so I gues the problem is the source.
Are you sure that the source file contains this element?
Maybe you could try to use this code to parse the String in an Document
```
builder.parse(new InputSource(new StringReader(xml)));
``` |
36,774,580 | I have a function that loads HTML from an external file via an `AJAX` call using jQuery.
These ajax call runs inside of a `$.each` loop and I need this ajax call to finish before the loop continues. Here is my code:
```
$('img').each(function(){
var cotainer_html = $('.cotainer_html').clone();
/* Get Image C... | 2016/04/21 | [
"https://Stackoverflow.com/questions/36774580",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2001026/"
] | I'd also recommend using Pandas' CSV parser, but instead of reading the whole file into memory in one go I would iterate over it in chunks and write these to a memory-mapped array on the fly:
```
import numpy as np
from numpy.lib.format import open_memmap
import pandas as pd
# make some test data
data = np.random.ran... | Since your data are on disk, you have to import it first and it will be costly.
I think the best csv reader today is the `pandas` one.
```
In [7]: %timeit v=pd.read_csv('100ksamples.csv',sep=',')
1 loop, best of 3: 276 ms per loop # for 100k lines
```
which seems 10 times better than your test ( but it's disk depen... |
3,040,697 | I am using a function that obtains a target element id at onclick. Example, if I click on the text element that has the id of 'help'.
```
var click = (e && e.target) || (event && event.srcElement);
```
The var click would contain the ref to the id of "help".
I want to compare the var click to the string 'help' usin... | 2010/06/14 | [
"https://Stackoverflow.com/questions/3040697",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/354212/"
] | The simplest approach is probably
```
if (click.id == 'help') { //do something }
``` | The line:
```
var click = (e && e.target) || (event && event.srcElement);
```
is not getting the `id` rather the element itself, use **[`getAttribute`](http://reference.sitepoint.com/javascript/Element/getAttribute)** to get the id instead.
```
var id = click.getAttribute('id');
alert(id);
```
Or simply:
```
var... |
3,040,697 | I am using a function that obtains a target element id at onclick. Example, if I click on the text element that has the id of 'help'.
```
var click = (e && e.target) || (event && event.srcElement);
```
The var click would contain the ref to the id of "help".
I want to compare the var click to the string 'help' usin... | 2010/06/14 | [
"https://Stackoverflow.com/questions/3040697",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/354212/"
] | The simplest approach is probably
```
if (click.id == 'help') { //do something }
``` | ```
if (click["id"] != null && click["id"] == "help") { do stuff }
```
Addressing the last part of your question, you cannot create a new DOM object by modifying your current one like you propose in your question, and I do not understand if you want to locate an already existing object and store it in a variable, or ... |
3,040,697 | I am using a function that obtains a target element id at onclick. Example, if I click on the text element that has the id of 'help'.
```
var click = (e && e.target) || (event && event.srcElement);
```
The var click would contain the ref to the id of "help".
I want to compare the var click to the string 'help' usin... | 2010/06/14 | [
"https://Stackoverflow.com/questions/3040697",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/354212/"
] | The simplest approach is probably
```
if (click.id == 'help') { //do something }
``` | I think this is what you're after ...
```
if (click.id == 'help') { // Test to see if click is the 'help' element
var newEl = document.createElement('div'); // Create a new element
newEl.id = click.id + 'div'; // Set it's id
newEl.innerHTML = 'my help text goes here'; // Set it's content
click.parentElement... |
3,040,697 | I am using a function that obtains a target element id at onclick. Example, if I click on the text element that has the id of 'help'.
```
var click = (e && e.target) || (event && event.srcElement);
```
The var click would contain the ref to the id of "help".
I want to compare the var click to the string 'help' usin... | 2010/06/14 | [
"https://Stackoverflow.com/questions/3040697",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/354212/"
] | The line:
```
var click = (e && e.target) || (event && event.srcElement);
```
is not getting the `id` rather the element itself, use **[`getAttribute`](http://reference.sitepoint.com/javascript/Element/getAttribute)** to get the id instead.
```
var id = click.getAttribute('id');
alert(id);
```
Or simply:
```
var... | ```
if (click["id"] != null && click["id"] == "help") { do stuff }
```
Addressing the last part of your question, you cannot create a new DOM object by modifying your current one like you propose in your question, and I do not understand if you want to locate an already existing object and store it in a variable, or ... |
3,040,697 | I am using a function that obtains a target element id at onclick. Example, if I click on the text element that has the id of 'help'.
```
var click = (e && e.target) || (event && event.srcElement);
```
The var click would contain the ref to the id of "help".
I want to compare the var click to the string 'help' usin... | 2010/06/14 | [
"https://Stackoverflow.com/questions/3040697",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/354212/"
] | The line:
```
var click = (e && e.target) || (event && event.srcElement);
```
is not getting the `id` rather the element itself, use **[`getAttribute`](http://reference.sitepoint.com/javascript/Element/getAttribute)** to get the id instead.
```
var id = click.getAttribute('id');
alert(id);
```
Or simply:
```
var... | I think this is what you're after ...
```
if (click.id == 'help') { // Test to see if click is the 'help' element
var newEl = document.createElement('div'); // Create a new element
newEl.id = click.id + 'div'; // Set it's id
newEl.innerHTML = 'my help text goes here'; // Set it's content
click.parentElement... |
28,427,815 | I don't even know how to ask this question correctly, because I have never seen it done before. I am pretty competent with editing name servers, creating a records, and cnames etc, but I have no idea if this is even possible.
I have a client that owns a several domains that all point at the same site. So say the main ... | 2015/02/10 | [
"https://Stackoverflow.com/questions/28427815",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2914698/"
] | You can use this code in your `DOCUMENT_ROOT/.htaccess` file:
```
RewriteEngine On
# facebook redirect
RewriteCond %{HTTP_HOST} ^(www\.)?other-domain-1\.com$ [NC]
RewriteRule ^facebook/?$ http://facebook.com/account [L,NC,R=302]
# linked-in redirect
RewriteCond %{HTTP_HOST} ^(www\.)?other-domain-1\.com$ [NC]
Rewrite... | So the Solution that worked on my server based on anubhava answer above was
```
facebook redirect
RewriteCond %{HTTP_HOST} ^(www\.)?other-domain-1\.com$ [NC]
RewriteRule ^facebook/?$ http://facebook.com/account [L,NC,R=302]
```
Then after getting them all working changed the `R=302` to `R=301` to make the redirects ... |
26,903,351 | I have just installed VS2015 Preview. I created a MVC project. I added a new typescript file. I have tried to compile and I got:
>
> The "TypeScript.Tasks.VsTsc" task could not be loaded from the assembly C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript\TypeScript.tasks.dll. Could not load file ... | 2014/11/13 | [
"https://Stackoverflow.com/questions/26903351",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/249695/"
] | It helped to install TypeScript 1.3 for Visual Studio 2013 after the installation of the Visual Studio 2015. Strange... | There indeed seems something wrong with the installer for the TypeScript 1.3 powertool, I found that using the repair option in Add/Remove Programs fixed the install in most cases. |
2,366,475 | I have a form that uses jQuery-UI's [selectable](http://docs.jquery.com/UI/Selectable) plugin to populate a list from a table. My form also allows users to remove single or multiple list items if they change their minds. This function works in IE and Firefox. The list is also automatically cleared and the form reset if... | 2010/03/02 | [
"https://Stackoverflow.com/questions/2366475",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/128245/"
] | Well first to confess I have not used the selectable stuff at all, SO given that, a shot in the dark, can you chain?
```
this.grpselections.empty().removeData();
``` | Not enough info here. Try putting a debugger; statement in the code and opening ie8 developer tools to debug the script and see what is going on. |
54,706,786 | In my app I'm doing this:
```
<ion-col *ngFor ="let place of intentList, let photo of photoList">
<ion-card>
<ion-card-content>
<img class="img" src = "{{photo}}" (click)="clickedImage(place.intent)">
<div>{{place.val}}</div>
</ion-card-content>
</ion-card>
... | 2019/02/15 | [
"https://Stackoverflow.com/questions/54706786",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4116960/"
] | ```
<ion-col *ngFor ="let place of intentList; let i=index;">
<ion-card>
<ion-card-content>
<img class="img" src = "{{photo[i]}}" (click)="clickedImage(place.intent)">
<div>{{place.val}}</div>
</ion-card-content>
</ion-card>
</ion-col>
```
You can achieve ... | This is because you can't run 2 loops in angular. So you are actually not getting the value of photo path in your variable photo.
But instead you are getting the value of variable place in the variable photo.
you can check it printing the value of photo
```
{{photo}}
``` |
51,772,800 | I have been making a website with bootstrap and am trying to use sections to separate parts. However on large screens there is too much space between the text and the end of the section and on small screens the text runs of the section? Each section has a set height in the css which I believe is something to with it.
... | 2018/08/09 | [
"https://Stackoverflow.com/questions/51772800",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7232012/"
] | Checkpointing is a process of truncating RDD lineage graph and saving it to a reliable distributed (HDFS) or local file system. If you have a large RDD lineage graph and you want freeze the content of the current RDD i.e. materialize the complete RDD before proceeding to the next step, you generally use persist or chec... | One difference is that if your spark job needs a certain in memory partitioning scheme, eg if you use a window function, then checkpoint will persist that to disk, whereas writing to parquet will not.
I'm not aware of a way with the current versions of spark to write parquet files and then read them in again, with a p... |
2,907,984 | I found this hint in my textbook:
$$ \sin\left((1-n) \cdot \frac{\pi}{2}\right) = \sin\left((1+n) \cdot \frac{\pi}{2}\right) = \cos\left(\frac{n\pi}{2}\right). $$
I don't understand this at all.
Let's assume $n = 2$:
\begin{align}
\sin\left((1-2)\cdot \frac{\pi}{2}\right) &= -1.32 \\
\sin\left((1+2)\cdot \frac... | 2018/09/06 | [
"https://math.stackexchange.com/questions/2907984",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/588100/"
] | This only has a chance of being true if what is meant is actually
$$ \sin ((1-n)\pi/2) = \sin((1+n)\pi/2) = \cos(n\pi/2) $$
But then it is actually true, since $\sin(\pi/2 \pm x) = \cos(x)$, and then just set $x=n\pi/2$. Your $n$ doesn't even need to be an integer.
Why your textbook was omitting the parentheses around... | **hint**
You just need know that
$$\sin(a)=\sin(\pi-a)=\cos(\frac{\pi}{2}-a)$$ |
69,064,493 | I have a simple `<section>` with a `<h1>` tag inside it.
```
<section className = "topone">
<h1>Test Text</h1>
</section>
```
Inline .css works fine, but I want to use an external .css file, I have `stylish.css` as like below;
```
.topone {
background-color : "white";
display: 'flex';
justify-co... | 2021/09/05 | [
"https://Stackoverflow.com/questions/69064493",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4302226/"
] | I have found the problem, first I thought this is related to 3rd library 'react-toastify' because it also imports it's own .css file. But the problem was in my own .css file.
1. Assigning the .css file to a variable like `import style from './styles.css'` **doesn't work at all**. It only accepts `import './styles.css'... | Are you sure that you use the correct import path? If you keep your styles in a different folder you may want to include them like this:
import '../stylesFolder/stylish.css'; |
12,318,120 | I would like to add a table of the coordinates of highlighted site in a ggplot.
Using a previous [question](https://stackoverflow.com/questions/11467965/r-ggplot2-highlighting-selected-points-and-strange-behavior) as example data:
```
set.seed(1)
mydata <- data.frame(a=1:50, b=rnorm(50))
ggplot(mydata,aes(x=a,y=b)) +... | 2012/09/07 | [
"https://Stackoverflow.com/questions/12318120",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1392044/"
] | You can use `ggplot2`'s `annotation_custom` with a `tableGrob` from the `gridExtra` package.
```
library(ggplot2)
library(gridExtra)
set.seed(1)
mydata <- data.frame(a=1:50, b=rnorm(50))
mytable <- cbind(sites=c("site 1","site 2","site 3","site 4"),mydata[10:13,])
k <- ggplot(mydata,aes(x=a,y=b)) +
geom_point(colou... | @user3206440: I found a work-around that removes row numbers. I formatted my data as a matrix, assigned column names, then had tableGrob call that directly. Whenever I had tableGrob call it as a data frame, the row name persisted.
Below is an example. I'm sure there's an easier way to deal with the chisq.test output
... |
12,318,120 | I would like to add a table of the coordinates of highlighted site in a ggplot.
Using a previous [question](https://stackoverflow.com/questions/11467965/r-ggplot2-highlighting-selected-points-and-strange-behavior) as example data:
```
set.seed(1)
mydata <- data.frame(a=1:50, b=rnorm(50))
ggplot(mydata,aes(x=a,y=b)) +... | 2012/09/07 | [
"https://Stackoverflow.com/questions/12318120",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1392044/"
] | You can use `ggplot2`'s `annotation_custom` with a `tableGrob` from the `gridExtra` package.
```
library(ggplot2)
library(gridExtra)
set.seed(1)
mydata <- data.frame(a=1:50, b=rnorm(50))
mytable <- cbind(sites=c("site 1","site 2","site 3","site 4"),mydata[10:13,])
k <- ggplot(mydata,aes(x=a,y=b)) +
geom_point(colou... | @user3206440, @Punintended An easy way of removing row numbers exists: add `rows = NULL` to the call to `tableGrob`.
```
library(ggplot2)
library(gridExtra)
set.seed(1)
mydata <- data.frame(a=1:50, b=rnorm(50))
mytable <-
cbind(sites=c("site 1","site 2","site 3","site 4"), mydata[10:13,])
k <- ggplot(mydata,aes(x=... |
12,318,120 | I would like to add a table of the coordinates of highlighted site in a ggplot.
Using a previous [question](https://stackoverflow.com/questions/11467965/r-ggplot2-highlighting-selected-points-and-strange-behavior) as example data:
```
set.seed(1)
mydata <- data.frame(a=1:50, b=rnorm(50))
ggplot(mydata,aes(x=a,y=b)) +... | 2012/09/07 | [
"https://Stackoverflow.com/questions/12318120",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1392044/"
] | You can use `ggplot2`'s `annotation_custom` with a `tableGrob` from the `gridExtra` package.
```
library(ggplot2)
library(gridExtra)
set.seed(1)
mydata <- data.frame(a=1:50, b=rnorm(50))
mytable <- cbind(sites=c("site 1","site 2","site 3","site 4"),mydata[10:13,])
k <- ggplot(mydata,aes(x=a,y=b)) +
geom_point(colou... | With the release of ['ggplot2'](https://cran.r-project.org/package=ggplot2) 3.0.0 and ['ggpmisc'](https://cran.r-project.org/package=ggpmisc) 0.3.0 a new simpler answer is possible:
```
library(ggplot2)
library(ggpmisc)
set.seed(1)
mydata <- data.frame(a = 1:50, b = rnorm(50))
table <- cbind(sites=c("site 1", "site 2... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.