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 |
|---|---|---|---|---|---|
5,182,163 | Found this question on "[How can I detect the operating system in Perl](https://stackoverflow.com/questions/334686/how-can-i-detect-the-operating-system-in-perl)" -- but what I need to snippet of Perl that detects the OS, and then uses that value to conditional excute code for OS-A or OS-B; in this case, those being Wi... | 2011/03/03 | [
"https://Stackoverflow.com/questions/5182163",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/471255/"
] | Of course $^O is the definitive answer to this. But you might want to look at [Devel::CheckOS](http://search.cpan.org/perldoc?Devel%3a%3aCheckOS) which puts a friendly wrapper around it. | Take a look at how [`File::Spec`](http://search.cpan.org/perldoc?File%3a%3aSpec) does it.
[Here.](http://cpansearch.perl.org/src/SMUELLER/PathTools-3.33/lib/File/Spec.pm)
---
Answer to comment:
I'm not saying to load File::Spec. I'm saying look at how it does its "sub-classing". Really, it's kind of like this:
* ... |
5,182,163 | Found this question on "[How can I detect the operating system in Perl](https://stackoverflow.com/questions/334686/how-can-i-detect-the-operating-system-in-perl)" -- but what I need to snippet of Perl that detects the OS, and then uses that value to conditional excute code for OS-A or OS-B; in this case, those being Wi... | 2011/03/03 | [
"https://Stackoverflow.com/questions/5182163",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/471255/"
] | Of course $^O is the definitive answer to this. But you might want to look at [Devel::CheckOS](http://search.cpan.org/perldoc?Devel%3a%3aCheckOS) which puts a friendly wrapper around it. | You can use a dispatch table like this:
```
my %callback = (
MSWin32 => sub { win_code() },
linux => sub { linux_code() },
);
# run appropriate code
$callback{$^O}->();
``` |
186,702 | [](https://i.stack.imgur.com/gOy6A.jpg)
hi there! We bought an old condo, and it has a built-in cupboard of sorts, but it looks like this: (see photo). Any ideas on how to clean up all these scratches would be greatly appreciated! Thanks | 2020/03/15 | [
"https://diy.stackexchange.com/questions/186702",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/113417/"
] | When refinishing old surfaces like that, I have had great results finding the right compound to do what is called I think, re-amalgamation. It is when the proper solvent or compound I called it earlier, is used to melt the finish on the surface and allowed to dry again. It will remove some of the finish, or perhaps eve... | You have got your work cut out for you. in my opinion that thing needs a complete refinishing. You’re going to want to use a stripper such as a citrus-based stripper and strip off all of the old varnish. Once all the varnish is stripped off then you’re going to want to sand the wood, there appeared to be some deep scra... |
5,049,495 | I have a dynamic 3d array of numbers and currently I'm doing it like I usually would in C:
```
for (auto i = 0; i < size; i++) {
for (auto j = 0; j < size; j++) {
for (auto k = 0; k < size; k++) {
...
}
}
}
```
Looks pretty ugly. Is there a shorter and maybe more "elegant" way of ... | 2011/02/19 | [
"https://Stackoverflow.com/questions/5049495",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/249230/"
] | Using foreach is probably most idiomatic approach in D. It is possible to iterate by both index and value or value only.
```
import std.stdio;
void main () {
auto arr3 = [ [[1 ,2 ,3 ]], [[4 ,5 ,6 ]], [[7 , 8, 9]],
[[11,12,13]], [[14,15,16]], [[17,18,19]] ];
foreach (index3, arr2; arr3)
foreac... | ```
import std.array;
foreach(el;join(join(arr3))){
writeln (el);
}
```
however this way you can't differentiate between which lower array you access (unless you add a separator as second argument in the join functions) |
52,940,721 | I should preface this by letting you know I'm not a coder. I'm just a person who knows a little VB.NET and likes efficiency.
I'm working with WebBrowser1.Document.Body.InnerHtml to get the source of the webpage within the webbrowser element, inside the source is this Table Row
```
<tr>
<td width="60px">
1... | 2018/10/23 | [
"https://Stackoverflow.com/questions/52940721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10361640/"
] | Base on the Jimi's idea:
```
Dim date1 as string
Dim textExistOrNot as Boolean = false
'get collection of all tr in the webpage
For Each trSect As HtmlElement In WebBrowser1.Document.GetElementsByTagName("tr")
If trSect.innerText Is Nothing Then
Else
'get the tr which has the text "CHARGED_ONBOARDI... | I suggest you to go with external library : [HTML Agility pack](https://html-agility-pack.net/)
You can find bunch of examples on link : [Examples](https://html-agility-pack.net/online-examples)
```
Dim htmlFile as new HtmlDocument
htmlFile .LoadHtml("YourHtmlCode")
Dim htmlNodes = htmlFile.DocumentNode.SelectNode... |
25,447,527 | my plan is to using PHP in Tide.
I read the guides and I didn't figured out if its possible to use it with a big application written in Symfony2 (or other framework).
I just saw this tag but I've no clue how to startup my Symfony2 app.
Is this possible?
Is there an additional resource to read? | 2014/08/22 | [
"https://Stackoverflow.com/questions/25447527",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1477415/"
] | Here's an answer from the developers:
>
> TideKit includes Zend as part of our PHP but we don't encourage full
> blown PHP app development since this can limit capabilities and
> platforms for deployment. Therefore, we've not looked at frameworks
> like Symphony, CodeIgniter, and others to ensure they can be used.... | You can use PHP inside of TideSDK. [Here is a good link to the documentation on how to use PHP with TideSDK](http://tidesdk.multipart.net/docs/user-dev/generated/#!/guide/using_php) . I have not used Symfony2 before, but let me assure you that using javascript and html5 are two of the easiest languages are.
How I sta... |
294,297 | I'm using the code provided by **Mark Wibrow** ([Text spirals with TikZ](https://tex.stackexchange.com/questions/88751/text-spirals-with-tikz)) to generate a spiral text that I could include as a front cover to a report.
The below code works perfectly fine when using latin characters. However, I need to be able to wr... | 2016/02/16 | [
"https://tex.stackexchange.com/questions/294297",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/93101/"
] | As an ignorant monolingual British English speaker, my experience with dealing with non-English fonts and the `babel` package in `LaTeX` is pretty much zero, so I have no idea how practical/useful this solution is. Also, I'm not sure the characters are counted correctly. It needs to be complied with `lualatex` or `xela... | (As I was posting this, I see there's a Lua-/XeTeX solution, which I would prefer. However, here's a pdfTeX method.)
Remember each letter (in this type of TikZ picture) is typeset in its own `\hbox`, which allows for many effects, but comes at a cost. The Greek characters are also a problem, which I can't explain.
B... |
39,799,821 | I want to remove one frequency (one peak) from signal and plot my function without it. After fft I found frequency and amplitude and I am not sure what I need to do now. For example I want to remove my highest peak (marked with red dot on plot).
```
import numpy as np
import matplotlib.pyplot as plt
# create data
N =... | 2016/09/30 | [
"https://Stackoverflow.com/questions/39799821",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5395658/"
] | One option is to transform the signal to the frequency domain then remove the selected frequency.
```
import numpy as np
import matplotlib.pyplot as plt
from scipy.fftpack import rfft, irfft, fftfreq, fft
# Number of samplepoints
N = 500
# sample spacing
T = 0.1
x = np.linspace(0.0, (N-1)*T, N)
# x = np.arange(0.0, ... | You can design a bandstop filter:
```
from scipy import signal
wc = freq[np.argmax(amplitude)] / (0.5 / dt)
wp = [wc * 0.9, wc / 0.9]
ws = [wc * 0.95, wc / 0.95]
b, a = signal.iirdesign(wp, ws, 1, 40)
f = signal.filtfilt(b, a, f)
``` |
1,305,967 | I have a template function that takes the following form:
```
template < class ITER1, class ITER2 >
bool example(ITER1 Input1, ITER1 Input2, ITER2 Output)
{
ITER2 OrigOutput(Output);
// ...
std::copy(Input1, Input2, Output);
return (OrigOutput != Output);
}
```
And I'm calling `example()` like thi... | 2009/08/20 | [
"https://Stackoverflow.com/questions/1305967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2958/"
] | Write a wrapper iterator which delgates to another iterator, which you would construct from your insert iterator. Your delegate then can set a `modified` member to be true in the `operator=` method.
Something along the lines of this:
```
template<typename ITER>
class ModifiedIterator : public std::iterator<std::outpu... | OutputIterators don't allow that. But in your case, what prevent you to return `Input1 != Input2`? |
1,305,967 | I have a template function that takes the following form:
```
template < class ITER1, class ITER2 >
bool example(ITER1 Input1, ITER1 Input2, ITER2 Output)
{
ITER2 OrigOutput(Output);
// ...
std::copy(Input1, Input2, Output);
return (OrigOutput != Output);
}
```
And I'm calling `example()` like thi... | 2009/08/20 | [
"https://Stackoverflow.com/questions/1305967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2958/"
] | Write a wrapper iterator which delgates to another iterator, which you would construct from your insert iterator. Your delegate then can set a `modified` member to be true in the `operator=` method.
Something along the lines of this:
```
template<typename ITER>
class ModifiedIterator : public std::iterator<std::outpu... | You have at least the following two options:
1. Write your own version `inserter` which takes an extra boolean reference parameter as an argument which is set to true if `cont.insert (...).second` is true.
2. Before the 'if' statement in the caller code, store the size of the container. If it has more elements after t... |
31,608,365 | I have created a shape which represents a page with a shadow that gets bigger towards the bottom.
```css
body {
background: #dddddd;
}
div {
background: white;
margin: 40px auto;
height: 300px;
width: 300px;
position: relative;
padding: 10px;
}
div:before,
div:after {
height: 96%;
z-ind... | 2015/07/24 | [
"https://Stackoverflow.com/questions/31608365",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2889988/"
] | >
> **Note:** This answer does not describe how to fix the stacking context problem that is seen in your approach. This just provides a couple of alternate approaches that could be used to achieve a similar effect. **Advantage** of these approaches is that they **should work in IE10+ and does not require any extra ele... | If you use another `div` it fixes the problem that you are experiencing, so that the background colour is on the inner `div` and the rotate is on the outer `div`.
Else you might need to use another method to get the same result.
```css
body {
background: #dddddd;
}
.two{
background: white;
height: 300px;
wid... |
31,608,365 | I have created a shape which represents a page with a shadow that gets bigger towards the bottom.
```css
body {
background: #dddddd;
}
div {
background: white;
margin: 40px auto;
height: 300px;
width: 300px;
position: relative;
padding: 10px;
}
div:before,
div:after {
height: 96%;
z-ind... | 2015/07/24 | [
"https://Stackoverflow.com/questions/31608365",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2889988/"
] | If you use another `div` it fixes the problem that you are experiencing, so that the background colour is on the inner `div` and the rotate is on the outer `div`.
Else you might need to use another method to get the same result.
```css
body {
background: #dddddd;
}
.two{
background: white;
height: 300px;
wid... | When you go into the transforms world, the transforms themselves will solve some of the problems that they create.
You can solve this with the 3d equivalent of z-index, the Z coordinate
Unfortunately, this won't work in IE (I believe until they support preserve 3d)
```css
body {
background: #dddddd;
}
div {
b... |
31,608,365 | I have created a shape which represents a page with a shadow that gets bigger towards the bottom.
```css
body {
background: #dddddd;
}
div {
background: white;
margin: 40px auto;
height: 300px;
width: 300px;
position: relative;
padding: 10px;
}
div:before,
div:after {
height: 96%;
z-ind... | 2015/07/24 | [
"https://Stackoverflow.com/questions/31608365",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2889988/"
] | >
> **Note:** This answer does not describe how to fix the stacking context problem that is seen in your approach. This just provides a couple of alternate approaches that could be used to achieve a similar effect. **Advantage** of these approaches is that they **should work in IE10+ and does not require any extra ele... | When you go into the transforms world, the transforms themselves will solve some of the problems that they create.
You can solve this with the 3d equivalent of z-index, the Z coordinate
Unfortunately, this won't work in IE (I believe until they support preserve 3d)
```css
body {
background: #dddddd;
}
div {
b... |
6,760 | I now have an immersion wort chiller, it does a pretty decent job chilling boiling wort to around 85-90F very fast, about 5 minutes, but from there to 65-70 it takes a lot, maybe 15 minutes more and I waste a lot of water. I friend suggested that i put sanitized ice packs directly into the wort once it reached the 90F ... | 2012/03/30 | [
"https://homebrew.stackexchange.com/questions/6760",
"https://homebrew.stackexchange.com",
"https://homebrew.stackexchange.com/users/2170/"
] | Assuming that you have cleaned and sanitized the ice packs, this should work.
Are you stirring the wort while it cools? I find this helps a lot, especially as the temperature cools. Without stirring the cooled wort will sit over the chiller and the center of the pot isn't as effectively cooled.
Sticking your kettle i... | That could work, i would also fill them with boiled water. What type of container did you have in mind?
Being the wort would be around 90F, HDPE may be overkill but you could worry less of any stress causing these to leak.
If any of these were to leak, the water would be sanitized, but that could totally screw up your... |
6,760 | I now have an immersion wort chiller, it does a pretty decent job chilling boiling wort to around 85-90F very fast, about 5 minutes, but from there to 65-70 it takes a lot, maybe 15 minutes more and I waste a lot of water. I friend suggested that i put sanitized ice packs directly into the wort once it reached the 90F ... | 2012/03/30 | [
"https://homebrew.stackexchange.com/questions/6760",
"https://homebrew.stackexchange.com",
"https://homebrew.stackexchange.com/users/2170/"
] | Assuming that you have cleaned and sanitized the ice packs, this should work.
Are you stirring the wort while it cools? I find this helps a lot, especially as the temperature cools. Without stirring the cooled wort will sit over the chiller and the center of the pot isn't as effectively cooled.
Sticking your kettle i... | I have a copper wort-chiller as well, but before I had it, I used ice to cool my beer.
I would sterilize Pyrex glass containers, and put boiled-and-cooled water in them, and into the freezer a few days before brewing. I would put the pot in a sink full of cold water, and put the ice from the container into the pot (no... |
6,760 | I now have an immersion wort chiller, it does a pretty decent job chilling boiling wort to around 85-90F very fast, about 5 minutes, but from there to 65-70 it takes a lot, maybe 15 minutes more and I waste a lot of water. I friend suggested that i put sanitized ice packs directly into the wort once it reached the 90F ... | 2012/03/30 | [
"https://homebrew.stackexchange.com/questions/6760",
"https://homebrew.stackexchange.com",
"https://homebrew.stackexchange.com/users/2170/"
] | I would pass on that technique. Most ice packs I have seen have weird textured surfaces. There is also embossed lettering on them too. The likelyhood of actually sanitizing all though nooks and crannies is low.
Unless you are talking about sourcing some uber smooth surfaced bottles and freezing them it might be worth ... | That could work, i would also fill them with boiled water. What type of container did you have in mind?
Being the wort would be around 90F, HDPE may be overkill but you could worry less of any stress causing these to leak.
If any of these were to leak, the water would be sanitized, but that could totally screw up your... |
6,760 | I now have an immersion wort chiller, it does a pretty decent job chilling boiling wort to around 85-90F very fast, about 5 minutes, but from there to 65-70 it takes a lot, maybe 15 minutes more and I waste a lot of water. I friend suggested that i put sanitized ice packs directly into the wort once it reached the 90F ... | 2012/03/30 | [
"https://homebrew.stackexchange.com/questions/6760",
"https://homebrew.stackexchange.com",
"https://homebrew.stackexchange.com/users/2170/"
] | I have a copper wort-chiller as well, but before I had it, I used ice to cool my beer.
I would sterilize Pyrex glass containers, and put boiled-and-cooled water in them, and into the freezer a few days before brewing. I would put the pot in a sink full of cold water, and put the ice from the container into the pot (no... | That could work, i would also fill them with boiled water. What type of container did you have in mind?
Being the wort would be around 90F, HDPE may be overkill but you could worry less of any stress causing these to leak.
If any of these were to leak, the water would be sanitized, but that could totally screw up your... |
6,760 | I now have an immersion wort chiller, it does a pretty decent job chilling boiling wort to around 85-90F very fast, about 5 minutes, but from there to 65-70 it takes a lot, maybe 15 minutes more and I waste a lot of water. I friend suggested that i put sanitized ice packs directly into the wort once it reached the 90F ... | 2012/03/30 | [
"https://homebrew.stackexchange.com/questions/6760",
"https://homebrew.stackexchange.com",
"https://homebrew.stackexchange.com/users/2170/"
] | I would pass on that technique. Most ice packs I have seen have weird textured surfaces. There is also embossed lettering on them too. The likelyhood of actually sanitizing all though nooks and crannies is low.
Unless you are talking about sourcing some uber smooth surfaced bottles and freezing them it might be worth ... | I have a copper wort-chiller as well, but before I had it, I used ice to cool my beer.
I would sterilize Pyrex glass containers, and put boiled-and-cooled water in them, and into the freezer a few days before brewing. I would put the pot in a sink full of cold water, and put the ice from the container into the pot (no... |
51,184,561 | I have this simple markup:
```
<div v-for="(node, index) in nodes" :key="index + 1">
<p>This is a paragraph</p>
</div>
```
Along with this:
```
new Vue({
el: '#app',
data: {
nodes: [{
left: 0,
top: 0
}],
},
addNode: function(position){
this.nodes.push(position)
}
})
```
Now, a... | 2018/07/05 | [
"https://Stackoverflow.com/questions/51184561",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7190575/"
] | These come to my mind first :
* [atomic](https://en.cppreference.com/w/cpp/atomic/atomic) and [memory\_model](https://en.cppreference.com/w/cpp/language/memory_model) : they allow writing portable code in concurrent / lockfree contexts.
* [unique\_ptr](https://en.cppreference.com/w/cpp/memory/unique_ptr) : helps simpl... | *And one can always argue that the new language features make the code clearer …thus fewer errors regarding misunderstandings; especially if the compiler is able to test and verify your assumptions.*
In my not so humble opinion, there are few language features, that is, *standard general purpose* programming language ... |
1,988,230 | I am implementing a tag cloud system based on [this](http://forge.mysql.com/wiki/TagSchema#Recommended_Architecture) recommendation. (However, I am not using foreign keys)
I am allowing up to 25 tags. My question is, how can I handle editing on the items? I have this item adding/editing page:
Title:
Description:
Tags... | 2010/01/01 | [
"https://Stackoverflow.com/questions/1988230",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/229335/"
] | Each object on the managed heap can be used as a lock-object, which is a means to synchronize access between threads.
>
> I thought it just stops the thread until the content of {} is finished.
>
>
>
Well, a `lock` it stops **other** threads from acquiring the lock until the lock is released, which is most common... | The object itself isn't locked. Think of each object as having an *associated* lock (or *monitor*). When one thread has acquired the lock, no other thread can acquire it without the first thread releasing it, either by calling `Monitor.Exit` (which is what happens at the end of a `lock` statement) or by calling `Monito... |
1,988,230 | I am implementing a tag cloud system based on [this](http://forge.mysql.com/wiki/TagSchema#Recommended_Architecture) recommendation. (However, I am not using foreign keys)
I am allowing up to 25 tags. My question is, how can I handle editing on the items? I have this item adding/editing page:
Title:
Description:
Tags... | 2010/01/01 | [
"https://Stackoverflow.com/questions/1988230",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/229335/"
] | Each object on the managed heap can be used as a lock-object, which is a means to synchronize access between threads.
>
> I thought it just stops the thread until the content of {} is finished.
>
>
>
Well, a `lock` it stops **other** threads from acquiring the lock until the lock is released, which is most common... | Locking an object does nothing to the object itself - it simply means that any other thread trying to lock the same object will be stalled until the locking thread releases it.
The reason that lock(this) is frowned upon is that other code outside the object can also lock the object and thus interfere with its normal op... |
1,988,230 | I am implementing a tag cloud system based on [this](http://forge.mysql.com/wiki/TagSchema#Recommended_Architecture) recommendation. (However, I am not using foreign keys)
I am allowing up to 25 tags. My question is, how can I handle editing on the items? I have this item adding/editing page:
Title:
Description:
Tags... | 2010/01/01 | [
"https://Stackoverflow.com/questions/1988230",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/229335/"
] | Each object on the managed heap can be used as a lock-object, which is a means to synchronize access between threads.
>
> I thought it just stops the thread until the content of {} is finished.
>
>
>
Well, a `lock` it stops **other** threads from acquiring the lock until the lock is released, which is most common... | When you use `lock(someObject) { ...code... }` it means only when thread can be inside the locked region at a time (assuming you always lock on the same object!). A second thread that attempts to enter the region will block and have to wait until the first thread leaves. If you have two `lock (someObject) { }` regions ... |
1,988,230 | I am implementing a tag cloud system based on [this](http://forge.mysql.com/wiki/TagSchema#Recommended_Architecture) recommendation. (However, I am not using foreign keys)
I am allowing up to 25 tags. My question is, how can I handle editing on the items? I have this item adding/editing page:
Title:
Description:
Tags... | 2010/01/01 | [
"https://Stackoverflow.com/questions/1988230",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/229335/"
] | Each object on the managed heap can be used as a lock-object, which is a means to synchronize access between threads.
>
> I thought it just stops the thread until the content of {} is finished.
>
>
>
Well, a `lock` it stops **other** threads from acquiring the lock until the lock is released, which is most common... | ```
using System;
using System.Threading;
class sycexp
{
public static void Main()
{
exp e=new exp();
Thread t1=new Thread(new ThreadStart(e.show));
Thread t2=new Thread(new Th... |
1,988,230 | I am implementing a tag cloud system based on [this](http://forge.mysql.com/wiki/TagSchema#Recommended_Architecture) recommendation. (However, I am not using foreign keys)
I am allowing up to 25 tags. My question is, how can I handle editing on the items? I have this item adding/editing page:
Title:
Description:
Tags... | 2010/01/01 | [
"https://Stackoverflow.com/questions/1988230",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/229335/"
] | The object itself isn't locked. Think of each object as having an *associated* lock (or *monitor*). When one thread has acquired the lock, no other thread can acquire it without the first thread releasing it, either by calling `Monitor.Exit` (which is what happens at the end of a `lock` statement) or by calling `Monito... | Locking an object does nothing to the object itself - it simply means that any other thread trying to lock the same object will be stalled until the locking thread releases it.
The reason that lock(this) is frowned upon is that other code outside the object can also lock the object and thus interfere with its normal op... |
1,988,230 | I am implementing a tag cloud system based on [this](http://forge.mysql.com/wiki/TagSchema#Recommended_Architecture) recommendation. (However, I am not using foreign keys)
I am allowing up to 25 tags. My question is, how can I handle editing on the items? I have this item adding/editing page:
Title:
Description:
Tags... | 2010/01/01 | [
"https://Stackoverflow.com/questions/1988230",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/229335/"
] | The object itself isn't locked. Think of each object as having an *associated* lock (or *monitor*). When one thread has acquired the lock, no other thread can acquire it without the first thread releasing it, either by calling `Monitor.Exit` (which is what happens at the end of a `lock` statement) or by calling `Monito... | When you use `lock(someObject) { ...code... }` it means only when thread can be inside the locked region at a time (assuming you always lock on the same object!). A second thread that attempts to enter the region will block and have to wait until the first thread leaves. If you have two `lock (someObject) { }` regions ... |
1,988,230 | I am implementing a tag cloud system based on [this](http://forge.mysql.com/wiki/TagSchema#Recommended_Architecture) recommendation. (However, I am not using foreign keys)
I am allowing up to 25 tags. My question is, how can I handle editing on the items? I have this item adding/editing page:
Title:
Description:
Tags... | 2010/01/01 | [
"https://Stackoverflow.com/questions/1988230",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/229335/"
] | The object itself isn't locked. Think of each object as having an *associated* lock (or *monitor*). When one thread has acquired the lock, no other thread can acquire it without the first thread releasing it, either by calling `Monitor.Exit` (which is what happens at the end of a `lock` statement) or by calling `Monito... | ```
using System;
using System.Threading;
class sycexp
{
public static void Main()
{
exp e=new exp();
Thread t1=new Thread(new ThreadStart(e.show));
Thread t2=new Thread(new Th... |
1,988,230 | I am implementing a tag cloud system based on [this](http://forge.mysql.com/wiki/TagSchema#Recommended_Architecture) recommendation. (However, I am not using foreign keys)
I am allowing up to 25 tags. My question is, how can I handle editing on the items? I have this item adding/editing page:
Title:
Description:
Tags... | 2010/01/01 | [
"https://Stackoverflow.com/questions/1988230",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/229335/"
] | Locking an object does nothing to the object itself - it simply means that any other thread trying to lock the same object will be stalled until the locking thread releases it.
The reason that lock(this) is frowned upon is that other code outside the object can also lock the object and thus interfere with its normal op... | ```
using System;
using System.Threading;
class sycexp
{
public static void Main()
{
exp e=new exp();
Thread t1=new Thread(new ThreadStart(e.show));
Thread t2=new Thread(new Th... |
1,988,230 | I am implementing a tag cloud system based on [this](http://forge.mysql.com/wiki/TagSchema#Recommended_Architecture) recommendation. (However, I am not using foreign keys)
I am allowing up to 25 tags. My question is, how can I handle editing on the items? I have this item adding/editing page:
Title:
Description:
Tags... | 2010/01/01 | [
"https://Stackoverflow.com/questions/1988230",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/229335/"
] | When you use `lock(someObject) { ...code... }` it means only when thread can be inside the locked region at a time (assuming you always lock on the same object!). A second thread that attempts to enter the region will block and have to wait until the first thread leaves. If you have two `lock (someObject) { }` regions ... | ```
using System;
using System.Threading;
class sycexp
{
public static void Main()
{
exp e=new exp();
Thread t1=new Thread(new ThreadStart(e.show));
Thread t2=new Thread(new Th... |
146,557 | I was reading a question about the Python *global* statement ( ["Python scope"](https://stackoverflow.com/questions/146359/python-scope) ) and I was remembering about how often I used this statement when I was a Python beginner (I used *global* a lot) and how, nowadays, years later, I don't use it at all, ever. I even ... | 2008/09/28 | [
"https://Stackoverflow.com/questions/146557",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20037/"
] | I've used it in situations where a function creates or sets variables which will be used globally. Here are some examples:
```
discretes = 0
def use_discretes():
#this global statement is a message to the parser to refer
#to the globally defined identifier "discretes"
global discretes
if using_real_ha... | I use it for global options with command-line scripts and 'optparse':
my main() parses the arguments and passes those to whatever function does the work of the script... but writes the supplied options to a global 'opts' dictionary.
Shell script options often tweak 'leaf' behavior, and it's inconvenient (and unnecess... |
146,557 | I was reading a question about the Python *global* statement ( ["Python scope"](https://stackoverflow.com/questions/146359/python-scope) ) and I was remembering about how often I used this statement when I was a Python beginner (I used *global* a lot) and how, nowadays, years later, I don't use it at all, ever. I even ... | 2008/09/28 | [
"https://Stackoverflow.com/questions/146557",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20037/"
] | I've used it in situations where a function creates or sets variables which will be used globally. Here are some examples:
```
discretes = 0
def use_discretes():
#this global statement is a message to the parser to refer
#to the globally defined identifier "discretes"
global discretes
if using_real_ha... | I avoid it and we even have a [pylint](http://www.logilab.org/857) rule that forbids it in our production code. I actually believe it shouldn't even exist at all. |
146,557 | I was reading a question about the Python *global* statement ( ["Python scope"](https://stackoverflow.com/questions/146359/python-scope) ) and I was remembering about how often I used this statement when I was a Python beginner (I used *global* a lot) and how, nowadays, years later, I don't use it at all, ever. I even ... | 2008/09/28 | [
"https://Stackoverflow.com/questions/146557",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20037/"
] | Objects are the prefered way of having non-local state, so global is rarely needed. I dont think the upcoming nonlocal modifier is going to be widely used either, I think its mostly there to make lispers stop complaining :-) | Once or twice. But it was always good starting point to refactor. |
146,557 | I was reading a question about the Python *global* statement ( ["Python scope"](https://stackoverflow.com/questions/146359/python-scope) ) and I was remembering about how often I used this statement when I was a Python beginner (I used *global* a lot) and how, nowadays, years later, I don't use it at all, ever. I even ... | 2008/09/28 | [
"https://Stackoverflow.com/questions/146557",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20037/"
] | I use 'global' in a context such as this:
```
_cached_result = None
def myComputationallyExpensiveFunction():
global _cached_result
if _cached_result:
return _cached_result
# ... figure out result
_cached_result = result
return result
```
I use 'global' because it makes sense and is clea... | I avoid it and we even have a [pylint](http://www.logilab.org/857) rule that forbids it in our production code. I actually believe it shouldn't even exist at all. |
146,557 | I was reading a question about the Python *global* statement ( ["Python scope"](https://stackoverflow.com/questions/146359/python-scope) ) and I was remembering about how often I used this statement when I was a Python beginner (I used *global* a lot) and how, nowadays, years later, I don't use it at all, ever. I even ... | 2008/09/28 | [
"https://Stackoverflow.com/questions/146557",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20037/"
] | Rarely. I've yet to find a use for it at all. | If I can avoid it, no. And, to my knowledge, there is always a way to avoid it. But I'm not stating that it's totally useless either |
146,557 | I was reading a question about the Python *global* statement ( ["Python scope"](https://stackoverflow.com/questions/146359/python-scope) ) and I was remembering about how often I used this statement when I was a Python beginner (I used *global* a lot) and how, nowadays, years later, I don't use it at all, ever. I even ... | 2008/09/28 | [
"https://Stackoverflow.com/questions/146557",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20037/"
] | In my view, as soon as you feel the need to use global variables in a python code, it's a great time to stop for a bit and work on refactoring of your code.
Putting the `global` in the code and delaying the refactoring process might sound promising if your dead-line is close, but, believe me, you're not gonna go bac... | Objects are the prefered way of having non-local state, so global is rarely needed. I dont think the upcoming nonlocal modifier is going to be widely used either, I think its mostly there to make lispers stop complaining :-) |
146,557 | I was reading a question about the Python *global* statement ( ["Python scope"](https://stackoverflow.com/questions/146359/python-scope) ) and I was remembering about how often I used this statement when I was a Python beginner (I used *global* a lot) and how, nowadays, years later, I don't use it at all, ever. I even ... | 2008/09/28 | [
"https://Stackoverflow.com/questions/146557",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20037/"
] | I've used it in situations where a function creates or sets variables which will be used globally. Here are some examples:
```
discretes = 0
def use_discretes():
#this global statement is a message to the parser to refer
#to the globally defined identifier "discretes"
global discretes
if using_real_ha... | Once or twice. But it was always good starting point to refactor. |
146,557 | I was reading a question about the Python *global* statement ( ["Python scope"](https://stackoverflow.com/questions/146359/python-scope) ) and I was remembering about how often I used this statement when I was a Python beginner (I used *global* a lot) and how, nowadays, years later, I don't use it at all, ever. I even ... | 2008/09/28 | [
"https://Stackoverflow.com/questions/146557",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20037/"
] | In my view, as soon as you feel the need to use global variables in a python code, it's a great time to stop for a bit and work on refactoring of your code.
Putting the `global` in the code and delaying the refactoring process might sound promising if your dead-line is close, but, believe me, you're not gonna go bac... | I've used it in quick & dirty, single-use scripts to automate some one-time task. Anything bigger than that, or that needs to be reused, and I'll find a more elegant way. |
146,557 | I was reading a question about the Python *global* statement ( ["Python scope"](https://stackoverflow.com/questions/146359/python-scope) ) and I was remembering about how often I used this statement when I was a Python beginner (I used *global* a lot) and how, nowadays, years later, I don't use it at all, ever. I even ... | 2008/09/28 | [
"https://Stackoverflow.com/questions/146557",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20037/"
] | I use 'global' in a context such as this:
```
_cached_result = None
def myComputationallyExpensiveFunction():
global _cached_result
if _cached_result:
return _cached_result
# ... figure out result
_cached_result = result
return result
```
I use 'global' because it makes sense and is clea... | I use it for global options with command-line scripts and 'optparse':
my main() parses the arguments and passes those to whatever function does the work of the script... but writes the supplied options to a global 'opts' dictionary.
Shell script options often tweak 'leaf' behavior, and it's inconvenient (and unnecess... |
146,557 | I was reading a question about the Python *global* statement ( ["Python scope"](https://stackoverflow.com/questions/146359/python-scope) ) and I was remembering about how often I used this statement when I was a Python beginner (I used *global* a lot) and how, nowadays, years later, I don't use it at all, ever. I even ... | 2008/09/28 | [
"https://Stackoverflow.com/questions/146557",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20037/"
] | I use 'global' in a context such as this:
```
_cached_result = None
def myComputationallyExpensiveFunction():
global _cached_result
if _cached_result:
return _cached_result
# ... figure out result
_cached_result = result
return result
```
I use 'global' because it makes sense and is clea... | If I can avoid it, no. And, to my knowledge, there is always a way to avoid it. But I'm not stating that it's totally useless either |
54,264,689 | i have this google map url
I tried to embed using iframe to my website but it's not working
```html
<iframe id="iframeid"
width="450"
height="250"
style="border:0"
src="https://www.google.com/maps/dir/?api=1&origin=Space+Needle+Seattle+WA&destination=Pike+Place+Market+Seattle+WA&travelmode=bicyclin... | 2019/01/19 | [
"https://Stackoverflow.com/questions/54264689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10432340/"
] | Here is another way of implementing:
```html
<iframe width="100%" height="600" src="https://maps.google.com/maps?width=100%&height=600&hl=en&coord=52.70967533219885, -8.020019531250002&q=1%20Grafton%20Street%2C%20Dublin%2C%20Ireland&ie=UTF8&t=&z=14&iwloc=B&output=embed" frameborder=... | First, check out [how to ask](https://stackoverflow.com/help/how-to-ask)
From the looks of it, I would start [on googles developer guide](https://developers.google.com/maps/documentation/embed/guide), you need to request an API key. Then try to put that code with the API key put into your html code
```
<iframe
wid... |
54,264,689 | i have this google map url
I tried to embed using iframe to my website but it's not working
```html
<iframe id="iframeid"
width="450"
height="250"
style="border:0"
src="https://www.google.com/maps/dir/?api=1&origin=Space+Needle+Seattle+WA&destination=Pike+Place+Market+Seattle+WA&travelmode=bicyclin... | 2019/01/19 | [
"https://Stackoverflow.com/questions/54264689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10432340/"
] | If you check the console you will find the following error,
`Refused to display 'https://www.google.com/maps/dir/?api=1&origin=Space+Needle+Seattle+WA&destination=Pike+Place+Market+Seattle+WA&travelmode=bicycling' in a frame because it set 'X-Frame-Options' to 'sameorigin'.`
[Here](https://stackoverflow.com/questions... | First, check out [how to ask](https://stackoverflow.com/help/how-to-ask)
From the looks of it, I would start [on googles developer guide](https://developers.google.com/maps/documentation/embed/guide), you need to request an API key. Then try to put that code with the API key put into your html code
```
<iframe
wid... |
54,264,689 | i have this google map url
I tried to embed using iframe to my website but it's not working
```html
<iframe id="iframeid"
width="450"
height="250"
style="border:0"
src="https://www.google.com/maps/dir/?api=1&origin=Space+Needle+Seattle+WA&destination=Pike+Place+Market+Seattle+WA&travelmode=bicyclin... | 2019/01/19 | [
"https://Stackoverflow.com/questions/54264689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10432340/"
] | you can generate HTML code for the location from google maps, follow this.
[Share a map or directions with others](https://support.google.com/maps/answer/144361?co=GENIE.Platform%3DDesktop&hl=en) | First, check out [how to ask](https://stackoverflow.com/help/how-to-ask)
From the looks of it, I would start [on googles developer guide](https://developers.google.com/maps/documentation/embed/guide), you need to request an API key. Then try to put that code with the API key put into your html code
```
<iframe
wid... |
54,264,689 | i have this google map url
I tried to embed using iframe to my website but it's not working
```html
<iframe id="iframeid"
width="450"
height="250"
style="border:0"
src="https://www.google.com/maps/dir/?api=1&origin=Space+Needle+Seattle+WA&destination=Pike+Place+Market+Seattle+WA&travelmode=bicyclin... | 2019/01/19 | [
"https://Stackoverflow.com/questions/54264689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10432340/"
] | It looks like all the google earth maps require a paid API KEY to use. However, I was able to create the embedded maps I was looking for by
1. Using Google earth to create any overlay layers or markers and saving them as kmz files.
2. going to [maps.google.com](https://maps.google.com) and creating my own map
* Go to... | First, check out [how to ask](https://stackoverflow.com/help/how-to-ask)
From the looks of it, I would start [on googles developer guide](https://developers.google.com/maps/documentation/embed/guide), you need to request an API key. Then try to put that code with the API key put into your html code
```
<iframe
wid... |
54,264,689 | i have this google map url
I tried to embed using iframe to my website but it's not working
```html
<iframe id="iframeid"
width="450"
height="250"
style="border:0"
src="https://www.google.com/maps/dir/?api=1&origin=Space+Needle+Seattle+WA&destination=Pike+Place+Market+Seattle+WA&travelmode=bicyclin... | 2019/01/19 | [
"https://Stackoverflow.com/questions/54264689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10432340/"
] | Here is another way of implementing:
```html
<iframe width="100%" height="600" src="https://maps.google.com/maps?width=100%&height=600&hl=en&coord=52.70967533219885, -8.020019531250002&q=1%20Grafton%20Street%2C%20Dublin%2C%20Ireland&ie=UTF8&t=&z=14&iwloc=B&output=embed" frameborder=... | If you check the console you will find the following error,
`Refused to display 'https://www.google.com/maps/dir/?api=1&origin=Space+Needle+Seattle+WA&destination=Pike+Place+Market+Seattle+WA&travelmode=bicycling' in a frame because it set 'X-Frame-Options' to 'sameorigin'.`
[Here](https://stackoverflow.com/questions... |
54,264,689 | i have this google map url
I tried to embed using iframe to my website but it's not working
```html
<iframe id="iframeid"
width="450"
height="250"
style="border:0"
src="https://www.google.com/maps/dir/?api=1&origin=Space+Needle+Seattle+WA&destination=Pike+Place+Market+Seattle+WA&travelmode=bicyclin... | 2019/01/19 | [
"https://Stackoverflow.com/questions/54264689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10432340/"
] | Here is another way of implementing:
```html
<iframe width="100%" height="600" src="https://maps.google.com/maps?width=100%&height=600&hl=en&coord=52.70967533219885, -8.020019531250002&q=1%20Grafton%20Street%2C%20Dublin%2C%20Ireland&ie=UTF8&t=&z=14&iwloc=B&output=embed" frameborder=... | you can generate HTML code for the location from google maps, follow this.
[Share a map or directions with others](https://support.google.com/maps/answer/144361?co=GENIE.Platform%3DDesktop&hl=en) |
54,264,689 | i have this google map url
I tried to embed using iframe to my website but it's not working
```html
<iframe id="iframeid"
width="450"
height="250"
style="border:0"
src="https://www.google.com/maps/dir/?api=1&origin=Space+Needle+Seattle+WA&destination=Pike+Place+Market+Seattle+WA&travelmode=bicyclin... | 2019/01/19 | [
"https://Stackoverflow.com/questions/54264689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10432340/"
] | Here is another way of implementing:
```html
<iframe width="100%" height="600" src="https://maps.google.com/maps?width=100%&height=600&hl=en&coord=52.70967533219885, -8.020019531250002&q=1%20Grafton%20Street%2C%20Dublin%2C%20Ireland&ie=UTF8&t=&z=14&iwloc=B&output=embed" frameborder=... | It looks like all the google earth maps require a paid API KEY to use. However, I was able to create the embedded maps I was looking for by
1. Using Google earth to create any overlay layers or markers and saving them as kmz files.
2. going to [maps.google.com](https://maps.google.com) and creating my own map
* Go to... |
54,264,689 | i have this google map url
I tried to embed using iframe to my website but it's not working
```html
<iframe id="iframeid"
width="450"
height="250"
style="border:0"
src="https://www.google.com/maps/dir/?api=1&origin=Space+Needle+Seattle+WA&destination=Pike+Place+Market+Seattle+WA&travelmode=bicyclin... | 2019/01/19 | [
"https://Stackoverflow.com/questions/54264689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10432340/"
] | If you check the console you will find the following error,
`Refused to display 'https://www.google.com/maps/dir/?api=1&origin=Space+Needle+Seattle+WA&destination=Pike+Place+Market+Seattle+WA&travelmode=bicycling' in a frame because it set 'X-Frame-Options' to 'sameorigin'.`
[Here](https://stackoverflow.com/questions... | you can generate HTML code for the location from google maps, follow this.
[Share a map or directions with others](https://support.google.com/maps/answer/144361?co=GENIE.Platform%3DDesktop&hl=en) |
54,264,689 | i have this google map url
I tried to embed using iframe to my website but it's not working
```html
<iframe id="iframeid"
width="450"
height="250"
style="border:0"
src="https://www.google.com/maps/dir/?api=1&origin=Space+Needle+Seattle+WA&destination=Pike+Place+Market+Seattle+WA&travelmode=bicyclin... | 2019/01/19 | [
"https://Stackoverflow.com/questions/54264689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10432340/"
] | It looks like all the google earth maps require a paid API KEY to use. However, I was able to create the embedded maps I was looking for by
1. Using Google earth to create any overlay layers or markers and saving them as kmz files.
2. going to [maps.google.com](https://maps.google.com) and creating my own map
* Go to... | you can generate HTML code for the location from google maps, follow this.
[Share a map or directions with others](https://support.google.com/maps/answer/144361?co=GENIE.Platform%3DDesktop&hl=en) |
31,760 | In this weeks parsha of Vayeira, I counted 6 references to the words דלת and פתח, all in the story of Lot and Sodom. I don't believe this is a coincidence, since its all about standing in the door, opening the door, closing the door, all of which is irrelevant information. It must be teaching something.
>
> Genesis 1... | 2013/10/19 | [
"https://judaism.stackexchange.com/questions/31760",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/1739/"
] | The following is my understanding based on things I've read, but I can't give any sources at present.
On a physical level, a doorway or a gateway is the dividing line between one domain and another. If there is a door, opening it allows people or things to go from one domain to the other, and closing it effects the op... | I think in the Sdom story, it serves to emphasize that there's an angry, dangerous crowd outside and it's just barely safe inside.
In the Haftorah, Malbim and others point out that if we're asking G-d for a miracle, we attempt to make it as non-disruptive as possible, thus the fewer people who observe it the better. H... |
31,760 | In this weeks parsha of Vayeira, I counted 6 references to the words דלת and פתח, all in the story of Lot and Sodom. I don't believe this is a coincidence, since its all about standing in the door, opening the door, closing the door, all of which is irrelevant information. It must be teaching something.
>
> Genesis 1... | 2013/10/19 | [
"https://judaism.stackexchange.com/questions/31760",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/1739/"
] | Firstly, yasher kochacho on a really good observation!
[Rav Yosef Tzvi Rimon](https://mizrachi.org/speaker/rabbi-yosef-zvi-rimon/) makes an interesting analysis [here](https://www1.biu.ac.il/indexE.php?id=19368&pt=1&pid=14327&level=0&cPath=43,14206,14211,14327,19368#_ftn1).
He notes that there are interesting paralle... | The following is my understanding based on things I've read, but I can't give any sources at present.
On a physical level, a doorway or a gateway is the dividing line between one domain and another. If there is a door, opening it allows people or things to go from one domain to the other, and closing it effects the op... |
31,760 | In this weeks parsha of Vayeira, I counted 6 references to the words דלת and פתח, all in the story of Lot and Sodom. I don't believe this is a coincidence, since its all about standing in the door, opening the door, closing the door, all of which is irrelevant information. It must be teaching something.
>
> Genesis 1... | 2013/10/19 | [
"https://judaism.stackexchange.com/questions/31760",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/1739/"
] | The following is my understanding based on things I've read, but I can't give any sources at present.
On a physical level, a doorway or a gateway is the dividing line between one domain and another. If there is a door, opening it allows people or things to go from one domain to the other, and closing it effects the op... | I am not sure why you are translating פתח and פתחה (which is the same as לפתח; See Rashi ד״ה הרה נסו of Bereishit 14:10) as door when it simply means an opening, specifically the space before the door which we might refer to as a vestibule. Rashi even defines פתח (Bereishit 19:11) as the space through which people ente... |
31,760 | In this weeks parsha of Vayeira, I counted 6 references to the words דלת and פתח, all in the story of Lot and Sodom. I don't believe this is a coincidence, since its all about standing in the door, opening the door, closing the door, all of which is irrelevant information. It must be teaching something.
>
> Genesis 1... | 2013/10/19 | [
"https://judaism.stackexchange.com/questions/31760",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/1739/"
] | Firstly, yasher kochacho on a really good observation!
[Rav Yosef Tzvi Rimon](https://mizrachi.org/speaker/rabbi-yosef-zvi-rimon/) makes an interesting analysis [here](https://www1.biu.ac.il/indexE.php?id=19368&pt=1&pid=14327&level=0&cPath=43,14206,14211,14327,19368#_ftn1).
He notes that there are interesting paralle... | I think in the Sdom story, it serves to emphasize that there's an angry, dangerous crowd outside and it's just barely safe inside.
In the Haftorah, Malbim and others point out that if we're asking G-d for a miracle, we attempt to make it as non-disruptive as possible, thus the fewer people who observe it the better. H... |
31,760 | In this weeks parsha of Vayeira, I counted 6 references to the words דלת and פתח, all in the story of Lot and Sodom. I don't believe this is a coincidence, since its all about standing in the door, opening the door, closing the door, all of which is irrelevant information. It must be teaching something.
>
> Genesis 1... | 2013/10/19 | [
"https://judaism.stackexchange.com/questions/31760",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/1739/"
] | Firstly, yasher kochacho on a really good observation!
[Rav Yosef Tzvi Rimon](https://mizrachi.org/speaker/rabbi-yosef-zvi-rimon/) makes an interesting analysis [here](https://www1.biu.ac.il/indexE.php?id=19368&pt=1&pid=14327&level=0&cPath=43,14206,14211,14327,19368#_ftn1).
He notes that there are interesting paralle... | I am not sure why you are translating פתח and פתחה (which is the same as לפתח; See Rashi ד״ה הרה נסו of Bereishit 14:10) as door when it simply means an opening, specifically the space before the door which we might refer to as a vestibule. Rashi even defines פתח (Bereishit 19:11) as the space through which people ente... |
56,859,479 | Counting the amount of lines in the file and counting the numbers in each line. Then writing it out to an output file
Code:
```
num_lines = 0
with open("Version2_file.txt", 'r') as f:
for line in f:
num_lines += 1
print("Number of lines:")
print(num_lines)
```
From Text file:
```none
1.0,1.123,1.123
1.... | 2019/07/02 | [
"https://Stackoverflow.com/questions/56859479",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11705794/"
] | Just subtract, subtraction is aligned on the index. You can reindex `df2` before subtracting to avoid NaNs:
```
# df1 - df2.reindex(df1.index)
df1.sub(df2.reindex(df1.index))
Jan17 Jun18 Dec18 Apr19
ID Name
0 Nick 5.0 0.0 1.7 0.0
1 Jack 4.0 0.0 2.0 0.0... | You can simply do
```
df1-df2.loc[df1.index]
```
Output:
```
Jan17 Jun18 Dec18 Apr19
ID Name
0 Nick 5.0 0.0 1.7 0.0
1 Jack 4.0 0.0 2.0 0.0
2 Fox 2.0 -3.3 0.0 0.0
3 Rex 0.0 0.0 2.0 0.0
``` |
56,859,479 | Counting the amount of lines in the file and counting the numbers in each line. Then writing it out to an output file
Code:
```
num_lines = 0
with open("Version2_file.txt", 'r') as f:
for line in f:
num_lines += 1
print("Number of lines:")
print(num_lines)
```
From Text file:
```none
1.0,1.123,1.123
1.... | 2019/07/02 | [
"https://Stackoverflow.com/questions/56859479",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11705794/"
] | Just subtract, subtraction is aligned on the index. You can reindex `df2` before subtracting to avoid NaNs:
```
# df1 - df2.reindex(df1.index)
df1.sub(df2.reindex(df1.index))
Jan17 Jun18 Dec18 Apr19
ID Name
0 Nick 5.0 0.0 1.7 0.0
1 Jack 4.0 0.0 2.0 0.0... | Try something new
```
sum(df1.align(0-df2,join='left'))
Out[282]:
Jan17 Jun18 Dec18 Apr19
ID Name
0 Nick 5.0 0.0 1.7 0.0
1 Jack 4.0 0.0 2.0 0.0
2 Fox 2.0 -3.3 0.0 0.0
3 Rex 0.0 0.0 2.0 0.0
``` |
56,859,479 | Counting the amount of lines in the file and counting the numbers in each line. Then writing it out to an output file
Code:
```
num_lines = 0
with open("Version2_file.txt", 'r') as f:
for line in f:
num_lines += 1
print("Number of lines:")
print(num_lines)
```
From Text file:
```none
1.0,1.123,1.123
1.... | 2019/07/02 | [
"https://Stackoverflow.com/questions/56859479",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11705794/"
] | You can simply do
```
df1-df2.loc[df1.index]
```
Output:
```
Jan17 Jun18 Dec18 Apr19
ID Name
0 Nick 5.0 0.0 1.7 0.0
1 Jack 4.0 0.0 2.0 0.0
2 Fox 2.0 -3.3 0.0 0.0
3 Rex 0.0 0.0 2.0 0.0
``` | Try something new
```
sum(df1.align(0-df2,join='left'))
Out[282]:
Jan17 Jun18 Dec18 Apr19
ID Name
0 Nick 5.0 0.0 1.7 0.0
1 Jack 4.0 0.0 2.0 0.0
2 Fox 2.0 -3.3 0.0 0.0
3 Rex 0.0 0.0 2.0 0.0
``` |
4,101,940 | A DataGridView bound by this code does not display information as expected:
```
dataGridView1.DataSource = ds;
```
here's the code for ds:
```
public DataSet ConnectandReadList()
{
DataSet ds = new DataSet();
string connection_string="Data Source=hermes;database=qcvalues; Integrated... | 2010/11/04 | [
"https://Stackoverflow.com/questions/4101940",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/117700/"
] | Try binding to the table inside the dataset: `dataGridView1.DataSource = ds.Tables[0];`
From the documentation for the [DataGridView.DataSource](http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.datasource.aspx) property, you can also bind to a `DataSet` and use the `DataMember` property:
>
>... | Is ds a DataSet?
If so, try setting your DGV's DataMember to a DataTable within the DataSet or specifying your DataSet's DataTable for the DataSource. |
52,500,161 | I'm new using the linux commands and I'm having a problem using the rm command in a makefile.
The makefile is in the **/project** directory and I want to remove all the files with extension .o that are in the **/project/src** folder.
I have tried with
```
rm /src/ -f *.o
```
and
```
rm /src -f *.o
```
I do not ... | 2018/09/25 | [
"https://Stackoverflow.com/questions/52500161",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9123167/"
] | You can delete files like this
```
rm -f src/*.o
```
-f is to force deletion, without confirmation | You can use: rm -f /projects/src/\*.o |
64,841 | I'd like to know if it's possible to send some to a command's stdin and then keep reading from the terminal.
The problem i'm trying to solve is executing some initialization code every time i open a Node.js REPL, so i have some functions available at the REPL from the start. Basically, to automate this:
```
$ node
> ... | 2013/02/15 | [
"https://unix.stackexchange.com/questions/64841",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/18533/"
] | ```
{ echo "require('./myutils')" ; cat ; } | node
```
Be aware that your REPL environment may act differently when taking input that's not from a terminal (for example, the prompt may not appear). | You can use [rlwrap](http://utopia.knoware.nl/~hlub/rlwrap/#rlwrap) (wrapper for the [readline](http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html) library) to interact with a program whose interaction capabilities don't suit you.
```
rlwrap node
```
Rlwrap can't send initial input to the command, but it comes ... |
49,119,392 | I am attempting to flatten a list using:
```
wd = ['this' , 'is']
np.asarray(list(map(lambda x : list(x) , wd))).flatten()
```
which returns:
```
array([['t', 'h', 'i', 's'], ['i', 's']], dtype=object)
```
when I'm expecting a char array: `['t','h','i','s','i','s']`
Is this correct use of `flatten`? | 2018/03/05 | [
"https://Stackoverflow.com/questions/49119392",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/470184/"
] | with just a list iteration:
```
[u for i in np.asarray(list(map(lambda x : list(x) , wd))) for u in i]
```
gives you this:
```
['t', 'h', 'i', 's', 'i', 's']
```
Although, as the comments say, you can just use `''.join()` for your specific example, this has the advantage of working for `numpy` arrays and lists of... | ```
In[8]: from itertools import chain
In[9]: list(chain.from_iterable(['this' , 'is']))
Out[9]: ['t', 'h', 'i', 's', 'i', 's']
``` |
49,119,392 | I am attempting to flatten a list using:
```
wd = ['this' , 'is']
np.asarray(list(map(lambda x : list(x) , wd))).flatten()
```
which returns:
```
array([['t', 'h', 'i', 's'], ['i', 's']], dtype=object)
```
when I'm expecting a char array: `['t','h','i','s','i','s']`
Is this correct use of `flatten`? | 2018/03/05 | [
"https://Stackoverflow.com/questions/49119392",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/470184/"
] | No, this isn't a correct use for `numpy.ndarray.flatten`.
Two-dimensional NumPy arrays have to be rectangular or they will be cast to object arrays (or it will throw an exception). With object arrays flatten won't work correctly (because it won't flatten the "objects") and rectangular is impossible because your words... | ```
In[8]: from itertools import chain
In[9]: list(chain.from_iterable(['this' , 'is']))
Out[9]: ['t', 'h', 'i', 's', 'i', 's']
``` |
49,119,392 | I am attempting to flatten a list using:
```
wd = ['this' , 'is']
np.asarray(list(map(lambda x : list(x) , wd))).flatten()
```
which returns:
```
array([['t', 'h', 'i', 's'], ['i', 's']], dtype=object)
```
when I'm expecting a char array: `['t','h','i','s','i','s']`
Is this correct use of `flatten`? | 2018/03/05 | [
"https://Stackoverflow.com/questions/49119392",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/470184/"
] | No, this isn't a correct use for `numpy.ndarray.flatten`.
Two-dimensional NumPy arrays have to be rectangular or they will be cast to object arrays (or it will throw an exception). With object arrays flatten won't work correctly (because it won't flatten the "objects") and rectangular is impossible because your words... | with just a list iteration:
```
[u for i in np.asarray(list(map(lambda x : list(x) , wd))) for u in i]
```
gives you this:
```
['t', 'h', 'i', 's', 'i', 's']
```
Although, as the comments say, you can just use `''.join()` for your specific example, this has the advantage of working for `numpy` arrays and lists of... |
54,098,426 | Why we cannot inherit a class with the private constructor in Java? Can anyone explain with simple example? | 2019/01/08 | [
"https://Stackoverflow.com/questions/54098426",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10594133/"
] | You can use [document.querySelectorAll()](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll) and [target.addEventListener()](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener) functions to achieve this without jQuery.
```js
document.querySelectorAll('.job-start-tm')... | Try something like this:
```
document.addEventListener('click', function(e){
if(e.target.tagName.toLowerCase() == 'span'){
console.log(e.target.innerText);
}
});
``` |
54,098,426 | Why we cannot inherit a class with the private constructor in Java? Can anyone explain with simple example? | 2019/01/08 | [
"https://Stackoverflow.com/questions/54098426",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10594133/"
] | You can use [document.querySelectorAll()](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll) and [target.addEventListener()](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener) functions to achieve this without jQuery.
```js
document.querySelectorAll('.job-start-tm')... | With jQuery, it's fairly trivial.
I'm waiting for you to edit the question to show the dropdown elements (and hopefully post the html and css source, rather than a screenshot), after which I'll edit this answer.
In the meantime, I'll assume
* the dropdowns are `<select>`s
* it is always the last row that contains th... |
2,195,327 | I need to develop an application that is based on a mathematical algorithm, but I do not which mathematical formula should I use. Basically I want to find out what is the probability of entering in a highschools given my overall grade and knowing the last admission grade. How do I compute my chance of entering in that ... | 2017/03/20 | [
"https://math.stackexchange.com/questions/2195327",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/427580/"
] | There is insufficient information to do what you want. Knowing a single grade that was admitted doesn't tell you anything about the percentage of people with other grades that were admitted. (There are, obviously, other factors to admission besides grades.)
If you knew the grades of all the applicants, as well as whic... | Not really sure you've given enough parameters, but here's a useful formula: $P(A|B) = \frac{P(A\cap B)}{P(B)}$
Where $P(A|B)$ denotes the probability of $A$ occurring, given that $B$ has occurred and $P(A\cap B)$ denotes the probability of both $A$ and $B$ occurring. In this case, $A$ would be the event that you ente... |
34,805,863 | Related question:
[Replace multiple instance of a character with a single instance in sql](https://stackoverflow.com/q/34792494/2993606)
**Requirement:**
I have the below strings:
```
Heelloo
Heeelloo
Heeeelloo
Heeeeeelloo
Heeeeeeeelloo
.
.
.
Heeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee... | 2016/01/15 | [
"https://Stackoverflow.com/questions/34805863",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2993606/"
] | Based on [T-SQL String Manipulation Tips and Techniques, Part 1](http://sqlmag.com/t-sql/t-sql-string-manipulation-tips-and-techniques-part-1) especially part `Replacing Multiple Contiguous Spaces With a Single Space and idea of Peter Larsson, a SQL Server MVP`:
>
> Then, the solution involves three steps (assuming t... | Try this user defined function:
```
CREATE FUNCTION TrimDuplicates(@String varchar(max))
RETURNS varchar(max)
AS
BEGIN
SET @String=REPLACE(@String,'eeeeeeee','!@#$%')
while CHARINDEX('ee',@String)>0 BEGIN SET @String=REPLACE(@String,'ee','e') END
while CHARINDEX('oo',@String)>0 BEGIN SET @String=REPLACE(@... |
63,227,787 | I am developing an web app and I am using angular for front-end and keycloak for security.
I am using the following packages on angular side:
**keycloak-js@10.0.1**
**keycloak-angular@8.0.1**
On front-end (angular app) I am trying to retrieve the user details using the following service:
```
import { Injectable } ... | 2020/08/03 | [
"https://Stackoverflow.com/questions/63227787",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8265525/"
] | I know this is an old question but given that I had the same issue and I found the fix, I'd like to share it here for the ages.
If you set the role `account/viewProfile` to your users
[like this](https://i.stack.imgur.com/xXUhm.png) the cors error will fade away.
I've opened a JIRA <https://issues.redhat.com/browse/K... | Use the implicit flow for Keycloak instead of default authorization-code
```
keycloak.init({
...
initOptions: {
flow: 'implicit',
}
}
```
and Access Type option to Public |
23,630,380 | I would like to concatenate 2 pandas DataFrames, each with time series indexes that may overlap, but also with column keys that may overlap.
For example:
```
old_close new_close
1TM ABL ... ABL ANG ...
Date ... | 2014/05/13 | [
"https://Stackoverflow.com/questions/23630380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1624918/"
] | Assuming, you want to 'exclude all duplicate values on both indices', this should work
```
unique_indices = np.setdiff1d(np.unioin1d(old_close.index.to_list(), new_close.index.to_list()),
np.intersect1d(old_close.index.to_list(), new_close.index.to_list()))
merged_close = pd.concat([old_... | From [Pandas documentation](http://pandas.pydata.org/pandas-docs/stable/merging.html):
```
concat(objs, axis=0, join='outer', join_axes=None, ignore_index=False,
keys=None, levels=None, names=None, verify_integrity=False)
```
>
> `verify_integrity`: boolean, default `False`. Check whether the new
> concatena... |
19,866 | Remember our friend Ralph Rigid from Chapter 3? His favorite
diner, Food for Thought, has adopted the following policy to reduce the
crowds at lunch time: if you show up for lunch t hours before or after
12 noon, you get to deduct t dollars from your bill. (This holds for any
fraction of an hour as well.)
(a) Use blue... | 2017/12/29 | [
"https://economics.stackexchange.com/questions/19866",
"https://economics.stackexchange.com",
"https://economics.stackexchange.com/users/15730/"
] | I think the answer to your question is that it would be a matter of Ralph's preferences. Perhaps he is indifferent to eating at 11:00 am or 1:00 pm, as you suggest. But he might have non-parabolic preferences (for reasons unspecified), and both this situation and the one you describe are consistent with his eating at 1... | There is no reason why Ralph's indifference curves should be parabolic or symmetrical about 12 noon. Their shape will depend on his preferences and circumstances (or, more precisely, on his preferences which will be influenced by his circumstances and may therefore change from one day to another).
Suppose for example... |
23,957,407 | I've just cloned a project with several pods locked.
After a `pod install` my Podfile.lock gets modified.
Why ?
Isn't it supposed to be updated only if I do `pod update` ?
---
**Podfile**
```rb
platform :ios, '6.0'
pod 'SVProgressHUD', '~> 0.9'
pod 'Reachability', '~> 3.1.0'
pod 'UIDeviceAddition', '~> 1.0... | 2014/05/30 | [
"https://Stackoverflow.com/questions/23957407",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/305189/"
] | This may happen due to various reasons. For example, pod master repo got updated and somebody installed pods after running `pod repo update`, while on your machine you still have an old version of the repository.
Alternatively, it could also happen if you change the `CocoaPods` tool version. The checksums changed, thi... | Pod install and pod update share the same machinery.
Pod install will lock the version of the dependencies not changed in the Podfile.
Pod update instead tries to update any pod
so only if you made changes to the Podfile the podfile.lock can change |
41,626,696 | In my `javascript` file, I got an ajax to get all list and iterate these data and append `<a id='userID' class='btn'>Assign ID<>` to my list.
So, how do a add **postback** to these anchor and redirect it inside my method in the server. Below is my code but didn't work. When I click the achor button, it just redirect/r... | 2017/01/13 | [
"https://Stackoverflow.com/questions/41626696",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1004303/"
] | You should be changed your button to:
```
<a id='uniqueID' class='btn assignID' href='javascript:void(0);' onclick="javascript:__doPostBack('uniqueID','Assign ID')">Assign ID</a>
```
And it's a good idea to implement the IPostBackEventHandler interface in your codebehind as below:
```
public partial class WebForm :... | The `__doPostBack` method really doesn't do anything special except, well... perform a POST operation back to the same page with two specific form arguments.
The first parameter is the `__EVENTTARGET` and the second parameter is the `__EVENTARGUMENT`.
The magic all happens in ASP.Net where it automagically wires up y... |
55,412,702 | I have a code below
```
<html>
<body>
<ul class="featured-categories__list row" id="featured-categories">
<li class="featured-categories__list__item col-sm-4">
<a class="product-box__box-link product-box__box-link--light product-box__box-link--content-bottom" id="secCatLnk1" h... | 2019/03/29 | [
"https://Stackoverflow.com/questions/55412702",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4575095/"
] | You can use [`$(this)`](https://stackoverflow.com/questions/5611233/jquery-this-selector-function-and-limitations) and [`.children()`](https://api.jquery.com/children/) to specify which one of the `element` you target.
Example: `$(this).children('.featured-categories__list__item__text').hide();`
See snippet:
```js... | ```
<script>
$(document).ready(function($){
$('.featured-categories__list__item').mouseover(function() {
$(this).find('a div .featured-categories__list__item__text').hide();
$(this).find('.featured-categories__list__item__focus-text').show();
}).mouseout(function() ... |
42,421,967 | I have some troubles with a dataframe obtained from reading a xls file.
Every data on such dataframe has the type 'unicode' and I can't do anything with this. I wanna change it to str values. Also, iff possible, I'd like to know the reason of this fact. I heard something about 'external data', and I know that both colu... | 2017/02/23 | [
"https://Stackoverflow.com/questions/42421967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7510900/"
] | You can use the following code.
```
for column in df:
df[column] = df_peru[column].str.encode('utf-8')
``` | To help others, this version worked for me.
I was getting an error while loading my dataframe to an oracle database: "`UnicodeDecodeError: 'ascii' codec can't decode byte 0xea in position 2: ordinal not in range(128)`"
I am on Python ver 2.7
```
for column in df:
df[column]= df[column].astype(str).str.decode('ut... |
68,477,566 | I have a **logo** that shifts whenever I make the browser **window smaller**. I'm not sure what is causing this I have attached my `jsx` and `css` code below. I tried to change **width values** but it shifts regardless of its properties. I can't provide images right now because stack overflow won't let me but I can try... | 2021/07/21 | [
"https://Stackoverflow.com/questions/68477566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14434812/"
] | I pulled down your repo and worked through the issue. The problem was caused by absolute positioning and using transforms. While those are both fine, they take the item out of the flow of the document. When you take them out of the flow of the DOM. That's what was causing the shift.
Here is the CSS you need to fix the... | fit : contain to the .navbar\_logo class.This reshapes the logo everytime you make the window smaller. Let me know how it goes |
49,219,594 | When trying to call Sendkeys method in selenium webdriver it is displaying below error:
```
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: call function result missing 'value'
(Session info: chrome=65.0.3325.146)
(Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee11... | 2018/03/11 | [
"https://Stackoverflow.com/questions/49219594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9475007/"
] | The error says it all :
```
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: call function result missing 'value'
(Session info: chrome=65.0.3325.146)
(Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Windows NT 6.1.7600 x86_64)
```
Your main... | An older version of the ChromeDriver is being spun off when the test is being run; to remedy:
* Ensure that you've gotten your browser up to date (v65-67) and get the latest version of the ChromeDriver executable(v2.38)
* Extract the ChromeDriver and explicitly set the System property when initializing the ChromeDrive... |
49,219,594 | When trying to call Sendkeys method in selenium webdriver it is displaying below error:
```
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: call function result missing 'value'
(Session info: chrome=65.0.3325.146)
(Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee11... | 2018/03/11 | [
"https://Stackoverflow.com/questions/49219594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9475007/"
] | The error says it all :
```
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: call function result missing 'value'
(Session info: chrome=65.0.3325.146)
(Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Windows NT 6.1.7600 x86_64)
```
Your main... | I had encountered the same issue. The issue got resolved by updating the chromedriverexe. please check the compatibility of your chrome browser with chrome driver here [To download chromedriver](http://chromedriver.chromium.org/downloads) |
49,219,594 | When trying to call Sendkeys method in selenium webdriver it is displaying below error:
```
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: call function result missing 'value'
(Session info: chrome=65.0.3325.146)
(Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee11... | 2018/03/11 | [
"https://Stackoverflow.com/questions/49219594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9475007/"
] | An older version of the ChromeDriver is being spun off when the test is being run; to remedy:
* Ensure that you've gotten your browser up to date (v65-67) and get the latest version of the ChromeDriver executable(v2.38)
* Extract the ChromeDriver and explicitly set the System property when initializing the ChromeDrive... | I had encountered the same issue. The issue got resolved by updating the chromedriverexe. please check the compatibility of your chrome browser with chrome driver here [To download chromedriver](http://chromedriver.chromium.org/downloads) |
2,056,606 | I'm developing in MAYA and looking for a good API to connect my models and to be able to control them programatically.
thanks. | 2010/01/13 | [
"https://Stackoverflow.com/questions/2056606",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/141189/"
] | hye oded, you can use MEL or python scripting for control objects and doing simple actions,
and you can use the c++ or Python via maya api to create complex tasks or heavy duty tasks, like creating deformers, expanding mel with new commands.
for resources in mel scripting i recommend "gnomon Mel fundemental" video tut... | There are a couple of apps for mel programming, but all they do is give you syntax coloring and maybe autocomplete. Nothing more advanced exists, which is just as well, because mel is just a terrible, terrible language: It really isnt good for anything other than quick hacks in Maya's script editor. You definitively sh... |
2,056,606 | I'm developing in MAYA and looking for a good API to connect my models and to be able to control them programatically.
thanks. | 2010/01/13 | [
"https://Stackoverflow.com/questions/2056606",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/141189/"
] | hye oded, you can use MEL or python scripting for control objects and doing simple actions,
and you can use the c++ or Python via maya api to create complex tasks or heavy duty tasks, like creating deformers, expanding mel with new commands.
for resources in mel scripting i recommend "gnomon Mel fundemental" video tut... | if you are on windows you can use PyScripter, to configure it you have to show autocomplete you have to follow these steps
1. Open Pyscripter for Python 2.6 if your python version in maya is 2.6.Click on Tools> Python Paths
2. Browse and add following path:('D:\Program Files (x86)\Autodesk\Maya2012\devkit\other\pymel\... |
2,056,606 | I'm developing in MAYA and looking for a good API to connect my models and to be able to control them programatically.
thanks. | 2010/01/13 | [
"https://Stackoverflow.com/questions/2056606",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/141189/"
] | There are a couple of apps for mel programming, but all they do is give you syntax coloring and maybe autocomplete. Nothing more advanced exists, which is just as well, because mel is just a terrible, terrible language: It really isnt good for anything other than quick hacks in Maya's script editor. You definitively sh... | if you are on windows you can use PyScripter, to configure it you have to show autocomplete you have to follow these steps
1. Open Pyscripter for Python 2.6 if your python version in maya is 2.6.Click on Tools> Python Paths
2. Browse and add following path:('D:\Program Files (x86)\Autodesk\Maya2012\devkit\other\pymel\... |
44,808,154 | This is the form.
```
<div class="row" ng-controller="contactsCtrl">
<form ng-show="addFormShow">
<h3>Add Contact</h3>
<!-- Add form -->
<div class="row">
<div class="large-6 columns">
<label>Name:
<input type="text" ng-model="name" placeholder="Contact Name" requir... | 2017/06/28 | [
"https://Stackoverflow.com/questions/44808154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4219239/"
] | It works fine with your code, check if you have properly added ng-controller in your code.
**DEMO**
```js
var myApp = angular.module('ReqWebApp', [])
myApp.controller('contactsCtrl', function contactsCtrl($scope) {
$scope.showAddForm = function(){
$scope.addFormShow = true;
}
});
```
```html
<!DOCTYPE htm... | The code works fine for me. I think you might have done some small error in adding controller. Refer the code below
```
<html ng-app='FormApp'>
<head>
</head>
<body ng-controller='contactsCtrl'>
<form ng-show="addFormShow">
<h3>Add Contact</h3>
<!-- Add form -->
<div class="row">
<div class="la... |
156,448 | While studying radio electronics I stumbled across a small article about wave interference on the same frequency. The article was very simple explaining that if there a stronger emitter on the frequency or the emitter is closer than any other - it will take over the frequency.
That got me interested, but I couldn't fi... | 2015/02/22 | [
"https://electronics.stackexchange.com/questions/156448",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/68321/"
] | >
> How does the wave gets overriden?
>
>
>
In AM radio, this is mostly a matter of perception. Imagine one person shouting in your ear and another person whispering on the other side of the room. Mostly you'd hear the shouting person. You could say they had "overridden" the quieter speaker.
In FM, the modulatio... | From my experience:
Leaky feeder is used for "amplifying" radio signals underground.
In general, radio signal attenuate over distance that also means power is lost over distance.
Bandwidth and distance also opposing each other.
Circuit is amplified using opamp or diferential amp or etc. |
156,448 | While studying radio electronics I stumbled across a small article about wave interference on the same frequency. The article was very simple explaining that if there a stronger emitter on the frequency or the emitter is closer than any other - it will take over the frequency.
That got me interested, but I couldn't fi... | 2015/02/22 | [
"https://electronics.stackexchange.com/questions/156448",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/68321/"
] | >
> How does the wave get overridden? Minor edits of Grammar
>
>
>
This happens in the same manner as two people singing the same tone, such as the note C. As one or maybe two individuals are listening for this tone, they acknowledge it an try to listen. The time when waves are overridden is simply when one person... | From my experience:
Leaky feeder is used for "amplifying" radio signals underground.
In general, radio signal attenuate over distance that also means power is lost over distance.
Bandwidth and distance also opposing each other.
Circuit is amplified using opamp or diferential amp or etc. |
39,480,816 | Suppose I have a JSONB column called `value` in a table `t`, and inside of these blobs of JSON is a `tags` field which is a list of strings.
I'd like to make a query for any of these JSON blobs tagged `"foo"` or `"bar"`.
So suppose the table data looks like this:
```
value
---------------------
{"tags": ["other"]}
{... | 2016/09/14 | [
"https://Stackoverflow.com/questions/39480816",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/208257/"
] | The operator I was looking for is `?|`, which can be used like so:
```
select t.value from t where value->'tags' ?| array['foo','bar'];
```
Tested as follows:
```
danburton=# select * from jsonb_test;
value
---------------------------
{"tags": ["foo"]}
{"tags": ["other"]}
{"tags": ["foo", "quux"]}
{"... | ```
SELECT DISTINCT t.value
FROM t, jsonb_array_elements(t.value->'tags') tags
WHERE tags.value <@ '["foo", "bar"]'::jsonb;
``` |
11,371,926 | I have an NSMutableDictionary that stores a collection of user profiles, how would I go about getting the last added profile? | 2012/07/07 | [
"https://Stackoverflow.com/questions/11371926",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1227315/"
] | NSDictionary provides no such service out of the box. Feel free to derive another class from it, and store the key of the last added object in an ivar. | `NSDictionary` objects are unordered (and generally in any language, dictionaries are unordered) hash tables. I would recommend using an `NSArray` instead. You could use NSDate timestamps as keys but then you'd have to iterate through every single key to find the most recent one, which could be slow. |
51,822 | I'm struggling to identify the cause of a misfire condition in my 1998 Honda Civic. It has D16Y7 engine with 185,000 miles on it.
The spark plugs, wires, distributor cap, rotor, and ignition coil were all replaced a year ago when a different misfire condition developed. It has run perfectly even since.
Last week unde... | 2018/02/16 | [
"https://mechanics.stackexchange.com/questions/51822",
"https://mechanics.stackexchange.com",
"https://mechanics.stackexchange.com/users/12779/"
] | With that many miles, consider a compression check before going any further, especially since the misfire happens at highway speeds. | It's probably your distributor. Was the replacement aftermarket? If so, I'd bet money it's your distributor.
You would remove the rotor cap and check for corrosion of the contacts and rotor. You said you have done this.
The **easiest** test is to find a known good distributor (if you live near Dallas, I know someone ... |
247,506 | Below code was working fine few days back. Suddenly stopped working and throws error.
```
String endPoint = 'https://query.yahooapis.com/v1/public/yql?q=';
String queryUrl = 'select item.condition from weather.forecast where woeid in (select woeid from geo.places(1) where text=Bangalore) and u=c';
HttpRequest req = ne... | 2019/01/22 | [
"https://salesforce.stackexchange.com/questions/247506",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/36359/"
] | I have the same issue right now and just found out Yahoo retired the API.
>
> On Jan. 3, 2019, YQL service at <http://query.yahooapis.com> will be retired. YQL based services that use <http://query.yahooapis.com> , including users of <http://datatables.org> , will no longer operate. Yahoo Weather API users see the tw... | I have got documentation on updated yahoo api to use instead of the retired one. Official announcement says:
>
> As of Thursday, Jan. 3, 2019, the YQL service at query.yahooapis.com
> will be retired. This will impact users of datatables.org as well as
> developers who creates features using this YQL service. To c... |
23,034 | For example, let's say you invented Git. And you want to make Git completely open source. But at the same time you want to build GitHub, and patent GitHub.
I assume you first have to write a patent for GitHub, which will have to first explain how Git works. But Git is not technically a "prior art" in this case because... | 2021/03/26 | [
"https://patents.stackexchange.com/questions/23034",
"https://patents.stackexchange.com",
"https://patents.stackexchange.com/users/25679/"
] | >
> Or, you could clarify in the patent you are only claiming the GitHub model and not the Git model, even though the Git model is explained.
>
>
>
This.
You have to explain the basics for the derivative to be sufficiently discussed. Explicitly disclaiming them achieves your goal. | Git is distributed version control system software. It is not the first distributed version control system. Software is typically protected by copyright not patents. Git as an application is almost assuredly not patentable. It is possible that some specific elements within Git might have been patentable but they would ... |
23,034 | For example, let's say you invented Git. And you want to make Git completely open source. But at the same time you want to build GitHub, and patent GitHub.
I assume you first have to write a patent for GitHub, which will have to first explain how Git works. But Git is not technically a "prior art" in this case because... | 2021/03/26 | [
"https://patents.stackexchange.com/questions/23034",
"https://patents.stackexchange.com",
"https://patents.stackexchange.com/users/25679/"
] | There are a few cases to consider. You have developed an internal combustion engine and a hoist that uses the engine to lift ships from the water. Either or both might or might not be patentable.
The hoist might be novel whether or not that particular engine is used in it. The engine might or might be obvious over pre... | Git is distributed version control system software. It is not the first distributed version control system. Software is typically protected by copyright not patents. Git as an application is almost assuredly not patentable. It is possible that some specific elements within Git might have been patentable but they would ... |
25,041 | The term "W-16" seems to imply some sort of configuration that resembles the letter W, which implies three banks of cylinders with one sharing a common cylinder head. In fact, the Bugatti W-16 in the Veyron is probably more accurately a double-V-16, with the two V's having different angles. So...was there any reason so... | 2016/01/20 | [
"https://mechanics.stackexchange.com/questions/25041",
"https://mechanics.stackexchange.com",
"https://mechanics.stackexchange.com/users/10851/"
] | I'm by no means an expert, but found an interesting article on Wikipedia about the W engine that indicates the W being a relatively recent addition to the automotive world, but not the aircraft/motorcycle worlds:
<https://en.wikipedia.org/wiki/W_engine>
>
> Three different configurations have been called W engines:
>... | **I think I know**
If you want citations, I have already failed you.
**You Asked**
>
> Was there any reason someone (possibly the Volkswagen group) decided to call this configuration a W-16?
>
>
>
**Answer**
***Maybe***.
Looking at this picture you can see the various designs and names of ICE platforms create... |
5,250,410 | I'm looking for a good Java api to do web scraping. I tried WEB-Harvest api
<http://web-harvest.sourceforge.net/usage.php> but I think it's a bit clunky.
Any other suggestions? | 2011/03/09 | [
"https://Stackoverflow.com/questions/5250410",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/652156/"
] | I don't want to solve the whole thing for you else you don't have a chance to learn, but let me help you get started.
Try to break it down into a flow chart that decides if the ball is a double or still in play. Each branch in the flowchart is a boolean condition. | >
> A ball that hits the wall and does not
> leave the playing field is sometimes
> still in play and sometimes a dou- ble
> according to the following rules:
>
>
>
Break them down:
1. A ball striking the railing and rebounding onto the playing field is still in play.
2. A ball that lodges in the screen that i... |
5,250,410 | I'm looking for a good Java api to do web scraping. I tried WEB-Harvest api
<http://web-harvest.sourceforge.net/usage.php> but I think it's a bit clunky.
Any other suggestions? | 2011/03/09 | [
"https://Stackoverflow.com/questions/5250410",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/652156/"
] | I don't want to solve the whole thing for you else you don't have a chance to learn, but let me help you get started.
Try to break it down into a flow chart that decides if the ball is a double or still in play. Each branch in the flowchart is a boolean condition. | Test each condition in sequence and accumulate the result in a single boolean variable.
Wrigley is known for its ivy covered brick outfield wall. So the single boolean condition is FALSE |
5,250,410 | I'm looking for a good Java api to do web scraping. I tried WEB-Harvest api
<http://web-harvest.sourceforge.net/usage.php> but I think it's a bit clunky.
Any other suggestions? | 2011/03/09 | [
"https://Stackoverflow.com/questions/5250410",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/652156/"
] | I don't want to solve the whole thing for you else you don't have a chance to learn, but let me help you get started.
Try to break it down into a flow chart that decides if the ball is a double or still in play. Each branch in the flowchart is a boolean condition. | Others have made good suggestions, another approach (depending on how you think) is to look at it from a natural language perspective. Your original problem statement is:
>
> A ball striking the railing and
> rebounding onto the playing field is
> still in play. A ball that lodges in
> the screen that is attached ... |
3,258 | I was going to propose a tag definition for [layout](https://graphicdesign.stackexchange.com/questions/tagged/layout "show questions tagged 'layout'") and I found that there are at the moment 73 questions tagged [layout](https://graphicdesign.stackexchange.com/questions/tagged/layout "show questions tagged 'layout'") a... | 2017/06/28 | [
"https://graphicdesign.meta.stackexchange.com/questions/3258",
"https://graphicdesign.meta.stackexchange.com",
"https://graphicdesign.meta.stackexchange.com/users/16316/"
] | I'm somewhat torn between this merger. I do think each are similar but they're also different in their rightful manner for example:
>
> Layout may refer to Page layout, the arrangement of visual elements on
> a page
>
>
>
[reference](https://en.wikipedia.org/wiki/Layout)
From reviewing the tags:
* [layout](htt... | I'm just going to mention there is also [composition](https://graphicdesign.stackexchange.com/questions/tagged/composition "show questions tagged 'composition'")
I guess I'm old school but I would never refer to any of this stuff as "layout."
* Composition on Wikipedia: <https://en.wikipedia.org/wiki/Composition_(vi... |
3,258 | I was going to propose a tag definition for [layout](https://graphicdesign.stackexchange.com/questions/tagged/layout "show questions tagged 'layout'") and I found that there are at the moment 73 questions tagged [layout](https://graphicdesign.stackexchange.com/questions/tagged/layout "show questions tagged 'layout'") a... | 2017/06/28 | [
"https://graphicdesign.meta.stackexchange.com/questions/3258",
"https://graphicdesign.meta.stackexchange.com",
"https://graphicdesign.meta.stackexchange.com/users/16316/"
] | I'm somewhat torn between this merger. I do think each are similar but they're also different in their rightful manner for example:
>
> Layout may refer to Page layout, the arrangement of visual elements on
> a page
>
>
>
[reference](https://en.wikipedia.org/wiki/Layout)
From reviewing the tags:
* [layout](htt... | I think all the answers given here are valid and have their own merit. Cai, Ryan and Darth have clearly thought long and hard on this and have proposed solutions that are all good. After a good [chat session](https://chat.stackexchange.com/transcript/message/38702057#38702057) I have come to my own conclusion, which I ... |
3,258 | I was going to propose a tag definition for [layout](https://graphicdesign.stackexchange.com/questions/tagged/layout "show questions tagged 'layout'") and I found that there are at the moment 73 questions tagged [layout](https://graphicdesign.stackexchange.com/questions/tagged/layout "show questions tagged 'layout'") a... | 2017/06/28 | [
"https://graphicdesign.meta.stackexchange.com/questions/3258",
"https://graphicdesign.meta.stackexchange.com",
"https://graphicdesign.meta.stackexchange.com/users/16316/"
] | I'm somewhat torn between this merger. I do think each are similar but they're also different in their rightful manner for example:
>
> Layout may refer to Page layout, the arrangement of visual elements on
> a page
>
>
>
[reference](https://en.wikipedia.org/wiki/Layout)
From reviewing the tags:
* [layout](htt... | My new suggestion after extensive talking to others as well as reading questions currently in [layout](https://graphicdesign.stackexchange.com/questions/tagged/layout "show questions tagged 'layout'") [composition](https://graphicdesign.stackexchange.com/questions/tagged/composition "show questions tagged 'composition'... |
3,258 | I was going to propose a tag definition for [layout](https://graphicdesign.stackexchange.com/questions/tagged/layout "show questions tagged 'layout'") and I found that there are at the moment 73 questions tagged [layout](https://graphicdesign.stackexchange.com/questions/tagged/layout "show questions tagged 'layout'") a... | 2017/06/28 | [
"https://graphicdesign.meta.stackexchange.com/questions/3258",
"https://graphicdesign.meta.stackexchange.com",
"https://graphicdesign.meta.stackexchange.com/users/16316/"
] | Ok, so after some more thought I've slightly changed my mind on how I think we should handle this. My suggestion...
We should have two separate tags:
1. [page-layout](https://graphicdesign.stackexchange.com/questions/tagged/page-layout "show questions tagged 'page-layout'")
This would then be used, much as it is now... | I'm just going to mention there is also [composition](https://graphicdesign.stackexchange.com/questions/tagged/composition "show questions tagged 'composition'")
I guess I'm old school but I would never refer to any of this stuff as "layout."
* Composition on Wikipedia: <https://en.wikipedia.org/wiki/Composition_(vi... |
3,258 | I was going to propose a tag definition for [layout](https://graphicdesign.stackexchange.com/questions/tagged/layout "show questions tagged 'layout'") and I found that there are at the moment 73 questions tagged [layout](https://graphicdesign.stackexchange.com/questions/tagged/layout "show questions tagged 'layout'") a... | 2017/06/28 | [
"https://graphicdesign.meta.stackexchange.com/questions/3258",
"https://graphicdesign.meta.stackexchange.com",
"https://graphicdesign.meta.stackexchange.com/users/16316/"
] | My new suggestion after extensive talking to others as well as reading questions currently in [layout](https://graphicdesign.stackexchange.com/questions/tagged/layout "show questions tagged 'layout'") [composition](https://graphicdesign.stackexchange.com/questions/tagged/composition "show questions tagged 'composition'... | I'm just going to mention there is also [composition](https://graphicdesign.stackexchange.com/questions/tagged/composition "show questions tagged 'composition'")
I guess I'm old school but I would never refer to any of this stuff as "layout."
* Composition on Wikipedia: <https://en.wikipedia.org/wiki/Composition_(vi... |
3,258 | I was going to propose a tag definition for [layout](https://graphicdesign.stackexchange.com/questions/tagged/layout "show questions tagged 'layout'") and I found that there are at the moment 73 questions tagged [layout](https://graphicdesign.stackexchange.com/questions/tagged/layout "show questions tagged 'layout'") a... | 2017/06/28 | [
"https://graphicdesign.meta.stackexchange.com/questions/3258",
"https://graphicdesign.meta.stackexchange.com",
"https://graphicdesign.meta.stackexchange.com/users/16316/"
] | Ok, so after some more thought I've slightly changed my mind on how I think we should handle this. My suggestion...
We should have two separate tags:
1. [page-layout](https://graphicdesign.stackexchange.com/questions/tagged/page-layout "show questions tagged 'page-layout'")
This would then be used, much as it is now... | I think all the answers given here are valid and have their own merit. Cai, Ryan and Darth have clearly thought long and hard on this and have proposed solutions that are all good. After a good [chat session](https://chat.stackexchange.com/transcript/message/38702057#38702057) I have come to my own conclusion, which I ... |
3,258 | I was going to propose a tag definition for [layout](https://graphicdesign.stackexchange.com/questions/tagged/layout "show questions tagged 'layout'") and I found that there are at the moment 73 questions tagged [layout](https://graphicdesign.stackexchange.com/questions/tagged/layout "show questions tagged 'layout'") a... | 2017/06/28 | [
"https://graphicdesign.meta.stackexchange.com/questions/3258",
"https://graphicdesign.meta.stackexchange.com",
"https://graphicdesign.meta.stackexchange.com/users/16316/"
] | Ok, so after some more thought I've slightly changed my mind on how I think we should handle this. My suggestion...
We should have two separate tags:
1. [page-layout](https://graphicdesign.stackexchange.com/questions/tagged/page-layout "show questions tagged 'page-layout'")
This would then be used, much as it is now... | My new suggestion after extensive talking to others as well as reading questions currently in [layout](https://graphicdesign.stackexchange.com/questions/tagged/layout "show questions tagged 'layout'") [composition](https://graphicdesign.stackexchange.com/questions/tagged/composition "show questions tagged 'composition'... |
3,258 | I was going to propose a tag definition for [layout](https://graphicdesign.stackexchange.com/questions/tagged/layout "show questions tagged 'layout'") and I found that there are at the moment 73 questions tagged [layout](https://graphicdesign.stackexchange.com/questions/tagged/layout "show questions tagged 'layout'") a... | 2017/06/28 | [
"https://graphicdesign.meta.stackexchange.com/questions/3258",
"https://graphicdesign.meta.stackexchange.com",
"https://graphicdesign.meta.stackexchange.com/users/16316/"
] | My new suggestion after extensive talking to others as well as reading questions currently in [layout](https://graphicdesign.stackexchange.com/questions/tagged/layout "show questions tagged 'layout'") [composition](https://graphicdesign.stackexchange.com/questions/tagged/composition "show questions tagged 'composition'... | I think all the answers given here are valid and have their own merit. Cai, Ryan and Darth have clearly thought long and hard on this and have proposed solutions that are all good. After a good [chat session](https://chat.stackexchange.com/transcript/message/38702057#38702057) I have come to my own conclusion, which I ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.