qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
21,833,584 | When using [jQuery DataTables](https://datatables.net/) is it possible to do accent-insensitive searches when using the filter? For instance, when I put the 'e' character, I'd like to search every word with 'e' or 'é', 'è'.
Something that came to mind is normalizing the strings and putting them into a separate, hidden... | 2014/02/17 | [
"https://Stackoverflow.com/questions/21833584",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1086938/"
] | In this [topic](http://datatables.net/forums/discussion/18763/key-problems-with-accent-spanish/p1) explain this issuse, the trick is to replace *strange characters* with a *normal character* (no accent character). So to speak way.
```
$.fn.DataTable.ext.type.search.string = function ( data ) {
return ! data ?
... | Additional feedback on column filtering : the comments above will only work if the column to filter is of type "string" (the DataTables column type defined [here](https://datatables.net/reference/option/columns.type)).
If the column contains HTML tags, the DataTables lib will automagically tag it as "html" type, and ... |
21,833,584 | When using [jQuery DataTables](https://datatables.net/) is it possible to do accent-insensitive searches when using the filter? For instance, when I put the 'e' character, I'd like to search every word with 'e' or 'é', 'è'.
Something that came to mind is normalizing the strings and putting them into a separate, hidden... | 2014/02/17 | [
"https://Stackoverflow.com/questions/21833584",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1086938/"
] | You are **so** close in your edit, what you have tried, except that you lack the must important thing : *Defining the "scope" or sType of your filter plugin*. The function is never called, right? This is because the plugin is not associated with a `sType`.
To get your code to work simply declare the plugin like this :... | In this [topic](http://datatables.net/forums/discussion/18763/key-problems-with-accent-spanish/p1) explain this issuse, the trick is to replace *strange characters* with a *normal character* (no accent character). So to speak way.
```
$.fn.DataTable.ext.type.search.string = function ( data ) {
return ! data ?
... |
490,649 | If I have n files in a directory, for example;
```
a
b
c
```
How do I get pairwise combinations of these files (non-directional) to pass to a function?
The expected output is
```
a-b
a-c
b-c
```
so that it can be passed to a function like
```
fn -file1 a -file2 b
fn -file1 a -file2 c
...
```
---
This is what... | 2018/12/23 | [
"https://unix.stackexchange.com/questions/490649",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/165231/"
] | Put the file names in an array and run through it manually with two loops.
You get each pairing only once if if *j < i* where *i* and *j* are the indexes used in the outer and the inner loop, respectively.
```
$ touch a b c d
$ f=(*)
$ for ((i = 0; i < ${#f[@]}; i++)); do
for ((j = i + 1; j < ${#f[@]}; j++)); ... | With `join` trick for filenames without whitespace(s):
Sample list of files:
```
$ ls *.json | head -4
1.json
2.json
comp.json
conf.json
```
---
```
$ join -j9999 -o1.1,2.1 <(ls *.json | head -4) <(ls *.json | head -4) | awk '$1 != $2'
1.json 2.json
1.json comp.json
1.json conf.json
2.json 1.json
2.json comp.json
... |
490,649 | If I have n files in a directory, for example;
```
a
b
c
```
How do I get pairwise combinations of these files (non-directional) to pass to a function?
The expected output is
```
a-b
a-c
b-c
```
so that it can be passed to a function like
```
fn -file1 a -file2 b
fn -file1 a -file2 c
...
```
---
This is what... | 2018/12/23 | [
"https://unix.stackexchange.com/questions/490649",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/165231/"
] | You're very close in your script, but you want to remove duplicates; i.e a-b is considered a duplicate of b-a.
We can use an inequality to handle this; only display the filename if the first file comes before the second file alphabetically. This will ensure only one of each matches.
```
for i in *.txt
do
for j in *... | With `join` trick for filenames without whitespace(s):
Sample list of files:
```
$ ls *.json | head -4
1.json
2.json
comp.json
conf.json
```
---
```
$ join -j9999 -o1.1,2.1 <(ls *.json | head -4) <(ls *.json | head -4) | awk '$1 != $2'
1.json 2.json
1.json comp.json
1.json conf.json
2.json 1.json
2.json comp.json
... |
490,649 | If I have n files in a directory, for example;
```
a
b
c
```
How do I get pairwise combinations of these files (non-directional) to pass to a function?
The expected output is
```
a-b
a-c
b-c
```
so that it can be passed to a function like
```
fn -file1 a -file2 b
fn -file1 a -file2 c
...
```
---
This is what... | 2018/12/23 | [
"https://unix.stackexchange.com/questions/490649",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/165231/"
] | With `join` trick for filenames without whitespace(s):
Sample list of files:
```
$ ls *.json | head -4
1.json
2.json
comp.json
conf.json
```
---
```
$ join -j9999 -o1.1,2.1 <(ls *.json | head -4) <(ls *.json | head -4) | awk '$1 != $2'
1.json 2.json
1.json comp.json
1.json conf.json
2.json 1.json
2.json comp.json
... | ```
for i in *.txt ; do
for j in *.txt ; do
if [ "$i" '<' "$j" ] ; then
echo "Pairs $i and $j"
fi
done
done
``` |
490,649 | If I have n files in a directory, for example;
```
a
b
c
```
How do I get pairwise combinations of these files (non-directional) to pass to a function?
The expected output is
```
a-b
a-c
b-c
```
so that it can be passed to a function like
```
fn -file1 a -file2 b
fn -file1 a -file2 c
...
```
---
This is what... | 2018/12/23 | [
"https://unix.stackexchange.com/questions/490649",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/165231/"
] | Put the file names in an array and run through it manually with two loops.
You get each pairing only once if if *j < i* where *i* and *j* are the indexes used in the outer and the inner loop, respectively.
```
$ touch a b c d
$ f=(*)
$ for ((i = 0; i < ${#f[@]}; i++)); do
for ((j = i + 1; j < ${#f[@]}; j++)); ... | You're very close in your script, but you want to remove duplicates; i.e a-b is considered a duplicate of b-a.
We can use an inequality to handle this; only display the filename if the first file comes before the second file alphabetically. This will ensure only one of each matches.
```
for i in *.txt
do
for j in *... |
490,649 | If I have n files in a directory, for example;
```
a
b
c
```
How do I get pairwise combinations of these files (non-directional) to pass to a function?
The expected output is
```
a-b
a-c
b-c
```
so that it can be passed to a function like
```
fn -file1 a -file2 b
fn -file1 a -file2 c
...
```
---
This is what... | 2018/12/23 | [
"https://unix.stackexchange.com/questions/490649",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/165231/"
] | Put the file names in an array and run through it manually with two loops.
You get each pairing only once if if *j < i* where *i* and *j* are the indexes used in the outer and the inner loop, respectively.
```
$ touch a b c d
$ f=(*)
$ for ((i = 0; i < ${#f[@]}; i++)); do
for ((j = i + 1; j < ${#f[@]}; j++)); ... | ```
for i in *.txt ; do
for j in *.txt ; do
if [ "$i" '<' "$j" ] ; then
echo "Pairs $i and $j"
fi
done
done
``` |
490,649 | If I have n files in a directory, for example;
```
a
b
c
```
How do I get pairwise combinations of these files (non-directional) to pass to a function?
The expected output is
```
a-b
a-c
b-c
```
so that it can be passed to a function like
```
fn -file1 a -file2 b
fn -file1 a -file2 c
...
```
---
This is what... | 2018/12/23 | [
"https://unix.stackexchange.com/questions/490649",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/165231/"
] | You're very close in your script, but you want to remove duplicates; i.e a-b is considered a duplicate of b-a.
We can use an inequality to handle this; only display the filename if the first file comes before the second file alphabetically. This will ensure only one of each matches.
```
for i in *.txt
do
for j in *... | ```
for i in *.txt ; do
for j in *.txt ; do
if [ "$i" '<' "$j" ] ; then
echo "Pairs $i and $j"
fi
done
done
``` |
1,519,503 | On the Android-x86 [download page](https://osdn.net/projects/android-x86/releases/71931), the following are listed. What is the difference between these? And which one to download to install on, for e.g., an Intel-based PC (i5)? Thank you very much.
```
android-x86-9.0-rc2.i686.rpm
android-x86-9.0-rc2.iso
android-x8... | 2020/01/23 | [
"https://superuser.com/questions/1519503",
"https://superuser.com",
"https://superuser.com/users/1009802/"
] | Naming: (android-x86)-(android\_version)-(release\_version)\_(cpu\_architecture or Kernel Version).rpm
i686 = 32 Bit
x86\_64 = 64 Bit
k49 = Android Kernel 4.9 | ### What is the difference between these?
>
> **Released Files**
>
>
> This release contains five files. You can choose one of these files
> depends on your devices. Most modern devices should be able to run the
> 64-bit ISO. For older devices with legacy BIOS, you may try the 32-bit
> ISO.
>
>
> * 64-bit ISO: an... |
15,416,108 | *JSF-2.0, Mojarra 2.1.19, PrimeFaces 3.4.1*
I know that we can add an image to button through defining our own css class like:
```
.imageButton {
background-image:url(#{resource['images/button.png']});
}
```
But the problem is, picture url is coming from the bean and it has different value for each user, so givin... | 2013/03/14 | [
"https://Stackoverflow.com/questions/15416108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1659451/"
] | Well it seems you want to load a detailview when user selects a cell and you want the user to be able go back to the previously view when back or some button like that is pressed. You need to use navigation controller for that. Here is the link to apple's doc <http://developer.apple.com/library/ios/ipad/#documentation/... | In your `SubMainViewController` you need to dismiss the your current viewcontroller using
```
[self.presentingViewController dismissViewControllerAnimated:YES completion:nil];
``` |
27,067,614 | Trying to use python to control numerous compiled executables, but running into timeline issues! I need to be able to run two executables simultaneously, and also be able to 'wait' until an executable has finished prior to starting another one. Also, some of them require superuser. Here is what I have so far:
```
impo... | 2014/11/21 | [
"https://Stackoverflow.com/questions/27067614",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4194793/"
] | You can do this more easily with `$watch`, which is designed for this purpose.
In your controller:
```
$scope.$watch('payment.type', function (newVal, oldVal) {
$scope.payment_input = 0;
// anything else you want to do when the payment type is changed
})
```
Now whenever `payment.type` is changed, these lines w... | You need to use `ng-show` instead of `ng-if` for input element `container` because the following reason
>
> The ngIf directive removes or recreates a portion of the DOM tree
> based on an {expression}. If the expression assigned to ngIf evaluates
> to a false value then the element is removed from the DOM, otherwis... |
139,496 | The only thing we seem to know about it so far is that it involved rathtars, as The Force Awakens and Wookieepedia say. But is there anything else about it in canon or legends? I get the impression that Finn either witnessed it or knew somebody who witnessed it, as he is shocked to learn that Han Solo is hauling rathta... | 2016/09/02 | [
"https://scifi.stackexchange.com/questions/139496",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/70161/"
] | **We don't know.** It's only mentioned in the film (and the subsequent novelisations) as a [*noodle incident*](http://tvtropes.org/pmwiki/pmwiki.php/Main/NoodleIncident). Evidently a single(?) rathtar caused a significant loss of life, probably somewhere called Trillia. It was a "massacre", if you feel like getting flo... | I don't think Finn was personally involved. Id rather say its a widely known event and everyone talks about it with fear. Kind of like 9/11 or Sandy Hook. Either way the way its told the event seems to have a lot of weight, like maybe after the massacre the creature became illegal to own. I loved that throw away line t... |
139,496 | The only thing we seem to know about it so far is that it involved rathtars, as The Force Awakens and Wookieepedia say. But is there anything else about it in canon or legends? I get the impression that Finn either witnessed it or knew somebody who witnessed it, as he is shocked to learn that Han Solo is hauling rathta... | 2016/09/02 | [
"https://scifi.stackexchange.com/questions/139496",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/70161/"
] | **We don't know.** It's only mentioned in the film (and the subsequent novelisations) as a [*noodle incident*](http://tvtropes.org/pmwiki/pmwiki.php/Main/NoodleIncident). Evidently a single(?) rathtar caused a significant loss of life, probably somewhere called Trillia. It was a "massacre", if you feel like getting flo... | I don't know what happend but the best answer is that a bunch of rathtars got loose and killed a whole bunch of people. |
139,496 | The only thing we seem to know about it so far is that it involved rathtars, as The Force Awakens and Wookieepedia say. But is there anything else about it in canon or legends? I get the impression that Finn either witnessed it or knew somebody who witnessed it, as he is shocked to learn that Han Solo is hauling rathta... | 2016/09/02 | [
"https://scifi.stackexchange.com/questions/139496",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/70161/"
] | **We don't know.** It's only mentioned in the film (and the subsequent novelisations) as a [*noodle incident*](http://tvtropes.org/pmwiki/pmwiki.php/Main/NoodleIncident). Evidently a single(?) rathtar caused a significant loss of life, probably somewhere called Trillia. It was a "massacre", if you feel like getting flo... | It appears to have been trillions of people that got killed because someone either purposely or accidently let loose Rathars to kill people and it became a wide world story. |
139,496 | The only thing we seem to know about it so far is that it involved rathtars, as The Force Awakens and Wookieepedia say. But is there anything else about it in canon or legends? I get the impression that Finn either witnessed it or knew somebody who witnessed it, as he is shocked to learn that Han Solo is hauling rathta... | 2016/09/02 | [
"https://scifi.stackexchange.com/questions/139496",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/70161/"
] | **We don't know.** It's only mentioned in the film (and the subsequent novelisations) as a [*noodle incident*](http://tvtropes.org/pmwiki/pmwiki.php/Main/NoodleIncident). Evidently a single(?) rathtar caused a significant loss of life, probably somewhere called Trillia. It was a "massacre", if you feel like getting flo... | I feel like someone done something wrong like a Jedi that let the rathtars out so all the Jedi fought the rathtars the rathtars killed Jedi and even people so the trillia massacre is a massacre of psycho creatures.
"from Star Wars" |
139,496 | The only thing we seem to know about it so far is that it involved rathtars, as The Force Awakens and Wookieepedia say. But is there anything else about it in canon or legends? I get the impression that Finn either witnessed it or knew somebody who witnessed it, as he is shocked to learn that Han Solo is hauling rathta... | 2016/09/02 | [
"https://scifi.stackexchange.com/questions/139496",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/70161/"
] | I don't think Finn was personally involved. Id rather say its a widely known event and everyone talks about it with fear. Kind of like 9/11 or Sandy Hook. Either way the way its told the event seems to have a lot of weight, like maybe after the massacre the creature became illegal to own. I loved that throw away line t... | I don't know what happend but the best answer is that a bunch of rathtars got loose and killed a whole bunch of people. |
139,496 | The only thing we seem to know about it so far is that it involved rathtars, as The Force Awakens and Wookieepedia say. But is there anything else about it in canon or legends? I get the impression that Finn either witnessed it or knew somebody who witnessed it, as he is shocked to learn that Han Solo is hauling rathta... | 2016/09/02 | [
"https://scifi.stackexchange.com/questions/139496",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/70161/"
] | I don't think Finn was personally involved. Id rather say its a widely known event and everyone talks about it with fear. Kind of like 9/11 or Sandy Hook. Either way the way its told the event seems to have a lot of weight, like maybe after the massacre the creature became illegal to own. I loved that throw away line t... | It appears to have been trillions of people that got killed because someone either purposely or accidently let loose Rathars to kill people and it became a wide world story. |
139,496 | The only thing we seem to know about it so far is that it involved rathtars, as The Force Awakens and Wookieepedia say. But is there anything else about it in canon or legends? I get the impression that Finn either witnessed it or knew somebody who witnessed it, as he is shocked to learn that Han Solo is hauling rathta... | 2016/09/02 | [
"https://scifi.stackexchange.com/questions/139496",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/70161/"
] | I don't think Finn was personally involved. Id rather say its a widely known event and everyone talks about it with fear. Kind of like 9/11 or Sandy Hook. Either way the way its told the event seems to have a lot of weight, like maybe after the massacre the creature became illegal to own. I loved that throw away line t... | I feel like someone done something wrong like a Jedi that let the rathtars out so all the Jedi fought the rathtars the rathtars killed Jedi and even people so the trillia massacre is a massacre of psycho creatures.
"from Star Wars" |
45,049,213 | I am new to Angular2 and trying to develop an application from the scratch. In that application, I would need to extensively use controls like Scheduler, Grids, Charts along with other controls.
I have been looking into google and came across Syncfusion, Kendo UI, DevExtreme etc but unable to come to conclusive solutio... | 2017/07/12 | [
"https://Stackoverflow.com/questions/45049213",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1355299/"
] | You can use Syncfusion's next generation JavaScript components. [Essential JS 2](https://www.syncfusion.com/products/essential-js2)
These components are fully developed in TypeScript and has full native support for Angular features like Ahead Of Compilation and Tree-Shaking. Using tree-shaking you can exclude the unus... | Use Primeng along with angular2 material components as both are compatible. Both has very good documentation, supports lazy loading and customizing the components is just of matter of changing css.
Please refer to the links below :
<https://www.primefaces.org/primeng/#/>
<https://material.angular.io/components> |
63,743,915 | I think I have written all the code right, but on the port I can only display app.js file
```
import React from 'react';
import ImgSlider from './ImgSlider';
import './App.css';
function App() {
return (
<div className="App" >
<div className="book-box">
<img src="" alt=""/>
<div>
<h1>Harry Potter</h1... | 2020/09/04 | [
"https://Stackoverflow.com/questions/63743915",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13065931/"
] | You arent rendering `ImgSlider`, just need to do this in App.js:
```
function App() {
return (
<div className="App" >
<div className="book-box">
<img src="" alt=""/>
<div>
<h1>Harry Potter</h1>
/* ADD this code*/
<ImgSlider />
</div>
</div>
</div>
);
}
```
This is just an example, you... | To render some content from imported component you have to render it like:
```
return (
<div className="App" >
<div className="book-box">
<img src="" alt=""/>
<div>
<h1>Harry Potter</h1>
{/*Place it where you want to show it */}
<ImgSlider />
</div>
</div>
</div>
);
}
``` |
63,743,915 | I think I have written all the code right, but on the port I can only display app.js file
```
import React from 'react';
import ImgSlider from './ImgSlider';
import './App.css';
function App() {
return (
<div className="App" >
<div className="book-box">
<img src="" alt=""/>
<div>
<h1>Harry Potter</h1... | 2020/09/04 | [
"https://Stackoverflow.com/questions/63743915",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13065931/"
] | You arent rendering `ImgSlider`, just need to do this in App.js:
```
function App() {
return (
<div className="App" >
<div className="book-box">
<img src="" alt=""/>
<div>
<h1>Harry Potter</h1>
/* ADD this code*/
<ImgSlider />
</div>
</div>
</div>
);
}
```
This is just an example, you... | Simply add `<ImgSlider />` into App
Your final code would look like this:
```
import React from 'react';
import ImgSlider from './ImgSlider';
import './App.css';
function App() {
return (
<div className="App" >
<div className="book-box">
<img src="" alt=""/>
<div>
<h1>Harry Potter</h1>
<Img... |
63,743,915 | I think I have written all the code right, but on the port I can only display app.js file
```
import React from 'react';
import ImgSlider from './ImgSlider';
import './App.css';
function App() {
return (
<div className="App" >
<div className="book-box">
<img src="" alt=""/>
<div>
<h1>Harry Potter</h1... | 2020/09/04 | [
"https://Stackoverflow.com/questions/63743915",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13065931/"
] | To render some content from imported component you have to render it like:
```
return (
<div className="App" >
<div className="book-box">
<img src="" alt=""/>
<div>
<h1>Harry Potter</h1>
{/*Place it where you want to show it */}
<ImgSlider />
</div>
</div>
</div>
);
}
``` | Simply add `<ImgSlider />` into App
Your final code would look like this:
```
import React from 'react';
import ImgSlider from './ImgSlider';
import './App.css';
function App() {
return (
<div className="App" >
<div className="book-box">
<img src="" alt=""/>
<div>
<h1>Harry Potter</h1>
<Img... |
53,763,361 | The task is to extract customer and order data from a sensitive system. Data is stored in a MySQL database.
A customer can be associated with many orders. A simple LEFT JOIN gives me exactly what I require:
```
---------------------------------------------------------
| customer_id | order_id | order_quantity | order... | 2018/12/13 | [
"https://Stackoverflow.com/questions/53763361",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2044126/"
] | One option would be using MySQL's native encryption methods like `SHA1` or `SHA2` and make a VIEW which you query and join with.
I've choosen to use SHA 512 because it has a very low probability different data could generate the same hash.
```
CREATE VIEW Table1_VIEW AS (
SELECT
<table>.*
, SHA2(<ta... | You could use any hash function, for example, MD5:
```
SELECT MD5(customer_id) AS anon_customer_id FROM customers;
```
But be aware though, MD5 is not very secure: <https://security.stackexchange.com/questions/19906/is-md5-considered-insecure> |
11,905,407 | I set this variable at the top of my page `setVars = {"n":"2","m":"1","degree":"3","p":"2"}`
I want to iterate over each of the elements in setVars but jquery's each() function isn't working.
Here's what I have -
```
$(setVars).each(function(key, value) {
elementId = '#' + key+ '-wrapper';
}
```
But `key` is set... | 2012/08/10 | [
"https://Stackoverflow.com/questions/11905407",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1088617/"
] | It should be like that I belive according to this <http://api.jquery.com/jQuery.each/>
```
$.each(setVars, function(key, value) {
elementId = '#' + key+ '-wrapper';
});
```
setVars is not a collection of DOM elements, it is an object | You are using [`.each()` that's meant for iterating through jQuery objects](http://api.jquery.com/each/) instead of [`$.each()` that's meant for iterating through objects and arrays](http://api.jquery.com/jQuery.each/). Try this:
```
$.each( setVars, function(key, value) {
elementId = '#' + key+ '-wrapper';
});
``` |
11,905,407 | I set this variable at the top of my page `setVars = {"n":"2","m":"1","degree":"3","p":"2"}`
I want to iterate over each of the elements in setVars but jquery's each() function isn't working.
Here's what I have -
```
$(setVars).each(function(key, value) {
elementId = '#' + key+ '-wrapper';
}
```
But `key` is set... | 2012/08/10 | [
"https://Stackoverflow.com/questions/11905407",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1088617/"
] | It should be like that I belive according to this <http://api.jquery.com/jQuery.each/>
```
$.each(setVars, function(key, value) {
elementId = '#' + key+ '-wrapper';
});
```
setVars is not a collection of DOM elements, it is an object | you don't need JQuery for this. Also I could be wrong but you don't want the quotes around the name of the object properties you never see that:
```
setVars = {n:"2",m:"1",degree:"3",p:"2"}
```
And
```
for(i in setVars){
console.log("key: ",i," value: ", setVars[i]); // demonstration of how to access key and va... |
24,405,738 | I am trying to show an info window by using
```
tkinter.messagebox.showinfo("info", "message")
```
However, I am getting error while using `from tkinter import *`
The problem is solve if I also have `import tkinter.messagebox`
So I am confused. Isn't `from tkinter import *` is supposed to import everything inside ... | 2014/06/25 | [
"https://Stackoverflow.com/questions/24405738",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2045858/"
] | ```
from tkinter import *
from tkinter import messagebox
root = Tk()
root.title("test")
root.geometry("300x300")
app = Frame(root)
app.grid()
button1 = Button(app, text = " exit " , width=2, command=exit)
button1.grid(padx=110, pady=80)
def dialog():
var = messagebox.showinfo("test" , "hoi, dit is een test als... | If you use the `from module import x` format, you don't prefix the imported resources with the module. So try
```
messagebox.showinfo("info", "message")
```
If you import like this: `import tkinter.messagebox` you reference it with the module, which is why you don't get an error in that case. |
24,405,738 | I am trying to show an info window by using
```
tkinter.messagebox.showinfo("info", "message")
```
However, I am getting error while using `from tkinter import *`
The problem is solve if I also have `import tkinter.messagebox`
So I am confused. Isn't `from tkinter import *` is supposed to import everything inside ... | 2014/06/25 | [
"https://Stackoverflow.com/questions/24405738",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2045858/"
] | `from tkinter import *` will load Tkinter's `__init__.py` which doesn't include messagebox, so to solve it we do `import tkinter.messagebox` which loads messagebox's `__init__.py`. | If you use the `from module import x` format, you don't prefix the imported resources with the module. So try
```
messagebox.showinfo("info", "message")
```
If you import like this: `import tkinter.messagebox` you reference it with the module, which is why you don't get an error in that case. |
24,405,738 | I am trying to show an info window by using
```
tkinter.messagebox.showinfo("info", "message")
```
However, I am getting error while using `from tkinter import *`
The problem is solve if I also have `import tkinter.messagebox`
So I am confused. Isn't `from tkinter import *` is supposed to import everything inside ... | 2014/06/25 | [
"https://Stackoverflow.com/questions/24405738",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2045858/"
] | ```
from tkinter import *
from tkinter import messagebox
root = Tk()
root.title("test")
root.geometry("300x300")
app = Frame(root)
app.grid()
button1 = Button(app, text = " exit " , width=2, command=exit)
button1.grid(padx=110, pady=80)
def dialog():
var = messagebox.showinfo("test" , "hoi, dit is een test als... | Can also try this method to access the `messagebox` method
```
import tkinter as tk
tk.messagebox.showinfo("info name","This is a Test")
``` |
24,405,738 | I am trying to show an info window by using
```
tkinter.messagebox.showinfo("info", "message")
```
However, I am getting error while using `from tkinter import *`
The problem is solve if I also have `import tkinter.messagebox`
So I am confused. Isn't `from tkinter import *` is supposed to import everything inside ... | 2014/06/25 | [
"https://Stackoverflow.com/questions/24405738",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2045858/"
] | `from tkinter import *` will load Tkinter's `__init__.py` which doesn't include messagebox, so to solve it we do `import tkinter.messagebox` which loads messagebox's `__init__.py`. | Can also try this method to access the `messagebox` method
```
import tkinter as tk
tk.messagebox.showinfo("info name","This is a Test")
``` |
43,698,334 | I'm tinkering a bit with Java but have a lot of experience in some other languages.
I have a test problem that I know solution to (and can easily produce in Python and C++). But running the following Java code gives an
>
> Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
>
>
>
I'm wondering ... | 2017/04/29 | [
"https://Stackoverflow.com/questions/43698334",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2850762/"
] | It will fail even if you increase your heap space.
For n = 113383, an operation make you go through Integer limit and n becomes negative and this is ending in a infite loop.
It works if you change Integer by Long. | I think the easiest to avoid this is to add memory using -Xmx flag
<https://docs.oracle.com/cd/E13150_01/jrockit_jvm/jrockit/jrdocs/refman/optionX.html>
here's official docs to read more about it |
43,698,334 | I'm tinkering a bit with Java but have a lot of experience in some other languages.
I have a test problem that I know solution to (and can easily produce in Python and C++). But running the following Java code gives an
>
> Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
>
>
>
I'm wondering ... | 2017/04/29 | [
"https://Stackoverflow.com/questions/43698334",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2850762/"
] | It will fail even if you increase your heap space.
For n = 113383, an operation make you go through Integer limit and n becomes negative and this is ending in a infite loop.
It works if you change Integer by Long. | to change the VM for Eclipse you can change the amount of the MV from Windows> Preferences> Java> Installed JREs from there select the JRE and click edit, then write in the Default VM Arguments: to -Xmx1024M or any other amount of memory ...
Well, it's fairly self-explanatory: you've run out of memory.
You may want t... |
26,074 | What is the technical term for the distorted, rumbly, windy sound headphones or speakers make when they are unable to properly play a high amplitude bass tone? The sound when the driver is not following the audio wave, but is instead skipping (or adding) sound wave peaks not in the input signal. | 2013/07/03 | [
"https://sound.stackexchange.com/questions/26074",
"https://sound.stackexchange.com",
"https://sound.stackexchange.com/users/35441/"
] | What you are actually hearing is square waves. What happens when a speaker is fed a signal that exceeds the amplitude it can produce is that the speaker coil projects the diaphram to the limit of how far it can travel. This results in an abrupt stop to the sound pressure and it stays pegged at the extreme end until the... | A number of terms can be applied:
* clipping
* electromagnetically saturated
* warping
Also seen written on a repair tag at a major recording studio in L.A. circa 1975:
"This VOT [voice of the theater] sounds like Vapid Schmooy"
"The loudspeaker is by far the poorest link in the reproduction chain for all forms of d... |
3,163,721 | I'm sure this is easy, but I can't find it yet.
What is $J\_n(-x)$? Where $J\_n$ is the usual Bessel function of integer order.
In particular, I'm looking to the sum $\sum\_{n=-\infty}^\infty J\_n(-x) = \sum\_{n=-\infty}^\infty f\_n(-1)J\_n(x) $,
I want to find this $f\_n(-1)$. | 2019/03/26 | [
"https://math.stackexchange.com/questions/3163721",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/141841/"
] | The next level of accuracy comes from applying better estimates for the integral. Taking logarithms, we want to estimate $\ln 2+\ln 3+\cdots+\ln n$ by integrals of $\ln x$. Since the logarithm is increasing, left-endpoint Riemann sums tell us that
\begin{align\*}\ln 1+\ln 2+\ln 3+\cdots+\ln n &\le \int\_1^{n+1}\ln x\, ... | $$\log(n!)=\frac12\log n+\sum\_{k=1}^{n-1}\frac12\big(\log(k)+\log(k+1)\big)\approx\frac12\log n+\int\_1^n\log x \,dx\tag{1}\label{1}$$
We are approximating the integral using the trapezoid rule. We just need a good bound on the error in this approximation.
I claim that
>
> $$
> \left|\frac12\big(\log(k)+\log(k+1)\b... |
26,951 | I have a Ford F350 cab & chassis and a gooseneck trailer. For the gooseneck hitch I want to use a steel plate.
The steel plate will be BOLTED to the frame, above the rear axle And the gooseneck ball will be welded to the steel plate.
The distance between the frames is about 34". So the plate Is going to be 34"long x 8... | 2019/04/17 | [
"https://engineering.stackexchange.com/questions/26951",
"https://engineering.stackexchange.com",
"https://engineering.stackexchange.com/users/20156/"
] | An "orbitless" drive can achieve this in a similar envelope as a planetary:
[Orbitless demo](https://youtu.be/hERmvD_Fe1o)
"Nutating" gears can also provide similar results.
A fixed planet carrier planetary will have opposing rotation between the sun and ring, **if** there is an odd number of planets in line between... | EDIT: I misread the original post and suggested a solution that provides 1:2 gearing *in one direction only.* In other words, a gearing system that works in forward but freewheels in reverse. Reading the question over, this is not what the OP requested.
---
I would recommend splitting your two requirements out into s... |
26,951 | I have a Ford F350 cab & chassis and a gooseneck trailer. For the gooseneck hitch I want to use a steel plate.
The steel plate will be BOLTED to the frame, above the rear axle And the gooseneck ball will be welded to the steel plate.
The distance between the frames is about 34". So the plate Is going to be 34"long x 8... | 2019/04/17 | [
"https://engineering.stackexchange.com/questions/26951",
"https://engineering.stackexchange.com",
"https://engineering.stackexchange.com/users/20156/"
] | An "orbitless" drive can achieve this in a similar envelope as a planetary:
[Orbitless demo](https://youtu.be/hERmvD_Fe1o)
"Nutating" gears can also provide similar results.
A fixed planet carrier planetary will have opposing rotation between the sun and ring, **if** there is an odd number of planets in line between... | Late to the party...
a simpler alternate solution to planetary gearsets is available for coaxial input/output if you don't care about symmetry around the drive shaft. it's used in some tower clocks.
The solution is to choose tooth counts that yield the same sum between two sets of pinions and wheels (which will have e... |
52,058,630 | ```
using System;
class BaseClass
{
public string name;
public BaseClass()
{
this.name = "MyName";
}
public virtual void A()
{
Console.WriteLine(this.surname); // error. BaseClass does not definition of surname
}
}
class DerivedClass : BaseClass
{
public string surn... | 2018/08/28 | [
"https://Stackoverflow.com/questions/52058630",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10284857/"
] | The `surname` field is only available in the Derived class, you should override the virtual method in your derived class:
```
using System;
class BaseClass
{
public string name;
public BaseClass()
{
this.name = "MyName";
}
public virtual void A()
{
Console.WriteLine($"Hi {na... | Your baseClass isn't necessary inherited by a class having the surname property.
As mentionned J. van Langen, you still can declare classes using their base class
```
using System;
class BaseClass
{
public string name;
public BaseClass()
{
this.name = "MyName";
}
public virtual void A()... |
32,396,163 | I want to use SurfaceView for animation to show the live camera preview. It is working fine. But when it loads for first time it flickering for first time. | 2015/09/04 | [
"https://Stackoverflow.com/questions/32396163",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/706021/"
] | This is common issue with android surface view.
Window was destroyed then re-created when the SurfaceView was adding, and the Window's pixel format was changed mean while, that guided me to the answer, the pixel format of the SurfaceView and the Activity was different so Window Manager forced the re-created.
To resol... | Adding a 0px height blank surfaceView to the first layout of the activity might solve the issue. It is a crazy solution, but it solved the issue for me.
You could also check the following query which has a full explanation of answer.
"[SurfaceView flashes black on load](https://stackoverflow.com/questions/8772862/surf... |
16,294,134 | i am making a program to read data from excel files and store them in tables. But since I am new to Comparators in Java i have difficulties in making one of them. Here is my issue, I have managed to read all the data from excel files as a string and store them in a table. But my project is to store them in table by asc... | 2013/04/30 | [
"https://Stackoverflow.com/questions/16294134",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2290614/"
] | Yes, you simply need to use the `parent::__construct()` method.
Like so:
```
class a{
/**
* The age of the user
*
* @var integer
*/
protected $age;
function __construct($a){
$this->age = $a;
}
}
class b extends a{
/**
* The name of the user
... | You can pass value to the parent constructor but the way you are doing is wrong,
```
$var = new b('name', 'age');
```
it is as if the child class accepts two parameters in its constructor but in real it has only one parameter.
You can pass parameter to parent constructor something like this
```
parent::__construct... |
16,294,134 | i am making a program to read data from excel files and store them in tables. But since I am new to Comparators in Java i have difficulties in making one of them. Here is my issue, I have managed to read all the data from excel files as a string and store them in a table. But my project is to store them in table by asc... | 2013/04/30 | [
"https://Stackoverflow.com/questions/16294134",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2290614/"
] | Yes, you simply need to use the `parent::__construct()` method.
Like so:
```
class a{
/**
* The age of the user
*
* @var integer
*/
protected $age;
function __construct($a){
$this->age = $a;
}
}
class b extends a{
/**
* The name of the user
... | Yes you can pass the argument to the class as well as parent class
```
Class a {
public function __construct($age){
$this->age = $a;
}
}
Class b extends a {
public function __construct($name,$age){
parent::__construct($age);
$this->name = $name;
... |
16,294,134 | i am making a program to read data from excel files and store them in tables. But since I am new to Comparators in Java i have difficulties in making one of them. Here is my issue, I have managed to read all the data from excel files as a string and store them in a table. But my project is to store them in table by asc... | 2013/04/30 | [
"https://Stackoverflow.com/questions/16294134",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2290614/"
] | Yes, you simply need to use the `parent::__construct()` method.
Like so:
```
class a{
/**
* The age of the user
*
* @var integer
*/
protected $age;
function __construct($a){
$this->age = $a;
}
}
class b extends a{
/**
* The name of the user
... | Just call parent::\_\_construct in the child. for example
```
class Form extends Tag
{
function __construct()
{
parent::__construct();
// Called second.
}
}
``` |
16,294,134 | i am making a program to read data from excel files and store them in tables. But since I am new to Comparators in Java i have difficulties in making one of them. Here is my issue, I have managed to read all the data from excel files as a string and store them in a table. But my project is to store them in table by asc... | 2013/04/30 | [
"https://Stackoverflow.com/questions/16294134",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2290614/"
] | Yes, you simply need to use the `parent::__construct()` method.
Like so:
```
class a{
/**
* The age of the user
*
* @var integer
*/
protected $age;
function __construct($a){
$this->age = $a;
}
}
class b extends a{
/**
* The name of the user
... | Here is how is should go:
```
<?php
class a {
private $age;
public function __construct($age){
$this->age = $age;
}
public function getAge()
{
return $this->age;
}
}
class b extends a {
private $name;
public function __construct($age, $name){
parent::__cons... |
36,817 | I am getting 404 error. Only home page is working only.
Can anybody tell me what could be reason for that
Thanks | 2014/09/23 | [
"https://magento.stackexchange.com/questions/36817",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/9122/"
] | This issue have something to do with your server not processing your .htaccess file which can be cause by many different things.
1. Check to make sure you have .htaccess in your server root folder
2. Check your magento setting see [How to remove index.php from URLs](https://stackoverflow.com/questions/10474740/how-to-... | Check if mod\_rewrite is enabled on server and if .htaccess is used.
If you can't enable it you should disable SEO in Magento / Admin / System / Configuration / General / Web / Search Engine Optimization |
53,414,096 | So I'm working with cmdlets in C# and using a base cmdlet which derives from PSCmdlet.
Like this: Child <- Parent <- PSCmdlet.
We login to a system using methods in the Parent cmdlet. But sometimes things don't always go right with exceptions, crashes and so on. So it doesn't really logout properly.
My question is ... | 2018/11/21 | [
"https://Stackoverflow.com/questions/53414096",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6533422/"
] | The solution for my problem, as @PetSerAl suggested, was to implement IDisposable in the Parent class.
Using Dispose() I could then add whatever methods needed to finalize the cmdlet no matter what happens. | This sounds like a good case to use `Try-catch`:
```
try
{
UserLogin();
OtherMethod();
}
catch(UnauthorizedException au)
{
Console.WriteLine("Unauthorized user... shutting down");
//Closing Code...
Environment.Exit(0);
}
catch(OtherException oe)
{
//Closing Code...
Environment.Exit(0);
}
..... |
15,976,414 | I have an ASP.net website that was working fine with IE9, Mozilla, chrome but with IE 10 users have lot issues. The UI and even the functionality (like clicking on button, login/logout do not work) doesn't work well with IE10.
The IE version I have is 10.0.9200.16519.
I see few differences between the view source fro... | 2013/04/12 | [
"https://Stackoverflow.com/questions/15976414",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/901504/"
] | It looks like the `document.PrintOut()` method is what you're looking for.
Check [this link](http://msdn.microsoft.com/en-us/library/vstudio/b9f0ke7y%28v=vs.100%29.aspx) for some examples. | you can use print dialog
```
using (PrintDialog pd = new PrintDialog())
{
pd.ShowDialog();
ProcessStartInfo info = new ProcessStartInfo(@"C:\documents\DOCNAME.DOC");
info.Verb = "PrintTo";
info.Arguments = pd.PrinterSettings.PrinterName;
... |
29,990 | I would like to be able to HIDE the employer names in my CV unless I authorize the visibility. This will prevent recruiters from sending my resume into companies without my approval. | 2009/11/16 | [
"https://meta.stackexchange.com/questions/29990",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/9852/"
] | Contingency recruiters are not allowed and unwelcome... these are the ones who have a tendency to spam in hopes of scoring a commission.
(Retained recruiters are allowed and welcome... they represent employers directly and are indistinguishable from the employer's own hiring staff.)
Anyone employer/recruiter using th... | Why would it? I've known recruiters send CVs to companies when I've explicitly told them not to. I can see why not having employer names might stop some, but it won't stop all.
Anyway, according to [this answer](https://meta.stackexchange.com/questions/26820/any-plans-to-restrict-recruiter-access-in-careers-stackoverf... |
29,990 | I would like to be able to HIDE the employer names in my CV unless I authorize the visibility. This will prevent recruiters from sending my resume into companies without my approval. | 2009/11/16 | [
"https://meta.stackexchange.com/questions/29990",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/9852/"
] | Contingency recruiters are not allowed and unwelcome... these are the ones who have a tendency to spam in hopes of scoring a commission.
(Retained recruiters are allowed and welcome... they represent employers directly and are indistinguishable from the employer's own hiring staff.)
Anyone employer/recruiter using th... | I post my resume on my webpage (links to .txt and .pdf versions), along with this note:
>
> MSWord and RTF versions removed due to abuse. Authorization is NOT granted to edit and redistribute these documents.
>
>
>
I don't know if it has any effect but it does make my intentions clear: do not think about submitti... |
32,893,374 | Given two very simple classes:
```
class X
{
};
class Y : public X
{
};
```
Why is it that, with Clang and [GCC targeting C++14](https://ideone.com/fdIuVC), `std::is_assignable<X*, Y*>::value` is `false`? It is `true` with Clang on my setup when I target C++11. | 2015/10/01 | [
"https://Stackoverflow.com/questions/32893374",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/251153/"
] | In JavaScript, functions are first class citizens, just like strings and ints. When you do, `Array.prototype.forEach.call`, you are getting the *value* of the `.call` property, which going up the `prototype` chain is `Function.prototype.call`. So, your `forEach` variable is set to `Function.prototype.call`.
Now, when ... | You can do this too, if you want to do `forEach(array, fn)`
```
var forEach = Function.call.bind(Array.prototype.forEach);
```
Now you can use it as you were doing it before:
```
forEach([1,2,3], function(a) { console.log(a); });
```
What you are doing is binding call `this` to `Array.prototype.forEach`. This is ... |
32,893,374 | Given two very simple classes:
```
class X
{
};
class Y : public X
{
};
```
Why is it that, with Clang and [GCC targeting C++14](https://ideone.com/fdIuVC), `std::is_assignable<X*, Y*>::value` is `false`? It is `true` with Clang on my setup when I target C++11. | 2015/10/01 | [
"https://Stackoverflow.com/questions/32893374",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/251153/"
] | In JavaScript, functions are first class citizens, just like strings and ints. When you do, `Array.prototype.forEach.call`, you are getting the *value* of the `.call` property, which going up the `prototype` chain is `Function.prototype.call`. So, your `forEach` variable is set to `Function.prototype.call`.
Now, when ... | Functions that relies on `this` internally must be bound to work properly when detached from their "owner", because for unbound functions the `this` value will be the object referenced by the left-side of the dot in `obj.func()`. If functions are invoked directly from the current scope (e.g. `func()`) then `this` will ... |
29,099,685 | I am using [Entity Framework](https://msdn.microsoft.com/en-us/data/ef.aspx) 6.0 with [Microsoft SQL Server](http://www.microsoft.com/en-us/server-cloud/products/sql-server). By default, the primary key it generates for a table is named like `PK_dbo.TableName`, where `TableName` is in a plural form, even though the act... | 2015/03/17 | [
"https://Stackoverflow.com/questions/29099685",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1509307/"
] | You can do it like this:
```cs
public class PKNameGenerator : SqlServerMigrationSqlGenerator {
static readonly string PREFIX = "PK";
protected override void Generate(CreateTableOperation createTableOperation) {
createTableOperation.PrimaryKey.Name = GetPkName(createTableOperation.Name);
... | You could set the name of your db-field explicitly, although I'm not sure if that is what you're looking for.
```
[Key]
[Column("PK_Employee")]
public int EmployeeId {get; set;}
``` |
29,099,685 | I am using [Entity Framework](https://msdn.microsoft.com/en-us/data/ef.aspx) 6.0 with [Microsoft SQL Server](http://www.microsoft.com/en-us/server-cloud/products/sql-server). By default, the primary key it generates for a table is named like `PK_dbo.TableName`, where `TableName` is in a plural form, even though the act... | 2015/03/17 | [
"https://Stackoverflow.com/questions/29099685",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1509307/"
] | You can do it like this:
```cs
public class PKNameGenerator : SqlServerMigrationSqlGenerator {
static readonly string PREFIX = "PK";
protected override void Generate(CreateTableOperation createTableOperation) {
createTableOperation.PrimaryKey.Name = GetPkName(createTableOperation.Name);
... | Fluent API is clean, so more cleaner this way with separate configuration file
```
public class EmployeeConfiguration : EntityTypeConfiguration<Employee>
{
public EmployeeConfiguration()
{
HasKey(x => x.EmployeeId);
}
}
```
And OnModelCreating you can add this configuration file
```
modelBuilder... |
55,015,303 | I have a `create-react-app` app and I am translation files from `jsx` to `typescript`. For example, one file is called `/code/app_react/src/common/Action.jsx` and I renamed it to `/code/app_react/src/common/Action.tsx`. I made the necessary changes to successfully convert it to `tsx`, but I am getting an error related ... | 2019/03/06 | [
"https://Stackoverflow.com/questions/55015303",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/267835/"
] | It is happening because of the pre-built cache. A simple solution would be to restart your nodejs and react app.
**In Linux**
```
$ pkill node
$ killall node
$ kill -9 <pid>
```
**In Windows**
```
C:\>taskkill /im node.exe
C:\>taskkill /f /im node.exe
C:\>taskkill /pid <PID of node>
```
**In MacOs**
``... | It took me all day and all I needed was to restart docker :)
And I do need to restart it after every file change to tsx. |
55,015,303 | I have a `create-react-app` app and I am translation files from `jsx` to `typescript`. For example, one file is called `/code/app_react/src/common/Action.jsx` and I renamed it to `/code/app_react/src/common/Action.tsx`. I made the necessary changes to successfully convert it to `tsx`, but I am getting an error related ... | 2019/03/06 | [
"https://Stackoverflow.com/questions/55015303",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/267835/"
] | Killed my yarn process running, killed vscode, re-started both and it works | I manually deleted the `node_modules` folder and re-installed them by running `npm i` and the trick worked for me. |
55,015,303 | I have a `create-react-app` app and I am translation files from `jsx` to `typescript`. For example, one file is called `/code/app_react/src/common/Action.jsx` and I renamed it to `/code/app_react/src/common/Action.tsx`. I made the necessary changes to successfully convert it to `tsx`, but I am getting an error related ... | 2019/03/06 | [
"https://Stackoverflow.com/questions/55015303",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/267835/"
] | I had the same issue converting .jsx to .tsx. If you're using Parcel to build your app, delete the `.cache` folder. That's where Parcel caches build files. That fixed it for me. | I manually deleted the `node_modules` folder and re-installed them by running `npm i` and the trick worked for me. |
55,015,303 | I have a `create-react-app` app and I am translation files from `jsx` to `typescript`. For example, one file is called `/code/app_react/src/common/Action.jsx` and I renamed it to `/code/app_react/src/common/Action.tsx`. I made the necessary changes to successfully convert it to `tsx`, but I am getting an error related ... | 2019/03/06 | [
"https://Stackoverflow.com/questions/55015303",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/267835/"
] | I was working with redux and then came across this error!!
I tried killing node , removing node modules, restarting the laptop but it still gave the same error then later I started debugging index.js
I commented each line and started uncommenting from top to see where the code is breaking then observed
>
> I had no... | I also had the problem in a React Application (started with yarn start and displayed at localhost:3000). The problem arised after renaming a component and forgetting the suffix .js. After adding the suffix .js the already started App still was searching for the file without the suffix. The solution was similar to Umand... |
55,015,303 | I have a `create-react-app` app and I am translation files from `jsx` to `typescript`. For example, one file is called `/code/app_react/src/common/Action.jsx` and I renamed it to `/code/app_react/src/common/Action.tsx`. I made the necessary changes to successfully convert it to `tsx`, but I am getting an error related ... | 2019/03/06 | [
"https://Stackoverflow.com/questions/55015303",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/267835/"
] | I had same issue, no need to remove `node_modules` or remove target file, you just have to kill the node process.
If you're on `windows`:
* `ctrl``+``alt``+``delete` to run task manager
* find `node`
* end process
If you're on `linux`:
* probably something like `pkill node`, etc.
After I killed the `node` process ... | I also had the problem in a React Application (started with yarn start and displayed at localhost:3000). The problem arised after renaming a component and forgetting the suffix .js. After adding the suffix .js the already started App still was searching for the file without the suffix. The solution was similar to Umand... |
55,015,303 | I have a `create-react-app` app and I am translation files from `jsx` to `typescript`. For example, one file is called `/code/app_react/src/common/Action.jsx` and I renamed it to `/code/app_react/src/common/Action.tsx`. I made the necessary changes to successfully convert it to `tsx`, but I am getting an error related ... | 2019/03/06 | [
"https://Stackoverflow.com/questions/55015303",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/267835/"
] | I had the same issue converting .jsx to .tsx. If you're using Parcel to build your app, delete the `.cache` folder. That's where Parcel caches build files. That fixed it for me. | It took me all day and all I needed was to restart docker :)
And I do need to restart it after every file change to tsx. |
55,015,303 | I have a `create-react-app` app and I am translation files from `jsx` to `typescript`. For example, one file is called `/code/app_react/src/common/Action.jsx` and I renamed it to `/code/app_react/src/common/Action.tsx`. I made the necessary changes to successfully convert it to `tsx`, but I am getting an error related ... | 2019/03/06 | [
"https://Stackoverflow.com/questions/55015303",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/267835/"
] | Just restart your npm server, it will automatically detect the typescript file and make adjustments | I manually deleted the `node_modules` folder and re-installed them by running `npm i` and the trick worked for me. |
55,015,303 | I have a `create-react-app` app and I am translation files from `jsx` to `typescript`. For example, one file is called `/code/app_react/src/common/Action.jsx` and I renamed it to `/code/app_react/src/common/Action.tsx`. I made the necessary changes to successfully convert it to `tsx`, but I am getting an error related ... | 2019/03/06 | [
"https://Stackoverflow.com/questions/55015303",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/267835/"
] | It is happening because of the pre-built cache. A simple solution would be to restart your nodejs and react app.
**In Linux**
```
$ pkill node
$ killall node
$ kill -9 <pid>
```
**In Windows**
```
C:\>taskkill /im node.exe
C:\>taskkill /f /im node.exe
C:\>taskkill /pid <PID of node>
```
**In MacOs**
``... | I manually deleted the `node_modules` folder and re-installed them by running `npm i` and the trick worked for me. |
55,015,303 | I have a `create-react-app` app and I am translation files from `jsx` to `typescript`. For example, one file is called `/code/app_react/src/common/Action.jsx` and I renamed it to `/code/app_react/src/common/Action.tsx`. I made the necessary changes to successfully convert it to `tsx`, but I am getting an error related ... | 2019/03/06 | [
"https://Stackoverflow.com/questions/55015303",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/267835/"
] | Maybe you have not imported the file. You need to import the file to use it.
```
import Action from '/code/app_react/src/common/Action.tsx';
```
Also add this to your webpack.config.js.
```
resolve: {
extensions: [".ts", ".tsx", ".js", ".jsx"]
},
```
You're good to go! | I was working with redux and then came across this error!!
I tried killing node , removing node modules, restarting the laptop but it still gave the same error then later I started debugging index.js
I commented each line and started uncommenting from top to see where the code is breaking then observed
>
> I had no... |
55,015,303 | I have a `create-react-app` app and I am translation files from `jsx` to `typescript`. For example, one file is called `/code/app_react/src/common/Action.jsx` and I renamed it to `/code/app_react/src/common/Action.tsx`. I made the necessary changes to successfully convert it to `tsx`, but I am getting an error related ... | 2019/03/06 | [
"https://Stackoverflow.com/questions/55015303",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/267835/"
] | It took me all day and all I needed was to restart docker :)
And I do need to restart it after every file change to tsx. | I also had the problem in a React Application (started with yarn start and displayed at localhost:3000). The problem arised after renaming a component and forgetting the suffix .js. After adding the suffix .js the already started App still was searching for the file without the suffix. The solution was similar to Umand... |
8,800,349 | this question is easy,we can :
```
public static void writePhotoJpg(Bitmap data, String pathName) {
File file = new File(pathName);
try {
file.createNewFile();
// BufferedOutputStream os = new BufferedOutputStream(
// new FileOutputStream(file));
FileOutputStream os = new FileO... | 2012/01/10 | [
"https://Stackoverflow.com/questions/8800349",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/233618/"
] | you can try this:
```
public static final int BUFFER_SIZE = 1024 * 8;
static void writeExternalToCache(Bitmap bitmap, File file) {
try {
file.createNewFile();
FileOutputStream fos = new FileOutputStream(file);
final BufferedOutputStream bos = new BufferedOutputStream(fos, BUFFER_SIZE);
... | Use `.getRootView()` method of view OR the layout contains this view, use it (e.g.) **mainLayout** contain one image view at index 1 then `mainlayou.getChildAt(1)` to get the view.
E.g.
```
View v1 = mainLayout.getChildAt(1); //OR View v1 = mainLayout.getRootView();
v1.setDrawingCacheEnabled(true);
... |
26,567 | The Mishnah in Megillah ([2:2](https://www.sefaria.org/Mishnah_Megillah.2.2?lang=bi&with=all&lang2=en)) says that one who reads the megillah while semi-asleep ('מתנמנם') is yotzei. The gemara comments ([18b](http://hebrewbooks.org/shas.aspx?mesechta=11&daf=18b&format=pdf)):
>
> מתנמנם יצא וכו': היכי דמי מתנמנם אמר רב... | 2013/02/24 | [
"https://judaism.stackexchange.com/questions/26567",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/369/"
] | As mentioned in the comments, the Mishnah is just talking about one who reads the megillah. Someone who is falling asleep while listening will not be able to hear every word. The [Shulchan Aruch](http://he.wikisource.org/wiki/%D7%A9%D7%95%D7%9C%D7%97%D7%9F_%D7%A2%D7%A8%D7%95%D7%9A_%D7%90%D7%95%D7%A8%D7%97_%D7%97%D7%99%... | The Ben Ish Chai Writes in Tetzaveh Hilchos Purim 3:
>
> אות ג
>
>
> קראה מתנמנם הואיל ולא נרדם בשינה יצא אבל השומע אם מתנמנם לא יצא וצריך
> להזהר בד"ז שהוא מצוי תמיד דאלו השומעים יתנמנמו, ולכתחילה אם ראו את
> הקורא שקרא איזה פסוקים מתנמנם מכריחין אותתו שיחזור ויקראנה, דלא אמרינן
> קראה מתנמנם יצא אלא בדיעבד היכ... |
13,918 | **Motivation**: Last October 7 there was a presidential election in Venezuela.
Although the opposition saw an unprecedented increase in its votes, the
government votes increased even more resulting in the current president
being re-elected. The votes were counted by computers that are not trustworthy
because of [what t... | 2012/10/31 | [
"https://mathematica.stackexchange.com/questions/13918",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/251/"
] | The grid line detection from [this answer](https://stackoverflow.com/questions/10196198/how-to-remove-convexity-defects-in-sudoku-square/10226971#10226971) works almost out of the box.
First, I adjust the brightness of the image for easier binarization:
```
src = ColorConvert[Import["http://i.stack.imgur.com/CmKLx.pn... | Below are some techniques that together with @nikie answer give you a powerful way of detecting specific table grids.
The Rubber Band Algorithm
=========================
The 3 columns to be detected must be very close to 40%, 15% and 45% of the total table width. Similarly, the line heights have a proportion to follo... |
26,533,025 | Somewhere during the various updates of XCode in the last month, the iOS versions dropped from my simulator selection (image below.) Anyone know how to resolve this?
 | 2014/10/23 | [
"https://Stackoverflow.com/questions/26533025",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33226/"
] | **How to fix it**
Xcode uses the device version to disambiguate devices with the same name.
If two devices have the same name and version number, it will use the devices' UDIDs.
You have 4 of each of a bunch of devices (eg iPhone 5s). I suspect that some of them are for the same iOS version. You should delete some of... | Deleting multiple copies of the same version from the Devices window did the trick for me. |
26,533,025 | Somewhere during the various updates of XCode in the last month, the iOS versions dropped from my simulator selection (image below.) Anyone know how to resolve this?
 | 2014/10/23 | [
"https://Stackoverflow.com/questions/26533025",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33226/"
] | **How to fix it**
Xcode uses the device version to disambiguate devices with the same name.
If two devices have the same name and version number, it will use the devices' UDIDs.
You have 4 of each of a bunch of devices (eg iPhone 5s). I suspect that some of them are for the same iOS version. You should delete some of... | I found this script to be the most efficient. I clears the list of existing simulators, than rebuilds it based on installed platforms.
See <https://gist.github.com/cabeca/cbaacbeb6a1cc4683aa5> |
26,533,025 | Somewhere during the various updates of XCode in the last month, the iOS versions dropped from my simulator selection (image below.) Anyone know how to resolve this?
 | 2014/10/23 | [
"https://Stackoverflow.com/questions/26533025",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33226/"
] | Deleting multiple copies of the same version from the Devices window did the trick for me. | I found this script to be the most efficient. I clears the list of existing simulators, than rebuilds it based on installed platforms.
See <https://gist.github.com/cabeca/cbaacbeb6a1cc4683aa5> |
18,021,189 | This is simple Client-Server chat program.This code is working fine on computers connected on Network, how to modify it such that it can connect between computers over the Internet. Using Public IP of the server in `gethostbyname()` isn't working.
```
//Client.c
#include<stdio.h>
#include<sys/types.h>
#include<sys/so... | 2013/08/02 | [
"https://Stackoverflow.com/questions/18021189",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2578889/"
] | Based on the information you've given, I don't think it's possible to provide a solution to the question you're asking. You've stated that your code works when the two computers are on the same local network, so clearly the code (which, yes, has issues) works at least well enough to connect from client to server.
If (... | Well after my research I came up with this answer. If you want to connect Devices over Internet you need to have a Server having a unique IP Address Eg you could buy one online. When you try to create a device in your home network as Server you need to provide the Global IP Address and since the ISP provides you with a... |
18,021,189 | This is simple Client-Server chat program.This code is working fine on computers connected on Network, how to modify it such that it can connect between computers over the Internet. Using Public IP of the server in `gethostbyname()` isn't working.
```
//Client.c
#include<stdio.h>
#include<sys/types.h>
#include<sys/so... | 2013/08/02 | [
"https://Stackoverflow.com/questions/18021189",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2578889/"
] | Based on the information you've given, I don't think it's possible to provide a solution to the question you're asking. You've stated that your code works when the two computers are on the same local network, so clearly the code (which, yes, has issues) works at least well enough to connect from client to server.
If (... | You can't connect to a device only by the global IP but if you open a port, port forward, only for the server then the socket can be made. |
18,021,189 | This is simple Client-Server chat program.This code is working fine on computers connected on Network, how to modify it such that it can connect between computers over the Internet. Using Public IP of the server in `gethostbyname()` isn't working.
```
//Client.c
#include<stdio.h>
#include<sys/types.h>
#include<sys/so... | 2013/08/02 | [
"https://Stackoverflow.com/questions/18021189",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2578889/"
] | Well after my research I came up with this answer. If you want to connect Devices over Internet you need to have a Server having a unique IP Address Eg you could buy one online. When you try to create a device in your home network as Server you need to provide the Global IP Address and since the ISP provides you with a... | You can't connect to a device only by the global IP but if you open a port, port forward, only for the server then the socket can be made. |
12,753,148 | Here's a problem I experience (simplified example):
Let's say I have several tables:

One customer can have mamy products and a product can have multiple features.
On my asp.net front-end I have a grid with customer info:
something like this:
```
... | 2012/10/05 | [
"https://Stackoverflow.com/questions/12753148",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/194076/"
] | Unicode doesn't have a defined sort (or collation) order. When Excel sorts, it's using tables based on the currently selected language. For example, someone using Excel in English mode may get different sorting results that someone using Excel in Portuguese.
There are also issues of normalization. With Unicode, one "c... | I don't think you can do what you want to do in Excel without limiting your approach significantly.
By experimentation, the Code function will never return a value higher than 255. If you use any unicode text that cannot be generated via this VBA Code, it will be interpreted as a question mark (?) or 63.
```
For x = ... |
26,708,876 | According to the help file
<http://www.inside-r.org/packages/cran/igraph/docs/erdos.renyi.game>
the erdos.renyi.game function is supposed to accept n=The number of vertices in the graph and m= the number of edges in the graph as input parameters.
The dataset I am working with has 6 vertices and 25 edges, so when i ... | 2014/11/03 | [
"https://Stackoverflow.com/questions/26708876",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3948603/"
] | Just use `erdos.renyi.game(n=6, m=25)` `erdos.renyi.game(6, 12, type="gnm")` and it will work. You have to define explicitly that the second parameter is for the value of `m` and not `p`. | ```
erdos.renyi.game(n, p.or.m, type=c("gnp", "gnm"),
directed = FALSE, loops = FALSE, ...)
```
n
```
The number of vertices in the graph.
```
p.or.m
```
Either the probability for drawing an edge between two arbitrary vertices (G(n,p) graph), or the number of edges in the graph (for G(n,m) graph... |
1,831,961 | I am writing a small application in C# using [Windows Forms](http://en.wikipedia.org/wiki/Windows_Forms). I want to let my users copy and paste data around the application and there are some custom controls, for example one is a colour picker.
Some of the default controls (well at least the TextBox) have a copy and pa... | 2009/12/02 | [
"https://Stackoverflow.com/questions/1831961",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/177761/"
] | The simplest way is to activate `KeyPreview` in the form and then follow the logic in `KeyDown` event.
But an other approach can be useful:
If you have in your win application a menu (by e.g. &Edit => Copy (Paste)).
Enable for that menus the keyboard shortcuts
```
//
// editToolStripMenuItem
//
this.editToolSt... | To find the focussed control: `ContainerControl.ActiveControl`. Then depending on the type of control, you can set a value (with the clipboard value). |
1,831,961 | I am writing a small application in C# using [Windows Forms](http://en.wikipedia.org/wiki/Windows_Forms). I want to let my users copy and paste data around the application and there are some custom controls, for example one is a colour picker.
Some of the default controls (well at least the TextBox) have a copy and pa... | 2009/12/02 | [
"https://Stackoverflow.com/questions/1831961",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/177761/"
] | The simplest way is to activate `KeyPreview` in the form and then follow the logic in `KeyDown` event.
But an other approach can be useful:
If you have in your win application a menu (by e.g. &Edit => Copy (Paste)).
Enable for that menus the keyboard shortcuts
```
//
// editToolStripMenuItem
//
this.editToolSt... | The KeyUp event solved my problem! Events `KeyDown` and `KeyPress` didn't catch `Ctrl` + `C` for copy!
From Stack Overflow question *[Catching Ctrl + C in a textbox](https://stackoverflow.com/questions/1650648/catching-control-c-in-a-textbox/1650747#1650747)*:
```
private void txtConsole_KeyUp(object sender, KeyEvent... |
1,831,961 | I am writing a small application in C# using [Windows Forms](http://en.wikipedia.org/wiki/Windows_Forms). I want to let my users copy and paste data around the application and there are some custom controls, for example one is a colour picker.
Some of the default controls (well at least the TextBox) have a copy and pa... | 2009/12/02 | [
"https://Stackoverflow.com/questions/1831961",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/177761/"
] | The simplest way is to activate `KeyPreview` in the form and then follow the logic in `KeyDown` event.
But an other approach can be useful:
If you have in your win application a menu (by e.g. &Edit => Copy (Paste)).
Enable for that menus the keyboard shortcuts
```
//
// editToolStripMenuItem
//
this.editToolSt... | ```
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navig... |
11,577,712 | Here is my code:
```
<div class="container">
<div>
<h1>Welcome TeamName1</h1>
asdf
<hr>
asdf
</div>
</div> <!-- /container -->
```
The hr tag does not seem to work as I would expect it. Instead of drawing a line, it creates a gap, like so:
>
>  =\int\_0^x \sin (1/t)\,dt$ is differentiable everywhere, with $h'(x) = \sin (1/x)$ for $x\ne 0$ by the FTC, and $h'(0)=0$ because of all the oscillation at $0.$ (You have to do some work to see this last bit. ) Now you have mentioned an example of a sequence $f\_n$ converging to $0$ uniformly o... | Since $f\_0,f\_1,f\_2,...f\_n$ is continuous and differentiable $n$-times, we say it is of multiplicity $n$.
We say $\alpha$ is a Zero (root) of multiplicity n $\ni f(\alpha)=f'(\alpha)= f^2(\alpha)=... f^{n-1}(\alpha)$
Since the sequence converges to $1$ limit point, $g \rightarrow f$ is a contracting function.
B... |
55,137,277 | I have the following code:
```
var d = double.Parse("4796.400000000001");
Console.WriteLine(d.ToString("G17", CultureInfo.InvariantCulture));
```
If I compile and run this using an x86 configuration in Visual Studio, then I get the following output:
```
4796.4000000000005
```
If I instead compile as x64 I get thi... | 2019/03/13 | [
"https://Stackoverflow.com/questions/55137277",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4219724/"
] | I think the simple answer to this one is that this is a bug in .NET Framework. I filed the following ticket on the issue:
<https://developercommunity.visualstudio.com/content/problem/488302/issue-with-double-parser.html>
The issue has been closed as "won't fix" with the following motivation:
>
> The change taken i... | Not sure why there is a difference, though, the code in the x86 configuration is not the same as in the x64 configuration.
[](https://i.stack.imgur.com/RdMfv.png)
[](https://i.stack.imgur.com/FB... |
1,923,624 | So I'm viewing a short proof on the uniqueness of Taylor polynomials.
>
> **Uniqueness of Taylor polynomial:**
> Let $f:]a,b,[ \rightarrow \mathbb{R}$ $n$ times continuously
> differentiable and $x\_0 \in ]a,b,[$. If $p$ is $n$th degree polynomial
> function for which
>
>
> $$f(x)-p(x)=o(|x-x\_0|^n), \space \te... | 2016/09/12 | [
"https://math.stackexchange.com/questions/1923624",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/248602/"
] | The correct result requires even less hypotheses.
>
> **Uniqueness of Taylor Polynomial**: *If $f$ is defined in a certain neighborhood of $a$ such that $f^{(n)}(a)$ exists and $P(x)$ is a polynomial of degree $n$ such that $$f(x) - P(x) = o((x - a)^{n})$$ as $x \to a$ then $$P(x) = f(a) + f'(a)(x - a) + f''(a)\frac{... | By Taylor's Theorem, we know that $f(x)-T\_{n, x\_0}=o(|x-x\_0|^n)$ and we are assuming that $f(x)-p(x)=o(|x-x\_0|^n)$ as $x \rightarrow
x\_0$. Now use the definition $o(|x-x\_0|^n)$: $F=o(|x-x\_0|^n)$ iff
$$\lim\_{x\to x\_0}\frac{F(x)}{(x-x\_0)^n}=0.$$
By the way, uniqueness can be proved without Taylor's Theorem. A... |
631,584 | We've been having a bit of an issue, and saying that it's a *bit* of an issue is an understatement. Our client (Ubuntu 15.04, specs linked) has these installed, and in this order:
1. Ubuntu-desktop (already installed, but we did sudo apt-get install and found out)
2. TightVNCServer
3. XRDP (with, of course vnc4server ... | 2015/06/03 | [
"https://askubuntu.com/questions/631584",
"https://askubuntu.com",
"https://askubuntu.com/users/416341/"
] | It looks like you can implement this through the standard Linux authentication system (called `pam` - Pluggable Authentication Modules). This (amongst other things) is responsible for checking if users can log in.
Within the pam system, there's a module called `pam_time`, which allows you to set restrictions for login... | One module would be `pam_time`.
Your question may be answered by [How do I restrict my kids computing time.](https://askubuntu.com/questions/68918/how-do-i-restrict-my-kids-computing-time) |
10,391,922 | I want to get all the phone numbers with diff labels like "iPhone", "home phone", "mobile number", "other numbers" , etc. for a contact stored in iPhone address book.
How do I get it?
Please help.
Thanks in advance.
I am trying: which is crashing
```
ABAddressBookRef ab=ABAddressBookCreate();
CFArrayRef peopl... | 2012/04/30 | [
"https://Stackoverflow.com/questions/10391922",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/95873/"
] | Try:
```
ABMultiValueRef *phones = ABRecordCopyValue(ref, kABPersonPhoneProperty);
for(CFIndex j = 0; j < ABMultiValueGetCount(phones); j++)
{
CFStringRef phoneNumberRef = ABMultiValueCopyValueAtIndex(phones, j);
CFStringRef locLabel = ABMultiValueCopyLabelAtIndex(phones, j);
NSString *phoneLabel =(NSString*... | Solved it this way:
```
ABAddressBookRef addressBook = ABAddressBookCreate();
CFArrayRef all = ABAddressBookCopyArrayOfAllPeople(addressBook);
CFIndex n = ABAddressBookGetPersonCount(addressBook);
for( int i = 0 ; i < n ; i++ )
{
ABRecordRef ref = CFArrayGetValueAtIndex(all, i);
NSString *firstName = (NSStr... |
10,391,922 | I want to get all the phone numbers with diff labels like "iPhone", "home phone", "mobile number", "other numbers" , etc. for a contact stored in iPhone address book.
How do I get it?
Please help.
Thanks in advance.
I am trying: which is crashing
```
ABAddressBookRef ab=ABAddressBookCreate();
CFArrayRef peopl... | 2012/04/30 | [
"https://Stackoverflow.com/questions/10391922",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/95873/"
] | Try:
```
ABMultiValueRef *phones = ABRecordCopyValue(ref, kABPersonPhoneProperty);
for(CFIndex j = 0; j < ABMultiValueGetCount(phones); j++)
{
CFStringRef phoneNumberRef = ABMultiValueCopyValueAtIndex(phones, j);
CFStringRef locLabel = ABMultiValueCopyLabelAtIndex(phones, j);
NSString *phoneLabel =(NSString*... | Also to get phone number with particular record id, do this:
```
ABAddressBookRef addressBook = ABAddressBookCreate();
CFArrayRef all = ABAddressBookCopyArrayOfAllPeople(addressBook);
ABRecordRef ref = CFArrayGetValueAtIndex(all, indexPath.row);
NSString *firstName = (NSString *)ABRecordCopyVa... |
10,391,922 | I want to get all the phone numbers with diff labels like "iPhone", "home phone", "mobile number", "other numbers" , etc. for a contact stored in iPhone address book.
How do I get it?
Please help.
Thanks in advance.
I am trying: which is crashing
```
ABAddressBookRef ab=ABAddressBookCreate();
CFArrayRef peopl... | 2012/04/30 | [
"https://Stackoverflow.com/questions/10391922",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/95873/"
] | Try:
```
ABMultiValueRef *phones = ABRecordCopyValue(ref, kABPersonPhoneProperty);
for(CFIndex j = 0; j < ABMultiValueGetCount(phones); j++)
{
CFStringRef phoneNumberRef = ABMultiValueCopyValueAtIndex(phones, j);
CFStringRef locLabel = ABMultiValueCopyLabelAtIndex(phones, j);
NSString *phoneLabel =(NSString*... | This is solid for ARC 64bit iOS8:
```
- (NSArray *)phoneNumbersOfContactAsStrings:(ABRecordRef)contactRef {
NSMutableArray *mobilePhones = [NSMutableArray arrayWithCapacity:0];
ABMultiValueRef phones = ABRecordCopyValue(contactRef, kABPersonPhoneProperty);
NSArray *allPhoneNumbers = (NSArray *)CFBridgingRelease(ABMu... |
10,391,922 | I want to get all the phone numbers with diff labels like "iPhone", "home phone", "mobile number", "other numbers" , etc. for a contact stored in iPhone address book.
How do I get it?
Please help.
Thanks in advance.
I am trying: which is crashing
```
ABAddressBookRef ab=ABAddressBookCreate();
CFArrayRef peopl... | 2012/04/30 | [
"https://Stackoverflow.com/questions/10391922",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/95873/"
] | Solved it this way:
```
ABAddressBookRef addressBook = ABAddressBookCreate();
CFArrayRef all = ABAddressBookCopyArrayOfAllPeople(addressBook);
CFIndex n = ABAddressBookGetPersonCount(addressBook);
for( int i = 0 ; i < n ; i++ )
{
ABRecordRef ref = CFArrayGetValueAtIndex(all, i);
NSString *firstName = (NSStr... | Also to get phone number with particular record id, do this:
```
ABAddressBookRef addressBook = ABAddressBookCreate();
CFArrayRef all = ABAddressBookCopyArrayOfAllPeople(addressBook);
ABRecordRef ref = CFArrayGetValueAtIndex(all, indexPath.row);
NSString *firstName = (NSString *)ABRecordCopyVa... |
10,391,922 | I want to get all the phone numbers with diff labels like "iPhone", "home phone", "mobile number", "other numbers" , etc. for a contact stored in iPhone address book.
How do I get it?
Please help.
Thanks in advance.
I am trying: which is crashing
```
ABAddressBookRef ab=ABAddressBookCreate();
CFArrayRef peopl... | 2012/04/30 | [
"https://Stackoverflow.com/questions/10391922",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/95873/"
] | This is solid for ARC 64bit iOS8:
```
- (NSArray *)phoneNumbersOfContactAsStrings:(ABRecordRef)contactRef {
NSMutableArray *mobilePhones = [NSMutableArray arrayWithCapacity:0];
ABMultiValueRef phones = ABRecordCopyValue(contactRef, kABPersonPhoneProperty);
NSArray *allPhoneNumbers = (NSArray *)CFBridgingRelease(ABMu... | Also to get phone number with particular record id, do this:
```
ABAddressBookRef addressBook = ABAddressBookCreate();
CFArrayRef all = ABAddressBookCopyArrayOfAllPeople(addressBook);
ABRecordRef ref = CFArrayGetValueAtIndex(all, indexPath.row);
NSString *firstName = (NSString *)ABRecordCopyVa... |
34,431,379 | I have a cookbook that performs some installation on the target node. I want to log the output of chef client run in /var/log/. I want to embed certain code in the recipe that logs the output.
```
java "java home" do
java_source "https://url
action :install
end
``` | 2015/12/23 | [
"https://Stackoverflow.com/questions/34431379",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3086014/"
] | From inside a recipe, you can do this:
```
log 'message' do
message 'A message add to the log.'
level :info
end
```
or, using code:
`Chef::Log.debug "Your message here"`
<https://docs.chef.io/resource_log.html> | You can control the Chef log level via either the `log_level` option in `client.rb` or the `--log-level` (`-l`) command ling flag. You can log additional data using the `log` resource from your recipe code. |
63,945,063 | There are 1000 txt files in a folder.
The contents of the files are as follows:
```
("a1", "b1")
```
I want to combine all the files into one file. However, I have to separate the contents of each file with commas.
```
("a1", "b1"), ("a2", "b2")
```
Then I need to add a fixed text at the beginning and end as belo... | 2020/09/17 | [
"https://Stackoverflow.com/questions/63945063",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Here an attempt to do it with an awk one-liner (I used 3 columns for easier demonstration):
```
awk 'BEGIN{printf "START "} NR == 1 { printf "%s", $0; next} NR % 3 == 1 { printf " END\nSTART %s", $0;next} {printf ", %s", $0} END { print " END"}' file*
$ awk 'BEGIN{printf "START "} NR == 1 { printf "%s", $0; next} NR... | I know you asked for it in shell - but technically, if you prepend the Python solution with a `python -c "`, it is shell, is not it? [wink]
```
#! /usr/bin/env python3
import os
contents = []
with ('all.txt', 'wt') as output:
for filename in os.listdir('.'):
if filename == 'all.txt': continue
conte... |
63,945,063 | There are 1000 txt files in a folder.
The contents of the files are as follows:
```
("a1", "b1")
```
I want to combine all the files into one file. However, I have to separate the contents of each file with commas.
```
("a1", "b1"), ("a2", "b2")
```
Then I need to add a fixed text at the beginning and end as belo... | 2020/09/17 | [
"https://Stackoverflow.com/questions/63945063",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I know you asked for it in shell - but technically, if you prepend the Python solution with a `python -c "`, it is shell, is not it? [wink]
```
#! /usr/bin/env python3
import os
contents = []
with ('all.txt', 'wt') as output:
for filename in os.listdir('.'):
if filename == 'all.txt': continue
conte... | Bash variant
```
n=1; while read -r line; do
((n==1)) && printf 'start '
printf "$line"
((n>=10)) && { printf ' end\n'; n=1 ; } \
|| { printf ', ' ; ((n++)); }
done < <(cat file*)
``` |
63,945,063 | There are 1000 txt files in a folder.
The contents of the files are as follows:
```
("a1", "b1")
```
I want to combine all the files into one file. However, I have to separate the contents of each file with commas.
```
("a1", "b1"), ("a2", "b2")
```
Then I need to add a fixed text at the beginning and end as belo... | 2020/09/17 | [
"https://Stackoverflow.com/questions/63945063",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Here an attempt to do it with an awk one-liner (I used 3 columns for easier demonstration):
```
awk 'BEGIN{printf "START "} NR == 1 { printf "%s", $0; next} NR % 3 == 1 { printf " END\nSTART %s", $0;next} {printf ", %s", $0} END { print " END"}' file*
$ awk 'BEGIN{printf "START "} NR == 1 { printf "%s", $0; next} NR... | Something like this (untested) should do it:
```
awk '
{ rec = (rec=="" ? "" : rec ", ") $0 }
(NR%100) == 0 {
print "START", rec, "END"
rec = ""
}
' *
``` |
63,945,063 | There are 1000 txt files in a folder.
The contents of the files are as follows:
```
("a1", "b1")
```
I want to combine all the files into one file. However, I have to separate the contents of each file with commas.
```
("a1", "b1"), ("a2", "b2")
```
Then I need to add a fixed text at the beginning and end as belo... | 2020/09/17 | [
"https://Stackoverflow.com/questions/63945063",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Here an attempt to do it with an awk one-liner (I used 3 columns for easier demonstration):
```
awk 'BEGIN{printf "START "} NR == 1 { printf "%s", $0; next} NR % 3 == 1 { printf " END\nSTART %s", $0;next} {printf ", %s", $0} END { print " END"}' file*
$ awk 'BEGIN{printf "START "} NR == 1 { printf "%s", $0; next} NR... | Bash variant
```
n=1; while read -r line; do
((n==1)) && printf 'start '
printf "$line"
((n>=10)) && { printf ' end\n'; n=1 ; } \
|| { printf ', ' ; ((n++)); }
done < <(cat file*)
``` |
63,945,063 | There are 1000 txt files in a folder.
The contents of the files are as follows:
```
("a1", "b1")
```
I want to combine all the files into one file. However, I have to separate the contents of each file with commas.
```
("a1", "b1"), ("a2", "b2")
```
Then I need to add a fixed text at the beginning and end as belo... | 2020/09/17 | [
"https://Stackoverflow.com/questions/63945063",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Something like this (untested) should do it:
```
awk '
{ rec = (rec=="" ? "" : rec ", ") $0 }
(NR%100) == 0 {
print "START", rec, "END"
rec = ""
}
' *
``` | Bash variant
```
n=1; while read -r line; do
((n==1)) && printf 'start '
printf "$line"
((n>=10)) && { printf ' end\n'; n=1 ; } \
|| { printf ', ' ; ((n++)); }
done < <(cat file*)
``` |
68,486 | It took me while to finish, but here is my custom matrix class. I assume that the row/column iterators are the most critical part of this class but anyway I would very much appreciate your ideas of this project.
```
#include <iostream>
#include <iomanip>
#include <ios>
#include <sstream>
#include <algorithm>
#includ... | 2014/10/31 | [
"https://codereview.stackexchange.com/questions/68486",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/53866/"
] | The first rule of matrix classes in C++ is that you don't write them by yourself; there are already dozens around, often highly optimized with [smart] expression templates and other cryptic stuff: [Boost.uBLAS](http://www.boost.org/doc/libs/1_56_0/libs/numeric/ublas/doc/index.htm), [Eigen](http://eigen.tuxfamily.org/in... | There's not a lot left after the characteristically excellent answer from [Morwenn](https://codereview.stackexchange.com/users/15094/morwenn), but I noticed a few things that may also help.
First, I see a lot right with this code. You didn't use `using namespace std;`, your functions are actually documented with comme... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.