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
1,888
Hydrogen is the lightest element, so it's cable of lifting the most weight in out atmosphere (probably not the best terminology there, but you get the picture) Would hot hydrogen (in the same sense as hot air) be able to lift even more mass? Would a higher or lower density of hydrogen in a ballon lift more? If you cou...
2010/12/13
[ "https://physics.stackexchange.com/questions/1888", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/4/" ]
A vacuum balloon is a possibility, but I doubt it can provide more lift than a hydrogen balloon: you need a rigid shell to prevent implosion of the vacuum balloon, and my feeling is the shell will be too heavy. However, while vacuum balloons cannot compete on lift, they can have better altitude control: you can bleed a...
Approximate mean atomic mass of air: 29 Approximate mean atomic mass of hydrogen: 2 So with both gases at the same temperature and pressure, you are getting $\frac{27}{29}=93\%$ of the theoretical lifting capacity. You would have to heat the hydrogen to about 200 C in order to get to 95% efficiency. It would be ...
33,082,748
I am very new to MOQ and have an issue I cannot solve. I have the following code I am testing (I am testing first one - **ValidateInputBankFile**): ``` #region Constructor private readonly IErrorRepository _errorRepository; private readonly IFileSystem _fileSystem; public IP_BankInfoDeserializer(IErro...
2015/10/12
[ "https://Stackoverflow.com/questions/33082748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1539189/" ]
**To answer your question** > > The problem is that my var result always returns null. I don't understand what am I doing wrong? > > > `ValidateInputBankFile` is never setup and you use loose mocks, therefore it will return null. Use Strict mocks by passing MockBehavior.Strict in the constructor of your mock and...
Personally to me it looks like you are attempting to test your class but as the same time mock it so that not all of the class runs. **I** see this as incorrect, effectively how do you know that the deserialisation code is working correctly? If your answer is another test where you mock other functionality in your cla...
4,944,156
There is the template class List. ``` template <typename Point> class List { public: template <const unsigned short N> void load ( const char *file); ... }; template <typename Point> template <const unsigned short N> void List <Point>::load ( const char *file) } ``` How to special...
2011/02/09
[ "https://Stackoverflow.com/questions/4944156", "https://Stackoverflow.com", "https://Stackoverflow.com/users/598598/" ]
It turns out that there's a provision in the C++ spec that explicitly disallows specializing a template class or function nested inside of a template class unless you also explicitly specialize the outer template as well. Visual Studio doesn't enforce this rule, hence the confusion with the previous example, but g++ ce...
**Edit**: Ok, so I rewrote your class a bit, with inlined function definitions, and this definitely works: ``` template <typename Point> class List { public: template <const unsigned short N> void load( const char *file){ } template<> void load<2>(const char* file){ } }; ```
4,944,156
There is the template class List. ``` template <typename Point> class List { public: template <const unsigned short N> void load ( const char *file); ... }; template <typename Point> template <const unsigned short N> void List <Point>::load ( const char *file) } ``` How to special...
2011/02/09
[ "https://Stackoverflow.com/questions/4944156", "https://Stackoverflow.com", "https://Stackoverflow.com/users/598598/" ]
It turns out that there's a provision in the C++ spec that explicitly disallows specializing a template class or function nested inside of a template class unless you also explicitly specialize the outer template as well. Visual Studio doesn't enforce this rule, hence the confusion with the previous example, but g++ ce...
You cannot specialize a member template without also specializing the class template. I also wonder what the meaning of N could be, as it is not used in the function parameter?
652,556
This is my first time setting up an Ubuntu Server (14.04 LTS) and I am having trouble configuring the firewall (UFW). I only need `ssh` and `http`, so I am doing this: ``` sudo ufw disable sudo ufw reset sudo ufw default deny incoming sudo ufw default allow outgoing sudo ufw allow 22/tcp sudo ufw allow 80/tcp sudo...
2015/07/25
[ "https://askubuntu.com/questions/652556", "https://askubuntu.com", "https://askubuntu.com/users/433097/" ]
Use of `/etc/docker/daemon.json` with content ``` { "iptables": false } ``` might sound like a solution **but it only works until the next reboot**. After that you may notice that none of your containers has access to Internet so you can't for example ping any website. It may be undesired behavior. Same applies t...
**An addition to the accepted answer** If you map a port like `127.0.0.1:8080:8080` to keep it closed from the Internet, but still want to be able to access it from your working environment (e.g for monitoring/administration/debugging purposes, with IP whitelist or ssh tunnel) there is a "well-known" solution for that...
652,556
This is my first time setting up an Ubuntu Server (14.04 LTS) and I am having trouble configuring the firewall (UFW). I only need `ssh` and `http`, so I am doing this: ``` sudo ufw disable sudo ufw reset sudo ufw default deny incoming sudo ufw default allow outgoing sudo ufw allow 22/tcp sudo ufw allow 80/tcp sudo...
2015/07/25
[ "https://askubuntu.com/questions/652556", "https://askubuntu.com", "https://askubuntu.com/users/433097/" ]
In my case I've ended up modifying iptables to allow access to Docker only from specific IPs. As per [ESala's answer](https://askubuntu.com/posts/652572/revisions): > > If you use `-p` flag on containers Docker makes changes directly to iptables, ignoring the ufw. > > > **Example of records added to iptables by ...
**An addition to the accepted answer** If you map a port like `127.0.0.1:8080:8080` to keep it closed from the Internet, but still want to be able to access it from your working environment (e.g for monitoring/administration/debugging purposes, with IP whitelist or ssh tunnel) there is a "well-known" solution for that...
652,556
This is my first time setting up an Ubuntu Server (14.04 LTS) and I am having trouble configuring the firewall (UFW). I only need `ssh` and `http`, so I am doing this: ``` sudo ufw disable sudo ufw reset sudo ufw default deny incoming sudo ufw default allow outgoing sudo ufw allow 22/tcp sudo ufw allow 80/tcp sudo...
2015/07/25
[ "https://askubuntu.com/questions/652556", "https://askubuntu.com", "https://askubuntu.com/users/433097/" ]
In my case I've ended up modifying iptables to allow access to Docker only from specific IPs. As per [ESala's answer](https://askubuntu.com/posts/652572/revisions): > > If you use `-p` flag on containers Docker makes changes directly to iptables, ignoring the ufw. > > > **Example of records added to iptables by ...
A fast workaround is when running Docker and doing the port mapping. You can always do ``` docker run ...-p 127.0.0.1:<ext pot>:<internal port> ... ``` to prevent your Docker from being accessed from outside.
652,556
This is my first time setting up an Ubuntu Server (14.04 LTS) and I am having trouble configuring the firewall (UFW). I only need `ssh` and `http`, so I am doing this: ``` sudo ufw disable sudo ufw reset sudo ufw default deny incoming sudo ufw default allow outgoing sudo ufw allow 22/tcp sudo ufw allow 80/tcp sudo...
2015/07/25
[ "https://askubuntu.com/questions/652556", "https://askubuntu.com", "https://askubuntu.com/users/433097/" ]
The problem was using the `-p` flag on containers. It turns out that Docker makes changes directly on your `iptables`, which are not shown with `ufw status`. Possible solutions are: 1. Stop using the `-p` flag. Use docker linking or [docker networks](https://docs.docker.com/engine/userguide/networking/) instead. 2. ...
Use --network=host when you start container so docker will map port to isolated host-only network instead of default bridge network. I see no legal ways to block bridged network. Alternatively you can use custom user-defined network with isolation.
652,556
This is my first time setting up an Ubuntu Server (14.04 LTS) and I am having trouble configuring the firewall (UFW). I only need `ssh` and `http`, so I am doing this: ``` sudo ufw disable sudo ufw reset sudo ufw default deny incoming sudo ufw default allow outgoing sudo ufw allow 22/tcp sudo ufw allow 80/tcp sudo...
2015/07/25
[ "https://askubuntu.com/questions/652556", "https://askubuntu.com", "https://askubuntu.com/users/433097/" ]
The problem was using the `-p` flag on containers. It turns out that Docker makes changes directly on your `iptables`, which are not shown with `ufw status`. Possible solutions are: 1. Stop using the `-p` flag. Use docker linking or [docker networks](https://docs.docker.com/engine/userguide/networking/) instead. 2. ...
Use of `/etc/docker/daemon.json` with content ``` { "iptables": false } ``` might sound like a solution **but it only works until the next reboot**. After that you may notice that none of your containers has access to Internet so you can't for example ping any website. It may be undesired behavior. Same applies t...
652,556
This is my first time setting up an Ubuntu Server (14.04 LTS) and I am having trouble configuring the firewall (UFW). I only need `ssh` and `http`, so I am doing this: ``` sudo ufw disable sudo ufw reset sudo ufw default deny incoming sudo ufw default allow outgoing sudo ufw allow 22/tcp sudo ufw allow 80/tcp sudo...
2015/07/25
[ "https://askubuntu.com/questions/652556", "https://askubuntu.com", "https://askubuntu.com/users/433097/" ]
The problem was using the `-p` flag on containers. It turns out that Docker makes changes directly on your `iptables`, which are not shown with `ufw status`. Possible solutions are: 1. Stop using the `-p` flag. Use docker linking or [docker networks](https://docs.docker.com/engine/userguide/networking/) instead. 2. ...
UPDATE 10.2021 ============== When we use only one port-number then docker will use an ephemeral port see [docker-compose ports](https://docs.docker.com/compose/compose-file/compose-file-v3/#ports) > > Specify just the container port (an ephemeral host port is chosen for the host port). > > > I thought that my o...
652,556
This is my first time setting up an Ubuntu Server (14.04 LTS) and I am having trouble configuring the firewall (UFW). I only need `ssh` and `http`, so I am doing this: ``` sudo ufw disable sudo ufw reset sudo ufw default deny incoming sudo ufw default allow outgoing sudo ufw allow 22/tcp sudo ufw allow 80/tcp sudo...
2015/07/25
[ "https://askubuntu.com/questions/652556", "https://askubuntu.com", "https://askubuntu.com/users/433097/" ]
In my case I've ended up modifying iptables to allow access to Docker only from specific IPs. As per [ESala's answer](https://askubuntu.com/posts/652572/revisions): > > If you use `-p` flag on containers Docker makes changes directly to iptables, ignoring the ufw. > > > **Example of records added to iptables by ...
Use of `/etc/docker/daemon.json` with content ``` { "iptables": false } ``` might sound like a solution **but it only works until the next reboot**. After that you may notice that none of your containers has access to Internet so you can't for example ping any website. It may be undesired behavior. Same applies t...
652,556
This is my first time setting up an Ubuntu Server (14.04 LTS) and I am having trouble configuring the firewall (UFW). I only need `ssh` and `http`, so I am doing this: ``` sudo ufw disable sudo ufw reset sudo ufw default deny incoming sudo ufw default allow outgoing sudo ufw allow 22/tcp sudo ufw allow 80/tcp sudo...
2015/07/25
[ "https://askubuntu.com/questions/652556", "https://askubuntu.com", "https://askubuntu.com/users/433097/" ]
A fast workaround is when running Docker and doing the port mapping. You can always do ``` docker run ...-p 127.0.0.1:<ext pot>:<internal port> ... ``` to prevent your Docker from being accessed from outside.
1. Login to your docker console: > > sudo docker exec -i -t **docker\_image\_name** /bin/bash > > > 2. And then inside your docker console: > > > ``` > sudo apt-get update > sudo apt-get install ufw > sudo ufw allow 22 > > ``` > > 3. Add your ufw rules and enable the ufw > > sudo ufw enable > > > * Your...
652,556
This is my first time setting up an Ubuntu Server (14.04 LTS) and I am having trouble configuring the firewall (UFW). I only need `ssh` and `http`, so I am doing this: ``` sudo ufw disable sudo ufw reset sudo ufw default deny incoming sudo ufw default allow outgoing sudo ufw allow 22/tcp sudo ufw allow 80/tcp sudo...
2015/07/25
[ "https://askubuntu.com/questions/652556", "https://askubuntu.com", "https://askubuntu.com/users/433097/" ]
In my case I've ended up modifying iptables to allow access to Docker only from specific IPs. As per [ESala's answer](https://askubuntu.com/posts/652572/revisions): > > If you use `-p` flag on containers Docker makes changes directly to iptables, ignoring the ufw. > > > **Example of records added to iptables by ...
UPDATE 10.2021 ============== When we use only one port-number then docker will use an ephemeral port see [docker-compose ports](https://docs.docker.com/compose/compose-file/compose-file-v3/#ports) > > Specify just the container port (an ephemeral host port is chosen for the host port). > > > I thought that my o...
652,556
This is my first time setting up an Ubuntu Server (14.04 LTS) and I am having trouble configuring the firewall (UFW). I only need `ssh` and `http`, so I am doing this: ``` sudo ufw disable sudo ufw reset sudo ufw default deny incoming sudo ufw default allow outgoing sudo ufw allow 22/tcp sudo ufw allow 80/tcp sudo...
2015/07/25
[ "https://askubuntu.com/questions/652556", "https://askubuntu.com", "https://askubuntu.com/users/433097/" ]
The problem was using the `-p` flag on containers. It turns out that Docker makes changes directly on your `iptables`, which are not shown with `ufw status`. Possible solutions are: 1. Stop using the `-p` flag. Use docker linking or [docker networks](https://docs.docker.com/engine/userguide/networking/) instead. 2. ...
A fast workaround is when running Docker and doing the port mapping. You can always do ``` docker run ...-p 127.0.0.1:<ext pot>:<internal port> ... ``` to prevent your Docker from being accessed from outside.
51,200,369
This is an extension of the question posed [here](https://stackoverflow.com/questions/20360675/roll-rows-of-a-matrix-independently) (quoted below) > > I have a matrix (2d numpy ndarray, to be precise): > > > > ``` > A = np.array([[4, 0, 0], > [1, 2, 3], > [0, 0, 5]]) > > ``` > > And I...
2018/07/05
[ "https://Stackoverflow.com/questions/51200369", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3826115/" ]
Inspired by [Roll rows of a matrix independently's solution](https://stackoverflow.com/a/51613442/), here's a vectorized one based on [`np.lib.stride_tricks.as_strided`](http://www.scipy-lectures.org/advanced/advanced_numpy/#indexing-scheme-strides) - ``` from skimage.util.shape import view_as_windows as viewW def st...
I was able to hack this together with linear indexing...it gets the right result but performs rather slowly on large arrays. ``` A = np.array([[4, 0, 0], [1, 2, 3], [0, 0, 5]]).astype(float) r = np.array([2, 0, -1]) rows, column_indices = np.ogrid[:A.shape[0], :A.shape[1]] # Use always a...
51,200,369
This is an extension of the question posed [here](https://stackoverflow.com/questions/20360675/roll-rows-of-a-matrix-independently) (quoted below) > > I have a matrix (2d numpy ndarray, to be precise): > > > > ``` > A = np.array([[4, 0, 0], > [1, 2, 3], > [0, 0, 5]]) > > ``` > > And I...
2018/07/05
[ "https://Stackoverflow.com/questions/51200369", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3826115/" ]
Inspired by [Roll rows of a matrix independently's solution](https://stackoverflow.com/a/51613442/), here's a vectorized one based on [`np.lib.stride_tricks.as_strided`](http://www.scipy-lectures.org/advanced/advanced_numpy/#indexing-scheme-strides) - ``` from skimage.util.shape import view_as_windows as viewW def st...
Based on @Seberg and @yann-dubois answers in the non-nan case, I've written a method that: * Is faster than the current answer * Works on ndarrays of any shape (specify the row-axis using the `axis` argument) * Allows for setting `fill` to either np.nan, any other "fill value" or False to allow regular rolling across ...
16,670,806
I have this in my `index.html` file but it does not show the paragraph that I want to add with `D3` ``` <!DOCTYPE html> <html> <head> <title> D3 page template </title> <script type="text/javascript" src = "d3/d3.v3.js"></script> </head> <body> <script type="text/javascript"> d3.select("body...
2013/05/21
[ "https://Stackoverflow.com/questions/16670806", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You are missing the character set in your HTML page. Add something like this: ``` <meta charset="utf-8"> ``` The un-minified source of D3 includes the actual symbol for pi, which confuses the browser if the character set is not defined.
I am going to assume that you are testing this out without a web server. If so, then your URL will read file://.... not http://.. With this, the Javascript request will go to file:///.../D3/d3/d3.v3.js which won't have the proper response header set, such as charset and MIME. You can always get it from a CDN to avoi...
16,670,806
I have this in my `index.html` file but it does not show the paragraph that I want to add with `D3` ``` <!DOCTYPE html> <html> <head> <title> D3 page template </title> <script type="text/javascript" src = "d3/d3.v3.js"></script> </head> <body> <script type="text/javascript"> d3.select("body...
2013/05/21
[ "https://Stackoverflow.com/questions/16670806", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You are missing the character set in your HTML page. Add something like this: ``` <meta charset="utf-8"> ``` The un-minified source of D3 includes the actual symbol for pi, which confuses the browser if the character set is not defined.
Was having similar issue. My problem was my script file was loading before it could load the d3js library. Just adding `defer` fixed the issue. `<script src="app.js" defer></script>`
16,670,806
I have this in my `index.html` file but it does not show the paragraph that I want to add with `D3` ``` <!DOCTYPE html> <html> <head> <title> D3 page template </title> <script type="text/javascript" src = "d3/d3.v3.js"></script> </head> <body> <script type="text/javascript"> d3.select("body...
2013/05/21
[ "https://Stackoverflow.com/questions/16670806", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I am going to assume that you are testing this out without a web server. If so, then your URL will read file://.... not http://.. With this, the Javascript request will go to file:///.../D3/d3/d3.v3.js which won't have the proper response header set, such as charset and MIME. You can always get it from a CDN to avoi...
Was having similar issue. My problem was my script file was loading before it could load the d3js library. Just adding `defer` fixed the issue. `<script src="app.js" defer></script>`
178,294
A few words in the WP Job Manager weren't translated yet. I edited most of them in de po file now but for the sentence "posted 5 hours ago" I can't find where to translate the "Hours" It's declared as `%s` in the po file, Cant find the word hour in any of the plugin's files... so where to change the "hours" term of...
2015/02/16
[ "https://wordpress.stackexchange.com/questions/178294", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/67623/" ]
I think you need to understand how the code you are using works. The code that output the string is: ``` <?php printf( __( '%s ago', 'wp-job-manager' ), human_time_diff( get_post_time( 'U' ), current_time( 'timestamp' ) ) ); ?> ``` In the above code, `__( '%s ago', 'wp-job-manager' )` is translated by wp-job-manager...
Since your problem resolves around the fact that the WP theme developers used a function that doesn't have any hooks so we could easily alter the output, you're going to have to copy & paste the following code in your functions.php file ``` function human_time_diff( $from, $to = '' ) { if ( empty( $to ) ) { ...
73,872,837
I am using axios to fetch and retrieve data from an api. I then set the api data to some state. When I save the changes, it shows the name from index [0] of the array, as I want. However when I refresh the page, it throws an error "Cannot read properties of undefined (reading 'name')". It seems like I am losing the api...
2022/09/27
[ "https://Stackoverflow.com/questions/73872837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19883046/" ]
You do not need to compute the friendship duration in advance, unless you need it for later. You can compute it on the fly as follows: ```js const friends = [ { name: "Michael", start: 1981, end: 2004 }, { name: "Joe", start: 1992, end: 2008 }, { name: "Sara", start: 1999, end: 2007 }, { name: "Marcel", start:...
You need to calculate the duration for both c1 and c2 and then compare those two calculated values each time the comparison function is called. ```js const friends = [ { name: "Michael", start: 1981, end: 2004 }, { name: "Joe", start: 1992, end: 2008 }, { name: "Sara", start: 1999, end: 2007 }, ...
55,820,297
im passing users list as a props to UserItem Component to make iterate on user list and displaying them on table. the list is displayed correctly and i dont have any divs in my render return but i still get the error : index.js:1446 Warning: validateDOMNesting(...): cannot appear as a child of . tried many solutions f...
2019/04/23
[ "https://Stackoverflow.com/questions/55820297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11389034/" ]
Most likely the component `Spinner` renders a `<div>` as the outermost node. Check the implementation of it. You implicitly render it inside `<tbody>` through the lines ``` <tbody> {usersList} </tbody> ``` where `usersList` defaults to `<Spinner />` when there are no users or `loading` is `true`. This is why g...
I had the same problem. I had a external spinner component that I needed to inject. This is how i solved it: ``` <table className="table profit-withdrawal"> <thead className="thead-default"> <tr> <th>Nick Name</th> <th>Transfer to</th> <th>Details</th> <th>Ac...
55,820,297
im passing users list as a props to UserItem Component to make iterate on user list and displaying them on table. the list is displayed correctly and i dont have any divs in my render return but i still get the error : index.js:1446 Warning: validateDOMNesting(...): cannot appear as a child of . tried many solutions f...
2019/04/23
[ "https://Stackoverflow.com/questions/55820297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11389034/" ]
Most likely the component `Spinner` renders a `<div>` as the outermost node. Check the implementation of it. You implicitly render it inside `<tbody>` through the lines ``` <tbody> {usersList} </tbody> ``` where `usersList` defaults to `<Spinner />` when there are no users or `loading` is `true`. This is why g...
validateDOMNesting(...): cannot appear as a child of `<div>`. I see an error similar to this You replace : tag `<body> to <div>`
55,820,297
im passing users list as a props to UserItem Component to make iterate on user list and displaying them on table. the list is displayed correctly and i dont have any divs in my render return but i still get the error : index.js:1446 Warning: validateDOMNesting(...): cannot appear as a child of . tried many solutions f...
2019/04/23
[ "https://Stackoverflow.com/questions/55820297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11389034/" ]
Most likely the component `Spinner` renders a `<div>` as the outermost node. Check the implementation of it. You implicitly render it inside `<tbody>` through the lines ``` <tbody> {usersList} </tbody> ``` where `usersList` defaults to `<Spinner />` when there are no users or `loading` is `true`. This is why g...
It may not be your case, but it may be someone else's. It's kind of embarrassing but I had this problem because I was importing the wrong component: ``` import Table from 'react-bootstrap/Col'; <-- Is a Col not a Table ``` Check if the imports are correct
55,820,297
im passing users list as a props to UserItem Component to make iterate on user list and displaying them on table. the list is displayed correctly and i dont have any divs in my render return but i still get the error : index.js:1446 Warning: validateDOMNesting(...): cannot appear as a child of . tried many solutions f...
2019/04/23
[ "https://Stackoverflow.com/questions/55820297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11389034/" ]
Most likely the component `Spinner` renders a `<div>` as the outermost node. Check the implementation of it. You implicitly render it inside `<tbody>` through the lines ``` <tbody> {usersList} </tbody> ``` where `usersList` defaults to `<Spinner />` when there are no users or `loading` is `true`. This is why g...
In case someone gets this error and use render like : ``` ... {usersData ? ( Object.values(usersData)?.map((user: any) => ( <div key={user?.id}> <tr> <td>{user?.id}1</td> <td>2</td> <td>3</td> </tr> </div> )) ) : ( <Box> {' '} <tr> <td>1</td> <td>2...
55,820,297
im passing users list as a props to UserItem Component to make iterate on user list and displaying them on table. the list is displayed correctly and i dont have any divs in my render return but i still get the error : index.js:1446 Warning: validateDOMNesting(...): cannot appear as a child of . tried many solutions f...
2019/04/23
[ "https://Stackoverflow.com/questions/55820297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11389034/" ]
I had the same problem. I had a external spinner component that I needed to inject. This is how i solved it: ``` <table className="table profit-withdrawal"> <thead className="thead-default"> <tr> <th>Nick Name</th> <th>Transfer to</th> <th>Details</th> <th>Ac...
It may not be your case, but it may be someone else's. It's kind of embarrassing but I had this problem because I was importing the wrong component: ``` import Table from 'react-bootstrap/Col'; <-- Is a Col not a Table ``` Check if the imports are correct
55,820,297
im passing users list as a props to UserItem Component to make iterate on user list and displaying them on table. the list is displayed correctly and i dont have any divs in my render return but i still get the error : index.js:1446 Warning: validateDOMNesting(...): cannot appear as a child of . tried many solutions f...
2019/04/23
[ "https://Stackoverflow.com/questions/55820297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11389034/" ]
I had the same problem. I had a external spinner component that I needed to inject. This is how i solved it: ``` <table className="table profit-withdrawal"> <thead className="thead-default"> <tr> <th>Nick Name</th> <th>Transfer to</th> <th>Details</th> <th>Ac...
In case someone gets this error and use render like : ``` ... {usersData ? ( Object.values(usersData)?.map((user: any) => ( <div key={user?.id}> <tr> <td>{user?.id}1</td> <td>2</td> <td>3</td> </tr> </div> )) ) : ( <Box> {' '} <tr> <td>1</td> <td>2...
55,820,297
im passing users list as a props to UserItem Component to make iterate on user list and displaying them on table. the list is displayed correctly and i dont have any divs in my render return but i still get the error : index.js:1446 Warning: validateDOMNesting(...): cannot appear as a child of . tried many solutions f...
2019/04/23
[ "https://Stackoverflow.com/questions/55820297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11389034/" ]
validateDOMNesting(...): cannot appear as a child of `<div>`. I see an error similar to this You replace : tag `<body> to <div>`
It may not be your case, but it may be someone else's. It's kind of embarrassing but I had this problem because I was importing the wrong component: ``` import Table from 'react-bootstrap/Col'; <-- Is a Col not a Table ``` Check if the imports are correct
55,820,297
im passing users list as a props to UserItem Component to make iterate on user list and displaying them on table. the list is displayed correctly and i dont have any divs in my render return but i still get the error : index.js:1446 Warning: validateDOMNesting(...): cannot appear as a child of . tried many solutions f...
2019/04/23
[ "https://Stackoverflow.com/questions/55820297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11389034/" ]
validateDOMNesting(...): cannot appear as a child of `<div>`. I see an error similar to this You replace : tag `<body> to <div>`
In case someone gets this error and use render like : ``` ... {usersData ? ( Object.values(usersData)?.map((user: any) => ( <div key={user?.id}> <tr> <td>{user?.id}1</td> <td>2</td> <td>3</td> </tr> </div> )) ) : ( <Box> {' '} <tr> <td>1</td> <td>2...
62,417,963
I have a question about how to make an iteration. I want to place a total row after each item in the array if the next element in the array matches a specific condition. Spesific conditions have logic like this the data like this [![enter image description here](https://i.stack.imgur.com/kjxAn.png)](https://i.stack.i...
2020/06/16
[ "https://Stackoverflow.com/questions/62417963", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10498511/" ]
Following logic might help you on your way: ``` <?php $stock = [ '01/01/2020' => 20, '01/02/2020' => 30, '01/03/2020' => 40 ]; showStatus($stock, 'in stock - before transaction'); $demand = 60; foreach ($stock as $key => $value) { if ($value <= $demand) { $stock[$key] = 0; $supplied[...
I'm not sure I've understood you correctly but this might help: ``` $values = [ '01/01/2020' => 20, '01/02/2020' => 30, '01/03/2020' => 40 ]; $demand = 60; $total = array_sum($values); $decrease = $total - $demand; //(20+30+40) - 60 = 30 $last_key = array_keys($values,end($values))[0]; //Is 01/03/2020 in...
7,234
Can anyone help me identify what LEGO set this is from? My son has it half built and we cannot find the instructions and the bricks have been mixed with his other LEGO. [![enter image description here](https://i.stack.imgur.com/MY9dC.jpg)](https://i.stack.imgur.com/MY9dC.jpg)
2016/01/16
[ "https://bricks.stackexchange.com/questions/7234", "https://bricks.stackexchange.com", "https://bricks.stackexchange.com/users/6723/" ]
Based on the different shades of gray and the odd placement of the ball joint, I believe this is not a Lego set. Its more likely that it is something your son made out of his imagination and other Lego pieces.
I personally don't think this is lego. I've seen some of the elements in the pictures in Kre-o battleships sets. Perhaps you can evaluate on that?
28,018,253
I've been trying to make this work for 2 days now and have read many examples and stack overflow questions. I'm new to html and css, this is my 3rd day. Any tips or insights into what I'm doing wrong would be much appreciated, as well as general comments or criticisms. I'm trying to make the blue pane on the left side...
2015/01/19
[ "https://Stackoverflow.com/questions/28018253", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1902625/" ]
You need a `container`, otherwise `leftpane` wouldn't know how much the `rightpane` expands. So with `container` in place, the `container` will expand with `rightpane` and since `leftpane` is child object of `container` it gets the `height` of it when set to `100%` with some appropriate positioning. ```css /* Lightest...
Refer here: [here](https://stackoverflow.com/questions/5671012/extend-div-height-to-entire-webpage) ``` <div><!-- make a <div> to hold everything in.. --> <div style="width:125;height:100%;">blah blah blah</div> <div style="height:100%;">blah blah blah</div> </div> ```
28,018,253
I've been trying to make this work for 2 days now and have read many examples and stack overflow questions. I'm new to html and css, this is my 3rd day. Any tips or insights into what I'm doing wrong would be much appreciated, as well as general comments or criticisms. I'm trying to make the blue pane on the left side...
2015/01/19
[ "https://Stackoverflow.com/questions/28018253", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1902625/" ]
Well the problem is, all your elements(leftpane, rightpane, header and mainContent) are positioned *absolute*. **Absolutely positioned elements are removed from the normal flow** and positioned relative to the first parent element that has a position other than *static* (in this case, "html"). [hint: open firebug and ...
Refer here: [here](https://stackoverflow.com/questions/5671012/extend-div-height-to-entire-webpage) ``` <div><!-- make a <div> to hold everything in.. --> <div style="width:125;height:100%;">blah blah blah</div> <div style="height:100%;">blah blah blah</div> </div> ```
28,018,253
I've been trying to make this work for 2 days now and have read many examples and stack overflow questions. I'm new to html and css, this is my 3rd day. Any tips or insights into what I'm doing wrong would be much appreciated, as well as general comments or criticisms. I'm trying to make the blue pane on the left side...
2015/01/19
[ "https://Stackoverflow.com/questions/28018253", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1902625/" ]
You need a `container`, otherwise `leftpane` wouldn't know how much the `rightpane` expands. So with `container` in place, the `container` will expand with `rightpane` and since `leftpane` is child object of `container` it gets the `height` of it when set to `100%` with some appropriate positioning. ```css /* Lightest...
Well the problem is, all your elements(leftpane, rightpane, header and mainContent) are positioned *absolute*. **Absolutely positioned elements are removed from the normal flow** and positioned relative to the first parent element that has a position other than *static* (in this case, "html"). [hint: open firebug and ...
46,933,951
We are using Google Cloud SQL for our project but facing some administrative issues around it . In our cloud DB We have two users like : root% (any host) root182.68.122.202 Now we need "SUPER" user access on these two users to perform some admin tasks like modifying the variable 'max\_allowed\_packet' to higher lim...
2017/10/25
[ "https://Stackoverflow.com/questions/46933951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2935602/" ]
According to Google’s [Cloud SQL documentation](https://cloud.google.com/sql/docs/mysql/users#root-user), the root user has all privileges but SUPER and FILE. It’s a characteristic of the Google Cloud SQL. But rest assured! You have three other ways of easily changing that global "group by" variable that has been slow...
You can edit your running instance. From the left menu in the SQL section : 1. view your instance detail by clicking on the concerned line 2. click on the "Edit button", in the configuration block, edit the "add database flags" add a new item by choosing in the defined list 3. Don't forget to save your new flag by hi...
46,933,951
We are using Google Cloud SQL for our project but facing some administrative issues around it . In our cloud DB We have two users like : root% (any host) root182.68.122.202 Now we need "SUPER" user access on these two users to perform some admin tasks like modifying the variable 'max\_allowed\_packet' to higher lim...
2017/10/25
[ "https://Stackoverflow.com/questions/46933951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2935602/" ]
Google Cloud SQL does not support SUPER privileges, which means that GRANT ALL PRIVILEGES statements will not work. As an alternative, you can use GRANT ALL ON `%`.\*.
You can edit your running instance. From the left menu in the SQL section : 1. view your instance detail by clicking on the concerned line 2. click on the "Edit button", in the configuration block, edit the "add database flags" add a new item by choosing in the defined list 3. Don't forget to save your new flag by hi...
31,752,034
When Oracle compiles a stored procedure, it stores the AST for the procedure in DIANA format. * how can I access this AST? * are there built-in tools for processing this AST?
2015/07/31
[ "https://Stackoverflow.com/questions/31752034", "https://Stackoverflow.com", "https://Stackoverflow.com/users/116/" ]
There is an undocumented package DUMPDIANA that is meant to dump the Diana in a human-readable format. The file $ORACLE\_HOME\rdbms\admin\dumpdian.sql says "Documentation is available in /vobs/plsql/notes/dumpdiana.txt". I cannot find that file, and without it we can only guess at the meaning of some parameters. Basi...
Here is an excellent tutorial on DIANA and IDL in the PDF [How to unwrap PL/SQL](https://www.blackhat.com/presentations/bh-usa-06/BH-US-06-Finnigan.pdf) by Pete Finnigan, principal consultant at Siemens at the time of the writting, specializing in researching and securing Oracle databases. Among other very interestin...
1,175,799
There is a mean called Harmonic mean. <http://dlmf.nist.gov/1.2#E19> I mostly see usage of arithematic mean and geometric mean. On the other hand, I have never seen the usage of Harmonic mean yet. In what kind of case, is the Harmonic mean used?
2015/03/04
[ "https://math.stackexchange.com/questions/1175799", "https://math.stackexchange.com", "https://math.stackexchange.com/users/110621/" ]
You go on a round trip. You go out at $50$ miles per hour and come back at $60$ miles per hour. The average speed of your whole trip will be the harmonic mean of $50$ and $60$ (mph). You can extend this to several legs of a trip all the same length. Your overall average speed will be the harmonic mean of the speeds on ...
The harmonic mean usually appears when averaging speed (or rates in general). See this question as a reference: <https://stackoverflow.com/questions/34794664/how-should-i-calculate-the-average-speed-by-road-segment-for-multiple-segments/34795821#34795821>
476,953
I'm looking for a way to map some hot-keys to "delete the line that my cursor is on" in Xcode. I found "delete to end of line" and "delete to beginning of line" in the text key bindings, but I am missing how to completely delete the line no matter what I have selected. TextMate has this functionality mapped to Ctrl+Shi...
2009/01/25
[ "https://Stackoverflow.com/questions/476953", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53653/" ]
You can set up a system-wide key binding file that will apply to all Cocoa apps. To do what you want it should like like this: In your home folder, Library/KeyBindings/DefaultKeyBinding.dict ``` { "^D" = ( "moveToBeginningOfLine:", "deleteToEndOfLine:", ); } ``` I believe if you only want i...
I was looking for a solution to this, and I tried Ashley Clark's, but it turns out there's an easier option using an included User Script called delete Line. * Open the weird menu to the left of 'help' that looks like a scroll. * Choose Edit User Scripts... * Click the Key Bindings tab * Expand the Text section * Doub...
476,953
I'm looking for a way to map some hot-keys to "delete the line that my cursor is on" in Xcode. I found "delete to end of line" and "delete to beginning of line" in the text key bindings, but I am missing how to completely delete the line no matter what I have selected. TextMate has this functionality mapped to Ctrl+Shi...
2009/01/25
[ "https://Stackoverflow.com/questions/476953", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53653/" ]
``` <key>Custom Keyword Set</key> <dict> <key>Delete Current Line In One Hit</key> <string>moveToEndOfLine:, deleteToBeginningOfLine:, deleteToEndOfParagraph:</string> </dict> ``` I suggest to create your customized dictonary in your file **IDETextKeyBindingSet.plist**. So: * close Xcode; * open Terminal; * s...
For Xcode 9.0(beta), inserting customized key dictionary into IDETextKeyBindingSet.plist working fine for me.You need to restart XCode if already open and after next launch you will find new customized shortcuts under the KeyBindings menu. ``` <key>Customized</key> <dict> <key>Delete Rest Of Line</key> <string...
476,953
I'm looking for a way to map some hot-keys to "delete the line that my cursor is on" in Xcode. I found "delete to end of line" and "delete to beginning of line" in the text key bindings, but I am missing how to completely delete the line no matter what I have selected. TextMate has this functionality mapped to Ctrl+Shi...
2009/01/25
[ "https://Stackoverflow.com/questions/476953", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53653/" ]
As I don't always work on the same xcode I prefer not to install scripts. Xcode uses some sub-set of emacs commands. I use this approach to quickly delete a line. ^k (control-k) deletes from the cursor to the end of the line. Doing it twice also deletes the carriage return and takes up the next line. ^a takes you to t...
This works for me (Xcode 4.4.1): Same steps like described here: [Xcode duplicate line](https://stackoverflow.com/questions/10266170/xcode-4-duplicate-line) (Halley's answer) But instead of: selectLine:, copy:, moveToEndOfLine:, insertNewline:, paste:, deleteBackward: Use: selectLine:, moveToBeginningOfLine:, dele...
476,953
I'm looking for a way to map some hot-keys to "delete the line that my cursor is on" in Xcode. I found "delete to end of line" and "delete to beginning of line" in the text key bindings, but I am missing how to completely delete the line no matter what I have selected. TextMate has this functionality mapped to Ctrl+Shi...
2009/01/25
[ "https://Stackoverflow.com/questions/476953", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53653/" ]
I was looking for a solution to this, and I tried Ashley Clark's, but it turns out there's an easier option using an included User Script called delete Line. * Open the weird menu to the left of 'help' that looks like a scroll. * Choose Edit User Scripts... * Click the Key Bindings tab * Expand the Text section * Doub...
``` <key>Custom Keyword Set</key> <dict> <key>Delete Current Line In One Hit</key> <string>moveToEndOfLine:, deleteToBeginningOfLine:, deleteToEndOfParagraph:</string> </dict> ``` I suggest to create your customized dictonary in your file **IDETextKeyBindingSet.plist**. So: * close Xcode; * open Terminal; * s...
476,953
I'm looking for a way to map some hot-keys to "delete the line that my cursor is on" in Xcode. I found "delete to end of line" and "delete to beginning of line" in the text key bindings, but I am missing how to completely delete the line no matter what I have selected. TextMate has this functionality mapped to Ctrl+Shi...
2009/01/25
[ "https://Stackoverflow.com/questions/476953", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53653/" ]
You can set up a system-wide key binding file that will apply to all Cocoa apps. To do what you want it should like like this: In your home folder, Library/KeyBindings/DefaultKeyBinding.dict ``` { "^D" = ( "moveToBeginningOfLine:", "deleteToEndOfLine:", ); } ``` I believe if you only want i...
This works for me (Xcode 4.4.1): Same steps like described here: [Xcode duplicate line](https://stackoverflow.com/questions/10266170/xcode-4-duplicate-line) (Halley's answer) But instead of: selectLine:, copy:, moveToEndOfLine:, insertNewline:, paste:, deleteBackward: Use: selectLine:, moveToBeginningOfLine:, dele...
476,953
I'm looking for a way to map some hot-keys to "delete the line that my cursor is on" in Xcode. I found "delete to end of line" and "delete to beginning of line" in the text key bindings, but I am missing how to completely delete the line no matter what I have selected. TextMate has this functionality mapped to Ctrl+Shi...
2009/01/25
[ "https://Stackoverflow.com/questions/476953", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53653/" ]
You can set up a system-wide key binding file that will apply to all Cocoa apps. To do what you want it should like like this: In your home folder, Library/KeyBindings/DefaultKeyBinding.dict ``` { "^D" = ( "moveToBeginningOfLine:", "deleteToEndOfLine:", ); } ``` I believe if you only want i...
As I don't always work on the same xcode I prefer not to install scripts. Xcode uses some sub-set of emacs commands. I use this approach to quickly delete a line. ^k (control-k) deletes from the cursor to the end of the line. Doing it twice also deletes the carriage return and takes up the next line. ^a takes you to t...
476,953
I'm looking for a way to map some hot-keys to "delete the line that my cursor is on" in Xcode. I found "delete to end of line" and "delete to beginning of line" in the text key bindings, but I am missing how to completely delete the line no matter what I have selected. TextMate has this functionality mapped to Ctrl+Shi...
2009/01/25
[ "https://Stackoverflow.com/questions/476953", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53653/" ]
You can set up a system-wide key binding file that will apply to all Cocoa apps. To do what you want it should like like this: In your home folder, Library/KeyBindings/DefaultKeyBinding.dict ``` { "^D" = ( "moveToBeginningOfLine:", "deleteToEndOfLine:", ); } ``` I believe if you only want i...
If you're having trouble in modern Xcode (which I was) solution for this in Xcode 7.2 is to do what Opena [mentioned here with screenshots](https://stackoverflow.com/a/13049587/5760384) or [in text form via Velthune's answer](https://stackoverflow.com/a/26670057/5760384). Since I wanted a more direct command I simplifi...
476,953
I'm looking for a way to map some hot-keys to "delete the line that my cursor is on" in Xcode. I found "delete to end of line" and "delete to beginning of line" in the text key bindings, but I am missing how to completely delete the line no matter what I have selected. TextMate has this functionality mapped to Ctrl+Shi...
2009/01/25
[ "https://Stackoverflow.com/questions/476953", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53653/" ]
Thanks for the help, Ashley. After some experimentation I mapped my favorite TextMate commands (duplicate line, delete line). I created the file *~/Library/KeyBindings/PBKeyBinding.dict* and added the following: ``` { "^$K" = ( "selectLine:", "cut:" ); "^$D" = ( "selectLine:", ...
I was looking for a solution to this, and I tried Ashley Clark's, but it turns out there's an easier option using an included User Script called delete Line. * Open the weird menu to the left of 'help' that looks like a scroll. * Choose Edit User Scripts... * Click the Key Bindings tab * Expand the Text section * Doub...
476,953
I'm looking for a way to map some hot-keys to "delete the line that my cursor is on" in Xcode. I found "delete to end of line" and "delete to beginning of line" in the text key bindings, but I am missing how to completely delete the line no matter what I have selected. TextMate has this functionality mapped to Ctrl+Shi...
2009/01/25
[ "https://Stackoverflow.com/questions/476953", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53653/" ]
``` <key>Custom Keyword Set</key> <dict> <key>Delete Current Line In One Hit</key> <string>moveToEndOfLine:, deleteToBeginningOfLine:, deleteToEndOfParagraph:</string> </dict> ``` I suggest to create your customized dictonary in your file **IDETextKeyBindingSet.plist**. So: * close Xcode; * open Terminal; * s...
This works for me (Xcode 4.4.1): Same steps like described here: [Xcode duplicate line](https://stackoverflow.com/questions/10266170/xcode-4-duplicate-line) (Halley's answer) But instead of: selectLine:, copy:, moveToEndOfLine:, insertNewline:, paste:, deleteBackward: Use: selectLine:, moveToBeginningOfLine:, dele...
476,953
I'm looking for a way to map some hot-keys to "delete the line that my cursor is on" in Xcode. I found "delete to end of line" and "delete to beginning of line" in the text key bindings, but I am missing how to completely delete the line no matter what I have selected. TextMate has this functionality mapped to Ctrl+Shi...
2009/01/25
[ "https://Stackoverflow.com/questions/476953", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53653/" ]
As I don't always work on the same xcode I prefer not to install scripts. Xcode uses some sub-set of emacs commands. I use this approach to quickly delete a line. ^k (control-k) deletes from the cursor to the end of the line. Doing it twice also deletes the carriage return and takes up the next line. ^a takes you to t...
``` <key>Custom Keyword Set</key> <dict> <key>Delete Current Line In One Hit</key> <string>moveToEndOfLine:, deleteToBeginningOfLine:, deleteToEndOfParagraph:</string> </dict> ``` I suggest to create your customized dictonary in your file **IDETextKeyBindingSet.plist**. So: * close Xcode; * open Terminal; * s...
41,096,588
My route for pages in routes.rb ``` get ":slug", to: 'site#pages' ``` my actions in site\_controller.rb ``` def pages render @page.page_template end def about end def contact end def content end def local_news end def global_news @newscasts = Newscast.published.paginate(page: params[:page], per_page: 5...
2016/12/12
[ "https://Stackoverflow.com/questions/41096588", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5613673/" ]
You need to define @newscasts inside pages method ``` @newscasts = Newscast.published.paginate(page: params[:page], per_page: 5) ``` Or you can write this in your controller above your methods. ``` before_action :global_news, only: [:pages] ``` Before action will run your global\_news methods before every acti...
This cast an error because you are just rendering the `global_news`. With `render` you are not executing the controller action. So @newscast is never set. You can either use a before filter as in the other answer or call the method manually, because I think you are doing something dynamically here, right? for example...
177,716
I want to ensure the sender of Document B is the same person as who previously sent me Document A. Both documents are signed with self-signed certificates. I'm not interested in knowing the real-world identity of the sender. When I open the self-signed certificate with a certificate viewer, it shows the certificate's...
2018/01/16
[ "https://security.stackexchange.com/questions/177716", "https://security.stackexchange.com", "https://security.stackexchange.com/users/168602/" ]
Public and private keys are linked in such as way that if two certificates have the same public key, they were created using the same private key. So if you assume that the private key is indeed kept private, the part you can trust in the certificates to identify the creator is the **public key**, and by extension the...
If two self-signed certificates have different public keys you cannot determine if these certificates were created by the same person or not. If two self-signed certificates have the same public key you at least know that the same private key was used to create the certificates. If you assume that this secret privat...
177,716
I want to ensure the sender of Document B is the same person as who previously sent me Document A. Both documents are signed with self-signed certificates. I'm not interested in knowing the real-world identity of the sender. When I open the self-signed certificate with a certificate viewer, it shows the certificate's...
2018/01/16
[ "https://security.stackexchange.com/questions/177716", "https://security.stackexchange.com", "https://security.stackexchange.com/users/168602/" ]
If two self-signed certificates have different public keys you cannot determine if these certificates were created by the same person or not. If two self-signed certificates have the same public key you at least know that the same private key was used to create the certificates. If you assume that this secret privat...
I think that the math behind the functions should keep you relatively safe, given that the public key in the certificate matches with the creator's public key. --------------------------------------------------------------------------------------------------------------------------------------------------------------- ...
177,716
I want to ensure the sender of Document B is the same person as who previously sent me Document A. Both documents are signed with self-signed certificates. I'm not interested in knowing the real-world identity of the sender. When I open the self-signed certificate with a certificate viewer, it shows the certificate's...
2018/01/16
[ "https://security.stackexchange.com/questions/177716", "https://security.stackexchange.com", "https://security.stackexchange.com/users/168602/" ]
If two self-signed certificates have different public keys you cannot determine if these certificates were created by the same person or not. If two self-signed certificates have the same public key you at least know that the same private key was used to create the certificates. If you assume that this secret privat...
In addition to the points made by other users, if the documents themselves are signed with MD5 or SHA-1, then you cannot trust that they were signed by the same person, even if the signatures are valid and have the same public key (which would normally be sufficient). The reason for this is that both MD5 and SHA-1 hav...
177,716
I want to ensure the sender of Document B is the same person as who previously sent me Document A. Both documents are signed with self-signed certificates. I'm not interested in knowing the real-world identity of the sender. When I open the self-signed certificate with a certificate viewer, it shows the certificate's...
2018/01/16
[ "https://security.stackexchange.com/questions/177716", "https://security.stackexchange.com", "https://security.stackexchange.com/users/168602/" ]
Public and private keys are linked in such as way that if two certificates have the same public key, they were created using the same private key. So if you assume that the private key is indeed kept private, the part you can trust in the certificates to identify the creator is the **public key**, and by extension the...
I think that the math behind the functions should keep you relatively safe, given that the public key in the certificate matches with the creator's public key. --------------------------------------------------------------------------------------------------------------------------------------------------------------- ...
177,716
I want to ensure the sender of Document B is the same person as who previously sent me Document A. Both documents are signed with self-signed certificates. I'm not interested in knowing the real-world identity of the sender. When I open the self-signed certificate with a certificate viewer, it shows the certificate's...
2018/01/16
[ "https://security.stackexchange.com/questions/177716", "https://security.stackexchange.com", "https://security.stackexchange.com/users/168602/" ]
Public and private keys are linked in such as way that if two certificates have the same public key, they were created using the same private key. So if you assume that the private key is indeed kept private, the part you can trust in the certificates to identify the creator is the **public key**, and by extension the...
In addition to the points made by other users, if the documents themselves are signed with MD5 or SHA-1, then you cannot trust that they were signed by the same person, even if the signatures are valid and have the same public key (which would normally be sufficient). The reason for this is that both MD5 and SHA-1 hav...
177,716
I want to ensure the sender of Document B is the same person as who previously sent me Document A. Both documents are signed with self-signed certificates. I'm not interested in knowing the real-world identity of the sender. When I open the self-signed certificate with a certificate viewer, it shows the certificate's...
2018/01/16
[ "https://security.stackexchange.com/questions/177716", "https://security.stackexchange.com", "https://security.stackexchange.com/users/168602/" ]
In addition to the points made by other users, if the documents themselves are signed with MD5 or SHA-1, then you cannot trust that they were signed by the same person, even if the signatures are valid and have the same public key (which would normally be sufficient). The reason for this is that both MD5 and SHA-1 hav...
I think that the math behind the functions should keep you relatively safe, given that the public key in the certificate matches with the creator's public key. --------------------------------------------------------------------------------------------------------------------------------------------------------------- ...
8,616,765
I cannot get the symfony2 configuration to correctly overwrite values from other config-files. Here is the problem: I have a new environment "staging" where I want to use most of the stuff from config\_prod.yml but have another logging level (I want it to be as it is in development, simply logging everything to a file...
2011/12/23
[ "https://Stackoverflow.com/questions/8616765", "https://Stackoverflow.com", "https://Stackoverflow.com/users/372562/" ]
Pretty much one year later I now have an understanding of what's happening and how to prevent it: The `nested` handler is befilled with the configuration from the `config.yml` and when parsing the `config_staging.yml`, the yaml component does not overwrite the whole hashmap and set the value to null but tries to merge...
Check that you don't have any repeated keys in the \_staging config file -- the second one would override the first, with the net result that the first is ignored.
8,616,765
I cannot get the symfony2 configuration to correctly overwrite values from other config-files. Here is the problem: I have a new environment "staging" where I want to use most of the stuff from config\_prod.yml but have another logging level (I want it to be as it is in development, simply logging everything to a file...
2011/12/23
[ "https://Stackoverflow.com/questions/8616765", "https://Stackoverflow.com", "https://Stackoverflow.com/users/372562/" ]
Check that you don't have any repeated keys in the \_staging config file -- the second one would override the first, with the net result that the first is ignored.
If you want to alter a collection by removing an element you will have to create an intermediate YAML file (importing the base) setting the collection to "null" and re-adding all required collection elements in a file which in turn imports the intermediate YAML file. You can not simply overwrite a collection. New elem...
8,616,765
I cannot get the symfony2 configuration to correctly overwrite values from other config-files. Here is the problem: I have a new environment "staging" where I want to use most of the stuff from config\_prod.yml but have another logging level (I want it to be as it is in development, simply logging everything to a file...
2011/12/23
[ "https://Stackoverflow.com/questions/8616765", "https://Stackoverflow.com", "https://Stackoverflow.com/users/372562/" ]
Pretty much one year later I now have an understanding of what's happening and how to prevent it: The `nested` handler is befilled with the configuration from the `config.yml` and when parsing the `config_staging.yml`, the yaml component does not overwrite the whole hashmap and set the value to null but tries to merge...
If you want to alter a collection by removing an element you will have to create an intermediate YAML file (importing the base) setting the collection to "null" and re-adding all required collection elements in a file which in turn imports the intermediate YAML file. You can not simply overwrite a collection. New elem...
24,266,951
How can i find words with doubled letters(**e.g. progress, tool and so on**) in text using regex?
2014/06/17
[ "https://Stackoverflow.com/questions/24266951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3673609/" ]
``` my $str = "katttaarww"; my @arr = $str =~ /(.)\1+/g; print join "~", @arr; ``` output ``` t~a~w ```
use a backreference to a single wildcard capture group, see below: ``` a = "hello" a =~ /(.)\1/ ```
8,788,817
I need to use as.Date on the index of a zoo object. Some of the dates are in BST and so when converting I lose a day on (only) these entries. I don't care about one hour's difference or even the time part of the date at all, I just want to make sure that the dates displayed stay the same. I'm guessing this is not very ...
2012/01/09
[ "https://Stackoverflow.com/questions/8788817", "https://Stackoverflow.com", "https://Stackoverflow.com/users/978760/" ]
Suppose we have this sample data: ``` library(zoo) x <- as.POSIXct("2000-01-01", tz = "GMT") ``` Then see if any of these are what you want: ``` # use current time zone as.Date(as.character(x, tz = "")) # use GMT as.Date(as.character(x, tz = "GMT")) # set entire session to GMT Sys.setenv(TZ = "GMT") as.Date(x) `...
I would suggest using as.POSIXlt to convert to a date object, wrapped in as.Date: ``` d <- as.POSIXct(c("2007-07-31","2007-08-31","2007-09-30","2007-10-31")) d [1] "2007-07-31 BST" "2007-08-31 BST" "2007-09-30 BST" "2007-10-31 GMT" as.Date(as.POSIXlt(d)) [1] "2007-07-31" "2007-08-31" "2007-09-30" "2007-10-31" ``` ...
8,788,817
I need to use as.Date on the index of a zoo object. Some of the dates are in BST and so when converting I lose a day on (only) these entries. I don't care about one hour's difference or even the time part of the date at all, I just want to make sure that the dates displayed stay the same. I'm guessing this is not very ...
2012/01/09
[ "https://Stackoverflow.com/questions/8788817", "https://Stackoverflow.com", "https://Stackoverflow.com/users/978760/" ]
You can offset the `POSIX` objects so its not based around midnight. 1 hour (3600 secs) should be sufficient: ``` d <- as.POSIXct(c("2007-07-31","2007-08-31","2007-09-30","2007-10-31")) d [1] "2007-07-31 BST" "2007-08-31 BST" "2007-09-30 BST" "2007-10-31 GMT" as.Date(d) [1] "2007-07-30" "2007-08-30" "2007-09-29" "200...
I would suggest using as.POSIXlt to convert to a date object, wrapped in as.Date: ``` d <- as.POSIXct(c("2007-07-31","2007-08-31","2007-09-30","2007-10-31")) d [1] "2007-07-31 BST" "2007-08-31 BST" "2007-09-30 BST" "2007-10-31 GMT" as.Date(as.POSIXlt(d)) [1] "2007-07-31" "2007-08-31" "2007-09-30" "2007-10-31" ``` ...
67,811,438
I have 3 shared integer variables which are being written/read in multithreaded code . Something like this happens in the shared code . How do I make the thread 2 operation free of data race without relying on a lock ? using a lock would impact my runtime , this is legacy code so I can't really move to std::atomic. ...
2021/06/02
[ "https://Stackoverflow.com/questions/67811438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4354472/" ]
You don't *start* reading from `doneQ` until you've finished sending *all* the lines to `lineParseQ`, which is more lines than there is buffer space. So once the `doneQ` buffer is full, that send blocks, which starts filling the `lineParseQ` buffer, and once that's full, it deadlocks. Move either the loop sending to `l...
Coordinate the pipeline with `sync.WaitGroup` breaking each piece into stages. When you know one piece of the pipeline is complete (and no one is writing to a particular channel), close the channel to instruct all "workers" to exit e.g. ``` var wg sync.WaitGroup for i := 1; i <= 5; i++ { i := i wg.Add(1) g...
59,170,905
I have a csv that contains 100 rows by three columns of random numbers: ``` 100, 20, 30 746, 82, 928 387, 12, 287.3 12, 47, 2938 125, 198, 263 ... 12, 2736, 14 ``` In bash, I need to add another column that will be either a 0 or a 1. However, (and here is the hard part), I need to have 20% of the rows with 0s, and 8...
2019/12/04
[ "https://Stackoverflow.com/questions/59170905", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8305680/" ]
Using awk and `rand()` to get randomly 0s and 1s with 20 % probability of getting a 0: ``` $ awk 'BEGIN{OFS=", ";srand()}{print $0,(rand()>0.2)}' file ``` Output: ``` 100, 20, 30, 1 746, 82, 928, 1 387, 12, 287.3, 1 12, 47, 2938, 0 125, 198, 263, 1 ..., 0 12, 2736, 14, 1 ``` Explained: ``` $ awk ' BEGIN { OF...
Adding to the previous reply, Here is a Python 3 way to do this : ``` #!/usr/local/bin/python3 import csv import math import random totalOflines = len(open('columns.csv').readlines()) newColumn = ( [0] * math.ceil(totalOflines * 0.20) ) + ( [1] * math.ceil(totalOflines * 0.80) ) random.shuffle(newColumn) csvr = csv...
59,170,905
I have a csv that contains 100 rows by three columns of random numbers: ``` 100, 20, 30 746, 82, 928 387, 12, 287.3 12, 47, 2938 125, 198, 263 ... 12, 2736, 14 ``` In bash, I need to add another column that will be either a 0 or a 1. However, (and here is the hard part), I need to have 20% of the rows with 0s, and 8...
2019/12/04
[ "https://Stackoverflow.com/questions/59170905", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8305680/" ]
Using awk and `rand()` to get randomly 0s and 1s with 20 % probability of getting a 0: ``` $ awk 'BEGIN{OFS=", ";srand()}{print $0,(rand()>0.2)}' file ``` Output: ``` 100, 20, 30, 1 746, 82, 928, 1 387, 12, 287.3, 1 12, 47, 2938, 0 125, 198, 263, 1 ..., 0 12, 2736, 14, 1 ``` Explained: ``` $ awk ' BEGIN { OF...
Another way to do it is the following: 1. Create a sequence of 0 and 1's with the correct ratio: ``` $ awk 'END{for(i=1;i<=FNR;++i) print (i <= 0.8*FNR) }' file ``` 2. Shuffle the output to randomize it: ``` $ awk 'END{for(i=1;i<=FNR;++i) print (i <= 0.8*FNR) }' file | shuf ``` 3. Paste it next to the file with a ...
59,170,905
I have a csv that contains 100 rows by three columns of random numbers: ``` 100, 20, 30 746, 82, 928 387, 12, 287.3 12, 47, 2938 125, 198, 263 ... 12, 2736, 14 ``` In bash, I need to add another column that will be either a 0 or a 1. However, (and here is the hard part), I need to have 20% of the rows with 0s, and 8...
2019/12/04
[ "https://Stackoverflow.com/questions/59170905", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8305680/" ]
Using awk and `rand()` to get randomly 0s and 1s with 20 % probability of getting a 0: ``` $ awk 'BEGIN{OFS=", ";srand()}{print $0,(rand()>0.2)}' file ``` Output: ``` 100, 20, 30, 1 746, 82, 928, 1 387, 12, 287.3, 1 12, 47, 2938, 0 125, 198, 263, 1 ..., 0 12, 2736, 14, 1 ``` Explained: ``` $ awk ' BEGIN { OF...
This seems to be more a problem of algorithm than of programming. You state in your question: *I need to have 20% of the rows with 0s, and 80% with 1s.*. So the first question is, what to do, if the number of rows is not a multiple of 5. If you have 112 rows in total, 20% would be 22.4 rows, and this does not make sens...
59,170,905
I have a csv that contains 100 rows by three columns of random numbers: ``` 100, 20, 30 746, 82, 928 387, 12, 287.3 12, 47, 2938 125, 198, 263 ... 12, 2736, 14 ``` In bash, I need to add another column that will be either a 0 or a 1. However, (and here is the hard part), I need to have 20% of the rows with 0s, and 8...
2019/12/04
[ "https://Stackoverflow.com/questions/59170905", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8305680/" ]
Another way to do it is the following: 1. Create a sequence of 0 and 1's with the correct ratio: ``` $ awk 'END{for(i=1;i<=FNR;++i) print (i <= 0.8*FNR) }' file ``` 2. Shuffle the output to randomize it: ``` $ awk 'END{for(i=1;i<=FNR;++i) print (i <= 0.8*FNR) }' file | shuf ``` 3. Paste it next to the file with a ...
Adding to the previous reply, Here is a Python 3 way to do this : ``` #!/usr/local/bin/python3 import csv import math import random totalOflines = len(open('columns.csv').readlines()) newColumn = ( [0] * math.ceil(totalOflines * 0.20) ) + ( [1] * math.ceil(totalOflines * 0.80) ) random.shuffle(newColumn) csvr = csv...
59,170,905
I have a csv that contains 100 rows by three columns of random numbers: ``` 100, 20, 30 746, 82, 928 387, 12, 287.3 12, 47, 2938 125, 198, 263 ... 12, 2736, 14 ``` In bash, I need to add another column that will be either a 0 or a 1. However, (and here is the hard part), I need to have 20% of the rows with 0s, and 8...
2019/12/04
[ "https://Stackoverflow.com/questions/59170905", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8305680/" ]
This seems to be more a problem of algorithm than of programming. You state in your question: *I need to have 20% of the rows with 0s, and 80% with 1s.*. So the first question is, what to do, if the number of rows is not a multiple of 5. If you have 112 rows in total, 20% would be 22.4 rows, and this does not make sens...
Adding to the previous reply, Here is a Python 3 way to do this : ``` #!/usr/local/bin/python3 import csv import math import random totalOflines = len(open('columns.csv').readlines()) newColumn = ( [0] * math.ceil(totalOflines * 0.20) ) + ( [1] * math.ceil(totalOflines * 0.80) ) random.shuffle(newColumn) csvr = csv...
6,755,758
I am curious, why all the larger open source PHP projects, it seems none of them use the MVC pattern and all the post on SO promote it's use?
2011/07/20
[ "https://Stackoverflow.com/questions/6755758", "https://Stackoverflow.com", "https://Stackoverflow.com/users/143030/" ]
phpBB and PHPMyAdmin, (and PHPlist, SquirrelMail and others) are all very old code-bases originating on PHP3 and PHP4. They have not been rewritten to use techniques like MVC or even OO in most cases. PHP coding conventions prior to PHP5 were mainly procedural and it was very common to find application logic inter-ming...
Most of those were already based in nonMVC php, and it worked. Although I am supporter of MVC symfony I can see why they'd changed the codebase to make it MVC.
48,905,062
It's been several months since I have a compilation error on when I want to change the value of an enumeration declared at the beginning of the program (global), in a function that replaces it with an integer. Before I did not have this problem, but having switched my code from a mini arduino card, to ESP8266 the prob...
2018/02/21
[ "https://Stackoverflow.com/questions/48905062", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8375960/" ]
You can try following HTML ``` This is my text. <i class="far fa-question-circle" data-toggle="tooltip" data-title="This is my tooltip."></i> ``` Since the default nature of browser is difficult to override and may cause unexpected behavior we can choose alternative way to solve the issue The Bootstrap 4 tool-tip ...
I had issues with the `data-title` from the answers above, instead I had to use the `data-original-title`. You can set this property using the `attr` function from jQuery or directly into the DOM. **HTML:** ``` This is my text. <i class="far fa-question-circle" data-toggle="tooltip"></i> ``` **JavaScript:** ```...
48,905,062
It's been several months since I have a compilation error on when I want to change the value of an enumeration declared at the beginning of the program (global), in a function that replaces it with an integer. Before I did not have this problem, but having switched my code from a mini arduino card, to ESP8266 the prob...
2018/02/21
[ "https://Stackoverflow.com/questions/48905062", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8375960/" ]
You can try following HTML ``` This is my text. <i class="far fa-question-circle" data-toggle="tooltip" data-title="This is my tooltip."></i> ``` Since the default nature of browser is difficult to override and may cause unexpected behavior we can choose alternative way to solve the issue The Bootstrap 4 tool-tip ...
You can achieve by `title` attribute so don't use directly `data-title` or `data-original-title` attribute because of if we are targeting SEO friendly page then need to write well title text. So This is not `Bootstrap4` tooltip issue so the main reason is that when created `svg` tag by `fontawesome` script for icon the...
48,905,062
It's been several months since I have a compilation error on when I want to change the value of an enumeration declared at the beginning of the program (global), in a function that replaces it with an integer. Before I did not have this problem, but having switched my code from a mini arduino card, to ESP8266 the prob...
2018/02/21
[ "https://Stackoverflow.com/questions/48905062", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8375960/" ]
I had issues with the `data-title` from the answers above, instead I had to use the `data-original-title`. You can set this property using the `attr` function from jQuery or directly into the DOM. **HTML:** ``` This is my text. <i class="far fa-question-circle" data-toggle="tooltip"></i> ``` **JavaScript:** ```...
You can achieve by `title` attribute so don't use directly `data-title` or `data-original-title` attribute because of if we are targeting SEO friendly page then need to write well title text. So This is not `Bootstrap4` tooltip issue so the main reason is that when created `svg` tag by `fontawesome` script for icon the...
35,932,568
I am coding a MVC5 internet application where some of my Views have hidden values for the ViewModel. Here is an example: ``` @Html.HiddenFor(model => model.id) ``` Is this a safe way to store variables that could potentially be sensitive? By sensitive, I mean variables that should not be seen or changed by any user...
2016/03/11
[ "https://Stackoverflow.com/questions/35932568", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3736648/" ]
Yes, the end user can see and potentially change the value. All that `HiddenFor` does is render a hidden input tag like so: ``` <input type="hidden" id="id" name="id" value="abc123"/> ``` So, this isn't a safe way to store sensitive data. A *slightly* better way would be a session variable, but that can still be al...
The only "safe" way is to not send your variables to the client. That aside, you could look at encrypting your values that you send to the clients and decrypting them when they are posted back. A hidden field like below will not be readily apparent to the user and changing the value in the hidden field will invalidate...
3,554,787
I have two MTS video files, each one 2 minutes long. I need to be able to join the files together and convert the format to MPEG4. I have a suitable command line for converting MTS to MP4 but don't know how to join the files together in the first place. Some articles on the web suggest using the CAT command, like: ``...
2010/08/24
[ "https://Stackoverflow.com/questions/3554787", "https://Stackoverflow.com", "https://Stackoverflow.com/users/312031/" ]
Using cat works. Its just that video players will be kind of fooled about the video length while reading the resulting whole\_video.mts. There will be typically a sudden timestamp jump where the file were previously cut. But this is okay. You can encode it and then you'll get a right timestamped file. Encoding with ff...
It's OK, I've sorted it. Using the latest SVN versions of FFMPEG, x264 and MP4Box (GPAC), here's what I did... Use FFMPEG to convert the MTS files to MP4 as normal: ``` ffmpeg -i video1.mts -vcodec libx264 -deinterlace -crf 25 -vpre hq -f mp4 -s hd480 -ab 128k -threads 0 -y 1.mp4 ffmpeg -i video2.mts -vcodec libx264 ...
3,554,787
I have two MTS video files, each one 2 minutes long. I need to be able to join the files together and convert the format to MPEG4. I have a suitable command line for converting MTS to MP4 but don't know how to join the files together in the first place. Some articles on the web suggest using the CAT command, like: ``...
2010/08/24
[ "https://Stackoverflow.com/questions/3554787", "https://Stackoverflow.com", "https://Stackoverflow.com/users/312031/" ]
The following worked perfectly for me (i.e. resulting in seamless joins): ``` ffmpeg -i "concat:00019.MTS|00020.MTS|00021.MTS|00022.MTS" output.mp4 ```
It's OK, I've sorted it. Using the latest SVN versions of FFMPEG, x264 and MP4Box (GPAC), here's what I did... Use FFMPEG to convert the MTS files to MP4 as normal: ``` ffmpeg -i video1.mts -vcodec libx264 -deinterlace -crf 25 -vpre hq -f mp4 -s hd480 -ab 128k -threads 0 -y 1.mp4 ffmpeg -i video2.mts -vcodec libx264 ...
3,554,787
I have two MTS video files, each one 2 minutes long. I need to be able to join the files together and convert the format to MPEG4. I have a suitable command line for converting MTS to MP4 but don't know how to join the files together in the first place. Some articles on the web suggest using the CAT command, like: ``...
2010/08/24
[ "https://Stackoverflow.com/questions/3554787", "https://Stackoverflow.com", "https://Stackoverflow.com/users/312031/" ]
The following worked perfectly for me (i.e. resulting in seamless joins): ``` ffmpeg -i "concat:00019.MTS|00020.MTS|00021.MTS|00022.MTS" output.mp4 ```
Using cat works. Its just that video players will be kind of fooled about the video length while reading the resulting whole\_video.mts. There will be typically a sudden timestamp jump where the file were previously cut. But this is okay. You can encode it and then you'll get a right timestamped file. Encoding with ff...
8,001,339
LinqKit has an extension method `ForEach` for `IEnumerable` which clashes with `System.Collections.Generic.IEnumerable`. ``` Error 4 The call is ambiguous between the following methods or properties: 'LinqKit.Extensions.ForEach<Domain>(System.Collections.Generic.IEnumerable<Domain>, System.Action<Domain>)' and ...
2011/11/03
[ "https://Stackoverflow.com/questions/8001339", "https://Stackoverflow.com", "https://Stackoverflow.com/users/264140/" ]
`Enumerable`, in the framework, does not declare an extension for `ForEach()`. Both of these are from external references. You should consider only using one of them - either the reference that's adding `EnumerableExtensionMethods` or the `LinqKit`. (This, btw, is one reason that using the same namespace as the fram...
You simply need to fully-qualify the method that you're calling, as in the error message. So, instead of using ``` ForEach<Domain>( ... ); ``` use ``` LinqKit.Extensions.ForEach<Domain>( ... ); ```
13,274,953
I'm trying to clean up our work-site Team Foundation Server 2010 defaultcollection. Unfortunately we originally set it up with a whole bunch of projects at the root level of the defaultcollection. Now we want to clean it up by moving a bunch of those projects into a root-level archive directory, while preserving the ...
2012/11/07
[ "https://Stackoverflow.com/questions/13274953", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1348592/" ]
Those aren't "root level projects". Those are "Team Projects". There's a lot more to a team project than just source control, so, no, you can't do the same things with a "team project folder" as you could with a lower-level folder. TFS does not use the term "project" the same way that SourceSafe did. In SS, "project" ...
You can try the /keephistory option... as I understand it, that is supposed to allow you to do what you are trying to do.
48,281,220
I've created a data sync process in Azure so that Azure has created few tables in my SQL Server database in the `Datasync` schema. I want to hide those tables that are located in the `Datasync` schema. Can you guys please suggest how to avoid showing those tables in Azure, or how to hide tables from my SQL Server? [...
2018/01/16
[ "https://Stackoverflow.com/questions/48281220", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4689622/" ]
There is No `HIDE` feature in SQL Server instead, you can Deny the permission to that Table for Certain Users of User Groups whom you do not want to view the Tables or Objects on your schema You can Use the `DENY` keyword to deny certain Users and `REVOKE` to Remove the existing permission
This question is somewhat old, but today I was looking for something similar so that I can organize tables in my database, either by hiding tables whose designing is completed, or placing them in some folder so that they do not interfere with the tables that I am currently working on *(and confuse me :P )*. I found th...
12,019,483
Let me explain my problem. Please excuse me for the long question. Here it goes. I have a View (**BusyProviderView**) ``` <Grid> <xctk:BusyIndicator x:Name="aaa" IsBusy="{Binding IsRunning}" > <xctk:BusyIndicator.BusyContentTemplate> <DataTemplate> <Grid cal:Bind.Model="{Bindin...
2012/08/18
[ "https://Stackoverflow.com/questions/12019483", "https://Stackoverflow.com", "https://Stackoverflow.com/users/106986/" ]
It seems by default the [Extended Toolkit](https://wpftoolkit.codeplex.com/)'s `BusyIndicator` uses the string `"Please Wait...."` for the `BusyContent`. So inside the `DataTemplate` the `DataContext` will be the above mentioned string and this causes the confusion and exception in Caliburn. To fix it you need to set ...
I think Oleg is right though, you cannot use conventions in a DataTemplate using Caliburn (CaliburnMicro you can). From the [Documentation - Other Things to Know](http://caliburnmicro.codeplex.com/wikipage?title=All%20About%20Conventions) > > Other Things To Know > On all platforms, conventions cannot by applied to ...
63,378,567
I am trying to run an `ember.js` app on my laptop but after installing the `ember-cli` and trying to run `ember --version` command I get an `error`. To install `ember-cli` I used the following command - `npm install -g ember-cli` It is probably important to mention that when I run `ember --version` command outside of...
2020/08/12
[ "https://Stackoverflow.com/questions/63378567", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6212903/" ]
> > It is probably important to mention that when I run ember --version command outside of the app directory it works, but when I run it inside app directory it crashes and gives error. > > > Just wanted to answer this small piece. When you run `ember` inside of a directory with a `package.json` that includes `emb...
replace `catch` with `catch (error)` just had the same problem and solved it by replacing catch with catch(error) so you need to add (error) next to each catch. i needed to change this in about 10 files. so you gotta change every time and run it so you see the new location of the error. best of luck
22,814,315
I count the vowels and the consonant in a string. Now I want to display the most used vowel and consonant in this string the code that I have for the counting ``` private void Button_Click(object sender, RoutedEventArgs e) { char[] charArray = new char[] { 'a', 'e', 'i', 'o', 'u' }; string line...
2014/04/02
[ "https://Stackoverflow.com/questions/22814315", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3454520/" ]
Make the vowels and constants lists instead of an int counter then you can manipulate each list at a later stage. ``` private void Button_Click(object sender, RoutedEventArgs e) { char[] charArray = new char[] { 'a', 'e', 'i', 'o', 'u' }; string line = testBox.Text.ToLower(); char lett...
Ok here is one way to do it. It may be a little more advanced due to the heavy use of linq and lambadas. It does work, but I would recommend breaking some of the functionality out into functions. ``` char[] charArray = new char[] { 'a', 'e', 'i', 'o', 'u' }; string line = "bbcccaaaeeiiiioouu"; var vowelCounts = new D...
22,814,315
I count the vowels and the consonant in a string. Now I want to display the most used vowel and consonant in this string the code that I have for the counting ``` private void Button_Click(object sender, RoutedEventArgs e) { char[] charArray = new char[] { 'a', 'e', 'i', 'o', 'u' }; string line...
2014/04/02
[ "https://Stackoverflow.com/questions/22814315", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3454520/" ]
Make the vowels and constants lists instead of an int counter then you can manipulate each list at a later stage. ``` private void Button_Click(object sender, RoutedEventArgs e) { char[] charArray = new char[] { 'a', 'e', 'i', 'o', 'u' }; string line = testBox.Text.ToLower(); char lett...
As String is an enumerable of characters You can use LINQs GroupBy function to group by characters an then do all kinds of evaluation with the groups: <http://dotnetfiddle.net/dmLkVb> ``` var grouped = line.GroupBy(c=> c); var vowels = grouped.Where(g => charArray.Contains(g.Key)); var mostUsed = vowels.OrderBy(v => ...
4,809,314
I am having some trouble with ImageMagick. I have installed GhostScript v9.00 and ImageMagick-6.6.7-1-Q16 on Windows 7 - 32Bit When I run the following command in cmd **convert D:\test\sample.pdf D:\test\pages\page.jpg** only the first page of the pdf is converted to pdf. I have also tried the following command **...
2011/01/26
[ "https://Stackoverflow.com/questions/4809314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/295654/" ]
You can specify which page to convert by putting a number in [] after the filename: ``` convert D:\test\sample.pdf[7] D:\test\pages\page-7.jpg ``` It should have, however, converted all pages to individual images with your command.
By the way if you need to convert first and second pages then provide in array comma separated values ``` convert D:\test\sample.pdf[0,1] D:\test\pages\page.jpg ``` Resulting JPEG files will be named: * for page 1: `page-0.jpg` * for page 2: `page-1.jpg` You can also do ``` convert D:\test\sample.pdf[10,15,20-22,...
4,809,314
I am having some trouble with ImageMagick. I have installed GhostScript v9.00 and ImageMagick-6.6.7-1-Q16 on Windows 7 - 32Bit When I run the following command in cmd **convert D:\test\sample.pdf D:\test\pages\page.jpg** only the first page of the pdf is converted to pdf. I have also tried the following command **...
2011/01/26
[ "https://Stackoverflow.com/questions/4809314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/295654/" ]
You can specify which page to convert by putting a number in [] after the filename: ``` convert D:\test\sample.pdf[7] D:\test\pages\page-7.jpg ``` It should have, however, converted all pages to individual images with your command.
According to the site admin at the ImageMagick forum: > > ImageMagick uses the pngalpha device when it finds an Adobe > Illustrator PDF. Many of these are a single page. Ideally, Ghostscript > would support a device that allows multiple PDF pages with > transparency but it doesn't... > > > Easy fix. **Edit del...
4,809,314
I am having some trouble with ImageMagick. I have installed GhostScript v9.00 and ImageMagick-6.6.7-1-Q16 on Windows 7 - 32Bit When I run the following command in cmd **convert D:\test\sample.pdf D:\test\pages\page.jpg** only the first page of the pdf is converted to pdf. I have also tried the following command **...
2011/01/26
[ "https://Stackoverflow.com/questions/4809314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/295654/" ]
You can specify which page to convert by putting a number in [] after the filename: ``` convert D:\test\sample.pdf[7] D:\test\pages\page-7.jpg ``` It should have, however, converted all pages to individual images with your command.
I found this solution which convert all pages in the pdf to a single jpg image: ``` montage input.pdf -mode Concatenate -tile 1x output.jpg ``` montage is included in ImageMagick. Tested on ImageMagick 6.7.7-10 on Ubuntu 13.04.
4,809,314
I am having some trouble with ImageMagick. I have installed GhostScript v9.00 and ImageMagick-6.6.7-1-Q16 on Windows 7 - 32Bit When I run the following command in cmd **convert D:\test\sample.pdf D:\test\pages\page.jpg** only the first page of the pdf is converted to pdf. I have also tried the following command **...
2011/01/26
[ "https://Stackoverflow.com/questions/4809314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/295654/" ]
You can specify which page to convert by putting a number in [] after the filename: ``` convert D:\test\sample.pdf[7] D:\test\pages\page-7.jpg ``` It should have, however, converted all pages to individual images with your command.
I ran into similar problem with GhostScript. This can be solver with using `%03d` iterator in the output file name. Here is example: ``` gs -r300 -dNOPAUSE -dBATCH -sDEVICE#pngalpha -sOutputFile=output-%03d.png input.pdf ``` Here is the reference with detailed information: <https://ghostscript.com/doc/current/Device...
4,809,314
I am having some trouble with ImageMagick. I have installed GhostScript v9.00 and ImageMagick-6.6.7-1-Q16 on Windows 7 - 32Bit When I run the following command in cmd **convert D:\test\sample.pdf D:\test\pages\page.jpg** only the first page of the pdf is converted to pdf. I have also tried the following command **...
2011/01/26
[ "https://Stackoverflow.com/questions/4809314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/295654/" ]
By the way if you need to convert first and second pages then provide in array comma separated values ``` convert D:\test\sample.pdf[0,1] D:\test\pages\page.jpg ``` Resulting JPEG files will be named: * for page 1: `page-0.jpg` * for page 2: `page-1.jpg` You can also do ``` convert D:\test\sample.pdf[10,15,20-22,...
According to the site admin at the ImageMagick forum: > > ImageMagick uses the pngalpha device when it finds an Adobe > Illustrator PDF. Many of these are a single page. Ideally, Ghostscript > would support a device that allows multiple PDF pages with > transparency but it doesn't... > > > Easy fix. **Edit del...
4,809,314
I am having some trouble with ImageMagick. I have installed GhostScript v9.00 and ImageMagick-6.6.7-1-Q16 on Windows 7 - 32Bit When I run the following command in cmd **convert D:\test\sample.pdf D:\test\pages\page.jpg** only the first page of the pdf is converted to pdf. I have also tried the following command **...
2011/01/26
[ "https://Stackoverflow.com/questions/4809314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/295654/" ]
By the way if you need to convert first and second pages then provide in array comma separated values ``` convert D:\test\sample.pdf[0,1] D:\test\pages\page.jpg ``` Resulting JPEG files will be named: * for page 1: `page-0.jpg` * for page 2: `page-1.jpg` You can also do ``` convert D:\test\sample.pdf[10,15,20-22,...
I found this solution which convert all pages in the pdf to a single jpg image: ``` montage input.pdf -mode Concatenate -tile 1x output.jpg ``` montage is included in ImageMagick. Tested on ImageMagick 6.7.7-10 on Ubuntu 13.04.
4,809,314
I am having some trouble with ImageMagick. I have installed GhostScript v9.00 and ImageMagick-6.6.7-1-Q16 on Windows 7 - 32Bit When I run the following command in cmd **convert D:\test\sample.pdf D:\test\pages\page.jpg** only the first page of the pdf is converted to pdf. I have also tried the following command **...
2011/01/26
[ "https://Stackoverflow.com/questions/4809314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/295654/" ]
By the way if you need to convert first and second pages then provide in array comma separated values ``` convert D:\test\sample.pdf[0,1] D:\test\pages\page.jpg ``` Resulting JPEG files will be named: * for page 1: `page-0.jpg` * for page 2: `page-1.jpg` You can also do ``` convert D:\test\sample.pdf[10,15,20-22,...
I ran into similar problem with GhostScript. This can be solver with using `%03d` iterator in the output file name. Here is example: ``` gs -r300 -dNOPAUSE -dBATCH -sDEVICE#pngalpha -sOutputFile=output-%03d.png input.pdf ``` Here is the reference with detailed information: <https://ghostscript.com/doc/current/Device...
4,809,314
I am having some trouble with ImageMagick. I have installed GhostScript v9.00 and ImageMagick-6.6.7-1-Q16 on Windows 7 - 32Bit When I run the following command in cmd **convert D:\test\sample.pdf D:\test\pages\page.jpg** only the first page of the pdf is converted to pdf. I have also tried the following command **...
2011/01/26
[ "https://Stackoverflow.com/questions/4809314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/295654/" ]
According to the site admin at the ImageMagick forum: > > ImageMagick uses the pngalpha device when it finds an Adobe > Illustrator PDF. Many of these are a single page. Ideally, Ghostscript > would support a device that allows multiple PDF pages with > transparency but it doesn't... > > > Easy fix. **Edit del...
I ran into similar problem with GhostScript. This can be solver with using `%03d` iterator in the output file name. Here is example: ``` gs -r300 -dNOPAUSE -dBATCH -sDEVICE#pngalpha -sOutputFile=output-%03d.png input.pdf ``` Here is the reference with detailed information: <https://ghostscript.com/doc/current/Device...
4,809,314
I am having some trouble with ImageMagick. I have installed GhostScript v9.00 and ImageMagick-6.6.7-1-Q16 on Windows 7 - 32Bit When I run the following command in cmd **convert D:\test\sample.pdf D:\test\pages\page.jpg** only the first page of the pdf is converted to pdf. I have also tried the following command **...
2011/01/26
[ "https://Stackoverflow.com/questions/4809314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/295654/" ]
I found this solution which convert all pages in the pdf to a single jpg image: ``` montage input.pdf -mode Concatenate -tile 1x output.jpg ``` montage is included in ImageMagick. Tested on ImageMagick 6.7.7-10 on Ubuntu 13.04.
I ran into similar problem with GhostScript. This can be solver with using `%03d` iterator in the output file name. Here is example: ``` gs -r300 -dNOPAUSE -dBATCH -sDEVICE#pngalpha -sOutputFile=output-%03d.png input.pdf ``` Here is the reference with detailed information: <https://ghostscript.com/doc/current/Device...
14,360,880
I have a form to collect the user's contact info, and this form is using 3 fields for date of birth. I'm using Jquery UI's Datepicker for selecting the date and ValidationEngine ([source here](https://github.com/posabsolute/jQuery-Validation-Engine) and original developer [here](http://www.position-absolute.com/articl...
2013/01/16
[ "https://Stackoverflow.com/questions/14360880", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1983959/" ]
API 10 is gingerbread which doesn't support fragments as you can see in the log cat the error is inflating the class fragment. You would either need to use a library like `ActionBarSherlock` or the android support library may allow it, or provide an alternative layout for the gingerbread version. **UPDATE** If your...
Make sure you have Importet Fragments from the Supporter Library: ``` import android.support.v4.app.Fragment; ``` If you added the minSDK in you Manifest you can run Lint to see if you are using Methods that aren't available in some of your supported Versions. In Manifest: ``` <uses-sdk android:minSdkVersion="8" /...
14,360,880
I have a form to collect the user's contact info, and this form is using 3 fields for date of birth. I'm using Jquery UI's Datepicker for selecting the date and ValidationEngine ([source here](https://github.com/posabsolute/jQuery-Validation-Engine) and original developer [here](http://www.position-absolute.com/articl...
2013/01/16
[ "https://Stackoverflow.com/questions/14360880", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1983959/" ]
API 10 is gingerbread which doesn't support fragments as you can see in the log cat the error is inflating the class fragment. You would either need to use a library like `ActionBarSherlock` or the android support library may allow it, or provide an alternative layout for the gingerbread version. **UPDATE** If your...
The problem is you are using new API calls. API only supports `Fragments` through the [support library](http://developer.android.com/tools/extras/support-library.html), but the changes do not happen automatically just by importing the library. You have to make sure you use the library functionality and not the newer AP...
1,519,792
As I know in win32 every program receives say 4GB of virtual memory. Memory manager is responsible for offloading chunks of memory from physical memory to disk. Does it imply that malloc or any other memory allocation API will throw OUT\_OF\_MEMORY exception only when virtual limit is hit? I mean is it possible for m...
2009/10/05
[ "https://Stackoverflow.com/questions/1519792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53861/" ]
Yes, it's possible. Remember that memory can be fragmented and that `malloc` won't be able to find a sufficiently large chunk to serve the size you requested. This can easily be way before you hit your 4 GiB limit.
The virtual memory limit on Win 32 is 2Gb. On Win 64, it's much bigger. `malloc` doesn't throw an exception - it returns NULL. NULL return, or exception, the memory manager can fail well before the 2Gb limit is reached if * The paging file isn't big enough. If the paging file is limited either by policy, or by lack o...
1,519,792
As I know in win32 every program receives say 4GB of virtual memory. Memory manager is responsible for offloading chunks of memory from physical memory to disk. Does it imply that malloc or any other memory allocation API will throw OUT\_OF\_MEMORY exception only when virtual limit is hit? I mean is it possible for m...
2009/10/05
[ "https://Stackoverflow.com/questions/1519792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53861/" ]
Yes, it's possible. Remember that memory can be fragmented and that `malloc` won't be able to find a sufficiently large chunk to serve the size you requested. This can easily be way before you hit your 4 GiB limit.
how about allocating a few smaller areas, if a huge one isn't available?
1,519,792
As I know in win32 every program receives say 4GB of virtual memory. Memory manager is responsible for offloading chunks of memory from physical memory to disk. Does it imply that malloc or any other memory allocation API will throw OUT\_OF\_MEMORY exception only when virtual limit is hit? I mean is it possible for m...
2009/10/05
[ "https://Stackoverflow.com/questions/1519792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53861/" ]
Yes, it's possible. Remember that memory can be fragmented and that `malloc` won't be able to find a sufficiently large chunk to serve the size you requested. This can easily be way before you hit your 4 GiB limit.
For full chapter and verse on Windows virtual memory check out this post on Mark Russinovich's Blog (lots of other great stuff here too): [Pushing the Limits of Windows: Virtual Memory](http://blogs.technet.com/markrussinovich/archive/2008/11/17/3155406.aspx) If memory fragmentation is your problem and writing custom...
1,519,792
As I know in win32 every program receives say 4GB of virtual memory. Memory manager is responsible for offloading chunks of memory from physical memory to disk. Does it imply that malloc or any other memory allocation API will throw OUT\_OF\_MEMORY exception only when virtual limit is hit? I mean is it possible for m...
2009/10/05
[ "https://Stackoverflow.com/questions/1519792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53861/" ]
The virtual memory limit on Win 32 is 2Gb. On Win 64, it's much bigger. `malloc` doesn't throw an exception - it returns NULL. NULL return, or exception, the memory manager can fail well before the 2Gb limit is reached if * The paging file isn't big enough. If the paging file is limited either by policy, or by lack o...
how about allocating a few smaller areas, if a huge one isn't available?
1,519,792
As I know in win32 every program receives say 4GB of virtual memory. Memory manager is responsible for offloading chunks of memory from physical memory to disk. Does it imply that malloc or any other memory allocation API will throw OUT\_OF\_MEMORY exception only when virtual limit is hit? I mean is it possible for m...
2009/10/05
[ "https://Stackoverflow.com/questions/1519792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53861/" ]
The virtual memory limit on Win 32 is 2Gb. On Win 64, it's much bigger. `malloc` doesn't throw an exception - it returns NULL. NULL return, or exception, the memory manager can fail well before the 2Gb limit is reached if * The paging file isn't big enough. If the paging file is limited either by policy, or by lack o...
For full chapter and verse on Windows virtual memory check out this post on Mark Russinovich's Blog (lots of other great stuff here too): [Pushing the Limits of Windows: Virtual Memory](http://blogs.technet.com/markrussinovich/archive/2008/11/17/3155406.aspx) If memory fragmentation is your problem and writing custom...
1,519,792
As I know in win32 every program receives say 4GB of virtual memory. Memory manager is responsible for offloading chunks of memory from physical memory to disk. Does it imply that malloc or any other memory allocation API will throw OUT\_OF\_MEMORY exception only when virtual limit is hit? I mean is it possible for m...
2009/10/05
[ "https://Stackoverflow.com/questions/1519792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53861/" ]
For full chapter and verse on Windows virtual memory check out this post on Mark Russinovich's Blog (lots of other great stuff here too): [Pushing the Limits of Windows: Virtual Memory](http://blogs.technet.com/markrussinovich/archive/2008/11/17/3155406.aspx) If memory fragmentation is your problem and writing custom...
how about allocating a few smaller areas, if a huge one isn't available?
10,920,255
I have a custom TextBox on a standard Windows Form. In OnLeave() of the TextBox, I am trying to find out the value of a particular custom string property added to the form in its constructor; Form constructor; ``` public partial class FormName : Form { public string psTableName { get; set; } ``` TextBox OnLeave...
2012/06/06
[ "https://Stackoverflow.com/questions/10920255", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1440549/" ]
First, a string is not a control and therefore won't be returned by `FindForm().Controls` Since it's a public member, can't you just do: `(this.FindForm() as FormName).psTablename` I would check for null, first, but you get the idea.
Does this achieve what you are looking for? ``` protected override void OnLeave(EventArgs e) { string x = this.psTableName; } ```