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 |
|---|---|---|---|---|---|
23,638,599 | I need some help, this is bothering me...
I have the following DIV structure:
```
<div id="principal">
<div id="colIzquierda">Some Content</div>
<div id="colDerecha">Some Content</div>
</div>
```
And the following CSS code to style it:
```
body, html {
height:100%;
margin:0px;
padding:0px; }
... | 2014/05/13 | [
"https://Stackoverflow.com/questions/23638599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1591005/"
] | By calling `dispatch_async`, you're scheduling that work to happen later. Your function exits with nil before that work is done. You'll want to add a callback block to your function or make it block until you receive and process the image data.
Here is an example of a function with a block callback and how to use it.
... | The call to dataWithContentsOfURL:options:error: needs to be within the dispatch\_queue block for it to be asynchronous. Any changes to the UI need to be in the mainThread. It should look something like this:
```
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul);
dispatch_as... |
23,638,599 | I need some help, this is bothering me...
I have the following DIV structure:
```
<div id="principal">
<div id="colIzquierda">Some Content</div>
<div id="colDerecha">Some Content</div>
</div>
```
And the following CSS code to style it:
```
body, html {
height:100%;
margin:0px;
padding:0px; }
... | 2014/05/13 | [
"https://Stackoverflow.com/questions/23638599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1591005/"
] | By calling `dispatch_async`, you're scheduling that work to happen later. Your function exits with nil before that work is done. You'll want to add a callback block to your function or make it block until you receive and process the image data.
Here is an example of a function with a block callback and how to use it.
... | You are not downloading the image asynchronously. Moreover, a method that is supposed to return a value in an async way cannot return that value through the method return value, but it should return it using a block.
You can try to do something like this:
```
- (void)downloadImage:(NSString *)imageURL onComplete:(vo... |
23,638,599 | I need some help, this is bothering me...
I have the following DIV structure:
```
<div id="principal">
<div id="colIzquierda">Some Content</div>
<div id="colDerecha">Some Content</div>
</div>
```
And the following CSS code to style it:
```
body, html {
height:100%;
margin:0px;
padding:0px; }
... | 2014/05/13 | [
"https://Stackoverflow.com/questions/23638599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1591005/"
] | The call to dataWithContentsOfURL:options:error: needs to be within the dispatch\_queue block for it to be asynchronous. Any changes to the UI need to be in the mainThread. It should look something like this:
```
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul);
dispatch_as... | You are not downloading the image asynchronously. Moreover, a method that is supposed to return a value in an async way cannot return that value through the method return value, but it should return it using a block.
You can try to do something like this:
```
- (void)downloadImage:(NSString *)imageURL onComplete:(vo... |
30,098,061 | Out there, there are a lot of examples about how to play video on Android (API level 16).
But I can't understand why they don't work for me.
This is a simple example:
AndroidManifest.xml
```
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="my.owm.pa... | 2015/05/07 | [
"https://Stackoverflow.com/questions/30098061",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/881712/"
] | I worked on this way :
```
public class AnVideoView extends Activity {
String SrcPath = "/sdcard/Video/Android in Spaaaaaace!_low.mp4";
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.ma... | I also have come across issues with `VideoView` like this across multiple devices before.
Firstly I would consider re-encoding your videos using a tool such as `ffmpeg` that can be downloaded [here](https://www.ffmpeg.org/).
The following encoding has always worked for me:
```
ffmpeg -i input.mp4 -c:v libx264 -profi... |
30,098,061 | Out there, there are a lot of examples about how to play video on Android (API level 16).
But I can't understand why they don't work for me.
This is a simple example:
AndroidManifest.xml
```
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="my.owm.pa... | 2015/05/07 | [
"https://Stackoverflow.com/questions/30098061",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/881712/"
] | I worked on this way :
```
public class AnVideoView extends Activity {
String SrcPath = "/sdcard/Video/Android in Spaaaaaace!_low.mp4";
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.ma... | SOLVED: the DrawerLayout should be added at the END of the layout... it seems the order is important! |
141,716 | HI hope y'all doing well
I have an app where users need to create different items.
There's a page that displays all the items created that as a "*Create new...*" button.
---
The user's path:
1. User goes to the "all items" page.
2. Clicks on "*Create new...*" button.
3. Complete a form.
4. Click save.
5. ...
---
... | 2021/11/30 | [
"https://ux.stackexchange.com/questions/141716",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/153248/"
] | It depends on what will likely happen next. If the user will want to keep working on the newly added item (let's say they're writing an article, and want to keep editing a draft), they'll stay on the Newly Added Item page. If they're more likely to want to add more new items, they should be taken back to the All Items ... | @Izquierdo's answer is quite reasonable. But if you still not sure what user prefer to do after entering data into the form let him decide himself by adding one more action button:
`SAVE` `SAVE AND EDIT` `CANCEL` |
141,716 | HI hope y'all doing well
I have an app where users need to create different items.
There's a page that displays all the items created that as a "*Create new...*" button.
---
The user's path:
1. User goes to the "all items" page.
2. Clicks on "*Create new...*" button.
3. Complete a form.
4. Click save.
5. ...
---
... | 2021/11/30 | [
"https://ux.stackexchange.com/questions/141716",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/153248/"
] | It depends on what will likely happen next. If the user will want to keep working on the newly added item (let's say they're writing an article, and want to keep editing a draft), they'll stay on the Newly Added Item page. If they're more likely to want to add more new items, they should be taken back to the All Items ... | I'd go with something succinct. Probably like the following:
`Save | +` `X`
Here, `Save` part is for saving and going back to whatever would be more natural for specific case. Say, in you case it could be the same list of items, if there are actions other than just creating new items.
The vertical bar `|` part is no... |
141,716 | HI hope y'all doing well
I have an app where users need to create different items.
There's a page that displays all the items created that as a "*Create new...*" button.
---
The user's path:
1. User goes to the "all items" page.
2. Clicks on "*Create new...*" button.
3. Complete a form.
4. Click save.
5. ...
---
... | 2021/11/30 | [
"https://ux.stackexchange.com/questions/141716",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/153248/"
] | @Izquierdo's answer is quite reasonable. But if you still not sure what user prefer to do after entering data into the form let him decide himself by adding one more action button:
`SAVE` `SAVE AND EDIT` `CANCEL` | I'd go with something succinct. Probably like the following:
`Save | +` `X`
Here, `Save` part is for saving and going back to whatever would be more natural for specific case. Say, in you case it could be the same list of items, if there are actions other than just creating new items.
The vertical bar `|` part is no... |
67,399,493 | This is the streamlit code that im currently working on it.
when i click the button "About Python" It is working fine and Showing "Generate Syntax" Button. But then when i click on the "Generate Syntax" button it is not showing anything and my program is running from the first again. Please help.
```
left, center, rig... | 2021/05/05 | [
"https://Stackoverflow.com/questions/67399493",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15049957/"
] | This can be seen quite often in [Streamlit discussions](https://discuss.streamlit.io/t/the-button-inside-a-button-seems-to-reset-the-whole-app-why/1051) because it looks like a bug at the first glance, but it's not. A simple and silly answer would be "That's the way streamlit is designed".
So every time you press th... | When you click `About Python`:
* the value of `left_one` becomes `True`
* the value of all other buttons (including `generate_syntax`) becomes `False`
When you click `Generate Syntax`:
* the value of `generate_syntax` becomes `True`
* the value of `left_one` becomes `False`
The issue is that you never meet both con... |
43,035,156 | I am looking for examples of the java code used to make a call to an AWS API Gateway.
I can make the call to an AWS API gateway that dose not require IAM verification but I am finding it very difficult to find a clear example of how to structure a URL.
How do you pass in the Secret key and Secret Key ID appropriate... | 2017/03/26 | [
"https://Stackoverflow.com/questions/43035156",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4757571/"
] | ```
You should sign your request and credentials as per AWS Signature V4.
```
Sample code to sign is available @
<https://s3.amazonaws.com/aws-java-sdk/samples/AWSS3SigV4JavaSamples.jar>
```
Sample code :
URL url = new URL("https://XXXXXXX.execute-api.us-west-2.amazonaws.com/dev/pets");
HttpURLConnection ... | You should be able to initial the SDK client with credential and pass in a credential provider, like,
```
BasicAWSCredentials awsCreds = new BasicAWSCredentials("access_key_id", "secret_key_id");
SimpleCalcSdk sdkClient = SimpleCalcSdk.builder()
.withCredentials(awsCreds)
... |
47,244,357 | I am learning the sql server 2012 and got stuck when using the copy datase, trying to figure out why.
I created two instances on the same host, using administrator, windows authentication.
(the default instance:iZp0w14yqtvxcmZ, the second instance: iZp0w14yqtvxcmZ\instance2, try to copy database from the default one ... | 2017/11/12 | [
"https://Stackoverflow.com/questions/47244357",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7357672/"
] | after two-day's struggling, I figured it out. The sql server agent service should use a domain-based account for a multi-server environment. Also that account should be able to log in and perform the job. | Two instances must have the same password and open, then in this case:
>
> insert into [EI7-PC\SQLEXPRESS2].[MYCOMPANY].[dbo].[inventory] SELECT \*
> FROM [EI7-PC\SQLEXPRESS1].[MYCOMPANY].[dbo].[inventory] where itemno='10-0001'
>
>
>
The reason for the same password is unknown, this is per my experience. With t... |
47,244,357 | I am learning the sql server 2012 and got stuck when using the copy datase, trying to figure out why.
I created two instances on the same host, using administrator, windows authentication.
(the default instance:iZp0w14yqtvxcmZ, the second instance: iZp0w14yqtvxcmZ\instance2, try to copy database from the default one ... | 2017/11/12 | [
"https://Stackoverflow.com/questions/47244357",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7357672/"
] | after two-day's struggling, I figured it out. The sql server agent service should use a domain-based account for a multi-server environment. Also that account should be able to log in and perform the job. | I solved the issue changing the login method to system local account.
[](https://i.stack.imgur.com/vem1r.png) |
47,244,357 | I am learning the sql server 2012 and got stuck when using the copy datase, trying to figure out why.
I created two instances on the same host, using administrator, windows authentication.
(the default instance:iZp0w14yqtvxcmZ, the second instance: iZp0w14yqtvxcmZ\instance2, try to copy database from the default one ... | 2017/11/12 | [
"https://Stackoverflow.com/questions/47244357",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7357672/"
] | I solved the issue changing the login method to system local account.
[](https://i.stack.imgur.com/vem1r.png) | Two instances must have the same password and open, then in this case:
>
> insert into [EI7-PC\SQLEXPRESS2].[MYCOMPANY].[dbo].[inventory] SELECT \*
> FROM [EI7-PC\SQLEXPRESS1].[MYCOMPANY].[dbo].[inventory] where itemno='10-0001'
>
>
>
The reason for the same password is unknown, this is per my experience. With t... |
11,244,397 | This is the code which is being used to display overlay using Jquery colorbox plugin
```
function inlineLightbox(h) {
jQuery.colorbox({
opacity: 0.6,
inline: true,
href: h,
onOpen: function() {
jQuery('#colorbox').addClass('inline');
},
onComplete: functi... | 2012/06/28 | [
"https://Stackoverflow.com/questions/11244397",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/471607/"
] | That code looks fine to me. I believe your problem is being caused by something that was not included in your post.
Have you checked your JavaScript console for errors?
Are you absolutely sure that your selector ('#colorbox a.close, #colorbox a.btn-close') is matching the link elements you are clicking on? | first thing your are defining inlineLightbox() function
and you are calling somthing else function inlineSigninLightbox('#popup-password-update-confirm');
and to prevent from reload or other event bubbling after clicking close button you can use this
```
$(document).bind('cbox_complete', function(event){
event.... |
24,652,378 | Here is the HTML code:
```
<input id="700690188" class="default_shipping_address"
type="radio" name="address" checked="true">
```
and i am trying with below code:
```
if(driver.findElement(By.id("700700139")).isSelected()){
System.out.println(driver.findElement(
By.xpath("//input[@id='700700139']/following-sib... | 2014/07/09 | [
"https://Stackoverflow.com/questions/24652378",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3538483/"
] | You are using a different id than the one on the page. You say the page shows an element with id 700690188 but you are querying for 700700139 | Depending on the version/type of control will depend on the usage of the .isSelected If your `input` element is not working with the .isSelected for some reason...it should..., then you can check the attribute `@checked` for true or false. Personally I would pare these together in a function and call it to return a tru... |
35,188,205 | I am getting the following error for grunt, yeoman and bower:
```
Drews-iMac:~ drewjocham$ npm install -g grunt-cli
npm ERR! tar.unpack untar error /Users/drewjocham/.npm/grunt-cli/0.1.13/package.tgz
npm ERR! Darwin 15.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "grunt-cli"
npm ERR! node v0.12.2
npm E... | 2016/02/03 | [
"https://Stackoverflow.com/questions/35188205",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4753897/"
] | You should try "sudo npm install ...":
```
sudo npm install -g grunt-cli
```
It seems to be a permission issue during installation. | Have a look at the NPM "fixing permissions" documentation page (there's even a video!): <https://docs.npmjs.com/getting-started/fixing-npm-permissions> |
53,292,720 | I want gitignore a file that is already committed and pushed to master;
Meaning, I want to ignore any change of that file.
But after I add the path in gitignore, it is still included in commit and pushed when I use
```
git add .
```
how do I ignore such file ? | 2018/11/14 | [
"https://Stackoverflow.com/questions/53292720",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5572627/"
] | You cannot. Once the file is in Git repo it is in the Git repo. You have to remove the file from Git repo in order for .gitignore to kick in and start ignoring the file.
It is pretty simple - it is either the file is in repo and tracked. Or the file is not in the repo and not tracked.
.gitignore helps with the second... | 1. If you want the file to be removed altogether, you can delete the file locally, commit and push to master.
Remember, gitignore will only work for files, not yet pushed to remote. If already pushed to remote then, it will not work.
>
> A gitignore file specifies intentionally untracked files that Git
> should igno... |
148,831 | Is it considered bad practice (and how bad) to run different JavaScript for IE? Currently im writing some JavaScript and the simplist way to work arround IE quirks seems to be to check for browser version and run different code
```
var browserName = navigator.appName;
if (browserName == "Microsoft Internet Explorer")... | 2012/05/16 | [
"https://softwareengineering.stackexchange.com/questions/148831",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/29270/"
] | Yes
---
Inferring functionality from a user agent string is a weak and error-prone test. Though relatively common, in this day and age I would say it is certainly considered a bad practice.
For example [jquery](http://api.jquery.com/jQuery.browser/) has a function for detecting which browser a user is using and it's ... | Use the IE specific comments `<!--[if IE > 6]>...` or something like that. Works on all super crappy browsers IE? -> IE8, but not on IE9+ which is considered sort of ok as a browser.
The bottom line, once you deal with super crappy browser that needs workarounds, it's ok to do whatever is necessary, but avoiding tu... |
148,831 | Is it considered bad practice (and how bad) to run different JavaScript for IE? Currently im writing some JavaScript and the simplist way to work arround IE quirks seems to be to check for browser version and run different code
```
var browserName = navigator.appName;
if (browserName == "Microsoft Internet Explorer")... | 2012/05/16 | [
"https://softwareengineering.stackexchange.com/questions/148831",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/29270/"
] | **It’s ok when it’s valid JS and there are no abstractions**
It's not exactly bad practice, even though it got better, browsers aren’t 100% identic.
But, before starting special cases, look carefully, if they are really special cases and not just idiosyncracies of another browser. In this case, you should search for ... | I think it is better to defer this kind of decision-making to the framework designer, and use one JavaScript framework that encapsulates this kind of complexity. Nowadays we have AngularJS, JQuery, ReactJS, and so on, doing things without a framework would get you this kind of difficulties. |
148,831 | Is it considered bad practice (and how bad) to run different JavaScript for IE? Currently im writing some JavaScript and the simplist way to work arround IE quirks seems to be to check for browser version and run different code
```
var browserName = navigator.appName;
if (browserName == "Microsoft Internet Explorer")... | 2012/05/16 | [
"https://softwareengineering.stackexchange.com/questions/148831",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/29270/"
] | If by "do some stuff" you mean "use IE specific facility x" and by "do some other stuff" you mean "use more common facility y", then it is better practice to just check for the presence of x or y.
I'm guessing that you are currently not using any external Javascript library. In that case, I would check to see if jQuer... | Well, assuming you're actually interested in learning JavaScript, the best practice is this: Prefer testing by absence/existence of methods and write normalizing functions. So a totally lame example but it hits three principles:
```
if(!document.getElementsByClassName){
document.getByClass = function(){ //look at ... |
148,831 | Is it considered bad practice (and how bad) to run different JavaScript for IE? Currently im writing some JavaScript and the simplist way to work arround IE quirks seems to be to check for browser version and run different code
```
var browserName = navigator.appName;
if (browserName == "Microsoft Internet Explorer")... | 2012/05/16 | [
"https://softwareengineering.stackexchange.com/questions/148831",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/29270/"
] | Yes
---
Inferring functionality from a user agent string is a weak and error-prone test. Though relatively common, in this day and age I would say it is certainly considered a bad practice.
For example [jquery](http://api.jquery.com/jQuery.browser/) has a function for detecting which browser a user is using and it's ... | If by "do some stuff" you mean "use IE specific facility x" and by "do some other stuff" you mean "use more common facility y", then it is better practice to just check for the presence of x or y.
I'm guessing that you are currently not using any external Javascript library. In that case, I would check to see if jQuer... |
148,831 | Is it considered bad practice (and how bad) to run different JavaScript for IE? Currently im writing some JavaScript and the simplist way to work arround IE quirks seems to be to check for browser version and run different code
```
var browserName = navigator.appName;
if (browserName == "Microsoft Internet Explorer")... | 2012/05/16 | [
"https://softwareengineering.stackexchange.com/questions/148831",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/29270/"
] | If by "do some stuff" you mean "use IE specific facility x" and by "do some other stuff" you mean "use more common facility y", then it is better practice to just check for the presence of x or y.
I'm guessing that you are currently not using any external Javascript library. In that case, I would check to see if jQuer... | Use the IE specific comments `<!--[if IE > 6]>...` or something like that. Works on all super crappy browsers IE? -> IE8, but not on IE9+ which is considered sort of ok as a browser.
The bottom line, once you deal with super crappy browser that needs workarounds, it's ok to do whatever is necessary, but avoiding tu... |
148,831 | Is it considered bad practice (and how bad) to run different JavaScript for IE? Currently im writing some JavaScript and the simplist way to work arround IE quirks seems to be to check for browser version and run different code
```
var browserName = navigator.appName;
if (browserName == "Microsoft Internet Explorer")... | 2012/05/16 | [
"https://softwareengineering.stackexchange.com/questions/148831",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/29270/"
] | Use the IE specific comments `<!--[if IE > 6]>...` or something like that. Works on all super crappy browsers IE? -> IE8, but not on IE9+ which is considered sort of ok as a browser.
The bottom line, once you deal with super crappy browser that needs workarounds, it's ok to do whatever is necessary, but avoiding tu... | Well, assuming you're actually interested in learning JavaScript, the best practice is this: Prefer testing by absence/existence of methods and write normalizing functions. So a totally lame example but it hits three principles:
```
if(!document.getElementsByClassName){
document.getByClass = function(){ //look at ... |
148,831 | Is it considered bad practice (and how bad) to run different JavaScript for IE? Currently im writing some JavaScript and the simplist way to work arround IE quirks seems to be to check for browser version and run different code
```
var browserName = navigator.appName;
if (browserName == "Microsoft Internet Explorer")... | 2012/05/16 | [
"https://softwareengineering.stackexchange.com/questions/148831",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/29270/"
] | Yes
---
Inferring functionality from a user agent string is a weak and error-prone test. Though relatively common, in this day and age I would say it is certainly considered a bad practice.
For example [jquery](http://api.jquery.com/jQuery.browser/) has a function for detecting which browser a user is using and it's ... | **It’s ok when it’s valid JS and there are no abstractions**
It's not exactly bad practice, even though it got better, browsers aren’t 100% identic.
But, before starting special cases, look carefully, if they are really special cases and not just idiosyncracies of another browser. In this case, you should search for ... |
148,831 | Is it considered bad practice (and how bad) to run different JavaScript for IE? Currently im writing some JavaScript and the simplist way to work arround IE quirks seems to be to check for browser version and run different code
```
var browserName = navigator.appName;
if (browserName == "Microsoft Internet Explorer")... | 2012/05/16 | [
"https://softwareengineering.stackexchange.com/questions/148831",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/29270/"
] | If by "do some stuff" you mean "use IE specific facility x" and by "do some other stuff" you mean "use more common facility y", then it is better practice to just check for the presence of x or y.
I'm guessing that you are currently not using any external Javascript library. In that case, I would check to see if jQuer... | I think it is better to defer this kind of decision-making to the framework designer, and use one JavaScript framework that encapsulates this kind of complexity. Nowadays we have AngularJS, JQuery, ReactJS, and so on, doing things without a framework would get you this kind of difficulties. |
148,831 | Is it considered bad practice (and how bad) to run different JavaScript for IE? Currently im writing some JavaScript and the simplist way to work arround IE quirks seems to be to check for browser version and run different code
```
var browserName = navigator.appName;
if (browserName == "Microsoft Internet Explorer")... | 2012/05/16 | [
"https://softwareengineering.stackexchange.com/questions/148831",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/29270/"
] | **It’s ok when it’s valid JS and there are no abstractions**
It's not exactly bad practice, even though it got better, browsers aren’t 100% identic.
But, before starting special cases, look carefully, if they are really special cases and not just idiosyncracies of another browser. In this case, you should search for ... | Use the IE specific comments `<!--[if IE > 6]>...` or something like that. Works on all super crappy browsers IE? -> IE8, but not on IE9+ which is considered sort of ok as a browser.
The bottom line, once you deal with super crappy browser that needs workarounds, it's ok to do whatever is necessary, but avoiding tu... |
148,831 | Is it considered bad practice (and how bad) to run different JavaScript for IE? Currently im writing some JavaScript and the simplist way to work arround IE quirks seems to be to check for browser version and run different code
```
var browserName = navigator.appName;
if (browserName == "Microsoft Internet Explorer")... | 2012/05/16 | [
"https://softwareengineering.stackexchange.com/questions/148831",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/29270/"
] | Use the IE specific comments `<!--[if IE > 6]>...` or something like that. Works on all super crappy browsers IE? -> IE8, but not on IE9+ which is considered sort of ok as a browser.
The bottom line, once you deal with super crappy browser that needs workarounds, it's ok to do whatever is necessary, but avoiding tu... | I think it is better to defer this kind of decision-making to the framework designer, and use one JavaScript framework that encapsulates this kind of complexity. Nowadays we have AngularJS, JQuery, ReactJS, and so on, doing things without a framework would get you this kind of difficulties. |
35,942,452 | I'm struggling with making a navigation keyboard-accessible, so that the user can `Tab` through the links. The problem is with popups that will be shown next to a menu item once it is focused or hovered. Here's a minimal working example:
```css
a.help {
/* don't show help until explicitly triggered */
displa... | 2016/03/11 | [
"https://Stackoverflow.com/questions/35942452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/334761/"
] | I just saw how they do stuff like this in the YAML CSS framework. They don't mess with `display` (or `visibility`, for that matter) and just move the element out of the viewport:
```css
a.help {
/* don't show help until explicitly triggered */
position: relative;
left: -32768px;
}
li:hover + a.help, a... | Use "tabindex" attribute:
```css
a.help {
/* don't show help until explicitly triggered */
display: none;
}
li:hover + a.help, a:focus + a.help {
/* show help button when user is about to interact with the original button */
display: inline;
}
a.help:focus, a.help:hover, a.help:active {
/*... |
35,942,452 | I'm struggling with making a navigation keyboard-accessible, so that the user can `Tab` through the links. The problem is with popups that will be shown next to a menu item once it is focused or hovered. Here's a minimal working example:
```css
a.help {
/* don't show help until explicitly triggered */
displa... | 2016/03/11 | [
"https://Stackoverflow.com/questions/35942452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/334761/"
] | You can use negative `tabindex` attribute in order to move element out of `Tab` scope:
```html
<h3>Actions</h3>
<ul>
<li><a href="#" tabindex="1">Edit</a> <a tabindex="-1" href="#">(Help)</a></li>
<li><a href="#" tabindex="2">Delete</a> <a tabindex="-1" href="#">(Help)</a></li>
<li><a href="#" tabindex... | Use "tabindex" attribute:
```css
a.help {
/* don't show help until explicitly triggered */
display: none;
}
li:hover + a.help, a:focus + a.help {
/* show help button when user is about to interact with the original button */
display: inline;
}
a.help:focus, a.help:hover, a.help:active {
/*... |
35,942,452 | I'm struggling with making a navigation keyboard-accessible, so that the user can `Tab` through the links. The problem is with popups that will be shown next to a menu item once it is focused or hovered. Here's a minimal working example:
```css
a.help {
/* don't show help until explicitly triggered */
displa... | 2016/03/11 | [
"https://Stackoverflow.com/questions/35942452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/334761/"
] | I just saw how they do stuff like this in the YAML CSS framework. They don't mess with `display` (or `visibility`, for that matter) and just move the element out of the viewport:
```css
a.help {
/* don't show help until explicitly triggered */
position: relative;
left: -32768px;
}
li:hover + a.help, a... | You can use negative `tabindex` attribute in order to move element out of `Tab` scope:
```html
<h3>Actions</h3>
<ul>
<li><a href="#" tabindex="1">Edit</a> <a tabindex="-1" href="#">(Help)</a></li>
<li><a href="#" tabindex="2">Delete</a> <a tabindex="-1" href="#">(Help)</a></li>
<li><a href="#" tabindex... |
8,463,430 | I have the following query which should show result for the last 3 months:
```
SELECT COUNT(DISTINCT dbo.UserQuiz.QuizID) AS [Total Number of Quizzes],
dbo.Divisions.DivisionName,
DATENAME(Month, dbo.UserQuiz.DateTimeComplete) AS Month
FROM dbo.UserQuiz
INNER JOIN dbo.Quiz
ON dbo.UserQuiz.QuizID = dbo.Quiz... | 2011/12/11 | [
"https://Stackoverflow.com/questions/8463430",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/914849/"
] | You need an end parenthesis after the 3.
```
SELECT
COUNT(DISTINCT dbo.UserQuiz.QuizID) AS [Total Number of Quizzes],
dbo.Divisions.DivisionName,
DATENAME(Month, dbo.UserQuiz.DateTimeComplete) AS Month
FROM dbo.UserQuiz
INNER JOIN dbo.Quiz
ON dbo.UserQuiz.QuizID = dbo.Quiz.QuizID
INNER JO... | I believe you miss a ')' in you having somewhere.
```
HAVING (DATENAME(Month, GETDATE()) - DATENAME(Month, dbo.UserQuiz.DateTimeComplete) > 3
``` |
23,520,599 | I have two projects: 1 is a WCF web service and 1 is a Windows Service.
In the global of my web service I call a method which will send a email to me when I start the web service.
```
protected void Application_Start(object sender, EventArgs e)
{
MailService mailService = new MailService();
ma... | 2014/05/07 | [
"https://Stackoverflow.com/questions/23520599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2867416/"
] | The webservice isn't actually started before a request is made hence you get the email when the watchdog makes the request. See [ASP.NET Page Life Cycle](http://msdn.microsoft.com/en-us/library/ms178472%28v=vs.85%29.aspx).
The solution I'd go for is to NOT have the webservice email when it starts but instead have the ... | I have made a very good solution with help from @Sani Huttunen
In my Windows Service:
```
public partial class NotificationStarter : ServiceBase
{
protected override void OnStart(string[] args)
{
WebserviceController webserviceController = new WebserviceController();
webserviceController.FillW... |
52,689,010 | My pandas Data frame df could produce result as below:
```
grouped = df[(df['X'] == 'venture') & (df['company_code'].isin(['TDS','XYZ','UVW']))].groupby(['company_code','sector'])['X_sector'].count()
```
The output of this is as follows:
```
company_code sector
TDS Meta ... | 2018/10/07 | [
"https://Stackoverflow.com/questions/52689010",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5889530/"
] | You will have to chain a groupby here. Consider this example:
```
import pandas as pd
import numpy as np
np.random.seed(111)
names = [
'Robert Baratheon',
'Jon Snow',
'Daenerys Targaryen',
'Theon Greyjoy',
'Tyrion Lannister'
]
df = pd.DataFrame({
'season': np.random.randint(1, 7, size=100),
... | Why would you want things to be complicated, when there are simple codes possible:
```
Z = df.groupby('country_code')['sector'].value_counts().groupby(level=0).head(3).sort_values(ascending=False).to_frame('counts').reset_index()
Z
``` |
68,416,020 | Sometimes, frameworks make things more complicated instead of simplifying them. I would like to serialize a join like this one
```
queryset = Cities.objects.raw("SELECT 1 as id, cities.name as ci, states.name as s, countries.name as co FROM cities JOIN states ON states.id = cities.state_id LEFT OUTER JOIN countries ON... | 2021/07/16 | [
"https://Stackoverflow.com/questions/68416020",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14324456/"
] | The DRF provides generic views to serialize a collection of objects using a particular model. Let's say you have a model called `City` like this:
```
from django.db import models
class City(models.Model):
name = models.CharField()
state = models.CharField()
country = models.CharField()
```
And a seriali... | I found a solution, I don't know if it's the best solution but it worked for me and I would like to share it. If someone find a better way to do this, you are welcome to suggest changes.
My model:
```
""" The following 3 models deal with tables that already exist in the database """
class Countries(models.Model):
... |
446,186 | I want to solve the standard problem of a cylinder rolling down an inclined plane by only using conservation laws. In particular I want to use the equation:
$$E\_{pot}=\frac{1}{2}mv^2+\frac{1}{2}I\omega ^2$$
where $m$ is the mass of the cylinder, $v$ the velocity of translation and $\omega$ the angular velocity. The ... | 2018/12/09 | [
"https://physics.stackexchange.com/questions/446186",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/208011/"
] | If you take your answer and differentiate
$$2v v'={4g\over 3}h'$$
Of course $v'=a$ is the acceleration (I am using the apex to indicate differentiation) , but now you have the problem of.. what is $h'$?
If you call $h$ the height of the incline it does not make sense to differentiate (it would be $0$) it and the for... | If we assume constant acceleration, then use the motion equation
$$s=s\_0+\frac12 (v\_0+v)t\,, $$
where presumably $s\_0=0$ and $v\_0=0$. The acceleration is then the simple fraction of velocity change over duration,
$$a=\frac{dv}{dt}=\frac{v-v\_0} t\,.$$
The distance $s$ is the length of the slope. You'll have to... |
446,186 | I want to solve the standard problem of a cylinder rolling down an inclined plane by only using conservation laws. In particular I want to use the equation:
$$E\_{pot}=\frac{1}{2}mv^2+\frac{1}{2}I\omega ^2$$
where $m$ is the mass of the cylinder, $v$ the velocity of translation and $\omega$ the angular velocity. The ... | 2018/12/09 | [
"https://physics.stackexchange.com/questions/446186",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/208011/"
] | If you take your answer and differentiate
$$2v v'={4g\over 3}h'$$
Of course $v'=a$ is the acceleration (I am using the apex to indicate differentiation) , but now you have the problem of.. what is $h'$?
If you call $h$ the height of the incline it does not make sense to differentiate (it would be $0$) it and the for... | Once you have $v^2\_{\rm final}= \frac{4gh}{3} $ you can use the constant acceleration kinematic equation $$v^2\_{\rm final} =v^2\_{\rm initial} + 2\, a \,s$$ with $v\_{\rm initial} = 0$ and $h = s\,\sin \alpha$.
That kinematic equation is just the conservation of energy "in disguise" $$\frac 12 m v^2\_{\rm final} -\... |
446,186 | I want to solve the standard problem of a cylinder rolling down an inclined plane by only using conservation laws. In particular I want to use the equation:
$$E\_{pot}=\frac{1}{2}mv^2+\frac{1}{2}I\omega ^2$$
where $m$ is the mass of the cylinder, $v$ the velocity of translation and $\omega$ the angular velocity. The ... | 2018/12/09 | [
"https://physics.stackexchange.com/questions/446186",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/208011/"
] | If you take your answer and differentiate
$$2v v'={4g\over 3}h'$$
Of course $v'=a$ is the acceleration (I am using the apex to indicate differentiation) , but now you have the problem of.. what is $h'$?
If you call $h$ the height of the incline it does not make sense to differentiate (it would be $0$) it and the for... | This is a one-dimensional problem, so the simplest solution is as follows: Using
$$h = x\sin{\theta}$$
where $x$ is distance along the surface of the $\theta$-inclined plane, you have:
$$ mgx\sin{\theta} =\frac 3 4 m\dot x^2$$
so if you set:
$$ g' = \frac 2 3 g\sin{\theta} $$
then:
$$ U = mg'x = \frac 1 2 m \do... |
446,186 | I want to solve the standard problem of a cylinder rolling down an inclined plane by only using conservation laws. In particular I want to use the equation:
$$E\_{pot}=\frac{1}{2}mv^2+\frac{1}{2}I\omega ^2$$
where $m$ is the mass of the cylinder, $v$ the velocity of translation and $\omega$ the angular velocity. The ... | 2018/12/09 | [
"https://physics.stackexchange.com/questions/446186",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/208011/"
] | If we assume constant acceleration, then use the motion equation
$$s=s\_0+\frac12 (v\_0+v)t\,, $$
where presumably $s\_0=0$ and $v\_0=0$. The acceleration is then the simple fraction of velocity change over duration,
$$a=\frac{dv}{dt}=\frac{v-v\_0} t\,.$$
The distance $s$ is the length of the slope. You'll have to... | This is a one-dimensional problem, so the simplest solution is as follows: Using
$$h = x\sin{\theta}$$
where $x$ is distance along the surface of the $\theta$-inclined plane, you have:
$$ mgx\sin{\theta} =\frac 3 4 m\dot x^2$$
so if you set:
$$ g' = \frac 2 3 g\sin{\theta} $$
then:
$$ U = mg'x = \frac 1 2 m \do... |
446,186 | I want to solve the standard problem of a cylinder rolling down an inclined plane by only using conservation laws. In particular I want to use the equation:
$$E\_{pot}=\frac{1}{2}mv^2+\frac{1}{2}I\omega ^2$$
where $m$ is the mass of the cylinder, $v$ the velocity of translation and $\omega$ the angular velocity. The ... | 2018/12/09 | [
"https://physics.stackexchange.com/questions/446186",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/208011/"
] | Once you have $v^2\_{\rm final}= \frac{4gh}{3} $ you can use the constant acceleration kinematic equation $$v^2\_{\rm final} =v^2\_{\rm initial} + 2\, a \,s$$ with $v\_{\rm initial} = 0$ and $h = s\,\sin \alpha$.
That kinematic equation is just the conservation of energy "in disguise" $$\frac 12 m v^2\_{\rm final} -\... | This is a one-dimensional problem, so the simplest solution is as follows: Using
$$h = x\sin{\theta}$$
where $x$ is distance along the surface of the $\theta$-inclined plane, you have:
$$ mgx\sin{\theta} =\frac 3 4 m\dot x^2$$
so if you set:
$$ g' = \frac 2 3 g\sin{\theta} $$
then:
$$ U = mg'x = \frac 1 2 m \do... |
1,512,424 | I have multiple objects in a hierarchy which have common properties and methods inherited from the superclass, and object-specific properties and methods in the subclasses. I'm still new to OOP javascript, so there is probably a much better approach to this. I'm using jQuery for the AJAX, but not sure if that makes any... | 2009/10/03 | [
"https://Stackoverflow.com/questions/1512424",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/133221/"
] | Here is a prototypical approach to my earlier code, AND a simple reference to the calling object, which solves both the inheritance issues and the scope issues.
```
// Define Superclass
function Obj(input) {
this.content = input;
this.type = "object";
this.owner = utils.getValidUser();
this.state = 0;
... | Aw, kinda strange approach to Object Oriented JavaScript :)
As I get you want implement model you're using in other languages you familiar with to construct your object. I'm about `this.inheritFrom` . In JS there aren't classes, objects are inheriting directly from objects. One way (there are a lot of discussions in ... |
10,556,066 | I am working on a Java application which has a threading issue.
While using the applications for some time with Netbeans profiler attached, I can see several threads are created. Most of them finish in some `.5 seconds`. I could only find SwingWorkers used in the application.
Moreover, the majority of threads displa... | 2012/05/11 | [
"https://Stackoverflow.com/questions/10556066",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/752920/"
] | After doing some research, I found that with the SQL Server ODBC Driver, [`CDatabase.ExecuteSQL`](http://msdn.microsoft.com/en-us/library/67cze9b7.aspx) can execute multiple statements in one instruction. | Have worked with MFC together with SQL Server for several years. Have never encountered such a function. Usually, there is some tokenizer involved to accomplish that.
As a comparison, [SQLite](http://www.sqlite.org/) does support such multi-statements through its APIs. |
29,605,927 | I have just setup Pootle translation server, but as being absolute beginner with Python, and fact that I can't find any configuration setting in default file that Pootle installation creates regarding HTTP port that servers run on, hope that someone here can give me quick tip.
From Pootle's documentation:
>
> By def... | 2015/04/13 | [
"https://Stackoverflow.com/questions/29605927",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1428454/"
] | The garbage collector is responsible for orphan objects on the heap.
Have a look at this Oracle tutorial [Java Garbage Collection Basics](http://www.oracle.com/webfolder/technetwork/tutorials/obe/java/gc01/index.html). It explain the GC basics. | Basically garbage collection deallocates memory for all objects that are no longer referenced by any other object in the JVM. So it doesn't matter if it is a static or instance field or a local variable. |
29,605,927 | I have just setup Pootle translation server, but as being absolute beginner with Python, and fact that I can't find any configuration setting in default file that Pootle installation creates regarding HTTP port that servers run on, hope that someone here can give me quick tip.
From Pootle's documentation:
>
> By def... | 2015/04/13 | [
"https://Stackoverflow.com/questions/29605927",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1428454/"
] | Static fields will not be eligible for garbage collection as long as the class they live in is loaded. And according to [Oracle docs](https://docs.oracle.com/javase/specs/jls/se7/html/jls-12.html):
>
> A class or interface may be unloaded if and only if its defining class
> loader may be reclaimed by the garbage col... | Basically garbage collection deallocates memory for all objects that are no longer referenced by any other object in the JVM. So it doesn't matter if it is a static or instance field or a local variable. |
215,044 | What does the different assignment types mean in bitbake recipe scripts, such as:
```
BB_NUMBER_THREADS ?= "${@oe.utils.cpu_count()}"
PARALLEL_MAKE ?= "-j ${@oe.utils.cpu_count()}"
MACHINE ??= "qemux86"
```
What of above is analogous to Ruby's `bb_number_threads ||= 'something'`? | 2015/07/10 | [
"https://unix.stackexchange.com/questions/215044",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/112907/"
] | As per [this](http://www.yoctoproject.org/docs/1.6/bitbake-user-manual/bitbake-user-manual.html#setting-a-default-value) section of Bitbake manual
**?= is:**
>
> You can use the "?=" operator to achieve a "softer" assignment for a variable. This type of assignment allows you to define a variable if it is undefined w... | Short and crisp explaination would be:
IF A is not set before and
`A ?= aval
A ?= difval`
at the end of the parsing, the value of `A` will be `aval`.
Simple rule about `?=` : The first set value will be used.
---
IF A is not set before and
`A ?= aval
A ??= difval`
OR
`A = aval
A ??= difval`
at the end of... |
46,090,810 | I was using google finance api to get the stock quotes and display the contents on my site. All of a sudden from 6/september/2017 this stopped working. The url i used to get the stock quotes is <https://finance.google.com/finance/info?client=ig&q=SYMBOL&callback=>?.
Previously, i was using yahoo finance api and it was... | 2017/09/07 | [
"https://Stackoverflow.com/questions/46090810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8573186/"
] | In the end i started using yahoo finance. The data is not live, there is a 20 minutes delay. I thought it will be helpful to people who are facing issues like me.
The yahoo api url is <https://query.yahooapis.com/v1/public/yql?q=select%20>\*%20from%20yahoo.finance.quotes%20where%20symbol%3D%22MSFT%22&env=store://datat... | I was manually reading from Google Finance page for each stock before I got the `?info` link. As this is not working anymore, I am going back to the webpage.
Here is my python snippet:
```
def get_market_price(symbol):
print "Getting market price: " + symbol
base_url = 'http://finance.google.com/finance?q='
... |
46,090,810 | I was using google finance api to get the stock quotes and display the contents on my site. All of a sudden from 6/september/2017 this stopped working. The url i used to get the stock quotes is <https://finance.google.com/finance/info?client=ig&q=SYMBOL&callback=>?.
Previously, i was using yahoo finance api and it was... | 2017/09/07 | [
"https://Stackoverflow.com/questions/46090810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8573186/"
] | This url works. I think just the url changed from www.google.com to finance.google.com
<https://finance.google.com/finance/getprices?q=ACC&x=NSE&p=15&i=300&f=d,c,o,h,l,v> | You can simply parse the result of this request:
<https://finance.google.com/finance/getprices?q=GOOG&x=NASD&p=1d&i=60&f=d,c,o,h,l,v>
(GOOG at NASDAQ, one day, frequency 60 seconds, DATE,CLOSE,HIGH,LOW,OPEN,VOLUME) |
46,090,810 | I was using google finance api to get the stock quotes and display the contents on my site. All of a sudden from 6/september/2017 this stopped working. The url i used to get the stock quotes is <https://finance.google.com/finance/info?client=ig&q=SYMBOL&callback=>?.
Previously, i was using yahoo finance api and it was... | 2017/09/07 | [
"https://Stackoverflow.com/questions/46090810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8573186/"
] | In the end i started using yahoo finance. The data is not live, there is a 20 minutes delay. I thought it will be helpful to people who are facing issues like me.
The yahoo api url is <https://query.yahooapis.com/v1/public/yql?q=select%20>\*%20from%20yahoo.finance.quotes%20where%20symbol%3D%22MSFT%22&env=store://datat... | You can simply parse the result of this request:
<https://finance.google.com/finance/getprices?q=GOOG&x=NASD&p=1d&i=60&f=d,c,o,h,l,v>
(GOOG at NASDAQ, one day, frequency 60 seconds, DATE,CLOSE,HIGH,LOW,OPEN,VOLUME) |
46,090,810 | I was using google finance api to get the stock quotes and display the contents on my site. All of a sudden from 6/september/2017 this stopped working. The url i used to get the stock quotes is <https://finance.google.com/finance/info?client=ig&q=SYMBOL&callback=>?.
Previously, i was using yahoo finance api and it was... | 2017/09/07 | [
"https://Stackoverflow.com/questions/46090810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8573186/"
] | We had a same issue & we found below alternative API provided by Microsoft Bing API for Stock Markets. Below API returns the stock data in JSON format.
<https://finance.services.appex.bing.com/Market.svc/ChartAndQuotes?symbols=139.1.500209.BOM&chartType=1d&isETF=false&iseod=False&lang=en-IN&isCS=false&isVol=true>
Tha... | I had to switch to Google finance after using Yahoo finance for a long time after Verizon bought yahoo this May and ended the free API service. I went back and re-researched this issue and someone created a new Yahoo finance API call that works with the new yahoo API. <https://stackoverflow.com/a/44092983/8316350>
The... |
46,090,810 | I was using google finance api to get the stock quotes and display the contents on my site. All of a sudden from 6/september/2017 this stopped working. The url i used to get the stock quotes is <https://finance.google.com/finance/info?client=ig&q=SYMBOL&callback=>?.
Previously, i was using yahoo finance api and it was... | 2017/09/07 | [
"https://Stackoverflow.com/questions/46090810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8573186/"
] | This url works. I think just the url changed from www.google.com to finance.google.com
<https://finance.google.com/finance/getprices?q=ACC&x=NSE&p=15&i=300&f=d,c,o,h,l,v> | I had a same problem in PHP.
I replace the URL <https://www.google.com/finance/converter?a=>$amount&from=$from\_Currency&to=$to\_Currency
to
<https://finance.google.com/finance/converter?a=1&from=>$from\_Currency&to=$to\_Currency
Works fine for me. |
46,090,810 | I was using google finance api to get the stock quotes and display the contents on my site. All of a sudden from 6/september/2017 this stopped working. The url i used to get the stock quotes is <https://finance.google.com/finance/info?client=ig&q=SYMBOL&callback=>?.
Previously, i was using yahoo finance api and it was... | 2017/09/07 | [
"https://Stackoverflow.com/questions/46090810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8573186/"
] | We had a same issue & we found below alternative API provided by Microsoft Bing API for Stock Markets. Below API returns the stock data in JSON format.
<https://finance.services.appex.bing.com/Market.svc/ChartAndQuotes?symbols=139.1.500209.BOM&chartType=1d&isETF=false&iseod=False&lang=en-IN&isCS=false&isVol=true>
Tha... | You can simply parse the result of this request:
<https://finance.google.com/finance/getprices?q=GOOG&x=NASD&p=1d&i=60&f=d,c,o,h,l,v>
(GOOG at NASDAQ, one day, frequency 60 seconds, DATE,CLOSE,HIGH,LOW,OPEN,VOLUME) |
46,090,810 | I was using google finance api to get the stock quotes and display the contents on my site. All of a sudden from 6/september/2017 this stopped working. The url i used to get the stock quotes is <https://finance.google.com/finance/info?client=ig&q=SYMBOL&callback=>?.
Previously, i was using yahoo finance api and it was... | 2017/09/07 | [
"https://Stackoverflow.com/questions/46090810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8573186/"
] | In the end i started using yahoo finance. The data is not live, there is a 20 minutes delay. I thought it will be helpful to people who are facing issues like me.
The yahoo api url is <https://query.yahooapis.com/v1/public/yql?q=select%20>\*%20from%20yahoo.finance.quotes%20where%20symbol%3D%22MSFT%22&env=store://datat... | We had a same issue & we found below alternative API provided by Microsoft Bing API for Stock Markets. Below API returns the stock data in JSON format.
<https://finance.services.appex.bing.com/Market.svc/ChartAndQuotes?symbols=139.1.500209.BOM&chartType=1d&isETF=false&iseod=False&lang=en-IN&isCS=false&isVol=true>
Tha... |
46,090,810 | I was using google finance api to get the stock quotes and display the contents on my site. All of a sudden from 6/september/2017 this stopped working. The url i used to get the stock quotes is <https://finance.google.com/finance/info?client=ig&q=SYMBOL&callback=>?.
Previously, i was using yahoo finance api and it was... | 2017/09/07 | [
"https://Stackoverflow.com/questions/46090810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8573186/"
] | In the end i started using yahoo finance. The data is not live, there is a 20 minutes delay. I thought it will be helpful to people who are facing issues like me.
The yahoo api url is <https://query.yahooapis.com/v1/public/yql?q=select%20>\*%20from%20yahoo.finance.quotes%20where%20symbol%3D%22MSFT%22&env=store://datat... | I had to switch to Google finance after using Yahoo finance for a long time after Verizon bought yahoo this May and ended the free API service. I went back and re-researched this issue and someone created a new Yahoo finance API call that works with the new yahoo API. <https://stackoverflow.com/a/44092983/8316350>
The... |
46,090,810 | I was using google finance api to get the stock quotes and display the contents on my site. All of a sudden from 6/september/2017 this stopped working. The url i used to get the stock quotes is <https://finance.google.com/finance/info?client=ig&q=SYMBOL&callback=>?.
Previously, i was using yahoo finance api and it was... | 2017/09/07 | [
"https://Stackoverflow.com/questions/46090810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8573186/"
] | We had a same issue & we found below alternative API provided by Microsoft Bing API for Stock Markets. Below API returns the stock data in JSON format.
<https://finance.services.appex.bing.com/Market.svc/ChartAndQuotes?symbols=139.1.500209.BOM&chartType=1d&isETF=false&iseod=False&lang=en-IN&isCS=false&isVol=true>
Tha... | I was manually reading from Google Finance page for each stock before I got the `?info` link. As this is not working anymore, I am going back to the webpage.
Here is my python snippet:
```
def get_market_price(symbol):
print "Getting market price: " + symbol
base_url = 'http://finance.google.com/finance?q='
... |
46,090,810 | I was using google finance api to get the stock quotes and display the contents on my site. All of a sudden from 6/september/2017 this stopped working. The url i used to get the stock quotes is <https://finance.google.com/finance/info?client=ig&q=SYMBOL&callback=>?.
Previously, i was using yahoo finance api and it was... | 2017/09/07 | [
"https://Stackoverflow.com/questions/46090810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8573186/"
] | We had a same issue & we found below alternative API provided by Microsoft Bing API for Stock Markets. Below API returns the stock data in JSON format.
<https://finance.services.appex.bing.com/Market.svc/ChartAndQuotes?symbols=139.1.500209.BOM&chartType=1d&isETF=false&iseod=False&lang=en-IN&isCS=false&isVol=true>
Tha... | I had a same problem in PHP.
I replace the URL <https://www.google.com/finance/converter?a=>$amount&from=$from\_Currency&to=$to\_Currency
to
<https://finance.google.com/finance/converter?a=1&from=>$from\_Currency&to=$to\_Currency
Works fine for me. |
36,138,301 | I want to go back from one page(say B) to previous(say A) without refreshing it. I have a page B where if I am using it manually and I press backspace key manually it goes back to page A without refreshing, but when I am using
```
myElement.send_keys(Keys.BACK_SPACE)
```
on page B its redirecting me to page A and... | 2016/03/21 | [
"https://Stackoverflow.com/questions/36138301",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5935121/"
] | Use the webdriver's `back()` method:
```
browser.back()
```
Alternatively, use the [`history.back()`](https://stackoverflow.com/a/8067539/771848) through "execute script":
```
browser.execute_script("history.back();")
``` | Try to manage tabs, than you can route between the pages without refreshing them. Open link B in a new tab then you can go back to the first tab (link A) without refreshing |
58,454,269 | I am new to deep learning, here is the [code](https://github.com/pytorch/examples/blob/master/vae/main.py) I saw
The code is fine, but I don't understand the follow:
```
for epoch in range(1, args.epochs + 1):
train(epoch)
test(epoch)
with torch.no_grad():
sample = torch.randn(64, 20).to(device)
... | 2019/10/18 | [
"https://Stackoverflow.com/questions/58454269",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5865579/"
] | I would like to know more information about context file as the error says `
>
> 'Maximum number of retries (6) exceeded'
>
>
>
`. It might cause if you are trying to redeploy database on every request, So Considering you have already deployed database in cosmosdb it is recommended to remove Database.EnsureCreate... | First of all, have you checked the inner exception as stated in the error?
>
> Microsoft.EntityFrameworkCore.Storage.RetryLimitExceededException: 'Maximum number of retries (6) exceeded while executing database operations with 'CosmosExecutionStrategy'. **See inner exception for the most recent failure.'**
>
>
>
... |
41,569,121 | I have the following action methods:
```
[HttpGet]
public ActionResult DBLookupIndex(DBLookupDTO dto)
{
dto.Areas = _ph.GetProfiles();
return View(dto);
}
[HttpGet]
public ActionResult Search(DBLookupDTO dto)
{
dto.Orders = _oh.GetOrders(dto.OrderNumber, dto.Product... | 2017/01/10 | [
"https://Stackoverflow.com/questions/41569121",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7301355/"
] | you can access using `window`
```
var a = window["var"+counter]; // this line output : var0;or var3 etc
```
but you should use an array or JOSN object
```
var obj = {txt0 :"this is txt 0", txt1: "this is txt 1", txt2 = "this is txt 2"}
```
and access like
```
obj["var"+counter]
``` | ```
var txt = ["this is text 0", "this is text 1", "this is text 2"];
var counter = 0;
/* You should make sure counter is within [0; txt.length - 1 ] */
$('h1').text(txt[counter]);
``` |
41,569,121 | I have the following action methods:
```
[HttpGet]
public ActionResult DBLookupIndex(DBLookupDTO dto)
{
dto.Areas = _ph.GetProfiles();
return View(dto);
}
[HttpGet]
public ActionResult Search(DBLookupDTO dto)
{
dto.Orders = _oh.GetOrders(dto.OrderNumber, dto.Product... | 2017/01/10 | [
"https://Stackoverflow.com/questions/41569121",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7301355/"
] | You cad do it with this code: `var a = window['txt'+counter];`
```js
var txt0 = "this is txt 0"
var txt1 = "this is txt 1"
var txt2 = "this is txt 2"
counter = 0; // 1,2 or 3 etc
var a = window['txt'+counter];
$('h1').text(a);
console.log(a);
```
```html
<script src="https://ajax.googleapis.com/ajax/libs/jquer... | you can access using `window`
```
var a = window["var"+counter]; // this line output : var0;or var3 etc
```
but you should use an array or JOSN object
```
var obj = {txt0 :"this is txt 0", txt1: "this is txt 1", txt2 = "this is txt 2"}
```
and access like
```
obj["var"+counter]
``` |
41,569,121 | I have the following action methods:
```
[HttpGet]
public ActionResult DBLookupIndex(DBLookupDTO dto)
{
dto.Areas = _ph.GetProfiles();
return View(dto);
}
[HttpGet]
public ActionResult Search(DBLookupDTO dto)
{
dto.Orders = _oh.GetOrders(dto.OrderNumber, dto.Product... | 2017/01/10 | [
"https://Stackoverflow.com/questions/41569121",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7301355/"
] | You cad do it with this code: `var a = window['txt'+counter];`
```js
var txt0 = "this is txt 0"
var txt1 = "this is txt 1"
var txt2 = "this is txt 2"
counter = 0; // 1,2 or 3 etc
var a = window['txt'+counter];
$('h1').text(a);
console.log(a);
```
```html
<script src="https://ajax.googleapis.com/ajax/libs/jquer... | ```
var txt = ["this is text 0", "this is text 1", "this is text 2"];
var counter = 0;
/* You should make sure counter is within [0; txt.length - 1 ] */
$('h1').text(txt[counter]);
``` |
4,562,144 | I got array which has one,two,three,four,five. values..
in my array....says countListArray.
I need to display this countlistarray has titleForHeaderInSection....
for each section i need to display 6 cell... | 2010/12/30 | [
"https://Stackoverflow.com/questions/4562144",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/465800/"
] | You need to implement table view data source and delegate methods.
for name of section use this
```
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
return [yourArray objectAtIndex:section];
}
``` | You just need to handle titleForRow:inSection message. Or, do you have any problems with that? |
21,908,577 | I'm doing a hangman game, this is my progress. So the computer chooses a random word, prints out as many underscores as there are letters in the word. Now I need to check if a input letter matches any of the letters in the random word.
I've tried this so far.
```
var wordList = new Array("duck","cat","dog","carpet","p... | 2014/02/20 | [
"https://Stackoverflow.com/questions/21908577",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3329347/"
] | The following suggestion would be what you are looking for, it will return a bool;
```
bool isItThere = randomWord.Contains('guessletter');
```
if you want the position of the characters see @guy777's answer. | The following code returns all the positions matched by a letter in a word :
```
function checkLetterInWord(word, letter) {
var positions = [];
for(var i=0; i<word.length; i++)
if(word.charAt(i) == letter)
positions.push(i);
return positions;
}
var word2guess = "hangman";
var pos = ch... |
31,744,466 | I'm trying to insert in my database the input provided by the user, alongside the id . However i'm failing to do so. Maybe i'm way off maybe i'm close, but I just want to learn how to do it.Any help please?
```
$options = '';
$filter=mysql_query("select id from employees WHERE Status='Employed '");
while($row ... | 2015/07/31 | [
"https://Stackoverflow.com/questions/31744466",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5117936/"
] | There is mistake in your if condition
```
if(isset($_POST['submit'])){
$addedhours = //fetched variable from the post data
$options = //fetched variable from the post data
$sql="INSERT INTO `editedworkhours` (`AFNumber`, `Note`, `AddedWH`, `DeductedWH`) VALUES('$options',NULL,'$addedho... | Apart from (among other problems) the fact that you really, really should not use mysql\_\* functions any more:
Near the end of your snippet you create a query. But you never execute it. That's why it's not working. |
194,832 | If I have this equation:
$p'(t)-p(t)\alpha =0$
I can say that $p$ is a function that represents the size of a population at time t. The rate at which the population grows is constant. The solution will show that the size of the population is proportional to the initial size.
If I have this equation:
$p'(t)-p(t)f(t)... | 2012/09/12 | [
"https://math.stackexchange.com/questions/194832",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/21050/"
] | The equation
$$p'(t)=f(t)\ p(t)$$
says: The rate $p'$ by which the population $P$ grows is proportional to the current size $p$ of $P$; but the proportionality factor $f$ valid at time $t$ depends on time. If, e.g., the growth rate depends on the seasons, the function $t\mapsto f(t)$ would be a certain periodic functio... | In your first equation, the solution is $p(t)=ce^{at}$. As you say, you choose $c$ to be $p(0)$ if that is the initial condition you are given. If you are given that $p(2)=10000$, that there were $10000$ individuals at year $2$, you would find $c=10000e^{-2a}$ Similarly, $c$ in the last equation is a constant of integr... |
29,852,431 | Having used the AlamoFire framework I've noticed that the completionHandler is run on the main thread. I'm wondering if the code below is a good practice for creating a Core Data import task within the completion handler:
```
Alamofire.request(.GET, "http://myWebSite.example", parameters: parameters)
.resp... | 2015/04/24 | [
"https://Stackoverflow.com/questions/29852431",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3084800/"
] | This is a really good question. Your approach is perfectly valid. However, Alamofire can actually help you streamline this even more.
Your Example Code Dispatch Queue Breakdown
------------------------------------------
In you example code, you are jumping between the following dispatch queues:
1. NSURLSession dispa... | Just complementing the perfect answer from @cnoon, if you like me is using `ResponseObjectSerializable` you can embed this concurrent behaviour on the request extension itself:
```
extension Request {
public func responseObject<T: ResponseObjectSerializable>(completionHandler: Response<T, NSError> -> Void) -> Self... |
29,852,431 | Having used the AlamoFire framework I've noticed that the completionHandler is run on the main thread. I'm wondering if the code below is a good practice for creating a Core Data import task within the completion handler:
```
Alamofire.request(.GET, "http://myWebSite.example", parameters: parameters)
.resp... | 2015/04/24 | [
"https://Stackoverflow.com/questions/29852431",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3084800/"
] | This is a really good question. Your approach is perfectly valid. However, Alamofire can actually help you streamline this even more.
Your Example Code Dispatch Queue Breakdown
------------------------------------------
In you example code, you are jumping between the following dispatch queues:
1. NSURLSession dispa... | Small Update for Swift 3.0 ,Alamofire (4.0.1),Edit for @cnoon answer:
```
let queue = DispatchQueue(label: "com.cnoon.manager-response-queue",
qos: .userInitiated,
attributes:.concurrent)
Alamofire?.request(SERVER_URL, method: .post,
parameters: ["foo": "bar"],
enco... |
29,852,431 | Having used the AlamoFire framework I've noticed that the completionHandler is run on the main thread. I'm wondering if the code below is a good practice for creating a Core Data import task within the completion handler:
```
Alamofire.request(.GET, "http://myWebSite.example", parameters: parameters)
.resp... | 2015/04/24 | [
"https://Stackoverflow.com/questions/29852431",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3084800/"
] | Small Update for Swift 3.0 ,Alamofire (4.0.1),Edit for @cnoon answer:
```
let queue = DispatchQueue(label: "com.cnoon.manager-response-queue",
qos: .userInitiated,
attributes:.concurrent)
Alamofire?.request(SERVER_URL, method: .post,
parameters: ["foo": "bar"],
enco... | Just complementing the perfect answer from @cnoon, if you like me is using `ResponseObjectSerializable` you can embed this concurrent behaviour on the request extension itself:
```
extension Request {
public func responseObject<T: ResponseObjectSerializable>(completionHandler: Response<T, NSError> -> Void) -> Self... |
1,585 | I have a handful of friends who are strictly vegan, and I talked with each of them before about their views. At least 3 of them have said to me that **under no circumstance would they eat an animal or use an animal product** (say, for clothing). This is nonsensical, right? There are no real justifications for this, as ... | 2011/11/03 | [
"https://philosophy.stackexchange.com/questions/1585",
"https://philosophy.stackexchange.com",
"https://philosophy.stackexchange.com/users/514/"
] | Almost every choice you make could have some "irrational" part to it since not all causes and effects can be understood completely.
There are arguments today for rejecting any animal food source that are rational for the pressure they put on producers.
Your position could be motivated by pure empathy, physical or men... | No,
It is not irrational for someone to push to TRY and be pure vegan.
Lets take it from this situation. What is there end game?
**Are they trying to make a political statement?**
If that is the case in the eyes of the world watching. If a famous musician misses a note, no one notices, except other musicians (whi... |
1,585 | I have a handful of friends who are strictly vegan, and I talked with each of them before about their views. At least 3 of them have said to me that **under no circumstance would they eat an animal or use an animal product** (say, for clothing). This is nonsensical, right? There are no real justifications for this, as ... | 2011/11/03 | [
"https://philosophy.stackexchange.com/questions/1585",
"https://philosophy.stackexchange.com",
"https://philosophy.stackexchange.com/users/514/"
] | I think that one can find a rational justification for the position, if one is willing to accept certain basic principles.
Let us start from the standpoint of Kant's second formulation of the Categorical Imperative (from the *Groundwork of a Metaphysics of Morals*) which reads: *Act in such a way that you treat humani... | 1) As a practicing lacto vegetarian for 35 years (no animal flesh or eggs but dairy OK) I believe there is no way one can be totally "pure", if that is the end in mind. One can look at the Jain sect in India; they sweep the sidewalk in front of them before walking and strain their water before drinking lest the injure ... |
1,585 | I have a handful of friends who are strictly vegan, and I talked with each of them before about their views. At least 3 of them have said to me that **under no circumstance would they eat an animal or use an animal product** (say, for clothing). This is nonsensical, right? There are no real justifications for this, as ... | 2011/11/03 | [
"https://philosophy.stackexchange.com/questions/1585",
"https://philosophy.stackexchange.com",
"https://philosophy.stackexchange.com/users/514/"
] | 1) As a practicing lacto vegetarian for 35 years (no animal flesh or eggs but dairy OK) I believe there is no way one can be totally "pure", if that is the end in mind. One can look at the Jain sect in India; they sweep the sidewalk in front of them before walking and strain their water before drinking lest the injure ... | Regarding the ethical reasons stated, you need to take a step back and look at the underlying assumption, namely, that there is such a thing as good and evil, or right and wrong. The "welfare of animals" has no meaning unless you are working in a framework of "right and wrong" or "justice and injustice". There can be n... |
1,585 | I have a handful of friends who are strictly vegan, and I talked with each of them before about their views. At least 3 of them have said to me that **under no circumstance would they eat an animal or use an animal product** (say, for clothing). This is nonsensical, right? There are no real justifications for this, as ... | 2011/11/03 | [
"https://philosophy.stackexchange.com/questions/1585",
"https://philosophy.stackexchange.com",
"https://philosophy.stackexchange.com/users/514/"
] | Almost every choice you make could have some "irrational" part to it since not all causes and effects can be understood completely.
There are arguments today for rejecting any animal food source that are rational for the pressure they put on producers.
Your position could be motivated by pure empathy, physical or men... | In the purest sense you cannot be both a capitalist and an ethical vegan.
As stated by your "one step back" thought, eventually, and sometimes rather quickly, the money on any item can quickly make it to somewhere where cruelty to animals happens.
But then again, in an extreme sense you cannot be an fully ethical veg... |
1,585 | I have a handful of friends who are strictly vegan, and I talked with each of them before about their views. At least 3 of them have said to me that **under no circumstance would they eat an animal or use an animal product** (say, for clothing). This is nonsensical, right? There are no real justifications for this, as ... | 2011/11/03 | [
"https://philosophy.stackexchange.com/questions/1585",
"https://philosophy.stackexchange.com",
"https://philosophy.stackexchange.com/users/514/"
] | The goal is to do the least amount of harm possible. The notion that if you cannot save everyone, you should save no one is ridiculous. The mere fact of you existing will cause someone else to suffer somehow, but intentionally causing suffering is completely different. Yes, a rabbit may have been killed by mistake in h... | Regarding the ethical reasons stated, you need to take a step back and look at the underlying assumption, namely, that there is such a thing as good and evil, or right and wrong. The "welfare of animals" has no meaning unless you are working in a framework of "right and wrong" or "justice and injustice". There can be n... |
1,585 | I have a handful of friends who are strictly vegan, and I talked with each of them before about their views. At least 3 of them have said to me that **under no circumstance would they eat an animal or use an animal product** (say, for clothing). This is nonsensical, right? There are no real justifications for this, as ... | 2011/11/03 | [
"https://philosophy.stackexchange.com/questions/1585",
"https://philosophy.stackexchange.com",
"https://philosophy.stackexchange.com/users/514/"
] | Disclaimer: Some (many?) of the things I wrote below may not reflect my personal views on the matter. However, I wrote all this thinking like the best vegan I could be.
>
> under no circumstance would they eat an animal or use an animal product (say, for clothing). This is nonsensical, right?
>
>
>
I tend to thin... | Regarding the ethical reasons stated, you need to take a step back and look at the underlying assumption, namely, that there is such a thing as good and evil, or right and wrong. The "welfare of animals" has no meaning unless you are working in a framework of "right and wrong" or "justice and injustice". There can be n... |
1,585 | I have a handful of friends who are strictly vegan, and I talked with each of them before about their views. At least 3 of them have said to me that **under no circumstance would they eat an animal or use an animal product** (say, for clothing). This is nonsensical, right? There are no real justifications for this, as ... | 2011/11/03 | [
"https://philosophy.stackexchange.com/questions/1585",
"https://philosophy.stackexchange.com",
"https://philosophy.stackexchange.com/users/514/"
] | Disclaimer: Some (many?) of the things I wrote below may not reflect my personal views on the matter. However, I wrote all this thinking like the best vegan I could be.
>
> under no circumstance would they eat an animal or use an animal product (say, for clothing). This is nonsensical, right?
>
>
>
I tend to thin... | No,
It is not irrational for someone to push to TRY and be pure vegan.
Lets take it from this situation. What is there end game?
**Are they trying to make a political statement?**
If that is the case in the eyes of the world watching. If a famous musician misses a note, no one notices, except other musicians (whi... |
1,585 | I have a handful of friends who are strictly vegan, and I talked with each of them before about their views. At least 3 of them have said to me that **under no circumstance would they eat an animal or use an animal product** (say, for clothing). This is nonsensical, right? There are no real justifications for this, as ... | 2011/11/03 | [
"https://philosophy.stackexchange.com/questions/1585",
"https://philosophy.stackexchange.com",
"https://philosophy.stackexchange.com/users/514/"
] | I think that one can find a rational justification for the position, if one is willing to accept certain basic principles.
Let us start from the standpoint of Kant's second formulation of the Categorical Imperative (from the *Groundwork of a Metaphysics of Morals*) which reads: *Act in such a way that you treat humani... | The irrationality stems from the fact that veganism both claims that all sentient animals should be accorded the same respect, yet it wishes to deny that man has just as much a right to eat meat than any other omnivore or carnivore does. Or in other words, they both claim that all animals are created equal, and that ma... |
1,585 | I have a handful of friends who are strictly vegan, and I talked with each of them before about their views. At least 3 of them have said to me that **under no circumstance would they eat an animal or use an animal product** (say, for clothing). This is nonsensical, right? There are no real justifications for this, as ... | 2011/11/03 | [
"https://philosophy.stackexchange.com/questions/1585",
"https://philosophy.stackexchange.com",
"https://philosophy.stackexchange.com/users/514/"
] | I think that one can find a rational justification for the position, if one is willing to accept certain basic principles.
Let us start from the standpoint of Kant's second formulation of the Categorical Imperative (from the *Groundwork of a Metaphysics of Morals*) which reads: *Act in such a way that you treat humani... | In the purest sense you cannot be both a capitalist and an ethical vegan.
As stated by your "one step back" thought, eventually, and sometimes rather quickly, the money on any item can quickly make it to somewhere where cruelty to animals happens.
But then again, in an extreme sense you cannot be an fully ethical veg... |
1,585 | I have a handful of friends who are strictly vegan, and I talked with each of them before about their views. At least 3 of them have said to me that **under no circumstance would they eat an animal or use an animal product** (say, for clothing). This is nonsensical, right? There are no real justifications for this, as ... | 2011/11/03 | [
"https://philosophy.stackexchange.com/questions/1585",
"https://philosophy.stackexchange.com",
"https://philosophy.stackexchange.com/users/514/"
] | Almost every choice you make could have some "irrational" part to it since not all causes and effects can be understood completely.
There are arguments today for rejecting any animal food source that are rational for the pressure they put on producers.
Your position could be motivated by pure empathy, physical or men... | Regarding the ethical reasons stated, you need to take a step back and look at the underlying assumption, namely, that there is such a thing as good and evil, or right and wrong. The "welfare of animals" has no meaning unless you are working in a framework of "right and wrong" or "justice and injustice". There can be n... |
16,438,073 | I am not able to call `rJava` package in `R 3.0`. I got the following message
```
Error: package ‘rJava’ was built before R 3.0.0: please re-install it
```
I am getting error when I tried to re-install `rJava` package. I have provided the output of `R CMD javareconf`
```
Java interpreter : /usr/bin/java
Java versio... | 2013/05/08 | [
"https://Stackoverflow.com/questions/16438073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1080893/"
] | I ran into the exact same issue. My solution was to install the openjdk-7-\* via
```
sudo apt-get install openjdk-7-*
```
Followed that with
```
sudo R CMD javareconf
```
and I was then able to install rJava in R via `install.packages("rJava")`.
While perhaps not the most elegant solution it appears to have solv... | For those getting the error:
```
error: unable to load shared object '/some/dir/rJava/libs/rJava.so': libjvm.so:
cannot open shared object file: No such file or directory
```
I solved the error locating the library in the system and linking them to `/usr/lib`:
```
$sudo updatedb
$locate libjvm.so
/usr/lib/debug/u... |
16,438,073 | I am not able to call `rJava` package in `R 3.0`. I got the following message
```
Error: package ‘rJava’ was built before R 3.0.0: please re-install it
```
I am getting error when I tried to re-install `rJava` package. I have provided the output of `R CMD javareconf`
```
Java interpreter : /usr/bin/java
Java versio... | 2013/05/08 | [
"https://Stackoverflow.com/questions/16438073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1080893/"
] | I ran into the exact same issue. My solution was to install the openjdk-7-\* via
```
sudo apt-get install openjdk-7-*
```
Followed that with
```
sudo R CMD javareconf
```
and I was then able to install rJava in R via `install.packages("rJava")`.
While perhaps not the most elegant solution it appears to have solv... | Installing rJava from the distribution packages as proposed in [this askUbuntu answer](https://askubuntu.com/questions/858961/install-rjava-on-ubuntu-failed) also works:
```
sudo apt-get install r-cran-rjava
```
NOTE: tried from a Debian system. |
16,438,073 | I am not able to call `rJava` package in `R 3.0`. I got the following message
```
Error: package ‘rJava’ was built before R 3.0.0: please re-install it
```
I am getting error when I tried to re-install `rJava` package. I have provided the output of `R CMD javareconf`
```
Java interpreter : /usr/bin/java
Java versio... | 2013/05/08 | [
"https://Stackoverflow.com/questions/16438073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1080893/"
] | I ran into the exact same issue. My solution was to install the openjdk-7-\* via
```
sudo apt-get install openjdk-7-*
```
Followed that with
```
sudo R CMD javareconf
```
and I was then able to install rJava in R via `install.packages("rJava")`.
While perhaps not the most elegant solution it appears to have solv... | I was also facing same error which was on RHEL8.1 & i resolved it as follows:
```
yum --enablerepo=* install java-1.8*
```
later i ran same command which was giving me error logs of R server.
```
R CMD javareconf
```
which turns into following output.
[ also works:
```
sudo apt-get install r-cran-rjava
```
NOTE: tried from a Debian system. |
16,438,073 | I am not able to call `rJava` package in `R 3.0`. I got the following message
```
Error: package ‘rJava’ was built before R 3.0.0: please re-install it
```
I am getting error when I tried to re-install `rJava` package. I have provided the output of `R CMD javareconf`
```
Java interpreter : /usr/bin/java
Java versio... | 2013/05/08 | [
"https://Stackoverflow.com/questions/16438073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1080893/"
] | For those getting the error:
```
error: unable to load shared object '/some/dir/rJava/libs/rJava.so': libjvm.so:
cannot open shared object file: No such file or directory
```
I solved the error locating the library in the system and linking them to `/usr/lib`:
```
$sudo updatedb
$locate libjvm.so
/usr/lib/debug/u... | I was also facing same error which was on RHEL8.1 & i resolved it as follows:
```
yum --enablerepo=* install java-1.8*
```
later i ran same command which was giving me error logs of R server.
```
R CMD javareconf
```
which turns into following output.
[ also works:
```
sudo apt-get install r-cran-rjava
```
NOTE: tried from a Debian system. | I was also facing same error which was on RHEL8.1 & i resolved it as follows:
```
yum --enablerepo=* install java-1.8*
```
later i ran same command which was giving me error logs of R server.
```
R CMD javareconf
```
which turns into following output.
[ {
$('.expanded'... | 2015/11/17 | [
"https://Stackoverflow.com/questions/33747780",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4959360/"
] | You have to iterate your counter on the server, using a server-side technology like PHP, Node.js, Python, Java or something along those lines. You will create a route that processes the request, increments your counter, then returns a response with some sort of success / failure message. To store your count you can use... | You need a data service to store the change, and in your application you will need to add xhr calls to the service to get the data.
In short, without using a service or using localstorage, you cannot make permanent change after refreshing. |
70,048,491 | So I was thinking that ok node is asynchronous (meaning multiple lines of code execute at the same time), then why we use the keyword async( which literally means asynchronous) to wait for a task to be done by keyword await (that is making it synchronous). Why there is not a keyword **sync**, because that's what we are... | 2021/11/20 | [
"https://Stackoverflow.com/questions/70048491",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10017481/"
] | The `async` keyword enables the use of `await` which is just a more streamlined syntax for writing code with promises and asynchronous operations. It does not make anything synchronous. It just allows you to use similar programming techniques as synchronous code, but it is all still asynchronous.
>
> Can someone plea... | Node.js is not "asynchronous," but instead, Node.js has a set of asynchronous APIs.
To answer your question about `async/await -` async/await is just syntactic sugar as it uses promises under the hood. |
7,228,570 | Is it possible to change the width of UITabbarItem in UITabbar and margins between each UITabbarItem for iPad Application?
The problem is that standard margins are too large for my layout - client want tabs to be more compact :/
Or should I mess with UIToolbar to achieve this goal? | 2011/08/29 | [
"https://Stackoverflow.com/questions/7228570",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/581204/"
] | I have solved just the same problem it this way:
my goal was to customize tab bar by using images, that were sent by the designer for me.
I have attached the .png files for the project, initialized the correspondent variables of type UIImage\* and used UITabBarItem function setFinishedSelectedImage: withFinishedUnsele... | I don't think it is possible. You can create a custom tab bar. Also messing around with default UItabbar might cause rejection during App approval process. |
7,228,570 | Is it possible to change the width of UITabbarItem in UITabbar and margins between each UITabbarItem for iPad Application?
The problem is that standard margins are too large for my layout - client want tabs to be more compact :/
Or should I mess with UIToolbar to achieve this goal? | 2011/08/29 | [
"https://Stackoverflow.com/questions/7228570",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/581204/"
] | For Tabbar item width :
```
[[UITabBar appearance] setItemWidth:self.window.frame.size.width/NUMBER_OF_ITEMS];
```
For tabbar frame :
```
[self.tabBar setFrame:rectFrame];
``` | I have solved just the same problem it this way:
my goal was to customize tab bar by using images, that were sent by the designer for me.
I have attached the .png files for the project, initialized the correspondent variables of type UIImage\* and used UITabBarItem function setFinishedSelectedImage: withFinishedUnsele... |
7,228,570 | Is it possible to change the width of UITabbarItem in UITabbar and margins between each UITabbarItem for iPad Application?
The problem is that standard margins are too large for my layout - client want tabs to be more compact :/
Or should I mess with UIToolbar to achieve this goal? | 2011/08/29 | [
"https://Stackoverflow.com/questions/7228570",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/581204/"
] | No subclassing is needed.
```
tabBarController.tabBar.itemPositioning = .centered
tabBarController.tabBar.itemWidth = 40
tabBarController.tabBar.itemSpacing = 38
``` | You cannot change the width of the the `UITabBarItem`, and you cannot do this even after subclassing the UITabBarItem. Apple has certain restrictions in the way they want the developers to implement the applications.
You will need to use a `UIToolBar` for this, and my best bet is for you to go to `github` and as ther... |
7,228,570 | Is it possible to change the width of UITabbarItem in UITabbar and margins between each UITabbarItem for iPad Application?
The problem is that standard margins are too large for my layout - client want tabs to be more compact :/
Or should I mess with UIToolbar to achieve this goal? | 2011/08/29 | [
"https://Stackoverflow.com/questions/7228570",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/581204/"
] | I have solved just the same problem it this way:
my goal was to customize tab bar by using images, that were sent by the designer for me.
I have attached the .png files for the project, initialized the correspondent variables of type UIImage\* and used UITabBarItem function setFinishedSelectedImage: withFinishedUnsele... | You cannot change the width of the the `UITabBarItem`, and you cannot do this even after subclassing the UITabBarItem. Apple has certain restrictions in the way they want the developers to implement the applications.
You will need to use a `UIToolBar` for this, and my best bet is for you to go to `github` and as ther... |
7,228,570 | Is it possible to change the width of UITabbarItem in UITabbar and margins between each UITabbarItem for iPad Application?
The problem is that standard margins are too large for my layout - client want tabs to be more compact :/
Or should I mess with UIToolbar to achieve this goal? | 2011/08/29 | [
"https://Stackoverflow.com/questions/7228570",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/581204/"
] | You can change the spacing of the tab bar items by subclassing UITabBar and overriding its layoutSubviews method. You will find all tab bar buttons in the self.subViews array. Their class is the non-public UITabBarButton but they inherit from UIControl so you can identify all tab bar buttons checking if they are kind o... | You cannot change the width of the the `UITabBarItem`, and you cannot do this even after subclassing the UITabBarItem. Apple has certain restrictions in the way they want the developers to implement the applications.
You will need to use a `UIToolBar` for this, and my best bet is for you to go to `github` and as ther... |
7,228,570 | Is it possible to change the width of UITabbarItem in UITabbar and margins between each UITabbarItem for iPad Application?
The problem is that standard margins are too large for my layout - client want tabs to be more compact :/
Or should I mess with UIToolbar to achieve this goal? | 2011/08/29 | [
"https://Stackoverflow.com/questions/7228570",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/581204/"
] | For Tabbar item width :
```
[[UITabBar appearance] setItemWidth:self.window.frame.size.width/NUMBER_OF_ITEMS];
```
For tabbar frame :
```
[self.tabBar setFrame:rectFrame];
``` | You can change the spacing of the tab bar items by subclassing UITabBar and overriding its layoutSubviews method. You will find all tab bar buttons in the self.subViews array. Their class is the non-public UITabBarButton but they inherit from UIControl so you can identify all tab bar buttons checking if they are kind o... |
7,228,570 | Is it possible to change the width of UITabbarItem in UITabbar and margins between each UITabbarItem for iPad Application?
The problem is that standard margins are too large for my layout - client want tabs to be more compact :/
Or should I mess with UIToolbar to achieve this goal? | 2011/08/29 | [
"https://Stackoverflow.com/questions/7228570",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/581204/"
] | For Tabbar item width :
```
[[UITabBar appearance] setItemWidth:self.window.frame.size.width/NUMBER_OF_ITEMS];
```
For tabbar frame :
```
[self.tabBar setFrame:rectFrame];
``` | I don't think it is possible. You can create a custom tab bar. Also messing around with default UItabbar might cause rejection during App approval process. |
7,228,570 | Is it possible to change the width of UITabbarItem in UITabbar and margins between each UITabbarItem for iPad Application?
The problem is that standard margins are too large for my layout - client want tabs to be more compact :/
Or should I mess with UIToolbar to achieve this goal? | 2011/08/29 | [
"https://Stackoverflow.com/questions/7228570",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/581204/"
] | For Tabbar item width :
```
[[UITabBar appearance] setItemWidth:self.window.frame.size.width/NUMBER_OF_ITEMS];
```
For tabbar frame :
```
[self.tabBar setFrame:rectFrame];
``` | You can use setSelectionIndicatorImage to make your tab more compact.
The UITabBarItem width in iPad will match the selectionIndicatorImage's width
in AppDelegate.m
```
[[UITabBar appearance] setItemWidth:self.window.frame.size.width/NUMBER_OF_YOUR_TAB];
[[UITabBar appearance] setItemSpacing:0];
[[UITabBar appearan... |
7,228,570 | Is it possible to change the width of UITabbarItem in UITabbar and margins between each UITabbarItem for iPad Application?
The problem is that standard margins are too large for my layout - client want tabs to be more compact :/
Or should I mess with UIToolbar to achieve this goal? | 2011/08/29 | [
"https://Stackoverflow.com/questions/7228570",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/581204/"
] | I have solved just the same problem it this way:
my goal was to customize tab bar by using images, that were sent by the designer for me.
I have attached the .png files for the project, initialized the correspondent variables of type UIImage\* and used UITabBarItem function setFinishedSelectedImage: withFinishedUnsele... | You can change the spacing of the tab bar items by subclassing UITabBar and overriding its layoutSubviews method. You will find all tab bar buttons in the self.subViews array. Their class is the non-public UITabBarButton but they inherit from UIControl so you can identify all tab bar buttons checking if they are kind o... |
7,228,570 | Is it possible to change the width of UITabbarItem in UITabbar and margins between each UITabbarItem for iPad Application?
The problem is that standard margins are too large for my layout - client want tabs to be more compact :/
Or should I mess with UIToolbar to achieve this goal? | 2011/08/29 | [
"https://Stackoverflow.com/questions/7228570",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/581204/"
] | For Tabbar item width :
```
[[UITabBar appearance] setItemWidth:self.window.frame.size.width/NUMBER_OF_ITEMS];
```
For tabbar frame :
```
[self.tabBar setFrame:rectFrame];
``` | You cannot change the width of the the `UITabBarItem`, and you cannot do this even after subclassing the UITabBarItem. Apple has certain restrictions in the way they want the developers to implement the applications.
You will need to use a `UIToolBar` for this, and my best bet is for you to go to `github` and as ther... |
31,409,149 | I am getting the following error when i try triggering a build using the following command:
curl <http://jenkins_server:port/jenkins/job/job_name/build?token=token_name>
Output:
>
> Authentication required
>
>
> <--
> You are authenticated as: anonymous
>
> Groups that you are in:
>
>
> Permission you need... | 2015/07/14 | [
"https://Stackoverflow.com/questions/31409149",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/361089/"
] | I had the same problem after setting up a test Jenkins server. The solution was to authenticate using my Jenkins admin password:
```
curl -u admin:<mypassword> http://localhost:8080/job/Test/build?token=<mytoken>
```
Use the same username and password you use to login to Jenkins. There was no need to install additio... | This works for me:
tokenuser = You need login with the user and check token config jenkins -> admin users
user = username
```
curl -XPOST --silent --show-error --user user:tokenuser "http://ipserver/jenkins/buildByToken/build?job=JOBNAME&token=7RJWiIwD5cW3S6QjwF7a"
```
Example:
```
curl -XPOST --silent --show-err... |
31,409,149 | I am getting the following error when i try triggering a build using the following command:
curl <http://jenkins_server:port/jenkins/job/job_name/build?token=token_name>
Output:
>
> Authentication required
>
>
> <--
> You are authenticated as: anonymous
>
> Groups that you are in:
>
>
> Permission you need... | 2015/07/14 | [
"https://Stackoverflow.com/questions/31409149",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/361089/"
] | I had the same problem after setting up a test Jenkins server. The solution was to authenticate using my Jenkins admin password:
```
curl -u admin:<mypassword> http://localhost:8080/job/Test/build?token=<mytoken>
```
Use the same username and password you use to login to Jenkins. There was no need to install additio... | I suggest you try [Jenkins Python API](https://python-jenkins.readthedocs.org/en/latest/api.html#module-jenkins). It provides an `build_job` action that is super easy to trigger a job.
```
build_job(name, parameters=None, token=None)
Trigger build job.
Parameters:
name – name of job
parameters – paramet... |
31,409,149 | I am getting the following error when i try triggering a build using the following command:
curl <http://jenkins_server:port/jenkins/job/job_name/build?token=token_name>
Output:
>
> Authentication required
>
>
> <--
> You are authenticated as: anonymous
>
> Groups that you are in:
>
>
> Permission you need... | 2015/07/14 | [
"https://Stackoverflow.com/questions/31409149",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/361089/"
] | I suggest you try [Jenkins Python API](https://python-jenkins.readthedocs.org/en/latest/api.html#module-jenkins). It provides an `build_job` action that is super easy to trigger a job.
```
build_job(name, parameters=None, token=None)
Trigger build job.
Parameters:
name – name of job
parameters – paramet... | On 1.625.3, giving Anonymous read access to almost everything worked for me.
**UPDATE**: I guess I should clarify since this got downvoted. I was able to reproduce that error message, and when I turned on read access for the Anonymous user on all of the access types, it resolved the problem. Just saying... |
31,409,149 | I am getting the following error when i try triggering a build using the following command:
curl <http://jenkins_server:port/jenkins/job/job_name/build?token=token_name>
Output:
>
> Authentication required
>
>
> <--
> You are authenticated as: anonymous
>
> Groups that you are in:
>
>
> Permission you need... | 2015/07/14 | [
"https://Stackoverflow.com/questions/31409149",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/361089/"
] | I think there's no need to set up any kind of plugin to make it works, simply do this BATCH CMD:
```
curl -X POST http://USER_ID_JENKINS_RECEIVER:TOKEN_OF_USER_ID_JENKINS_RECEIVER@URL_JENKINS_RECEIVER:PORT/job/NAME_OF_JOB/buildWithParameters?token=TOKEN_JOB_JENKINS_RECEIVER
```
* To see you **USER\_ID\_TOKEN**, go t... | I had the same problem after setting up a test Jenkins server. The solution was to authenticate using my Jenkins admin password:
```
curl -u admin:<mypassword> http://localhost:8080/job/Test/build?token=<mytoken>
```
Use the same username and password you use to login to Jenkins. There was no need to install additio... |
31,409,149 | I am getting the following error when i try triggering a build using the following command:
curl <http://jenkins_server:port/jenkins/job/job_name/build?token=token_name>
Output:
>
> Authentication required
>
>
> <--
> You are authenticated as: anonymous
>
> Groups that you are in:
>
>
> Permission you need... | 2015/07/14 | [
"https://Stackoverflow.com/questions/31409149",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/361089/"
] | I install Build Token Root Plugin to solve this issue before
<https://wiki.jenkins-ci.org/display/JENKINS/Build+Token+Root+Plugin>
Then as the same, setup Authentication Token
Finally, either use curl to trigger remote build (Be careful the escape character "\")
`curl http://JENKINS_URL/buildByToken/build?job=JOB_N... | I think there's no need to set up any kind of plugin to make it works, simply do this BATCH CMD:
```
curl -X POST http://USER_ID_JENKINS_RECEIVER:TOKEN_OF_USER_ID_JENKINS_RECEIVER@URL_JENKINS_RECEIVER:PORT/job/NAME_OF_JOB/buildWithParameters?token=TOKEN_JOB_JENKINS_RECEIVER
```
* To see you **USER\_ID\_TOKEN**, go t... |
31,409,149 | I am getting the following error when i try triggering a build using the following command:
curl <http://jenkins_server:port/jenkins/job/job_name/build?token=token_name>
Output:
>
> Authentication required
>
>
> <--
> You are authenticated as: anonymous
>
> Groups that you are in:
>
>
> Permission you need... | 2015/07/14 | [
"https://Stackoverflow.com/questions/31409149",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/361089/"
] | I think there's no need to set up any kind of plugin to make it works, simply do this BATCH CMD:
```
curl -X POST http://USER_ID_JENKINS_RECEIVER:TOKEN_OF_USER_ID_JENKINS_RECEIVER@URL_JENKINS_RECEIVER:PORT/job/NAME_OF_JOB/buildWithParameters?token=TOKEN_JOB_JENKINS_RECEIVER
```
* To see you **USER\_ID\_TOKEN**, go t... | This works for me:
tokenuser = You need login with the user and check token config jenkins -> admin users
user = username
```
curl -XPOST --silent --show-error --user user:tokenuser "http://ipserver/jenkins/buildByToken/build?job=JOBNAME&token=7RJWiIwD5cW3S6QjwF7a"
```
Example:
```
curl -XPOST --silent --show-err... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.