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 |
|---|---|---|---|---|---|
700,844 | I'm having a problem with my hard disk.
I only have 80GB of HD, then I rename my Admin user like (Shaqnet to My PC) then from that time before I rename the administrator I only have 39GB space and a free space of 38GB. After I rename it I notice that I only have 1 GB space. What should I do?
I tried to delete the fil... | 2014/01/13 | [
"https://superuser.com/questions/700844",
"https://superuser.com",
"https://superuser.com/users/289468/"
] | Gnome Keyring GUI application is called Seahorse and shows as "Passwords and Keys" in the menu. Seahorse can manage multiple collections and you can lock them directly from the GUI (they appear under **Passwords** in the sidebar) simply by clicking on the padlock icon next to each of them. By default you will have only... | In the main GUI of Gnome keyring (at least in the current version, which is seahorse 3.36), the user can right-click a keyring to get the context menu where an option to lock the keyring is available. It is also possible to create more keyrings in addition to the default one (called "login") and store passwords in diff... |
2,288 | Let us have the following three sets of information

---

---

---
Now I want to combine all of this data and show it all together. Telling it like a story. Giving inter... | 2010/11/01 | [
"https://ux.stackexchange.com/questions/2288",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/2290/"
] | Maybe this [one](https://ux.stackexchange.com/questions/953/how-to-display-the-hierarchical-data-closed)
**ADDED:**
and use it with combination of [Topic Map](https://ux.stackexchange.com/questions/1056/how-to-use-topic-maps) to find out *associations*, *occurrences*(number of occurrences to size "circle") between *... | If you are trying to "visualize" relationships between 1 or more things you may find a tool like [this](http://yuml.me/diagram/scruffy/class/samples) very handy. Not only does it let you visually build a picture with simple text, but it handles many of the "odd" scenarios that might otherwise be hard to indicate.
![al... |
63,022,266 | I am currently trying to upgrade our Python 2.7 project to 3.5. I'm using pipenv to create a virtual environment to do this in. Our server has been upgraded to Ubuntu 16.04. In my current pip environment, when running `python -V` it correctly returns "Python 3.5.2". However, when attempting to start uWSGI I receive the... | 2020/07/21 | [
"https://Stackoverflow.com/questions/63022266",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4289829/"
] | This is odd. It really looks like a Bug... partly
The reason is probably that the angle of the lines are so narrow that MATLAB runs into rounding errors when calculating the points to draw for your limits very small limits given very large numbers. (You see that you don't run into this problem when you don't scale the... | It seems Max pretty much hit the nail on the head as it pertains to the reason for this error is occurring. Per Enrico's advice I went ahead and submitted a bug report. MathWorks responded saying they were unsure it was "unexpected behavior" and would look into it more shortly. They also did suggest a temporary workaro... |
51,534,178 | This was working fine in Asterisk 1.8.32.3 - I'm testing with Asterisk 13.22.0 on Centos 7 running as root (already - as you'll see below):
```
same=>n,System(/usr/src/bash/setData.sh ${CHANNEL(accountcode)})
```
The script's permissions:
```
[root@localhost bash]# ls -l
-rwxr-xr-x 1 root root 1493 Jan 20 2016 set... | 2018/07/26 | [
"https://Stackoverflow.com/questions/51534178",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5847235/"
] | Ok this is resolved.
Turns out that the problem is that one of the parameters I tried to pass through the SYSTEM() and SHELL() calls in my dialplan, contained a linefeed character (\n, or hex 0x0a).
It appears that in Asterisk 13.22.0, in a call to SYSTEM() or SHELL(), parsing and evaluation of Asterisk channel varia... | 1) check selinux
2) try run under same user as you pbx(see asterisk.conf)
if not help, stop asterisk, start asterisk in console mode
```
asterisk -vvvgc
```
see error |
243,913 | So this isnt like a technical question, just some advice.
This is my issue:
A few years ago I had a medical problem but I'll spare you the details.
One of the results is a lack of concentration and motivation.
How it works is that I can get a burst of enthusiasm and work away at a project for hours on end, then it's l... | 2013/01/16 | [
"https://askubuntu.com/questions/243913",
"https://askubuntu.com",
"https://askubuntu.com/users/57196/"
] | There is a writing app called FocusWriter which is a very distraction free text editor. It does however not support any syntax highlighting.
It is available for free download in the Ubuntu Software Center.
And here is a link to their webpage:
<http://gottcode.org/focuswriter/> | I found a solution to the distraction editor.
Having checked out focuswriter, I started looking through Google for similar apps and stumbled upon Marave.
It doesn't work perfectly as I need to start it with sudo in order to save, but it's fullscreen and distraction free, thanks very much for the input |
120,698 | Google search results:
"posts by categories" — 442 000
"posts by category" — 2 820 000
Usually there are many posts and many categories, but many people do something like that: <http://heteconomist.com/all-posts-by-category/> Is it correct? | 2017/02/25 | [
"https://ell.stackexchange.com/questions/120698",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/49764/"
] | People who write *by categories* think about posts sorted into a number of categories, people who write *by category* think about *category* as the criterion for sorting. Either form is acceptable, but I think the singular is mildly preferred in formal discourse. | "posts by categories" is incorrect.
"posts by category" assumes multiple categories, else it's meaningless.
One would also say, for example, "posts by gender" not "posts by genders". |
253,793 | If I wish to eat some of the chocolate my friend is eating. Can I say:
>
> 1. Give me a bite.
> 2. Share me a bite.
> 3. Let me take a bite.
> 4. Can you share a bite?
>
>
>
**Important: Does it have any taboos meaning too?** | 2020/07/14 | [
"https://ell.stackexchange.com/questions/253793",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/92676/"
] | Firstly, it’s “than”, not “then”.
As Kate Bunting mentions, the second example is valid, though rather old-fashioned and formal.
The first sort of sounds like it’s trying to say:
>
> Men are rather impressed by beauty.
>
>
>
“Rather” here just means “very”.
One acceptable and common way to phrase what you're t... | To add to Chris's answer...
Even better to avoid using 'rather' here. So:
>
> Men are impressed by beauty in a woman, not character
>
>
>
or
>
> Men are more impressed by a woman's beauty than her character.
>
>
> |
253,793 | If I wish to eat some of the chocolate my friend is eating. Can I say:
>
> 1. Give me a bite.
> 2. Share me a bite.
> 3. Let me take a bite.
> 4. Can you share a bite?
>
>
>
**Important: Does it have any taboos meaning too?** | 2020/07/14 | [
"https://ell.stackexchange.com/questions/253793",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/92676/"
] | Firstly, it’s “than”, not “then”.
As Kate Bunting mentions, the second example is valid, though rather old-fashioned and formal.
The first sort of sounds like it’s trying to say:
>
> Men are rather impressed by beauty.
>
>
>
“Rather” here just means “very”.
One acceptable and common way to phrase what you're t... | >
> Men are rather impressed by beauty than character.
>
>
>
Will rather be the right answer to your question.
Here `rather` is giving more emphasis on one over the other. |
985,843 | 1. Suppose given an array of size n, with sorted values.
2. In iteration i, a new random-generated value is given, and inserted into the end of the array.
3. The array is then resorted, and discard the least value item.
4. After iteration n, the retained array will contain the largest value items.
For example, in Java... | 2009/06/12 | [
"https://Stackoverflow.com/questions/985843",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/110022/"
] | A very simple optimalization would be to compare the lowest value in the sorted array (should thus be the first item) with the new value before inserting it. If the new value is greater than this value, replace the element with the new value and then resort the array. | You can use binary search to insert a value into a sorted array. |
985,843 | 1. Suppose given an array of size n, with sorted values.
2. In iteration i, a new random-generated value is given, and inserted into the end of the array.
3. The array is then resorted, and discard the least value item.
4. After iteration n, the retained array will contain the largest value items.
For example, in Java... | 2009/06/12 | [
"https://Stackoverflow.com/questions/985843",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/110022/"
] | The fastest algorithm I can think of would be to replace the smallest element with the new one, if needed, and push the new one to its proper place by repeatedly swapping with adjacent elements.
**EDIT:** The code assumes that the array is sorted in descending order, and thus the last element is the smallest.
```
voi... | This will keep the size at 4 and do what you want as I understand it.
```
SortedSet<Integer> set = new TreeSet<Integer>();
set.add(2);
set.add(3);
set.add(6);
set.add(9);
Random rand = new Random();
for (int i=0; i < n; i++) {
int i = rand.nextInt(1000);
set.remove(set.first());
set.add(i);
}
``` |
985,843 | 1. Suppose given an array of size n, with sorted values.
2. In iteration i, a new random-generated value is given, and inserted into the end of the array.
3. The array is then resorted, and discard the least value item.
4. After iteration n, the retained array will contain the largest value items.
For example, in Java... | 2009/06/12 | [
"https://Stackoverflow.com/questions/985843",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/110022/"
] | This will keep the size at 4 and do what you want as I understand it.
```
SortedSet<Integer> set = new TreeSet<Integer>();
set.add(2);
set.add(3);
set.add(6);
set.add(9);
Random rand = new Random();
for (int i=0; i < n; i++) {
int i = rand.nextInt(1000);
set.remove(set.first());
set.add(i);
}
``` | Do you really need an online one item at a time algorithm? Or are you actually parsing a larger collection of data and just want the top n items? If it's the latter, look at [partial qsort](http://www.siam.org/meetings/analco04/abstracts/CMartinez.pdf). |
985,843 | 1. Suppose given an array of size n, with sorted values.
2. In iteration i, a new random-generated value is given, and inserted into the end of the array.
3. The array is then resorted, and discard the least value item.
4. After iteration n, the retained array will contain the largest value items.
For example, in Java... | 2009/06/12 | [
"https://Stackoverflow.com/questions/985843",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/110022/"
] | Use a [TreeSet](http://java.sun.com/javase/6/docs/api/index.html?java/util/TreeSet.html) instead of a `List`, it'll maintain the order such that such that the largest value will always be at [SortedSet#last()](http://java.sun.com/javase/6/docs/api/java/util/SortedSet.html#last()). If using 1.6+ you can use [NavigableSe... | You can use binary search to insert a value into a sorted array. |
985,843 | 1. Suppose given an array of size n, with sorted values.
2. In iteration i, a new random-generated value is given, and inserted into the end of the array.
3. The array is then resorted, and discard the least value item.
4. After iteration n, the retained array will contain the largest value items.
For example, in Java... | 2009/06/12 | [
"https://Stackoverflow.com/questions/985843",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/110022/"
] | This will keep the size at 4 and do what you want as I understand it.
```
SortedSet<Integer> set = new TreeSet<Integer>();
set.add(2);
set.add(3);
set.add(6);
set.add(9);
Random rand = new Random();
for (int i=0; i < n; i++) {
int i = rand.nextInt(1000);
set.remove(set.first());
set.add(i);
}
``` | I'm not sure if the above example would work, what is n? and if you cycle through adding random #'s from 1 to 1,000 you'll always end up with 1000, 999, 998 and 997 - no? I don't think adding a # and then resorting each time is efficient- it would probably be quicker to check each of the four positions and replacing wi... |
985,843 | 1. Suppose given an array of size n, with sorted values.
2. In iteration i, a new random-generated value is given, and inserted into the end of the array.
3. The array is then resorted, and discard the least value item.
4. After iteration n, the retained array will contain the largest value items.
For example, in Java... | 2009/06/12 | [
"https://Stackoverflow.com/questions/985843",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/110022/"
] | Use a min-heap to store the data, and after each insertion of a new random value, delete the min in O(1) time.
After n iterations, perform n extract-min's to get the sorted list. | Here is another solution which merges the operations into just a search, an array copy and a value set. This avoid the need for sorting or loops.
```
public static <T extends Comparable<T>>
void insertAndRemoveSmallest(T[] array, T t) {
int pos = Arrays.binarySearch(array, t);
if (pos < 0) pos = ~pos;... |
985,843 | 1. Suppose given an array of size n, with sorted values.
2. In iteration i, a new random-generated value is given, and inserted into the end of the array.
3. The array is then resorted, and discard the least value item.
4. After iteration n, the retained array will contain the largest value items.
For example, in Java... | 2009/06/12 | [
"https://Stackoverflow.com/questions/985843",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/110022/"
] | The fastest algorithm I can think of would be to replace the smallest element with the new one, if needed, and push the new one to its proper place by repeatedly swapping with adjacent elements.
**EDIT:** The code assumes that the array is sorted in descending order, and thus the last element is the smallest.
```
voi... | You can use binary search to insert a value into a sorted array. |
985,843 | 1. Suppose given an array of size n, with sorted values.
2. In iteration i, a new random-generated value is given, and inserted into the end of the array.
3. The array is then resorted, and discard the least value item.
4. After iteration n, the retained array will contain the largest value items.
For example, in Java... | 2009/06/12 | [
"https://Stackoverflow.com/questions/985843",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/110022/"
] | [**Collections.binarySearch()**](http://java.sun.com/j2se/1.4.2/docs/api/java/util/Collections.html#binarySearch(java.util.List,%20java.lang.Object))
[**ArrayList.ensureCapcity()**](http://java.sun.com/j2se/1.4.2/docs/api/java/util/ArrayList.html#ensureCapacity(int))
Your pseudocode inserts a set of new items N into ... | If you're working with an ArrayList, you can replace the last number in the array with the new number if the new number is larger before you sort the array.
The Java `Collections.sort` uses merge sort which isn't the most efficient way of sorting in this situation. You want to use a binary search to find the insertion... |
985,843 | 1. Suppose given an array of size n, with sorted values.
2. In iteration i, a new random-generated value is given, and inserted into the end of the array.
3. The array is then resorted, and discard the least value item.
4. After iteration n, the retained array will contain the largest value items.
For example, in Java... | 2009/06/12 | [
"https://Stackoverflow.com/questions/985843",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/110022/"
] | [**Collections.binarySearch()**](http://java.sun.com/j2se/1.4.2/docs/api/java/util/Collections.html#binarySearch(java.util.List,%20java.lang.Object))
[**ArrayList.ensureCapcity()**](http://java.sun.com/j2se/1.4.2/docs/api/java/util/ArrayList.html#ensureCapacity(int))
Your pseudocode inserts a set of new items N into ... | Do you really need an online one item at a time algorithm? Or are you actually parsing a larger collection of data and just want the top n items? If it's the latter, look at [partial qsort](http://www.siam.org/meetings/analco04/abstracts/CMartinez.pdf). |
985,843 | 1. Suppose given an array of size n, with sorted values.
2. In iteration i, a new random-generated value is given, and inserted into the end of the array.
3. The array is then resorted, and discard the least value item.
4. After iteration n, the retained array will contain the largest value items.
For example, in Java... | 2009/06/12 | [
"https://Stackoverflow.com/questions/985843",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/110022/"
] | Use a [TreeSet](http://java.sun.com/javase/6/docs/api/index.html?java/util/TreeSet.html) instead of a `List`, it'll maintain the order such that such that the largest value will always be at [SortedSet#last()](http://java.sun.com/javase/6/docs/api/java/util/SortedSet.html#last()). If using 1.6+ you can use [NavigableSe... | I'm not sure if the above example would work, what is n? and if you cycle through adding random #'s from 1 to 1,000 you'll always end up with 1000, 999, 998 and 997 - no? I don't think adding a # and then resorting each time is efficient- it would probably be quicker to check each of the four positions and replacing wi... |
36,229,665 | I have a form with a drop down menu, which has some categories (as `string`). When the user submits the form, I want to display a random text from the category that the user choose, but I have no idea how to do that.
I did it for one category, but I don't know how to do it for subsequent categories.
```
<script langu... | 2016/03/25 | [
"https://Stackoverflow.com/questions/36229665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6115973/"
] | something like this ?
```js
function select(){
var categories = document.getElementById("mySelect").value;
if(categories == "Funny"){
var r_text = new Array ();
r_text[0] = "funny_text1";
r_text[1] = "funny_text2";
r_text[2] = "funny_text3";
var i = Math.floor(3*Math.random())
doc... | Well if you want a basic, non-database way to do this you could do something like the following:
```js
var funny = ["AHAHAH.", "This is funny.", "Ok, don't judge."];
var other = ["Quote 1", "Quote 2", "Quote 3"];
var category = funny;
var quote = category[[Math.floor(Math.random() * category.length)]];
doc... |
36,229,665 | I have a form with a drop down menu, which has some categories (as `string`). When the user submits the form, I want to display a random text from the category that the user choose, but I have no idea how to do that.
I did it for one category, but I don't know how to do it for subsequent categories.
```
<script langu... | 2016/03/25 | [
"https://Stackoverflow.com/questions/36229665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6115973/"
] | something like this ?
```js
function select(){
var categories = document.getElementById("mySelect").value;
if(categories == "Funny"){
var r_text = new Array ();
r_text[0] = "funny_text1";
r_text[1] = "funny_text2";
r_text[2] = "funny_text3";
var i = Math.floor(3*Math.random())
doc... | I would recommend having an array of objects containing the quotes and any applicable tags that apply to them. Since many quotes could be a combination of funny, inspirational, patriotic etc.
You could use something like this:
```js
var quotes = [
{
'value': 'Ask Not What Your Country Can Do For You...'... |
36,229,665 | I have a form with a drop down menu, which has some categories (as `string`). When the user submits the form, I want to display a random text from the category that the user choose, but I have no idea how to do that.
I did it for one category, but I don't know how to do it for subsequent categories.
```
<script langu... | 2016/03/25 | [
"https://Stackoverflow.com/questions/36229665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6115973/"
] | Well if you want a basic, non-database way to do this you could do something like the following:
```js
var funny = ["AHAHAH.", "This is funny.", "Ok, don't judge."];
var other = ["Quote 1", "Quote 2", "Quote 3"];
var category = funny;
var quote = category[[Math.floor(Math.random() * category.length)]];
doc... | I would recommend having an array of objects containing the quotes and any applicable tags that apply to them. Since many quotes could be a combination of funny, inspirational, patriotic etc.
You could use something like this:
```js
var quotes = [
{
'value': 'Ask Not What Your Country Can Do For You...'... |
67,287,029 | I want to kill the nodepad process if it exists. If I use this:
```
PS C:\> get-process -name notepad | Stop-Process -Force
```
I will get an error when the process does not exist.
```
get-process : Cannot find a process with the name "notepad". Verify the process name and call the cmdlet again.
At line:1 char:1
+ ... | 2021/04/27 | [
"https://Stackoverflow.com/questions/67287029",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14222243/"
] | Just add `-ErrorAction SilentlyContinue`. This one is simpler and does not prompt any erros if process does not exist.
```
Get-Process -Name notepad -ErrorAction SilentlyContinue | Stop-Process -Force
``` | I suggest checking if the notepad process is the one you want first before just force-ending all notepad processes on the system:
```
Try {
(Get-WmiObject win32_process -Filter "name='notepad.exe'" |
Where commandline -like '*\path\to\manual.txt'
).Terminate()
}
# Handle "can't call method on null" error:... |
33,581,814 | >
> **public void setTextAppearance (Context context, int resId)
> Added in API level 1**
>
>
> This method was deprecated in API level 23.
> Use setTextAppearance(int) instead.
>
>
>
**My Question**: Why it's been deprecated? Why it doesn't need `Context` anymore? And most importantly, how to use `setText... | 2015/11/07 | [
"https://Stackoverflow.com/questions/33581814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1660013/"
] | You can use `TextViewCompat` from the support/androidX library:
```
import android.support.v4.widget.TextViewCompat // for support-library
import androidx.core.widget.TextViewCompat // for androidX library
// ...
TextViewCompat.setTextAppearance(view, resId)
```
Internally it gets the context ... | 1. how to use `setTextAppearance(int resId)` for older versions?
Use it like this:
```
if (Build.VERSION.SDK_INT < 23) {
super.setTextAppearance(context, resId);
} else {
super.setTextAppearance(resId);
}
```
For more info: <https://stackoverflow.com/a/33393762/4747587>
2. Why it's been deprecated? Why it d... |
33,581,814 | >
> **public void setTextAppearance (Context context, int resId)
> Added in API level 1**
>
>
> This method was deprecated in API level 23.
> Use setTextAppearance(int) instead.
>
>
>
**My Question**: Why it's been deprecated? Why it doesn't need `Context` anymore? And most importantly, how to use `setText... | 2015/11/07 | [
"https://Stackoverflow.com/questions/33581814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1660013/"
] | 1. how to use `setTextAppearance(int resId)` for older versions?
Use it like this:
```
if (Build.VERSION.SDK_INT < 23) {
super.setTextAppearance(context, resId);
} else {
super.setTextAppearance(resId);
}
```
For more info: <https://stackoverflow.com/a/33393762/4747587>
2. Why it's been deprecated? Why it d... | The above answer is correct - here's another way too. In Kotlin I wrote an extension which makes life easier if you do support `SDK 23` and below as well as above.
```
fun TextView.setAppearance(context: Context, res: Int) {
if (Build.VERSION.SDK_INT < 23) {
setTextAppearance(context, res)
... |
33,581,814 | >
> **public void setTextAppearance (Context context, int resId)
> Added in API level 1**
>
>
> This method was deprecated in API level 23.
> Use setTextAppearance(int) instead.
>
>
>
**My Question**: Why it's been deprecated? Why it doesn't need `Context` anymore? And most importantly, how to use `setText... | 2015/11/07 | [
"https://Stackoverflow.com/questions/33581814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1660013/"
] | You can use `TextViewCompat` from the support/androidX library:
```
import android.support.v4.widget.TextViewCompat // for support-library
import androidx.core.widget.TextViewCompat // for androidX library
// ...
TextViewCompat.setTextAppearance(view, resId)
```
Internally it gets the context ... | The above answer is correct - here's another way too. In Kotlin I wrote an extension which makes life easier if you do support `SDK 23` and below as well as above.
```
fun TextView.setAppearance(context: Context, res: Int) {
if (Build.VERSION.SDK_INT < 23) {
setTextAppearance(context, res)
... |
210 | Hi,
The definition I have for a Path Algega of a quiver Q is that it is the algebra whose basis is formed by the oriented paths in Q, including the trivial ones. Apparently multiplication is given by concatenation of paths, and those that can't be concatenated are considered zero. That part I think I understand, but I... | 2009/10/09 | [
"https://mathoverflow.net/questions/210",
"https://mathoverflow.net",
"https://mathoverflow.net/users/16/"
] | The short answer is no. You just have to think of them as formal sums, in the same way that you can only think of elements of a group algebra as formal sums.
What you can do is think of the path category of a quiver, which is the category whose objects are elements are vertices of the quiver, and whose morphisms are p... | I realize that this question is four months old, but I'm new to the site.
Another thing you can do is use the relationship between path algebras and other algebras to breathe some life into the formal construction. For example, it is known that any elementary hereditary algebra over a field is isomorphic to a path alg... |
210 | Hi,
The definition I have for a Path Algega of a quiver Q is that it is the algebra whose basis is formed by the oriented paths in Q, including the trivial ones. Apparently multiplication is given by concatenation of paths, and those that can't be concatenated are considered zero. That part I think I understand, but I... | 2009/10/09 | [
"https://mathoverflow.net/questions/210",
"https://mathoverflow.net",
"https://mathoverflow.net/users/16/"
] | The short answer is no. You just have to think of them as formal sums, in the same way that you can only think of elements of a group algebra as formal sums.
What you can do is think of the path category of a quiver, which is the category whose objects are elements are vertices of the quiver, and whose morphisms are p... | Maybe it is useful to add that a path algebra is a special case of a tensor algebra of a bimodule. Namely, the path algebra of a finite quiver $Q$ is the tensor algebra $T\_RV$ of a finite dimensional bimodule $V=V\_Q$ over a split semisimple finite dimensional commutative algebra $R=\oplus\_{i\in I}k$ over a field $k$... |
210 | Hi,
The definition I have for a Path Algega of a quiver Q is that it is the algebra whose basis is formed by the oriented paths in Q, including the trivial ones. Apparently multiplication is given by concatenation of paths, and those that can't be concatenated are considered zero. That part I think I understand, but I... | 2009/10/09 | [
"https://mathoverflow.net/questions/210",
"https://mathoverflow.net",
"https://mathoverflow.net/users/16/"
] | Maybe it is useful to add that a path algebra is a special case of a tensor algebra of a bimodule. Namely, the path algebra of a finite quiver $Q$ is the tensor algebra $T\_RV$ of a finite dimensional bimodule $V=V\_Q$ over a split semisimple finite dimensional commutative algebra $R=\oplus\_{i\in I}k$ over a field $k$... | I realize that this question is four months old, but I'm new to the site.
Another thing you can do is use the relationship between path algebras and other algebras to breathe some life into the formal construction. For example, it is known that any elementary hereditary algebra over a field is isomorphic to a path alg... |
25,570,720 | I want to search through all existing objects to see if there are any matching date objects in CoreData:
Dates are currently saved in my CoreData via the **start\_date** attribute with the following format: 2013-08-29 14:27:47 +0000.
I am then letting a user select a date from a UIDatePicker and assigning .date() to ... | 2014/08/29 | [
"https://Stackoverflow.com/questions/25570720",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2794594/"
] | Before to save `start_date` attributes in Core Data, you need to be sure that their time is set to 12:00 AM:
```
//Get "Aug 29, 2014, 12:00 AM" from "Aug 29, 2014, 10:07 PM"
let newDate = NSDate() //or any other date
let calendar = NSCalendar.currentCalendar()
calendar.timeZone = NSTimeZone.systemTimeZone()
var startD... | ```
<edit>
```
Your second way of doing things seems to me like a good way to go. Store the integer values for year, month and day, and create a predicate with that. Your usage of NSDateComponents and calendar is great, and so this should be the easiest way to go. Very important: don't use for the time of 00, as midn... |
25,570,720 | I want to search through all existing objects to see if there are any matching date objects in CoreData:
Dates are currently saved in my CoreData via the **start\_date** attribute with the following format: 2013-08-29 14:27:47 +0000.
I am then letting a user select a date from a UIDatePicker and assigning .date() to ... | 2014/08/29 | [
"https://Stackoverflow.com/questions/25570720",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2794594/"
] | If you still have to option of changing the way you store data, I would store it on your project-entity as three attributes: an Integer for year, an Integer for month and an Integer for day. It will be easier to code (you can create a predicate like:
```
NSInteger year = ....
NSInteger month = ....
NSInteger day = ...... | ```
<edit>
```
Your second way of doing things seems to me like a good way to go. Store the integer values for year, month and day, and create a predicate with that. Your usage of NSDateComponents and calendar is great, and so this should be the easiest way to go. Very important: don't use for the time of 00, as midn... |
42,051,220 | I recently wrote some code that takes user input and performs a function which returns an output.
Initially, I gathered the input via a prompt box.
```
var a = prompt("What month were you born?");
var b = prompt("What day of the month were you born?");
```
The rest of the code I wrote is dependent on these two var... | 2017/02/05 | [
"https://Stackoverflow.com/questions/42051220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7401845/"
] | navbar-fixed-top has a fixed height 50px, so you can directly style an image by setting e.g. `max-height: 40px` to it and `margin: 5px` to center image.
```css
.navbar-header img {
height: 40px;
margin: 5px;
}
```
```html
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="s... | I had the same problem sometime back and this is what I did . Hope this works for you
```css
.brand{
max-height: 30px;
}
```
```html
<a href="link/location/here" class="img-circle">
<img class="brand" src="img/logo.png">
</a>
``` |
218,178 | I've been thinking of using `WP_Query`'s pagination to make a custom lazy loading. is there a way to utilize the `WP_Query`'s pagination for a lazy load?
Say for example, I have to load 24 posts in the first load, and when the scroll reach bottom it will lazy load the next 24 post.
Is this possible? | 2016/02/19 | [
"https://wordpress.stackexchange.com/questions/218178",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/88947/"
] | Take a look at this rough example. This requires a little bit of adaptation but as a whole, it does what you want - it loads X amount of next posts if user clicks a button which should be below already loaded posts.
If you want to automatically load more posts if user scrolls down, just replace click event with some o... | I've been using infinite scroll for this.
Here is what I have used in script.js
```
$(function(){
var $container = $('#ms-container');
$container.imagesLoaded(function(){
$container.masonry({
itemSelector : '.ms-item',
});
});
//var templateUrl = object_name.templateUrl;
//var src = ... |
218,178 | I've been thinking of using `WP_Query`'s pagination to make a custom lazy loading. is there a way to utilize the `WP_Query`'s pagination for a lazy load?
Say for example, I have to load 24 posts in the first load, and when the scroll reach bottom it will lazy load the next 24 post.
Is this possible? | 2016/02/19 | [
"https://wordpress.stackexchange.com/questions/218178",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/88947/"
] | Take a look at this rough example. This requires a little bit of adaptation but as a whole, it does what you want - it loads X amount of next posts if user clicks a button which should be below already loaded posts.
If you want to automatically load more posts if user scrolls down, just replace click event with some o... | Thanks for your answer N00b. It worked really well. I tweaked it a little bit because the lock didn't work and I wanted to pull posts per page from the WordPress options page. I also reduced HTML markup by using the [jQuery .data() function](https://api.jquery.com/data/).
**Main JS**
```
(function($) {
//Load mor... |
49,839,437 | All of markers shows up on maps based from data latitude and longitude from firebase. And i want to show markers on maps only inside of the circle, circle radius from current place is 10 kilometers.
This is how i show all markers from Firebase
```
LatLng newlocation = new LatLng(dataSnapshot.child("latitude").getVal... | 2018/04/15 | [
"https://Stackoverflow.com/questions/49839437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9043937/"
] | Use this formula to find distance between two latitude and longitude this function will return distance in meter
```
double getDistance(double LAT1, double LONG1, double LAT2, double LONG2) {
double distance = 2 * 6371000 * Math.asin(Math.sqrt(Math.pow((Math.sin((LAT2 * (3.14159 / 180) - LAT1 * (3.14159 / 180)) ... | When you add markers to the map, store objects inside an array. Then use `computeDistanceBetween` to calculate distance and `setMap(null)` to hide away markers.
```
var markers;
// adding...
var centerLatlng = new google.maps.LatLng(-25.363882,131.044922);
markers.each(function(){
var distance = google.maps.geome... |
23,193,544 | I need the source code of the OpenSSL API functions for EVP encryption, like `EVP_aes_256_cbc`. After much searching, all I could find were the headers of the functions in `openssl/evp.h`, but no source code in a `.c` file.
Where can I find the source code? | 2014/04/21 | [
"https://Stackoverflow.com/questions/23193544",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1644195/"
] | You'll find the final CBC mode implementation in [`cbc128.c`](http://docs.huihoo.com/doxygen/openssl/1.0.1c/cbc128_8c_source.html) and AES itself in [`AES.c`](http://docs.huihoo.com/doxygen/openssl/1.0.1c/aes__cbc_8c_source.html). Mind that the EVP are high level functions that could use an engine - for instance using ... | >
> I need the source code of openssl api functions evp encription... "EVP\_AES\_256\_CBC"...
>
>
>
There is no function `EVP_AES_256_CBC`:
```
$ cd openssl-1.0.1g
$ grep -R EVP_AES_256_CBC *
$
```
So searching for it should turn up no results.
---
>
> where can I find the source code
>
>
>
As user3553... |
33,911,285 | I see the class Thread has 4 constructors:
```
public Thread(ParameterizedThreadStart start);
public Thread(ThreadStart start);
public Thread(ParameterizedThreadStart start, int maxStackSize);
public Thread(ThreadStart start, int maxStackSize);
```
**ParameterizedThreadStart** and **ThreadStart** are delegate like t... | 2015/11/25 | [
"https://Stackoverflow.com/questions/33911285",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4481962/"
] | You can use the [*Task Parallel Library*](https://msdn.microsoft.com/en-us/library/dd460717(v=vs.110).aspx) which allows you to have a return value. If you actually want a new thread to be allocated, you can use the right overload of [`Task.Factory.StartNew`](https://msdn.microsoft.com/en-us/library/dd321263(v=vs.110).... | You can use:
```
public void StartThread()
{
ParameterizedThreadStart pts = new ParameterizedThreadStart(this.DoWork);
Thread th = new Thread(pts);
int i =5;
th.Start(i);
}
public void DoWork(object data)
{
Console.WriteLine("I got data='{0}'", data);
}... |
33,911,285 | I see the class Thread has 4 constructors:
```
public Thread(ParameterizedThreadStart start);
public Thread(ThreadStart start);
public Thread(ParameterizedThreadStart start, int maxStackSize);
public Thread(ThreadStart start, int maxStackSize);
```
**ParameterizedThreadStart** and **ThreadStart** are delegate like t... | 2015/11/25 | [
"https://Stackoverflow.com/questions/33911285",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4481962/"
] | You can use the [*Task Parallel Library*](https://msdn.microsoft.com/en-us/library/dd460717(v=vs.110).aspx) which allows you to have a return value. If you actually want a new thread to be allocated, you can use the right overload of [`Task.Factory.StartNew`](https://msdn.microsoft.com/en-us/library/dd321263(v=vs.110).... | It is possible by creating the return value from the thread. Then you should take this variable by using a lambda expression. Assign to this variable a your "return" value from the worker thread and then it is necessary to wait till thread ends from the parent thread.
```
int value = 5; // a variable to store the retu... |
47,383,289 | How would I go about reading the first 5 lines from a text file in java using a buffered Reader or Scanner? Here is my code
```
final int assumedLineLength = 16;
File file = new File("src/hw7p1/Acronyms.txt");
HashMap<String, String> hashMap = new HashMap<String, String>((int)(file.length() / assumed... | 2017/11/19 | [
"https://Stackoverflow.com/questions/47383289",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4872055/"
] | You can either use `className` or `cssText` to do so.
If you used className, you need to define the class in CSS.
```js
// By setting css class name
var buttonShort = document.createElement("button");
buttonShort.innerHTML = "Generate Short Password";
// set class name
buttonShort.className = "button";
var body ... | How about the following code?
```
var cssString = "{padding: 15px 20px; color: #F00;}";
buttonShort.style.cssText = cssString;
``` |
47,383,289 | How would I go about reading the first 5 lines from a text file in java using a buffered Reader or Scanner? Here is my code
```
final int assumedLineLength = 16;
File file = new File("src/hw7p1/Acronyms.txt");
HashMap<String, String> hashMap = new HashMap<String, String>((int)(file.length() / assumed... | 2017/11/19 | [
"https://Stackoverflow.com/questions/47383289",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4872055/"
] | Use the `style.width` property before you append the button element to the body, like so :
```js
var buttonShort = document.createElement("button");
buttonShort.innerHTML = "Generate Short Password";
var body = document.getElementsByTagName("body")[0];
buttonShort.style.width = '200px'; // setting the width to 2... | How about the following code?
```
var cssString = "{padding: 15px 20px; color: #F00;}";
buttonShort.style.cssText = cssString;
``` |
47,383,289 | How would I go about reading the first 5 lines from a text file in java using a buffered Reader or Scanner? Here is my code
```
final int assumedLineLength = 16;
File file = new File("src/hw7p1/Acronyms.txt");
HashMap<String, String> hashMap = new HashMap<String, String>((int)(file.length() / assumed... | 2017/11/19 | [
"https://Stackoverflow.com/questions/47383289",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4872055/"
] | Use the `style.width` property before you append the button element to the body, like so :
```js
var buttonShort = document.createElement("button");
buttonShort.innerHTML = "Generate Short Password";
var body = document.getElementsByTagName("body")[0];
buttonShort.style.width = '200px'; // setting the width to 2... | You can either use `className` or `cssText` to do so.
If you used className, you need to define the class in CSS.
```js
// By setting css class name
var buttonShort = document.createElement("button");
buttonShort.innerHTML = "Generate Short Password";
// set class name
buttonShort.className = "button";
var body ... |
47,383,289 | How would I go about reading the first 5 lines from a text file in java using a buffered Reader or Scanner? Here is my code
```
final int assumedLineLength = 16;
File file = new File("src/hw7p1/Acronyms.txt");
HashMap<String, String> hashMap = new HashMap<String, String>((int)(file.length() / assumed... | 2017/11/19 | [
"https://Stackoverflow.com/questions/47383289",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4872055/"
] | You can either use `className` or `cssText` to do so.
If you used className, you need to define the class in CSS.
```js
// By setting css class name
var buttonShort = document.createElement("button");
buttonShort.innerHTML = "Generate Short Password";
// set class name
buttonShort.className = "button";
var body ... | put this into head tag:
```
<style>
p.ex3 {
font-size: 15px;
}
</style>
```
and put this into body:
```
<div><p id="demo" class="ex0">Led Off</p></div>
<button type="button" onclick='document.getElementById("demo").innerHTML = "Led
On"'><p class="ex3">Led On</p></button>
``` |
47,383,289 | How would I go about reading the first 5 lines from a text file in java using a buffered Reader or Scanner? Here is my code
```
final int assumedLineLength = 16;
File file = new File("src/hw7p1/Acronyms.txt");
HashMap<String, String> hashMap = new HashMap<String, String>((int)(file.length() / assumed... | 2017/11/19 | [
"https://Stackoverflow.com/questions/47383289",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4872055/"
] | Use the `style.width` property before you append the button element to the body, like so :
```js
var buttonShort = document.createElement("button");
buttonShort.innerHTML = "Generate Short Password";
var body = document.getElementsByTagName("body")[0];
buttonShort.style.width = '200px'; // setting the width to 2... | put this into head tag:
```
<style>
p.ex3 {
font-size: 15px;
}
</style>
```
and put this into body:
```
<div><p id="demo" class="ex0">Led Off</p></div>
<button type="button" onclick='document.getElementById("demo").innerHTML = "Led
On"'><p class="ex3">Led On</p></button>
``` |
3,609,188 | I'm writing an app which needs to post emails on behalf of users of our Google Apps Premier domain. I see there is a way to do this using the AppEngine Mail Service if you have the admin credentials. I want to know how to do this from a normal Java app running on say Tomcat. | 2010/08/31 | [
"https://Stackoverflow.com/questions/3609188",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/219579/"
] | This is explained at
* [Zend\_Controller Basics](http://framework.zend.com/manual/en/zend.controller.basics.html) and
* [Zend Framework MVC Request Lifecycle](http://devzone.zend.com/article/11978) and
* [Zend Framework Dispatch Workflow](http://www.slideshare.net/polleywong/zend-framework-dispatch-workflow)
Usually ... | Here is a bit less orthodox view on [how zend framework application could be architectured](http://artur.ejsmont.org/blog/content/how-to-structure-a-zend-framework-application-and-manage-internal-dependencies). |
34,460,182 | I'd like to apply a drop-shadow filter to a specific element/path inside an inline placed SVG via CSS, I **don't** need the whole graphic to be shadowed, just an element inside it.
```css
.shadow {
fill: red;
-webkit-filter:
drop-shadow( 3px 3px 2px rgba(0,0,0,.7) );
filter:
drop-shadow( ... | 2015/12/25 | [
"https://Stackoverflow.com/questions/34460182",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1262357/"
] | **Updated 2020-04:** I did some experiments on this issue because I too couldn't find any information on this and the results are pretty inconsistent.
**The TL;DR: SVG drop-shadows are very inconsistent but HTML drop-shadows reliably work (outside of IE11).** If you want SVG drop-shadows, [you're going to have use a p... | You can apply a shadow selectively by doing color selection on the object you want to shadow, creating a shadow and then merging it under the original graphic. But you have to do it via the SVG filter trapdoor in CSS Filters - which doesn't work in IE. (So ... hacky, but possible)
Spec is here: w3.org/TR/SVG11/filters... |
34,460,182 | I'd like to apply a drop-shadow filter to a specific element/path inside an inline placed SVG via CSS, I **don't** need the whole graphic to be shadowed, just an element inside it.
```css
.shadow {
fill: red;
-webkit-filter:
drop-shadow( 3px 3px 2px rgba(0,0,0,.7) );
filter:
drop-shadow( ... | 2015/12/25 | [
"https://Stackoverflow.com/questions/34460182",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1262357/"
] | **Updated 2020-04:** I did some experiments on this issue because I too couldn't find any information on this and the results are pretty inconsistent.
**The TL;DR: SVG drop-shadows are very inconsistent but HTML drop-shadows reliably work (outside of IE11).** If you want SVG drop-shadows, [you're going to have use a p... | In [this](https://codepen.io/ChemBioScripting/pen/wEXrjB) CodePen I added different *drop-shadows* to `path` and `text` generated dynamically. [Here](https://codepen.io/dudleystorey/pen/EaMQBj) I found a cross-browser solution that you can apply to a `class`, for example, instead of `#robbie img` (in the second link):
... |
34,460,182 | I'd like to apply a drop-shadow filter to a specific element/path inside an inline placed SVG via CSS, I **don't** need the whole graphic to be shadowed, just an element inside it.
```css
.shadow {
fill: red;
-webkit-filter:
drop-shadow( 3px 3px 2px rgba(0,0,0,.7) );
filter:
drop-shadow( ... | 2015/12/25 | [
"https://Stackoverflow.com/questions/34460182",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1262357/"
] | You can apply a shadow selectively by doing color selection on the object you want to shadow, creating a shadow and then merging it under the original graphic. But you have to do it via the SVG filter trapdoor in CSS Filters - which doesn't work in IE. (So ... hacky, but possible)
Spec is here: w3.org/TR/SVG11/filters... | In [this](https://codepen.io/ChemBioScripting/pen/wEXrjB) CodePen I added different *drop-shadows* to `path` and `text` generated dynamically. [Here](https://codepen.io/dudleystorey/pen/EaMQBj) I found a cross-browser solution that you can apply to a `class`, for example, instead of `#robbie img` (in the second link):
... |
6,372,802 | I want to calculate Daylight hours based on given Latitude and Longitude and DateTime
I mean calculate the time of sunrise and the time of sunset in a specefic Date and based on gegraphic coordinate. | 2011/06/16 | [
"https://Stackoverflow.com/questions/6372802",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1152862/"
] | Check this [***Latitude and Longitude and Daylight Hours***](https://web.archive.org/web/20180128172128/http://mathforum.org/library/drmath/view/56478.html)
```
D = daylength
L = latitude
J = day of the year
P = asin[.39795*cos(.2163108 + 2*atan{.9671396*tan[.00860(J-186)]})]
_ ... | I just answered another question, and think that my solution is fitting here aswell. It's a Javascript solution, so you should be able to convert easily to other languages if you need.
I've created a repository under [GitHub Sundial](https://github.com/Kalyse/Sundial) it is licenced under the permissive modified BSD l... |
6,372,802 | I want to calculate Daylight hours based on given Latitude and Longitude and DateTime
I mean calculate the time of sunrise and the time of sunset in a specefic Date and based on gegraphic coordinate. | 2011/06/16 | [
"https://Stackoverflow.com/questions/6372802",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1152862/"
] | Check this [***Latitude and Longitude and Daylight Hours***](https://web.archive.org/web/20180128172128/http://mathforum.org/library/drmath/view/56478.html)
```
D = daylength
L = latitude
J = day of the year
P = asin[.39795*cos(.2163108 + 2*atan{.9671396*tan[.00860(J-186)]})]
_ ... | sin24+(24cos-18^12)^(day number of the year)+(latitude)^24= #of daylight hours |
6,372,802 | I want to calculate Daylight hours based on given Latitude and Longitude and DateTime
I mean calculate the time of sunrise and the time of sunset in a specefic Date and based on gegraphic coordinate. | 2011/06/16 | [
"https://Stackoverflow.com/questions/6372802",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1152862/"
] | Check this [***Latitude and Longitude and Daylight Hours***](https://web.archive.org/web/20180128172128/http://mathforum.org/library/drmath/view/56478.html)
```
D = daylength
L = latitude
J = day of the year
P = asin[.39795*cos(.2163108 + 2*atan{.9671396*tan[.00860(J-186)]})]
_ ... | Here is a python function that returns the number of hours of daylight with arguments of latitude and day of the year(number between 1-356):
```
import math
def Daylight(latitude,day):
P = math.asin(0.39795 * math.cos(0.2163108 + 2 * math.atan(0.9671396 * math.tan(.00860 * (day - 186)))))
pi = math.pi
daylightamount =... |
6,372,802 | I want to calculate Daylight hours based on given Latitude and Longitude and DateTime
I mean calculate the time of sunrise and the time of sunset in a specefic Date and based on gegraphic coordinate. | 2011/06/16 | [
"https://Stackoverflow.com/questions/6372802",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1152862/"
] | Here is a python function that returns the number of hours of daylight with arguments of latitude and day of the year(number between 1-356):
```
import math
def Daylight(latitude,day):
P = math.asin(0.39795 * math.cos(0.2163108 + 2 * math.atan(0.9671396 * math.tan(.00860 * (day - 186)))))
pi = math.pi
daylightamount =... | I just answered another question, and think that my solution is fitting here aswell. It's a Javascript solution, so you should be able to convert easily to other languages if you need.
I've created a repository under [GitHub Sundial](https://github.com/Kalyse/Sundial) it is licenced under the permissive modified BSD l... |
6,372,802 | I want to calculate Daylight hours based on given Latitude and Longitude and DateTime
I mean calculate the time of sunrise and the time of sunset in a specefic Date and based on gegraphic coordinate. | 2011/06/16 | [
"https://Stackoverflow.com/questions/6372802",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1152862/"
] | Here is a python function that returns the number of hours of daylight with arguments of latitude and day of the year(number between 1-356):
```
import math
def Daylight(latitude,day):
P = math.asin(0.39795 * math.cos(0.2163108 + 2 * math.atan(0.9671396 * math.tan(.00860 * (day - 186)))))
pi = math.pi
daylightamount =... | sin24+(24cos-18^12)^(day number of the year)+(latitude)^24= #of daylight hours |
16,312 | How to show that:
$$f(x)= \lim\_{k \to \infty} \Bigl(\lim\_{j \to \infty} \cos^{2j}(k!\cdot \pi \cdot x)\Bigl)$$
is the *Dirichlet's function*. | 2011/01/04 | [
"https://math.stackexchange.com/questions/16312",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Suppose $x = \frac {p}{q} \in \mathbb{Q}$. If $k>q$ then $k! \cdot x \in \mathbb {Z}$ so $ \cos(k!\cdot \pi \cdot x) = \pm 1$
$$ k>q,\; \; \lim\_{j \to \infty} \cos(k!\cdot \pi \cdot x)^{2j} = \lim\_{j \to \infty} (\pm 1)^{2j} = 1$$
so taking the limit of $k \rightarrow \infty$ you get also 1.
If $x \notin \mathbb{Q}... | If x is rational, once k gets large enough the cosine is 1 independent of j. If x is irrational, the cosine is less than one so the j limit will be zero. This is true for all k. |
12,946,928 | If I offer an in-app Non-consumable purchase (say a book, or a song) within my app and then 2-3 months after it has been released I realize that there is something wrong with my digital content, Can I do an update of the digital content? So if I had a digital article as an in-app purchases for $1.99 and sold 1,000 copi... | 2012/10/18 | [
"https://Stackoverflow.com/questions/12946928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1180550/"
] | **About AppStore Hosted Content**
I have not tried, but browsing inside Apple doc, I've found [this](https://developer.apple.com/library/ios/#documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/13_ManagingIn-AppPurchases/ManagingIn-AppPurchases.html#//apple_ref/doc/uid/TP40011225-CH4-SW37) which confirms t... | This all depends on how you make the content available to the user. When the user makes their original purchase of the in-app content, where does the content come from?
If it is part of the app bundle, then the only way to get updated content to these users is to submit an update to your app that includes the updated ... |
12,946,928 | If I offer an in-app Non-consumable purchase (say a book, or a song) within my app and then 2-3 months after it has been released I realize that there is something wrong with my digital content, Can I do an update of the digital content? So if I had a digital article as an in-app purchases for $1.99 and sold 1,000 copi... | 2012/10/18 | [
"https://Stackoverflow.com/questions/12946928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1180550/"
] | Yes, as a matter of fact, provided that you do a few steps, you can keep track and systematically, efficiently keep track of what is downloaded.
> 1.Yes it's possible. Provided you keep a track of who has bought what pack (ie. keep a bool value as an NSUserDefault), then they will still have access to it (even if you ... | This all depends on how you make the content available to the user. When the user makes their original purchase of the in-app content, where does the content come from?
If it is part of the app bundle, then the only way to get updated content to these users is to submit an update to your app that includes the updated ... |
12,946,928 | If I offer an in-app Non-consumable purchase (say a book, or a song) within my app and then 2-3 months after it has been released I realize that there is something wrong with my digital content, Can I do an update of the digital content? So if I had a digital article as an in-app purchases for $1.99 and sold 1,000 copi... | 2012/10/18 | [
"https://Stackoverflow.com/questions/12946928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1180550/"
] | Yes, as a matter of fact, provided that you do a few steps, you can keep track and systematically, efficiently keep track of what is downloaded.
> 1.Yes it's possible. Provided you keep a track of who has bought what pack (ie. keep a bool value as an NSUserDefault), then they will still have access to it (even if you ... | **About AppStore Hosted Content**
I have not tried, but browsing inside Apple doc, I've found [this](https://developer.apple.com/library/ios/#documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/13_ManagingIn-AppPurchases/ManagingIn-AppPurchases.html#//apple_ref/doc/uid/TP40011225-CH4-SW37) which confirms t... |
12,946,928 | If I offer an in-app Non-consumable purchase (say a book, or a song) within my app and then 2-3 months after it has been released I realize that there is something wrong with my digital content, Can I do an update of the digital content? So if I had a digital article as an in-app purchases for $1.99 and sold 1,000 copi... | 2012/10/18 | [
"https://Stackoverflow.com/questions/12946928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1180550/"
] | **About AppStore Hosted Content**
I have not tried, but browsing inside Apple doc, I've found [this](https://developer.apple.com/library/ios/#documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/13_ManagingIn-AppPurchases/ManagingIn-AppPurchases.html#//apple_ref/doc/uid/TP40011225-CH4-SW37) which confirms t... | For the above problem:
please have a look at the following urls for separate things:
**Following link is the link to the SKDownload API:**
<http://developer.apple.com/library/ios/#documentation/StoreKit/Reference/SKDownload_Ref/Introduction/Introduction.html#//apple_ref/doc/uid/TP40011851>
**Following link is the lin... |
12,946,928 | If I offer an in-app Non-consumable purchase (say a book, or a song) within my app and then 2-3 months after it has been released I realize that there is something wrong with my digital content, Can I do an update of the digital content? So if I had a digital article as an in-app purchases for $1.99 and sold 1,000 copi... | 2012/10/18 | [
"https://Stackoverflow.com/questions/12946928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1180550/"
] | Yes, as a matter of fact, provided that you do a few steps, you can keep track and systematically, efficiently keep track of what is downloaded.
> 1.Yes it's possible. Provided you keep a track of who has bought what pack (ie. keep a bool value as an NSUserDefault), then they will still have access to it (even if you ... | For the above problem:
please have a look at the following urls for separate things:
**Following link is the link to the SKDownload API:**
<http://developer.apple.com/library/ios/#documentation/StoreKit/Reference/SKDownload_Ref/Introduction/Introduction.html#//apple_ref/doc/uid/TP40011851>
**Following link is the lin... |
248,034 | I have a transformer that outputs 14.3V (AC of course) and the current in short-circuit is about 13A (made a beautiful spark when I measured it :) ). Can I guesstimate from here what is the 'normal' current that I can get from this transformer without overheating it? I need 1.3A.
Other data:
Input voltage: 230V
O... | 2016/07/26 | [
"https://electronics.stackexchange.com/questions/248034",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/33899/"
] | You need 14.5 V X 1.3 A = 18.9 VA. Look for 20 VA transformers on seller sites. Here is one that I found:
[](https://i.stack.imgur.com/0hIJP.png)
The one that you have is about that size, so there is a good chance that is will be ok, but you don't ha... | Short-circuit current is not a useful measure.
Instead, pick a tolerance — say, 10% — and gradually increase the load current until the output voltage drops by that amount (e.g., from 14.3 V to 12.9 V). This gives you one estimate of the transformer's capacity.
Pay attention to how the voltage drops as you increase t... |
12,366,958 | I've made a hand-made mutex for my project, but I doubt if it is thread safe...
```
bool blocked;
while ( blocked )
{
}
blocked = true;
...
blocked = false;
```
Lets say, thread A passes the while loop and doesn't block the flag in time (doesn't have time to set the flag to `false`) an... | 2012/09/11 | [
"https://Stackoverflow.com/questions/12366958",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1574294/"
] | Your code is completely defunct!
The reason is that access to the variable `blocked` is not atomic. Two threads can read it simultaneously and decide that the mutex is unlocked, if the two reads happen before the first thread writes out the `true` update and the update propagates to all CPUs.
You need atomic var... | You've pretty much got it already.
1. Yes, it's very possible. For a single core, threads get executed by the OS via [timeslicing](http://en.wikipedia.org/wiki/Preemption_%28computing%29#Time_slice). It runs thread A for a bit, then pauses it, and runs thread B for a bit. Thread A could get paused right after passing ... |
12,366,958 | I've made a hand-made mutex for my project, but I doubt if it is thread safe...
```
bool blocked;
while ( blocked )
{
}
blocked = true;
...
blocked = false;
```
Lets say, thread A passes the while loop and doesn't block the flag in time (doesn't have time to set the flag to `false`) an... | 2012/09/11 | [
"https://Stackoverflow.com/questions/12366958",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1574294/"
] | Your code is completely defunct!
The reason is that access to the variable `blocked` is not atomic. Two threads can read it simultaneously and decide that the mutex is unlocked, if the two reads happen before the first thread writes out the `true` update and the update propagates to all CPUs.
You need atomic var... | Yes, the situation you described can happen. The reason for this is that the thread can be interrupted between testing `blocked` is `false`, and setting `blocked` to `true`. To get the behaviour you want you will need to use or emulate an atomic **test-and-set** operation.
Further information on test-and-set can be fo... |
12,366,958 | I've made a hand-made mutex for my project, but I doubt if it is thread safe...
```
bool blocked;
while ( blocked )
{
}
blocked = true;
...
blocked = false;
```
Lets say, thread A passes the while loop and doesn't block the flag in time (doesn't have time to set the flag to `false`) an... | 2012/09/11 | [
"https://Stackoverflow.com/questions/12366958",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1574294/"
] | Your code is completely defunct!
The reason is that access to the variable `blocked` is not atomic. Two threads can read it simultaneously and decide that the mutex is unlocked, if the two reads happen before the first thread writes out the `true` update and the update propagates to all CPUs.
You need atomic var... | 1. It's possible because the processor can switch from the first thread to the second after entering the loop, but before locking the mutex.
2. It's possible because they use kernel-level operations to ensure that the thread is not switched until a certain operation is complete.
On Windows for instance, you could make... |
12,366,958 | I've made a hand-made mutex for my project, but I doubt if it is thread safe...
```
bool blocked;
while ( blocked )
{
}
blocked = true;
...
blocked = false;
```
Lets say, thread A passes the while loop and doesn't block the flag in time (doesn't have time to set the flag to `false`) an... | 2012/09/11 | [
"https://Stackoverflow.com/questions/12366958",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1574294/"
] | Your code is completely defunct!
The reason is that access to the variable `blocked` is not atomic. Two threads can read it simultaneously and decide that the mutex is unlocked, if the two reads happen before the first thread writes out the `true` update and the update propagates to all CPUs.
You need atomic var... | a mutex implementation must ensure mutual exclusivity (that's the meaning of it) and not obtained in your code. It requires some atomic variable and suitable memory order for its access. In C++11, best use `std::mutex` (ideally together with `std::lock`), for C++03 you can use `boost::mutex` etc. |
12,366,958 | I've made a hand-made mutex for my project, but I doubt if it is thread safe...
```
bool blocked;
while ( blocked )
{
}
blocked = true;
...
blocked = false;
```
Lets say, thread A passes the while loop and doesn't block the flag in time (doesn't have time to set the flag to `false`) an... | 2012/09/11 | [
"https://Stackoverflow.com/questions/12366958",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1574294/"
] | 1. It's possible because the processor can switch from the first thread to the second after entering the loop, but before locking the mutex.
2. It's possible because they use kernel-level operations to ensure that the thread is not switched until a certain operation is complete.
On Windows for instance, you could make... | You've pretty much got it already.
1. Yes, it's very possible. For a single core, threads get executed by the OS via [timeslicing](http://en.wikipedia.org/wiki/Preemption_%28computing%29#Time_slice). It runs thread A for a bit, then pauses it, and runs thread B for a bit. Thread A could get paused right after passing ... |
12,366,958 | I've made a hand-made mutex for my project, but I doubt if it is thread safe...
```
bool blocked;
while ( blocked )
{
}
blocked = true;
...
blocked = false;
```
Lets say, thread A passes the while loop and doesn't block the flag in time (doesn't have time to set the flag to `false`) an... | 2012/09/11 | [
"https://Stackoverflow.com/questions/12366958",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1574294/"
] | 1. It's possible because the processor can switch from the first thread to the second after entering the loop, but before locking the mutex.
2. It's possible because they use kernel-level operations to ensure that the thread is not switched until a certain operation is complete.
On Windows for instance, you could make... | Yes, the situation you described can happen. The reason for this is that the thread can be interrupted between testing `blocked` is `false`, and setting `blocked` to `true`. To get the behaviour you want you will need to use or emulate an atomic **test-and-set** operation.
Further information on test-and-set can be fo... |
12,366,958 | I've made a hand-made mutex for my project, but I doubt if it is thread safe...
```
bool blocked;
while ( blocked )
{
}
blocked = true;
...
blocked = false;
```
Lets say, thread A passes the while loop and doesn't block the flag in time (doesn't have time to set the flag to `false`) an... | 2012/09/11 | [
"https://Stackoverflow.com/questions/12366958",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1574294/"
] | 1. It's possible because the processor can switch from the first thread to the second after entering the loop, but before locking the mutex.
2. It's possible because they use kernel-level operations to ensure that the thread is not switched until a certain operation is complete.
On Windows for instance, you could make... | a mutex implementation must ensure mutual exclusivity (that's the meaning of it) and not obtained in your code. It requires some atomic variable and suitable memory order for its access. In C++11, best use `std::mutex` (ideally together with `std::lock`), for C++03 you can use `boost::mutex` etc. |
27,420,566 | I have a list of dates like this:
```
Frequency Date
Weekly 07/01/2015
Fortnightly 07/01/2015
Monthly 07/01/2015
Fortnightly 14/01/2015
Weekly 14/01/2015
Weekly 21/01/2015
.............
So on
```
I would like to put these on a cal like this
```
January
February
March
April
May
June
July
August
```
with da... | 2014/12/11 | [
"https://Stackoverflow.com/questions/27420566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2981303/"
] | You can't hide Javascript because the browser downloads and executes it because its design is to work as client-side. Maybe you can give a try to javascript [obfuscator](http://javascriptobfuscator.com/) that will make it hard to read only. | To hide the JS is very difficult. But u can minify the JS-File as an alternative. So it is very hard to understand the context. It changes the declaration to letters, so it is unreadable. Uglify is very nice. There are also some online Tools to do that.
Uglify JS: <http://github.com/mishoo/UglifyJS>
It is now being u... |
317,789 | On Area 51 meta someone asked a question about promoting his proposal which I answered [here](https://area51.meta.stackexchange.com/a/28317).
Now on Stack Exchange since we don't like spam I don't like the idea of someone spamming something from Stack Exchange on some other platform, so I said in the most friendly way... | 2018/11/04 | [
"https://meta.stackexchange.com/questions/317789",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/311917/"
] | I don't think this simple reminder is rude, and it's not wrong.
It's always fine to remind people not to spam and to respect the users using the website. If you feel like it's rude to the user, you always have the right to remove it.
I also don't think you have to put the reminder in since most users know it's unres... | Although I sometime see small text used within posts, I personally think it is undesirable to do so, because my first thought is always "I wonder what they want to try and hide in the fine print". If it is worth saying then I think it is worth making it easily readable.
I think we all know that spamming is highly unpo... |
33,043,860 | I have a set of queries, where some are merely portions of the eventual search string. I need to clean the partial strings from a very long collection of queries. Is a fast way to do this across potentially millions of sets like this?
```
t = {u'house prices',
u'how ',
u'how man',
u'how many animals go ex',
u'how ... | 2015/10/09 | [
"https://Stackoverflow.com/questions/33043860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/601059/"
] | Sort the set to make a list `q`, then iterate through it and build up a new list of elements where `not q[i+1].startswith(q[i])`. Should do the trick reasonably well. | Edit: Alex Hall's solution is better.
For each set, create a new [trie](https://en.wikipedia.org/wiki/Trie) and insert all the set's strings into it. In the resulting trie, the leaf nodes represent the strings that are not prefixes of any other strings. With a good trie implementation, the runtime is expected to be li... |
43,615,966 | Hey guys needing some assistance. I am wondering if I can add a function to only match the letters from left to right instead of bringing up any word with that letter to my current code. For example if I search A and my list contains Apple and Banana only Apple should come up. I know this has already been asked but loo... | 2017/04/25 | [
"https://Stackoverflow.com/questions/43615966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7704400/"
] | One way to do it is override the default functionality;
```
// Overrides the default autocomplete filter function to search only from the beginning of the string
$.ui.autocomplete.filter = function (array, term) {
var matcher = new RegExp("^" + $.ui.autocomplete.escapeRegex(term), "i");
return $.grep(array, fu... | Here's a solution adapting one of the examples from <https://api.jqueryui.com/autocomplete/#entry-examples> (using a custom source callback to match only the beginning of terms)
```js
$(document).ready(function() {
var data = [{
value: "Equipment Search",
url: ''
},
{
value: "Equipmen... |
43,615,966 | Hey guys needing some assistance. I am wondering if I can add a function to only match the letters from left to right instead of bringing up any word with that letter to my current code. For example if I search A and my list contains Apple and Banana only Apple should come up. I know this has already been asked but loo... | 2017/04/25 | [
"https://Stackoverflow.com/questions/43615966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7704400/"
] | As I commented, you can do this using a Function for source.
Working Example: <https://jsfiddle.net/Twisty/5gm0tmLh/>
**JavaScript**
```
var mySource = [{
value: "Equipment Search",
url: 'https://domaina.com/equipment/default.aspx'
}, {
value: "Equipment Search Dev",
url: 'https://domaina.com/equipment/defau... | Here's a solution adapting one of the examples from <https://api.jqueryui.com/autocomplete/#entry-examples> (using a custom source callback to match only the beginning of terms)
```js
$(document).ready(function() {
var data = [{
value: "Equipment Search",
url: ''
},
{
value: "Equipmen... |
37,122,073 | This is a weird one. Earlier today, I posted code for a form that had floating labels. The problem was that the JS within the code that would register if the cursor or text had been put into the input was not working because, regardless of what you put in there, the label would float back down.
When I posted the code ... | 2016/05/09 | [
"https://Stackoverflow.com/questions/37122073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5015595/"
] | I just tested your code, it works fine: <https://jsfiddle.net/jb013rqe/3/>
But it looks like you forgot to include jQuery as an external dependency:
[](https://i.stack.imgur.com/cMQNd.png)
Just add an jquery cdn url to the External Resources section... | Always make sure you have jquery loaded on the page.
It seems to work fine for me. The placeholder in the input shrinks up and stays there if text is in the input. Try putting your js in this
```
$(document).ready(function () {
/*Code here*/
});
```
If that does not work are there any console errors? |
12,592,755 | I have a table like this:

and what I need is a sum of amounts in given year for given department.
I tried this:
```
SELECT SUM(amount) FROM `spendings` WHERE dept_name='fiz' AND YEAR(date)=2012
```
but it only returns `NULL`. `dept_name` is a `v... | 2012/09/25 | [
"https://Stackoverflow.com/questions/12592755",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1185254/"
] | To prevent anyone else from trying to answer this, the answer is that the System.Version class has no public setters on its members. Hence it cannot be de-serialized properly, and remains in its initial state. I had to use my own "Version" class that had publicly-settable members, and that worked fine. | I dont think [Serializable] could be an issue.
Try putting 'Content-Type: application/json' as header from the client side.
Also use [FromBody] attribute like this.
```
[HttpPost]
[ActionName("Details")]
public ServiceDto Get([FromBody]Version version)
{
}
``` |
10,229,132 | Using CakePHP 2.0 here. The title is a bit misleading, so to clear things up - I have session array which is populated with ids of products as user adds them to cart. So this array goes like [0] => 25, [1] => 70 etc. Let's say this array is called $products.
What I want to ask is is there some possibility to have arra... | 2012/04/19 | [
"https://Stackoverflow.com/questions/10229132",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/779669/"
] | Don't want to sound rude, but all of responses to my question were about how to order my array by Product id (which was clearly not what I asked) or suggestions on doing manual sql queries which is inappropriate. Seems like I couldn't properly describe what I needed, but I tried to make it as clear as possible, sorry.
... | I can't think of a simple SQL query that would order the results according to a list of parameters.
So the simplest is probably to reorder the records after having fetched them from the db.
```
$records = $this->Product->find('all', array('conditions' => array('Product.id' => $products)));
$sorted_records = array();... |
10,229,132 | Using CakePHP 2.0 here. The title is a bit misleading, so to clear things up - I have session array which is populated with ids of products as user adds them to cart. So this array goes like [0] => 25, [1] => 70 etc. Let's say this array is called $products.
What I want to ask is is there some possibility to have arra... | 2012/04/19 | [
"https://Stackoverflow.com/questions/10229132",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/779669/"
] | Don't want to sound rude, but all of responses to my question were about how to order my array by Product id (which was clearly not what I asked) or suggestions on doing manual sql queries which is inappropriate. Seems like I couldn't properly describe what I needed, but I tried to make it as clear as possible, sorry.
... | This is valid SQL, not sure how to make cakephp render it but i think it will solve your ordering issue :
`SELECT * FROM product WHERE id IN (35, 15, 25) ORDER BY id = 35 DESC, id = 15 DESC, id = 25` |
10,229,132 | Using CakePHP 2.0 here. The title is a bit misleading, so to clear things up - I have session array which is populated with ids of products as user adds them to cart. So this array goes like [0] => 25, [1] => 70 etc. Let's say this array is called $products.
What I want to ask is is there some possibility to have arra... | 2012/04/19 | [
"https://Stackoverflow.com/questions/10229132",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/779669/"
] | Don't want to sound rude, but all of responses to my question were about how to order my array by Product id (which was clearly not what I asked) or suggestions on doing manual sql queries which is inappropriate. Seems like I couldn't properly describe what I needed, but I tried to make it as clear as possible, sorry.
... | If I understand correctly you need to order the model result, or in other words set an order on the query to sort in an arbitrary fashion.
Here's two options:
1. Specify a sort. Not familiar with Cake but the mysql you need to generate is: `order by id = 25 desc, id = 70 desc, id = etc` (a guess would say to try `ord... |
10,229,132 | Using CakePHP 2.0 here. The title is a bit misleading, so to clear things up - I have session array which is populated with ids of products as user adds them to cart. So this array goes like [0] => 25, [1] => 70 etc. Let's say this array is called $products.
What I want to ask is is there some possibility to have arra... | 2012/04/19 | [
"https://Stackoverflow.com/questions/10229132",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/779669/"
] | Don't want to sound rude, but all of responses to my question were about how to order my array by Product id (which was clearly not what I asked) or suggestions on doing manual sql queries which is inappropriate. Seems like I couldn't properly describe what I needed, but I tried to make it as clear as possible, sorry.
... | I'm not familiar with cake or its database layers, but maybe you can add a little bit of sql.
The relevant sql would be something like
```
order by field(myTable.myID, 35, 15, 25)
-- or alternatively, more cross database compatible
order by case when myTable.myID = 35 then 1
when myTable.myID = 15 then ... |
10,229,132 | Using CakePHP 2.0 here. The title is a bit misleading, so to clear things up - I have session array which is populated with ids of products as user adds them to cart. So this array goes like [0] => 25, [1] => 70 etc. Let's say this array is called $products.
What I want to ask is is there some possibility to have arra... | 2012/04/19 | [
"https://Stackoverflow.com/questions/10229132",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/779669/"
] | Don't want to sound rude, but all of responses to my question were about how to order my array by Product id (which was clearly not what I asked) or suggestions on doing manual sql queries which is inappropriate. Seems like I couldn't properly describe what I needed, but I tried to make it as clear as possible, sorry.
... | The way I usually handle problems like this is by indexing the $list by the Product ID using the Set class, which is built into Cake. So
```
$list = Set::combine($list, '{n}.Product.id', '{n}.Product');
```
Then use loop through your cart ($products) which is already in the order you want
```
foreach($products as $... |
65,505,704 | [](https://i.stack.imgur.com/ov5TG.png)
I want to copy a hidden worksheet using VBA. However, When it run the vba code, all the copied worksheets are hidden as well, may I know is there any method to copy the worksheet and the new created worksheet is... | 2020/12/30 | [
"https://Stackoverflow.com/questions/65505704",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11833633/"
] | Please, try:
```
Sheet6.Copy After:=Sheets(Sheets.count)
Sheets(Sheets.count).Visible = xlSheetVisible
``` | ```
Sub CopySheet6()
Sheet6.Copy After:=Sheets(Sheets.Count)
Worksheets("Sheet6 (" & Sheets.Count - 1 & ")").Visible = True
End Sub
``` |
65,505,704 | [](https://i.stack.imgur.com/ov5TG.png)
I want to copy a hidden worksheet using VBA. However, When it run the vba code, all the copied worksheets are hidden as well, may I know is there any method to copy the worksheet and the new created worksheet is... | 2020/12/30 | [
"https://Stackoverflow.com/questions/65505704",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11833633/"
] | There are two stages of *Hidden*, xlSheetHidden and xlSheetVeryHidden. On my Excel 365 your code worked for normal *Hidden* sheets and crashed for *VeryHidden* sheets. In neither case was the copy hidden. However, the following code will unhide the sheet, create a visible copy and hide the original again to the same le... | ```
Sub CopySheet6()
Sheet6.Copy After:=Sheets(Sheets.Count)
Worksheets("Sheet6 (" & Sheets.Count - 1 & ")").Visible = True
End Sub
``` |
65,505,704 | [](https://i.stack.imgur.com/ov5TG.png)
I want to copy a hidden worksheet using VBA. However, When it run the vba code, all the copied worksheets are hidden as well, may I know is there any method to copy the worksheet and the new created worksheet is... | 2020/12/30 | [
"https://Stackoverflow.com/questions/65505704",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11833633/"
] | There are two stages of *Hidden*, xlSheetHidden and xlSheetVeryHidden. On my Excel 365 your code worked for normal *Hidden* sheets and crashed for *VeryHidden* sheets. In neither case was the copy hidden. However, the following code will unhide the sheet, create a visible copy and hide the original again to the same le... | Please, try:
```
Sheet6.Copy After:=Sheets(Sheets.count)
Sheets(Sheets.count).Visible = xlSheetVisible
``` |
20,592,667 | This is my code and I simply want it to read the input and if it is not empty just return what was inputted.
```
print "Welcome to translator!"
print "Enter in an english word"
original=raw_input("Enter a word")
if len(original) != 0:
return original
``` | 2013/12/15 | [
"https://Stackoverflow.com/questions/20592667",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3103970/"
] | You can only `return` from within a function So that would produce a `SyntaxError`.
A proper way to achieve what you want is by:
```
print "Welcome to translator!"
print "Enter in an english word"
original = raw_input("Enter a word")
if original: # Checks if original is not empty
print original
```
If you wan... | From the Python Official Website:
>
> `return` may only occur syntactically nested in a function definition,
> not within a nested class definition.
>
>
> If an expression list is present, it is evaluated, else None is
> substituted.
>
>
> `return` leaves the current function call with the expression list (or
>... |
42,372,319 | When I run this it will display the two inputs together. For example 1 + 2 will come out to 12. I know that this string has to somehow be changed to an integer but I am lost on how to do so. Any help is greatly appreciated.
```
private void
jButton5ActionPerformed(java.awt.event.ActionEvent evt) { ... | 2017/02/21 | [
"https://Stackoverflow.com/questions/42372319",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6063665/"
] | Values from JTextFields are Strings. If you want to do arithmetic on them you have to cast them to appropriate Numeric type like Integer or Double.
`jLabel1.setText(String.valueOf(Integer.parseInt(jTextField1.getText()) +
Integer.parseInt(jTextField2.getText())));` | >
> I know that this string has to somehow be changed to an integer but I
> am lost on how to do so.
>
>
>
You are right. That's indeed the problem. Extracting a string number to int is very easy to achieve using `Integer.parseInt` method.
```
private void
jButton5ActionPerformed(java.awt.event.ActionEvent ... |
21,020,300 | I am using require js for handling my Backbone application.
I want to load a script called global (where I'll have several miscellaneous functions which i want to use in certain Backbone views).
Here is the way I confid require js:
```
require.config({
paths: {
"jquery" : "libs/jquery",
... | 2014/01/09 | [
"https://Stackoverflow.com/questions/21020300",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2661067/"
] | Check your shim - I think the `global` object needs to be moved up.
```
shim: {
backbone: {
deps: ["underscore", "jquery"],
exports: "Backbone"
},
underscore: {
exports: '_'
},
text : {
exports : 'text'
},
... | You should exports Global in global scope in your **global.js**.
Instead
```
return Global;
```
Do
```
window.Global = Global;
```
Then your shim config will work as expected. |
24,340,649 | I am trying to search a multi-dimensional associative array and change a value after searching. Here is what my array looks like
```
$arr=Array ( [0] => Array ( [1] =>
Array ( [keyword] => 2014
[count] => 97
[percent] => 4.91 )))
```
So what I am trying to do is to search for keyword ... | 2014/06/21 | [
"https://Stackoverflow.com/questions/24340649",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1161864/"
] | you can use that code:
```
$arr = Array(
0 => Array(
1 => Array(
'keyword' => 2014,
'count' => 97,
'percent' => 4.91
)
)
);
foreach ($arr as &$arr1) {
foreach ($arr1 as &$arr2) {
if (2014 == $arr2['keyword']) {
$arr2['count'] += 100... | iterate through the dimensions of the array and change value if you found the key
```
foreach ($arr as $key => $val) {
foreach ($arr[$key] as $keyy => $val) {
foreach ($arr[$key][$keyy] as $keyyy => $val) {
if($arr[$key][$keyy]['keyword'] == 2014){
$arr[$key][$keyy]['count'] = $... |
24,340,649 | I am trying to search a multi-dimensional associative array and change a value after searching. Here is what my array looks like
```
$arr=Array ( [0] => Array ( [1] =>
Array ( [keyword] => 2014
[count] => 97
[percent] => 4.91 )))
```
So what I am trying to do is to search for keyword ... | 2014/06/21 | [
"https://Stackoverflow.com/questions/24340649",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1161864/"
] | iterate through the dimensions of the array and change value if you found the key
```
foreach ($arr as $key => $val) {
foreach ($arr[$key] as $keyy => $val) {
foreach ($arr[$key][$keyy] as $keyyy => $val) {
if($arr[$key][$keyy]['keyword'] == 2014){
$arr[$key][$keyy]['count'] = $... | Your array
```
$arr=array( "0" => array( "1" =>
array( "keyword" => 2014 ,
"count" => 97,
"percent" => 4.91 ),
"2"=> array( "keyword" => 2015,
"count" => 5,
"percent" => 4.91 )));
```
Code
```
foreach($arr as $key => &$val) {
foreach($val as $mm => &$aa... |
24,340,649 | I am trying to search a multi-dimensional associative array and change a value after searching. Here is what my array looks like
```
$arr=Array ( [0] => Array ( [1] =>
Array ( [keyword] => 2014
[count] => 97
[percent] => 4.91 )))
```
So what I am trying to do is to search for keyword ... | 2014/06/21 | [
"https://Stackoverflow.com/questions/24340649",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1161864/"
] | you can use that code:
```
$arr = Array(
0 => Array(
1 => Array(
'keyword' => 2014,
'count' => 97,
'percent' => 4.91
)
)
);
foreach ($arr as &$arr1) {
foreach ($arr1 as &$arr2) {
if (2014 == $arr2['keyword']) {
$arr2['count'] += 100... | Your array
```
$arr=array( "0" => array( "1" =>
array( "keyword" => 2014 ,
"count" => 97,
"percent" => 4.91 ),
"2"=> array( "keyword" => 2015,
"count" => 5,
"percent" => 4.91 )));
```
Code
```
foreach($arr as $key => &$val) {
foreach($val as $mm => &$aa... |
4,127,005 | I'm trying to check if two strings are identical as quickly as possible. Can I protect myself from hash collisions without also comparing the entire string?
I've got a cache of items that are keyed by a string. I store the hash of the string, the length of the string, and the string itself. (I'm currently using [djb2]... | 2010/11/08 | [
"https://Stackoverflow.com/questions/4127005",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/501015/"
] | I have tried similar thing as you describe, and the main problem I see, is that u can't create `ObjectSet<T>` for derived type. So you will not have `ObjectSet<Person>` repository.
If you derive all your Entities from for example BusinessObject entity, you will be able to work only with `ObjectSet<BusinessObject>`. If ... | One disadvantage of using inheritance in your model is that you won't be able to surface your model through WCF Data Services (OData) as it doesn't currently support derived entities. |
4,127,005 | I'm trying to check if two strings are identical as quickly as possible. Can I protect myself from hash collisions without also comparing the entire string?
I've got a cache of items that are keyed by a string. I store the hash of the string, the length of the string, and the string itself. (I'm currently using [djb2]... | 2010/11/08 | [
"https://Stackoverflow.com/questions/4127005",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/501015/"
] | I have tried similar thing as you describe, and the main problem I see, is that u can't create `ObjectSet<T>` for derived type. So you will not have `ObjectSet<Person>` repository.
If you derive all your Entities from for example BusinessObject entity, you will be able to work only with `ObjectSet<BusinessObject>`. If ... | I'm a little late to the party, but I've been having the same questions as you regarding inheritance in EF and found a pretty good summary for you to read. It's an [excerpt from Julie Lerman's book Programming Entity Framework](http://books.google.com/books?id=rtdgHbMeTBMC&lpg=PA371&ots=kUxo0EKzVD&dq=entity%20framework... |
4,127,005 | I'm trying to check if two strings are identical as quickly as possible. Can I protect myself from hash collisions without also comparing the entire string?
I've got a cache of items that are keyed by a string. I store the hash of the string, the length of the string, and the string itself. (I'm currently using [djb2]... | 2010/11/08 | [
"https://Stackoverflow.com/questions/4127005",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/501015/"
] | I'm a little late to the party, but I've been having the same questions as you regarding inheritance in EF and found a pretty good summary for you to read. It's an [excerpt from Julie Lerman's book Programming Entity Framework](http://books.google.com/books?id=rtdgHbMeTBMC&lpg=PA371&ots=kUxo0EKzVD&dq=entity%20framework... | One disadvantage of using inheritance in your model is that you won't be able to surface your model through WCF Data Services (OData) as it doesn't currently support derived entities. |
13,109,127 | trying to make an element render the full size of the screen:
```
<!DOCTYPE html>
<html>
<head>
<title>Test Page</title>
</head>
<body>
<canvas></canvas>
<script>
(function(){
var canvas = document.getElementsByTagName("canvas")[0];
canvas.style.background = "#0f0";
... | 2012/10/28 | [
"https://Stackoverflow.com/questions/13109127",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1259261/"
] | Width and height of canvas element should be marked like:
```
<canvas id="myCanvas" width="200" height="200">
```
Css styles messes it up | Try to set
```
canvas.width = screen.width + "px";
canvas.height = screen.height + "px";
```
without the `.style.` |
13,109,127 | trying to make an element render the full size of the screen:
```
<!DOCTYPE html>
<html>
<head>
<title>Test Page</title>
</head>
<body>
<canvas></canvas>
<script>
(function(){
var canvas = document.getElementsByTagName("canvas")[0];
canvas.style.background = "#0f0";
... | 2012/10/28 | [
"https://Stackoverflow.com/questions/13109127",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1259261/"
] | Width and height of canvas element should be marked like:
```
<canvas id="myCanvas" width="200" height="200">
```
Css styles messes it up | Maybe your window is much smaller then your screen. You can't cover more then the window, so maybe screen isn't what you want.
if changed it so this, so it covers the whole body
```
var canvas = document.getElementsByTagName("canvas")[0];
var body = document.getElementsByTagName("body")[0];
ca... |
11,181,999 | The API documentation describe how to add a "simple product" using rest:
<http://www.magentocommerce.com/api/rest/Resources/Products/products.html>
But what about configurable products?
We are working with t-shirts and the only way we can allow users to select size is creating a configurable product, so that's the re... | 2012/06/24 | [
"https://Stackoverflow.com/questions/11181999",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1061342/"
] | This should work
```
{
"cart_item": {
"quote_id": 7,
"sku": "WJ01",
"qty": 1,
"product_option": {
"extension_attributes": {
"configurable_item_options": [
{
"option_id": "93",
"option_value": 58
},
{
"option_id": "141",
... | Magento API is very slow prior to 1.7.0.0 like 1 simple product save (insert) every 1-2 seconds or even more. A configurable product without associated products takes longer to save.
Try Magmi <http://sourceforge.net/apps/mediawiki/magmi/index.php?title=Magmi_Wiki>. It inserts 20 products/seconds using raw queries. It... |
11,181,999 | The API documentation describe how to add a "simple product" using rest:
<http://www.magentocommerce.com/api/rest/Resources/Products/products.html>
But what about configurable products?
We are working with t-shirts and the only way we can allow users to select size is creating a configurable product, so that's the re... | 2012/06/24 | [
"https://Stackoverflow.com/questions/11181999",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1061342/"
] | Although the question is very old. But because I'm currently working on a similar task to create configurable products in Magento 1.9.x and associate those to simple products.
For Magento Version 1.9.2.4 for instance the answer is in the code:
```
// file: app/code/core/Mage/Catalog/Model/Api2/Product/Rest/Admin/V1.
... | Magento API is very slow prior to 1.7.0.0 like 1 simple product save (insert) every 1-2 seconds or even more. A configurable product without associated products takes longer to save.
Try Magmi <http://sourceforge.net/apps/mediawiki/magmi/index.php?title=Magmi_Wiki>. It inserts 20 products/seconds using raw queries. It... |
21,486,915 | I basically have one big gigantic table (about 1.000.000.000.000 records) in a database with these fields:
id, block\_id, record
id is unique, block\_id is not unique, it contains about 10k (max) records with the same block\_id but with different records
To simplify my job that deals with the DB I have an API simila... | 2014/01/31 | [
"https://Stackoverflow.com/questions/21486915",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39998/"
] | Your second SQL query is wrong. There should be a space between WHERE and TypeName. Like This :
```
SqlCommand cmd = new SqlCommand("select ExerciseName from ExerciseDisplay Where TypeName='" + ddlType.SelectedValue + "'", con);
``` | The Problem appear in the selectedIndexChanged function , which might be fired when the index of ddltype dropdownlist changed instead of dllExericese , also you should ensure the dlltype selectedindex not change after using the autopost method by setting dlltype.SelectedIndex=dlltyp.selectedindex in the function dlltyp... |
21,486,915 | I basically have one big gigantic table (about 1.000.000.000.000 records) in a database with these fields:
id, block\_id, record
id is unique, block\_id is not unique, it contains about 10k (max) records with the same block\_id but with different records
To simplify my job that deals with the DB I have an API simila... | 2014/01/31 | [
"https://Stackoverflow.com/questions/21486915",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39998/"
] | The problem is your event, you event is for the other drop down, your event should be:
```
protected void ddlType_SelectedIndexChanged(object sender, EventArgs e)
{
BindExercise();
}
```
A contribution to your code, if you populate your dropdown with datasource, the items that you add will not appear if they are... | Your second SQL query is wrong. There should be a space between WHERE and TypeName. Like This :
```
SqlCommand cmd = new SqlCommand("select ExerciseName from ExerciseDisplay Where TypeName='" + ddlType.SelectedValue + "'", con);
``` |
21,486,915 | I basically have one big gigantic table (about 1.000.000.000.000 records) in a database with these fields:
id, block\_id, record
id is unique, block\_id is not unique, it contains about 10k (max) records with the same block\_id but with different records
To simplify my job that deals with the DB I have an API simila... | 2014/01/31 | [
"https://Stackoverflow.com/questions/21486915",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39998/"
] | The problem is your event, you event is for the other drop down, your event should be:
```
protected void ddlType_SelectedIndexChanged(object sender, EventArgs e)
{
BindExercise();
}
```
A contribution to your code, if you populate your dropdown with datasource, the items that you add will not appear if they are... | The Problem appear in the selectedIndexChanged function , which might be fired when the index of ddltype dropdownlist changed instead of dllExericese , also you should ensure the dlltype selectedindex not change after using the autopost method by setting dlltype.SelectedIndex=dlltyp.selectedindex in the function dlltyp... |
1,398,989 | Sometimes I want to see how many times a certain function is called in a file or a code block. How do you do that? I am using Vim 7.2.
I presume you have to use `!wc` or some such. | 2009/09/09 | [
"https://Stackoverflow.com/questions/1398989",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149045/"
] | For counting the number of times some pattern occurs, use:
```
:%s/pattern//gn
```
The 'n' flag count the number of occurrences without doing any change to the document.
For counting the total number of words, you have several options.
If you want to run as an external command:
```
:!wc -w %
```
If you want to ... | You can use a substitution without a replacement to get the number of occurences. If you want to count all occurences of **word** use
```
:%s/\<word\>//gn
```
`\<` and `\>` match start and end of word. The `n` option prevents the substitution from being done. |
61,953,589 | I am trying to fetch the record as per multiple IDS and calculate the min value using PHP and MySQL. I am explaining the query below.
```
SELECT MIN(min_price) AS base_price,entity_id
FROM catalog_product_index_price
WHERE entity_id IN
('31439,31440,31441,31442,31443,31444,31445,31446,31447,31448,31469,31470,314... | 2020/05/22 | [
"https://Stackoverflow.com/questions/61953589",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13307697/"
] | You can only count the columns that have a value.
Also if the entity\_id is a numeric field you need to remove the quotes.
For example:
```
SELECT MIN(min_price) AS base_price,entity_id
FROM catalog_product_index_price
WHERE entity_id IN (31439, 31440, 31441, 31442, 31443, 31444, 31445, 31446, 31447, 31448, 31469 ... | ```
SELECT MIN(min_price) AS base_price,entity_id
FROM catalog_product_index_price
WHERE entity_id IN
('31439,31440,31441,31442,31443,31444,31445,31446,31447,31448,31469,31470,31471,
31472,31473')
AND min_price is not null;
``` |
37,295,383 | When I run the script, the browser proceeds to perpetually open new tabs until I end the process in the task manager. Shouldn't this loop only open the browser once? Even if you ignore the while loop and only focus on the browser request I get the same behavior. Does this have to do with the try/catch? What's going wro... | 2016/05/18 | [
"https://Stackoverflow.com/questions/37295383",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4077513/"
] | In case d.browse(....) throws an exception and doOnce=true will never executed.
Move doOnce=true into a finally block and it should work. | ```
try
{
d.browse(...);
doOnce = true;
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
```
If your call to `browse` above raises an exception, you will never set the exit flag.
Why are you doing this in a loop? If your intent is to only do this step once, ... |
37,295,383 | When I run the script, the browser proceeds to perpetually open new tabs until I end the process in the task manager. Shouldn't this loop only open the browser once? Even if you ignore the while loop and only focus on the browser request I get the same behavior. Does this have to do with the try/catch? What's going wro... | 2016/05/18 | [
"https://Stackoverflow.com/questions/37295383",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4077513/"
] | If you want to execute the try/catch block only once in `while` you should put the `doOnce` in your finally block :
```
try
{
d.browse(...);
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
doOnce = true;
}
```
but if you want to exit from `while` when a... | In case d.browse(....) throws an exception and doOnce=true will never executed.
Move doOnce=true into a finally block and it should work. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.