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 |
|---|---|---|---|---|---|
8,581,574 | We have this declaration in LCD.c:
```
unsigned char LCD[8][64] = {((unsigned char) 0)};
```
And in LCD.h we want to have something like:
```
extern unsigned char LCD[][];
```
We get this error:
```
Error[Pe098]: an array may not have elements of this type
``` | 2011/12/20 | [
"https://Stackoverflow.com/questions/8581574",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1106072/"
] | In C an array does not contain information about the size of each one of its dimensions. Therefore, the compiler needs to know how large is each one of the dimensions except the first one. So, to correct this situation, do something like this:
LCD.h:
```
#define MINOR 64
extern unsigned char LCD[][MINOR];
```
LCD.c... | sizeof of LCD array will refused if you didn't define the size of the two dimension !
```
sizeof refused : extern unsigned char LCD[][64];
sizeof accepted : extern unsigned char LCD[8][64];
```
it depend what you want ! |
67,673 | I have read research claiming the idea of multiple styles of learning does not hold up. If so, what does the research say is the best form of learning/teaching? | 2016/04/25 | [
"https://academia.stackexchange.com/questions/67673",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/53133/"
] | Recent eagle's-eye overview of best-practice study methods: Dunlosky, John, et al. "What works, what doesn't." *Scientific American Mind* 24.4 (2013): 46-53.
Gold star winners:
* **Self-testing.** That is: doing homework exercises and checking the answers.
* **Distributed practice.** Studying regularly in batches ove... | **Multimodal Learning**
as per the article *Multimedia design: the effects of relating multimodal information*, M. Dubois and I. Vial
>
> A statistically significant effect was observed on word memorisation
> in the different information presentation modes, suggesting better
> processing when there is co-referencin... |
24,734 | I have a problem where I am solving a system of linear equations but sometimes the system results in a singular matrix which cannot be easily solved. In this case I would like that those rows for which system is ill-defined would be computed as 0. How can I assure that?
An example matrix:
$$
\left[ \begin{array}{cccc... | 2016/08/16 | [
"https://scicomp.stackexchange.com/questions/24734",
"https://scicomp.stackexchange.com",
"https://scicomp.stackexchange.com/users/779/"
] | If you are willing to minimize the 2-norm of the solution rather than minimizing the number of non-zeros, you can use the pseudo-inverse. To solve A\*x = b in MATLAB, that would be pinv(A)\*b. In your example, this produces 2-norm of solution of 1.2120, vs. 2-norm of your preferred solution of 1.2207.
You can come clo... | I think I found a solution. I think the following algorithm can do the trick.
1. Define a set of restricted indexes $M$.
2. Populate $M$ with indexes of all rows which have $1$ only on a diagonal (equal to: all rows for which the sum of its elements is $1$; or, for which all non-diagonal elements are $0$).
3. Remove a... |
37,270 | When designing a Help page or FAQ that is broken down into categories, is a category titled "Other" useful, or does it indicate a poor information architecture?
Sometimes there are truly items that don't fit into a broader category, but my questions is what exactly to do about it:
* Should I eliminate the few things ... | 2013/03/28 | [
"https://ux.stackexchange.com/questions/37270",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/16943/"
] | When you have categories, there are often items that don't fit into any category well, and so you are left with a choice between having a category with a single item in it, or a catchall category like 'other'.
If the item isn't needed in the first place, then regardless of whether it fits into a category or not, you s... | I would guess that if you could rework your categories so that everything is meaningfully categorized, that would be your best option.
However, I don't consider an "Other" category illegitimate, after all the point is to get information across to the user. In this regard, calling it "Uncategorized" or "Miscellaneous" ... |
64,300,852 | I am able to mount my ext4 partition in wsl-2 using the following command in powershell:
`wsl --mount \\.\PHYSICALDRIVE4 --partition 1`
However when I either restart my computer or run `wsl --restart` the partition is unmounted and I have to run the above command again. Is there a way of automounting the partition?
... | 2020/10/11 | [
"https://Stackoverflow.com/questions/64300852",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9721442/"
] | After asking around on the wsl github, this option is currently not supported however there is a work around solution which is below for anyone who needs this functionality.
```
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /V "Mount PhysicalDrive4" /t REG_SZ /F /D "C:\Windows\System32\wsl.exe --mount \... | Just add the command to the end of .bashrc file in your home directory in WSL ( or the .zshrc file if you use zsh ) |
26,624,393 | I am executing selenium webdriver scripts through jenkins and logging some info through logger.info. On console output of jenkins it is showing as [testng] 2014-10-28 23:52:29,868 (pool-1-thread-2). I am not able to figure it out what "868" is referring to?
I looked at line no in source code but no it is not the same... | 2014/10/29 | [
"https://Stackoverflow.com/questions/26624393",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3578472/"
] | As Rahul said, i haven´t find a clean way to detect if someone has follow my instagram account, but the algorithm recommended wouldn't work as expected.
I would recommend to store a list of followers, then (lets suppose 5 mins later) ask the api for a new list of followers and compare if you have someone new. Because... | I think there is no direct method but you can try this algorithm.
1. Store number of followers a user has.
2. Now when you check for new followers find the **difference** in number of followers with current and saved number.
3. Let's say if '**three**' is the difference then, in the API Endpoint get the first three f... |
111,394 | I'm trying to create an exclusion script that will not send to people who do not have at least 16 matches in a related DE. I feel like i'm really close but haven't been able to get it to work yet.
This is what I have so far:
```
%%[ROWCOUNT(LOOKUPROWS("Shane_RA", "family_ID", _subscriberkey)) > 15]%%
``` | 2016/02/22 | [
"https://salesforce.stackexchange.com/questions/111394",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/16353/"
] | It assumes it's a AMPScript block. All you need is this without the block syntax:
```
ROWCOUNT(LOOKUPROWS("Shane_RA", "family_ID", _subscriberkey)) > 15
``` | Remember, your DE `Shane_RA` should be using template as DomainExclusion (Shown in below screenshot)
`ROWCOUNT(LOOKUPROWS("Shane_RA", "family_ID", _subscriberkey)) < 15`
[](https://i.stack.imgur.com/bgtQA.png) |
10,704,460 | I want to replace one random word of which are several in a string.
So let's say the string is
```
$str = 'I like blue, blue is my favorite colour because blue is very nice and blue is pretty';
```
And let's say I want to replace the word blue with red but only 2 times at random positions.
So after a function is d... | 2012/05/22 | [
"https://Stackoverflow.com/questions/10704460",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1100951/"
] | ```
echo preg_replace_callback('/blue/', function($match) { return rand(0,100) > 50 ? $match[0] : 'red'; }, $str);
``` | Well, you could use this algorithm:
1. calculate the random amount of times you want to replace the string
2. explode the string into an array
3. for that array replace the string occurence only if a random value between 1 and 100 is % 3 (for istance)
4. Decrease the number calculated at point 1.
5. Repeat until the n... |
10,704,460 | I want to replace one random word of which are several in a string.
So let's say the string is
```
$str = 'I like blue, blue is my favorite colour because blue is very nice and blue is pretty';
```
And let's say I want to replace the word blue with red but only 2 times at random positions.
So after a function is d... | 2012/05/22 | [
"https://Stackoverflow.com/questions/10704460",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1100951/"
] | Well, you could use this algorithm:
1. calculate the random amount of times you want to replace the string
2. explode the string into an array
3. for that array replace the string occurence only if a random value between 1 and 100 is % 3 (for istance)
4. Decrease the number calculated at point 1.
5. Repeat until the n... | ```
<?php
$amount_to_replace = 2;
$word_to_replace = 'blue';
$new_word = 'red';
$str = 'I like blue, blue is my favorite colour because blue is very nice and blue is pretty';
$words = explode(' ', $str); //convert string to array of words
$blue_keys = array_keys($words, $word_to_replace); //get index of all $word_to_... |
10,704,460 | I want to replace one random word of which are several in a string.
So let's say the string is
```
$str = 'I like blue, blue is my favorite colour because blue is very nice and blue is pretty';
```
And let's say I want to replace the word blue with red but only 2 times at random positions.
So after a function is d... | 2012/05/22 | [
"https://Stackoverflow.com/questions/10704460",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1100951/"
] | Much as I am loathed to use regex for something which is on the face of it very simple, in order to **guarantee exactly *n* replaces** I think it can help here, as it allows use to easily use [`array_rand()`](http://php.net/manual/en/function.array-rand.php), which does exactly what you want - pick *n* random items fro... | Well, you could use this algorithm:
1. calculate the random amount of times you want to replace the string
2. explode the string into an array
3. for that array replace the string occurence only if a random value between 1 and 100 is % 3 (for istance)
4. Decrease the number calculated at point 1.
5. Repeat until the n... |
10,704,460 | I want to replace one random word of which are several in a string.
So let's say the string is
```
$str = 'I like blue, blue is my favorite colour because blue is very nice and blue is pretty';
```
And let's say I want to replace the word blue with red but only 2 times at random positions.
So after a function is d... | 2012/05/22 | [
"https://Stackoverflow.com/questions/10704460",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1100951/"
] | ```
echo preg_replace_callback('/blue/', function($match) { return rand(0,100) > 50 ? $match[0] : 'red'; }, $str);
``` | ```
<?php
$amount_to_replace = 2;
$word_to_replace = 'blue';
$new_word = 'red';
$str = 'I like blue, blue is my favorite colour because blue is very nice and blue is pretty';
$words = explode(' ', $str); //convert string to array of words
$blue_keys = array_keys($words, $word_to_replace); //get index of all $word_to_... |
10,704,460 | I want to replace one random word of which are several in a string.
So let's say the string is
```
$str = 'I like blue, blue is my favorite colour because blue is very nice and blue is pretty';
```
And let's say I want to replace the word blue with red but only 2 times at random positions.
So after a function is d... | 2012/05/22 | [
"https://Stackoverflow.com/questions/10704460",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1100951/"
] | Much as I am loathed to use regex for something which is on the face of it very simple, in order to **guarantee exactly *n* replaces** I think it can help here, as it allows use to easily use [`array_rand()`](http://php.net/manual/en/function.array-rand.php), which does exactly what you want - pick *n* random items fro... | ```
echo preg_replace_callback('/blue/', function($match) { return rand(0,100) > 50 ? $match[0] : 'red'; }, $str);
``` |
10,704,460 | I want to replace one random word of which are several in a string.
So let's say the string is
```
$str = 'I like blue, blue is my favorite colour because blue is very nice and blue is pretty';
```
And let's say I want to replace the word blue with red but only 2 times at random positions.
So after a function is d... | 2012/05/22 | [
"https://Stackoverflow.com/questions/10704460",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1100951/"
] | Much as I am loathed to use regex for something which is on the face of it very simple, in order to **guarantee exactly *n* replaces** I think it can help here, as it allows use to easily use [`array_rand()`](http://php.net/manual/en/function.array-rand.php), which does exactly what you want - pick *n* random items fro... | ```
<?php
$amount_to_replace = 2;
$word_to_replace = 'blue';
$new_word = 'red';
$str = 'I like blue, blue is my favorite colour because blue is very nice and blue is pretty';
$words = explode(' ', $str); //convert string to array of words
$blue_keys = array_keys($words, $word_to_replace); //get index of all $word_to_... |
17,742,285 | I am unable to store the string into an array, when I output `b[c]` nothing appears whatsoever, how can I store it into an array?
```
int main(int argc, char *argv[])
{
string b[80000];
int c=0;
string s;
ifstream file(argv[1]);
while(file >> s) {
b[c]=s;
c++;
cout<<b[c];
... | 2013/07/19 | [
"https://Stackoverflow.com/questions/17742285",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2511357/"
] | You're printing empty strings. Just move `cout << b[c];` before `c++;`
I'd suggest use `std::vector`, it will avoid unnecessary temporary variables and magic constants:
```
#include <iostream>
#include <vector>
#include <string>
#include <fstream>
int main(int argc, const char* argv[])
{
std::ifstream fin(argv[1... | This may work
```
while(file >> s) {
b[c]=s;
cout<<b[c];
c++;
}
``` |
125,516 | Scientific computing is algorithm intensive and can also be data intensive. It often needs to use a lot of memory to run analysis and release it before continuing with the next. Sometime it also uses memory pool to recycle memory for each analysis. Managed language is interesting here because it can allow the developer... | 2008/09/24 | [
"https://Stackoverflow.com/questions/125516",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21495/"
] | [Python](http://www.python.org/) has become pretty big in scientific computing lately. It is a managed language, so you don't have to remember to free your memory. At the same time, it has packages for scientific and numerical computing ([NumPy](http://numpy.scipy.org/), [SciPy](http://www.scipy.org/)), which gives you... | The best option is Python with NumPy/ SciPy/ IPython. It has excellent performance because the core math is happening in libraries written in highly optimized C and Fortran. Since you interact with it using Python, everything from your perspective is clean and managed with extremely succinct, readable code and garbage ... |
125,516 | Scientific computing is algorithm intensive and can also be data intensive. It often needs to use a lot of memory to run analysis and release it before continuing with the next. Sometime it also uses memory pool to recycle memory for each analysis. Managed language is interesting here because it can allow the developer... | 2008/09/24 | [
"https://Stackoverflow.com/questions/125516",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21495/"
] | You are asking a fundamentally flawed question. The entire point of managed languages is that you don't handle memory. That is handled by the Garbage Collector, while you can make certain actions to better allow it to do its job in an efficient manner, it is not your job to do its job.
The things you can do to improve... | I think I would paraphrase the question by saying is the .NET memory manager capable of handling the job of memory management for scientific computing where traditionally hand tuned routines have been used for improving memory performance, especially for very large (GByte) matrices?
The author of this article certain... |
125,516 | Scientific computing is algorithm intensive and can also be data intensive. It often needs to use a lot of memory to run analysis and release it before continuing with the next. Sometime it also uses memory pool to recycle memory for each analysis. Managed language is interesting here because it can allow the developer... | 2008/09/24 | [
"https://Stackoverflow.com/questions/125516",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21495/"
] | You might be surprised at the number of people that use Matlab for this, and as it could be considered a programming language and certainly manages its own memory (with support for huge data sets, etc) then it should seriously be considered as a solution here.
Further, it will generate program code (may require a sepa... | I think I would paraphrase the question by saying is the .NET memory manager capable of handling the job of memory management for scientific computing where traditionally hand tuned routines have been used for improving memory performance, especially for very large (GByte) matrices?
The author of this article certain... |
125,516 | Scientific computing is algorithm intensive and can also be data intensive. It often needs to use a lot of memory to run analysis and release it before continuing with the next. Sometime it also uses memory pool to recycle memory for each analysis. Managed language is interesting here because it can allow the developer... | 2008/09/24 | [
"https://Stackoverflow.com/questions/125516",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21495/"
] | Not exactly sure what the question is, but you might want to check out [Fortress](http://projectfortress.sun.com/Projects/Community) | With a managed language you don't get that control as easily. The whole point in these languages is to handle malloc, garbage, and so on. Each managed language will handle that differently.
With Perl running out of memory is considered a fatal error. You can save the day via some small measure with $^M but this is onl... |
125,516 | Scientific computing is algorithm intensive and can also be data intensive. It often needs to use a lot of memory to run analysis and release it before continuing with the next. Sometime it also uses memory pool to recycle memory for each analysis. Managed language is interesting here because it can allow the developer... | 2008/09/24 | [
"https://Stackoverflow.com/questions/125516",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21495/"
] | You might be surprised at the number of people that use Matlab for this, and as it could be considered a programming language and certainly manages its own memory (with support for huge data sets, etc) then it should seriously be considered as a solution here.
Further, it will generate program code (may require a sepa... | Not exactly sure what the question is, but you might want to check out [Fortress](http://projectfortress.sun.com/Projects/Community) |
125,516 | Scientific computing is algorithm intensive and can also be data intensive. It often needs to use a lot of memory to run analysis and release it before continuing with the next. Sometime it also uses memory pool to recycle memory for each analysis. Managed language is interesting here because it can allow the developer... | 2008/09/24 | [
"https://Stackoverflow.com/questions/125516",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21495/"
] | I think I would paraphrase the question by saying is the .NET memory manager capable of handling the job of memory management for scientific computing where traditionally hand tuned routines have been used for improving memory performance, especially for very large (GByte) matrices?
The author of this article certain... | BlackBox Component Builder, developed by Oberon microsystems, is the component-based development environment for the programming language „Component Pascal“.
Due to its stability, performance and simplicity, BlackBox is perfectly suited for science and engineering applications.
<http://www.oberon.ch/blackbox.html>
(... |
125,516 | Scientific computing is algorithm intensive and can also be data intensive. It often needs to use a lot of memory to run analysis and release it before continuing with the next. Sometime it also uses memory pool to recycle memory for each analysis. Managed language is interesting here because it can allow the developer... | 2008/09/24 | [
"https://Stackoverflow.com/questions/125516",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21495/"
] | [Python](http://www.python.org/) has become pretty big in scientific computing lately. It is a managed language, so you don't have to remember to free your memory. At the same time, it has packages for scientific and numerical computing ([NumPy](http://numpy.scipy.org/), [SciPy](http://www.scipy.org/)), which gives you... | BlackBox Component Builder, developed by Oberon microsystems, is the component-based development environment for the programming language „Component Pascal“.
Due to its stability, performance and simplicity, BlackBox is perfectly suited for science and engineering applications.
<http://www.oberon.ch/blackbox.html>
(... |
125,516 | Scientific computing is algorithm intensive and can also be data intensive. It often needs to use a lot of memory to run analysis and release it before continuing with the next. Sometime it also uses memory pool to recycle memory for each analysis. Managed language is interesting here because it can allow the developer... | 2008/09/24 | [
"https://Stackoverflow.com/questions/125516",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21495/"
] | You are asking a fundamentally flawed question. The entire point of managed languages is that you don't handle memory. That is handled by the Garbage Collector, while you can make certain actions to better allow it to do its job in an efficient manner, it is not your job to do its job.
The things you can do to improve... | The best option is Python with NumPy/ SciPy/ IPython. It has excellent performance because the core math is happening in libraries written in highly optimized C and Fortran. Since you interact with it using Python, everything from your perspective is clean and managed with extremely succinct, readable code and garbage ... |
125,516 | Scientific computing is algorithm intensive and can also be data intensive. It often needs to use a lot of memory to run analysis and release it before continuing with the next. Sometime it also uses memory pool to recycle memory for each analysis. Managed language is interesting here because it can allow the developer... | 2008/09/24 | [
"https://Stackoverflow.com/questions/125516",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21495/"
] | F# seems to be somewhat targeted at this audience. There is actually a book called [F# for scientists](http://www.ffconsultancy.com/products/fsharp_for_scientists/?fsb).
Also this [question](http://lambda-the-ultimate.org/node/2720) was asked over at Lambda the Ultimate. | I would think that functional languages would be best suited to this type of task. |
125,516 | Scientific computing is algorithm intensive and can also be data intensive. It often needs to use a lot of memory to run analysis and release it before continuing with the next. Sometime it also uses memory pool to recycle memory for each analysis. Managed language is interesting here because it can allow the developer... | 2008/09/24 | [
"https://Stackoverflow.com/questions/125516",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21495/"
] | I would think that functional languages would be best suited to this type of task. | With a managed language you don't get that control as easily. The whole point in these languages is to handle malloc, garbage, and so on. Each managed language will handle that differently.
With Perl running out of memory is considered a fatal error. You can save the day via some small measure with $^M but this is onl... |
22,815,810 | What i am trying to do on Kendo grid is to pass selected column's id to controller and returned data will be datasource of 2nd kendo grid on same page without any page load or refresh.
Everthing works well on server side.Desired data Data will be returned to view as json format but 2nd grid cannot show the data.
Js:
... | 2014/04/02 | [
"https://Stackoverflow.com/questions/22815810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2543065/"
] | The problem is that you are not saying where in the returned data is actually the array with the data.
Your `model` definition should be:
```
schema: {
data: "Data",
model: {
ID: "ID",
fields: {
ID: {
editable: false,
... | Specify the type of the dataSource to be "aspnet-mvc". Before that make sure that you have loaded the kendo.aspnetmvc.min.js file.
Also you have to specify the schema configuration.
It should look something like this:
```
"dataSource": {
"transport": {
"prefix": "",
... |
24,376,772 | MY table is similar the one below. My goal is to get the total points of each person ( WHERE username = 'Bobby' OR username= 'George') and return the result in columns instead of rows. (Note: I have more than two username in my table and each of them contain specific points, in this case I am trying to retrieve the spe... | 2014/06/24 | [
"https://Stackoverflow.com/questions/24376772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3740975/"
] | >
> Can Java finalize an object when it is still in scope?
>
>
>
Yes.
However, I'm being pedantic here. *Scope* is a language concept that determines the validity of names. Whether an object can be garbage collected (and therefore finalized) depends on whether it is *reachable*.
The [answer from ajb](https://sta... | [JLS §12.6.1](http://docs.oracle.com/javase/specs/jls/se8/html/jls-12.html#jls-12.6.1):
>
> Optimizing transformations of a program can be designed that reduce the number of objects that are reachable to be less than those which would naively be considered reachable. For example, a Java compiler or code generator may... |
19,460 | I'm the proud parent of two 10 month old border collie pups - Amber and Ghost, sister and brother respectively.
Training so far is going well. Basic commands (sit, wait, leave, stand, heel, crawl, round, paw, etc even through to "cross" when arriving at a pavement edge) work first time, every time. Some slight re-cal... | 2018/01/14 | [
"https://pets.stackexchange.com/questions/19460",
"https://pets.stackexchange.com",
"https://pets.stackexchange.com/users/11071/"
] | Bonobos are NOT pets!
---------------------
And please, for you and the bonobo, do not try to keep one as pet. There are at least four reasons for this:
1. Bonobos are not safe.
2. The circumstances of bonobo capture and sale.
3. Bonobo care.
4. Legality.
**1. Bonobos are not safe to be around for humans.**
This st... | [](https://i.stack.imgur.com/WMBim.jpg)
**Who are Bonobos?**
Bonobo belong to the genus *Pan*. The two species belonging to the genus *Pan* are *Pan troglodytes* (chimpanzee) and *Pan paniscus* (bonobo)
**Habitat**
Bonobos are found only south of t... |
19,460 | I'm the proud parent of two 10 month old border collie pups - Amber and Ghost, sister and brother respectively.
Training so far is going well. Basic commands (sit, wait, leave, stand, heel, crawl, round, paw, etc even through to "cross" when arriving at a pavement edge) work first time, every time. Some slight re-cal... | 2018/01/14 | [
"https://pets.stackexchange.com/questions/19460",
"https://pets.stackexchange.com",
"https://pets.stackexchange.com/users/11071/"
] | You should not get a Bonobo as a pet, they are aggressive and dangerous, and like with any smart animal, will use toddler style manipulation to get what they want. But I understand where you are coming from and thus recommend safer pets that hopefully meet your desire. If you want something ape like look no further tha... | [](https://i.stack.imgur.com/WMBim.jpg)
**Who are Bonobos?**
Bonobo belong to the genus *Pan*. The two species belonging to the genus *Pan* are *Pan troglodytes* (chimpanzee) and *Pan paniscus* (bonobo)
**Habitat**
Bonobos are found only south of t... |
19,460 | I'm the proud parent of two 10 month old border collie pups - Amber and Ghost, sister and brother respectively.
Training so far is going well. Basic commands (sit, wait, leave, stand, heel, crawl, round, paw, etc even through to "cross" when arriving at a pavement edge) work first time, every time. Some slight re-cal... | 2018/01/14 | [
"https://pets.stackexchange.com/questions/19460",
"https://pets.stackexchange.com",
"https://pets.stackexchange.com/users/11071/"
] | To be blunt, these creatures can have Jekyll and Hyde personalities and can be very vindictive and decisive. I would not get one if you have children or live alone. They can be quite territorial protective and jealous, a combination that is worrisome to say the least. They have been known to turn on there owners/human ... | [](https://i.stack.imgur.com/WMBim.jpg)
**Who are Bonobos?**
Bonobo belong to the genus *Pan*. The two species belonging to the genus *Pan* are *Pan troglodytes* (chimpanzee) and *Pan paniscus* (bonobo)
**Habitat**
Bonobos are found only south of t... |
19,460 | I'm the proud parent of two 10 month old border collie pups - Amber and Ghost, sister and brother respectively.
Training so far is going well. Basic commands (sit, wait, leave, stand, heel, crawl, round, paw, etc even through to "cross" when arriving at a pavement edge) work first time, every time. Some slight re-cal... | 2018/01/14 | [
"https://pets.stackexchange.com/questions/19460",
"https://pets.stackexchange.com",
"https://pets.stackexchange.com/users/11071/"
] | Bonobos are NOT pets!
---------------------
And please, for you and the bonobo, do not try to keep one as pet. There are at least four reasons for this:
1. Bonobos are not safe.
2. The circumstances of bonobo capture and sale.
3. Bonobo care.
4. Legality.
**1. Bonobos are not safe to be around for humans.**
This st... | You should not get a Bonobo as a pet, they are aggressive and dangerous, and like with any smart animal, will use toddler style manipulation to get what they want. But I understand where you are coming from and thus recommend safer pets that hopefully meet your desire. If you want something ape like look no further tha... |
19,460 | I'm the proud parent of two 10 month old border collie pups - Amber and Ghost, sister and brother respectively.
Training so far is going well. Basic commands (sit, wait, leave, stand, heel, crawl, round, paw, etc even through to "cross" when arriving at a pavement edge) work first time, every time. Some slight re-cal... | 2018/01/14 | [
"https://pets.stackexchange.com/questions/19460",
"https://pets.stackexchange.com",
"https://pets.stackexchange.com/users/11071/"
] | Bonobos are NOT pets!
---------------------
And please, for you and the bonobo, do not try to keep one as pet. There are at least four reasons for this:
1. Bonobos are not safe.
2. The circumstances of bonobo capture and sale.
3. Bonobo care.
4. Legality.
**1. Bonobos are not safe to be around for humans.**
This st... | To be blunt, these creatures can have Jekyll and Hyde personalities and can be very vindictive and decisive. I would not get one if you have children or live alone. They can be quite territorial protective and jealous, a combination that is worrisome to say the least. They have been known to turn on there owners/human ... |
50,836,716 | Hi I would like to ask the result of an expression,
```
int x = 7;
double y = 2;
```
what will the type be when (x / y + 2)?
is it a double, long, int, string or byte?
thanks | 2018/06/13 | [
"https://Stackoverflow.com/questions/50836716",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8283264/"
] | It's a `double`. The *arithmetic conversion* rules come in to play when you have an expression containing mixed types:
`x` is converted to a `double` in the evaluation of `x / y`, and 2 is converted to a `double` when added to that term.
Note that this is true regardless of the range of `int` (and `double`) on your p... | The resulting type of the expression will be `double`. This is detailed in section 6.3.1.8 of the [C standard](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf) which details the **Usual arithmetic conversions**:
>
> First, if the corresponding real type of either operand is `long double`, the other operand ... |
50,836,716 | Hi I would like to ask the result of an expression,
```
int x = 7;
double y = 2;
```
what will the type be when (x / y + 2)?
is it a double, long, int, string or byte?
thanks | 2018/06/13 | [
"https://Stackoverflow.com/questions/50836716",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8283264/"
] | It returns `double` type.
In `(x / y + 2)` first `x/y` performed and here variable `x` is of `int` type and `y` is of `double` type, so you are performing division operator between two different type, hence **arithmetic type conversation** happens i.e temporarily `int` gets converted or promoted to `double` i.e `x/y` ... | The resulting type of the expression will be `double`. This is detailed in section 6.3.1.8 of the [C standard](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf) which details the **Usual arithmetic conversions**:
>
> First, if the corresponding real type of either operand is `long double`, the other operand ... |
177,279 | I've made it so they have the ability to echolocate and for the main character, a person with sight, the lighting is odd because it only comes from fires that are a necessity for warmth, cooking or forging.
My question would be, would windows be of any use in a windy city? | 2020/05/27 | [
"https://worldbuilding.stackexchange.com/questions/177279",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/75712/"
] | Ventilation and temperature control
===================================
The windows are probably not going to look like modern windows, with nicely tempered glass, but if we're defining a window as something you can open that's not a door then you'd probably want them still. Depending on climate these might look like ... | Ventilation
===========
You'll want some form of windows to help stay cool in the summer and to help give you enough fresh air to fuel the fireplaces. Here's a [detailed guide](https://www.windowmaster.com/solutions/natural-ventilation/natural-ventilation-design-guidelines) to window ventilation and below is a diagram... |
23,838,988 | Ok,
So I have a table with various columns, one of them being a date column that I use to sort the latest entries to the database, such as: `SELECT * FROM foo ORDER BY date DESC LIMIT 0,25`. This gives me the 25 latest entries.
What I want, is to group all the entries of one date together in the html such that the ou... | 2014/05/23 | [
"https://Stackoverflow.com/questions/23838988",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1307845/"
] | Just keep track of the date. If it changes, output the new date.
```
// The current date. Start with nothing.
$currentDate = '';
// Loop through your db results
while ($row = mysql_fetch_assoc($result)) {
// Check to see if the date of the current row is the same as previous row.
if ($currentDate !== $row['yo... | Remember the last date
```
$cur = null;
while($row = mysql_fetch_assoc($r)) {
if($row['date'] !== $cur) {
$cur = $row['date'];
echo "<li class="date">" . $row['date'] . "</li>\n";
}
echo "\t<li>" . $row['event'] . "</li>\n";
}
```
Or do more in SQL with GROUP CONCAT:
```
// SELECT date, ... |
23,838,988 | Ok,
So I have a table with various columns, one of them being a date column that I use to sort the latest entries to the database, such as: `SELECT * FROM foo ORDER BY date DESC LIMIT 0,25`. This gives me the 25 latest entries.
What I want, is to group all the entries of one date together in the html such that the ou... | 2014/05/23 | [
"https://Stackoverflow.com/questions/23838988",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1307845/"
] | Just keep track of the date. If it changes, output the new date.
```
// The current date. Start with nothing.
$currentDate = '';
// Loop through your db results
while ($row = mysql_fetch_assoc($result)) {
// Check to see if the date of the current row is the same as previous row.
if ($currentDate !== $row['yo... | You can do this via a group concat in the query like this (though it would generally work better for things like IDs:
```
select yourDateField, groupConcat(id)
from someTable order by yourDateField desc limit 0,25
```
which would then return data like:
```
2014-05-22
1, 2, 3, 4, 5
```
for each row which you can ... |
17,557,567 | In a Sails.js application, how can I include javascript assets selectively?
For instance, if I have an admin page and admin.js lives inside the assets/js directory. How do I keep the admin.js from loading on the public index page?
I'm aware that I could move the js out to the public directory, and include the script... | 2013/07/09 | [
"https://Stackoverflow.com/questions/17557567",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1207685/"
] | Sailsjs uses asset-rack to serve /assets. With the default layout page, sailsjs serves pages that look like (dummy2.js is included with an explicit < script >):
```
<html>
<head>
...
<script type="text/javascript" src="/assets/mixins/sails.io-d338eee765373b5d77fdd78f29d47900.js"></script>
<script type="t... | Yes, you put a condition in template. :)
or add another "block" for your js.
```
extends ../layout
block body
<h1>hello</h1>
block jsscripts
<scripts> ..... </script>
``` |
17,557,567 | In a Sails.js application, how can I include javascript assets selectively?
For instance, if I have an admin page and admin.js lives inside the assets/js directory. How do I keep the admin.js from loading on the public index page?
I'm aware that I could move the js out to the public directory, and include the script... | 2013/07/09 | [
"https://Stackoverflow.com/questions/17557567",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1207685/"
] | >
>
> >
> > In a Sails.js application, how can I include javascript assets selectively?
> >
> >
> >
>
>
>
I selectively load js assets using a wrapper around assets.js(). This snippet uses Jade's "-" and "!{...}". EJS would instead use "<%...%>" and "<%=...%>"
```
<!-- JavaScript and stylesheets from your a... | Yes, you put a condition in template. :)
or add another "block" for your js.
```
extends ../layout
block body
<h1>hello</h1>
block jsscripts
<scripts> ..... </script>
``` |
17,557,567 | In a Sails.js application, how can I include javascript assets selectively?
For instance, if I have an admin page and admin.js lives inside the assets/js directory. How do I keep the admin.js from loading on the public index page?
I'm aware that I could move the js out to the public directory, and include the script... | 2013/07/09 | [
"https://Stackoverflow.com/questions/17557567",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1207685/"
] | I know this is a old question but since people are still looking for this.
Sails has a folder called tasks in the root after you create a new project.
The file you are looking for is
>
> pipeline.js
>
>
>
That file holds a variable called `jsFilesToInject`
```
// Client-side javascript files to inject in or... | Yes, you put a condition in template. :)
or add another "block" for your js.
```
extends ../layout
block body
<h1>hello</h1>
block jsscripts
<scripts> ..... </script>
``` |
17,557,567 | In a Sails.js application, how can I include javascript assets selectively?
For instance, if I have an admin page and admin.js lives inside the assets/js directory. How do I keep the admin.js from loading on the public index page?
I'm aware that I could move the js out to the public directory, and include the script... | 2013/07/09 | [
"https://Stackoverflow.com/questions/17557567",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1207685/"
] | Sailsjs uses asset-rack to serve /assets. With the default layout page, sailsjs serves pages that look like (dummy2.js is included with an explicit < script >):
```
<html>
<head>
...
<script type="text/javascript" src="/assets/mixins/sails.io-d338eee765373b5d77fdd78f29d47900.js"></script>
<script type="t... | To answer part of your question about where included files are located.
In 0.10 version order of the files is set in file `tasks/values/injectedFiles.js` as I recall in previous versions it was determined in `Gruntfile.js` itself. |
17,557,567 | In a Sails.js application, how can I include javascript assets selectively?
For instance, if I have an admin page and admin.js lives inside the assets/js directory. How do I keep the admin.js from loading on the public index page?
I'm aware that I could move the js out to the public directory, and include the script... | 2013/07/09 | [
"https://Stackoverflow.com/questions/17557567",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1207685/"
] | Sailsjs uses asset-rack to serve /assets. With the default layout page, sailsjs serves pages that look like (dummy2.js is included with an explicit < script >):
```
<html>
<head>
...
<script type="text/javascript" src="/assets/mixins/sails.io-d338eee765373b5d77fdd78f29d47900.js"></script>
<script type="t... | You can add reference of your custom file in tasks/pipeline.js
```
var jsFilesToInject = [
'js/dependencies/sails.io.js',
'js/dependencies/**/*.js',
'js/**/*.js',
'js/yourcustomFile.js'
];
``` |
17,557,567 | In a Sails.js application, how can I include javascript assets selectively?
For instance, if I have an admin page and admin.js lives inside the assets/js directory. How do I keep the admin.js from loading on the public index page?
I'm aware that I could move the js out to the public directory, and include the script... | 2013/07/09 | [
"https://Stackoverflow.com/questions/17557567",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1207685/"
] | >
>
> >
> > In a Sails.js application, how can I include javascript assets selectively?
> >
> >
> >
>
>
>
I selectively load js assets using a wrapper around assets.js(). This snippet uses Jade's "-" and "!{...}". EJS would instead use "<%...%>" and "<%=...%>"
```
<!-- JavaScript and stylesheets from your a... | To answer part of your question about where included files are located.
In 0.10 version order of the files is set in file `tasks/values/injectedFiles.js` as I recall in previous versions it was determined in `Gruntfile.js` itself. |
17,557,567 | In a Sails.js application, how can I include javascript assets selectively?
For instance, if I have an admin page and admin.js lives inside the assets/js directory. How do I keep the admin.js from loading on the public index page?
I'm aware that I could move the js out to the public directory, and include the script... | 2013/07/09 | [
"https://Stackoverflow.com/questions/17557567",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1207685/"
] | >
>
> >
> > In a Sails.js application, how can I include javascript assets selectively?
> >
> >
> >
>
>
>
I selectively load js assets using a wrapper around assets.js(). This snippet uses Jade's "-" and "!{...}". EJS would instead use "<%...%>" and "<%=...%>"
```
<!-- JavaScript and stylesheets from your a... | You can add reference of your custom file in tasks/pipeline.js
```
var jsFilesToInject = [
'js/dependencies/sails.io.js',
'js/dependencies/**/*.js',
'js/**/*.js',
'js/yourcustomFile.js'
];
``` |
17,557,567 | In a Sails.js application, how can I include javascript assets selectively?
For instance, if I have an admin page and admin.js lives inside the assets/js directory. How do I keep the admin.js from loading on the public index page?
I'm aware that I could move the js out to the public directory, and include the script... | 2013/07/09 | [
"https://Stackoverflow.com/questions/17557567",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1207685/"
] | I know this is a old question but since people are still looking for this.
Sails has a folder called tasks in the root after you create a new project.
The file you are looking for is
>
> pipeline.js
>
>
>
That file holds a variable called `jsFilesToInject`
```
// Client-side javascript files to inject in or... | To answer part of your question about where included files are located.
In 0.10 version order of the files is set in file `tasks/values/injectedFiles.js` as I recall in previous versions it was determined in `Gruntfile.js` itself. |
17,557,567 | In a Sails.js application, how can I include javascript assets selectively?
For instance, if I have an admin page and admin.js lives inside the assets/js directory. How do I keep the admin.js from loading on the public index page?
I'm aware that I could move the js out to the public directory, and include the script... | 2013/07/09 | [
"https://Stackoverflow.com/questions/17557567",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1207685/"
] | I know this is a old question but since people are still looking for this.
Sails has a folder called tasks in the root after you create a new project.
The file you are looking for is
>
> pipeline.js
>
>
>
That file holds a variable called `jsFilesToInject`
```
// Client-side javascript files to inject in or... | You can add reference of your custom file in tasks/pipeline.js
```
var jsFilesToInject = [
'js/dependencies/sails.io.js',
'js/dependencies/**/*.js',
'js/**/*.js',
'js/yourcustomFile.js'
];
``` |
43,476,080 | I've been trying to write a Racket interpreter that can evaluate itself but I can't get it to work for some reason. The code for `interpreter.rkt` is pretty standard. The code from `interpreter-test.rkt` might be the problem? I'm not sure.
`interpreter.rkt`
```
#lang racket
(provide eeval)
(define (eeval lines)
... | 2017/04/18 | [
"https://Stackoverflow.com/questions/43476080",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6546220/"
] | If you're going to use *mutable* pairs, make sure that they're used *everywhere*. For instance, transform expressions like this:
```
(cons 'x 'y)
```
Into this:
```
(mcons 'x 'y)
```
And this:
```
'(a b c)
```
Into this:
```
(require compatibility/mlist)
(mlist 'a 'b 'c)
``` | I recommend that you represent the environment, frames and bindings as structures.
```
#lang racket
; From SICP:
; An environment is a sequence of frames.
(struct environment (frames) #:mutable #:transparent)
; Each frame is a table (possibly empty) of bindings,
; which associate variable names with their correspondin... |
43,476,080 | I've been trying to write a Racket interpreter that can evaluate itself but I can't get it to work for some reason. The code for `interpreter.rkt` is pretty standard. The code from `interpreter-test.rkt` might be the problem? I'm not sure.
`interpreter.rkt`
```
#lang racket
(provide eeval)
(define (eeval lines)
... | 2017/04/18 | [
"https://Stackoverflow.com/questions/43476080",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6546220/"
] | If you're going to use *mutable* pairs, make sure that they're used *everywhere*. For instance, transform expressions like this:
```
(cons 'x 'y)
```
Into this:
```
(mcons 'x 'y)
```
And this:
```
'(a b c)
```
Into this:
```
(require compatibility/mlist)
(mlist 'a 'b 'c)
``` | Thanks to Matthias Felleisen on the Racket users mailing list: <https://groups.google.com/forum/#!topic/racket-users/aFfGgh7Rfgc>, I found the problem. It has nothing to do with cons, mcons, or quotes.
The problem was a mistake in interpreter.rkt. In interpreter.rkt, under the definition of myeval, in the case of a le... |
161,101 | I'm a bit confused whether these two are the same concept. If they are different what's the difference?
Thanks! | 2015/07/12 | [
"https://stats.stackexchange.com/questions/161101",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/82121/"
] | Suppose you have a set of binary observations $Y\_i$ for $i=1,\ldots,n$ and, for each observation, an associated explanatory variable $X\_i$. Logistic regression assumes
$$ Y\_i \stackrel{ind}{\sim} Ber(\pi\_i), \quad \ln\left(\frac{\pi\_i}{1-\pi\_i}\right)=\beta\_0+\beta\_1 X\_i.$$
If you are obtaining point estimate... | I don't claim to be an expert on Logistic Regression. But I imagine it goes something like this - suppose $Y$ is a binary random variable taking on either the value $0$ or $1$. Define
$$\pi=\mathbb{P}\left(Y=0∣X\right)\text{,}$$
where $X$ is the independent variable (I'm assuming only one predictor for simplicity). The... |
161,101 | I'm a bit confused whether these two are the same concept. If they are different what's the difference?
Thanks! | 2015/07/12 | [
"https://stats.stackexchange.com/questions/161101",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/82121/"
] | The other answers are good. However, to clarify the intuition as well as give some further details:
* In logistic regression, you maximize the likelihood function $p(y|\beta\_{0},\beta\_{1},x)$ (find MLE). That is, you find the weights $\beta\_{0},\beta\_{1}$ that maximizes how likely your observed data is. There is... | I don't claim to be an expert on Logistic Regression. But I imagine it goes something like this - suppose $Y$ is a binary random variable taking on either the value $0$ or $1$. Define
$$\pi=\mathbb{P}\left(Y=0∣X\right)\text{,}$$
where $X$ is the independent variable (I'm assuming only one predictor for simplicity). The... |
161,101 | I'm a bit confused whether these two are the same concept. If they are different what's the difference?
Thanks! | 2015/07/12 | [
"https://stats.stackexchange.com/questions/161101",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/82121/"
] | The other answers are good. However, to clarify the intuition as well as give some further details:
* In logistic regression, you maximize the likelihood function $p(y|\beta\_{0},\beta\_{1},x)$ (find MLE). That is, you find the weights $\beta\_{0},\beta\_{1}$ that maximizes how likely your observed data is. There is... | Suppose you have a set of binary observations $Y\_i$ for $i=1,\ldots,n$ and, for each observation, an associated explanatory variable $X\_i$. Logistic regression assumes
$$ Y\_i \stackrel{ind}{\sim} Ber(\pi\_i), \quad \ln\left(\frac{\pi\_i}{1-\pi\_i}\right)=\beta\_0+\beta\_1 X\_i.$$
If you are obtaining point estimate... |
206,235 | I have following args to get recent posts,
```
$args = array(
'date_query' => array( array( 'after' => '1 week ago' ) ),
'posts_per_page' => 15,
'ignore_sticky_posts' => 1,
'meta_key' => 'post_views_count',
'orderby' => 'meta_value_num',
'order' => 'DESC',
'cat' => '-907,-908,-909'
);
``... | 2015/10/22 | [
"https://wordpress.stackexchange.com/questions/206235",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/68403/"
] | Here is another way of doing it, specially if you need to work with the query object. The issue with merging queries is that you loose the correctness of the query object.
My idea here is to run two separate queries, one very lean one to get post ID's from the `date_query` query and then merging the two arrays of post... | I am not sure, is this the best way, but I succeed with following code.
```
$highlights = array('8308', '8315');
$args1 = array(
'post__in' => $highlights
);
$args2 = array(
'date_query' => array( array( 'after' => '1 week ago' ) ),
'posts_per_page' => 13,
'ignore_sticky_posts' => 1,
'meta_key'... |
206,235 | I have following args to get recent posts,
```
$args = array(
'date_query' => array( array( 'after' => '1 week ago' ) ),
'posts_per_page' => 15,
'ignore_sticky_posts' => 1,
'meta_key' => 'post_views_count',
'orderby' => 'meta_value_num',
'order' => 'DESC',
'cat' => '-907,-908,-909'
);
``... | 2015/10/22 | [
"https://wordpress.stackexchange.com/questions/206235",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/68403/"
] | I am not sure, is this the best way, but I succeed with following code.
```
$highlights = array('8308', '8315');
$args1 = array(
'post__in' => $highlights
);
$args2 = array(
'date_query' => array( array( 'after' => '1 week ago' ) ),
'posts_per_page' => 13,
'ignore_sticky_posts' => 1,
'meta_key'... | Actually, I've found this solution to be very versatile:
```php
$highlights = array('8308', '8315');
//Optionally, to get these IDS (or others, maybe of the different posttype, or whatever) you can use a simple args with get_posts function and return just the ids using the arg fields => ids
$args2 = array(
'date... |
206,235 | I have following args to get recent posts,
```
$args = array(
'date_query' => array( array( 'after' => '1 week ago' ) ),
'posts_per_page' => 15,
'ignore_sticky_posts' => 1,
'meta_key' => 'post_views_count',
'orderby' => 'meta_value_num',
'order' => 'DESC',
'cat' => '-907,-908,-909'
);
``... | 2015/10/22 | [
"https://wordpress.stackexchange.com/questions/206235",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/68403/"
] | Here is another way of doing it, specially if you need to work with the query object. The issue with merging queries is that you loose the correctness of the query object.
My idea here is to run two separate queries, one very lean one to get post ID's from the `date_query` query and then merging the two arrays of post... | Actually, I've found this solution to be very versatile:
```php
$highlights = array('8308', '8315');
//Optionally, to get these IDS (or others, maybe of the different posttype, or whatever) you can use a simple args with get_posts function and return just the ids using the arg fields => ids
$args2 = array(
'date... |
16,266,811 | I am writing an app for android which uses Fragments, but when I run the application on a GingerBread phone, I get an error in this line:
```
inflater.inflate(R.layout.fragment_location, container, false);
```
which says
```
android.view.InflateException: Binary XML file line #8: Error inflating class <unknown>
``... | 2013/04/28 | [
"https://Stackoverflow.com/questions/16266811",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2008306/"
] | On the left screen of Eclipse:
click your project then click "libs"
You will see the libraries that you were used on your project.
Right click the "android-support-v4.jar" select the "Build Path" / "Add to Build Path"
After do this,
top of the your activity delete the import things that about the FRAGMENTS.
use ... | `Fragment` is introduced in `API level 11 (Honeycomb)`. So if you want to use `Fragments` flexibly in below `AIP level 11` you should use library like `ABS (ActionBarSherlock)` you can get it from github(<https://github.com/JakeWharton/ActionBarSherlock>). Better use that. |
16,266,811 | I am writing an app for android which uses Fragments, but when I run the application on a GingerBread phone, I get an error in this line:
```
inflater.inflate(R.layout.fragment_location, container, false);
```
which says
```
android.view.InflateException: Binary XML file line #8: Error inflating class <unknown>
``... | 2013/04/28 | [
"https://Stackoverflow.com/questions/16266811",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2008306/"
] | as others have mentioned, Fragments aren't supported on pre-honeycomb versions of Android, so you will need to use a library for this.
Google has one, and there is also a very popular library called [**ActionBarSherlock**](http://actionbarsherlock.com/download.html) , which also has examples of how to use them.
i thi... | `Fragment` is introduced in `API level 11 (Honeycomb)`. So if you want to use `Fragments` flexibly in below `AIP level 11` you should use library like `ABS (ActionBarSherlock)` you can get it from github(<https://github.com/JakeWharton/ActionBarSherlock>). Better use that. |
16,464,166 | I have the following:
**Date** ------- **Cost**
```
Jan £500
Jan £600
Feb £300
Feb £600
March £1000
March £500
```
The cost cells are coloured differently depending on its current status (confirmed green, unconfirmed white, semi-confirmed yellow), I need a formula to sum all costs that are... | 2013/05/09 | [
"https://Stackoverflow.com/questions/16464166",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1571463/"
] | Add this Function to your VBA module in order to return a cells interior color index:
```
Function ColorIndex(rng As Range, _
Optional text As Boolean = False) As Variant
Dim cell As Range, row As Range
Dim i As Long, j As Long
Dim iWhite As Long, iBlack As Long
Dim aryColours ... | I realize you are asking for a programing answer, and I have no idea of the scope of your project.
Here is simple solution, without programing.
Filter by color, select the cells, the sum will be displayed at the bottom (i.e. 2100)
 |
42,360,999 | I want to convert "base64" string into bytes array through the javascript.
I received string from the URL like.
```
("data:image/jpeg;base64,/9j/4QN6RXhpZgAASUkqAAgAAAAIA)
```
And i want to convert the string into bytes array. because i need this byte array to send Rest API endpoint. The rest API Content-type=appl... | 2017/02/21 | [
"https://Stackoverflow.com/questions/42360999",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6260875/"
] | You can use `XMLHttpRequest` to do the dirty work for you:
```js
var url = document.createElement("canvas").toDataURL(); // some data-uri
var xhr = new XMLHttpRequest();
xhr.open("GET", url);
xhr.responseType = "arraybuffer";
xhr.onload = function() {
// result = ArrayBuffer, from here assign a view to it
i... | This would prove to be much short solution.
```
const byteArray = new Buffer(base64String.replace(/^[\w\d;:\/]+base64\,/g, ''), 'base64');
```
>
> base64String is the string containing the base 64 string.
>
>
>
>
> byteArray is the array you need.
>
>
>
>
> The regex replacement is optional and is just th... |
42,360,999 | I want to convert "base64" string into bytes array through the javascript.
I received string from the URL like.
```
("data:image/jpeg;base64,/9j/4QN6RXhpZgAASUkqAAgAAAAIA)
```
And i want to convert the string into bytes array. because i need this byte array to send Rest API endpoint. The rest API Content-type=appl... | 2017/02/21 | [
"https://Stackoverflow.com/questions/42360999",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6260875/"
] | You can try with the following;
```
function test(base64StringFromURL)
{
var parts = base64StringFromURL.split(";base64,");
var contentType = parts[0].replace("data:", "");
var base64 = parts[1];
var byteArray = base64ToByteArray(base64);
..
}
function base64ToByteArray(base64String) {
try { ... | This would prove to be much short solution.
```
const byteArray = new Buffer(base64String.replace(/^[\w\d;:\/]+base64\,/g, ''), 'base64');
```
>
> base64String is the string containing the base 64 string.
>
>
>
>
> byteArray is the array you need.
>
>
>
>
> The regex replacement is optional and is just th... |
4,412,278 | I want to make available the same interface with a netTcpBinding and basicHttpBinding. I also wanna make available the wsdl for both endpoints. When I access `http://localhost:9876/TestService/`, I get the mex endpoint that has the information for the Tcp endoint at `http://localhost:9876/TestService/?wsdl`, but the ad... | 2010/12/10 | [
"https://Stackoverflow.com/questions/4412278",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/91617/"
] | It's a rookie mistake on my part. It's actually correct. The answer is in [the post below](http://social.msdn.microsoft.com/Forums/en/wcf/thread/38fd2e58-85b3-42c6-955b-323cd0a922f2).
I only get a response from the browser when I hit the base HTTP class, but using this wsdl, I can connect with both bindings. | I suspect your service endpoint address is wrong:
```
<endpoint address="/ws" binding="basicHttpBinding" bindingConfiguration="SimpleBinding"
name="Test" contract="CompanyX.AppServer.Interfaces.ITest" />
```
Since it's a relative address (added to your base address), it should be just `ws` - no leadi... |
142,083 | The SEO company keeps bugging me to put the Analytics code in the `<head>` section because they say:
"...the code isn't in the `<head>` section, I am unable to install webmaster tools, which is essential to us tracking keywords for the campaign. Could you please move the analytics code to the `<head>` section or paste... | 2016/10/21 | [
"https://magento.stackexchange.com/questions/142083",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/20848/"
] | Try going to this part of the admin:
```
System->Configuration->Design->Head
```
and see if you can insert what you need in there | In Magento 2.1 `Miscellaneous scripts` configuration is rendering before the body closing tag and it's no longer in `Stores -> Configuration` section.
If you need to place the script into **`<head>`** tag you can place it in `Scripts and Style Sheets` section
>
> Content -> Design -> Configuration -> Open your them... |
142,083 | The SEO company keeps bugging me to put the Analytics code in the `<head>` section because they say:
"...the code isn't in the `<head>` section, I am unable to install webmaster tools, which is essential to us tracking keywords for the campaign. Could you please move the analytics code to the `<head>` section or paste... | 2016/10/21 | [
"https://magento.stackexchange.com/questions/142083",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/20848/"
] | Magento provides a system configuration called `Miscellaneous scripts`. You can assign your analytics JS code into it and it will add this JS code into head section.
Follow below steps to assign JS to `Miscellaneous scripts`.
1. Login to the admin panel
2. go to system>configuration
3. Click on the Design section on... | In Magento 2.1 `Miscellaneous scripts` configuration is rendering before the body closing tag and it's no longer in `Stores -> Configuration` section.
If you need to place the script into **`<head>`** tag you can place it in `Scripts and Style Sheets` section
>
> Content -> Design -> Configuration -> Open your them... |
72,610,948 | I have an application where I need to populate a DropDownList using MySQL. This is easily done using
```
DropDownList1.Items.Add(“ItemName”)
```
The problem though is that I need to pass the database index for the `ItemName` rather than the default index. I have tried to use
```
DropDownList1.Items.Insert(int inde... | 2022/06/14 | [
"https://Stackoverflow.com/questions/72610948",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6743474/"
] | Finally I found a solution for this problem.
Issue 1: Disabling sound effect on pressing DPAD\_CENTER key. I could resolve this issue by programmatically disabling sound effect in CardPresenter (for Leanback ListRowPresenter) and CardAdapter (for RecyclerView).
Issue 2: Disabling sound effect on pressing DPAD navigat... | If you just want to mute android tv navigation system sound effect and there is no custom navigation behavior, I found a way by overriding onKeyDown.
First, I added a GlobalFocusChangeListener at Activity and Dialog to listen and keep the reference of focused view.
```
window.decorView.viewTreeObserver.addOnGlobalFoc... |
62,788,630 | I am pretty new to JS and React-Bootstrap and have read a few other questions related to this error. However, I am still unable to solve my problem. Thankful for any help you can give.
I am trying to implement a row that when clicked on will unhide another row beneath it with more detail about that row. I found this o... | 2020/07/08 | [
"https://Stackoverflow.com/questions/62788630",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9627391/"
] | the `this` reference is not referring to your react class but rather to the `renderTable` function, if you can move it to the class property and bind it using the react class `constructor` or to the `render` function
```
class Gateway extends React.Component {
onRowClickHandler(e){
const hiddenElement = e.current... | You have to be careful about the meaning of `this` in JSX callbacks. In JavaScript, class methods are not bound by default. If you forget to bind `this.handlerFunction` and pass it to `onClick`, this will be undefined when the function is actually called.
This is not React-specific behavior; it is a part of how functi... |
10,238,902 | When creating a form in jQuery mobile, it seems like the default form functionality is to specify the page load animation from the `<form>` tag rather than the submit button. I am trying to build a form with two submit buttons that are each supposed to perform a different animation (it sounds weird, but it makes sense ... | 2012/04/20 | [
"https://Stackoverflow.com/questions/10238902",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552532/"
] | May be i would be wrong, I think Submit button do not support transitions, but anchor tag does.. Try this by using anchor tag...
For Example,
```
<form action="blah.php" method="get">
<a id="direct1" data-transition="slide">submit button 2</a>
<a id="direct2" data-transition="pop">submit button 2</a>
</form>
```
If... | Just put data transitions on the `<form>` tag.
```
<form action="login.php" method="post" data-transition="slideup" data-direction="reverse">
...your content form here...
</form>
```
Works even if your POST management page sets a location header to another page. |
30,963,429 | I have a problem with removing strings from a list of string I use this
```
(remove "lol" '("lol" "lol2" "lol")
```
but it returns the same list. What's the problem here? | 2015/06/21 | [
"https://Stackoverflow.com/questions/30963429",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4606560/"
] | You're running into the problem of trying to determine equality. I believe `remove` uses `eql` as its default equality tester. Unfortunately, two strings are not `eql` unless they're actually the same object.
Try:
```
`(remove "lol" '("lol" "lol2" "lol") :test #'equal)
```
Alternatively, if you know you will be tes... | You should close the ')'
So write : (remove "lol" '("lol" "lol2" "lol")**)** |
4,226,984 | I have the following code, converting dec. to binary (stored as an int) and it runs just fine in C::B :
```
for(i=0;i<8;i++)
{
carry = start_value%2;
tab[bla] = carry;
bla++;
start_value = start_value/2;
}
for(i=bla; i>0; i--)
{
binary = binary + tab[i]*pow(10,i);
}
```
B... | 2010/11/19 | [
"https://Stackoverflow.com/questions/4226984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/513734/"
] | No. Neither JDO or JPA would support such a thing. Obviously you could subclass the class and have the subclass for the amalgamated/processed data and store it in its own table | As an update, given that there are a number of ways of attempting to subclass or embed the data within another class, lots of which dont work very well (on GWT), here are two schema that do work. In the first the main features are that primary key is in base class, and the inheritance strategy is SUBCLASS\_TABLE. Note ... |
57,411,000 | For this toy model:
```
from keras.layers import Input, Dense, Reshape
from keras.models import Model
# this is the size of our encoded representations
compression = 10
input_img = Input(shape=(28,28, ), name= "28x28")
encoded = Dense(int(np.floor(28*28/compression)), activation='relu',
name= "enc... | 2019/08/08 | [
"https://Stackoverflow.com/questions/57411000",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4133063/"
] | React Navigation emits events to screen components that subscribe to them.
**componentDidMount:**
This method is called once all our children Elements and our Component instances are mounted onto the Native UI. When this method is called we now have access to the Native UI (DOM, UIView, etc.), access to our children r... | `componentDidMount` call first, but in the next time (back or something...) just `willFocus` call |
37,020,149 | This is my date difference to calculated days code and I have user date format of `yy-dd-mm` but I have changed my format to `dd-mm-yy`.so I have changed format code, but it is not working properly.
Please can anyone help with this?
```
<script>
var calculate = function() {
var from = document.getElementById("txtd... | 2016/05/04 | [
"https://Stackoverflow.com/questions/37020149",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6102306/"
] | you should use from.split('-') function to get date,month,year. Then create a new Date(year,month,date) for both from and to. newTo-newFrom gives the date difference between 2 date in milliseconds. Divide this difference by 1000 \* 3600 \* 24 to get the date difference in days
```
var diffDays = Math.ceil(timeDiff / (... | ```
<html>
<head>
<title></title>
</head>
<body>
<input type="text" id="txtdate" value="16-04-2016" />
<input type="text" id="txtdate1" value="24-05-2016" />
<input type="text" id="result" value="" />
<!-- dd-mm-yyyy -->
<script type="text/javascript">
var calculate = function() {
var from = document.getE... |
37,020,149 | This is my date difference to calculated days code and I have user date format of `yy-dd-mm` but I have changed my format to `dd-mm-yy`.so I have changed format code, but it is not working properly.
Please can anyone help with this?
```
<script>
var calculate = function() {
var from = document.getElementById("txtd... | 2016/05/04 | [
"https://Stackoverflow.com/questions/37020149",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6102306/"
] | Search n Replace these two lines of your code:
```
var fromdate = from.slice(3, 5);
var frommonth = from.slice(0, 2);
```
TO:
```
var fromdate = from.slice(0, 2);
var frommonth = from.slice(3, 5);
```
Search And replace thest two lines:
```
var todate = to.slice(3, 5);
var tomonth = to.slice(0, 2);
```
TO:... | you should use from.split('-') function to get date,month,year. Then create a new Date(year,month,date) for both from and to. newTo-newFrom gives the date difference between 2 date in milliseconds. Divide this difference by 1000 \* 3600 \* 24 to get the date difference in days
```
var diffDays = Math.ceil(timeDiff / (... |
37,020,149 | This is my date difference to calculated days code and I have user date format of `yy-dd-mm` but I have changed my format to `dd-mm-yy`.so I have changed format code, but it is not working properly.
Please can anyone help with this?
```
<script>
var calculate = function() {
var from = document.getElementById("txtd... | 2016/05/04 | [
"https://Stackoverflow.com/questions/37020149",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6102306/"
] | Search n Replace these two lines of your code:
```
var fromdate = from.slice(3, 5);
var frommonth = from.slice(0, 2);
```
TO:
```
var fromdate = from.slice(0, 2);
var frommonth = from.slice(3, 5);
```
Search And replace thest two lines:
```
var todate = to.slice(3, 5);
var tomonth = to.slice(0, 2);
```
TO:... | ```
<html>
<head>
<title></title>
</head>
<body>
<input type="text" id="txtdate" value="16-04-2016" />
<input type="text" id="txtdate1" value="24-05-2016" />
<input type="text" id="result" value="" />
<!-- dd-mm-yyyy -->
<script type="text/javascript">
var calculate = function() {
var from = document.getE... |
9,825,310 | I want to write an JUnit @Rule (version 4.10) to setup some objects (an Entity Manager) and make them available in the test, by "injecting" it into an variable.
Something like this:
```
public class MyTestClass() {
@Rule
MyEntityManagerInjectRule = new MyEntityManagerInjectRule():
//MyEntityManagerInjectRule ... | 2012/03/22 | [
"https://Stackoverflow.com/questions/9825310",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/280244/"
] | How about:
```
public class MyTestClass() {
@Rule
public TestRule MyEntityManagerInjectRule =
new MyEntityManagerInjectRule(this); // pass instance to constructor
//MyEntityManagerInjectRule "inject" the entity manager
EntityManger em;
@Test...
}
```
Just add the test class instance to the const... | There is a different approach: the rule provides the EntityManager instead of injecting it.
```
public class MyTestClass() {
@Rule
public MyEntityManagerRule rule = new MyEntityManagerRule();
@Test
public void firstTest() {
doSomethingWith(rule.getEntityManager());
}
}
``` |
9,825,310 | I want to write an JUnit @Rule (version 4.10) to setup some objects (an Entity Manager) and make them available in the test, by "injecting" it into an variable.
Something like this:
```
public class MyTestClass() {
@Rule
MyEntityManagerInjectRule = new MyEntityManagerInjectRule():
//MyEntityManagerInjectRule ... | 2012/03/22 | [
"https://Stackoverflow.com/questions/9825310",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/280244/"
] | The proper way to achieve that is to make your rule implement `org.junit.rules.MethodRule` (not `TestRule`). The `apply()` method of the `MethodRule` interface has a `target` argument, which **holds a reference to the current instance** of the test class (of course, it is a different instance each time a method is exec... | There is a different approach: the rule provides the EntityManager instead of injecting it.
```
public class MyTestClass() {
@Rule
public MyEntityManagerRule rule = new MyEntityManagerRule();
@Test
public void firstTest() {
doSomethingWith(rule.getEntityManager());
}
}
``` |
8,881,038 | I open up a notepad from my program using `Process.Start()` but the new opened notepad covers the screen. But I do want my application to maintain its focus.
I similarly (using the same Process.Start) open up MS Excel and Word but to get focus back to my form all I need to write is:
```
this.Focus();
```
But quirk ... | 2012/01/16 | [
"https://Stackoverflow.com/questions/8881038",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/661933/"
] | I had the same problem, i eventually wound up with programmatically calling alt-tab:
```
[DllImport("user32.dll")]
static extern bool PostMessage(IntPtr hWnd, UInt32 Msg, int wParam, int lParam);
private void alttab()
{
uint WM_SYSCOMMAND = 0x0112;
int SC_PREVWINDOW = 0xF050;
PostMessage(P... | Windows prevents apps from shoving their window into the user's face, you are seeing this at work. The exact rules when an app may steal the focus are documented in the MSDN docs for AllowSetForegroundWindow().
A back-door around this restriction is the AttachThreadInput() function. This code worked well, I did take a... |
8,881,038 | I open up a notepad from my program using `Process.Start()` but the new opened notepad covers the screen. But I do want my application to maintain its focus.
I similarly (using the same Process.Start) open up MS Excel and Word but to get focus back to my form all I need to write is:
```
this.Focus();
```
But quirk ... | 2012/01/16 | [
"https://Stackoverflow.com/questions/8881038",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/661933/"
] | I tried almost everything on internet (so sure about it :)). At best I could get my form on top of all other forms, but without focus (going by @Hans Passant's method). Going by heavy blocks of codes all over, I somehow felt this aint gonna be easy. So I always used `SetForegroundWindow()` with chunks of other code. Ne... | I had the same problem, i eventually wound up with programmatically calling alt-tab:
```
[DllImport("user32.dll")]
static extern bool PostMessage(IntPtr hWnd, UInt32 Msg, int wParam, int lParam);
private void alttab()
{
uint WM_SYSCOMMAND = 0x0112;
int SC_PREVWINDOW = 0xF050;
PostMessage(P... |
8,881,038 | I open up a notepad from my program using `Process.Start()` but the new opened notepad covers the screen. But I do want my application to maintain its focus.
I similarly (using the same Process.Start) open up MS Excel and Word but to get focus back to my form all I need to write is:
```
this.Focus();
```
But quirk ... | 2012/01/16 | [
"https://Stackoverflow.com/questions/8881038",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/661933/"
] | I had the same problem, i eventually wound up with programmatically calling alt-tab:
```
[DllImport("user32.dll")]
static extern bool PostMessage(IntPtr hWnd, UInt32 Msg, int wParam, int lParam);
private void alttab()
{
uint WM_SYSCOMMAND = 0x0112;
int SC_PREVWINDOW = 0xF050;
PostMessage(P... | Try this:
```
public partial class MainForm : Form
{
private ShowForm showForm;
public MainForm()
{
InitializeComponent();
}
private void showButton_Click(object sender, EventArgs e)
{
this.showForm = new ShowForm();
this.showForm.FormClosed += showForm_FormClosed;
... |
8,881,038 | I open up a notepad from my program using `Process.Start()` but the new opened notepad covers the screen. But I do want my application to maintain its focus.
I similarly (using the same Process.Start) open up MS Excel and Word but to get focus back to my form all I need to write is:
```
this.Focus();
```
But quirk ... | 2012/01/16 | [
"https://Stackoverflow.com/questions/8881038",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/661933/"
] | I tried almost everything on internet (so sure about it :)). At best I could get my form on top of all other forms, but without focus (going by @Hans Passant's method). Going by heavy blocks of codes all over, I somehow felt this aint gonna be easy. So I always used `SetForegroundWindow()` with chunks of other code. Ne... | Windows prevents apps from shoving their window into the user's face, you are seeing this at work. The exact rules when an app may steal the focus are documented in the MSDN docs for AllowSetForegroundWindow().
A back-door around this restriction is the AttachThreadInput() function. This code worked well, I did take a... |
8,881,038 | I open up a notepad from my program using `Process.Start()` but the new opened notepad covers the screen. But I do want my application to maintain its focus.
I similarly (using the same Process.Start) open up MS Excel and Word but to get focus back to my form all I need to write is:
```
this.Focus();
```
But quirk ... | 2012/01/16 | [
"https://Stackoverflow.com/questions/8881038",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/661933/"
] | Windows prevents apps from shoving their window into the user's face, you are seeing this at work. The exact rules when an app may steal the focus are documented in the MSDN docs for AllowSetForegroundWindow().
A back-door around this restriction is the AttachThreadInput() function. This code worked well, I did take a... | Try this:
```
public partial class MainForm : Form
{
private ShowForm showForm;
public MainForm()
{
InitializeComponent();
}
private void showButton_Click(object sender, EventArgs e)
{
this.showForm = new ShowForm();
this.showForm.FormClosed += showForm_FormClosed;
... |
8,881,038 | I open up a notepad from my program using `Process.Start()` but the new opened notepad covers the screen. But I do want my application to maintain its focus.
I similarly (using the same Process.Start) open up MS Excel and Word but to get focus back to my form all I need to write is:
```
this.Focus();
```
But quirk ... | 2012/01/16 | [
"https://Stackoverflow.com/questions/8881038",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/661933/"
] | If you want to start a process and focus back to the form, then start that process with minimized state, like this:
```
Dim psi As New ProcessStartInfo("notepad")
psi.WindowStyle = ProcessWindowStyle.Minimized
Process.Start(psi)
``` | Windows prevents apps from shoving their window into the user's face, you are seeing this at work. The exact rules when an app may steal the focus are documented in the MSDN docs for AllowSetForegroundWindow().
A back-door around this restriction is the AttachThreadInput() function. This code worked well, I did take a... |
8,881,038 | I open up a notepad from my program using `Process.Start()` but the new opened notepad covers the screen. But I do want my application to maintain its focus.
I similarly (using the same Process.Start) open up MS Excel and Word but to get focus back to my form all I need to write is:
```
this.Focus();
```
But quirk ... | 2012/01/16 | [
"https://Stackoverflow.com/questions/8881038",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/661933/"
] | I tried almost everything on internet (so sure about it :)). At best I could get my form on top of all other forms, but without focus (going by @Hans Passant's method). Going by heavy blocks of codes all over, I somehow felt this aint gonna be easy. So I always used `SetForegroundWindow()` with chunks of other code. Ne... | Try this:
```
public partial class MainForm : Form
{
private ShowForm showForm;
public MainForm()
{
InitializeComponent();
}
private void showButton_Click(object sender, EventArgs e)
{
this.showForm = new ShowForm();
this.showForm.FormClosed += showForm_FormClosed;
... |
8,881,038 | I open up a notepad from my program using `Process.Start()` but the new opened notepad covers the screen. But I do want my application to maintain its focus.
I similarly (using the same Process.Start) open up MS Excel and Word but to get focus back to my form all I need to write is:
```
this.Focus();
```
But quirk ... | 2012/01/16 | [
"https://Stackoverflow.com/questions/8881038",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/661933/"
] | I tried almost everything on internet (so sure about it :)). At best I could get my form on top of all other forms, but without focus (going by @Hans Passant's method). Going by heavy blocks of codes all over, I somehow felt this aint gonna be easy. So I always used `SetForegroundWindow()` with chunks of other code. Ne... | If you want to start a process and focus back to the form, then start that process with minimized state, like this:
```
Dim psi As New ProcessStartInfo("notepad")
psi.WindowStyle = ProcessWindowStyle.Minimized
Process.Start(psi)
``` |
8,881,038 | I open up a notepad from my program using `Process.Start()` but the new opened notepad covers the screen. But I do want my application to maintain its focus.
I similarly (using the same Process.Start) open up MS Excel and Word but to get focus back to my form all I need to write is:
```
this.Focus();
```
But quirk ... | 2012/01/16 | [
"https://Stackoverflow.com/questions/8881038",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/661933/"
] | If you want to start a process and focus back to the form, then start that process with minimized state, like this:
```
Dim psi As New ProcessStartInfo("notepad")
psi.WindowStyle = ProcessWindowStyle.Minimized
Process.Start(psi)
``` | Try this:
```
public partial class MainForm : Form
{
private ShowForm showForm;
public MainForm()
{
InitializeComponent();
}
private void showButton_Click(object sender, EventArgs e)
{
this.showForm = new ShowForm();
this.showForm.FormClosed += showForm_FormClosed;
... |
187,599 | There's a lot of talk generally about backing up, and a lot of confusion around System and Data backups.
I'd like these questions to be considered in the context of Mac only, so any advice on tool would be great.
I myself am confused about what strategies to take... a few questions:
----------------------------------... | 2010/09/12 | [
"https://superuser.com/questions/187599",
"https://superuser.com",
"https://superuser.com/users/49099/"
] | This is based on Windows, the questions you asked are general about computers so I think what I write will apply to you. There is nothing special in this regard to a mac.
First part of your question
---------------------------
1. Backing up data is generally what you want for just recovering documents, and the import... | Nice work Wil. I wanted to add some Mac OS X specific things though.
**Part 1: Data versus the whole system?**
I would simply look at the practical implications. Disk space is cheap. Time is costly and not replaceable.
A full system backup with the Time Machine feature in OS X will make recovery very simple in the c... |
14,790,432 | Jquery UI autocomplete opens when you typed a letter in the input text area that matches a list of selections of the source object and close after making a selection from the list of selections using the enter key or close if the text you typed in is not in the list of selections.
How do I check when the autocomplete ... | 2013/02/09 | [
"https://Stackoverflow.com/questions/14790432",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1000116/"
] | You can use [delete](http://www.ruby-doc.org/core-1.9.3/Hash.html#method-i-delete) method
```
@members = params[:project].delete(:members)
@project = Project.new(params[:project])
``` | You have at least two options for this.
1) Ignore the members key when you initialize the Project
```
@members = params[:project][:members]
@project = Project.new(params[:project].except(:members))
```
2) Delete the members key from the params object
```
@members = params[:project].delete(:members)
@project = Proj... |
14,790,432 | Jquery UI autocomplete opens when you typed a letter in the input text area that matches a list of selections of the source object and close after making a selection from the list of selections using the enter key or close if the text you typed in is not in the list of selections.
How do I check when the autocomplete ... | 2013/02/09 | [
"https://Stackoverflow.com/questions/14790432",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1000116/"
] | You can use [delete](http://www.ruby-doc.org/core-1.9.3/Hash.html#method-i-delete) method
```
@members = params[:project].delete(:members)
@project = Project.new(params[:project])
``` | You can do something like :
```
before_filter :edit_params_hash, :only => [:create]
def edit_params_hash
@members = params[:projects][:members] if params[:projects][:members].present?
params[:projects][:members] ||= nil
end
```
and then in create use
```
def create
@project = Project.new(params... |
14,790,432 | Jquery UI autocomplete opens when you typed a letter in the input text area that matches a list of selections of the source object and close after making a selection from the list of selections using the enter key or close if the text you typed in is not in the list of selections.
How do I check when the autocomplete ... | 2013/02/09 | [
"https://Stackoverflow.com/questions/14790432",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1000116/"
] | You have at least two options for this.
1) Ignore the members key when you initialize the Project
```
@members = params[:project][:members]
@project = Project.new(params[:project].except(:members))
```
2) Delete the members key from the params object
```
@members = params[:project].delete(:members)
@project = Proj... | You can do something like :
```
before_filter :edit_params_hash, :only => [:create]
def edit_params_hash
@members = params[:projects][:members] if params[:projects][:members].present?
params[:projects][:members] ||= nil
end
```
and then in create use
```
def create
@project = Project.new(params... |
3,428,691 | I'm trying to make resizable UIViews of which users can resize (code is done for that) and drag it around. Now I need to make it look like what it looks like in IB, with circles at its corners to drag, and dotted lines as borders of the UIView.
How do you think I should go about doing this?
Many thanks. | 2010/08/07 | [
"https://Stackoverflow.com/questions/3428691",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/338926/"
] | The proper way to do that is to override the `drawRect:` method of the UIView subclass (your draggable views in this case.)
>
> When you subclass UIView to create a custom class that draws itself, implement the drawRect: method to draw the view within the specified region. This method is invoked the first time a view... | I know this question is pretty old, but I wrote a custom control to achieve exactly this. Someone else who happens upon this question may find it useful: <https://github.com/spoletto/SPUserResizableView>
 |
1,159,060 | Hi Everyone – I am planning to upgrade my dual boot Ubuntu 16.04LTS/Win 10 system to 18.04LTS /Win10 and would love some opinions. My main drive is a 1TB SSD and my data drives are 2 8TB HDD’s running in RAID1 configuration. I use Ubuntu chiefly for deep learning research with Tensorflow and Pytorch on large(r) Medical... | 2019/07/17 | [
"https://askubuntu.com/questions/1159060",
"https://askubuntu.com",
"https://askubuntu.com/users/808514/"
] | * 100 GB for `/` is *a lot!* Unless you use a lot of huge temp files, this is going to be overkill. 64GB is double of what a typical system needs and I have allocated 48GB because the largest `tmp` file I ever created was 24GB.
```
df --human-readable | grep --invert-match "/loop"
Filesystem Si... | Unallocated SSD space for provisioning
--------------------------------------
Addressing this part of the question:
>
> Plans are to shrink my Windows ntfs partitions down to 450 GB, and
> expand the Ubuntu ext4 partitions up to 500 GB, leaving 50GB
> unallocated. I read that it is helpful not to allocate SSD’s full... |
59,593,841 | In the Thermal Power Library from Modelon, there are two kinds of connectors: flow connector and volume connector.
Based on the tutorial shipped with the library, these two kinds of connectors should NOT be connected with the same kind of connector.
But I checked their code, it seems the codes are the same.
I checked ... | 2020/01/04 | [
"https://Stackoverflow.com/questions/59593841",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12160919/"
] | Here is a very short and simplified explanation applying to thermo-hydraulic systems.
In `flow models` (pipes, valves etc.) enthalpy is unchanged and mass flow/pressure drop are related with a static equation.
In `volume models` pressure and enthalpy are dynamic state variables, that is, mass and energy conservation ... | These kind of connectors are indeed the same due to modelica language specification. You can only connect two connectors that are *interchangeable*, that have the exact same amount and type of flow and potential variables. At every node all flows have to sum up to zero and all potentials have to be the same, therefore ... |
21,910,547 | I have a recipe in chef, which I want to use multiple times (in multiple roles), only with a few parameters different. I want to be able to use multiple such roles on the same node.
How can I "parameterize" the recipe? I can't use attributes, because those are on node, so one role would override another's attributes. | 2014/02/20 | [
"https://Stackoverflow.com/questions/21910547",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/121595/"
] | Recommended approach in this case is to use a lightweight resource provider or similar.
I think when the runlist is converged it dedupes any recipes so if you had 6 roles all including the same recipe and added each role to the runlist it would only actually run that recipe once.
[Seems like someone asked opscode thi... | I found this answer very useful in helping me with a similar use case. I wanted to share a simple example of creating an object to iterate over that PatrickWalker refers to ("...build some sort of object that represents the instances.. and loop..."). I hope this may help someone.
1. Create an attribute with a value wh... |
30,978 | I figure any definition for a word boundary is probably somewhat fuzzy. However, I thought, instead of banging my head against the wall trying to come with an ad-hoc solution, I would throw this out there.
Identifying word boundaries in English is, generally speaking, not a big deal: the / big / house / etc. If I wer... | 2019/03/27 | [
"https://linguistics.stackexchange.com/questions/30978",
"https://linguistics.stackexchange.com",
"https://linguistics.stackexchange.com/users/19727/"
] | The question relies on a number of unidentified assumptions about word boundaries, which are not totally alien but also are not obvious or obviously right. The main problem I see is the premise that there is this one thing, word boundary, that solves myriad problems.
The notion of there being a single "phonological tr... | I thought recently, that it would be pragmatic to treat words strictly as phrases. A word can appear in a single-word phrase. Theoretically, any word could be the answer to the question for the signet described by any appropriate definition. That test would be a circular definition, if asking "what's the word". Omittin... |
73,558,372 | 1. Can not extract resource from com.android.aaptcompiler.ParsedResource@ef79973.
2. Can not extract resource from com.android.aaptcompiler.ParsedResource@4c95ce87.
C:\Users\User.gradle\caches\transforms-3\4948de165b5218454019e0897afa16ee\transformed\material-1.6.1\res\values\values.xml:829:4: inner element must eithe... | 2022/08/31 | [
"https://Stackoverflow.com/questions/73558372",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19813518/"
] | I got the same issue because i had in string resource a ' character and i had to change to \' | In my case there was an issue in the strings.xml file. I had created a plurals with two items in in with the same quantity of "one". The error was resolved for me as soon as I fixed it.
```
<plurals name="some_key">
<item quantity="one">Singular</item>
<item quantity="one">Other</item> <!-- I had repeated this qua... |
73,558,372 | 1. Can not extract resource from com.android.aaptcompiler.ParsedResource@ef79973.
2. Can not extract resource from com.android.aaptcompiler.ParsedResource@4c95ce87.
C:\Users\User.gradle\caches\transforms-3\4948de165b5218454019e0897afa16ee\transformed\material-1.6.1\res\values\values.xml:829:4: inner element must eithe... | 2022/08/31 | [
"https://Stackoverflow.com/questions/73558372",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19813518/"
] | I got the same issue because i had in string resource a ' character and i had to change to \' | check your values directory,
I got the same issue, and the problem was in themes.xml.
You'll find exactly where is the issue located in the build output |
73,558,372 | 1. Can not extract resource from com.android.aaptcompiler.ParsedResource@ef79973.
2. Can not extract resource from com.android.aaptcompiler.ParsedResource@4c95ce87.
C:\Users\User.gradle\caches\transforms-3\4948de165b5218454019e0897afa16ee\transformed\material-1.6.1\res\values\values.xml:829:4: inner element must eithe... | 2022/08/31 | [
"https://Stackoverflow.com/questions/73558372",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19813518/"
] | I got the same issue because i had in string resource a ' character and i had to change to \' | Usually these type of errors occurred when you try to add a string or any other resource with the same name that was already exist. e.g. If you have a string resource named 'alpha' ABCDEF in strings.xml file and if you are trying to extract another string e.g. "aeiou" and giving the same name 'alpha' that was already e... |
20,369,333 | Say I want to implement a simple NoSql database containing a list of users. I want both the username and the email of the user to be unique. Which NoSql database can achieve this. | 2013/12/04 | [
"https://Stackoverflow.com/questions/20369333",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3064734/"
] | This solution is valid in MongoDB.
You need to put a [unique index](http://docs.mongodb.org/manual/tutorial/create-a-unique-index/) on these fields:
```
db.collection.ensureIndex({
username: 1,
email : 1
}, {
unique: true
})
```
Whenever you try to add a document with a username and email combination that alr... | you can user the incr command on a key in redis .
you will have something like thing like this
```
127.0.0.1:6379> INCR key
(integer) 1
127.0.0.1:6379> INCR key
(integer) 2
127.0.0.1:6379> INCR key
(integer) 3
127.0.0.1:6379> INCR key
(integer) 4
```
redis is very interressing database who can manage cache (like mem... |
20,369,333 | Say I want to implement a simple NoSql database containing a list of users. I want both the username and the email of the user to be unique. Which NoSql database can achieve this. | 2013/12/04 | [
"https://Stackoverflow.com/questions/20369333",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3064734/"
] | This solution is valid in MongoDB.
You need to put a [unique index](http://docs.mongodb.org/manual/tutorial/create-a-unique-index/) on these fields:
```
db.collection.ensureIndex({
username: 1,
email : 1
}, {
unique: true
})
```
Whenever you try to add a document with a username and email combination that alr... | In Dynamo you can't, at least in a direct way. That's up to your model. For example, if your key is the username, and the range key is the email, you will be able to do it. However, if one of these fields are in the value, you won't be able to achieve uniqueness |
20,369,333 | Say I want to implement a simple NoSql database containing a list of users. I want both the username and the email of the user to be unique. Which NoSql database can achieve this. | 2013/12/04 | [
"https://Stackoverflow.com/questions/20369333",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3064734/"
] | In Dynamo you can't, at least in a direct way. That's up to your model. For example, if your key is the username, and the range key is the email, you will be able to do it. However, if one of these fields are in the value, you won't be able to achieve uniqueness | you can user the incr command on a key in redis .
you will have something like thing like this
```
127.0.0.1:6379> INCR key
(integer) 1
127.0.0.1:6379> INCR key
(integer) 2
127.0.0.1:6379> INCR key
(integer) 3
127.0.0.1:6379> INCR key
(integer) 4
```
redis is very interressing database who can manage cache (like mem... |
16,317,929 | I have this Javascript variable :
```
var Item_properties = {
id : null,
keys : [],
hydrate: function() {
//get data
this.id = $('input[id=id]').val();
$("#item_key div input").each(function(index) {
this.keys.push($(this).val());
});
}
```
It is impossible to push any... | 2013/05/01 | [
"https://Stackoverflow.com/questions/16317929",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2339238/"
] | jQuery sets `this` to the DOM element in the callback to `.each`. You can save `this` into a variable and then use it.
```
var self = this;
$("#item_key div input").each(function(index) {
self.keys.push($(this).val()));
}
``` | Try like this:
```
var $this = this;
$("#item_key div input").each(function (index) {
$this.keys.push($(this).val());
});
```
Your code didn't worked since the `this` inside the each loop was actually reference to the input tag. But you need to reference the **Item\_properties** here. |
16,317,929 | I have this Javascript variable :
```
var Item_properties = {
id : null,
keys : [],
hydrate: function() {
//get data
this.id = $('input[id=id]').val();
$("#item_key div input").each(function(index) {
this.keys.push($(this).val());
});
}
```
It is impossible to push any... | 2013/05/01 | [
"https://Stackoverflow.com/questions/16317929",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2339238/"
] | jQuery sets `this` to the DOM element in the callback to `.each`. You can save `this` into a variable and then use it.
```
var self = this;
$("#item_key div input").each(function(index) {
self.keys.push($(this).val()));
}
``` | While [two](https://stackoverflow.com/a/16317950/887149) other [answers](https://stackoverflow.com/a/16317947/887149) are ok, here is another way to do it.
You can use
```
Item_properties.keys.push($(this).val());
```
Instead of
```
this.keys.push($(this).val());
``` |
16,317,929 | I have this Javascript variable :
```
var Item_properties = {
id : null,
keys : [],
hydrate: function() {
//get data
this.id = $('input[id=id]').val();
$("#item_key div input").each(function(index) {
this.keys.push($(this).val());
});
}
```
It is impossible to push any... | 2013/05/01 | [
"https://Stackoverflow.com/questions/16317929",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2339238/"
] | Try like this:
```
var $this = this;
$("#item_key div input").each(function (index) {
$this.keys.push($(this).val());
});
```
Your code didn't worked since the `this` inside the each loop was actually reference to the input tag. But you need to reference the **Item\_properties** here. | While [two](https://stackoverflow.com/a/16317950/887149) other [answers](https://stackoverflow.com/a/16317947/887149) are ok, here is another way to do it.
You can use
```
Item_properties.keys.push($(this).val());
```
Instead of
```
this.keys.push($(this).val());
``` |
32,065,784 | I'm trying to change the layout page based on a cookie so i tried doing this:
```
function LoggedOrNot()
{
@if (Page.User.Identity.IsAuthenticated)
{
var x = document.cookie;
document.getElementByID("signupbutton").innerHTML = x;
}
}
```
but it's not recognizi... | 2015/08/18 | [
"https://Stackoverflow.com/questions/32065784",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4723854/"
] | That's because Razor thinks you're still writing C# code. Use `<text>` to tag it as plain text:
```
function LoggedOrNot()
{
@if (Page.User.Identity.IsAuthenticated)
{
<text>var x = document.cookie;
document.getElementByID("signupbutton").innerHTML = x;</text>
}
}
``` | You should wrap it in text tags.
```
<text>var x = document.cookie; document.getElementByID("signupbutton").innerHTML = x</text>
```
This is because here you define a block of razor code and the ViewEngine, when try to execute the View see this like a c# command. Apparently, in this context there isn't any variable ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.