qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
9,006,994 | I'd like to grant permissions to my jstatd on linux
The corresponding manual reads:
>
> To use this policy, copy the text into a file called jstatd.all.policy
> and run the jstatd server as follows:
>
>
> jstatd -J-Djava.security.policy=jstatd.all.policy
>
>
>
But where on linux should I place this jstatd.a... | 2012/01/25 | [
"https://Stackoverflow.com/questions/9006994",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/677881/"
] | As far as i remember you have to create the file in the same location as `jstatd` (...jdk/bin/) and it should work.
Update:
From [here](http://docs.oracle.com/javase/7/docs/technotes/guides/security/PolicyFiles.html):
>
> The user policy file is by default located at
>
>
> `user.home/.java.policy` (Solaris/Linux) ... | You can also give a full path to the policy that would be used such as:
```
jstatd -p 1099 -J-Xrs -J-Djava.security.policy=C:\jstatd\tools.policy
```
This is helpful if you are on a shared machine and want a central place to add policies. |
69,291,645 | I'm trying to copy a database from a server (to which I'm connected through ssh) to my localhost. But all that I find is using the `copyDatabase()` method which is now deprecated, and the documentation doesn't explain how to do something similar (Or I didn't understand how to)
Also, I'd like to know how can I generaliz... | 2021/09/22 | [
"https://Stackoverflow.com/questions/69291645",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10605742/"
] | If you are using mongodb then its like
step 1: create a tunnel
```
ssh username@yourdomainOrIP -L 27017:localhost:27017
```
step 2 :
```
mongo
use admin
db.copyDatabase(<fromdb>,<todb>,"localhost:27017",<username>,<password>)
``` | 1. [mongodump](https://docs.mongodb.com/database-tools/mongodump/) dump either whole database or a specific collection
2. [mongorestore](https://docs.mongodb.com/database-tools/mongorestore/) restore to your local database |
3,689,201 | Since we can structure a MongoDB any way we want, we can do it this way
```
{ products:
[
{ date: "2010-09-08", data: { pageviews: 23, timeOnPage: 178 }},
{ date: "2010-09-09", data: { pageviews: 36, timeOnPage: 202 }}
],
brands:
[
{ date: "2010-09-08", data: { pageviews: 123, timeOnPage: 210 }},
... | 2010/09/11 | [
"https://Stackoverflow.com/questions/3689201",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/325418/"
] | Assuming you're using Mongoid (you tagged it), you wouldn't want to use your first schema idea. It would be very inefficient for Mongoid to pull out those huge documents each time you wanted to look up a single little value.
What would probably be a much better model for you is:
```
class Log
include Mongoid::Docum... | I'm not a MongoDB expert, but 1000 isn't "huge". Also I would seriously doubt any difference between 1 top-level document containing 4000 total subelements, and 4 top-level documents each containing 1000 subelements -- one of those six-of-one vs. half-dozen-of-another issues.
Now if you were talking 1 document with 1,... |
3,689,201 | Since we can structure a MongoDB any way we want, we can do it this way
```
{ products:
[
{ date: "2010-09-08", data: { pageviews: 23, timeOnPage: 178 }},
{ date: "2010-09-09", data: { pageviews: 36, timeOnPage: 202 }}
],
brands:
[
{ date: "2010-09-08", data: { pageviews: 123, timeOnPage: 210 }},
... | 2010/09/11 | [
"https://Stackoverflow.com/questions/3689201",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/325418/"
] | I'm not a MongoDB expert, but 1000 isn't "huge". Also I would seriously doubt any difference between 1 top-level document containing 4000 total subelements, and 4 top-level documents each containing 1000 subelements -- one of those six-of-one vs. half-dozen-of-another issues.
Now if you were talking 1 document with 1,... | You have talked about how you are going to update the data, but how do you plan to query it? It probably makes a difference on how you should structure your docs.
The problem with using embedded elements in arrays is that each time you add to that it may not fit in the current space allocated for the document. This wi... |
3,689,201 | Since we can structure a MongoDB any way we want, we can do it this way
```
{ products:
[
{ date: "2010-09-08", data: { pageviews: 23, timeOnPage: 178 }},
{ date: "2010-09-09", data: { pageviews: 36, timeOnPage: 202 }}
],
brands:
[
{ date: "2010-09-08", data: { pageviews: 123, timeOnPage: 210 }},
... | 2010/09/11 | [
"https://Stackoverflow.com/questions/3689201",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/325418/"
] | I'm not a MongoDB expert, but 1000 isn't "huge". Also I would seriously doubt any difference between 1 top-level document containing 4000 total subelements, and 4 top-level documents each containing 1000 subelements -- one of those six-of-one vs. half-dozen-of-another issues.
Now if you were talking 1 document with 1,... | It seems your design closely resembles the relational table schema.

So every document added will be a separate entry in a collection having its own identifier. Though mongo document size is limited to 4 MB, its mostly enough to accommodate plain text documents. And you... |
3,689,201 | Since we can structure a MongoDB any way we want, we can do it this way
```
{ products:
[
{ date: "2010-09-08", data: { pageviews: 23, timeOnPage: 178 }},
{ date: "2010-09-09", data: { pageviews: 36, timeOnPage: 202 }}
],
brands:
[
{ date: "2010-09-08", data: { pageviews: 123, timeOnPage: 210 }},
... | 2010/09/11 | [
"https://Stackoverflow.com/questions/3689201",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/325418/"
] | I'm not a MongoDB expert, but 1000 isn't "huge". Also I would seriously doubt any difference between 1 top-level document containing 4000 total subelements, and 4 top-level documents each containing 1000 subelements -- one of those six-of-one vs. half-dozen-of-another issues.
Now if you were talking 1 document with 1,... | Again this depends on your use case of querying. If you really care about single item, such as products per day:
{ type: 'products', date: "2010-09-08", data: { pageviews: 23, timeOnPage: 178 }}
then you could include multiple days in one date.
{ type: 'products', { date: "2010-09-08", data: { pageviews: 23, timeOnP... |
3,689,201 | Since we can structure a MongoDB any way we want, we can do it this way
```
{ products:
[
{ date: "2010-09-08", data: { pageviews: 23, timeOnPage: 178 }},
{ date: "2010-09-09", data: { pageviews: 36, timeOnPage: 202 }}
],
brands:
[
{ date: "2010-09-08", data: { pageviews: 123, timeOnPage: 210 }},
... | 2010/09/11 | [
"https://Stackoverflow.com/questions/3689201",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/325418/"
] | Assuming you're using Mongoid (you tagged it), you wouldn't want to use your first schema idea. It would be very inefficient for Mongoid to pull out those huge documents each time you wanted to look up a single little value.
What would probably be a much better model for you is:
```
class Log
include Mongoid::Docum... | You have talked about how you are going to update the data, but how do you plan to query it? It probably makes a difference on how you should structure your docs.
The problem with using embedded elements in arrays is that each time you add to that it may not fit in the current space allocated for the document. This wi... |
3,689,201 | Since we can structure a MongoDB any way we want, we can do it this way
```
{ products:
[
{ date: "2010-09-08", data: { pageviews: 23, timeOnPage: 178 }},
{ date: "2010-09-09", data: { pageviews: 36, timeOnPage: 202 }}
],
brands:
[
{ date: "2010-09-08", data: { pageviews: 123, timeOnPage: 210 }},
... | 2010/09/11 | [
"https://Stackoverflow.com/questions/3689201",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/325418/"
] | Assuming you're using Mongoid (you tagged it), you wouldn't want to use your first schema idea. It would be very inefficient for Mongoid to pull out those huge documents each time you wanted to look up a single little value.
What would probably be a much better model for you is:
```
class Log
include Mongoid::Docum... | It seems your design closely resembles the relational table schema.

So every document added will be a separate entry in a collection having its own identifier. Though mongo document size is limited to 4 MB, its mostly enough to accommodate plain text documents. And you... |
3,689,201 | Since we can structure a MongoDB any way we want, we can do it this way
```
{ products:
[
{ date: "2010-09-08", data: { pageviews: 23, timeOnPage: 178 }},
{ date: "2010-09-09", data: { pageviews: 36, timeOnPage: 202 }}
],
brands:
[
{ date: "2010-09-08", data: { pageviews: 123, timeOnPage: 210 }},
... | 2010/09/11 | [
"https://Stackoverflow.com/questions/3689201",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/325418/"
] | Assuming you're using Mongoid (you tagged it), you wouldn't want to use your first schema idea. It would be very inefficient for Mongoid to pull out those huge documents each time you wanted to look up a single little value.
What would probably be a much better model for you is:
```
class Log
include Mongoid::Docum... | Again this depends on your use case of querying. If you really care about single item, such as products per day:
{ type: 'products', date: "2010-09-08", data: { pageviews: 23, timeOnPage: 178 }}
then you could include multiple days in one date.
{ type: 'products', { date: "2010-09-08", data: { pageviews: 23, timeOnP... |
233,449 | so I am new to blender and I have been trying for days to get vertex paint to work on my sculpted object. Ive followed multiple tutorials but it just wont show up.
UPDATE:so now I am able to draw on my figure but I edited my character more in sculpt mode but when I go back to vertex paint mode the edits get undone and ... | 2021/08/04 | [
"https://blender.stackexchange.com/questions/233449",
"https://blender.stackexchange.com",
"https://blender.stackexchange.com/users/129981/"
] | I can see that you have the faces in the upper right corner enabled:
[](https://i.stack.imgur.com/IuKAc.png)
This works kind of as a mask.
You can disable it.
If you want to use a mask, then
* switch to Edit mode
* select the faces that should be affected by the p... | Answer to your second question:
[](https://i.stack.imgur.com/e3zgS.png)
In the properties window in the modifier tab I found the Multires modifier. I never worked with that before, but as I can see there is a different value for "level viewport" and "sculpt".
[![le... |
38,546,642 | I have a simple model:
```
class Receipt
include ActiveModel::Serialization
attr_accessor :products
end
```
and my controller is doing:
```
def create
respond_with receipt, :serializer => ReceiptSerializer
end
```
and the serializer:
```
class ReceiptSerializer < ActiveModel::Serializer
attributes :produ... | 2016/07/23 | [
"https://Stackoverflow.com/questions/38546642",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/594763/"
] | In all the documentation I've read and personal implementation I use `render json:` instead of `respond_with`.
```
render json: receipt, serializer: ReceiptSerializer
```
I believe that `respond_with` has been removed from rails and isn't considered a best practice anymore but I can't find a link to validate that cl... | I'm not totally sure, but it seems in your Receipt PORO, you should rather include: `ActiveModel::SerializerSupport`.
I can't confirm if that works for active\_model\_serializers 0.10.2 though |
8,843,611 | I have the following (simplified for this example) Django models:
```
class Ingredient(models.Model):
name = models.CharField(max_length=100)
def __unicode__(self):
return self.name
class RecipeIngredient(models.Model):
quantity = models.DecimalField(max_digits=5, decimal_places=3)
unit_of_me... | 2012/01/12 | [
"https://Stackoverflow.com/questions/8843611",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/382928/"
] | I solved this use case by overriding a field's queryset within `__init__` on the Form. A select input is still displayed but it only has one option. I had the same issue as the OP by too many options for the select.
```
class PaymentForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(PaymentF... | IT displays the id because you said so:
```
class RecipeIngredient(models.Model):
def __unicode__(self):
return self.id
```
EDIT:
...and also, because you use a TextInput
```
self.fields['ingredient'].widget = forms.TextInput(attrs={'size':'30'})
```
I guess you need this:
<https://docs.djangoproject... |
8,843,611 | I have the following (simplified for this example) Django models:
```
class Ingredient(models.Model):
name = models.CharField(max_length=100)
def __unicode__(self):
return self.name
class RecipeIngredient(models.Model):
quantity = models.DecimalField(max_digits=5, decimal_places=3)
unit_of_me... | 2012/01/12 | [
"https://Stackoverflow.com/questions/8843611",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/382928/"
] | I had a similar problem and solved very similarly like this (Python 3) this also used the super class to do the rendering rather than rewriting it out again.
I have added a feature which I wanted which is to make the field read only, I left it it as I thought it might be useful for editing for what you want:
```
clas... | IT displays the id because you said so:
```
class RecipeIngredient(models.Model):
def __unicode__(self):
return self.id
```
EDIT:
...and also, because you use a TextInput
```
self.fields['ingredient'].widget = forms.TextInput(attrs={'size':'30'})
```
I guess you need this:
<https://docs.djangoproject... |
8,843,611 | I have the following (simplified for this example) Django models:
```
class Ingredient(models.Model):
name = models.CharField(max_length=100)
def __unicode__(self):
return self.name
class RecipeIngredient(models.Model):
quantity = models.DecimalField(max_digits=5, decimal_places=3)
unit_of_me... | 2012/01/12 | [
"https://Stackoverflow.com/questions/8843611",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/382928/"
] | I solved this use case by overriding a field's queryset within `__init__` on the Form. A select input is still displayed but it only has one option. I had the same issue as the OP by too many options for the select.
```
class PaymentForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(PaymentF... | I had a similar problem and solved very similarly like this (Python 3) this also used the super class to do the rendering rather than rewriting it out again.
I have added a feature which I wanted which is to make the field read only, I left it it as I thought it might be useful for editing for what you want:
```
clas... |
344,459 | How can I do this question?
$$\sqrt{x}-2\sqrt[4]{x}-8 = 0$$
Can I solve this?
I tried to multiply everything by $x^4$, and got
$$8x^4+x^3 -2x = 0$$
I don't know how to proceed from here. | 2013/03/28 | [
"https://math.stackexchange.com/questions/344459",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/69840/"
] | When multiplying powers, we have to ADD exponents: $x^a x^b = x^{a + b}$. Instead, try letting $x = u^4$, so
$$
\sqrt{x} - 2\sqrt[4]{x} - 8 = 0
$$
becomes
$$
u^2 - 2u - 8 = 0,
$$
which you can solve using the quadratic formula (although you might introduce extraneous solutions). | **Hint**:
$x^{\frac{1}{4}}=k$
$ \sqrt{(x)}=k^2$
Or you can just keep the equation as it is:
$\sqrt{x}-2\sqrt[4]{x}-8=0 \implies \sqrt{x}-4\sqrt[4]{x}+2\sqrt[4]{x}-8=0$. Factorize it. |
344,459 | How can I do this question?
$$\sqrt{x}-2\sqrt[4]{x}-8 = 0$$
Can I solve this?
I tried to multiply everything by $x^4$, and got
$$8x^4+x^3 -2x = 0$$
I don't know how to proceed from here. | 2013/03/28 | [
"https://math.stackexchange.com/questions/344459",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/69840/"
] | Let $\sqrt[4]x=u$. This gives $\sqrt x = u^2$.
Solve the quadratic equation in $u$. You get the values for $u$ as $4$ or $-2$.
Since $\sqrt[4]x$ cannot be negative, it is equal to $4$.
Hence $x = 4^4 = 256$ | When multiplying powers, we have to ADD exponents: $x^a x^b = x^{a + b}$. Instead, try letting $x = u^4$, so
$$
\sqrt{x} - 2\sqrt[4]{x} - 8 = 0
$$
becomes
$$
u^2 - 2u - 8 = 0,
$$
which you can solve using the quadratic formula (although you might introduce extraneous solutions). |
344,459 | How can I do this question?
$$\sqrt{x}-2\sqrt[4]{x}-8 = 0$$
Can I solve this?
I tried to multiply everything by $x^4$, and got
$$8x^4+x^3 -2x = 0$$
I don't know how to proceed from here. | 2013/03/28 | [
"https://math.stackexchange.com/questions/344459",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/69840/"
] | Let $\sqrt[4]x=u$. This gives $\sqrt x = u^2$.
Solve the quadratic equation in $u$. You get the values for $u$ as $4$ or $-2$.
Since $\sqrt[4]x$ cannot be negative, it is equal to $4$.
Hence $x = 4^4 = 256$ | **Hint**:
$x^{\frac{1}{4}}=k$
$ \sqrt{(x)}=k^2$
Or you can just keep the equation as it is:
$\sqrt{x}-2\sqrt[4]{x}-8=0 \implies \sqrt{x}-4\sqrt[4]{x}+2\sqrt[4]{x}-8=0$. Factorize it. |
13,102,244 | I'm looking for what is the most idiomatic way of naming a method that for instance converts the data of a class to xml.
If I were doing this in Ruby I would make a method named `to_xml` for instance, but I've seen several different ways of doing this in Python. `toxml`, `to_xml`, `xml` and `toXML`, for different outp... | 2012/10/27 | [
"https://Stackoverflow.com/questions/13102244",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/68035/"
] | [PEP8](http://www.python.org/dev/peps/pep-0008/#method-names-and-instance-variables) recommends `to_xml`:
>
> Use the function naming rules: lowercase with words separated by underscores as necessary to improve readability.
>
>
> | If you go through the [Python Style Guide - PEP8](http://www.python.org/dev/peps/pep-0008/), it is recommended to use all letters in lowercase, with an underscore separating each word. |
5,616,325 | hello I am trying to debug the crash of an Android app an outdated android app that I have been working on. The app is the Jython Interpreter for Android so far I have managed to compile a debug binary and am hoping some one could shed some light on this error message of logcat thank you
```
I/ActivityManager( 51): ... | 2011/04/11 | [
"https://Stackoverflow.com/questions/5616325",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/701474/"
] | Instead of using Tomcat from Macports download Tomcat from Apache.
6.0: <http://tomcat.apache.org/download-60.cgi>
7.0: <http://tomcat.apache.org/download-70.cgi> | Edit to Bruno's answer which was finally what worked for me after quite a bit of maven trial and error.
If you are using 1.7 then you should be able to change revision to 1.7. I do not know if this is still a problem in Java 1.7 though.
```
sudo sh -c '$(j_home=$(/usr/libexec/java_home -v 1.6) && ln -sf ${j_home}/../... |
5,616,325 | hello I am trying to debug the crash of an Android app an outdated android app that I have been working on. The app is the Jython Interpreter for Android so far I have managed to compile a debug binary and am hoping some one could shed some light on this error message of logcat thank you
```
I/ActivityManager( 51): ... | 2011/04/11 | [
"https://Stackoverflow.com/questions/5616325",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/701474/"
] | This is similar to Bruno's answer above; however, I am not a big fan of symlinking the absolute path. Here is how I handle the symlinks:
```
cd /Library/Java/JavaVirtualMachines/<jdk version>/Contents/Home
sudo ln -s lib Classes
cd lib/
sudo ln -s tools.jar classes.jar
```
That makes it easier then symlinking absol... | Edit to Bruno's answer which was finally what worked for me after quite a bit of maven trial and error.
If you are using 1.7 then you should be able to change revision to 1.7. I do not know if this is still a problem in Java 1.7 though.
```
sudo sh -c '$(j_home=$(/usr/libexec/java_home -v 1.6) && ln -sf ${j_home}/../... |
5,616,325 | hello I am trying to debug the crash of an Android app an outdated android app that I have been working on. The app is the Jython Interpreter for Android so far I have managed to compile a debug binary and am hoping some one could shed some light on this error message of logcat thank you
```
I/ActivityManager( 51): ... | 2011/04/11 | [
"https://Stackoverflow.com/questions/5616325",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/701474/"
] | Here is my tested solution, which implies no change in maven config, just add symbolic links:
* ln -s /Library/Java/JavaVirtualMachines/1.6.0\_38-b04-436.jdk/Contents/Home/../Classes/classes.jar
/Library/Java/JavaVirtualMachines/1.6.0\_38-b04-436.jdk/Contents/Home/../Classes/tools.jar
* ln -s /Library/Java/JavaVirtual... | Can't find any references to it on the interweb, but my Mac 1.7 and 1.8 jdk's now have tools.jar.
>
> /Library/Java/JavaVirtualMachines/jdk1.7.0\_12.jdk/Contents/Home/lib/tools.jar
> /Library/Java/JavaVirtualMachines/jdk1.7.0\_51.jdk/Contents/Home/lib/tools.jar
> /Library/Java/JavaVirtualMachines/jdk1.7.0\_60.jdk/C... |
5,616,325 | hello I am trying to debug the crash of an Android app an outdated android app that I have been working on. The app is the Jython Interpreter for Android so far I have managed to compile a debug binary and am hoping some one could shed some light on this error message of logcat thank you
```
I/ActivityManager( 51): ... | 2011/04/11 | [
"https://Stackoverflow.com/questions/5616325",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/701474/"
] | Here is my tested solution, which implies no change in maven config, just add symbolic links:
* ln -s /Library/Java/JavaVirtualMachines/1.6.0\_38-b04-436.jdk/Contents/Home/../Classes/classes.jar
/Library/Java/JavaVirtualMachines/1.6.0\_38-b04-436.jdk/Contents/Home/../Classes/tools.jar
* ln -s /Library/Java/JavaVirtual... | I faced the same problem, and resolved it differently.
* First check that the **java\_home** is set as
`/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents` and not
`/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home`
* Add the cobertura plugin, make sure `systemPath` is correctly ref the locati... |
5,616,325 | hello I am trying to debug the crash of an Android app an outdated android app that I have been working on. The app is the Jython Interpreter for Android so far I have managed to compile a debug binary and am hoping some one could shed some light on this error message of logcat thank you
```
I/ActivityManager( 51): ... | 2011/04/11 | [
"https://Stackoverflow.com/questions/5616325",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/701474/"
] | This is similar to Bruno's answer above; however, I am not a big fan of symlinking the absolute path. Here is how I handle the symlinks:
```
cd /Library/Java/JavaVirtualMachines/<jdk version>/Contents/Home
sudo ln -s lib Classes
cd lib/
sudo ln -s tools.jar classes.jar
```
That makes it easier then symlinking absol... | Well, you search for 'tools.jar', with grep for instance. If the place where classes.jar is, where tools.jar was expected, you could just change the word.
Another idea is, to create a symbolic link from classes.jar to tools.jar, if you have enough privileges and the file system(s) on MacOS support this. Else: copy. M... |
5,616,325 | hello I am trying to debug the crash of an Android app an outdated android app that I have been working on. The app is the Jython Interpreter for Android so far I have managed to compile a debug binary and am hoping some one could shed some light on this error message of logcat thank you
```
I/ActivityManager( 51): ... | 2011/04/11 | [
"https://Stackoverflow.com/questions/5616325",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/701474/"
] | Here is my tested solution, which implies no change in maven config, just add symbolic links:
* ln -s /Library/Java/JavaVirtualMachines/1.6.0\_38-b04-436.jdk/Contents/Home/../Classes/classes.jar
/Library/Java/JavaVirtualMachines/1.6.0\_38-b04-436.jdk/Contents/Home/../Classes/tools.jar
* ln -s /Library/Java/JavaVirtual... | Well, you search for 'tools.jar', with grep for instance. If the place where classes.jar is, where tools.jar was expected, you could just change the word.
Another idea is, to create a symbolic link from classes.jar to tools.jar, if you have enough privileges and the file system(s) on MacOS support this. Else: copy. M... |
5,616,325 | hello I am trying to debug the crash of an Android app an outdated android app that I have been working on. The app is the Jython Interpreter for Android so far I have managed to compile a debug binary and am hoping some one could shed some light on this error message of logcat thank you
```
I/ActivityManager( 51): ... | 2011/04/11 | [
"https://Stackoverflow.com/questions/5616325",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/701474/"
] | This is similar to Bruno's answer above; however, I am not a big fan of symlinking the absolute path. Here is how I handle the symlinks:
```
cd /Library/Java/JavaVirtualMachines/<jdk version>/Contents/Home
sudo ln -s lib Classes
cd lib/
sudo ln -s tools.jar classes.jar
```
That makes it easier then symlinking absol... | Can't find any references to it on the interweb, but my Mac 1.7 and 1.8 jdk's now have tools.jar.
>
> /Library/Java/JavaVirtualMachines/jdk1.7.0\_12.jdk/Contents/Home/lib/tools.jar
> /Library/Java/JavaVirtualMachines/jdk1.7.0\_51.jdk/Contents/Home/lib/tools.jar
> /Library/Java/JavaVirtualMachines/jdk1.7.0\_60.jdk/C... |
5,616,325 | hello I am trying to debug the crash of an Android app an outdated android app that I have been working on. The app is the Jython Interpreter for Android so far I have managed to compile a debug binary and am hoping some one could shed some light on this error message of logcat thank you
```
I/ActivityManager( 51): ... | 2011/04/11 | [
"https://Stackoverflow.com/questions/5616325",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/701474/"
] | This is similar to Bruno's answer above; however, I am not a big fan of symlinking the absolute path. Here is how I handle the symlinks:
```
cd /Library/Java/JavaVirtualMachines/<jdk version>/Contents/Home
sudo ln -s lib Classes
cd lib/
sudo ln -s tools.jar classes.jar
```
That makes it easier then symlinking absol... | Instead of using Tomcat from Macports download Tomcat from Apache.
6.0: <http://tomcat.apache.org/download-60.cgi>
7.0: <http://tomcat.apache.org/download-70.cgi> |
5,616,325 | hello I am trying to debug the crash of an Android app an outdated android app that I have been working on. The app is the Jython Interpreter for Android so far I have managed to compile a debug binary and am hoping some one could shed some light on this error message of logcat thank you
```
I/ActivityManager( 51): ... | 2011/04/11 | [
"https://Stackoverflow.com/questions/5616325",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/701474/"
] | Instead of using Tomcat from Macports download Tomcat from Apache.
6.0: <http://tomcat.apache.org/download-60.cgi>
7.0: <http://tomcat.apache.org/download-70.cgi> | I faced the same problem, and resolved it differently.
* First check that the **java\_home** is set as
`/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents` and not
`/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home`
* Add the cobertura plugin, make sure `systemPath` is correctly ref the locati... |
5,616,325 | hello I am trying to debug the crash of an Android app an outdated android app that I have been working on. The app is the Jython Interpreter for Android so far I have managed to compile a debug binary and am hoping some one could shed some light on this error message of logcat thank you
```
I/ActivityManager( 51): ... | 2011/04/11 | [
"https://Stackoverflow.com/questions/5616325",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/701474/"
] | Well, you search for 'tools.jar', with grep for instance. If the place where classes.jar is, where tools.jar was expected, you could just change the word.
Another idea is, to create a symbolic link from classes.jar to tools.jar, if you have enough privileges and the file system(s) on MacOS support this. Else: copy. M... | I faced the same problem, and resolved it differently.
* First check that the **java\_home** is set as
`/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents` and not
`/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home`
* Add the cobertura plugin, make sure `systemPath` is correctly ref the locati... |
56,188,610 | [](https://i.stack.imgur.com/VVKJm.jpg)Grunt is running and detecting the change but the compilation is not happening due to the error "Could not find an option named "sourcemap"
Ruby was not installed since it was required before, I installed it.
Updated all th... | 2019/05/17 | [
"https://Stackoverflow.com/questions/56188610",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8550627/"
] | In css `body` tag defines the document's whole body and the `div` is a part of it, there are two ways to get this working.
1. Make the `div` to cover the entire page and set the image to the `div`
Refer here:
[Making a div that covers the entire page](https://stackoverflow.com/questions/3250790/making-a-div-that-cove... | There are 2 ways to get this done:
Note: Is is a good practice to create a **folder 'assets'** in the program's **root** directory, and place your image inside it.
**Method-1:**
```
app.layout = html.Div([ ...fill your children here... ],
style={'background-image': 'url(/assets/image.jpg)',
'background-... |
55,441,507 | I wrote this model for my app
models.py
---------
```
from django.db import models
from accounts.models import FrontendUsers
from django.utils import timezone
# Create your models here.
class Jit(models.Model):
value = models.CharField(max_length = 100, blank = False)
author = models.ForeignKey(FrontendUser... | 2019/03/31 | [
"https://Stackoverflow.com/questions/55441507",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7911552/"
] | Use one of these ways, but second one is better as it doesn't fetch author from database:
```
author = FrontendUsers.objects.get(id=author_id)
jit = Jit.objects.create(value = value,author=author)
```
or
```
jit = Jit.objects.create(value = value,author_id=author_id)
``` | You can use it like
`jit = Jit.objects.create(value = value,author_id=author_id)` |
55,441,507 | I wrote this model for my app
models.py
---------
```
from django.db import models
from accounts.models import FrontendUsers
from django.utils import timezone
# Create your models here.
class Jit(models.Model):
value = models.CharField(max_length = 100, blank = False)
author = models.ForeignKey(FrontendUser... | 2019/03/31 | [
"https://Stackoverflow.com/questions/55441507",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7911552/"
] | You can use it like
`jit = Jit.objects.create(value = value,author_id=author_id)` | Your are converting the user instace in ant int.
I think you should be using a form to achieve what you want. Try something like this, it works for me.
```
def new_post (request):
if request.method == 'POST':
if your_form.is_valid():
value = your_form.cleaned_data["value"]
if valu... |
55,441,507 | I wrote this model for my app
models.py
---------
```
from django.db import models
from accounts.models import FrontendUsers
from django.utils import timezone
# Create your models here.
class Jit(models.Model):
value = models.CharField(max_length = 100, blank = False)
author = models.ForeignKey(FrontendUser... | 2019/03/31 | [
"https://Stackoverflow.com/questions/55441507",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7911552/"
] | Use one of these ways, but second one is better as it doesn't fetch author from database:
```
author = FrontendUsers.objects.get(id=author_id)
jit = Jit.objects.create(value = value,author=author)
```
or
```
jit = Jit.objects.create(value = value,author_id=author_id)
``` | Your are converting the user instace in ant int.
I think you should be using a form to achieve what you want. Try something like this, it works for me.
```
def new_post (request):
if request.method == 'POST':
if your_form.is_valid():
value = your_form.cleaned_data["value"]
if valu... |
8,399,788 | This is a really easy one that I thought would be easily found on google but I can't think of the terminology.
I'm using CS4 and AS3 with a few multi-line dynamic text boxes beneath one another. When I populate the top text box I would like it to automatically push down the other text boxes beneath it when the content... | 2011/12/06 | [
"https://Stackoverflow.com/questions/8399788",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/67258/"
] | There are products called Hardware Security Modules (HSMs) designed to provide secure and reliable key storage. Most of them have software to interface with windows Crypto APIs, so that for example your RSACryptoServiceProvider will transparently use the HSM. | This issue is similar to Windows reminding you to [Backup your encryption key](http://windows.microsoft.com/en-US/windows-vista/Back-up-Encrypting-File-System-EFS-certificate)
In that article after exporting your key they suggest:
>
> Store the backup copy of your EFS certificate in a safe place.
>
>
>
What is a... |
5,552,434 | I have x number of input fields with class='agency\_field'. How can I create a JS array that contain the values of all fields with this class?
Using jQuery, this gives a syntax error:
>
> $(".agency\_field").each(function(index)
> { agencies[] = $(this).val(); });
>
>
> | 2011/04/05 | [
"https://Stackoverflow.com/questions/5552434",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149664/"
] | You can use [`.map`](http://api.jquery.com/map) instead, which is perhaps more suited to your purpose:
```
var values = $(".agency_field").map(function() {
return this.value;
}).get();
alert(values.join(","));
``` | ```
var agencies = [];
$(".agency_field").each(function(index) { agencies.push($(this).val()); });
``` |
5,552,434 | I have x number of input fields with class='agency\_field'. How can I create a JS array that contain the values of all fields with this class?
Using jQuery, this gives a syntax error:
>
> $(".agency\_field").each(function(index)
> { agencies[] = $(this).val(); });
>
>
> | 2011/04/05 | [
"https://Stackoverflow.com/questions/5552434",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149664/"
] | You can use [`.map`](http://api.jquery.com/map) instead, which is perhaps more suited to your purpose:
```
var values = $(".agency_field").map(function() {
return this.value;
}).get();
alert(values.join(","));
``` | You're creating a new array for each iteration. Try instead instantiating an array before the each call and adding to the array each iteration. |
5,552,434 | I have x number of input fields with class='agency\_field'. How can I create a JS array that contain the values of all fields with this class?
Using jQuery, this gives a syntax error:
>
> $(".agency\_field").each(function(index)
> { agencies[] = $(this).val(); });
>
>
> | 2011/04/05 | [
"https://Stackoverflow.com/questions/5552434",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149664/"
] | You can use [`.map`](http://api.jquery.com/map) instead, which is perhaps more suited to your purpose:
```
var values = $(".agency_field").map(function() {
return this.value;
}).get();
alert(values.join(","));
``` | ```
var arr = []; $(".agency_field").each(function(index) { arr.push($(this).val()); });
```
`arr` would contain what you want in the end. |
5,552,434 | I have x number of input fields with class='agency\_field'. How can I create a JS array that contain the values of all fields with this class?
Using jQuery, this gives a syntax error:
>
> $(".agency\_field").each(function(index)
> { agencies[] = $(this).val(); });
>
>
> | 2011/04/05 | [
"https://Stackoverflow.com/questions/5552434",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149664/"
] | You can use [`.map`](http://api.jquery.com/map) instead, which is perhaps more suited to your purpose:
```
var values = $(".agency_field").map(function() {
return this.value;
}).get();
alert(values.join(","));
``` | Your code shd be slightly changed to:
```
var agencies = [];
$(".agency_field").each(function(index) {
agencies.push($(this).val());
});
``` |
5,552,434 | I have x number of input fields with class='agency\_field'. How can I create a JS array that contain the values of all fields with this class?
Using jQuery, this gives a syntax error:
>
> $(".agency\_field").each(function(index)
> { agencies[] = $(this).val(); });
>
>
> | 2011/04/05 | [
"https://Stackoverflow.com/questions/5552434",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149664/"
] | You can use [`.map`](http://api.jquery.com/map) instead, which is perhaps more suited to your purpose:
```
var values = $(".agency_field").map(function() {
return this.value;
}).get();
alert(values.join(","));
``` | You need to create an array initially and then add each value to that array:
```
var agencies = [];
$(".agency_field").each(function(index) { agencies.push($(this).val()) });
``` |
5,552,434 | I have x number of input fields with class='agency\_field'. How can I create a JS array that contain the values of all fields with this class?
Using jQuery, this gives a syntax error:
>
> $(".agency\_field").each(function(index)
> { agencies[] = $(this).val(); });
>
>
> | 2011/04/05 | [
"https://Stackoverflow.com/questions/5552434",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149664/"
] | You can use [`.map`](http://api.jquery.com/map) instead, which is perhaps more suited to your purpose:
```
var values = $(".agency_field").map(function() {
return this.value;
}).get();
alert(values.join(","));
``` | You're quite used to a language like php? ;)
In Javascript, you'd use array.push() for appending to an array; so
```
$(".agency_field").each(function(index) { agencies.push( $(this).val() ); });
``` |
17,213,806 | I have a rather basic question. I have several values in a column that I would like to replace for a single one, for instance:
`a<-data.frame(T=LETTERS[5:20],V=rnorm(16,10,1))`
and I would like to change all "E", "S", "T" in T for "AB", so I tried
```
a[a$T==c("E","S","T")]<-"AB"
```
and it gives me several warnin... | 2013/06/20 | [
"https://Stackoverflow.com/questions/17213806",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1817709/"
] | You can use function `recode()` from library `car` to change values also for the factors.
```
library(car)
a$T<-recode(a$T,"c('E','S','T')='AB'")
```
If you need to replace different values with different other values then all statements can be written in one function call.
```
recode(a$T,"c('E','S','T')='AB';c('F'... | This would maintain your data structure (a factor like you guessed):
```
x <- levels(a$T)
levels(a$T) <- ifelse(x %in% c("E","S","T"), "AB", x)
```
or
```
levels(a$T)[levels(a$T) %in% c("E","S","T")] <- "AB"
```
---
**Edit**: if you have many such replacements, it is a little more complicated but not impossibl... |
17,213,806 | I have a rather basic question. I have several values in a column that I would like to replace for a single one, for instance:
`a<-data.frame(T=LETTERS[5:20],V=rnorm(16,10,1))`
and I would like to change all "E", "S", "T" in T for "AB", so I tried
```
a[a$T==c("E","S","T")]<-"AB"
```
and it gives me several warnin... | 2013/06/20 | [
"https://Stackoverflow.com/questions/17213806",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1817709/"
] | This would maintain your data structure (a factor like you guessed):
```
x <- levels(a$T)
levels(a$T) <- ifelse(x %in% c("E","S","T"), "AB", x)
```
or
```
levels(a$T)[levels(a$T) %in% c("E","S","T")] <- "AB"
```
---
**Edit**: if you have many such replacements, it is a little more complicated but not impossibl... | Do you really want factors there ???
If not (I think you do not) do `options(stringsAsFactors=FALSE)`
So it is much simpler than that... => `a[a$T %in% c("E","S","T"),"T"]<-"AB"` |
17,213,806 | I have a rather basic question. I have several values in a column that I would like to replace for a single one, for instance:
`a<-data.frame(T=LETTERS[5:20],V=rnorm(16,10,1))`
and I would like to change all "E", "S", "T" in T for "AB", so I tried
```
a[a$T==c("E","S","T")]<-"AB"
```
and it gives me several warnin... | 2013/06/20 | [
"https://Stackoverflow.com/questions/17213806",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1817709/"
] | You can use function `recode()` from library `car` to change values also for the factors.
```
library(car)
a$T<-recode(a$T,"c('E','S','T')='AB'")
```
If you need to replace different values with different other values then all statements can be written in one function call.
```
recode(a$T,"c('E','S','T')='AB';c('F'... | Do you really want factors there ???
If not (I think you do not) do `options(stringsAsFactors=FALSE)`
So it is much simpler than that... => `a[a$T %in% c("E","S","T"),"T"]<-"AB"` |
54,710,709 | Can some please help me with some code, I'm building a shopping list app. So I have an array of products, inside each product object there's a category name. what I want to do is display product under each category using ngFor, like category name fresh food under it everything with fresh food gets displayed so on. here... | 2019/02/15 | [
"https://Stackoverflow.com/questions/54710709",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11067534/"
] | The following plug-ins don't offer exactly what you want, but may be helpful:
* The [**Launcher Extension**](https://github.com/pedrosans/launcher-extension) adds **two buttons** to the main toolbar: one to run the **corresponding JUnit test** of the Java class opened in the active editor and a second button (green he... | It can be achieved by writing eclipse plugin project. Which internally provides Tools/buttons and add functionality on each button to perform certain actions. This would require some idea of Eclipse plugin development, with SWT, JFace.
Run your project as eclipse application to see/debug your changes. Once you are sat... |
54,710,709 | Can some please help me with some code, I'm building a shopping list app. So I have an array of products, inside each product object there's a category name. what I want to do is display product under each category using ngFor, like category name fresh food under it everything with fresh food gets displayed so on. here... | 2019/02/15 | [
"https://Stackoverflow.com/questions/54710709",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11067534/"
] | As an alternative, Eclipse 4.22 (Dec. 2021) comes with:
>
> [Launch Configuration View](https://www.eclipse.org/eclipse/news/4.22/platform.php#launch-config-view)
> ------------------------------------------------------------------------------------------------------
>
>
> The new Launch Configuration View allows q... | It can be achieved by writing eclipse plugin project. Which internally provides Tools/buttons and add functionality on each button to perform certain actions. This would require some idea of Eclipse plugin development, with SWT, JFace.
Run your project as eclipse application to see/debug your changes. Once you are sat... |
54,710,709 | Can some please help me with some code, I'm building a shopping list app. So I have an array of products, inside each product object there's a category name. what I want to do is display product under each category using ngFor, like category name fresh food under it everything with fresh food gets displayed so on. here... | 2019/02/15 | [
"https://Stackoverflow.com/questions/54710709",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11067534/"
] | The following plug-ins don't offer exactly what you want, but may be helpful:
* The [**Launcher Extension**](https://github.com/pedrosans/launcher-extension) adds **two buttons** to the main toolbar: one to run the **corresponding JUnit test** of the Java class opened in the active editor and a second button (green he... | As an alternative, Eclipse 4.22 (Dec. 2021) comes with:
>
> [Launch Configuration View](https://www.eclipse.org/eclipse/news/4.22/platform.php#launch-config-view)
> ------------------------------------------------------------------------------------------------------
>
>
> The new Launch Configuration View allows q... |
3,469 | I need to drill 2 small holes on the underside of my Silestone countertop to secure a new dishwasher. What kind of drill bit can I use?
AFAIK Silestone is some kind of artificial quartz, but I wonder if it's too hard for normal masonry bit. | 2010/12/13 | [
"https://diy.stackexchange.com/questions/3469",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/1313/"
] | Silestone is natural quartz aggregate, held together by a polymer binder. I believe it's something like 85% quartz. You'll need a diamond coated bit like **[this one](http://www.lowes.com/pd_146373-67702-728020_0__?productId=1017877&Ntt=diamond+drill&pl=1¤tURL=/pl__0__s%3FNtt%3Ddiamond%2Bdrill)**; it's a tiny hol... | I used a bit from Menards store like a Home Depot or Lowes. I cut a 1 3/8 hole in Cambria quartz for a faucet. The Brand was Montana MB-65208 diamond tipped bit. I cut at an angle to start then cut straight through by using the pumping motion, Applying water every few seconds. I did a practice and a real cut no problem... |
3,469 | I need to drill 2 small holes on the underside of my Silestone countertop to secure a new dishwasher. What kind of drill bit can I use?
AFAIK Silestone is some kind of artificial quartz, but I wonder if it's too hard for normal masonry bit. | 2010/12/13 | [
"https://diy.stackexchange.com/questions/3469",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/1313/"
] | I had a similar situation and solved it by gluing a strip of wood with the same finish as the cabinets underneath the counter top and securing the dishwasher to it instead. If you have the room underneath your counters for it, this might be something to consider. IIRC, the piece I used was 3/8" high by 1" deep and ran ... | I used a bit from Menards store like a Home Depot or Lowes. I cut a 1 3/8 hole in Cambria quartz for a faucet. The Brand was Montana MB-65208 diamond tipped bit. I cut at an angle to start then cut straight through by using the pumping motion, Applying water every few seconds. I did a practice and a real cut no problem... |
3,469 | I need to drill 2 small holes on the underside of my Silestone countertop to secure a new dishwasher. What kind of drill bit can I use?
AFAIK Silestone is some kind of artificial quartz, but I wonder if it's too hard for normal masonry bit. | 2010/12/13 | [
"https://diy.stackexchange.com/questions/3469",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/1313/"
] | With my granite counter top there are steel plates which have been epoxied to the underside of the granite counter. The dishwasher clips then are bolted into these. When my granite counter top was installed the installers left the plates and the epoxy (since the dishwasher was not there yet) but I am sure you can find ... | I used a bit from Menards store like a Home Depot or Lowes. I cut a 1 3/8 hole in Cambria quartz for a faucet. The Brand was Montana MB-65208 diamond tipped bit. I cut at an angle to start then cut straight through by using the pumping motion, Applying water every few seconds. I did a practice and a real cut no problem... |
3,469 | I need to drill 2 small holes on the underside of my Silestone countertop to secure a new dishwasher. What kind of drill bit can I use?
AFAIK Silestone is some kind of artificial quartz, but I wonder if it's too hard for normal masonry bit. | 2010/12/13 | [
"https://diy.stackexchange.com/questions/3469",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/1313/"
] | Silestone is natural quartz aggregate, held together by a polymer binder. I believe it's something like 85% quartz. You'll need a diamond coated bit like **[this one](http://www.lowes.com/pd_146373-67702-728020_0__?productId=1017877&Ntt=diamond+drill&pl=1¤tURL=/pl__0__s%3FNtt%3Ddiamond%2Bdrill)**; it's a tiny hol... | Is your dishwasher configured so that you can attach it to the sides of the cabinets instead? This method would only require a normal wood drill bit for a pilot hole. You may want to put some tape or a depth stop collar around the bit so that you don't drill all the way through the cabinet walls though.
An employee at... |
3,469 | I need to drill 2 small holes on the underside of my Silestone countertop to secure a new dishwasher. What kind of drill bit can I use?
AFAIK Silestone is some kind of artificial quartz, but I wonder if it's too hard for normal masonry bit. | 2010/12/13 | [
"https://diy.stackexchange.com/questions/3469",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/1313/"
] | I had a similar situation and solved it by gluing a strip of wood with the same finish as the cabinets underneath the counter top and securing the dishwasher to it instead. If you have the room underneath your counters for it, this might be something to consider. IIRC, the piece I used was 3/8" high by 1" deep and ran ... | With my granite counter top there are steel plates which have been epoxied to the underside of the granite counter. The dishwasher clips then are bolted into these. When my granite counter top was installed the installers left the plates and the epoxy (since the dishwasher was not there yet) but I am sure you can find ... |
3,469 | I need to drill 2 small holes on the underside of my Silestone countertop to secure a new dishwasher. What kind of drill bit can I use?
AFAIK Silestone is some kind of artificial quartz, but I wonder if it's too hard for normal masonry bit. | 2010/12/13 | [
"https://diy.stackexchange.com/questions/3469",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/1313/"
] | I had a similar situation and solved it by gluing a strip of wood with the same finish as the cabinets underneath the counter top and securing the dishwasher to it instead. If you have the room underneath your counters for it, this might be something to consider. IIRC, the piece I used was 3/8" high by 1" deep and ran ... | If you have trouble getting hold of a diamond tip drill, or simply find that far too expensive, you should be able to use a regular glass drill bit for the job. Two precautions are required:
1. Don't drill at too high a speed
2. Keep the it cool
The simplest way to achieve cooling for the bit is to create a circle of... |
3,469 | I need to drill 2 small holes on the underside of my Silestone countertop to secure a new dishwasher. What kind of drill bit can I use?
AFAIK Silestone is some kind of artificial quartz, but I wonder if it's too hard for normal masonry bit. | 2010/12/13 | [
"https://diy.stackexchange.com/questions/3469",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/1313/"
] | I had a similar situation and solved it by gluing a strip of wood with the same finish as the cabinets underneath the counter top and securing the dishwasher to it instead. If you have the room underneath your counters for it, this might be something to consider. IIRC, the piece I used was 3/8" high by 1" deep and ran ... | Is your dishwasher configured so that you can attach it to the sides of the cabinets instead? This method would only require a normal wood drill bit for a pilot hole. You may want to put some tape or a depth stop collar around the bit so that you don't drill all the way through the cabinet walls though.
An employee at... |
3,469 | I need to drill 2 small holes on the underside of my Silestone countertop to secure a new dishwasher. What kind of drill bit can I use?
AFAIK Silestone is some kind of artificial quartz, but I wonder if it's too hard for normal masonry bit. | 2010/12/13 | [
"https://diy.stackexchange.com/questions/3469",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/1313/"
] | Silestone is natural quartz aggregate, held together by a polymer binder. I believe it's something like 85% quartz. You'll need a diamond coated bit like **[this one](http://www.lowes.com/pd_146373-67702-728020_0__?productId=1017877&Ntt=diamond+drill&pl=1¤tURL=/pl__0__s%3FNtt%3Ddiamond%2Bdrill)**; it's a tiny hol... | With my granite counter top there are steel plates which have been epoxied to the underside of the granite counter. The dishwasher clips then are bolted into these. When my granite counter top was installed the installers left the plates and the epoxy (since the dishwasher was not there yet) but I am sure you can find ... |
3,469 | I need to drill 2 small holes on the underside of my Silestone countertop to secure a new dishwasher. What kind of drill bit can I use?
AFAIK Silestone is some kind of artificial quartz, but I wonder if it's too hard for normal masonry bit. | 2010/12/13 | [
"https://diy.stackexchange.com/questions/3469",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/1313/"
] | Silestone is natural quartz aggregate, held together by a polymer binder. I believe it's something like 85% quartz. You'll need a diamond coated bit like **[this one](http://www.lowes.com/pd_146373-67702-728020_0__?productId=1017877&Ntt=diamond+drill&pl=1¤tURL=/pl__0__s%3FNtt%3Ddiamond%2Bdrill)**; it's a tiny hol... | I had a similar situation and solved it by gluing a strip of wood with the same finish as the cabinets underneath the counter top and securing the dishwasher to it instead. If you have the room underneath your counters for it, this might be something to consider. IIRC, the piece I used was 3/8" high by 1" deep and ran ... |
3,469 | I need to drill 2 small holes on the underside of my Silestone countertop to secure a new dishwasher. What kind of drill bit can I use?
AFAIK Silestone is some kind of artificial quartz, but I wonder if it's too hard for normal masonry bit. | 2010/12/13 | [
"https://diy.stackexchange.com/questions/3469",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/1313/"
] | With my granite counter top there are steel plates which have been epoxied to the underside of the granite counter. The dishwasher clips then are bolted into these. When my granite counter top was installed the installers left the plates and the epoxy (since the dishwasher was not there yet) but I am sure you can find ... | If you have trouble getting hold of a diamond tip drill, or simply find that far too expensive, you should be able to use a regular glass drill bit for the job. Two precautions are required:
1. Don't drill at too high a speed
2. Keep the it cool
The simplest way to achieve cooling for the bit is to create a circle of... |
157,125 | I am currently learning about how the compilation and linking works in C++. I think I kinda get how the compiler works, and that for a file to fully compile you don't need to have function implementations, but only declarations. It is the linker's job to link the function declaration to its implementation.
But now I h... | 2023/01/27 | [
"https://cs.stackexchange.com/questions/157125",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/157168/"
] | The compiler compiles from a .cpp file to an object file (.o) with the binary code.
The linker combines all of the object files together into a single binary.
So, the linker doesn't need to know which cpp to look at, because the linker doesn't look at cpp files. Instead, the linker looks at all of the .o files, figur... | >
> It is the linker's job to link the function declaration to its implementation
>
>
>
This is not true. This is the compiler's job. Essentially the declaration (I'm assuming you mean the prototype, as in `return_type function_name (arguments...)`) is part of the language to allow you to tell the compiler what th... |
157,125 | I am currently learning about how the compilation and linking works in C++. I think I kinda get how the compiler works, and that for a file to fully compile you don't need to have function implementations, but only declarations. It is the linker's job to link the function declaration to its implementation.
But now I h... | 2023/01/27 | [
"https://cs.stackexchange.com/questions/157125",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/157168/"
] | The compiler compiles from a .cpp file to an object file (.o) with the binary code.
The linker combines all of the object files together into a single binary.
So, the linker doesn't need to know which cpp to look at, because the linker doesn't look at cpp files. Instead, the linker looks at all of the .o files, figur... | For C and C++, the linker's job is the same, ignoring template classes/functions.
The .o / .obj files are split into Sections, each of which has a Symbol Table.
The Symbol Table has the offset into this Section of each exported Symbol (function, global variable), and a set of relations. These are the function calls, ... |
157,125 | I am currently learning about how the compilation and linking works in C++. I think I kinda get how the compiler works, and that for a file to fully compile you don't need to have function implementations, but only declarations. It is the linker's job to link the function declaration to its implementation.
But now I h... | 2023/01/27 | [
"https://cs.stackexchange.com/questions/157125",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/157168/"
] | The linker is given explicitly the list of files to use, in the command line of the linker. They can be object files (.obj / .o) - compiled code - or libraries (.lib / .a) - object files structured in a single one.
Part of the job of the linker is to establish a list of the available functions and assign them an addre... | >
> It is the linker's job to link the function declaration to its implementation
>
>
>
This is not true. This is the compiler's job. Essentially the declaration (I'm assuming you mean the prototype, as in `return_type function_name (arguments...)`) is part of the language to allow you to tell the compiler what th... |
157,125 | I am currently learning about how the compilation and linking works in C++. I think I kinda get how the compiler works, and that for a file to fully compile you don't need to have function implementations, but only declarations. It is the linker's job to link the function declaration to its implementation.
But now I h... | 2023/01/27 | [
"https://cs.stackexchange.com/questions/157125",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/157168/"
] | The linker is given explicitly the list of files to use, in the command line of the linker. They can be object files (.obj / .o) - compiled code - or libraries (.lib / .a) - object files structured in a single one.
Part of the job of the linker is to establish a list of the available functions and assign them an addre... | For C and C++, the linker's job is the same, ignoring template classes/functions.
The .o / .obj files are split into Sections, each of which has a Symbol Table.
The Symbol Table has the offset into this Section of each exported Symbol (function, global variable), and a set of relations. These are the function calls, ... |
157,125 | I am currently learning about how the compilation and linking works in C++. I think I kinda get how the compiler works, and that for a file to fully compile you don't need to have function implementations, but only declarations. It is the linker's job to link the function declaration to its implementation.
But now I h... | 2023/01/27 | [
"https://cs.stackexchange.com/questions/157125",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/157168/"
] | >
> It is the linker's job to link the function declaration to its implementation
>
>
>
This is not true. This is the compiler's job. Essentially the declaration (I'm assuming you mean the prototype, as in `return_type function_name (arguments...)`) is part of the language to allow you to tell the compiler what th... | For C and C++, the linker's job is the same, ignoring template classes/functions.
The .o / .obj files are split into Sections, each of which has a Symbol Table.
The Symbol Table has the offset into this Section of each exported Symbol (function, global variable), and a set of relations. These are the function calls, ... |
12,159,915 | My scene consists of a plane which I'm shading with two textures. The first, bottom-most, texture is a solid image coming from the camera of the iPhone, the second image is a kind of viewfinder which I need to overlay over the camera input (with transparency). I'm getting these black dark lines at the borders of solids... | 2012/08/28 | [
"https://Stackoverflow.com/questions/12159915",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/341358/"
] | This may be because of `premultiplied alpha` in PNG images. Try to modify blending mode:
```
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); // instead of (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
``` | I found the solution to my problem by investigating how the `glBlendFunc` call works. I used [this editor](http://www.andersriggelsen.dk/glblendfunc.php) to check what formula is used to blend with `GL_ONE` and `GL_ONE_MINUS_SRC_ALPHA`.
This led to the following fragment shader code:
```
lowp vec4 camera = texture2D(... |
39,675,764 | I have a table called Student, the student table contains the id, first\_name and last\_name. I am trying to select and concatenate first\_name and last\_name and display the column as "Name". This is my query:
```
Student.select("concat(first_name, ' ', last_name) as 'Name'").find(201410204)
```
but it returns
```... | 2016/09/24 | [
"https://Stackoverflow.com/questions/39675764",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5943177/"
] | Let me give you two solutions, one by using the **`power of rails`** and other using the **`scalability of rails`**.
**1) (Using power of rails)**
In the `Student` model create a method named `full_name` and concatenate `first_name and last_name`.
```
class Student < ActiveRecord::Base
.....
def full_name
"#{try... | With `select` you restrict the returned columns. Your query returns only the Column `Name`. `id` and all other columns are missing. In this case you get an instance of student where all attributes are `nil`. Only the attribute `Name` is set. When you try `Student.select("concat(first_name, ' ', last_name) as 'Name'").f... |
39,675,764 | I have a table called Student, the student table contains the id, first\_name and last\_name. I am trying to select and concatenate first\_name and last\_name and display the column as "Name". This is my query:
```
Student.select("concat(first_name, ' ', last_name) as 'Name'").find(201410204)
```
but it returns
```... | 2016/09/24 | [
"https://Stackoverflow.com/questions/39675764",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5943177/"
] | You need to select the id as well:
```
Student.select(:id, "CONCAT(first_name,' ',last_name) as name").find(201410204)
2.4.1 :073 > Student.select(:id, "CONCAT(first_name,' ',last_name) as name").find(23000)
Student Load (0.9ms) SELECT "students"."id", CONCAT(first_name,' ',last_name) as name FROM "students" WHERE ... | With `select` you restrict the returned columns. Your query returns only the Column `Name`. `id` and all other columns are missing. In this case you get an instance of student where all attributes are `nil`. Only the attribute `Name` is set. When you try `Student.select("concat(first_name, ' ', last_name) as 'Name'").f... |
39,675,764 | I have a table called Student, the student table contains the id, first\_name and last\_name. I am trying to select and concatenate first\_name and last\_name and display the column as "Name". This is my query:
```
Student.select("concat(first_name, ' ', last_name) as 'Name'").find(201410204)
```
but it returns
```... | 2016/09/24 | [
"https://Stackoverflow.com/questions/39675764",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5943177/"
] | Let me give you two solutions, one by using the **`power of rails`** and other using the **`scalability of rails`**.
**1) (Using power of rails)**
In the `Student` model create a method named `full_name` and concatenate `first_name and last_name`.
```
class Student < ActiveRecord::Base
.....
def full_name
"#{try... | One solution
In model Create A method
```
def full_name
"#{self.try(:first_name)} #{self.try(:last_name)}"
end
Now
Student.find(121).full_name
``` |
39,675,764 | I have a table called Student, the student table contains the id, first\_name and last\_name. I am trying to select and concatenate first\_name and last\_name and display the column as "Name". This is my query:
```
Student.select("concat(first_name, ' ', last_name) as 'Name'").find(201410204)
```
but it returns
```... | 2016/09/24 | [
"https://Stackoverflow.com/questions/39675764",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5943177/"
] | You need to select the id as well:
```
Student.select(:id, "CONCAT(first_name,' ',last_name) as name").find(201410204)
2.4.1 :073 > Student.select(:id, "CONCAT(first_name,' ',last_name) as name").find(23000)
Student Load (0.9ms) SELECT "students"."id", CONCAT(first_name,' ',last_name) as name FROM "students" WHERE ... | One solution
In model Create A method
```
def full_name
"#{self.try(:first_name)} #{self.try(:last_name)}"
end
Now
Student.find(121).full_name
``` |
36,486,707 | I am new to Java and I have trouble understanding one thing:
When I am declaring an Object by assigning to a sub object (a class extending object), it doesn't have access to sub object attributes.
Why is that ?
Let's say I have this:
```
public class A {
public int a;
}
public class B extends A {
public int... | 2016/04/07 | [
"https://Stackoverflow.com/questions/36486707",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2591935/"
] | The object is of type `B` only at runtime, at compile time , the compiler does not that its actual type is B since the variable `object` is declared of type `A`, an explicit downcast is required
```
A object = new B();
B b = (B)object;
int x = b.b;
``` | If you called `myfunc()`:
```
A object = myfunc();
```
And I define `myfunc()` as:
```
A myfunc() {
if (new Random().nextBoolean()) {
return new A();
} else {
return new B();
}
}
```
Can you still expect to always access `object.b`? No. `myfunc()` is only promising that it will return somet... |
1,805,960 | Here is the scenario. I have an application which writes a configuration file in its directory (`user.dir`). When the user cannot write to that directory due to UAC issues, I would like to change that to write to `user.home/.appname/`. The problem is that Windows really lies to my application and writes to `user.dir` w... | 2009/11/26 | [
"https://Stackoverflow.com/questions/1805960",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/77779/"
] | This problem occurs if the Java executable is not marked as Vista compatible (using the manifest). The current release from Sun is marked as compatible. So the simplest solution is to use the latest release. This means that now neither files nor registry entries are virtualised.
---
Edit from author of OP:
[Java 6 U... | After writing your file, can you just check that the file suddenly appeared in virtualized directory? I'd do a small "touch" file at app start to set a global boolean variable userUserHome. |
1,805,960 | Here is the scenario. I have an application which writes a configuration file in its directory (`user.dir`). When the user cannot write to that directory due to UAC issues, I would like to change that to write to `user.home/.appname/`. The problem is that Windows really lies to my application and writes to `user.dir` w... | 2009/11/26 | [
"https://Stackoverflow.com/questions/1805960",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/77779/"
] | This problem occurs if the Java executable is not marked as Vista compatible (using the manifest). The current release from Sun is marked as compatible. So the simplest solution is to use the latest release. This means that now neither files nor registry entries are virtualised.
---
Edit from author of OP:
[Java 6 U... | 1. Prepare a native EXE that loads the JVM in process (java.exe does this but you will need your own).
2. Add a manifest file (or in RC data) that specifies UAC as invoker.
3. Try writing to the folder to see if it works.
Or decide this is too much work and use a config file. |
30,093,561 | I need to merge two json object based on key value using javascript.
I have two different variable g and c.
terms: All values need to merge.
```
var g = [ { id: 36, name: 'AAA', goal: 'yes' },
{ id: 40, name: 'BBB', goal: 'yes' },
{ id: 57, name: 'CCC', goal: 'yes' },
{ id: 4, name: 'DDD', goal: 'yes' }... | 2015/05/07 | [
"https://Stackoverflow.com/questions/30093561",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1393678/"
] | You forgot to push `obj` in the first loop in case the id doesn't exist in `c` and to loop through `c` in case one or more id's of that object does not exist in `g`.
```
var g = [
{ id: 36, name: 'AAA', goal: 'yes' },
{ id: 40, name: 'BBB', goal: 'yes' },
{ id: 57, name: 'CCC', goal: 'yes' },
... | Try using jquery. Try this :
```
var g= [
{ id: 36, name: 'AAA', goal: 'yes' },
{ id: 40, name: 'BBB', goal: 'yes' },
{ id: 57, name: 'CCC', goal: 'yes' },
{ id: 4, name: 'DDD', goal: 'yes' },
{ id: 39, name: 'EEE', goal: 'yes' },
{ id: 37, name: 'FFF', goal: 'yes' },
{ id: 59, name: 'GGG'... |
30,093,561 | I need to merge two json object based on key value using javascript.
I have two different variable g and c.
terms: All values need to merge.
```
var g = [ { id: 36, name: 'AAA', goal: 'yes' },
{ id: 40, name: 'BBB', goal: 'yes' },
{ id: 57, name: 'CCC', goal: 'yes' },
{ id: 4, name: 'DDD', goal: 'yes' }... | 2015/05/07 | [
"https://Stackoverflow.com/questions/30093561",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1393678/"
] | Using undescore.js, you can write some function like this:
```js
var a = [ { id: 36, name: 'AAA', goal: 'yes' },
{ id: 40, name: 'BBB', goal: 'yes' },
{ id: 57, name: 'CCC', goal: 'yes' },
{ id: 4, name: 'DDD', goal: 'yes' },
{ id: 39, name: 'EEE', goal: 'yes' },
{ id: 37, name: 'FFF', goal: '... | Try using jquery. Try this :
```
var g= [
{ id: 36, name: 'AAA', goal: 'yes' },
{ id: 40, name: 'BBB', goal: 'yes' },
{ id: 57, name: 'CCC', goal: 'yes' },
{ id: 4, name: 'DDD', goal: 'yes' },
{ id: 39, name: 'EEE', goal: 'yes' },
{ id: 37, name: 'FFF', goal: 'yes' },
{ id: 59, name: 'GGG'... |
30,093,561 | I need to merge two json object based on key value using javascript.
I have two different variable g and c.
terms: All values need to merge.
```
var g = [ { id: 36, name: 'AAA', goal: 'yes' },
{ id: 40, name: 'BBB', goal: 'yes' },
{ id: 57, name: 'CCC', goal: 'yes' },
{ id: 4, name: 'DDD', goal: 'yes' }... | 2015/05/07 | [
"https://Stackoverflow.com/questions/30093561",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1393678/"
] | You forgot to push `obj` in the first loop in case the id doesn't exist in `c` and to loop through `c` in case one or more id's of that object does not exist in `g`.
```
var g = [
{ id: 36, name: 'AAA', goal: 'yes' },
{ id: 40, name: 'BBB', goal: 'yes' },
{ id: 57, name: 'CCC', goal: 'yes' },
... | You could do it like this,
```
var g = [ { id: 36, name: 'AAA', goal: 'yes' },
{ id: 40, name: 'BBB', goal: 'yes' },
{ id: 57, name: 'CCC', goal: 'yes' },
{ id: 4, name: 'DDD', goal: 'yes' },
{ id: 39, name: 'EEE', goal: 'yes' },
{ id: 37, name: 'FFF', goal: 'yes' },
{ id: 59, name: 'GGG', goal... |
30,093,561 | I need to merge two json object based on key value using javascript.
I have two different variable g and c.
terms: All values need to merge.
```
var g = [ { id: 36, name: 'AAA', goal: 'yes' },
{ id: 40, name: 'BBB', goal: 'yes' },
{ id: 57, name: 'CCC', goal: 'yes' },
{ id: 4, name: 'DDD', goal: 'yes' }... | 2015/05/07 | [
"https://Stackoverflow.com/questions/30093561",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1393678/"
] | You forgot to push `obj` in the first loop in case the id doesn't exist in `c` and to loop through `c` in case one or more id's of that object does not exist in `g`.
```
var g = [
{ id: 36, name: 'AAA', goal: 'yes' },
{ id: 40, name: 'BBB', goal: 'yes' },
{ id: 57, name: 'CCC', goal: 'yes' },
... | Using undescore.js, you can write some function like this:
```js
var a = [ { id: 36, name: 'AAA', goal: 'yes' },
{ id: 40, name: 'BBB', goal: 'yes' },
{ id: 57, name: 'CCC', goal: 'yes' },
{ id: 4, name: 'DDD', goal: 'yes' },
{ id: 39, name: 'EEE', goal: 'yes' },
{ id: 37, name: 'FFF', goal: '... |
30,093,561 | I need to merge two json object based on key value using javascript.
I have two different variable g and c.
terms: All values need to merge.
```
var g = [ { id: 36, name: 'AAA', goal: 'yes' },
{ id: 40, name: 'BBB', goal: 'yes' },
{ id: 57, name: 'CCC', goal: 'yes' },
{ id: 4, name: 'DDD', goal: 'yes' }... | 2015/05/07 | [
"https://Stackoverflow.com/questions/30093561",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1393678/"
] | Using undescore.js, you can write some function like this:
```js
var a = [ { id: 36, name: 'AAA', goal: 'yes' },
{ id: 40, name: 'BBB', goal: 'yes' },
{ id: 57, name: 'CCC', goal: 'yes' },
{ id: 4, name: 'DDD', goal: 'yes' },
{ id: 39, name: 'EEE', goal: 'yes' },
{ id: 37, name: 'FFF', goal: '... | You could do it like this,
```
var g = [ { id: 36, name: 'AAA', goal: 'yes' },
{ id: 40, name: 'BBB', goal: 'yes' },
{ id: 57, name: 'CCC', goal: 'yes' },
{ id: 4, name: 'DDD', goal: 'yes' },
{ id: 39, name: 'EEE', goal: 'yes' },
{ id: 37, name: 'FFF', goal: 'yes' },
{ id: 59, name: 'GGG', goal... |
13,763,352 | I'm a HTML/CSS developer, researching javascript solutions for building a 'family-tree' which **needs to show marriages** (from outside the family, of course) in a meaningful way.
Essentially I'm looking at basing it upon a dendrogram, based on d3.js, e.g. <http://bl.ocks.org/4063570>, but I've struggled to find anyth... | 2012/12/07 | [
"https://Stackoverflow.com/questions/13763352",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/390477/"
] | There are some options, but I believe each would require a bit of work. It would help if there were one single standard for representing a family tree in JSON. I've recently noticed that geni.com has a quite in-depth API for this. Perhaps coding against their API would be a good idea for reusability...
-- Pedigree tre... | I also needed to draw pedigrees with D3 so I figured out how. I have [created examples](https://github.com/justincy/d3-pedigree-examples) that show the basic functionality and then add on advanced features such as expanding and showing descendants.
I don't know how you want to display marriages. Marriages are inherent... |
13,763,352 | I'm a HTML/CSS developer, researching javascript solutions for building a 'family-tree' which **needs to show marriages** (from outside the family, of course) in a meaningful way.
Essentially I'm looking at basing it upon a dendrogram, based on d3.js, e.g. <http://bl.ocks.org/4063570>, but I've struggled to find anyth... | 2012/12/07 | [
"https://Stackoverflow.com/questions/13763352",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/390477/"
] | There are some options, but I believe each would require a bit of work. It would help if there were one single standard for representing a family tree in JSON. I've recently noticed that geni.com has a quite in-depth API for this. Perhaps coding against their API would be a good idea for reusability...
-- Pedigree tre... | This needs some work, but essentially the idea I propose is do a force layout with a special kind of node called relationship that do not draw a circle. It represents the bind between two subjects and can be the parent of more nodes.
In d3 you can extend all the data structures to fit what you want, then there is mor... |
13,763,352 | I'm a HTML/CSS developer, researching javascript solutions for building a 'family-tree' which **needs to show marriages** (from outside the family, of course) in a meaningful way.
Essentially I'm looking at basing it upon a dendrogram, based on d3.js, e.g. <http://bl.ocks.org/4063570>, but I've struggled to find anyth... | 2012/12/07 | [
"https://Stackoverflow.com/questions/13763352",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/390477/"
] | I also needed to draw pedigrees with D3 so I figured out how. I have [created examples](https://github.com/justincy/d3-pedigree-examples) that show the basic functionality and then add on advanced features such as expanding and showing descendants.
I don't know how you want to display marriages. Marriages are inherent... | This needs some work, but essentially the idea I propose is do a force layout with a special kind of node called relationship that do not draw a circle. It represents the bind between two subjects and can be the parent of more nodes.
In d3 you can extend all the data structures to fit what you want, then there is mor... |
5,807,818 | Guys, can anyone explain the following scenario:
1) Web application has `module1.jar` in its `lib` directory. There is a class `A` in that module:
```
package module1;
import module2.B;
public interface IA {
void methodOk() {}
void methodWithB(B param) {}
}
package module1;
import module2.B;
public class... | 2011/04/27 | [
"https://Stackoverflow.com/questions/5807818",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/336184/"
] | Since the code is already compiled, it will not throw an error until you directly use class `B`. From the looks of your code, you don't actually use an instance of `B` for anything. | If B is not *used* by A anywhere, then the resulting bytecode will have no reference to module2.B, therefore it gets compiled away. No dependency exists, *except* at compilation in this case.
If the question is unclear and B *is* used in A somewhere, then I'd be interested in seeing more code to try to determine what'... |
5,807,818 | Guys, can anyone explain the following scenario:
1) Web application has `module1.jar` in its `lib` directory. There is a class `A` in that module:
```
package module1;
import module2.B;
public interface IA {
void methodOk() {}
void methodWithB(B param) {}
}
package module1;
import module2.B;
public class... | 2011/04/27 | [
"https://Stackoverflow.com/questions/5807818",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/336184/"
] | Since the code is already compiled, it will not throw an error until you directly use class `B`. From the looks of your code, you don't actually use an instance of `B` for anything. | Look at it from the perspective of the classloader. If you never have to load the class, you don't care if the bytecode for that class is missing.
Your question is really, "What triggers classloading?"
Two reasons I can think of off the top of my head are:
- Construction
- Static access |
5,807,818 | Guys, can anyone explain the following scenario:
1) Web application has `module1.jar` in its `lib` directory. There is a class `A` in that module:
```
package module1;
import module2.B;
public interface IA {
void methodOk() {}
void methodWithB(B param) {}
}
package module1;
import module2.B;
public class... | 2011/04/27 | [
"https://Stackoverflow.com/questions/5807818",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/336184/"
] | If B is not *used* by A anywhere, then the resulting bytecode will have no reference to module2.B, therefore it gets compiled away. No dependency exists, *except* at compilation in this case.
If the question is unclear and B *is* used in A somewhere, then I'd be interested in seeing more code to try to determine what'... | Look at it from the perspective of the classloader. If you never have to load the class, you don't care if the bytecode for that class is missing.
Your question is really, "What triggers classloading?"
Two reasons I can think of off the top of my head are:
- Construction
- Static access |
68,804,918 | I have only one button. In css you can use *button:active { do stuff }* and it will become valid once and after the button is clicked, so interacting with other objects (clicking on a image) will cause
the statement to be null. How Can I translate this into java script?
Something like that:
```
const Ham_Button = docu... | 2021/08/16 | [
"https://Stackoverflow.com/questions/68804918",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16680185/"
] | >
> How do you achieve the same when using Cloud Storage or Azure Storage?
>
>
>
In Azure Storage, you don't have to do anything special. The ownership of objects (blobs) always lie with the storage account owner where the blob is being uploaded. They can delegate permissions to manage the blob to some other users... | Firebase Storage is closer to Dropbox or Google Drive where the owner is technically the bucket, Should you want to track who the owner is, you can however use the metadata
```js
var newMetadata = {
customMetadata : {
'owner': auth().currentUser.uid
}
};
storageItemReference.updateMetadata(newMetadata)
... |
68,804,918 | I have only one button. In css you can use *button:active { do stuff }* and it will become valid once and after the button is clicked, so interacting with other objects (clicking on a image) will cause
the statement to be null. How Can I translate this into java script?
Something like that:
```
const Ham_Button = docu... | 2021/08/16 | [
"https://Stackoverflow.com/questions/68804918",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16680185/"
] | For Google Cloud Storage, the equivalent of uploading an object with the `x-amz-acl=bucket-owner-full-control` is to upload an object with the `x-goog-acl=bucket-owner-full-control` header. Switching the `amz` to `goog` works for most headers. There's a [translation table](https://cloud.google.com/storage/docs/migratin... | Firebase Storage is closer to Dropbox or Google Drive where the owner is technically the bucket, Should you want to track who the owner is, you can however use the metadata
```js
var newMetadata = {
customMetadata : {
'owner': auth().currentUser.uid
}
};
storageItemReference.updateMetadata(newMetadata)
... |
25,731,716 | Hi I have an input field where I want to do validation such that input only has numbers but with dashes and 11 number maximum
```
i.e 1233-224-1234
```
I have following validation applied that only accepts numbers
```
<input ng-pattern="customNum" ng-model=value.id />
In my controller I have
function my... | 2014/09/08 | [
"https://Stackoverflow.com/questions/25731716",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1764254/"
] | Please see here :<http://jsbin.com/talaz/1/>
```
<form name="form" class="css-form" novalidate>
<input type="text" ng-model="code" name="code" ng-pattern='/^\d{4}-\d{3}-\d{4}$/' />Code :{{code}}<br />
<span ng-show="form.size.$error.pattern ">
The code need to falow that 123... | You can try this if the digits are not fixed:
```
^\d+[-]\d+[-]\d+$
```
If your digits are fixed then :
```
^\d{4}-\d{3}-\d{4}$
``` |
25,731,716 | Hi I have an input field where I want to do validation such that input only has numbers but with dashes and 11 number maximum
```
i.e 1233-224-1234
```
I have following validation applied that only accepts numbers
```
<input ng-pattern="customNum" ng-model=value.id />
In my controller I have
function my... | 2014/09/08 | [
"https://Stackoverflow.com/questions/25731716",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1764254/"
] | Please see here :<http://jsbin.com/talaz/1/>
```
<form name="form" class="css-form" novalidate>
<input type="text" ng-model="code" name="code" ng-pattern='/^\d{4}-\d{3}-\d{4}$/' />Code :{{code}}<br />
<span ng-show="form.size.$error.pattern ">
The code need to falow that 123... | If you want a reusable validation that you can use in a lot of places and change in one place you can use a custom validator directive. I've called it a creditcard validator just for the example.
```
<form name="form">
<input type="text" ng-model="user.creditcard" name="creditcardNumber" validate-creditcard>
<sp... |
14,897,971 | I am writing a test script for a website and we have two servers running the script. I would like be able to access the name of the server to set which username should be used within the script.
My properties file says:
```
grinder.hostID = 1
```
My script says:
```
if grinder.hostID:
offset = 1
```... | 2013/02/15 | [
"https://Stackoverflow.com/questions/14897971",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2076059/"
] | Might be more reliable to get info about the host you are running on programmatically. That way you don't need to worry about accidentally setting identical (or otherwise incorrect) values for grinder.hostid on your various agents. You could use something like this:
```
import socket
# ...
host_id = socket.gethostname... | Are you sure that your `properties` is being imported in your `script` |
6,974,943 | >
> **Possible Duplicates:**
>
> [NSString retainCount is 2147483647](https://stackoverflow.com/questions/5483357/nsstring-retaincount-is-2147483647)
>
> [Objective C NSString\* property retain count oddity](https://stackoverflow.com/questions/403112/objective-c-nsstring-property-retain-count-oddity)
>
>
>
... | 2011/08/07 | [
"https://Stackoverflow.com/questions/6974943",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/734444/"
] | You initiate your NSString object with **string literal** and 2 following things happen:
1. As NSString is immutable -initWithString: method optimizes string creation so that your testString actually points to a same string you create it with (@"Test")
2. @"Test" is a **string literal** and it is created in compile ti... | You can only have two expectations for the result of retainCount:
1) It's greater than 1. You cannot predict what number it will actually be because you don't know who else is using it. You don't know how somebody else is using it. It's not a number you should care about.
2) People will tell you not to use it. Becaus... |
868,000 | A given text states, “Every real number except zero has a multiplicative inverse" (where mul-
tiplicative inverse of a real number x is a real number y such that xy = 1).
It offers the following translation:
$$\forall x((x\neq 0) \rightarrow \exists y(xy = 1)).$$
I personally translated the statement as:
$$\forall ... | 2014/07/15 | [
"https://math.stackexchange.com/questions/868000",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/128182/"
] | Yes :
>
> $∀x((x \ne 0 ) → ∃y(xy = 1 ))$
>
>
>
and
>
> $∀x∃y((x \ne 0) → (xy = 1))$
>
>
>
are logically equivalent, because :
>
>
> >
> > $\vdash \exists y (\alpha \rightarrow \beta) \leftrightarrow (\alpha \rightarrow \exists y \beta) \quad $ if $y$ is not *free* in $\alpha$.
> >
> >
> >
>
>
>
... | Yes, it is a general principle that if $y$ does not appear in $\varphi$, then the following are equivalent.
1. $\varphi \rightarrow \exists y(\psi)$
2. $\exists y(\varphi \rightarrow \psi)$ |
868,000 | A given text states, “Every real number except zero has a multiplicative inverse" (where mul-
tiplicative inverse of a real number x is a real number y such that xy = 1).
It offers the following translation:
$$\forall x((x\neq 0) \rightarrow \exists y(xy = 1)).$$
I personally translated the statement as:
$$\forall ... | 2014/07/15 | [
"https://math.stackexchange.com/questions/868000",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/128182/"
] | Yes :
>
> $∀x((x \ne 0 ) → ∃y(xy = 1 ))$
>
>
>
and
>
> $∀x∃y((x \ne 0) → (xy = 1))$
>
>
>
are logically equivalent, because :
>
>
> >
> > $\vdash \exists y (\alpha \rightarrow \beta) \leftrightarrow (\alpha \rightarrow \exists y \beta) \quad $ if $y$ is not *free* in $\alpha$.
> >
> >
> >
>
>
>
... | Yes, it is correct.
This principle is known as "null quantification rule".
In this case, the left-hand $x$ is independent of domain $y$. So, we can place $y$ domain on left hand side.
Follow the below link to get more details about null quantification rule.
<https://gateoverflow.in/130504/null-qunatification-rule> |
868,000 | A given text states, “Every real number except zero has a multiplicative inverse" (where mul-
tiplicative inverse of a real number x is a real number y such that xy = 1).
It offers the following translation:
$$\forall x((x\neq 0) \rightarrow \exists y(xy = 1)).$$
I personally translated the statement as:
$$\forall ... | 2014/07/15 | [
"https://math.stackexchange.com/questions/868000",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/128182/"
] | Yes, it is a general principle that if $y$ does not appear in $\varphi$, then the following are equivalent.
1. $\varphi \rightarrow \exists y(\psi)$
2. $\exists y(\varphi \rightarrow \psi)$ | Yes, it is correct.
This principle is known as "null quantification rule".
In this case, the left-hand $x$ is independent of domain $y$. So, we can place $y$ domain on left hand side.
Follow the below link to get more details about null quantification rule.
<https://gateoverflow.in/130504/null-qunatification-rule> |
53,949,700 | I'm making myself a portfolio website, and I'm wondering how to scroll the content inside a fixed div relative to the scrolling of the page.
I've tried placing an absolute div over the fixed div, but then all the content doesn't stay inside the fixed div, and trying inside the fixed div means the content stays still,... | 2018/12/27 | [
"https://Stackoverflow.com/questions/53949700",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5741280/"
] | Use [`rand`](https://perldoc.perl.org/functions/rand.html).
Five random number from 0 to 50:
```
@randoms = map {int(rand(50))} 1..5;
```
In your one-liner:
```
perl -F'\t' -lane 'print join ",", @F[map {int(rand(50))} 1..5]' inputfile
```
To use the same random column indexes for each line, use a `BEGIN` block... | Thank you all very much !!
I solved the problem following your suggestions (see below):
* Randomly selects $extractColumnCount columns from the range 2-$fileColumnCount,
sort them and place them in $cols\_new\_temp
cols\_new\_temp=$(echo $(shuf -i 2-$fileColumnCount -n $extractColumnCount | sort -n))
================... |
53,949,700 | I'm making myself a portfolio website, and I'm wondering how to scroll the content inside a fixed div relative to the scrolling of the page.
I've tried placing an absolute div over the fixed div, but then all the content doesn't stay inside the fixed div, and trying inside the fixed div means the content stays still,... | 2018/12/27 | [
"https://Stackoverflow.com/questions/53949700",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5741280/"
] | Your `perl -e'...$cols_new...'` is using single shell quotes, so the shell is not interpolating the variable.
While you can use interpolation or a command line argument to get information from the shell to a perl oneliner, often an environment variable is less troublesome:
```
export cols_new=1,2
perl -F'\t' -lane 'p... | Thank you all very much !!
I solved the problem following your suggestions (see below):
* Randomly selects $extractColumnCount columns from the range 2-$fileColumnCount,
sort them and place them in $cols\_new\_temp
cols\_new\_temp=$(echo $(shuf -i 2-$fileColumnCount -n $extractColumnCount | sort -n))
================... |
53,949,700 | I'm making myself a portfolio website, and I'm wondering how to scroll the content inside a fixed div relative to the scrolling of the page.
I've tried placing an absolute div over the fixed div, but then all the content doesn't stay inside the fixed div, and trying inside the fixed div means the content stays still,... | 2018/12/27 | [
"https://Stackoverflow.com/questions/53949700",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5741280/"
] | You can just do the random number generation in Perl:
```
perl -F'\t' -lane 'BEGIN { @cols = map int(rand 50) + 1, 1 .. 5 } print join ",", @F[@cols]' inputfile
``` | Thank you all very much !!
I solved the problem following your suggestions (see below):
* Randomly selects $extractColumnCount columns from the range 2-$fileColumnCount,
sort them and place them in $cols\_new\_temp
cols\_new\_temp=$(echo $(shuf -i 2-$fileColumnCount -n $extractColumnCount | sort -n))
================... |
8,736,670 | I am using jQuery UI Autocomplete plugin for better data input in my ASP.NET web application.
<http://jqueryui.com/demos/autocomplete/>
However, I think I have somehow lost in this plugin.
I would like to ask what I should do in order to use this autocomplete function with the data retrieve from database?
I expect A... | 2012/01/05 | [
"https://Stackoverflow.com/questions/8736670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/878334/"
] | You need to create an action that does the lookup and returns the result as a JsonResult
e.g.
```
public ActionResult FirstNameLookup(string firstName)
{
var contacts = FindContacts(firstname);
return Json(contacts.ToArray(), JsonRequestBehavior.AllowGet);
}
``` | I'm not sure if this will solve all your problems but here are a couple of edits you can make.
1. you don't need the "?firstname=" part of the url since you are using the data parameter for you ajax request.
2. rather than grabbing your search term with $('#FirstName').val(), try using the term property of the request... |
16,471,774 | I am working on an app where i am adding panelbars (multiselection) using JSP Wrapper (which means no ID to each of the panels), and inside those have the grids.
The grids are storing data specific to the selected person, who are displayed as list items(images) on the top of the page.
What I want to do is that when u... | 2013/05/09 | [
"https://Stackoverflow.com/questions/16471774",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/927044/"
] | If the `id` of your `PanelBar` is `panel`, do:
```
$("#panel").data("kendoPanelBar").collapse($("li", "#panelbar"));
```
or
```
var panelbar = $("#panelbar").data("kendoPanelBar");
panelbar.collapse($("li", panelbar.element));
```
i.e. we will `collapse` every `li` element under `#panelbar`.
**EDIT**: If you w... | HTML
```
<ul id="palettePanelBar">
<li id="item1" class="k-state-active">
<!--Some Data-->
</li>
<li id="item2">
<!--Some Data for second item-->
</li>
</ul>
```
Javascript
```
var panelBar = $("#palettePanelBar").data("kendoPanelBar... |
16,471,774 | I am working on an app where i am adding panelbars (multiselection) using JSP Wrapper (which means no ID to each of the panels), and inside those have the grids.
The grids are storing data specific to the selected person, who are displayed as list items(images) on the top of the page.
What I want to do is that when u... | 2013/05/09 | [
"https://Stackoverflow.com/questions/16471774",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/927044/"
] | If the `id` of your `PanelBar` is `panel`, do:
```
$("#panel").data("kendoPanelBar").collapse($("li", "#panelbar"));
```
or
```
var panelbar = $("#panelbar").data("kendoPanelBar");
panelbar.collapse($("li", panelbar.element));
```
i.e. we will `collapse` every `li` element under `#panelbar`.
**EDIT**: If you w... | You can use this block to collapse all panel and as a bonus to the answer, you can expand only the selected after that in this way:
```
var panelBar = $("#importCvPanelbar").data("kendoPanelBar");
panelBar.collapse($("li"));// will collapse all panel item
panelBar.bind("select", function(e) {... |
16,471,774 | I am working on an app where i am adding panelbars (multiselection) using JSP Wrapper (which means no ID to each of the panels), and inside those have the grids.
The grids are storing data specific to the selected person, who are displayed as list items(images) on the top of the page.
What I want to do is that when u... | 2013/05/09 | [
"https://Stackoverflow.com/questions/16471774",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/927044/"
] | HTML
```
<ul id="palettePanelBar">
<li id="item1" class="k-state-active">
<!--Some Data-->
</li>
<li id="item2">
<!--Some Data for second item-->
</li>
</ul>
```
Javascript
```
var panelBar = $("#palettePanelBar").data("kendoPanelBar... | You can use this block to collapse all panel and as a bonus to the answer, you can expand only the selected after that in this way:
```
var panelBar = $("#importCvPanelbar").data("kendoPanelBar");
panelBar.collapse($("li"));// will collapse all panel item
panelBar.bind("select", function(e) {... |
148,963 | Keeping the GUI responsive while the application does some CPU-heavy processing is one of the challenges of effective GUI programming.
[Here's a good discussion](http://wiki.wxpython.org/LongRunningTasks) of how to do this in wxPython. To summarize, there are 3 ways:
1. Use threads
2. Use wxYield
3. Chunk the work an... | 2008/09/29 | [
"https://Stackoverflow.com/questions/148963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8206/"
] | Threads or processes depending on the application. Sometimes it's actually best to have the GUI be it's own program and just send asynchronous calls to other programs when it has work to do. You'll still end up having multiple threads in the GUI to monitor for results, but it can simplify things if the work being done ... | I use threads so the GUI's main event loop never blocks. |
148,963 | Keeping the GUI responsive while the application does some CPU-heavy processing is one of the challenges of effective GUI programming.
[Here's a good discussion](http://wiki.wxpython.org/LongRunningTasks) of how to do this in wxPython. To summarize, there are 3 ways:
1. Use threads
2. Use wxYield
3. Chunk the work an... | 2008/09/29 | [
"https://Stackoverflow.com/questions/148963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8206/"
] | Threads -
Let's use a simple 2-layer view (GUI, application logic).
The application logic work should be done in a separate Python thread. For Asynchronous events that need to propagate up to the GUI layer, use wx's event system to post custom events. Posting wx events is thread safe so you could conceivably do it fro... | I use threads so the GUI's main event loop never blocks. |
148,963 | Keeping the GUI responsive while the application does some CPU-heavy processing is one of the challenges of effective GUI programming.
[Here's a good discussion](http://wiki.wxpython.org/LongRunningTasks) of how to do this in wxPython. To summarize, there are 3 ways:
1. Use threads
2. Use wxYield
3. Chunk the work an... | 2008/09/29 | [
"https://Stackoverflow.com/questions/148963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8206/"
] | Definitely threads. Why? The future is multi-core. Almost any new CPU has more than one core or if it has just one, it might support hyperthreading and thus pretending it has more than one. To effectively make use of multi-core CPUs (and Intel is planing to go up to 32 cores in the not so far future), you need multiple... | For some types of operations, using separate processes makes a lot of sense. Back in the day, spawning a process incurred a lot of overhead. With modern hardware this overhead is hardly even a blip on the screen. This is especially true if you're spawning a long running process.
One (arguable) advantage is that it's a... |
148,963 | Keeping the GUI responsive while the application does some CPU-heavy processing is one of the challenges of effective GUI programming.
[Here's a good discussion](http://wiki.wxpython.org/LongRunningTasks) of how to do this in wxPython. To summarize, there are 3 ways:
1. Use threads
2. Use wxYield
3. Chunk the work an... | 2008/09/29 | [
"https://Stackoverflow.com/questions/148963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8206/"
] | Threads or processes depending on the application. Sometimes it's actually best to have the GUI be it's own program and just send asynchronous calls to other programs when it has work to do. You'll still end up having multiple threads in the GUI to monitor for results, but it can simplify things if the work being done ... | This answer doesn't apply to the OP's question regarding Python, but is more of a meta-response.
The easy way is threads. However, not every platform has pre-emptive threading (e.g. BREW, some other embedded systems) If possibly, simply chunk the work and do it in the IDLE event handler.
Another problem with using th... |
148,963 | Keeping the GUI responsive while the application does some CPU-heavy processing is one of the challenges of effective GUI programming.
[Here's a good discussion](http://wiki.wxpython.org/LongRunningTasks) of how to do this in wxPython. To summarize, there are 3 ways:
1. Use threads
2. Use wxYield
3. Chunk the work an... | 2008/09/29 | [
"https://Stackoverflow.com/questions/148963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8206/"
] | Threads. They're what I always go for because you can do it in every framework you need.
And once you're used to multi-threading and parallel processing in one language/framework, you're good on all frameworks. | I think `delayedresult` is what you are looking for:
<http://www.wxpython.org/docs/api/wx.lib.delayedresult-module.html>
See the wxpython demo for an example. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.