qid
int64
1
74.6M
question
stringlengths
45
24.2k
date
stringlengths
10
10
metadata
stringlengths
101
178
response_j
stringlengths
32
23.2k
response_k
stringlengths
21
13.2k
6,548,940
I have an SQLite database, which does not support trig functions. I would like to sort a set of lat,lng pairs in my table by distance as compared to a second lat,lng pair. I'm familiar with the standard haversine distance formula for sorting lat,lng pairs by distance. In this case I don't care particularly for precis...
2011/07/01
['https://Stackoverflow.com/questions/6548940', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/475329/']
If your points are within reasonable distance of each other (i.e. not across half the world, and not across the date line), you can make a correction for the difference between latitude and longitude (as a longitude degree is shorter, except at the Equator), and then just calculate the distance as if the earth was flat...
You could always truncate the [Taylor series expansion](http://en.wikipedia.org/wiki/Cosine#Series_definitions) of sine and use the fact that sin^2(x)+cos^2(x)=1 to get the approximation of cosine. The only tricky part would be [using Taylor's theorem to estimate the number of terms that you'd need for a given amount o...
6,548,940
I have an SQLite database, which does not support trig functions. I would like to sort a set of lat,lng pairs in my table by distance as compared to a second lat,lng pair. I'm familiar with the standard haversine distance formula for sorting lat,lng pairs by distance. In this case I don't care particularly for precis...
2011/07/01
['https://Stackoverflow.com/questions/6548940', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/475329/']
If your points are within reasonable distance of each other (i.e. not across half the world, and not across the date line), you can make a correction for the difference between latitude and longitude (as a longitude degree is shorter, except at the Equator), and then just calculate the distance as if the earth was flat...
If you want proper spatial data in your model then use SpatiaLite, a spatially-enabled version of SQLite: <http://www.gaia-gis.it/spatialite/> Its like PostGIS is for PostgreSQL. All your SQLite functionality will work perfectly and unchanged, and you'll get spatial functions too.
6,548,940
I have an SQLite database, which does not support trig functions. I would like to sort a set of lat,lng pairs in my table by distance as compared to a second lat,lng pair. I'm familiar with the standard haversine distance formula for sorting lat,lng pairs by distance. In this case I don't care particularly for precis...
2011/07/01
['https://Stackoverflow.com/questions/6548940', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/475329/']
If your points are within reasonable distance of each other (i.e. not across half the world, and not across the date line), you can make a correction for the difference between latitude and longitude (as a longitude degree is shorter, except at the Equator), and then just calculate the distance as if the earth was flat...
Change "\*" with "/" works for me: select \* from Points order by (lat - @lat) \* (lat - @lat) + ((lng - @lng) / 2) \* ((lng - @lng) / 2)
6,548,940
I have an SQLite database, which does not support trig functions. I would like to sort a set of lat,lng pairs in my table by distance as compared to a second lat,lng pair. I'm familiar with the standard haversine distance formula for sorting lat,lng pairs by distance. In this case I don't care particularly for precis...
2011/07/01
['https://Stackoverflow.com/questions/6548940', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/475329/']
If you want proper spatial data in your model then use SpatiaLite, a spatially-enabled version of SQLite: <http://www.gaia-gis.it/spatialite/> Its like PostGIS is for PostgreSQL. All your SQLite functionality will work perfectly and unchanged, and you'll get spatial functions too.
You could always truncate the [Taylor series expansion](http://en.wikipedia.org/wiki/Cosine#Series_definitions) of sine and use the fact that sin^2(x)+cos^2(x)=1 to get the approximation of cosine. The only tricky part would be [using Taylor's theorem to estimate the number of terms that you'd need for a given amount o...
6,548,940
I have an SQLite database, which does not support trig functions. I would like to sort a set of lat,lng pairs in my table by distance as compared to a second lat,lng pair. I'm familiar with the standard haversine distance formula for sorting lat,lng pairs by distance. In this case I don't care particularly for precis...
2011/07/01
['https://Stackoverflow.com/questions/6548940', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/475329/']
You could always truncate the [Taylor series expansion](http://en.wikipedia.org/wiki/Cosine#Series_definitions) of sine and use the fact that sin^2(x)+cos^2(x)=1 to get the approximation of cosine. The only tricky part would be [using Taylor's theorem to estimate the number of terms that you'd need for a given amount o...
Change "\*" with "/" works for me: select \* from Points order by (lat - @lat) \* (lat - @lat) + ((lng - @lng) / 2) \* ((lng - @lng) / 2)
6,548,940
I have an SQLite database, which does not support trig functions. I would like to sort a set of lat,lng pairs in my table by distance as compared to a second lat,lng pair. I'm familiar with the standard haversine distance formula for sorting lat,lng pairs by distance. In this case I don't care particularly for precis...
2011/07/01
['https://Stackoverflow.com/questions/6548940', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/475329/']
If you want proper spatial data in your model then use SpatiaLite, a spatially-enabled version of SQLite: <http://www.gaia-gis.it/spatialite/> Its like PostGIS is for PostgreSQL. All your SQLite functionality will work perfectly and unchanged, and you'll get spatial functions too.
Change "\*" with "/" works for me: select \* from Points order by (lat - @lat) \* (lat - @lat) + ((lng - @lng) / 2) \* ((lng - @lng) / 2)
23,051,085
Is there any way that I can create a program where it gives input to another file and and collects its output? The best that google give me is this. And I tried to recreate (read: copying the code in some unknown manner (read: stabbing in the dark)) And I got this ``` import time string="file.py" process=subprocess....
2014/04/14
['https://Stackoverflow.com/questions/23051085', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2872852/']
[subprocess](https://docs.python.org/2/library/subprocess.html) is a stdlib module that you need to import (the same way `time` is) - so you just need to: ``` import subprocess ``` some time before you try to use the functions in it (usually, you want to do this near the top of your code, right underneath your curre...
In addition to lvc's answer you should consider using [Popen.communicate()](https://docs.python.org/library/subprocess.html#subprocess.Popen.communicate). something like, ``` import subprocess string="file.py" process=subprocess.Popen(string,stdin=subprocess.PIPE,stdout=subprocess.PIPE) res=process.communicate("3 5") ...
59,642,732
I have a Rails app which uses db `my_database_development` in my `config/database.yml`: ``` development: <<: *default database: my_database_development ``` Works correctly when I run `rails server`. Now I want to use another db, so I change my `config/database.yml`: ``` development: <<: *default database: ...
2020/01/08
['https://Stackoverflow.com/questions/59642732', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3943491/']
When you switch database, you will have new `schema_migrations` table. In new database, `schema_migrations` is empty so Rails will think you have `pending_migration`. I think you need to re-migrate in your new database. You can use some feature like database dump to migrate date from old database to new database
I am now unable to replicate the problem above. (Not sure why, maybe I was copying over my database incorrectly.) Also, a possible resolution was to copy tables over individually from `my_prev_database` to `my_database_development` Note for anyone troubleshooting similar problems: The commenters mentioned that, - Ru...
333,882
One problem that has always bothered me is the limitations of computers in studying math. With a chaotic dynamical system, for example, we know *mathematically* that they possess trajectories that never repeat themselves. But *computationally*, it seems that such an orbit can never be realized (since given the finite n...
2013/03/18
['https://math.stackexchange.com/questions/333882', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/62659/']
Numerical simulation of dynamic systems is indeed hard. One difficulty is that it is implemented using floating-point arithmetic, which is subject to rounding errors. For chaotic dynamical systems, the ones that have strange attractors, rounding errors are potentially serious, because orbits starting at nearby points ...
It's a valid concern, and I have a historical anecdote to match it. When Mandelbrot published the first picture of the Mandelbrot set, the image was of poor quality due to the state of informatics back then. Seeing what he thought where "speck of dusts" on the picture, his editor erased them. Since then we obtained muc...
333,882
One problem that has always bothered me is the limitations of computers in studying math. With a chaotic dynamical system, for example, we know *mathematically* that they possess trajectories that never repeat themselves. But *computationally*, it seems that such an orbit can never be realized (since given the finite n...
2013/03/18
['https://math.stackexchange.com/questions/333882', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/62659/']
Numerical simulation of dynamic systems is indeed hard. One difficulty is that it is implemented using floating-point arithmetic, which is subject to rounding errors. For chaotic dynamical systems, the ones that have strange attractors, rounding errors are potentially serious, because orbits starting at nearby points ...
The set of nonlinear systems that can be understood analytically is a measure zero set. Numerical experiments, and numerical algorithms, are a necessary tool in the study of these systems. But I agree that there is a need for more robust numerical tools for studying complex systems. Anyways, regarding chaotic sets, th...
34,175,959
I was debugging a watch kit extension app with notification in the device and watch. Then the watch app runs with the notification, and should start the companion app in the iPhone using WCSession, the iPhone prints only this in the log. What can the problem to run the app. All settings are default offered by Xcode. T...
2015/12/09
['https://Stackoverflow.com/questions/34175959', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/312627/']
I had to remove this from the plist file. ``` <key>UIApplicationExitsOnSuspend</key> <true/> ```
Check the value for `WKCompanionAppBundleIdentifier` in your info.plist for watch kit app. It should match the bundle identifier of your application
31,799,751
I have two lists of phone numbers. 1st list is a subset of 2nd list. I ran two different algorithms below to determine which phone numbers are contained in both of two lists. * Way 1: + Sortting 1st list: Arrays.sort(FirstList); + Looping 2nd list to find matched element: If Arrays.binarySearch(FistList, 'each o...
2015/08/04
['https://Stackoverflow.com/questions/31799751', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1517270/']
Because hashing is *O(1)* and binary searching is *O(log N)*.
Look at the source code for HashMap: it creates and stores a hash for each added (key, value) pair, then the containsKey() method calculates a hash for the given key, and uses a very fast operation to check if it is already in the map. So most retrieval operations are very fast.
31,799,751
I have two lists of phone numbers. 1st list is a subset of 2nd list. I ran two different algorithms below to determine which phone numbers are contained in both of two lists. * Way 1: + Sortting 1st list: Arrays.sort(FirstList); + Looping 2nd list to find matched element: If Arrays.binarySearch(FistList, 'each o...
2015/08/04
['https://Stackoverflow.com/questions/31799751', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1517270/']
`HashMap` relies on a very efficient algorithm called 'hashing' which has been in use for many years and is reliable and effective. Essentially the way it works is to split the items in the collection into much smaller groups which can be accessed extremely quickly. Once the group is located a less efficient search mec...
Look at the source code for HashMap: it creates and stores a hash for each added (key, value) pair, then the containsKey() method calculates a hash for the given key, and uses a very fast operation to check if it is already in the map. So most retrieval operations are very fast.
31,799,751
I have two lists of phone numbers. 1st list is a subset of 2nd list. I ran two different algorithms below to determine which phone numbers are contained in both of two lists. * Way 1: + Sortting 1st list: Arrays.sort(FirstList); + Looping 2nd list to find matched element: If Arrays.binarySearch(FistList, 'each o...
2015/08/04
['https://Stackoverflow.com/questions/31799751', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1517270/']
Because hashing is *O(1)* and binary searching is *O(log N)*.
Way 1: * Sorting: around `O(nlogn)` * Search: around `O(logn)` Way 2: * Creating HashTable: `O(n)` for small density (no collisions) * Contains: `O(1)`
31,799,751
I have two lists of phone numbers. 1st list is a subset of 2nd list. I ran two different algorithms below to determine which phone numbers are contained in both of two lists. * Way 1: + Sortting 1st list: Arrays.sort(FirstList); + Looping 2nd list to find matched element: If Arrays.binarySearch(FistList, 'each o...
2015/08/04
['https://Stackoverflow.com/questions/31799751', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1517270/']
Because hashing is *O(1)* and binary searching is *O(log N)*.
`HashMap` relies on a very efficient algorithm called 'hashing' which has been in use for many years and is reliable and effective. Essentially the way it works is to split the items in the collection into much smaller groups which can be accessed extremely quickly. Once the group is located a less efficient search mec...
31,799,751
I have two lists of phone numbers. 1st list is a subset of 2nd list. I ran two different algorithms below to determine which phone numbers are contained in both of two lists. * Way 1: + Sortting 1st list: Arrays.sort(FirstList); + Looping 2nd list to find matched element: If Arrays.binarySearch(FistList, 'each o...
2015/08/04
['https://Stackoverflow.com/questions/31799751', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1517270/']
`HashMap` relies on a very efficient algorithm called 'hashing' which has been in use for many years and is reliable and effective. Essentially the way it works is to split the items in the collection into much smaller groups which can be accessed extremely quickly. Once the group is located a less efficient search mec...
Way 1: * Sorting: around `O(nlogn)` * Search: around `O(logn)` Way 2: * Creating HashTable: `O(n)` for small density (no collisions) * Contains: `O(1)`
50,493,197
currently, I'm practicing solidity. However, I'm a little confused about accessing a private variable in a contract. For example here; ``` address private a; address private b; mapping (bytes32 => uint) public people; mapping (bytes32 => mapping(address => uint)) public listOfEmp; bytes32[] public list; bytes32 priva...
2018/05/23
['https://Stackoverflow.com/questions/50493197', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6181020/']
You can access the storage of your contract even if it's private. Try this: ``` web3.eth.getStorageAt("0x501...", 5) ``` If you want to access the map or array, check this document for layout of state variables: <https://solidity.readthedocs.io/en/v0.4.24/miscellaneous.html> By the way, you should always use getPr...
I don't believe you can. A private variable is meant to only be used within the contract in which it is defined. See here: <http://solidity.readthedocs.io/en/v0.4.21/contracts.html>
50,493,197
currently, I'm practicing solidity. However, I'm a little confused about accessing a private variable in a contract. For example here; ``` address private a; address private b; mapping (bytes32 => uint) public people; mapping (bytes32 => mapping(address => uint)) public listOfEmp; bytes32[] public list; bytes32 priva...
2018/05/23
['https://Stackoverflow.com/questions/50493197', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6181020/']
Think of Ethereum as a process running on your machine or remotely. Using `web3.eth.getStorageAt` you read data from the process memory. In the same way you can read the data of every program on your computer. On other hands, high level programming languages like Java, C++ or Solidity frequently define access rules on...
I don't believe you can. A private variable is meant to only be used within the contract in which it is defined. See here: <http://solidity.readthedocs.io/en/v0.4.21/contracts.html>
50,493,197
currently, I'm practicing solidity. However, I'm a little confused about accessing a private variable in a contract. For example here; ``` address private a; address private b; mapping (bytes32 => uint) public people; mapping (bytes32 => mapping(address => uint)) public listOfEmp; bytes32[] public list; bytes32 priva...
2018/05/23
['https://Stackoverflow.com/questions/50493197', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6181020/']
You can access the storage of your contract even if it's private. Try this: ``` web3.eth.getStorageAt("0x501...", 5) ``` If you want to access the map or array, check this document for layout of state variables: <https://solidity.readthedocs.io/en/v0.4.24/miscellaneous.html> By the way, you should always use getPr...
Think of Ethereum as a process running on your machine or remotely. Using `web3.eth.getStorageAt` you read data from the process memory. In the same way you can read the data of every program on your computer. On other hands, high level programming languages like Java, C++ or Solidity frequently define access rules on...
68,885,669
I have RGBA image from canvas and I use typedArray to remove alpha channel. ``` // data - arr from canvas. // [1,2,3,255, 1,2,3,255, 1,2,3,255,] // R G B A R G B A R G B A const delta = 4; const length = data.length; const newLength = length - length / delta; const rgbArr = new Uint8Array(newLength...
2021/08/22
['https://Stackoverflow.com/questions/68885669', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2497351/']
Looks like your solution is pretty good. At least none of the alternatives I came up with so far comes anywhere close in performance. Run the snippet to see for yourself. **Updated** with Justin's suggestion using `.filter` -- elegant but not faster. ```js const data = new Uint8Array(1e8); const delta = 4; const len...
filter would be good here ```js let array = new Uint8Array([1,2,3,255,1,2,3,255,1,2,3,255,1,2,3,255]) let filtered = array.filter((el,i) => { return i % 4 !== 4 - 1 }) console.log(filtered) ```
16,158,995
hi all ive been up all night trying to get this work, im trying to test the `$year` value against the date to make sure that it is not less than the current date here is my code at the moment it doesn't seem to work im not sure what im doing wrong ``` public function checkDateField($month, $day, $year) { ...
2013/04/23
['https://Stackoverflow.com/questions/16158995', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2228587/']
you can run the example by providing a path to the arm-linux-gnueabi shared libs using the -L flag. ``` qemu-arm -L /usr/arm-linux-gnueabi/ ``` also make sure the LD\_LIBRARY\_PATH is not set. ``` unset LD_LIBRARY_PATH ```
``` $ export QEMU_LD_PREFIX=/usr/arm-linux-gnueabi ``` This works for me. It's basically the same thing as: ``` $ qemu-arm -L /usr/arm-linux-gnueabi/ ``` You can add it to the ~/.bashrc file so you don't have to type it everytime you open the terminal.
16,158,995
hi all ive been up all night trying to get this work, im trying to test the `$year` value against the date to make sure that it is not less than the current date here is my code at the moment it doesn't seem to work im not sure what im doing wrong ``` public function checkDateField($month, $day, $year) { ...
2013/04/23
['https://Stackoverflow.com/questions/16158995', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2228587/']
you can run the example by providing a path to the arm-linux-gnueabi shared libs using the -L flag. ``` qemu-arm -L /usr/arm-linux-gnueabi/ ``` also make sure the LD\_LIBRARY\_PATH is not set. ``` unset LD_LIBRARY_PATH ```
If you want to run **ARM** without Linux, then you need a different compiler (at least). `arm-linux-gnueabi-gcc` is a compiler for **Linux**. The compiler and `libc` are intimately linked. You will need a `newlib` compiler with a portability layer for *qemu*.[porting newlib](http://wiki.osdev.org/Porting_Newlib) See:...
16,158,995
hi all ive been up all night trying to get this work, im trying to test the `$year` value against the date to make sure that it is not less than the current date here is my code at the moment it doesn't seem to work im not sure what im doing wrong ``` public function checkDateField($month, $day, $year) { ...
2013/04/23
['https://Stackoverflow.com/questions/16158995', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2228587/']
you can run the example by providing a path to the arm-linux-gnueabi shared libs using the -L flag. ``` qemu-arm -L /usr/arm-linux-gnueabi/ ``` also make sure the LD\_LIBRARY\_PATH is not set. ``` unset LD_LIBRARY_PATH ```
A variant, which worked for me, was to pass the loader library directly and to specify the required library paths using the loader parameter `--library-path`. For example: ``` $ TOOLCHAIN_ROOT=/usr/local/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/arm-linux-gnueabihf $ qemu-arm $TOOLCHAIN_ROOT/libc/lib/l...
16,158,995
hi all ive been up all night trying to get this work, im trying to test the `$year` value against the date to make sure that it is not less than the current date here is my code at the moment it doesn't seem to work im not sure what im doing wrong ``` public function checkDateField($month, $day, $year) { ...
2013/04/23
['https://Stackoverflow.com/questions/16158995', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2228587/']
I also met this problem when running a C program with assembly code. My solution is to build the executable with the option "-static", for instance ``` arm-linux-gnueabi-gcc -static -g main.c square.s ``` Then ``` qemu-arm a.out ``` will not report the error saying "can not find the /lib/ld-linux.so.3". The only...
A variant, which worked for me, was to pass the loader library directly and to specify the required library paths using the loader parameter `--library-path`. For example: ``` $ TOOLCHAIN_ROOT=/usr/local/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/arm-linux-gnueabihf $ qemu-arm $TOOLCHAIN_ROOT/libc/lib/l...
16,158,995
hi all ive been up all night trying to get this work, im trying to test the `$year` value against the date to make sure that it is not less than the current date here is my code at the moment it doesn't seem to work im not sure what im doing wrong ``` public function checkDateField($month, $day, $year) { ...
2013/04/23
['https://Stackoverflow.com/questions/16158995', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2228587/']
``` $ export QEMU_LD_PREFIX=/usr/arm-linux-gnueabi ``` This works for me. It's basically the same thing as: ``` $ qemu-arm -L /usr/arm-linux-gnueabi/ ``` You can add it to the ~/.bashrc file so you don't have to type it everytime you open the terminal.
A variant, which worked for me, was to pass the loader library directly and to specify the required library paths using the loader parameter `--library-path`. For example: ``` $ TOOLCHAIN_ROOT=/usr/local/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/arm-linux-gnueabihf $ qemu-arm $TOOLCHAIN_ROOT/libc/lib/l...
16,158,995
hi all ive been up all night trying to get this work, im trying to test the `$year` value against the date to make sure that it is not less than the current date here is my code at the moment it doesn't seem to work im not sure what im doing wrong ``` public function checkDateField($month, $day, $year) { ...
2013/04/23
['https://Stackoverflow.com/questions/16158995', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2228587/']
If you want to run **ARM** without Linux, then you need a different compiler (at least). `arm-linux-gnueabi-gcc` is a compiler for **Linux**. The compiler and `libc` are intimately linked. You will need a `newlib` compiler with a portability layer for *qemu*.[porting newlib](http://wiki.osdev.org/Porting_Newlib) See:...
A variant, which worked for me, was to pass the loader library directly and to specify the required library paths using the loader parameter `--library-path`. For example: ``` $ TOOLCHAIN_ROOT=/usr/local/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/arm-linux-gnueabihf $ qemu-arm $TOOLCHAIN_ROOT/libc/lib/l...
16,158,995
hi all ive been up all night trying to get this work, im trying to test the `$year` value against the date to make sure that it is not less than the current date here is my code at the moment it doesn't seem to work im not sure what im doing wrong ``` public function checkDateField($month, $day, $year) { ...
2013/04/23
['https://Stackoverflow.com/questions/16158995', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2228587/']
I also met this problem when running a C program with assembly code. My solution is to build the executable with the option "-static", for instance ``` arm-linux-gnueabi-gcc -static -g main.c square.s ``` Then ``` qemu-arm a.out ``` will not report the error saying "can not find the /lib/ld-linux.so.3". The only...
If you want to run **ARM** without Linux, then you need a different compiler (at least). `arm-linux-gnueabi-gcc` is a compiler for **Linux**. The compiler and `libc` are intimately linked. You will need a `newlib` compiler with a portability layer for *qemu*.[porting newlib](http://wiki.osdev.org/Porting_Newlib) See:...
16,158,995
hi all ive been up all night trying to get this work, im trying to test the `$year` value against the date to make sure that it is not less than the current date here is my code at the moment it doesn't seem to work im not sure what im doing wrong ``` public function checkDateField($month, $day, $year) { ...
2013/04/23
['https://Stackoverflow.com/questions/16158995', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2228587/']
you can run the example by providing a path to the arm-linux-gnueabi shared libs using the -L flag. ``` qemu-arm -L /usr/arm-linux-gnueabi/ ``` also make sure the LD\_LIBRARY\_PATH is not set. ``` unset LD_LIBRARY_PATH ```
I also met this problem when running a C program with assembly code. My solution is to build the executable with the option "-static", for instance ``` arm-linux-gnueabi-gcc -static -g main.c square.s ``` Then ``` qemu-arm a.out ``` will not report the error saying "can not find the /lib/ld-linux.so.3". The only...
16,158,995
hi all ive been up all night trying to get this work, im trying to test the `$year` value against the date to make sure that it is not less than the current date here is my code at the moment it doesn't seem to work im not sure what im doing wrong ``` public function checkDateField($month, $day, $year) { ...
2013/04/23
['https://Stackoverflow.com/questions/16158995', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2228587/']
``` $ export QEMU_LD_PREFIX=/usr/arm-linux-gnueabi ``` This works for me. It's basically the same thing as: ``` $ qemu-arm -L /usr/arm-linux-gnueabi/ ``` You can add it to the ~/.bashrc file so you don't have to type it everytime you open the terminal.
I solved the problem by copying the following libraries into /lib but I believe there should be a way better solution rather than this nasty solution I invented! ``` sudo cp /usr/arm-linux-gnueabi/lib/ld-linux.so.3 /lib sudo cp /usr/arm-linux-gnueabi/lib/libgcc_s.so.1 /lib sudo cp /usr/arm-linux-gnueabi/lib/libc.so.6...
16,158,995
hi all ive been up all night trying to get this work, im trying to test the `$year` value against the date to make sure that it is not less than the current date here is my code at the moment it doesn't seem to work im not sure what im doing wrong ``` public function checkDateField($month, $day, $year) { ...
2013/04/23
['https://Stackoverflow.com/questions/16158995', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2228587/']
I solved the problem by copying the following libraries into /lib but I believe there should be a way better solution rather than this nasty solution I invented! ``` sudo cp /usr/arm-linux-gnueabi/lib/ld-linux.so.3 /lib sudo cp /usr/arm-linux-gnueabi/lib/libgcc_s.so.1 /lib sudo cp /usr/arm-linux-gnueabi/lib/libc.so.6...
A variant, which worked for me, was to pass the loader library directly and to specify the required library paths using the loader parameter `--library-path`. For example: ``` $ TOOLCHAIN_ROOT=/usr/local/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/arm-linux-gnueabihf $ qemu-arm $TOOLCHAIN_ROOT/libc/lib/l...
32,376,066
I have `registertemptable` in `Apache Spark` using `Zeppelin` below: ``` val hvacText = sc.textFile("...") case class Hvac(date: String, time: String, targettemp: Integer, actualtemp: Integer, buildingID: String) val hvac = hvacText.map(s => s.split(",")).filter(s => s(0) != "Date").map( s => Hvac(s(0), ...
2015/09/03
['https://Stackoverflow.com/questions/32376066', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5296786/']
**Spark 2.x** For temporary views you can use [`Catalog.dropTempView`](https://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.sql.catalog.Catalog@dropTempView%28viewName:String%29:Boolean): ``` spark.catalog.dropTempView("df") ``` For global views you can use [`Catalog.dropGlobalTempView`](https...
If you want to remove your temp table on zeppelin, try like this. ``` sqlc.dropTempTable("hvac") ``` or ``` %sql DROP VIEW hvac ``` And you can get the informations you need from spark API Docs(<http://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.package>)
32,376,066
I have `registertemptable` in `Apache Spark` using `Zeppelin` below: ``` val hvacText = sc.textFile("...") case class Hvac(date: String, time: String, targettemp: Integer, actualtemp: Integer, buildingID: String) val hvac = hvacText.map(s => s.split(",")).filter(s => s(0) != "Date").map( s => Hvac(s(0), ...
2015/09/03
['https://Stackoverflow.com/questions/32376066', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5296786/']
**Spark 2.x** For temporary views you can use [`Catalog.dropTempView`](https://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.sql.catalog.Catalog@dropTempView%28viewName:String%29:Boolean): ``` spark.catalog.dropTempView("df") ``` For global views you can use [`Catalog.dropGlobalTempView`](https...
in new ver (2.0 and latest) of spark. one should use: `createOrReplaceTempView` in place of `registerTempTable` (depricated) and corresponding method to deallocate is: `dropTempView` ``` spark.catalog.dropTempView("temp_view_name") //drops the table ```
32,376,066
I have `registertemptable` in `Apache Spark` using `Zeppelin` below: ``` val hvacText = sc.textFile("...") case class Hvac(date: String, time: String, targettemp: Integer, actualtemp: Integer, buildingID: String) val hvac = hvacText.map(s => s.split(",")).filter(s => s(0) != "Date").map( s => Hvac(s(0), ...
2015/09/03
['https://Stackoverflow.com/questions/32376066', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5296786/']
**Spark 2.x** For temporary views you can use [`Catalog.dropTempView`](https://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.sql.catalog.Catalog@dropTempView%28viewName:String%29:Boolean): ``` spark.catalog.dropTempView("df") ``` For global views you can use [`Catalog.dropGlobalTempView`](https...
You can use sql drop table/view statement to remove it like below ``` spark.sql("drop view hvac"); ```
32,376,066
I have `registertemptable` in `Apache Spark` using `Zeppelin` below: ``` val hvacText = sc.textFile("...") case class Hvac(date: String, time: String, targettemp: Integer, actualtemp: Integer, buildingID: String) val hvac = hvacText.map(s => s.split(",")).filter(s => s(0) != "Date").map( s => Hvac(s(0), ...
2015/09/03
['https://Stackoverflow.com/questions/32376066', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5296786/']
If you want to remove your temp table on zeppelin, try like this. ``` sqlc.dropTempTable("hvac") ``` or ``` %sql DROP VIEW hvac ``` And you can get the informations you need from spark API Docs(<http://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.package>)
You can use sql drop table/view statement to remove it like below ``` spark.sql("drop view hvac"); ```
32,376,066
I have `registertemptable` in `Apache Spark` using `Zeppelin` below: ``` val hvacText = sc.textFile("...") case class Hvac(date: String, time: String, targettemp: Integer, actualtemp: Integer, buildingID: String) val hvac = hvacText.map(s => s.split(",")).filter(s => s(0) != "Date").map( s => Hvac(s(0), ...
2015/09/03
['https://Stackoverflow.com/questions/32376066', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5296786/']
in new ver (2.0 and latest) of spark. one should use: `createOrReplaceTempView` in place of `registerTempTable` (depricated) and corresponding method to deallocate is: `dropTempView` ``` spark.catalog.dropTempView("temp_view_name") //drops the table ```
You can use sql drop table/view statement to remove it like below ``` spark.sql("drop view hvac"); ```
20,344,535
Here is the sample code. Since there is not source to backtrack given a code get the pattern. ``` ResultSet rs = stmt.executeQuery("SELECT a, b, c FROM Table1"); while (rs.next()) { int x = rs.getInt("a"); String s = rs.getString("b"); float f = rs.getFloat("c"); } ``` I think this ...
2013/12/03
['https://Stackoverflow.com/questions/20344535', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2458372/']
A ResultSet is an instance of the [Iterator](http://en.wikipedia.org/wiki/Iterator_pattern) pattern. But not the `java.util.Iterator` interface. [Iterator as ArrayList http://ts1.mm.bing.net/th?id=H.4589598971789992&pid=15.1](http://ts1.mm.bing.net/th?id=H.4589598971789992&pid=15.1)
the patten name is "Iterator Pattern".
5,384,157
I have zero experience with OpenGL and a small amount of experience with Objective-C, but I'm fairly decent with C++. What resources should I be looking at to start learning how to use OpenGL within Objective-C? I read somewhere at some point that starting out with NSOpenGLView is a good start.
2011/03/21
['https://Stackoverflow.com/questions/5384157', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/657850/']
Given your affinity for C++, [this](http://iphone-3d-programming.labs.oreilly.com/) will probably be the most appealing resource for you. It covers OpenGL ES 1.1 and 2.0, so you'll get all you need to know. Personally, I really enjoy [this set of tutorials](http://iphonedevelopment.blogspot.com/2009/05/opengl-es-from-...
[NeHe's tutorials](http://nehe.gamedev.net/) include full Cocoa versions of all the early tutorials.
5,384,157
I have zero experience with OpenGL and a small amount of experience with Objective-C, but I'm fairly decent with C++. What resources should I be looking at to start learning how to use OpenGL within Objective-C? I read somewhere at some point that starting out with NSOpenGLView is a good start.
2011/03/21
['https://Stackoverflow.com/questions/5384157', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/657850/']
Honestly, you're probably not going to need to know much Objective-C for dealing with OpenGL, just C. OpenGL is C-based, so you don't need to learn anything new, language-wise, to deal with it. Objective-C knowledge is only really necessary when you plan on using Cocoa to build up your interface. Even then, the languag...
Given your affinity for C++, [this](http://iphone-3d-programming.labs.oreilly.com/) will probably be the most appealing resource for you. It covers OpenGL ES 1.1 and 2.0, so you'll get all you need to know. Personally, I really enjoy [this set of tutorials](http://iphonedevelopment.blogspot.com/2009/05/opengl-es-from-...
5,384,157
I have zero experience with OpenGL and a small amount of experience with Objective-C, but I'm fairly decent with C++. What resources should I be looking at to start learning how to use OpenGL within Objective-C? I read somewhere at some point that starting out with NSOpenGLView is a good start.
2011/03/21
['https://Stackoverflow.com/questions/5384157', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/657850/']
Honestly, you're probably not going to need to know much Objective-C for dealing with OpenGL, just C. OpenGL is C-based, so you don't need to learn anything new, language-wise, to deal with it. Objective-C knowledge is only really necessary when you plan on using Cocoa to build up your interface. Even then, the languag...
[NeHe's tutorials](http://nehe.gamedev.net/) include full Cocoa versions of all the early tutorials.
59,770,828
How can I create a script of inserts for my sybase to oracle Migration? The Migration wizard only gives me the option to migrate procedures and triggers and such. But there is no select for just tables. When I try to migrate tables offline and move data. the datamove/ folder is empty. I would also want to only migrate ...
2020/01/16
['https://Stackoverflow.com/questions/59770828', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/10847608/']
You can find solution for your problem in the following codesandbox <https://codesandbox.io/s/reactjs-accordion-automatic-close-mechanism-yejc0> Change prop names as it fits your code base, but the logic is solid
You could do something like this, using the state hook in the App component ``` export default function App() { const items = [ { id: 1, title: 'First Accordion', content: 'Hello' }, { id: 2, title: 'Click me', content: 'Hello 2' }, { id: 3, title: 'Third Accordion Accordion', content: 'Hello 3' }, ] ...
353,015
Specifically, when a post is flagged as **in need of moderator intervention** what does it mean? A while ago, this happened: --- [![enter image description here](https://i.stack.imgur.com/lPfVU.png)](https://i.stack.imgur.com/lPfVU.png) --- Little backstory: I asked a question which was *related* to a question su...
2020/08/14
['https://meta.stackexchange.com/questions/353015', 'https://meta.stackexchange.com', 'https://meta.stackexchange.com/users/826559/']
I've looked through a few of your flags and I think you need to rethink how flags work on our sites and what moderators are and do. Flags - particularly moderator attention flags - are designed to draw attention of the moderators when there is something that needs special treatment. These are generally rare flags and ...
> > Also notified the user who marked it as duplicate and edited the question to make it look pointed towards the author's intent(me). > > > That's unfortunate, but the correct procedure here is to [edit your question to clarify why it's not a duplicate](https://meta.stackexchange.com/q/194476/295232). That's some...
60,485,133
I got to find that we could read the contents of a file into a std::vector like this: ``` ifstream fin(..., ios::in); std::vector<char> buf( std::istreambuf_iterator<char>(fin), std::istreambuf_iterator<char>()); ``` Will this method cause plenty of memory reallocation like when I ...
2020/03/02
['https://Stackoverflow.com/questions/60485133', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/10132474/']
[`std::istreambuf_iterator`](https://en.cppreference.com/w/cpp/iterator/istreambuf_iterator) is an input iterator, so the distance between begin and end is not known in advance. There will be several reallocations during the constructor, unless the file is very small. For a random access iterator the distance would be ...
Vector keeps the data allocated sequentially. When a new element is added it may have no memory free after the last element, then it need to move all the data to a place in memory where it has enough room to the old and new data. The best solution is give a buffer to vector with the follow command: vector::reserve(siz...
66,880,148
I have a custom function and I would like to evaluate its media performance. For this, I would like to loop by executing my function a certain number of times. I want to do this because I see that the runtime is very unstable. A typical execution measuring the execution time would look something like this ``` @time m...
2021/03/31
['https://Stackoverflow.com/questions/66880148', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/12005038/']
Try [`@elapsed`](https://docs.julialang.org/en/v1/base/base/#Base.@elapsed) instead to get the execution time in seconds.
If you are timing multiple sections of your code at once, you can also use [TimerOutputs.jl](https://github.com/KristofferC/TimerOutputs.jl), which I've found to be very convenient. It automatically computes average runtimes and % total runtime.
593,683
Sometimes it's quite confusing when it comes to determining how to answer a probability question. Confusions always arise as of whether I should multiply/add or make conditional the probabilities. For example the following: > > Consider influenza epidemics for two parent heterosexual families. > Suppose that the prob...
2022/10/27
['https://stats.stackexchange.com/questions/593683', 'https://stats.stackexchange.com', 'https://stats.stackexchange.com/users/331633/']
Let's follow up on GlenB's advice and make those [Venn diagrams](https://en.m.wikipedia.org/wiki/Venn_diagram). We do this below with the heterosexual stereotype colours representing mother sick with red/pink and dad sick with blue. [![Venn diagram intro](https://i.stack.imgur.com/2tPUI.jpg)](https://i.stack.imgur.com...
> > My first question is that: I find it particularly difficult to differentiate between addition or multiplication rule when it comes to probabilities from independent events. > > > That's not a question (you don't ask anything), but the answer to what I assume is your implied question is simple: there *isn't an ...
32,126,987
Where can i find tutorials about advanced borders and box-shadows in css? I discovered shape of css but cant explanation this: ```css #space-invader{ box-shadow: 0 0 0 1em red, 0 1em 0 1em red, -2.5em 1.5em 0 .5em red, 2.5em 1.5em 0 .5em red, -3em -3em 0 0 red, 3em -3em 0 0 red, -2em -2...
2015/08/20
['https://Stackoverflow.com/questions/32126987', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5230154/']
You could use a mutex (one per car). Lock: before changing location of the associated car Unlock: after changing location of the associated car Lock: before getting location of the associated car Unlock: after done doing work that relies on that location being up to date
There are several ways to do this. Which way you choose depends a lot on the number of cars, the frequency of updates and position requests, the expected response time, and how accurate (up to date) you want the position reports to be. The easiest way to handle this is with a simple mutex (lock) that allows only one t...
32,126,987
Where can i find tutorials about advanced borders and box-shadows in css? I discovered shape of css but cant explanation this: ```css #space-invader{ box-shadow: 0 0 0 1em red, 0 1em 0 1em red, -2.5em 1.5em 0 .5em red, 2.5em 1.5em 0 .5em red, -3em -3em 0 0 red, 3em -3em 0 0 red, -2em -2...
2015/08/20
['https://Stackoverflow.com/questions/32126987', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5230154/']
I'd answer with: Try to make threading an external concept to your system yet make the system as modular and encapsulated as possible at the same time. It will allow adding concurrency at later phase at low cost and in case the solution happens to work nicely in a single thread (say by making it event-loop-based) no t...
There are several ways to do this. Which way you choose depends a lot on the number of cars, the frequency of updates and position requests, the expected response time, and how accurate (up to date) you want the position reports to be. The easiest way to handle this is with a simple mutex (lock) that allows only one t...
26,499,775
I'm trying to use GMP with C++11, but apparently it's not allowed to use mpz\_class in constexpr functions because mpz\_class is not a literal type. ``` #include <iostream> #include <gmpxx.h> using namespace std; constexpr mpz_class factorial(mpz_class n) { if (n == 0) return 1; else return n * factorial(n - ...
2014/10/22
['https://Stackoverflow.com/questions/26499775', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4168350/']
Instagram says: > > Note that we do not include an expiry time. Our access\_tokens have no explicit expiry, though your app should handle the case that either the user revokes access or we expire the token after some period of time. In this case, your response’s meta will contain an β€œerror\_type=OAuthAccessTokenError...
First you have to get the access token and save that access token in your app, access token is not valid forever, so you should implement and handle this on your application follow this tutorial for login with instagram using oauth and its implementation on app side <http://codegerms.com/login-with-instagram-ios-applic...
53,116,406
When I am working on the subdirectory of a git-repo, I should change dir to the parent to issue commands like ``` $ cd ..; git add .; git commit -m "2018-11-02 17:58:09" ; cd - [master 0984351] 2018-11-02 17:58:09 12 files changed, 558 insertions(+), 13 deletions(-) ``` Change to parent dir, commit changes and chan...
2018/11/02
['https://Stackoverflow.com/questions/53116406', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7301792/']
In our official documentation for Kubernetes filter we have an example about how to make your Pod suggest a parser for your data based in an annotation: <https://docs.fluentbit.io/manual/filter/kubernetes>
Look at this configmap: <https://github.com/fluent/fluent-bit-kubernetes-logging/blob/master/output/elasticsearch/fluent-bit-configmap.yaml> The nginx parser should be there: ``` [PARSER] Name nginx Format regex Regex ^(?<remote>[^ ]*) (?<host>[^ ]*) (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<m...
20,735,570
It is my understanding that in Lua 5.2 that environments are stored in upvalues named `_ENV`. This has made it really confusing for me to modify the environment of a chunk before running it, but after loading it. I would like to load a file with some functions and use the chunk to inject those functions into various e...
2013/12/23
['https://Stackoverflow.com/questions/20735570', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1825760/']
The simplest way to allow a chunk to be run in different environments is to make this explicit and have it receive an environment. Adding this line at the top of the chunk achieves this: `_ENV=...` Now you can call `chunk(env1)` and later `chunk(env2)` at your pleasure. There, no `debug` magic with upvalues. Althou...
I do not understand why you want to avoid using the debug library, while you are happy to use a C function (neither is possible in a sandbox.) It can be done using `debug.upvaluejoin`: ``` function newEnvForChunk(chunk, index) local newEnv = {} local function source() return newEnv end debug.upvaluejoin(chunk, ...
20,735,570
It is my understanding that in Lua 5.2 that environments are stored in upvalues named `_ENV`. This has made it really confusing for me to modify the environment of a chunk before running it, but after loading it. I would like to load a file with some functions and use the chunk to inject those functions into various e...
2013/12/23
['https://Stackoverflow.com/questions/20735570', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1825760/']
I do not understand why you want to avoid using the debug library, while you are happy to use a C function (neither is possible in a sandbox.) It can be done using `debug.upvaluejoin`: ``` function newEnvForChunk(chunk, index) local newEnv = {} local function source() return newEnv end debug.upvaluejoin(chunk, ...
If you don't want to modify your chunk (per LHF's great answer) here are two alternatives: ### Set up a blank environment, then dynamically change its environment to yours ```lua function compile(code) local meta = {} local env = setmetatable({},meta) return {meta=meta, f=load('return '..code, nil, nil, env)...
20,735,570
It is my understanding that in Lua 5.2 that environments are stored in upvalues named `_ENV`. This has made it really confusing for me to modify the environment of a chunk before running it, but after loading it. I would like to load a file with some functions and use the chunk to inject those functions into various e...
2013/12/23
['https://Stackoverflow.com/questions/20735570', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1825760/']
The simplest way to allow a chunk to be run in different environments is to make this explicit and have it receive an environment. Adding this line at the top of the chunk achieves this: `_ENV=...` Now you can call `chunk(env1)` and later `chunk(env2)` at your pleasure. There, no `debug` magic with upvalues. Althou...
If you don't want to modify your chunk (per LHF's great answer) here are two alternatives: ### Set up a blank environment, then dynamically change its environment to yours ```lua function compile(code) local meta = {} local env = setmetatable({},meta) return {meta=meta, f=load('return '..code, nil, nil, env)...
11,306,060
I'm trying to do it like this: Every single user can choose fields (like structures on MySQL) where this fields can handle their respective value, it's like doing a DB inside a DB. But how can I do it using a single table? (not talking about user accounts etc where I should be able to use a pointer to his own "s...
2012/07/03
['https://Stackoverflow.com/questions/11306060', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/996134/']
In my opinion you should create two tables. 1. with the user info 2. with 3 fields (userid, key and value) Each user has 1 record in the first table. Each user can have 0 or more records in the second table. This will ensure you can still search the data and that users can easily add more key/value pairs when needed.
Use a table with key-value pairs. So three columns: * user id * key ("name") * value ("asd") Add an index on *user id*, so that you can query a user's attributes easily. If you wanted to query all users with the same properties, then you could add a second index on *key* and/or *value*.
11,306,060
I'm trying to do it like this: Every single user can choose fields (like structures on MySQL) where this fields can handle their respective value, it's like doing a DB inside a DB. But how can I do it using a single table? (not talking about user accounts etc where I should be able to use a pointer to his own "s...
2012/07/03
['https://Stackoverflow.com/questions/11306060', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/996134/']
In my opinion you should create two tables. 1. with the user info 2. with 3 fields (userid, key and value) Each user has 1 record in the first table. Each user can have 0 or more records in the second table. This will ensure you can still search the data and that users can easily add more key/value pairs when needed.
Don't start building a database in a database. In this case, since the user makes the field by himself there is no relation between the fields as I understand? In that case it would make sense to take a look at the NoSQL databases since they seem to fit very good for this kind of situations. Another thing to check is...
11,306,060
I'm trying to do it like this: Every single user can choose fields (like structures on MySQL) where this fields can handle their respective value, it's like doing a DB inside a DB. But how can I do it using a single table? (not talking about user accounts etc where I should be able to use a pointer to his own "s...
2012/07/03
['https://Stackoverflow.com/questions/11306060', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/996134/']
In my opinion you should create two tables. 1. with the user info 2. with 3 fields (userid, key and value) Each user has 1 record in the first table. Each user can have 0 or more records in the second table. This will ensure you can still search the data and that users can easily add more key/value pairs when needed.
While i think the rational answer to this question is the one given by PeeHaa, if you really want the data to fit into one table you could try saving a serialized PHP array in one of the fields. Check out [serialize](http://php.net/manual/en/function.serialize.php) and [unserialize](http://www.php.net/manual/en/functio...
11,306,060
I'm trying to do it like this: Every single user can choose fields (like structures on MySQL) where this fields can handle their respective value, it's like doing a DB inside a DB. But how can I do it using a single table? (not talking about user accounts etc where I should be able to use a pointer to his own "s...
2012/07/03
['https://Stackoverflow.com/questions/11306060', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/996134/']
In my opinion you should create two tables. 1. with the user info 2. with 3 fields (userid, key and value) Each user has 1 record in the first table. Each user can have 0 or more records in the second table. This will ensure you can still search the data and that users can easily add more key/value pairs when needed.
Hope you are using a programming language also to get the data and present them. You can have a single table which has a varchar field. Then you store the serialized data of the field structure and their value in that field. When you want to get the structure, query the data and De-serialize that varchar field data. ...
11,306,060
I'm trying to do it like this: Every single user can choose fields (like structures on MySQL) where this fields can handle their respective value, it's like doing a DB inside a DB. But how can I do it using a single table? (not talking about user accounts etc where I should be able to use a pointer to his own "s...
2012/07/03
['https://Stackoverflow.com/questions/11306060', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/996134/']
Don't start building a database in a database. In this case, since the user makes the field by himself there is no relation between the fields as I understand? In that case it would make sense to take a look at the NoSQL databases since they seem to fit very good for this kind of situations. Another thing to check is...
Use a table with key-value pairs. So three columns: * user id * key ("name") * value ("asd") Add an index on *user id*, so that you can query a user's attributes easily. If you wanted to query all users with the same properties, then you could add a second index on *key* and/or *value*.
11,306,060
I'm trying to do it like this: Every single user can choose fields (like structures on MySQL) where this fields can handle their respective value, it's like doing a DB inside a DB. But how can I do it using a single table? (not talking about user accounts etc where I should be able to use a pointer to his own "s...
2012/07/03
['https://Stackoverflow.com/questions/11306060', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/996134/']
While i think the rational answer to this question is the one given by PeeHaa, if you really want the data to fit into one table you could try saving a serialized PHP array in one of the fields. Check out [serialize](http://php.net/manual/en/function.serialize.php) and [unserialize](http://www.php.net/manual/en/functio...
Use a table with key-value pairs. So three columns: * user id * key ("name") * value ("asd") Add an index on *user id*, so that you can query a user's attributes easily. If you wanted to query all users with the same properties, then you could add a second index on *key* and/or *value*.
11,306,060
I'm trying to do it like this: Every single user can choose fields (like structures on MySQL) where this fields can handle their respective value, it's like doing a DB inside a DB. But how can I do it using a single table? (not talking about user accounts etc where I should be able to use a pointer to his own "s...
2012/07/03
['https://Stackoverflow.com/questions/11306060', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/996134/']
Don't start building a database in a database. In this case, since the user makes the field by himself there is no relation between the fields as I understand? In that case it would make sense to take a look at the NoSQL databases since they seem to fit very good for this kind of situations. Another thing to check is...
Hope you are using a programming language also to get the data and present them. You can have a single table which has a varchar field. Then you store the serialized data of the field structure and their value in that field. When you want to get the structure, query the data and De-serialize that varchar field data. ...
11,306,060
I'm trying to do it like this: Every single user can choose fields (like structures on MySQL) where this fields can handle their respective value, it's like doing a DB inside a DB. But how can I do it using a single table? (not talking about user accounts etc where I should be able to use a pointer to his own "s...
2012/07/03
['https://Stackoverflow.com/questions/11306060', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/996134/']
While i think the rational answer to this question is the one given by PeeHaa, if you really want the data to fit into one table you could try saving a serialized PHP array in one of the fields. Check out [serialize](http://php.net/manual/en/function.serialize.php) and [unserialize](http://www.php.net/manual/en/functio...
Hope you are using a programming language also to get the data and present them. You can have a single table which has a varchar field. Then you store the serialized data of the field structure and their value in that field. When you want to get the structure, query the data and De-serialize that varchar field data. ...
52,835,726
I want to hide the internal type from the user of a library. Currently I have something like this: foo.h ``` typedef struct public { uint16 a; //... unsigned char internals[4]; } public_type; ``` foo.c ``` typedef struct public { uint32_t a; }internals_type; ``` Then in the functions, I'm doin...
2018/10/16
['https://Stackoverflow.com/questions/52835726', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7757891/']
I suggest you read more about [opaque data types](https://en.wikipedia.org/wiki/Opaque_data_type), and consider e.g. the `FILE` structure. In short, don't split your structure into "public" and "private" variants (that way lies madness and possible undefined behavior). Instead just *declare* a structure in a public he...
You can do in foo.h: ``` typedef struct internals_type; typedef struct { uint16 a; internals_type* internals; } public_type ``` Including foo.h is then enough for your user to compile, without knowing what is exactly inside `internals_type`.
52,835,726
I want to hide the internal type from the user of a library. Currently I have something like this: foo.h ``` typedef struct public { uint16 a; //... unsigned char internals[4]; } public_type; ``` foo.c ``` typedef struct public { uint32_t a; }internals_type; ``` Then in the functions, I'm doin...
2018/10/16
['https://Stackoverflow.com/questions/52835726', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7757891/']
I suggest you read more about [opaque data types](https://en.wikipedia.org/wiki/Opaque_data_type), and consider e.g. the `FILE` structure. In short, don't split your structure into "public" and "private" variants (that way lies madness and possible undefined behavior). Instead just *declare* a structure in a public he...
Typically you use `void*` to hide your implementation, e.g. ``` void *create_foo(int param1, int param2); void print_foo(void* foo); int operate_on_foo(void* foo); ``` So you "cast" the `void*` in your functions to your internal type. The downside of this is, that the compiler can't help you with the types, e.g. th...
4,643,055
I have to find the range of $f(x)=x\sqrt{1-x^2}$ on the interval $[-1,1]$. I have done so by setting $x=\sin\theta$ and thus finding it to be $[-0.5,0.5]$. Let $x=\sinΞΈ$. Then, for $x\in[-1,1]$ we get that $ΞΈ \in [-\frac{\pi}{2}, \frac{\pi}{2}]$. Thus, $f(x)$ becomes: $f(\theta)=\sin\theta \sqrt{1-(\sin\theta)^2}= \s...
2023/02/20
['https://math.stackexchange.com/questions/4643055', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/1033909/']
You could reason like this: $f(x)$ will have its maximum value at the same point as $g(x) = (f(x))^2 = x^2 - x^4.$ This is quadratic in $x^2$ and an even function. Since $z-z^2$ takes its maximum value when $z=1/2$ (by finding the vertex of the parabola) then we know $g(x)$, and hence $f(x)$ takes its maximum value whe...
Alternatively, observe that the function is odd over $[-1,1]$. Hence, if the max value occurs at $x\_0 > 0$, then the min occurs at $-x\_0$. But if $x > 0$, then by AM-GM inequality: $f(x) =x\sqrt{1-x^2} \le \dfrac{x^2+ (1-x^2)}{2}=\dfrac{1}{2}$ with $=$ occurs when $x=\sqrt{1-x^2}\implies x^2 = 1-x^2\implies x=\dfrac{...
47,222,510
Hi I am using `json` parsing, I am getting `json` response from backend and parsing is working well. but the issue is that when I try to set data as per response it sets last index only. Following is my snippet code and `json` response can any one help me with this please. Right now it shows output (in my first text...
2017/11/10
['https://Stackoverflow.com/questions/47222510', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4817574/']
because you are doing a for loop to set the text of the textviews you are setting on both all the offers and the last one is what you are able to see ``` JSONArray productOffersList=drawerdatas.getJSONArray("productOffersList"); offertextlist=new ArrayList<ProductOffersModel>(); // You were re creating the list arra...
Handling JSON data manually is not a recommended practice for large datasets. You should go with a JSON parsing library, Gson may be a good choice. <https://github.com/google/gson>
47,222,510
Hi I am using `json` parsing, I am getting `json` response from backend and parsing is working well. but the issue is that when I try to set data as per response it sets last index only. Following is my snippet code and `json` response can any one help me with this please. Right now it shows output (in my first text...
2017/11/10
['https://Stackoverflow.com/questions/47222510', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4817574/']
because you are doing a for loop to set the text of the textviews you are setting on both all the offers and the last one is what you are able to see ``` JSONArray productOffersList=drawerdatas.getJSONArray("productOffersList"); offertextlist=new ArrayList<ProductOffersModel>(); // You were re creating the list arra...
try with this parsing, ``` JSONArray productOffersList=drawerdatas.getJSONArray("productOffersList"); for(int k=0;k<productOffersList.length();k++) { JSONObject joofer = productOffersList.getJSONObject(k); JSONArray offerLine=joofer.getJSONArray("offerLine"); ...
47,222,510
Hi I am using `json` parsing, I am getting `json` response from backend and parsing is working well. but the issue is that when I try to set data as per response it sets last index only. Following is my snippet code and `json` response can any one help me with this please. Right now it shows output (in my first text...
2017/11/10
['https://Stackoverflow.com/questions/47222510', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4817574/']
try with this parsing, ``` JSONArray productOffersList=drawerdatas.getJSONArray("productOffersList"); for(int k=0;k<productOffersList.length();k++) { JSONObject joofer = productOffersList.getJSONObject(k); JSONArray offerLine=joofer.getJSONArray("offerLine"); ...
Handling JSON data manually is not a recommended practice for large datasets. You should go with a JSON parsing library, Gson may be a good choice. <https://github.com/google/gson>
68,928
Is there any command that could show me the size of several folders in linux, perhaps ranked from biggest to smallest?
2009/11/11
['https://superuser.com/questions/68928', 'https://superuser.com', 'https://superuser.com/users/4586/']
As others said, `du` is the way to go. But knowing the options to `du` is essential. Here they are: ``` du -m --max-depth 1 /foo /bar ``` This will give you the size in megabytes of the directories contained in `/foo` and `/bar`. If you want the output to be sorted, pipe it through the `sort` utility: ``` du -m --m...
Or you can pass: ``` du -sm /dir1 /dir2 | sort -nrk 1 #or du -sm * | sort -nrk 1 ``` The difference between the first and the second is that the sencond will pick all the files and dirs in the current directory and the first just the dirs you passed.
68,928
Is there any command that could show me the size of several folders in linux, perhaps ranked from biggest to smallest?
2009/11/11
['https://superuser.com/questions/68928', 'https://superuser.com', 'https://superuser.com/users/4586/']
> > du [options] [directories and/or files] > > >
From the command line I prefer to list the biggest last so I use: ``` du -shm ./* | sort -n ```
68,928
Is there any command that could show me the size of several folders in linux, perhaps ranked from biggest to smallest?
2009/11/11
['https://superuser.com/questions/68928', 'https://superuser.com', 'https://superuser.com/users/4586/']
Or you can pass: ``` du -sm /dir1 /dir2 | sort -nrk 1 #or du -sm * | sort -nrk 1 ``` The difference between the first and the second is that the sencond will pick all the files and dirs in the current directory and the first just the dirs you passed.
use `du` in terminal.
68,928
Is there any command that could show me the size of several folders in linux, perhaps ranked from biggest to smallest?
2009/11/11
['https://superuser.com/questions/68928', 'https://superuser.com', 'https://superuser.com/users/4586/']
As others said, `du` is the way to go. But knowing the options to `du` is essential. Here they are: ``` du -m --max-depth 1 /foo /bar ``` This will give you the size in megabytes of the directories contained in `/foo` and `/bar`. If you want the output to be sorted, pipe it through the `sort` utility: ``` du -m --m...
use `du` in terminal.
68,928
Is there any command that could show me the size of several folders in linux, perhaps ranked from biggest to smallest?
2009/11/11
['https://superuser.com/questions/68928', 'https://superuser.com', 'https://superuser.com/users/4586/']
If you would like a graphical (X11) display, consider installing **`xdiskusage`**. You can either pipe the output of `du` into it (as you might do if you're running `du` as another user, or on another system, or at another time), or you can run it interactively and it will invoke `du` for itself. As usual, once it's i...
From the command line I prefer to list the biggest last so I use: ``` du -shm ./* | sort -n ```
68,928
Is there any command that could show me the size of several folders in linux, perhaps ranked from biggest to smallest?
2009/11/11
['https://superuser.com/questions/68928', 'https://superuser.com', 'https://superuser.com/users/4586/']
> > du [options] [directories and/or files] > > >
use `du` in terminal.
68,928
Is there any command that could show me the size of several folders in linux, perhaps ranked from biggest to smallest?
2009/11/11
['https://superuser.com/questions/68928', 'https://superuser.com', 'https://superuser.com/users/4586/']
Or you can pass: ``` du -sm /dir1 /dir2 | sort -nrk 1 #or du -sm * | sort -nrk 1 ``` The difference between the first and the second is that the sencond will pick all the files and dirs in the current directory and the first just the dirs you passed.
If you would like a graphical (X11) display, consider installing **`xdiskusage`**. You can either pipe the output of `du` into it (as you might do if you're running `du` as another user, or on another system, or at another time), or you can run it interactively and it will invoke `du` for itself. As usual, once it's i...
68,928
Is there any command that could show me the size of several folders in linux, perhaps ranked from biggest to smallest?
2009/11/11
['https://superuser.com/questions/68928', 'https://superuser.com', 'https://superuser.com/users/4586/']
Or you can pass: ``` du -sm /dir1 /dir2 | sort -nrk 1 #or du -sm * | sort -nrk 1 ``` The difference between the first and the second is that the sencond will pick all the files and dirs in the current directory and the first just the dirs you passed.
From the command line I prefer to list the biggest last so I use: ``` du -shm ./* | sort -n ```
68,928
Is there any command that could show me the size of several folders in linux, perhaps ranked from biggest to smallest?
2009/11/11
['https://superuser.com/questions/68928', 'https://superuser.com', 'https://superuser.com/users/4586/']
Or you can pass: ``` du -sm /dir1 /dir2 | sort -nrk 1 #or du -sm * | sort -nrk 1 ``` The difference between the first and the second is that the sencond will pick all the files and dirs in the current directory and the first just the dirs you passed.
> > du [options] [directories and/or files] > > >
68,928
Is there any command that could show me the size of several folders in linux, perhaps ranked from biggest to smallest?
2009/11/11
['https://superuser.com/questions/68928', 'https://superuser.com', 'https://superuser.com/users/4586/']
If you would like a graphical (X11) display, consider installing **`xdiskusage`**. You can either pipe the output of `du` into it (as you might do if you're running `du` as another user, or on another system, or at another time), or you can run it interactively and it will invoke `du` for itself. As usual, once it's i...
use `du` in terminal.
38,042,541
Function ``` private void startService() { if (!onForeground) { Log.d(Constants.TAG, "RecordService startService"); Intent intent = new Intent(this, MainActivity.class); // intent.setAction(Intent.ACTION_VIEW); // intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); ...
2016/06/26
['https://Stackoverflow.com/questions/38042541', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5702485/']
> > NotificationCompat.Builder **setAutoCancel (boolean autoCancel)** Setting > this flag will make it so the notification is automatically canceled > when the user clicks it in the panel. > > > You can find more about how to create a notification [here](http://www.tutorialspoint.com/android/android_notification...
Add a ID in your Notification builder, after this set notification.cancel (id);
38,042,541
Function ``` private void startService() { if (!onForeground) { Log.d(Constants.TAG, "RecordService startService"); Intent intent = new Intent(this, MainActivity.class); // intent.setAction(Intent.ACTION_VIEW); // intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); ...
2016/06/26
['https://Stackoverflow.com/questions/38042541', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5702485/']
Notifications associated with a foreground service are ongoing, i.e., not cancelable. You should provide a separate action in the notification to cancel the notification (which would have to call [stopForeground()](https://developer.android.com/reference/android/app/Service.html#stopForeground(boolean)) to remove the n...
Add a ID in your Notification builder, after this set notification.cancel (id);
23,201,713
I need to create directories from for loop. I have a list. ``` a = [banana 1234, apple 456, orange 789] ``` And I need to create folders named by the numbers that are ending with numbers in list. for example. ``` C:\folder\1234; C:\folder\456 ``` and so on. code is ``` for length in atrinkta: folder = re.fin...
2014/04/21
['https://Stackoverflow.com/questions/23201713', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3383245/']
You will receive the following error ``` undefined method `collect' for nil:NilClass ``` on ``` <%= f.select :id , @courses.collect{|c| [c.id , c.name]} %> ``` Only when `@courses` instance variable **was not set in the action that rendered this particular view.** I see that `@courses` variable is set in the `e...
If you have your courses as a database table, you might want to try using rails' built in field helper `collection_select`. It will populate your select field with all of the data available in your model. If you want a drop-down like the one you are describing, I believe using collection select is the best way to handl...
12,861
I am looking for ideas for the following. I want to design a flexible plate where I can control the bending of the plate. In particular, a 5”x2” plate will be used which can be bent with some attached mechanisms. The plate will be dragged in water so it should not buckle under water pressure itself, rather its buckling...
2016/12/15
['https://engineering.stackexchange.com/questions/12861', 'https://engineering.stackexchange.com', 'https://engineering.stackexchange.com/users/9237/']
There are some works by professor Wiciak, where vibrations or noise are controlled by piezoelements. [Development of noise reduction panel using piezoelectric material](http://www.sciencedirect.com/science/article/pii/S2212017316305503) Piezomaterials can be used for active vibration control. Maybe you could apply th...
You will want to choose a thickness of plate to resist the water flow conditions, then select an acuator with enough force to deflect the plate. Your stroke length will be set by how much deflection you need. Your actuator type will be selected based on the required accuracy and budget. Pizeo would work great since...
12,861
I am looking for ideas for the following. I want to design a flexible plate where I can control the bending of the plate. In particular, a 5”x2” plate will be used which can be bent with some attached mechanisms. The plate will be dragged in water so it should not buckle under water pressure itself, rather its buckling...
2016/12/15
['https://engineering.stackexchange.com/questions/12861', 'https://engineering.stackexchange.com', 'https://engineering.stackexchange.com/users/9237/']
There are some works by professor Wiciak, where vibrations or noise are controlled by piezoelements. [Development of noise reduction panel using piezoelectric material](http://www.sciencedirect.com/science/article/pii/S2212017316305503) Piezomaterials can be used for active vibration control. Maybe you could apply th...
Presumably you will also want a reasonably well defined curve. To create a smooth, repeatable and adjustable curve you will want to stay withinthe elastic limit of the the material you are using which will depend on the material itself and its thickness. Steel or a composite sheet would seem like reasonable candidate...
26,009,316
I am trying to use dynamic memory for this project. I am getting a seg fault but I cannot figure out what I am doing incorrectly. Can anyone point to where my mistake is? The file seems to read in correctly...but im assuming the fault is a rogue pointer..help! I am just trying to read in "heart two 2" to "spade ace 11...
2014/09/24
['https://Stackoverflow.com/questions/26009316', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4073150/']
This is a really ancient way to program. Instead of using `new`, use `std::string` or `std::vector<char>`. Those also use dynamic memory but they make it much harder for you to accidentally cause memory allocation bugs. The first problem comes here: ``` cin >> *finNameP; ``` Since `finNameP` has type `char *`, the...
`deckPtr < &deckPtr[maxCards]` is always true, the for loop runs forever.
126,666
I cannot understand a situation with `MeijerG` function. My problem is as follows. I obtained a `MeijerG` function as the result of a Fourier transform: ``` Integrate[ Integrate[ Exp[I*k*r*Cos[Ο†]]/(k^4 + 1)*k, {Ο†, 0, 2 Ο€}, Assumptions -> {k > 0, r > 0}], {k, 0, ∞}, Assumptions -> {r > 0...
2016/09/19
['https://mathematica.stackexchange.com/questions/126666', 'https://mathematica.stackexchange.com', 'https://mathematica.stackexchange.com/users/788/']
The standard way to express `MeijerG` in terms of more specific special functions is with `FunctionExpand`. For example ``` MeijerG[{{1}, {}}, {{1/2, 1, 3/2}, {}}, z] ``` > > > ``` > MeijerG[{{1}, {}}, {{1/2, 1, 3/2}, {}}, z] > > ``` > > ``` FunctionExpand[%] ``` > > > ``` > -2 Ο€ z - Ο€^2 z BesselY[1, 2 Sqr...
To evaluate at `r = 0`, take the `Limit` of the `Series` expansion ``` int = Assuming[{r > 0}, Integrate[ Exp[I*k*r*Cos[Ο†]]/(k^4 + 1)*k, {k, 0, ∞}, {Ο†, 0, 2 Ο€}]] (* (1/2)*Pi*MeijerG[{{}, {}}, {{0, 1/2, 1/2}, {0}}, r^4/256] *) approx = Series[int, {r, 0, 1}] // Normal // FullSimplify[#, r > 0] & (* (Pi*...
126,666
I cannot understand a situation with `MeijerG` function. My problem is as follows. I obtained a `MeijerG` function as the result of a Fourier transform: ``` Integrate[ Integrate[ Exp[I*k*r*Cos[Ο†]]/(k^4 + 1)*k, {Ο†, 0, 2 Ο€}, Assumptions -> {k > 0, r > 0}], {k, 0, ∞}, Assumptions -> {r > 0...
2016/09/19
['https://mathematica.stackexchange.com/questions/126666', 'https://mathematica.stackexchange.com', 'https://mathematica.stackexchange.com/users/788/']
The standard way to express `MeijerG` in terms of more specific special functions is with `FunctionExpand`. For example ``` MeijerG[{{1}, {}}, {{1/2, 1, 3/2}, {}}, z] ``` > > > ``` > MeijerG[{{1}, {}}, {{1/2, 1, 3/2}, {}}, z] > > ``` > > ``` FunctionExpand[%] ``` > > > ``` > -2 Ο€ z - Ο€^2 z BesselY[1, 2 Sqr...
In addition to Chip's nice answer, another way would be to do a "round trip" using the Mellin transform and its inverse: ``` InverseMellinTransform[ MellinTransform[Ο€/2 MeijerG[{{}, {}}, {{0, 1/2, 1/2}, {0}}, r^4/256], r, t], t, r] -2 Ο€ KelvinKei[0, r] ``` --- **Bonus:** the original integral can in fact ...
69,674,741
How do you completely delete an object via the Amazon S3 Console? "Completely delete" meaning the object is entirely gone and isn't visible when enabling "Show versions." I cannot delete the "Show versions" objects themselves as the button is greyed out when they're selected. I've also tried deleting them via CLI but h...
2021/10/22
['https://Stackoverflow.com/questions/69674741', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4471173/']
If you have versioning enabled, deleting an object just adds another version of the object, the so called "delete marker". If you want to remove all versions, including the delete marker, you'll need to enumerate and delete all versions of the object. For instance, with the Python SDK, you can enumerate and delete them...
Looks like your IAM User accessing the bucket does not have s3:DeleteObjectVersion permission. Once you add this permission to your policy, you should be able to delete the versions as well.
11,334,089
My CouchApp has the following folder structur, where files inside the app folder are compiled into the `_attachments` folder: ``` my_couchapp β”œβ”€β”€ _attachments/ β”‚ β”œβ”€β”€ app.js β”‚ β”œβ”€β”€ app-tests.js β”‚ └── index.html β”œβ”€β”€ app/ β”‚ └── app.js β”œβ”€β”€ Assetfile └── views/ ``` I want to exclude the file `Assetfile`, `_attachm...
2012/07/04
['https://Stackoverflow.com/questions/11334089', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/65542/']
After a little more experimentation I found a way: the `app` folder can be excluded by specifying `app$`, so the final `.couchappignore` now looks like this: ``` [ "app$", "Assetfile", "app-tests.js" ] ```
In case you arrived here looking for a way to ignore subfolders, you are just like me. Here's my problem: ``` my-couchapp/ β”œβ”€β”€ node_modules/ β”‚ β”œβ”€β”€ react.js β”‚ β”œβ”€β”€ url/ β”‚ β”œβ”€β”€ browserify/ β”‚ └── coffee-script/ β”œβ”€β”€ app/ β”‚ └── app.js └── views/ ``` I wanted to include `node_modules/react.js` and `node_modules/ur...
60,710,171
I have created one service called **fleetman-webapp**: ``` apiVersion: v1 kind: Service metadata: name: fleetman-webapp spec: selector: app: webapp ports: - name: http port: 80 nodePort: 30080 type: NodePort ``` also, a pod named **webapp**: ``` apiVersion: v1 kind: Pod metadata: name: webapp l...
2020/03/16
['https://Stackoverflow.com/questions/60710171', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8384029/']
Even though, you are exposing port 30080 via NodePort in minikube, minikube will still not expose it because it will use its own external port to listen to this service. Minikube tunnels the service to expose to the outer world. To find out that exposed port: ``` minikube service $SERVICE_NAME ``` so, in your case ...
There are a lot of different hypervisors which can work with `minikube`. Choosing one will be highly dependent on variables like operating system. Some of them are: * Virtualbox * Hyper-V * VMware Fusion * KVM2 * Hyperkit * "Docker (`--vm-driver=none`)" (see the quotes) There is official documentation talking about ...
60,710,171
I have created one service called **fleetman-webapp**: ``` apiVersion: v1 kind: Service metadata: name: fleetman-webapp spec: selector: app: webapp ports: - name: http port: 80 nodePort: 30080 type: NodePort ``` also, a pod named **webapp**: ``` apiVersion: v1 kind: Pod metadata: name: webapp l...
2020/03/16
['https://Stackoverflow.com/questions/60710171', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8384029/']
There are a lot of different hypervisors which can work with `minikube`. Choosing one will be highly dependent on variables like operating system. Some of them are: * Virtualbox * Hyper-V * VMware Fusion * KVM2 * Hyperkit * "Docker (`--vm-driver=none`)" (see the quotes) There is official documentation talking about ...
For this specific (and really great) course about [Kubernetes on Udemy from Richard Chesterwood](https://www.udemy.com/course/kubernetes-microservices/) the following solution should work out of the box on Windows: just start the `minikube` with `hyper-v` driver, then it will automatically map all the ports you are exp...
60,710,171
I have created one service called **fleetman-webapp**: ``` apiVersion: v1 kind: Service metadata: name: fleetman-webapp spec: selector: app: webapp ports: - name: http port: 80 nodePort: 30080 type: NodePort ``` also, a pod named **webapp**: ``` apiVersion: v1 kind: Pod metadata: name: webapp l...
2020/03/16
['https://Stackoverflow.com/questions/60710171', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8384029/']
There are a lot of different hypervisors which can work with `minikube`. Choosing one will be highly dependent on variables like operating system. Some of them are: * Virtualbox * Hyper-V * VMware Fusion * KVM2 * Hyperkit * "Docker (`--vm-driver=none`)" (see the quotes) There is official documentation talking about ...
I have had the same issue and have been trying to solve that for the last 2 days I have tried to install ingress addon: ```sh minikube addons enable ingress ``` and also tried to run : ```sh minikube tunnel ``` looked for a way to allow the host machine to access the container IP address but apparently couldn't f...
60,710,171
I have created one service called **fleetman-webapp**: ``` apiVersion: v1 kind: Service metadata: name: fleetman-webapp spec: selector: app: webapp ports: - name: http port: 80 nodePort: 30080 type: NodePort ``` also, a pod named **webapp**: ``` apiVersion: v1 kind: Pod metadata: name: webapp l...
2020/03/16
['https://Stackoverflow.com/questions/60710171', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8384029/']
There are a lot of different hypervisors which can work with `minikube`. Choosing one will be highly dependent on variables like operating system. Some of them are: * Virtualbox * Hyper-V * VMware Fusion * KVM2 * Hyperkit * "Docker (`--vm-driver=none`)" (see the quotes) There is official documentation talking about ...
If you are running minikube in a Windows, then minikube must run as an Administrator command prompt window.
60,710,171
I have created one service called **fleetman-webapp**: ``` apiVersion: v1 kind: Service metadata: name: fleetman-webapp spec: selector: app: webapp ports: - name: http port: 80 nodePort: 30080 type: NodePort ``` also, a pod named **webapp**: ``` apiVersion: v1 kind: Pod metadata: name: webapp l...
2020/03/16
['https://Stackoverflow.com/questions/60710171', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8384029/']
Even though, you are exposing port 30080 via NodePort in minikube, minikube will still not expose it because it will use its own external port to listen to this service. Minikube tunnels the service to expose to the outer world. To find out that exposed port: ``` minikube service $SERVICE_NAME ``` so, in your case ...
For this specific (and really great) course about [Kubernetes on Udemy from Richard Chesterwood](https://www.udemy.com/course/kubernetes-microservices/) the following solution should work out of the box on Windows: just start the `minikube` with `hyper-v` driver, then it will automatically map all the ports you are exp...
60,710,171
I have created one service called **fleetman-webapp**: ``` apiVersion: v1 kind: Service metadata: name: fleetman-webapp spec: selector: app: webapp ports: - name: http port: 80 nodePort: 30080 type: NodePort ``` also, a pod named **webapp**: ``` apiVersion: v1 kind: Pod metadata: name: webapp l...
2020/03/16
['https://Stackoverflow.com/questions/60710171', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8384029/']
Even though, you are exposing port 30080 via NodePort in minikube, minikube will still not expose it because it will use its own external port to listen to this service. Minikube tunnels the service to expose to the outer world. To find out that exposed port: ``` minikube service $SERVICE_NAME ``` so, in your case ...
I have had the same issue and have been trying to solve that for the last 2 days I have tried to install ingress addon: ```sh minikube addons enable ingress ``` and also tried to run : ```sh minikube tunnel ``` looked for a way to allow the host machine to access the container IP address but apparently couldn't f...
60,710,171
I have created one service called **fleetman-webapp**: ``` apiVersion: v1 kind: Service metadata: name: fleetman-webapp spec: selector: app: webapp ports: - name: http port: 80 nodePort: 30080 type: NodePort ``` also, a pod named **webapp**: ``` apiVersion: v1 kind: Pod metadata: name: webapp l...
2020/03/16
['https://Stackoverflow.com/questions/60710171', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8384029/']
Even though, you are exposing port 30080 via NodePort in minikube, minikube will still not expose it because it will use its own external port to listen to this service. Minikube tunnels the service to expose to the outer world. To find out that exposed port: ``` minikube service $SERVICE_NAME ``` so, in your case ...
If you are running minikube in a Windows, then minikube must run as an Administrator command prompt window.
60,710,171
I have created one service called **fleetman-webapp**: ``` apiVersion: v1 kind: Service metadata: name: fleetman-webapp spec: selector: app: webapp ports: - name: http port: 80 nodePort: 30080 type: NodePort ``` also, a pod named **webapp**: ``` apiVersion: v1 kind: Pod metadata: name: webapp l...
2020/03/16
['https://Stackoverflow.com/questions/60710171', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8384029/']
For this specific (and really great) course about [Kubernetes on Udemy from Richard Chesterwood](https://www.udemy.com/course/kubernetes-microservices/) the following solution should work out of the box on Windows: just start the `minikube` with `hyper-v` driver, then it will automatically map all the ports you are exp...
If you are running minikube in a Windows, then minikube must run as an Administrator command prompt window.
60,710,171
I have created one service called **fleetman-webapp**: ``` apiVersion: v1 kind: Service metadata: name: fleetman-webapp spec: selector: app: webapp ports: - name: http port: 80 nodePort: 30080 type: NodePort ``` also, a pod named **webapp**: ``` apiVersion: v1 kind: Pod metadata: name: webapp l...
2020/03/16
['https://Stackoverflow.com/questions/60710171', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8384029/']
I have had the same issue and have been trying to solve that for the last 2 days I have tried to install ingress addon: ```sh minikube addons enable ingress ``` and also tried to run : ```sh minikube tunnel ``` looked for a way to allow the host machine to access the container IP address but apparently couldn't f...
If you are running minikube in a Windows, then minikube must run as an Administrator command prompt window.
8,737,854
I have a string in php formatted like this: ``` http://aaaaaaaaaa/*http://bbbbbbbbbbbbbbb ``` where aaa... and bbb.... represent random characters and are random in length. I would like to parse the string so that I am left with this: ``` http://bbbbbbbbbbbbbbb ```
2012/01/05
['https://Stackoverflow.com/questions/8737854', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/657818/']
In this case I wouldn't recommend regex but a simple substring or explode ``` $data = "http://aaaaaaaaaa/*http://bbbbbbbbbbb" $parts = explode('*', $data); echo $parts[1]; ``` fin :)
You don't need regular expressions at all in this case: ``` $str = 'http://aaaaaaaaaa/*http://bbbbbbbbbbbbbbb'; echo substr($str, strpos($str, 'http://', 1)); ```
8,737,854
I have a string in php formatted like this: ``` http://aaaaaaaaaa/*http://bbbbbbbbbbbbbbb ``` where aaa... and bbb.... represent random characters and are random in length. I would like to parse the string so that I am left with this: ``` http://bbbbbbbbbbbbbbb ```
2012/01/05
['https://Stackoverflow.com/questions/8737854', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/657818/']
You don't need regular expressions at all in this case: ``` $str = 'http://aaaaaaaaaa/*http://bbbbbbbbbbbbbbb'; echo substr($str, strpos($str, 'http://', 1)); ```
Here is a clean solution: grab everything after the last occurrence of "http://". ``` $start = strrpos($input, 'http://'); $output = substr($input, $start); ```
8,737,854
I have a string in php formatted like this: ``` http://aaaaaaaaaa/*http://bbbbbbbbbbbbbbb ``` where aaa... and bbb.... represent random characters and are random in length. I would like to parse the string so that I am left with this: ``` http://bbbbbbbbbbbbbbb ```
2012/01/05
['https://Stackoverflow.com/questions/8737854', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/657818/']
In this case I wouldn't recommend regex but a simple substring or explode ``` $data = "http://aaaaaaaaaa/*http://bbbbbbbbbbb" $parts = explode('*', $data); echo $parts[1]; ``` fin :)
Here is the regular expression way: ``` $str = 'http://aaaaaaaaaa/*http://bbbbbbbbbbbbbbb'; $url = preg_replace("/^.*(http:\/\/.*[^(http:\/\/)+])$/", "$1", $str); echo $url; ```
8,737,854
I have a string in php formatted like this: ``` http://aaaaaaaaaa/*http://bbbbbbbbbbbbbbb ``` where aaa... and bbb.... represent random characters and are random in length. I would like to parse the string so that I am left with this: ``` http://bbbbbbbbbbbbbbb ```
2012/01/05
['https://Stackoverflow.com/questions/8737854', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/657818/']
In this case I wouldn't recommend regex but a simple substring or explode ``` $data = "http://aaaaaaaaaa/*http://bbbbbbbbbbb" $parts = explode('*', $data); echo $parts[1]; ``` fin :)
Hi This would help you to get the address: ``` $str = 'http://www.example.com/*http://www.another.org/'; $pattern = '/^http:\/\/[\.\w\-]+\/\*(http:\/\/.+)$/'; //$result = preg_replace($pattern, '$1', $str); $found = preg_match_all($pattern, $str, $result); $url = (!$found==0) ? $result[1][0] : ''; echo $str . '<br />'...
8,737,854
I have a string in php formatted like this: ``` http://aaaaaaaaaa/*http://bbbbbbbbbbbbbbb ``` where aaa... and bbb.... represent random characters and are random in length. I would like to parse the string so that I am left with this: ``` http://bbbbbbbbbbbbbbb ```
2012/01/05
['https://Stackoverflow.com/questions/8737854', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/657818/']
In this case I wouldn't recommend regex but a simple substring or explode ``` $data = "http://aaaaaaaaaa/*http://bbbbbbbbbbb" $parts = explode('*', $data); echo $parts[1]; ``` fin :)
Here is a clean solution: grab everything after the last occurrence of "http://". ``` $start = strrpos($input, 'http://'); $output = substr($input, $start); ```
8,737,854
I have a string in php formatted like this: ``` http://aaaaaaaaaa/*http://bbbbbbbbbbbbbbb ``` where aaa... and bbb.... represent random characters and are random in length. I would like to parse the string so that I am left with this: ``` http://bbbbbbbbbbbbbbb ```
2012/01/05
['https://Stackoverflow.com/questions/8737854', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/657818/']
Here is the regular expression way: ``` $str = 'http://aaaaaaaaaa/*http://bbbbbbbbbbbbbbb'; $url = preg_replace("/^.*(http:\/\/.*[^(http:\/\/)+])$/", "$1", $str); echo $url; ```
Here is a clean solution: grab everything after the last occurrence of "http://". ``` $start = strrpos($input, 'http://'); $output = substr($input, $start); ```