qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
55,543,146
I recently encountered with an interview question. I did not understand the behaviour of `printf` function in this case ``` #include <stdio.h> int main() { int k = printf("String"); printf("%d",k); } ``` Expected result : Compilation Error Output : `String6` Why is the output `String6`?
2019/04/05
[ "https://Stackoverflow.com/questions/55543146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9929477/" ]
Here is the prototype for `printf`: ``` int printf(const char *format, ...); ``` We can see that `printf` returns an `int`. The [documentation](http://man7.org/linux/man-pages/man3/printf.3.html) indicates that: > > Upon successful return, these functions return the number of > characters printed (excluding the ...
the `printf()` function returns the number of character it printed. Since you set `int k = printf("String");`, the print function is executing printing out "String" and setting `k` equal to 6 since "String" is 6 characters long, then your second call to `printf` prints the value of `k` which is 6, resulting in the cons...
55,175,445
When I try to import SVG Image then the following error shows. Which loader I have to use for importing SVG images? ``` ./static/Rolling-1s-200px.svg 1:0 Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type. > <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 ...
2019/03/15
[ "https://Stackoverflow.com/questions/55175445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7580927/" ]
This worked for me without any other dependency ``` // In next.config.js module.exports = { webpack (config, options) { config.module.rules.push({ test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/, use: { loader: 'url-loader', options: { ...
If you want to use SVG files in your code **WITHOUT ANY CONFIG OR INSTALLING A DEPENDENCY** and have **complete control** on the tag's attributes, the best solution is to convert the SVG file to JSX or TSX components. **JSX solution:** ``` export const YourSVg = ({color, width, height}) => ( <svg fill={color} heig...
55,175,445
When I try to import SVG Image then the following error shows. Which loader I have to use for importing SVG images? ``` ./static/Rolling-1s-200px.svg 1:0 Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type. > <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 ...
2019/03/15
[ "https://Stackoverflow.com/questions/55175445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7580927/" ]
You can use [babel-plugin-inline-react-svg](https://github.com/airbnb/babel-plugin-inline-react-svg) ``` import React from 'react'; import CloseSVG from './close.svg'; const MyComponent = () => <CloseSVG />; ``` ``` npm install --save-dev babel-plugin-inline-react-svg ``` ``` // .babelrc { "plugins": [ "inl...
[How to import SVG into Next.js component?](https://stackoverflow.com/questions/56276103/how-to-import-svg-into-next-js-component) Another solution without install any library ``` import React from "react"; export default function GoogleLogo() { return ( <svg className="svgIcon-use" width="25" height="37" viewB...
55,175,445
When I try to import SVG Image then the following error shows. Which loader I have to use for importing SVG images? ``` ./static/Rolling-1s-200px.svg 1:0 Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type. > <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 ...
2019/03/15
[ "https://Stackoverflow.com/questions/55175445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7580927/" ]
With `Next.js 12.0.9` and `Webpack 5` this works for me: ```bs yarn add --dev url-loader @svgr/webpack ``` ``` // next.config.js module.exports = { webpack(config, options) { config.module.rules.push({ test: /\.svg$/, use: ['@svgr/webpack', 'url-loader'], }); return c...
I tried the first answer, but I got an error, so this works: ``` module.exports = { webpack(config) { config.module.rules.push({ test: /\.svg$/, use: ["@svgr/webpack"] }); return config; }}; ```
55,175,445
When I try to import SVG Image then the following error shows. Which loader I have to use for importing SVG images? ``` ./static/Rolling-1s-200px.svg 1:0 Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type. > <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 ...
2019/03/15
[ "https://Stackoverflow.com/questions/55175445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7580927/" ]
You need to provide a webpack loader that will handle SVG imports, one of the famous one is [svgr](https://github.com/smooth-code/svgr). In order to configure it to work with next, you need to add to your `next.config.js` file the usage of the loader, like that: ```js // next.config.js module.exports = { webpack(c...
You can use [babel-plugin-inline-react-svg](https://github.com/airbnb/babel-plugin-inline-react-svg) ``` import React from 'react'; import CloseSVG from './close.svg'; const MyComponent = () => <CloseSVG />; ``` ``` npm install --save-dev babel-plugin-inline-react-svg ``` ``` // .babelrc { "plugins": [ "inl...
55,175,445
When I try to import SVG Image then the following error shows. Which loader I have to use for importing SVG images? ``` ./static/Rolling-1s-200px.svg 1:0 Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type. > <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 ...
2019/03/15
[ "https://Stackoverflow.com/questions/55175445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7580927/" ]
[How to import SVG into Next.js component?](https://stackoverflow.com/questions/56276103/how-to-import-svg-into-next-js-component) Another solution without install any library ``` import React from "react"; export default function GoogleLogo() { return ( <svg className="svgIcon-use" width="25" height="37" viewB...
I tried the first answer, but I got an error, so this works: ``` module.exports = { webpack(config) { config.module.rules.push({ test: /\.svg$/, use: ["@svgr/webpack"] }); return config; }}; ```
55,175,445
When I try to import SVG Image then the following error shows. Which loader I have to use for importing SVG images? ``` ./static/Rolling-1s-200px.svg 1:0 Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type. > <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 ...
2019/03/15
[ "https://Stackoverflow.com/questions/55175445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7580927/" ]
The quick way: `<img>` or `<Image>` ----------------------------------- [**Not suitable for interactive SVGs or if you intend to manipulate a SVG by external CSS/JS**](https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Adding_vector_graphics_to_the_Web#the_quick_way_img_element) One can use ...
You can use [babel-plugin-inline-react-svg](https://github.com/airbnb/babel-plugin-inline-react-svg) ``` import React from 'react'; import CloseSVG from './close.svg'; const MyComponent = () => <CloseSVG />; ``` ``` npm install --save-dev babel-plugin-inline-react-svg ``` ``` // .babelrc { "plugins": [ "inl...
55,175,445
When I try to import SVG Image then the following error shows. Which loader I have to use for importing SVG images? ``` ./static/Rolling-1s-200px.svg 1:0 Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type. > <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 ...
2019/03/15
[ "https://Stackoverflow.com/questions/55175445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7580927/" ]
You can use [babel-plugin-inline-react-svg](https://github.com/airbnb/babel-plugin-inline-react-svg) ``` import React from 'react'; import CloseSVG from './close.svg'; const MyComponent = () => <CloseSVG />; ``` ``` npm install --save-dev babel-plugin-inline-react-svg ``` ``` // .babelrc { "plugins": [ "inl...
With `Next.js 12.0.9` and `Webpack 5` this works for me: ```bs yarn add --dev url-loader @svgr/webpack ``` ``` // next.config.js module.exports = { webpack(config, options) { config.module.rules.push({ test: /\.svg$/, use: ['@svgr/webpack', 'url-loader'], }); return c...
55,175,445
When I try to import SVG Image then the following error shows. Which loader I have to use for importing SVG images? ``` ./static/Rolling-1s-200px.svg 1:0 Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type. > <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 ...
2019/03/15
[ "https://Stackoverflow.com/questions/55175445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7580927/" ]
You can simply import it via `<img>` tag. ``` <img src='./next.svg' alt='next' /> ``` Just make sure that the svg is in public folder.
I tried the first answer, but I got an error, so this works: ``` module.exports = { webpack(config) { config.module.rules.push({ test: /\.svg$/, use: ["@svgr/webpack"] }); return config; }}; ```
55,175,445
When I try to import SVG Image then the following error shows. Which loader I have to use for importing SVG images? ``` ./static/Rolling-1s-200px.svg 1:0 Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type. > <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 ...
2019/03/15
[ "https://Stackoverflow.com/questions/55175445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7580927/" ]
The quick way: `<img>` or `<Image>` ----------------------------------- [**Not suitable for interactive SVGs or if you intend to manipulate a SVG by external CSS/JS**](https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Adding_vector_graphics_to_the_Web#the_quick_way_img_element) One can use ...
This worked for me without any other dependency ``` // In next.config.js module.exports = { webpack (config, options) { config.module.rules.push({ test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/, use: { loader: 'url-loader', options: { ...
55,175,445
When I try to import SVG Image then the following error shows. Which loader I have to use for importing SVG images? ``` ./static/Rolling-1s-200px.svg 1:0 Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type. > <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 ...
2019/03/15
[ "https://Stackoverflow.com/questions/55175445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7580927/" ]
I personally prefer [next-react-svg](https://github.com/jeremybarbet/next-react-svg) plugin which allows to treat SVG images as React components and automatically inline them, similar to what Create React App does. Here is how to use it: 1. Install `next-react-svg`: ``` npm i next-react-svg ``` 2. Add necessary se...
With `Next.js 12.0.9` and `Webpack 5` this works for me: ```bs yarn add --dev url-loader @svgr/webpack ``` ``` // next.config.js module.exports = { webpack(config, options) { config.module.rules.push({ test: /\.svg$/, use: ['@svgr/webpack', 'url-loader'], }); return c...
56,307,643
This is code and below is the IP address of the device please help me out i tried this many times but i dont know why it is sending me bank page it is not getting any data on this site atd.softghor.com it is working but when i use the code on my site it does not load any data i have used few lines of code becasue stack...
2019/05/25
[ "https://Stackoverflow.com/questions/56307643", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8428564/" ]
I also have the same problem, try this: ``` $zk = new ZKLibrary('X.X.X.X', 4370); $zk->connect(); $zk->disableDevice(); $users = $zk->getUser(); print_r($users); $zk->enableDevice(); $zk->disconnect(); ``` This will connect and print in array all the users. $zk->connect, is the way you connect (method), you wont hav...
You should change the version of PHP because the library just support PHP 7.4 or lower, and you have to uncomment the socket in the php.ini
13,352
I bought a VR device that can hold your phone to give a VR experience, however I only discovered after I got home that I have no way of controlling anything while my phone is inside the VR device. I downloaded the google cardboard app thinking it might hold a solution but I can't even make a menu selection without ope...
2016/06/18
[ "https://lifehacks.stackexchange.com/questions/13352", "https://lifehacks.stackexchange.com", "https://lifehacks.stackexchange.com/users/15504/" ]
Some of the apps have a gaze setting. So instead of pressing a button you can simply stare at the button you want to "click" and after a while it will select it if you stare at it long enough. That is the closest you will get to control on a buttonless VR device.
Without an integrated controller, your best bet is an external one, such as a bluetooth controller. These are readily available online for relatively cheap: For [example](https://www.amazon.co.uk/Virtoba-Control-Bluetooth-Controller-Serviceable/dp/B01CRXJBCU). I know that the Samsung VR headset comes with an integrate...
13,352
I bought a VR device that can hold your phone to give a VR experience, however I only discovered after I got home that I have no way of controlling anything while my phone is inside the VR device. I downloaded the google cardboard app thinking it might hold a solution but I can't even make a menu selection without ope...
2016/06/18
[ "https://lifehacks.stackexchange.com/questions/13352", "https://lifehacks.stackexchange.com", "https://lifehacks.stackexchange.com/users/15504/" ]
There are some tricks online of using copper tape or aluminum foil to "extend" the capacity touch to outside the VR case. Examples: <https://www.youtube.com/watch?v=7Na7HsX_N-o> <http://www.instructables.com/id/Copper-tape-touch-extension-for-Cardboard-VR-kits/>
Without an integrated controller, your best bet is an external one, such as a bluetooth controller. These are readily available online for relatively cheap: For [example](https://www.amazon.co.uk/Virtoba-Control-Bluetooth-Controller-Serviceable/dp/B01CRXJBCU). I know that the Samsung VR headset comes with an integrate...
13,352
I bought a VR device that can hold your phone to give a VR experience, however I only discovered after I got home that I have no way of controlling anything while my phone is inside the VR device. I downloaded the google cardboard app thinking it might hold a solution but I can't even make a menu selection without ope...
2016/06/18
[ "https://lifehacks.stackexchange.com/questions/13352", "https://lifehacks.stackexchange.com", "https://lifehacks.stackexchange.com/users/15504/" ]
My dad bought VR glasses which had the same problem. He said that Google cardboard has a magnet control. So we tested by swiping a magnet on the outside of the glass and we found the working spot. Stare at an option and just swipe the magnet on the spot.
Without an integrated controller, your best bet is an external one, such as a bluetooth controller. These are readily available online for relatively cheap: For [example](https://www.amazon.co.uk/Virtoba-Control-Bluetooth-Controller-Serviceable/dp/B01CRXJBCU). I know that the Samsung VR headset comes with an integrate...
13,352
I bought a VR device that can hold your phone to give a VR experience, however I only discovered after I got home that I have no way of controlling anything while my phone is inside the VR device. I downloaded the google cardboard app thinking it might hold a solution but I can't even make a menu selection without ope...
2016/06/18
[ "https://lifehacks.stackexchange.com/questions/13352", "https://lifehacks.stackexchange.com", "https://lifehacks.stackexchange.com/users/15504/" ]
Some of the apps have a gaze setting. So instead of pressing a button you can simply stare at the button you want to "click" and after a while it will select it if you stare at it long enough. That is the closest you will get to control on a buttonless VR device.
Try the Fulldive VR app, it's available for iOS and Android With it you can browse photos, videos, also there is a browser for internet, so you can browse internet in your VR glasses. I had an idea to use AirDroid through the Fulldive's browser, so you can control your phone, write SMS from inside VR glasses but I d...
13,352
I bought a VR device that can hold your phone to give a VR experience, however I only discovered after I got home that I have no way of controlling anything while my phone is inside the VR device. I downloaded the google cardboard app thinking it might hold a solution but I can't even make a menu selection without ope...
2016/06/18
[ "https://lifehacks.stackexchange.com/questions/13352", "https://lifehacks.stackexchange.com", "https://lifehacks.stackexchange.com/users/15504/" ]
There are some tricks online of using copper tape or aluminum foil to "extend" the capacity touch to outside the VR case. Examples: <https://www.youtube.com/watch?v=7Na7HsX_N-o> <http://www.instructables.com/id/Copper-tape-touch-extension-for-Cardboard-VR-kits/>
Try the Fulldive VR app, it's available for iOS and Android With it you can browse photos, videos, also there is a browser for internet, so you can browse internet in your VR glasses. I had an idea to use AirDroid through the Fulldive's browser, so you can control your phone, write SMS from inside VR glasses but I d...
13,352
I bought a VR device that can hold your phone to give a VR experience, however I only discovered after I got home that I have no way of controlling anything while my phone is inside the VR device. I downloaded the google cardboard app thinking it might hold a solution but I can't even make a menu selection without ope...
2016/06/18
[ "https://lifehacks.stackexchange.com/questions/13352", "https://lifehacks.stackexchange.com", "https://lifehacks.stackexchange.com/users/15504/" ]
My dad bought VR glasses which had the same problem. He said that Google cardboard has a magnet control. So we tested by swiping a magnet on the outside of the glass and we found the working spot. Stare at an option and just swipe the magnet on the spot.
Try the Fulldive VR app, it's available for iOS and Android With it you can browse photos, videos, also there is a browser for internet, so you can browse internet in your VR glasses. I had an idea to use AirDroid through the Fulldive's browser, so you can control your phone, write SMS from inside VR glasses but I d...
13,352
I bought a VR device that can hold your phone to give a VR experience, however I only discovered after I got home that I have no way of controlling anything while my phone is inside the VR device. I downloaded the google cardboard app thinking it might hold a solution but I can't even make a menu selection without ope...
2016/06/18
[ "https://lifehacks.stackexchange.com/questions/13352", "https://lifehacks.stackexchange.com", "https://lifehacks.stackexchange.com/users/15504/" ]
Some of the apps have a gaze setting. So instead of pressing a button you can simply stare at the button you want to "click" and after a while it will select it if you stare at it long enough. That is the closest you will get to control on a buttonless VR device.
My dad bought VR glasses which had the same problem. He said that Google cardboard has a magnet control. So we tested by swiping a magnet on the outside of the glass and we found the working spot. Stare at an option and just swipe the magnet on the spot.
13,352
I bought a VR device that can hold your phone to give a VR experience, however I only discovered after I got home that I have no way of controlling anything while my phone is inside the VR device. I downloaded the google cardboard app thinking it might hold a solution but I can't even make a menu selection without ope...
2016/06/18
[ "https://lifehacks.stackexchange.com/questions/13352", "https://lifehacks.stackexchange.com", "https://lifehacks.stackexchange.com/users/15504/" ]
There are some tricks online of using copper tape or aluminum foil to "extend" the capacity touch to outside the VR case. Examples: <https://www.youtube.com/watch?v=7Na7HsX_N-o> <http://www.instructables.com/id/Copper-tape-touch-extension-for-Cardboard-VR-kits/>
My dad bought VR glasses which had the same problem. He said that Google cardboard has a magnet control. So we tested by swiping a magnet on the outside of the glass and we found the working spot. Stare at an option and just swipe the magnet on the spot.
36,699,910
I was implementing a multi dimensional array and using pointers and testing the correctness of the address allotment.Even though the program ran perfectly and all the addresses were same as i expected.But there was a compilation warning `[Warning] excess elements in array initializer`.Can anyone explain about the warni...
2016/04/18
[ "https://Stackoverflow.com/questions/36699910", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5908241/" ]
You have three pairs of a pair of `int`s. The initialization should be: ``` int c[3][2][2] = {{{2,5},{7,9}},{{3,4},{6,1}},{{0,8},{11,13}}}; 3 ^ ^ ^ 2 ^ ^ 2 ^ ^ ```
That is not a three dimensional array. You forgot a brace! ``` int c[3][2][2] = {{{2,5},{7,9}},{{3,4},{6,1}},{{0,8},{11,13}}}; ``` Perhaps reformat things to make it clearer: ``` int c[3][2][2] = { { {2,5}, {7,9} }, { {3,4}, {6,1} }, { {0,8}, {11,13} } }; ```
283,292
We found some interesting insights in differential equations of the form $y^{(n)}(x)+F\_\lambda(y(x),y'(x),...,y^{(n-1)}(x))=0$, i.e. for ordinary differential equations of $n$-th order with $n\geq2$. The function $F$ is polynomial which can include a set of parameters $\lambda$. We know, that in physics usually the...
2016/09/30
[ "https://physics.stackexchange.com/questions/283292", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/131690/" ]
That's just not true. If a linear system has $n$ independent ways in which energy can be stored as states, and energy can flow between these states, then you can model the system with an nth order polynomial. Granted some systems can be approximated by a linear 2nd order rational polynomial function, but a closer look...
The Dirac equation, which is a system of four first-order equations for four components of the Dirac spinor, is generally equivalent to one fourth-order equation for one component of the spinor (<http://akhmeteli.org/wp-content/uploads/2011/08/JMAPAQ528082303_1.pdf> , published in the Journal of Mathematical Physics, <...
48,823,602
I have method that resolves a promise that retrieves some Products ``` global.getProducts().then(function (prodPromised) { ``` For each prodPromised I have a Category ID but I also want the Category Name. So, I create an array of promises in which I assing the Category Name to each Product. ``` var products = []; ...
2018/02/16
[ "https://Stackoverflow.com/questions/48823602", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4912621/" ]
You can either create a variable that you assign the promises to. Keep in mind that you have to continue with async code! ``` let products = null; global .getProducts() .then(function (prodPromised) { products = prodPromised; }) ``` This wont work: ``` let products = null; global .getProduct...
If createCatName is a synchronous function you can do the following ``` const products = global.getProducts().then( products=> products.map(self.createCatName) ); ``` If createCatName is an asynchronous function you do do this ``` const products = global.getProducts().then( products=> Promise.all( ...
41,600,570
I'm using the Parse SDK as my backend and I have also implemented the Facebook login, which works perfectly!! The thing is, when the user presses the FB login button and he's prompted to choose how to login, either type his credentials or use the fb app, if he chooses the latter, nothing happens! Does anyone know how ...
2017/01/11
[ "https://Stackoverflow.com/questions/41600570", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4388495/" ]
You can not login with Facebook Native App. But you can change the `loginBehavior` to `systemAccount`. If the user registered their Facebook Information to their iPhone. `ParseFBSDK` can reach them. You should add this line after your ParseFacebookUtils initialization ``` PFFacebookUtils.facebookLoginManager().loginB...
All I had to do was to update the Facebook login SDK and put the items below, on my .plist file's `LSApplicationQueriesSchemes`: ``` <array> <string>fbapi</string> <string>fb-messenger-share-api</string> <string>fbauth2</string> <string>fbshareextension</string> </array> ```
63,150,696
I'm using Perfex CRM which is developed by using CodeIgniter framework. I'm having an issue that the IDs of the are records not consecutive even after I delete the older records. Like the below image. Any idea what topic I should be looking for to fix this issue? [ID Issue](https://i.stack.imgur.com/ylob0.png)
2020/07/29
[ "https://Stackoverflow.com/questions/63150696", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12545885/" ]
Okay, I just spent a bunch of time trying to get it to work myself, and this is what worked: ``` npx react-native init MyApp --template react-native-template-typescript@6.4.* --version 0.62.2 ``` Note the specific version of the template package. To find the right template version for other versions of React Native,...
Try please, ``` npx react-native init MyApp --version react-native@0.62.2 --template react-native-template-typescript ```
63,150,696
I'm using Perfex CRM which is developed by using CodeIgniter framework. I'm having an issue that the IDs of the are records not consecutive even after I delete the older records. Like the below image. Any idea what topic I should be looking for to fix this issue? [ID Issue](https://i.stack.imgur.com/ylob0.png)
2020/07/29
[ "https://Stackoverflow.com/questions/63150696", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12545885/" ]
For typescript template, the version of react native depends on the react-native-template-typescript version, for example: * react-native-template-typescript@6.5.9 --> react-native@0.63.4 * react-native-template-typescript@6.5.7 --> react-native@0.63.3 Therefore if you want to install version react-native@0.63.4, you...
Try please, ``` npx react-native init MyApp --version react-native@0.62.2 --template react-native-template-typescript ```
63,150,696
I'm using Perfex CRM which is developed by using CodeIgniter framework. I'm having an issue that the IDs of the are records not consecutive even after I delete the older records. Like the below image. Any idea what topic I should be looking for to fix this issue? [ID Issue](https://i.stack.imgur.com/ylob0.png)
2020/07/29
[ "https://Stackoverflow.com/questions/63150696", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12545885/" ]
For typescript template, the version of react native depends on the react-native-template-typescript version, for example: * react-native-template-typescript@6.5.9 --> react-native@0.63.4 * react-native-template-typescript@6.5.7 --> react-native@0.63.3 Therefore if you want to install version react-native@0.63.4, you...
Okay, I just spent a bunch of time trying to get it to work myself, and this is what worked: ``` npx react-native init MyApp --template react-native-template-typescript@6.4.* --version 0.62.2 ``` Note the specific version of the template package. To find the right template version for other versions of React Native,...
18,550
What is the rationale for existence of payment companies like BitPay? If I want to start accepting Bitcoin at my store I can simply set up my own Bitcoin wallet for free and then a simple script which counts Bitcoin price after checkout depending on current exchange rate. So what is the extra value these guys bring to ...
2013/12/11
[ "https://bitcoin.stackexchange.com/questions/18550", "https://bitcoin.stackexchange.com", "https://bitcoin.stackexchange.com/users/3120/" ]
The difficulty is not really 1. testnet has a "20-minute rule": if no block is successfully mined within 20 minutes, the difficulty drops to 1 until a block is mined. Then it reverts to its previous value. However, it appears that `getdifficulty` returns 1 whenever the most recent block was difficulty 1, even if it wa...
First of all, this might not be impossible. The time to mine a block can vary greatly depending on your luck. But 7-8 hrs is quite a long time. You should make sure your cgminer is correctly connected to your bitcoind instance. Also, I think bitcoind should be fully synchronized and being up-to-date for mainnet does n...
116,664
I'm trying to balance an equation using oxidation numbers $\ce{MnO4^- + H+ + Cl- -> Mn^2+ + Cl2 + H2O}$ my suggestion: $\ce{MnO4- + 8H+ + 5Cl- → Mn^2+ + 2.5Cl2 + 4H2O}$ the 2.5 $\ce{Cl2}$ is throwing me off, would like to make sure my methodology is correct.
2019/06/11
[ "https://chemistry.stackexchange.com/questions/116664", "https://chemistry.stackexchange.com", "https://chemistry.stackexchange.com/users/80017/" ]
The balanced equation seems correct. Multiplying by $2$ we get the following: $$\ce{2 MnO4- + 16 H+ + 10 Cl- → 2 Mn^2+ + 5 Cl2 + 8 H2O}$$ which is also correct.
Actually, if you balance given redox reaction strictly following the half-reactions method where you have to equate the number of transferred electrons, you won't end up with fractional coefficients: $$ \begin{align} \ce{\overset{+7}{Mn}O4- + 8 H+ + 5 e- &→ \overset{+2}{Mn}^2+ + 4 H2O} &|\cdot 2 \tag{red}\\ \ce{2 \ove...
6,848,617
I need to store in memory a very long array.Each array item will be just a flag TRUE/FALSE (0/1). I need it to be very memory efficient so I have thought of implementing it as a masked-bit on top of an `unsigned char` region. Every `char` in memory should give me at least 8 flags. I have implemented the following funct...
2011/07/27
[ "https://Stackoverflow.com/questions/6848617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/418267/" ]
You can do it simpler: ``` unsigned char flag_bitmask[MAX_FLAGS]; void setFlag( int flag) { flag_bitmask[flag / 8] |= (1 << (flag % 8) ); } char isFlagSet(int flag) { return flag_bitmask[flag / 8] & (1 << (flag % 8) ); } void unSetFlag(int flag) { flag_bitmask[flag / 8] &= ~(1 << (flag % 8) ); } ``` I...
You can replace your `SIZE` constant with the macro `CHAR_BIT` from `<limits.h>`, which does the same thing. In the `new_bit_array` function, you can replace `0xFF` with `(unsigned char) ~0`, which is indepdendent of the number of bits in a char. Although it would be easier to initialize the memory to zero bits, perha...
6,848,617
I need to store in memory a very long array.Each array item will be just a flag TRUE/FALSE (0/1). I need it to be very memory efficient so I have thought of implementing it as a masked-bit on top of an `unsigned char` region. Every `char` in memory should give me at least 8 flags. I have implemented the following funct...
2011/07/27
[ "https://Stackoverflow.com/questions/6848617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/418267/" ]
You can do it simpler: ``` unsigned char flag_bitmask[MAX_FLAGS]; void setFlag( int flag) { flag_bitmask[flag / 8] |= (1 << (flag % 8) ); } char isFlagSet(int flag) { return flag_bitmask[flag / 8] & (1 << (flag % 8) ); } void unSetFlag(int flag) { flag_bitmask[flag / 8] &= ~(1 << (flag % 8) ); } ``` I...
You can use bitfields in structs. You could have an array of the following struct: ``` struct bitflags { unsigned char f0:1; unsigned char f1:1; unsigned char f2:1; unsigned char f3:1; unsigned char f4:1; unsigned char f5:1; unsigned char f6:1; unsigned char f7:1; }; struct bitflags ma...
48,248,859
I'm new to node.js and react. I've built a back end api to expose **CRUD endpoints** for a `Products` model with three fields: `Title`, `Description` and `Price`. I've used **node/express** for the server with an **SQLite** db file. I've tested the endpoints using postman and can successfully access all the products, ...
2018/01/14
[ "https://Stackoverflow.com/questions/48248859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9214331/" ]
After other comments saying it was working for them, and knowing that it worked for me some weeks ago, I've finally figured out what is going on: * On my "Available package sources" (NuGet config) in VS2017, I had the nuget nuget repository from work **[work-repo]**. I have to connect via VPN to be able to access it (...
I similarly found this wasn't working, and the problem was also having a private repository (that needed authentication rather than being completely inaccessible). The simplest solution for me was to list the nuget packages using 'nuget sources', check the name of the private repository, use 'nuget sources Disable -Nam...
48,248,859
I'm new to node.js and react. I've built a back end api to expose **CRUD endpoints** for a `Products` model with three fields: `Title`, `Description` and `Price`. I've used **node/express** for the server with an **SQLite** db file. I've tested the endpoints using postman and can successfully access all the products, ...
2018/01/14
[ "https://Stackoverflow.com/questions/48248859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9214331/" ]
After other comments saying it was working for them, and knowing that it worked for me some weeks ago, I've finally figured out what is going on: * On my "Available package sources" (NuGet config) in VS2017, I had the nuget nuget repository from work **[work-repo]**. I have to connect via VPN to be able to access it (...
I had the same problem and it was Telerik source/package causing the issue. Once I removed iy from the "Available package sources" (just like Xavier suggests), the SpaTemplates install completed without error
48,248,859
I'm new to node.js and react. I've built a back end api to expose **CRUD endpoints** for a `Products` model with three fields: `Title`, `Description` and `Price`. I've used **node/express** for the server with an **SQLite** db file. I've tested the endpoints using postman and can successfully access all the products, ...
2018/01/14
[ "https://Stackoverflow.com/questions/48248859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9214331/" ]
After other comments saying it was working for them, and knowing that it worked for me some weeks ago, I've finally figured out what is going on: * On my "Available package sources" (NuGet config) in VS2017, I had the nuget nuget repository from work **[work-repo]**. I have to connect via VPN to be able to access it (...
I had the same issue. In my case, the issue occured after installing Visual Studio 2019. After struggling for a while I found out that the NuGet V2 package source was completely missing. After going to `Tools` -> `Options` -> `NuGet Package Manager` -> `Package Sources`, adding <https://www.nuget.org/api/v2/>, the vue...
48,248,859
I'm new to node.js and react. I've built a back end api to expose **CRUD endpoints** for a `Products` model with three fields: `Title`, `Description` and `Price`. I've used **node/express** for the server with an **SQLite** db file. I've tested the endpoints using postman and can successfully access all the products, ...
2018/01/14
[ "https://Stackoverflow.com/questions/48248859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9214331/" ]
After other comments saying it was working for them, and knowing that it worked for me some weeks ago, I've finally figured out what is going on: * On my "Available package sources" (NuGet config) in VS2017, I had the nuget nuget repository from work **[work-repo]**. I have to connect via VPN to be able to access it (...
Its so simple: just run ``` dotnet new search vue ``` then follow the instruction and then select a template, enjoy
48,248,859
I'm new to node.js and react. I've built a back end api to expose **CRUD endpoints** for a `Products` model with three fields: `Title`, `Description` and `Price`. I've used **node/express** for the server with an **SQLite** db file. I've tested the endpoints using postman and can successfully access all the products, ...
2018/01/14
[ "https://Stackoverflow.com/questions/48248859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9214331/" ]
I had the same issue. In my case, the issue occured after installing Visual Studio 2019. After struggling for a while I found out that the NuGet V2 package source was completely missing. After going to `Tools` -> `Options` -> `NuGet Package Manager` -> `Package Sources`, adding <https://www.nuget.org/api/v2/>, the vue...
I similarly found this wasn't working, and the problem was also having a private repository (that needed authentication rather than being completely inaccessible). The simplest solution for me was to list the nuget packages using 'nuget sources', check the name of the private repository, use 'nuget sources Disable -Nam...
48,248,859
I'm new to node.js and react. I've built a back end api to expose **CRUD endpoints** for a `Products` model with three fields: `Title`, `Description` and `Price`. I've used **node/express** for the server with an **SQLite** db file. I've tested the endpoints using postman and can successfully access all the products, ...
2018/01/14
[ "https://Stackoverflow.com/questions/48248859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9214331/" ]
I had the same issue. In my case, the issue occured after installing Visual Studio 2019. After struggling for a while I found out that the NuGet V2 package source was completely missing. After going to `Tools` -> `Options` -> `NuGet Package Manager` -> `Package Sources`, adding <https://www.nuget.org/api/v2/>, the vue...
I had the same problem and it was Telerik source/package causing the issue. Once I removed iy from the "Available package sources" (just like Xavier suggests), the SpaTemplates install completed without error
48,248,859
I'm new to node.js and react. I've built a back end api to expose **CRUD endpoints** for a `Products` model with three fields: `Title`, `Description` and `Price`. I've used **node/express** for the server with an **SQLite** db file. I've tested the endpoints using postman and can successfully access all the products, ...
2018/01/14
[ "https://Stackoverflow.com/questions/48248859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9214331/" ]
I had the same issue. In my case, the issue occured after installing Visual Studio 2019. After struggling for a while I found out that the NuGet V2 package source was completely missing. After going to `Tools` -> `Options` -> `NuGet Package Manager` -> `Package Sources`, adding <https://www.nuget.org/api/v2/>, the vue...
Its so simple: just run ``` dotnet new search vue ``` then follow the instruction and then select a template, enjoy
72,794,596
how to create multiple terminals in python (VScode) to run the same code in several terminals simultaneously the same code. I also need to know how to open several .py files simultaneously too (running at the same time). I found some ways to run .py files similar to: ``` start /b python bot_1 ``` or ``` start bot_...
2022/06/29
[ "https://Stackoverflow.com/questions/72794596", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19227958/" ]
Your initial useState should be a value that can be rendered to the user or null, if you want to set the initial state use the useEffect hook setting the value using setValue.
The *initial* value can't be the value from the Promise result if the Promise is constructed in the same component; the component must render before the API call starts (and finishes). Either conditionally render the textarea only once the API call has finished ``` const [value, setValue] = useState(); useEffect(() =...
49,887,417
I'm working through Free Code Camp and I am making a tribute page for Violeta Parra. I've added the jQuery and jQuery UI plugins in settings and I've copied some stuff straight from the FCC lessons but it don't seem to be working. Here is the pen: <https://codepen.io/enheduana/pen/NYLMZN> So in the HTML section the i...
2018/04/17
[ "https://Stackoverflow.com/questions/49887417", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4403911/" ]
Your function call to `addClass` needs to be camelcase. It's `addClass` not `addclass`. Edit: Also, why don't you just apply the class on the element in the HTML? Why does it have to be applied via jQuery? <https://api.jquery.com/addclass/>
It looks like you don't have a class definition for `shake` or `animated` in your CSS. Jquery adds the classes as supposed to, but they don't do anything because they aren't defined. Just add the definitions and it should work fine.
73,777,688
Im trying to return the 'students' grades according to what they got on python. I used a bunch of elif statements but i dont feel like this is efficient. I was wondering if there are any other ways i can present this as? possibly smaller. Ive attempted using for loops and dictionaries, but im not getting it, maybe cuz ...
2022/09/19
[ "https://Stackoverflow.com/questions/73777688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19742994/" ]
You can use a dictionary to store the range and it's according grade value: ```py def grade_select(grade): dct = { range(0, 40): "D-", range(40, 45): "D", range(45, 50): "D+", ... range(90, 100 + 1): "A+" } dct = {g: m for r, m in dct.items() for g in r} return d...
Here's the fastest version that calculates an index based on the grade value. This method only works if your grade ranges are all five wide. ``` _lettergrades = ['D-', 'D', 'D+', 'C-', 'C', 'C+', 'B-', 'B', 'B+', 'A-', 'A', 'A+'] def grade_select(grade): return _lettergrades[(max(min(grade, 90), 35) - 35) // 5]...
73,777,688
Im trying to return the 'students' grades according to what they got on python. I used a bunch of elif statements but i dont feel like this is efficient. I was wondering if there are any other ways i can present this as? possibly smaller. Ive attempted using for loops and dictionaries, but im not getting it, maybe cuz ...
2022/09/19
[ "https://Stackoverflow.com/questions/73777688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19742994/" ]
since you return when a condition is matched, you do not need to use `elif` just `if`. moreover, the previous condition eliminates the need of checking if the value is "between". ``` def grade_select(grade): if grade < 40: return "D-" if grade < 45: return "D" if grade < 50: return "D+" if grade < 55:...
You can use a dictionary to store the range and it's according grade value: ```py def grade_select(grade): dct = { range(0, 40): "D-", range(40, 45): "D", range(45, 50): "D+", ... range(90, 100 + 1): "A+" } dct = {g: m for r, m in dct.items() for g in r} return d...
73,777,688
Im trying to return the 'students' grades according to what they got on python. I used a bunch of elif statements but i dont feel like this is efficient. I was wondering if there are any other ways i can present this as? possibly smaller. Ive attempted using for loops and dictionaries, but im not getting it, maybe cuz ...
2022/09/19
[ "https://Stackoverflow.com/questions/73777688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19742994/" ]
You can use a dictionary to store the range and it's according grade value: ```py def grade_select(grade): dct = { range(0, 40): "D-", range(40, 45): "D", range(45, 50): "D+", ... range(90, 100 + 1): "A+" } dct = {g: m for r, m in dct.items() for g in r} return d...
I guess using dictionary is the best way ``` def grade_select(grade): d = { 'D-':range(0,40), 'D':range(45,50), 'D+':range(50,55), 'C-':range(55,60) #, etc. } return [k for k,v in d.items() if grade in v][0] ```
73,777,688
Im trying to return the 'students' grades according to what they got on python. I used a bunch of elif statements but i dont feel like this is efficient. I was wondering if there are any other ways i can present this as? possibly smaller. Ive attempted using for loops and dictionaries, but im not getting it, maybe cuz ...
2022/09/19
[ "https://Stackoverflow.com/questions/73777688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19742994/" ]
since you return when a condition is matched, you do not need to use `elif` just `if`. moreover, the previous condition eliminates the need of checking if the value is "between". ``` def grade_select(grade): if grade < 40: return "D-" if grade < 45: return "D" if grade < 50: return "D+" if grade < 55:...
Here's the fastest version that calculates an index based on the grade value. This method only works if your grade ranges are all five wide. ``` _lettergrades = ['D-', 'D', 'D+', 'C-', 'C', 'C+', 'B-', 'B', 'B+', 'A-', 'A', 'A+'] def grade_select(grade): return _lettergrades[(max(min(grade, 90), 35) - 35) // 5]...
73,777,688
Im trying to return the 'students' grades according to what they got on python. I used a bunch of elif statements but i dont feel like this is efficient. I was wondering if there are any other ways i can present this as? possibly smaller. Ive attempted using for loops and dictionaries, but im not getting it, maybe cuz ...
2022/09/19
[ "https://Stackoverflow.com/questions/73777688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19742994/" ]
Here's the fastest version that calculates an index based on the grade value. This method only works if your grade ranges are all five wide. ``` _lettergrades = ['D-', 'D', 'D+', 'C-', 'C', 'C+', 'B-', 'B', 'B+', 'A-', 'A', 'A+'] def grade_select(grade): return _lettergrades[(max(min(grade, 90), 35) - 35) // 5]...
I guess using dictionary is the best way ``` def grade_select(grade): d = { 'D-':range(0,40), 'D':range(45,50), 'D+':range(50,55), 'C-':range(55,60) #, etc. } return [k for k,v in d.items() if grade in v][0] ```
73,777,688
Im trying to return the 'students' grades according to what they got on python. I used a bunch of elif statements but i dont feel like this is efficient. I was wondering if there are any other ways i can present this as? possibly smaller. Ive attempted using for loops and dictionaries, but im not getting it, maybe cuz ...
2022/09/19
[ "https://Stackoverflow.com/questions/73777688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19742994/" ]
Well, your condition is kinda weird, because ``` elif grade <= 40 and grade < 50 ``` has no sense (if grade <= 40 then grade < 50 of course) But I think you wanna write something like this: ``` if 40 <= grade < 50: pass ``` You can use syntax above, it could make it a little bit better. Also, you can check [...
Here's the fastest version that calculates an index based on the grade value. This method only works if your grade ranges are all five wide. ``` _lettergrades = ['D-', 'D', 'D+', 'C-', 'C', 'C+', 'B-', 'B', 'B+', 'A-', 'A', 'A+'] def grade_select(grade): return _lettergrades[(max(min(grade, 90), 35) - 35) // 5]...
73,777,688
Im trying to return the 'students' grades according to what they got on python. I used a bunch of elif statements but i dont feel like this is efficient. I was wondering if there are any other ways i can present this as? possibly smaller. Ive attempted using for loops and dictionaries, but im not getting it, maybe cuz ...
2022/09/19
[ "https://Stackoverflow.com/questions/73777688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19742994/" ]
since you return when a condition is matched, you do not need to use `elif` just `if`. moreover, the previous condition eliminates the need of checking if the value is "between". ``` def grade_select(grade): if grade < 40: return "D-" if grade < 45: return "D" if grade < 50: return "D+" if grade < 55:...
I guess using dictionary is the best way ``` def grade_select(grade): d = { 'D-':range(0,40), 'D':range(45,50), 'D+':range(50,55), 'C-':range(55,60) #, etc. } return [k for k,v in d.items() if grade in v][0] ```
73,777,688
Im trying to return the 'students' grades according to what they got on python. I used a bunch of elif statements but i dont feel like this is efficient. I was wondering if there are any other ways i can present this as? possibly smaller. Ive attempted using for loops and dictionaries, but im not getting it, maybe cuz ...
2022/09/19
[ "https://Stackoverflow.com/questions/73777688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19742994/" ]
since you return when a condition is matched, you do not need to use `elif` just `if`. moreover, the previous condition eliminates the need of checking if the value is "between". ``` def grade_select(grade): if grade < 40: return "D-" if grade < 45: return "D" if grade < 50: return "D+" if grade < 55:...
Well, your condition is kinda weird, because ``` elif grade <= 40 and grade < 50 ``` has no sense (if grade <= 40 then grade < 50 of course) But I think you wanna write something like this: ``` if 40 <= grade < 50: pass ``` You can use syntax above, it could make it a little bit better. Also, you can check [...
73,777,688
Im trying to return the 'students' grades according to what they got on python. I used a bunch of elif statements but i dont feel like this is efficient. I was wondering if there are any other ways i can present this as? possibly smaller. Ive attempted using for loops and dictionaries, but im not getting it, maybe cuz ...
2022/09/19
[ "https://Stackoverflow.com/questions/73777688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19742994/" ]
Well, your condition is kinda weird, because ``` elif grade <= 40 and grade < 50 ``` has no sense (if grade <= 40 then grade < 50 of course) But I think you wanna write something like this: ``` if 40 <= grade < 50: pass ``` You can use syntax above, it could make it a little bit better. Also, you can check [...
I guess using dictionary is the best way ``` def grade_select(grade): d = { 'D-':range(0,40), 'D':range(45,50), 'D+':range(50,55), 'C-':range(55,60) #, etc. } return [k for k,v in d.items() if grade in v][0] ```
4,734,831
How can i obtain currency formatting according to my country i.e indian rupee, INR or Rs ?? Please tell me the way to achieve this ?? Right now when i use **StringFormat="{}{0:C}"**, "$" is being used I have gone through this [link](http://www.nbdtech.com/Blog/archive/2009/03/18/getting-a-wpf-application-to-pick-up-...
2011/01/19
[ "https://Stackoverflow.com/questions/4734831", "https://Stackoverflow.com", "https://Stackoverflow.com/users/570928/" ]
You can specify the culture in your binding like this: ``` TextBlock Text="{Binding Value, StringFormat=C, ConverterCulture=nl-BE}" ``` nl-BE is belgian culture, you can exchange it with Indian culture info, I don't know that ;-)
Or you can set your current thread to the right culture, so you will use it everywhere in your application: ``` Thread.CurrentThread.CurrentUICulture = new CultureInfo("hi-IN"); ```
57,501,134
I have recently started studying SDL and I would like to get a good understanding of it. I have followed Lazy Foo' Productions' tutorials and there is one statement that I don't get. What is the meaning behind the `gScreenSurface->format` or `screenSurface->format` in the examples below? ```cpp SDL_ConvertSurface( scr...
2019/08/14
[ "https://Stackoverflow.com/questions/57501134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Have you taken a look at the [documentation](https://wiki.libsdl.org/SDL_ConvertSurface)? The format is an SDL Pixel Format detailing how the pixels are set in memory.
Not quite sure what you are asking, but `gScreenSurface->format` means "dereference the pointer in `gScreenSurface` to get the value `format` in whatever it points to". What's not clear about that? That's basic pointer use.
49,699,871
if you have an if(boolean && otherBoolean) statment, and the first boolean is false, will Java check the otherBoolean anyway? What I'm thinking is having something like this: ``` if( text.length()>=4 && text.subString(0,4).equals("~yay") ){ //do stuff } ``` because the subString method will throw an error if text i...
2018/04/06
[ "https://Stackoverflow.com/questions/49699871", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9269337/" ]
Actually ``` if (a) { if (b) { //stuff } } ``` Is the same thing as ``` if (a && b) { //stuff } ``` Debugger will stop verification if `a` is false. But in more complex statements you should be careful using short circuits.
In Java, the `&&` '[short-circuits](https://en.wikipedia.org/wiki/Short-circuit_evaluation)' - that is, as it's going along the conditionals it's evaluating, it'll jump out at the first 'false' conditional. So, your statement will be safe, because you'll need to have at least four characters in order for your code to ...
15,134,416
I'm trying to calculate the distance of my centroid point, that's calculated through the total number of tags, and sum of the instant time that tags appear. So that's the concept of (tc\_sum/cnt). However the SELECT on the subquery, doesn't allow me to get the centroid point, because the "centr" is not calculated ye...
2013/02/28
[ "https://Stackoverflow.com/questions/15134416", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1623718/" ]
I created a similar wrapper in the past and my approach was passing a "completion block" when calling my wrapper method; this completion block is then triggered once all the asynchronous calls are done running, and it receives whatever data your method would return in a synchronous scenario (in your case, the array of ...
If you are dispatching an asynchronouos block, you can communicate with your `UIViewController` subclass by calling back to it: ``` [self someSelectorWithCallbackData:stuffWhichYouWantToGiveBack]; ``` This will call `self` to get captured by the block, and so will work as expected. From the relevant method you can r...
15,134,416
I'm trying to calculate the distance of my centroid point, that's calculated through the total number of tags, and sum of the instant time that tags appear. So that's the concept of (tc\_sum/cnt). However the SELECT on the subquery, doesn't allow me to get the centroid point, because the "centr" is not calculated ye...
2013/02/28
[ "https://Stackoverflow.com/questions/15134416", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1623718/" ]
I created a similar wrapper in the past and my approach was passing a "completion block" when calling my wrapper method; this completion block is then triggered once all the asynchronous calls are done running, and it receives whatever data your method would return in a synchronous scenario (in your case, the array of ...
Think you need to use a protol @class Webservice; ``` @protocol WebserviceDelegate @optional -(void)webservice:(Webservice *)webservice didFetchPosts:(NSArray *)posts; -(void)webservice:(Webservice *)webservice didFetchComments:(NSArray *)comments forPostID:(NSString *)postID launchComments:(BOOL)launch; -(void)webse...
30,706,918
I have div element and I want to animate its CSS relative position from left:-260px; to left: -130px; over 0.5s when I put my mouse over it and I want it to stay there as long as my mouse is over that div. Than I want to animate it back to where it was when I move my mouse out of that div. I read tons of tutorials o...
2015/06/08
[ "https://Stackoverflow.com/questions/30706918", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4751835/" ]
Using ``` .myclass { transition: 0.5s; } .myclass:hover { /* add relevant vendor prefixes */ transform: translateX(130px); transition: 0.5s; } ``` EDIT: Proof of concept: <http://codepen.io/Theodeus/pen/oXWEYx>
Try like this: **[Demo](http://jsfiddle.net/jcng5un4/1/)** css: ``` ul li{ padding-left:260px; -moz-transition: padding-left .3s ease; -o-transition: padding-left .3s ease; -webkit-transition: padding-left .3s ease; transition: padding-left .3s ease; display:block; } ul li:ho...
30,706,918
I have div element and I want to animate its CSS relative position from left:-260px; to left: -130px; over 0.5s when I put my mouse over it and I want it to stay there as long as my mouse is over that div. Than I want to animate it back to where it was when I move my mouse out of that div. I read tons of tutorials o...
2015/06/08
[ "https://Stackoverflow.com/questions/30706918", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4751835/" ]
Using ``` .myclass { transition: 0.5s; } .myclass:hover { /* add relevant vendor prefixes */ transform: translateX(130px); transition: 0.5s; } ``` EDIT: Proof of concept: <http://codepen.io/Theodeus/pen/oXWEYx>
div1 { ====== ``` transition-property: transform; animation: example 5s infinite linear; ``` } ``` @keyframes example { 100%{-web-kit-transform:translate X(0px);} 0%{-web-kit-transform:translate X(150px);} } ```
1,747,044
In my linear algebra textbook it says that a dual basis for $V^{\*}$ is {${f\_{1}, ..., f\_{n}}$} where $f\_{i}(x)$ is the function that takes a vector in your vector space and writes it as a linear combination of your basis vectors and its value is equal to the coefficient in front of the ith basis vector. My book gav...
2016/04/17
[ "https://math.stackexchange.com/questions/1747044", "https://math.stackexchange.com", "https://math.stackexchange.com/users/297225/" ]
Say we have a finite dimensional vector space, $V$. (In the infinite dimensional case everything I say below is still true, but other things get much, *much* weirder.) We usually picture elements of $V$ as being fairly concrete - e.g. an arrow pointing in a certain direction. By contrast, elements of the dual space ar...
As a short and sweet answer, $V^\*$ is a set of linear maps from $V \rightarrow \Bbb{F}$, where $\Bbb{F}$ is the field the vector space is over. This is also sometimes denoted $\operatorname{Hom}(V,\Bbb{F})$. Given a basis $\{e\_i\}$ of $V$, the dual basis is the unique basis $\{f\_i\}$ of $V^\*$ such that $$f\_i(e\_j...
42,868,072
I'm fairly new to programming in C. My problem is that I have two implementations of a function and I want to be able to switch between them easily. Right now I define the two implementations of the function as function\_implementation1 and function\_implementation1 in the files "funtion\_implementation1.h" and "funt...
2017/03/17
[ "https://Stackoverflow.com/questions/42868072", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2707067/" ]
Without knowing what `replaceAll` is doing, I can't really fix that line of code, but you could try using a different replace function instead. ``` fa = parseFloat($("#face_amount").val().replace(/,/g,'')) // This works, returns 1000000 ``` I suspect the problem is that your `replaceAll` function isn't matching comm...
If your goal is to eliminate any non-numeric or `.` values, you can use a simple regex before you `parseFloat`.: ``` var floater = parseFloat($("#face_amount").val().replace(/[^\d\.]+/g, '')) ```
42,868,072
I'm fairly new to programming in C. My problem is that I have two implementations of a function and I want to be able to switch between them easily. Right now I define the two implementations of the function as function\_implementation1 and function\_implementation1 in the files "funtion\_implementation1.h" and "funt...
2017/03/17
[ "https://Stackoverflow.com/questions/42868072", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2707067/" ]
Without knowing what `replaceAll` is doing, I can't really fix that line of code, but you could try using a different replace function instead. ``` fa = parseFloat($("#face_amount").val().replace(/,/g,'')) // This works, returns 1000000 ``` I suspect the problem is that your `replaceAll` function isn't matching comm...
Works for me, but I included my `replaceAll` in the code: ```js function replaceAll(str,from,to){ var re = new RegExp(from,"g"); return str.replace(re,to); } var face_amount = '999,999'; var fa = parseFloat(replaceAll(face_amount,',','')); console.log(face_amount,': ',fa); face_amount = '1,000,000'; fa =...
2,314,809
Is communication between clients and servers in java rmi secure (i.e. encrypted by default)?
2010/02/22
[ "https://Stackoverflow.com/questions/2314809", "https://Stackoverflow.com", "https://Stackoverflow.com/users/174010/" ]
Encoded, yes. Encrypted, no. JERI for JINI gives JRMP (the RMI protocol) over SSL, IIRC. JSR #76 would have provided RMI Security, however it was controversially [voted down](http://jcp.org/en/jsr/results?id=325).
I think you mean "encrypted" not "encoded". The answer is no. If you're using RMI in a non-trusted environment I would suggest something like [RMI over SSH tunneling](http://www.javaranch.com/journal/2003/10/rmi-ssh_p1.html).
2,314,809
Is communication between clients and servers in java rmi secure (i.e. encrypted by default)?
2010/02/22
[ "https://Stackoverflow.com/questions/2314809", "https://Stackoverflow.com", "https://Stackoverflow.com/users/174010/" ]
Encoded, yes. Encrypted, no. JERI for JINI gives JRMP (the RMI protocol) over SSL, IIRC. JSR #76 would have provided RMI Security, however it was controversially [voted down](http://jcp.org/en/jsr/results?id=325).
By secure I guess you mean encrypted. Not by default with RMI. You can use [custom socket factories](http://java.sun.com/j2se/1.5.0/docs/guide/rmi/socketfactory/index.html) to encrypt RMI comms.
2,314,809
Is communication between clients and servers in java rmi secure (i.e. encrypted by default)?
2010/02/22
[ "https://Stackoverflow.com/questions/2314809", "https://Stackoverflow.com", "https://Stackoverflow.com/users/174010/" ]
Encoded, yes. Encrypted, no. JERI for JINI gives JRMP (the RMI protocol) over SSL, IIRC. JSR #76 would have provided RMI Security, however it was controversially [voted down](http://jcp.org/en/jsr/results?id=325).
In short, no. <http://java.sun.com/j2se/1.4.2/docs/guide/rmi/faq.html#encryption> In essence, the network channel has to be encrypted if you need things to be secure.
2,314,809
Is communication between clients and servers in java rmi secure (i.e. encrypted by default)?
2010/02/22
[ "https://Stackoverflow.com/questions/2314809", "https://Stackoverflow.com", "https://Stackoverflow.com/users/174010/" ]
Encoded, yes. Encrypted, no. JERI for JINI gives JRMP (the RMI protocol) over SSL, IIRC. JSR #76 would have provided RMI Security, however it was controversially [voted down](http://jcp.org/en/jsr/results?id=325).
Not mentioned this far: You can set up a [VPN](http://www.google.com/search?q=vpn&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-GB:official&client=firefox-a) between the machines for full layer 2 security.
2,314,809
Is communication between clients and servers in java rmi secure (i.e. encrypted by default)?
2010/02/22
[ "https://Stackoverflow.com/questions/2314809", "https://Stackoverflow.com", "https://Stackoverflow.com/users/174010/" ]
I think you mean "encrypted" not "encoded". The answer is no. If you're using RMI in a non-trusted environment I would suggest something like [RMI over SSH tunneling](http://www.javaranch.com/journal/2003/10/rmi-ssh_p1.html).
By secure I guess you mean encrypted. Not by default with RMI. You can use [custom socket factories](http://java.sun.com/j2se/1.5.0/docs/guide/rmi/socketfactory/index.html) to encrypt RMI comms.
2,314,809
Is communication between clients and servers in java rmi secure (i.e. encrypted by default)?
2010/02/22
[ "https://Stackoverflow.com/questions/2314809", "https://Stackoverflow.com", "https://Stackoverflow.com/users/174010/" ]
I think you mean "encrypted" not "encoded". The answer is no. If you're using RMI in a non-trusted environment I would suggest something like [RMI over SSH tunneling](http://www.javaranch.com/journal/2003/10/rmi-ssh_p1.html).
In short, no. <http://java.sun.com/j2se/1.4.2/docs/guide/rmi/faq.html#encryption> In essence, the network channel has to be encrypted if you need things to be secure.
2,314,809
Is communication between clients and servers in java rmi secure (i.e. encrypted by default)?
2010/02/22
[ "https://Stackoverflow.com/questions/2314809", "https://Stackoverflow.com", "https://Stackoverflow.com/users/174010/" ]
I think you mean "encrypted" not "encoded". The answer is no. If you're using RMI in a non-trusted environment I would suggest something like [RMI over SSH tunneling](http://www.javaranch.com/journal/2003/10/rmi-ssh_p1.html).
Not mentioned this far: You can set up a [VPN](http://www.google.com/search?q=vpn&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-GB:official&client=firefox-a) between the machines for full layer 2 security.
2,314,809
Is communication between clients and servers in java rmi secure (i.e. encrypted by default)?
2010/02/22
[ "https://Stackoverflow.com/questions/2314809", "https://Stackoverflow.com", "https://Stackoverflow.com/users/174010/" ]
By secure I guess you mean encrypted. Not by default with RMI. You can use [custom socket factories](http://java.sun.com/j2se/1.5.0/docs/guide/rmi/socketfactory/index.html) to encrypt RMI comms.
Not mentioned this far: You can set up a [VPN](http://www.google.com/search?q=vpn&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-GB:official&client=firefox-a) between the machines for full layer 2 security.
2,314,809
Is communication between clients and servers in java rmi secure (i.e. encrypted by default)?
2010/02/22
[ "https://Stackoverflow.com/questions/2314809", "https://Stackoverflow.com", "https://Stackoverflow.com/users/174010/" ]
In short, no. <http://java.sun.com/j2se/1.4.2/docs/guide/rmi/faq.html#encryption> In essence, the network channel has to be encrypted if you need things to be secure.
Not mentioned this far: You can set up a [VPN](http://www.google.com/search?q=vpn&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-GB:official&client=firefox-a) between the machines for full layer 2 security.
38,637,801
I'm trying to connect to a SQL Server 2016 database in RStudio. I'm using RStudio on my laptop. I could remote in to the server and install RStudio there if it were absolutely necessary, but working locally has massive advantages so I would really prefer that if it were possible. Connection with the server goes through...
2016/07/28
[ "https://Stackoverflow.com/questions/38637801", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6291408/" ]
Enable Implied Authentication for Launchpad Accounts Specifically navigate to the User Account from the Control Panel and you'll see the SQLR UserGroup with 20 accounts. Permission these on the Server and DB Table with write access. That should see you right. Good luck
You could create a ODBC connection in your local instance. A tutorial on creating ODBC connections can be found [here](http://help.bluemangolearning.com/m/screensteps-workgroup/l/17300-Creating-ODBC-Connections-on-Windows). Background about the different types of SQL Server ODBC connections can be found [here](https://...
160,973
I was referring to this lecture <http://www.stanford.edu/class/ee364a/videos/video05.html> (about 0:38:10) related to convex optimization and for optimization it had a certain affine function equality constraint like $$Ax=b$$ The lecturer then obtained the equivalent optimization problem removing the equality constrai...
2012/06/20
[ "https://math.stackexchange.com/questions/160973", "https://math.stackexchange.com", "https://math.stackexchange.com/users/31820/" ]
The null space of matrix $A$ are all those vectors $z$ with $Az=0$ where $0$ is the zero vector (same dimensions as $x$ and $b$). These vectors build up a vector space which can be described by a base $B$. And that base $B$ can be used to form a matrix $F$ - just fill up with zero columns until you can operate on the ...
When we have $x\_b$ a solution of $Ax = b$, then all other solutions of $Ax+b$ are given by $x\_b + x\_0$, where $x\_0$ is any solution of $Ax = 0$. Proof: Fix $x\_b$ a solution of $Ax=b$. 1. Let $x\_0$ be a solution of $Ax = 0$. Then $x\_0 + x\_b$ is a solution of $Ax+b$, since $A(x\_0+x\_b)= Ax\_0 + Ax\_b = 0 + b =...
13,348,925
I've a admin panel and user panel. Both have a Logout link. When I login to admin panel and in the mean time i login as a user. So both have a session. But when i logout from admin panel it's also logged from user panel. Why it's logout from user. I did seperate login session. **Login Session for Admin and User:** ...
2012/11/12
[ "https://Stackoverflow.com/questions/13348925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1802398/" ]
**[`session_destroy()`](http://php.net/manual/en/function.session-destroy.php)** > > session\_destroy — Destroys **all** data registered to a session > > > This being called implies the session, both user, and admin is being destroyed. You should simply **unset** the session variables you don't want and not destr...
session\_unset clears all session... not just one variable.. use ``` unset($_SESSION['admin']) ``` For more: <http://php.net/manual/en/function.session-unset.php>
218,930
This step-down transformer was scavenged from a power tool battery charger. It was designed to take 120V AC current and it outputs 20V AC. I can't find any specs for it, so I'm wondering what assumptions one can make about using it. 1. Since the wires are 16 AWG can we assume it's safe to run at up to 10A? Or could i...
2016/02/23
[ "https://electronics.stackexchange.com/questions/218930", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/39511/" ]
> > Since the wires are 16 AWG can we assume it's safe to run at up to 10A? Or could it be internally more constricted? > > > Based on apparent dimensions, the current rating is almost certainly less than 10A. Measure the laminations carefully and estimate the rating by comparing with published data for similar t...
The transformer will be safe up to a maximum temperature. If you can keep your hand on it (so <60C) it will be OK. It may be OK hotter. You can derive a duty cycle versus loading with several runs at different loadings. You cannot run a transformer backwards. 120v into a 20v winding will best case blow the fuse, worst...
526,722
### Equation to solve $$ 2x-3-2x^{ -(1/2) }= 0 $$ The answer should be $2.1777$. However I'm not too sure how the steps in between are constructed. Anyone can guide me how do I solve x for this equation? ### Progress One way that I have tried solving this is $$ 2x-3-2x^{ -(1/2) }= 0 $$ $$ 2x-2x^{ -(1/2) }= 3 $$ $$...
2013/10/15
[ "https://math.stackexchange.com/questions/526722", "https://math.stackexchange.com", "https://math.stackexchange.com/users/100930/" ]
**Hint:** * It is not true for directed graphs, that is, there exists a directed graph $G$ and a DFS run and a BFS run such that both trees are the same, but $G$ is not a tree. An example might be a [back-edge](http://en.wikipedia.org/wiki/File%3aTree_edges.svg). * In the case of undirected graphs it still might not b...
Note that it is essential that the trees are rooted trees. If you start with a paw (a triangle with an attached edge, so this certainly is not a tree) the BFS-tree from the vertex with degree 1 is a claw and the DFS-tree from a vertex with degree 2 is also a claw for one of the choices of the second vertex. This sugges...
32,634,024
All of my apps are currently written in Obj-C. The link <https://developer.apple.com/library/content/samplecode/ApplicationShortcuts/Introduction/Intro.html#//apple_ref/doc/uid/TP40016545> for the sample code of implementing Home Screen Shortcuts with 3D Touch is completely compiled in Swift. Anyone come across documen...
2015/09/17
[ "https://Stackoverflow.com/questions/32634024", "https://Stackoverflow.com", "https://Stackoverflow.com/users/717452/" ]
There are two states from where the user can open the app through Quick Actions. **TL;DR** You are always doing the same thing regardless of the state in which the app is when the quick action is done, that's why you only need to override `application:performActionForShortcutItem:completionHandler:` So if you wanted ...
If you look at the sample code provided for apple, you'll see that they suggest that you write a method that handles your shortcut item so that you can handle it in all three places: * `application: performActionForShortcutItem`, * `application: didFinishLaunchingWithOptions` and * `willFinishLaunchingWithOptions` An...
32,634,024
All of my apps are currently written in Obj-C. The link <https://developer.apple.com/library/content/samplecode/ApplicationShortcuts/Introduction/Intro.html#//apple_ref/doc/uid/TP40016545> for the sample code of implementing Home Screen Shortcuts with 3D Touch is completely compiled in Swift. Anyone come across documen...
2015/09/17
[ "https://Stackoverflow.com/questions/32634024", "https://Stackoverflow.com", "https://Stackoverflow.com/users/717452/" ]
There are two states from where the user can open the app through Quick Actions. **TL;DR** You are always doing the same thing regardless of the state in which the app is when the quick action is done, that's why you only need to override `application:performActionForShortcutItem:completionHandler:` So if you wanted ...
I make an objective-c demo project for home screen quick action. [3D touch home quick action demo : https://github.com/dakeshi/3D\_Touch\_HomeQuickAction](https://github.com/dakeshi/3D_Touch_HomeQuickAction) The Demo project implements the static quick action without *Info.plist* file to avoid unwanted situations bef...
32,634,024
All of my apps are currently written in Obj-C. The link <https://developer.apple.com/library/content/samplecode/ApplicationShortcuts/Introduction/Intro.html#//apple_ref/doc/uid/TP40016545> for the sample code of implementing Home Screen Shortcuts with 3D Touch is completely compiled in Swift. Anyone come across documen...
2015/09/17
[ "https://Stackoverflow.com/questions/32634024", "https://Stackoverflow.com", "https://Stackoverflow.com/users/717452/" ]
There are two states from where the user can open the app through Quick Actions. **TL;DR** You are always doing the same thing regardless of the state in which the app is when the quick action is done, that's why you only need to override `application:performActionForShortcutItem:completionHandler:` So if you wanted ...
**Implement below 3 simple steps:** **Step 1 :** Write below method in `AppDelegate` class to Configure dynamic shortcut items. NOTE : You can configure shortcut items in info.plist if you want it static. (Refer [Apple documentation.](https://developer.apple.com/library/content/documentation/UserExperience/Conceptual...
32,634,024
All of my apps are currently written in Obj-C. The link <https://developer.apple.com/library/content/samplecode/ApplicationShortcuts/Introduction/Intro.html#//apple_ref/doc/uid/TP40016545> for the sample code of implementing Home Screen Shortcuts with 3D Touch is completely compiled in Swift. Anyone come across documen...
2015/09/17
[ "https://Stackoverflow.com/questions/32634024", "https://Stackoverflow.com", "https://Stackoverflow.com/users/717452/" ]
There are two states from where the user can open the app through Quick Actions. **TL;DR** You are always doing the same thing regardless of the state in which the app is when the quick action is done, that's why you only need to override `application:performActionForShortcutItem:completionHandler:` So if you wanted ...
**It works on both swift 3 and 4 (only on home screen shortcuts)** ``` //Add plist items as show in image and write following method in Appdelegate //3D Touch Method shortcuts from home screen func application(_ application: UIApplication, performActionFor shortcutItem:UIApplicationShortcutItem, completionHandler: @e...
32,634,024
All of my apps are currently written in Obj-C. The link <https://developer.apple.com/library/content/samplecode/ApplicationShortcuts/Introduction/Intro.html#//apple_ref/doc/uid/TP40016545> for the sample code of implementing Home Screen Shortcuts with 3D Touch is completely compiled in Swift. Anyone come across documen...
2015/09/17
[ "https://Stackoverflow.com/questions/32634024", "https://Stackoverflow.com", "https://Stackoverflow.com/users/717452/" ]
If you look at the sample code provided for apple, you'll see that they suggest that you write a method that handles your shortcut item so that you can handle it in all three places: * `application: performActionForShortcutItem`, * `application: didFinishLaunchingWithOptions` and * `willFinishLaunchingWithOptions` An...
I make an objective-c demo project for home screen quick action. [3D touch home quick action demo : https://github.com/dakeshi/3D\_Touch\_HomeQuickAction](https://github.com/dakeshi/3D_Touch_HomeQuickAction) The Demo project implements the static quick action without *Info.plist* file to avoid unwanted situations bef...
32,634,024
All of my apps are currently written in Obj-C. The link <https://developer.apple.com/library/content/samplecode/ApplicationShortcuts/Introduction/Intro.html#//apple_ref/doc/uid/TP40016545> for the sample code of implementing Home Screen Shortcuts with 3D Touch is completely compiled in Swift. Anyone come across documen...
2015/09/17
[ "https://Stackoverflow.com/questions/32634024", "https://Stackoverflow.com", "https://Stackoverflow.com/users/717452/" ]
If you look at the sample code provided for apple, you'll see that they suggest that you write a method that handles your shortcut item so that you can handle it in all three places: * `application: performActionForShortcutItem`, * `application: didFinishLaunchingWithOptions` and * `willFinishLaunchingWithOptions` An...
**It works on both swift 3 and 4 (only on home screen shortcuts)** ``` //Add plist items as show in image and write following method in Appdelegate //3D Touch Method shortcuts from home screen func application(_ application: UIApplication, performActionFor shortcutItem:UIApplicationShortcutItem, completionHandler: @e...
32,634,024
All of my apps are currently written in Obj-C. The link <https://developer.apple.com/library/content/samplecode/ApplicationShortcuts/Introduction/Intro.html#//apple_ref/doc/uid/TP40016545> for the sample code of implementing Home Screen Shortcuts with 3D Touch is completely compiled in Swift. Anyone come across documen...
2015/09/17
[ "https://Stackoverflow.com/questions/32634024", "https://Stackoverflow.com", "https://Stackoverflow.com/users/717452/" ]
**Implement below 3 simple steps:** **Step 1 :** Write below method in `AppDelegate` class to Configure dynamic shortcut items. NOTE : You can configure shortcut items in info.plist if you want it static. (Refer [Apple documentation.](https://developer.apple.com/library/content/documentation/UserExperience/Conceptual...
I make an objective-c demo project for home screen quick action. [3D touch home quick action demo : https://github.com/dakeshi/3D\_Touch\_HomeQuickAction](https://github.com/dakeshi/3D_Touch_HomeQuickAction) The Demo project implements the static quick action without *Info.plist* file to avoid unwanted situations bef...
32,634,024
All of my apps are currently written in Obj-C. The link <https://developer.apple.com/library/content/samplecode/ApplicationShortcuts/Introduction/Intro.html#//apple_ref/doc/uid/TP40016545> for the sample code of implementing Home Screen Shortcuts with 3D Touch is completely compiled in Swift. Anyone come across documen...
2015/09/17
[ "https://Stackoverflow.com/questions/32634024", "https://Stackoverflow.com", "https://Stackoverflow.com/users/717452/" ]
I make an objective-c demo project for home screen quick action. [3D touch home quick action demo : https://github.com/dakeshi/3D\_Touch\_HomeQuickAction](https://github.com/dakeshi/3D_Touch_HomeQuickAction) The Demo project implements the static quick action without *Info.plist* file to avoid unwanted situations bef...
**It works on both swift 3 and 4 (only on home screen shortcuts)** ``` //Add plist items as show in image and write following method in Appdelegate //3D Touch Method shortcuts from home screen func application(_ application: UIApplication, performActionFor shortcutItem:UIApplicationShortcutItem, completionHandler: @e...
32,634,024
All of my apps are currently written in Obj-C. The link <https://developer.apple.com/library/content/samplecode/ApplicationShortcuts/Introduction/Intro.html#//apple_ref/doc/uid/TP40016545> for the sample code of implementing Home Screen Shortcuts with 3D Touch is completely compiled in Swift. Anyone come across documen...
2015/09/17
[ "https://Stackoverflow.com/questions/32634024", "https://Stackoverflow.com", "https://Stackoverflow.com/users/717452/" ]
**Implement below 3 simple steps:** **Step 1 :** Write below method in `AppDelegate` class to Configure dynamic shortcut items. NOTE : You can configure shortcut items in info.plist if you want it static. (Refer [Apple documentation.](https://developer.apple.com/library/content/documentation/UserExperience/Conceptual...
**It works on both swift 3 and 4 (only on home screen shortcuts)** ``` //Add plist items as show in image and write following method in Appdelegate //3D Touch Method shortcuts from home screen func application(_ application: UIApplication, performActionFor shortcutItem:UIApplicationShortcutItem, completionHandler: @e...
21,781,303
Context: I am playing with Three.js and some *PointLight* [here](http://cdpn.io/yGLKh). After a quick search it seems like for WebGL and OpenGL there is only a small number of light sources allowed (at the same time). It sounds like it would be a common requirement for most of 3d scenes made. Like to show a long stree...
2014/02/14
[ "https://Stackoverflow.com/questions/21781303", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1263612/" ]
This might be OT, but I really think you should not do this. The correct way to do this is to create `CustomDate` class, that is used in your application instead of `DateTime`. If you ensure the application can't accept `DateTime` and that `CustomDate` uses the conversion you want then there is no need to do any kind ...
Using Moq (most mocking frameworks have this feature). ``` // Method should never be called mock.Verify(foo => foo.Execute("ping"), Times.Never()); ``` If you can't mock your method (because is not an interface) you can try using microsoft fakes (moles) to do the work. Simply put an assert.Fail inside the Mole so t...
1,161,725
``` $ script/plugin install git://github.com/rails/exception_notification.git $ ls vendor/plugins/ exception_notification $ cat vendor/plugins/exception_notification/init.rb require "action_mailer" require "exception_notifier" require "exception_notifiable" require "exception_notifier_helper" $ script/console Loadi...
2009/07/21
[ "https://Stackoverflow.com/questions/1161725", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42595/" ]
This blog post has the solution: [How to Install the Exception Notifier Plugin with Ruby on Rails](http://engtech.wordpress.com/2008/02/06/rails-guide-exception-notifier-plugin/) The `ExceptionNotifier.exception_recipients = %w(user@domain)` statement in your environment.rb file is probably inside the `Rails::Initiali...
in environment.rb, after the initialize method add: ``` require 'exception_notification' ```
1,161,725
``` $ script/plugin install git://github.com/rails/exception_notification.git $ ls vendor/plugins/ exception_notification $ cat vendor/plugins/exception_notification/init.rb require "action_mailer" require "exception_notifier" require "exception_notifiable" require "exception_notifier_helper" $ script/console Loadi...
2009/07/21
[ "https://Stackoverflow.com/questions/1161725", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42595/" ]
You should install this plugin from specific branch: ``` script/plugin install git://github.com/rails/exception_notification.git -r "2-3-stable" ``` and [configure it exactly as docs are saying](http://github.com/rails/exception_notification/tree/2-3-stable). or when using Rails Templates (in Your template): ``` p...
in environment.rb, after the initialize method add: ``` require 'exception_notification' ```
1,161,725
``` $ script/plugin install git://github.com/rails/exception_notification.git $ ls vendor/plugins/ exception_notification $ cat vendor/plugins/exception_notification/init.rb require "action_mailer" require "exception_notifier" require "exception_notifiable" require "exception_notifier_helper" $ script/console Loadi...
2009/07/21
[ "https://Stackoverflow.com/questions/1161725", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42595/" ]
For 2.3-stable, you need the following: Use `ExceptionNotification::Notifier` and not `ExceptionNotifier`. And don't forget to add include `ExceptionNotification::Notifiable` in your controllers.
in environment.rb, after the initialize method add: ``` require 'exception_notification' ```
1,161,725
``` $ script/plugin install git://github.com/rails/exception_notification.git $ ls vendor/plugins/ exception_notification $ cat vendor/plugins/exception_notification/init.rb require "action_mailer" require "exception_notifier" require "exception_notifiable" require "exception_notifier_helper" $ script/console Loadi...
2009/07/21
[ "https://Stackoverflow.com/questions/1161725", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42595/" ]
This blog post has the solution: [How to Install the Exception Notifier Plugin with Ruby on Rails](http://engtech.wordpress.com/2008/02/06/rails-guide-exception-notifier-plugin/) The `ExceptionNotifier.exception_recipients = %w(user@domain)` statement in your environment.rb file is probably inside the `Rails::Initiali...
You should install this plugin from specific branch: ``` script/plugin install git://github.com/rails/exception_notification.git -r "2-3-stable" ``` and [configure it exactly as docs are saying](http://github.com/rails/exception_notification/tree/2-3-stable). or when using Rails Templates (in Your template): ``` p...
1,161,725
``` $ script/plugin install git://github.com/rails/exception_notification.git $ ls vendor/plugins/ exception_notification $ cat vendor/plugins/exception_notification/init.rb require "action_mailer" require "exception_notifier" require "exception_notifiable" require "exception_notifier_helper" $ script/console Loadi...
2009/07/21
[ "https://Stackoverflow.com/questions/1161725", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42595/" ]
This blog post has the solution: [How to Install the Exception Notifier Plugin with Ruby on Rails](http://engtech.wordpress.com/2008/02/06/rails-guide-exception-notifier-plugin/) The `ExceptionNotifier.exception_recipients = %w(user@domain)` statement in your environment.rb file is probably inside the `Rails::Initiali...
For 2.3-stable, you need the following: Use `ExceptionNotification::Notifier` and not `ExceptionNotifier`. And don't forget to add include `ExceptionNotification::Notifiable` in your controllers.
1,161,725
``` $ script/plugin install git://github.com/rails/exception_notification.git $ ls vendor/plugins/ exception_notification $ cat vendor/plugins/exception_notification/init.rb require "action_mailer" require "exception_notifier" require "exception_notifiable" require "exception_notifier_helper" $ script/console Loadi...
2009/07/21
[ "https://Stackoverflow.com/questions/1161725", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42595/" ]
For 2.3-stable, you need the following: Use `ExceptionNotification::Notifier` and not `ExceptionNotifier`. And don't forget to add include `ExceptionNotification::Notifiable` in your controllers.
You should install this plugin from specific branch: ``` script/plugin install git://github.com/rails/exception_notification.git -r "2-3-stable" ``` and [configure it exactly as docs are saying](http://github.com/rails/exception_notification/tree/2-3-stable). or when using Rails Templates (in Your template): ``` p...
12,601,791
I'm trying to download, save and show again an image. I'v manage to downolad it and store it to documents directory. So now if i go there with finder i can see those images. Now i'm trying to load it into web view. For that i use these code: ``` [webview loadHTMLString:simpleHtml baseURL:nil]; ``` In my simple html ...
2012/09/26
[ "https://Stackoverflow.com/questions/12601791", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1521122/" ]
you can check this it will be help you. ``` NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; ``` You can then refer to your images like this: or you can refer this link: <http://iphoneincubator.com/blog/window...
``` NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *ImagePath = [documentsDirectory stringByAppendingPathComponent:@"yourimage.png"]; ``` Use the above "ImagePath" in your html string.Instead of using 'loadHTMLString' use the following method of webview ``` [webView loadRequest:[NSURLReques...
12,601,791
I'm trying to download, save and show again an image. I'v manage to downolad it and store it to documents directory. So now if i go there with finder i can see those images. Now i'm trying to load it into web view. For that i use these code: ``` [webview loadHTMLString:simpleHtml baseURL:nil]; ``` In my simple html ...
2012/09/26
[ "https://Stackoverflow.com/questions/12601791", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1521122/" ]
i finally get it to work, however it dons't work with html. I use image data now. ``` NSData *imageData = [NSData dataWithContentsOfFile:image]; [webview loadData:imageData MIMEType:@"image/gif" textEncodingName:nil baseURL:nil]; ``` Now i find out another solution even better: To my original html string i need to a...
``` NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *ImagePath = [documentsDirectory stringByAppendingPathComponent:@"yourimage.png"]; ``` Use the above "ImagePath" in your html string.Instead of using 'loadHTMLString' use the following method of webview ``` [webView loadRequest:[NSURLReques...
1,192,768
What's the best way to detect the language of a string?
2009/07/28
[ "https://Stackoverflow.com/questions/1192768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/140937/" ]
*Fast answer:* [**NTextCat**](https://github.com/ivanakcheurov/ntextcat) ([NuGet](http://www.nuget.org/packages/NTextCat/), [Online Demo](http://ivanakcheurov.github.io/ntextcat/)) *Long answer:* Currently the best way seems to use classifiers **trained** to classify piece of text into one (or more) of languages from...
**CLD3 (Compact Language Detector v3)** library from Google's Chromium browser You could wrap the [CLD3 library](https://github.com/google/cld3), which is written in C++.
1,192,768
What's the best way to detect the language of a string?
2009/07/28
[ "https://Stackoverflow.com/questions/1192768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/140937/" ]
If the context of your code have internet access, you can try to use the Google API for language detection. <http://code.google.com/apis/ajaxlanguage/documentation/> ``` var text = "¿Dónde está el baño?"; google.language.detect(text, function(result) { if (!result.error) { var language = 'unknown'; for (l in...
**CLD3 (Compact Language Detector v3)** library from Google's Chromium browser You could wrap the [CLD3 library](https://github.com/google/cld3), which is written in C++.
1,192,768
What's the best way to detect the language of a string?
2009/07/28
[ "https://Stackoverflow.com/questions/1192768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/140937/" ]
If the context of your code have internet access, you can try to use the Google API for language detection. <http://code.google.com/apis/ajaxlanguage/documentation/> ``` var text = "¿Dónde está el baño?"; google.language.detect(text, function(result) { if (!result.error) { var language = 'unknown'; for (l in...
*Fast answer:* [**NTextCat**](https://github.com/ivanakcheurov/ntextcat) ([NuGet](http://www.nuget.org/packages/NTextCat/), [Online Demo](http://ivanakcheurov.github.io/ntextcat/)) *Long answer:* Currently the best way seems to use classifiers **trained** to classify piece of text into one (or more) of languages from...
1,192,768
What's the best way to detect the language of a string?
2009/07/28
[ "https://Stackoverflow.com/questions/1192768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/140937/" ]
Make a statistical analyses of the string: Split the string into words. Get a dictionary for every language you want to test for. And then find the language that has the highest word count. In C# every string in memory will be unicode, and is not encoded. Also in text files the encoding is not stored. (Sometimes only ...
**CLD3 (Compact Language Detector v3)** library from Google's Chromium browser You could wrap the [CLD3 library](https://github.com/google/cld3), which is written in C++.
1,192,768
What's the best way to detect the language of a string?
2009/07/28
[ "https://Stackoverflow.com/questions/1192768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/140937/" ]
*Fast answer:* [**NTextCat**](https://github.com/ivanakcheurov/ntextcat) ([NuGet](http://www.nuget.org/packages/NTextCat/), [Online Demo](http://ivanakcheurov.github.io/ntextcat/)) *Long answer:* Currently the best way seems to use classifiers **trained** to classify piece of text into one (or more) of languages from...
Make a statistical analyses of the string: Split the string into words. Get a dictionary for every language you want to test for. And then find the language that has the highest word count. In C# every string in memory will be unicode, and is not encoded. Also in text files the encoding is not stored. (Sometimes only ...
1,192,768
What's the best way to detect the language of a string?
2009/07/28
[ "https://Stackoverflow.com/questions/1192768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/140937/" ]
If the context of your code have internet access, you can try to use the Google API for language detection. <http://code.google.com/apis/ajaxlanguage/documentation/> ``` var text = "¿Dónde está el baño?"; google.language.detect(text, function(result) { if (!result.error) { var language = 'unknown'; for (l in...
We can use `Regex.IsMatch(text, "[\\uxxxx-\\uxxxx]+")` to detect an specific language. Here xxxx is the 4 digit Unicode id of a character. To detect Arabic: ``` bool isArabic = Regex.IsMatch(yourtext, @"[\u0600-\u06FF]+") ```
1,192,768
What's the best way to detect the language of a string?
2009/07/28
[ "https://Stackoverflow.com/questions/1192768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/140937/" ]
A statistical approach using digraphs or trigraphs is a very good indicator. For example, here are the most common digraphs in English in order: <http://www.letterfrequency.org/#digraph-frequency> (one can find better or more complete lists). This method may have a better success rate than word analysis for short snipp...
One alternative is to use '[Translator Text API](https://learn.microsoft.com/en-us/azure/cognitive-services/translator/translator-info-overview)' which is > > ... part of the Azure Cognitive Services API collection of machine > learning and AI algorithms in the cloud, and is readily consumable in > your development...
1,192,768
What's the best way to detect the language of a string?
2009/07/28
[ "https://Stackoverflow.com/questions/1192768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/140937/" ]
Make a statistical analyses of the string: Split the string into words. Get a dictionary for every language you want to test for. And then find the language that has the highest word count. In C# every string in memory will be unicode, and is not encoded. Also in text files the encoding is not stored. (Sometimes only ...
You may use the [C# package for language identification](http://research.microsoft.com/en-us/downloads/5a84b263-41d6-4ce1-a186-8e3f76efe2e5/) from Microsoft Research: > > This package implements several algorithms for language > identification, and includes two sets of pre-compiled language > profiles. One set cove...
1,192,768
What's the best way to detect the language of a string?
2009/07/28
[ "https://Stackoverflow.com/questions/1192768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/140937/" ]
A statistical approach using digraphs or trigraphs is a very good indicator. For example, here are the most common digraphs in English in order: <http://www.letterfrequency.org/#digraph-frequency> (one can find better or more complete lists). This method may have a better success rate than word analysis for short snipp...
You may use the [C# package for language identification](http://research.microsoft.com/en-us/downloads/5a84b263-41d6-4ce1-a186-8e3f76efe2e5/) from Microsoft Research: > > This package implements several algorithms for language > identification, and includes two sets of pre-compiled language > profiles. One set cove...