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 |
|---|---|---|---|---|---|
38,393,622 | **ionic check boxes** are showing square in android but in **IOS** its shows rounded.
How we can make them square for IOS? | 2016/07/15 | [
"https://Stackoverflow.com/questions/38393622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6269831/"
] | I just used this.
```
<ion-checkbox mode="md"></ion-checkbox>
``` | the code bellow works for the Ionic version 3:
```
.item {
.checkbox {
.checkbox-icon {
border-radius: 0% !important;
}
}
}
``` |
38,393,622 | **ionic check boxes** are showing square in android but in **IOS** its shows rounded.
How we can make them square for IOS? | 2016/07/15 | [
"https://Stackoverflow.com/questions/38393622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6269831/"
] | You can set globally with:
$ionicConfigProvider.form.checkbox("circle");
```
angular.module('app', ['ionic', ...])
.config(function($ionicConfigProvider) {
$ionicConfigProvider.form.checkbox("square");
//code
})
```
More information: [here](http://ionicframework.com/docs/api/provider/$ionicConfigProvider/) | the code bellow works for the Ionic version 3:
```
.item {
.checkbox {
.checkbox-icon {
border-radius: 0% !important;
}
}
}
``` |
38,393,622 | **ionic check boxes** are showing square in android but in **IOS** its shows rounded.
How we can make them square for IOS? | 2016/07/15 | [
"https://Stackoverflow.com/questions/38393622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6269831/"
] | Use checkbox-square system defind css class in your checkbox class.
```
<ion-checkbox class="checkbox-square" ng-model="isCheckedCommercial">value 1</ion-checkbox>
```
this will helps you.
If you have any query let me know. | Add this to your scss file.
```
.checkbox-icon {
border-radius: 0%!important
}
``` |
38,393,622 | **ionic check boxes** are showing square in android but in **IOS** its shows rounded.
How we can make them square for IOS? | 2016/07/15 | [
"https://Stackoverflow.com/questions/38393622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6269831/"
] | I just used this.
```
<ion-checkbox mode="md"></ion-checkbox>
``` | Native iOS uses [switches](https://developer.apple.com/ios/human-interface-guidelines/ui-controls/switches/). Ionic tries to use components that are like native controls. Not too successfully this time, but perhaps circles are closer to the native iOS feeling. So I'd stick with it: using ionic means also to follow thei... |
38,393,622 | **ionic check boxes** are showing square in android but in **IOS** its shows rounded.
How we can make them square for IOS? | 2016/07/15 | [
"https://Stackoverflow.com/questions/38393622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6269831/"
] | I just used this.
```
<ion-checkbox mode="md"></ion-checkbox>
``` | You can set globally with:
$ionicConfigProvider.form.checkbox("circle");
```
angular.module('app', ['ionic', ...])
.config(function($ionicConfigProvider) {
$ionicConfigProvider.form.checkbox("square");
//code
})
```
More information: [here](http://ionicframework.com/docs/api/provider/$ionicConfigProvider/) |
38,393,622 | **ionic check boxes** are showing square in android but in **IOS** its shows rounded.
How we can make them square for IOS? | 2016/07/15 | [
"https://Stackoverflow.com/questions/38393622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6269831/"
] | Use checkbox-square system defind css class in your checkbox class.
```
<ion-checkbox class="checkbox-square" ng-model="isCheckedCommercial">value 1</ion-checkbox>
```
this will helps you.
If you have any query let me know. | the code bellow works for the Ionic version 3:
```
.item {
.checkbox {
.checkbox-icon {
border-radius: 0% !important;
}
}
}
``` |
38,393,622 | **ionic check boxes** are showing square in android but in **IOS** its shows rounded.
How we can make them square for IOS? | 2016/07/15 | [
"https://Stackoverflow.com/questions/38393622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6269831/"
] | Use checkbox-square system defind css class in your checkbox class.
```
<ion-checkbox class="checkbox-square" ng-model="isCheckedCommercial">value 1</ion-checkbox>
```
this will helps you.
If you have any query let me know. | You can set globally with:
$ionicConfigProvider.form.checkbox("circle");
```
angular.module('app', ['ionic', ...])
.config(function($ionicConfigProvider) {
$ionicConfigProvider.form.checkbox("square");
//code
})
```
More information: [here](http://ionicframework.com/docs/api/provider/$ionicConfigProvider/) |
38,393,622 | **ionic check boxes** are showing square in android but in **IOS** its shows rounded.
How we can make them square for IOS? | 2016/07/15 | [
"https://Stackoverflow.com/questions/38393622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6269831/"
] | Use checkbox-square system defind css class in your checkbox class.
```
<ion-checkbox class="checkbox-square" ng-model="isCheckedCommercial">value 1</ion-checkbox>
```
this will helps you.
If you have any query let me know. | Native iOS uses [switches](https://developer.apple.com/ios/human-interface-guidelines/ui-controls/switches/). Ionic tries to use components that are like native controls. Not too successfully this time, but perhaps circles are closer to the native iOS feeling. So I'd stick with it: using ionic means also to follow thei... |
38,393,622 | **ionic check boxes** are showing square in android but in **IOS** its shows rounded.
How we can make them square for IOS? | 2016/07/15 | [
"https://Stackoverflow.com/questions/38393622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6269831/"
] | You can set globally with:
$ionicConfigProvider.form.checkbox("circle");
```
angular.module('app', ['ionic', ...])
.config(function($ionicConfigProvider) {
$ionicConfigProvider.form.checkbox("square");
//code
})
```
More information: [here](http://ionicframework.com/docs/api/provider/$ionicConfigProvider/) | Native iOS uses [switches](https://developer.apple.com/ios/human-interface-guidelines/ui-controls/switches/). Ionic tries to use components that are like native controls. Not too successfully this time, but perhaps circles are closer to the native iOS feeling. So I'd stick with it: using ionic means also to follow thei... |
38,393,622 | **ionic check boxes** are showing square in android but in **IOS** its shows rounded.
How we can make them square for IOS? | 2016/07/15 | [
"https://Stackoverflow.com/questions/38393622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6269831/"
] | I just used this.
```
<ion-checkbox mode="md"></ion-checkbox>
``` | Add this to your scss file.
```
.checkbox-icon {
border-radius: 0%!important
}
``` |
46,530,283 | I'm learning python, and am stuck on a project. The main part of the project was to code the collatz sequence, which wasn't a problem. The next part is to validate the user input using try and except, in order to make sure only an integer value is given in.
So far, I have the following code:
```
def collatz(number):
... | 2017/10/02 | [
"https://Stackoverflow.com/questions/46530283",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4334892/"
] | You can use:
```
valid=False
while not valid:
try:
number=int(input())
valid=True
except ValueError:
print('Incorrect type of data entered.\nPlease enter an integer!')
``` | Just use `isinstance(x, int)`, where x is input.
It returns True if x is an int. Just another solution, in case you were looking for a different way! |
2,351,562 | In Drupal 6, I have created a view, displayed as a block. My goal is to display some text if the view returns results, and hide it if the view is empty. I am using Header for the text, and this works perfectly except for the requirement to show at least one field. I can't save the view if I don't set any fields for dis... | 2010/02/28 | [
"https://Stackoverflow.com/questions/2351562",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/263967/"
] | You should be able add a field and check its "exclude from display" checkbox. | Do as Scott say, and select for "Row Style" = Node, so Fields will not required anymore... |
2,351,562 | In Drupal 6, I have created a view, displayed as a block. My goal is to display some text if the view returns results, and hide it if the view is empty. I am using Header for the text, and this works perfectly except for the requirement to show at least one field. I can't save the view if I don't set any fields for dis... | 2010/02/28 | [
"https://Stackoverflow.com/questions/2351562",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/263967/"
] | The user nevets on the Drupal forums gave a great example that helped me solve this. Check out <http://drupal.org/node/728336#comment-2659760> for the information. | You should be able add a field and check its "exclude from display" checkbox. |
2,351,562 | In Drupal 6, I have created a view, displayed as a block. My goal is to display some text if the view returns results, and hide it if the view is empty. I am using Header for the text, and this works perfectly except for the requirement to show at least one field. I can't save the view if I don't set any fields for dis... | 2010/02/28 | [
"https://Stackoverflow.com/questions/2351562",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/263967/"
] | You should be able add a field and check its "exclude from display" checkbox. | Change the **show** link under **Format** option of view, your objective will be accomplished. |
2,351,562 | In Drupal 6, I have created a view, displayed as a block. My goal is to display some text if the view returns results, and hide it if the view is empty. I am using Header for the text, and this works perfectly except for the requirement to show at least one field. I can't save the view if I don't set any fields for dis... | 2010/02/28 | [
"https://Stackoverflow.com/questions/2351562",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/263967/"
] | The user nevets on the Drupal forums gave a great example that helped me solve this. Check out <http://drupal.org/node/728336#comment-2659760> for the information. | Do as Scott say, and select for "Row Style" = Node, so Fields will not required anymore... |
2,351,562 | In Drupal 6, I have created a view, displayed as a block. My goal is to display some text if the view returns results, and hide it if the view is empty. I am using Header for the text, and this works perfectly except for the requirement to show at least one field. I can't save the view if I don't set any fields for dis... | 2010/02/28 | [
"https://Stackoverflow.com/questions/2351562",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/263967/"
] | The user nevets on the Drupal forums gave a great example that helped me solve this. Check out <http://drupal.org/node/728336#comment-2659760> for the information. | Change the **show** link under **Format** option of view, your objective will be accomplished. |
34,509,967 | Let's say, I have 3 tables: *appointments*, *doctors* and *departments*.
**appointments:**
```
id status doctor_id
---- --------- ---------
1 approved 1
2 cancelled 4
3 approved 4
4 approved 1
5 approved 4
6 NULL 5
7 approved 2
8 NULL ... | 2015/12/29 | [
"https://Stackoverflow.com/questions/34509967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3084708/"
] | I tried to work out a solution that fits your example and the requirements you wrote, but I'm not sure, if I got it entirely:
```
(?:;:)(\S+(?:{.*?}(?=[^}]*$|;[^}]*;:)))
```
This uses a positive lookahead to ensure that the last closing bracket is catched correctly (it has to be followed by the end of the string or ... | Try this regEx
```
(:or{.*?\};{1,})|(:and{.*\};)|(:!{.*?\};{0,})
```
I can't guarantee for any other complex case, but it is definitely what you have mentioned as output **Except extra ';'**
```
"firstName =:'Mon';lastName =:'Arthur';:or{size >:'20';lastName ^:'H';:and{company |:'lon';:or{company |:'we'}}};lastName... |
1,541,587 | Ubuntu 20-04 Guest OS
My Host is Windows 10
Using VMWare Workstation Tech preview 20H1
I'd like to ensure that ip address X is static, i.e always the same for a particular VM client X
eg my Ubuntu 2004 Client is known as node1
I believe this is known as DHCP Reservation
(<https://lifehacker.com/how-to-set-up-dhcp-re... | 2020/04/13 | [
"https://superuser.com/questions/1541587",
"https://superuser.com",
"https://superuser.com/users/69922/"
] | Use System Report
-----------------
The following worked for me:
1. Click on the Apple icon then **About This Mac**
2. Click on **System Report**
3. In the left column, Click on **Software > Extensions**
4. (Be patient -- it might take a while to load up the info)
5. Click on the **Obtained From** column so you can s... | Don't panic. Your Mac will continue to work fine. Check out these two links. They have good info on the subject:
<https://www.idownloadblog.com/2018/06/19/legacy-apps-macos-mojave/>
<https://www.macrumors.com/2020/03/25/mac-legacy-system-extension-warning/>
I was able to find the culprit apps in different folders, a... |
104,325 | In Emacs I can run a shell using following commands -
```
M-x term
M-x shell
M-x eshell
```
What is the difference between these three? | 2013/12/09 | [
"https://unix.stackexchange.com/questions/104325",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/19506/"
] | [`shell`](https://www.gnu.org/software/emacs/manual/html_node/emacs/Shell-Mode.html) is the oldest of these 3 choices. It uses Emacs's `comint-mode` to run a subshell (e.g. `bash`). In this mode, you're using Emacs to edit a command line. The subprocess doesn't see any input until you press Enter. Emacs is acting like ... | According to [Xahlee page](http://ergoemacs.org/emacs/emacs_shell_vs_term_vs_ansi-term_vs_eshell.html):
`shell` is the standard emacs interface to Operating System's command line interface.
`term` (ansi-term is pretty much same to term today. They were different packages, but now both defined in term.el) is a termina... |
29,089,023 | I'm launching a container which runs a bash script that does a docker build internally using docker 1.3.2 on Centos 7.0.1406 . The files/commands are at <https://gist.github.com/wrabbit-revisited/1d70d0f1805be1848c08> .
The docker build needs access to the docker socket so i use a common trick, as per <http://nathanle... | 2015/03/16 | [
"https://Stackoverflow.com/questions/29089023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4233608/"
] | I think your problem might be due to a misunderstanding of the `-v` option to `docker run`. You say you did
```
-v /var/run/docker:/var/run/docker
```
This creates a bind mount in the container for the file or directory `/var/run/docker`. But in your case, there is no such file or directory. You want the file `/var/... | Confirmed installing <https://github.com/dpw/selinux-dockersock> is enough and good in the long run.
A quick alternative fix is to pass `--privileged` argument, when starting a container. |
44,579,491 | I have this code and I want to implement this on my app. But I am thinking that this code is freezing my browser? What is the best and right way to implement this loop so I can get an updated data on my browser without using a lot of memory?
```js
$scope.mydata = {};
function GetData(){
$http({
... | 2017/06/16 | [
"https://Stackoverflow.com/questions/44579491",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2671261/"
] | Web Worker
==========
I would suggest moving this effectively infinite loop into a [Web Worker](https://www.html5rocks.com/en/tutorials/workers/basics/) which can post messages back to the main thread whenever they're useful.
A couple of other useful resources for learning about them are:
* [w3schools](https://www.w... | The problem is, you are trying to call the `GetData` function in the function itself. If you want to process the data returned by that function, you should call that function with a different name.
I have created a [JSFiddle](http://jsfiddle.net/sahansera/bkUEu/4812/) for you to simulate your problem
First, open the ... |
44,579,491 | I have this code and I want to implement this on my app. But I am thinking that this code is freezing my browser? What is the best and right way to implement this loop so I can get an updated data on my browser without using a lot of memory?
```js
$scope.mydata = {};
function GetData(){
$http({
... | 2017/06/16 | [
"https://Stackoverflow.com/questions/44579491",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2671261/"
] | Web Worker
==========
I would suggest moving this effectively infinite loop into a [Web Worker](https://www.html5rocks.com/en/tutorials/workers/basics/) which can post messages back to the main thread whenever they're useful.
A couple of other useful resources for learning about them are:
* [w3schools](https://www.w... | Can u show the data that you are getting from the API call. You must have pagination enabled, if you are not sending the data in a single API call, also you are updating the same variable, how will you use the data if the data keeps changing.
You should probably add the data that is coming from the api to $scope.data.
... |
5,501,073 | I am using this jquery plugin for called tokeninput it's for autosuggestion when typing:
the code here generates the autosuggestion for the input box:
```
$("#input-auto").tokenInput("topicGet.php", {
theme: "facebook"
});
```
but when I try to append the input which uses the `#input-aut... | 2011/03/31 | [
"https://Stackoverflow.com/questions/5501073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/455355/"
] | Looks like you're probably initializing the autosuggestion BEFORE you add the input into the DOM. You have to remember that jQuery is stupid, and only does things in the order that you tell it. When you initially 'generate' the autosuggestion, if it can't find it in the DOM at *that moment*, it won't do *anything*! So,... | Calling tokenInput on page load when input-auto doesn't yet exist is your problem.
```
$('.topicEdit').live('click', function() {
$('#Qtopics').html('<input type="text" id="input-auto" />');
$("#input-auto").tokenInput("topicGet.php", {
theme: "facebook"
});
});
``` |
5,501,073 | I am using this jquery plugin for called tokeninput it's for autosuggestion when typing:
the code here generates the autosuggestion for the input box:
```
$("#input-auto").tokenInput("topicGet.php", {
theme: "facebook"
});
```
but when I try to append the input which uses the `#input-aut... | 2011/03/31 | [
"https://Stackoverflow.com/questions/5501073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/455355/"
] | Looks like you're probably initializing the autosuggestion BEFORE you add the input into the DOM. You have to remember that jQuery is stupid, and only does things in the order that you tell it. When you initially 'generate' the autosuggestion, if it can't find it in the DOM at *that moment*, it won't do *anything*! So,... | I'm not exactly sure what the problem is, but try using [livequery](http://docs.jquery.com/Plugins/livequery) plugin. You don't need to specify an event to it, just a function which will run for all current and future elements that match the selector.
Example:
```
$(".something").livequery(function () {
// do so... |
55,262 | >
> Let $G=G\_1 \times G\_2 \times \cdots \times G\_n$ where $G\_i$ are abelian groups. Prove that Aut$G$ is isomorphic with the group of all invertible $n \times n$ matrices whose $(i,j)$ entries belong to Hom$(G\_i,G\_j)$, the usual matrix product being the group operation.
>
>
>
Given the structure of abelian g... | 2011/08/03 | [
"https://math.stackexchange.com/questions/55262",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/4736/"
] | Like Qiaochu says, the key here is that the direct product of finitely many abelian groups functions as both the (categorical) product and the (categorical) coproduct in the category of abelian groups.
And before your eyes glaze over, what that means is that:
1. A homomorphism from an abelian group $A$ *into* a (fini... | Here are some hints:
Given a general automorphism $\phi$, consider the restriction $\phi\_i$ of $\phi$ to $G\_i$ and composition with the projections $\pi\_j:G\longrightarrow G\_j$. What sort of animal is $\phi\_{i,j}=\pi\_j\circ \phi\_i$? Show that the collection of these animals for $1\leq i,j\leq n$ determines $\ph... |
44,531,474 | I am parsing a JSON file in my controller and have try/catch functionality. The catch for the JSON populates the ViewBag and I want to print it in the view if there is an error. However the ViewBag.Error does not print to the screen. I broke into the view and the string is there. It just doesn't print.
This is the re... | 2017/06/13 | [
"https://Stackoverflow.com/questions/44531474",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1327418/"
] | The problem is with the period(.) character in your exception message.Look at the json exception message and you usually will find a dot(.) in it.
HTML label element gets confused if you have a point . in the **first parameter** because it expects a property expression there.
Use `Label(string expression, string labe... | You should just print the value directly:
```
@ViewBag.Error
```
**Do not call `Html.Raw()`**, since your value is not HTML. |
44,531,474 | I am parsing a JSON file in my controller and have try/catch functionality. The catch for the JSON populates the ViewBag and I want to print it in the view if there is an error. However the ViewBag.Error does not print to the screen. I broke into the view and the string is there. It just doesn't print.
This is the re... | 2017/06/13 | [
"https://Stackoverflow.com/questions/44531474",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1327418/"
] | You should just print the value directly:
```
@ViewBag.Error
```
**Do not call `Html.Raw()`**, since your value is not HTML. | **ViewData and TempData require typecasting and null checking whereas ViewBag doesn't need such checking.**
If you interested for More info kindly refer here:<http://www.binaryintellect.net/articles/36941654-8bd4-4535-9226-ddf47841892f.aspx>
**So in your view you can simply write like below:**
```
@ViewBag.Error
... |
44,531,474 | I am parsing a JSON file in my controller and have try/catch functionality. The catch for the JSON populates the ViewBag and I want to print it in the view if there is an error. However the ViewBag.Error does not print to the screen. I broke into the view and the string is there. It just doesn't print.
This is the re... | 2017/06/13 | [
"https://Stackoverflow.com/questions/44531474",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1327418/"
] | The problem is with the period(.) character in your exception message.Look at the json exception message and you usually will find a dot(.) in it.
HTML label element gets confused if you have a point . in the **first parameter** because it expects a property expression there.
Use `Label(string expression, string labe... | **ViewData and TempData require typecasting and null checking whereas ViewBag doesn't need such checking.**
If you interested for More info kindly refer here:<http://www.binaryintellect.net/articles/36941654-8bd4-4535-9226-ddf47841892f.aspx>
**So in your view you can simply write like below:**
```
@ViewBag.Error
... |
5,083,031 | Here is my problem.
I'm doing a little weather web app in flash.
So i read an xml feed and copose an array of data from it.
my xml is like this
```
<xml>
<prevision>
<date>22</date>
<hour>5</hour>
<temperature>40</temperature>
</prevision>
<prevision>
<date>22</date>
<hour>10</hour>
<temperature>44</temperature>
</p... | 2011/02/22 | [
"https://Stackoverflow.com/questions/5083031",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/367864/"
] | Couldn't come up with a more elegant solution but try this:
```
results = Goal.connection.select_all('SELECT COUNT(*) as amount, event_id FROM goals GROUP BY event_id ORDER BY amount DESC LIMIT 0, xx')
raise results.inspect
```
If you just want the one most event\_id with most entries you can also use:
```
event_id... | If you have set up your models correctly you should be able to do this (if this is not the case then: **setup your models correctly**):
```
if Event.all.length == 0
return
end
eventMax = Event.first
Event.all.each do |e|
eventMax = e.goals.length>eventMax.goals.length?e:eventMax
end
#output or do whatever wi... |
7,882,028 | I am more of a frontend guy, so if these questions come out stupid, I apologize in advance :)
I am designing a database schema for an e-commerce site. The product sold on this site can contain other products. Eq: Think of a car as a product. Car can also contain other products like seats, steering wheel, windshield, e... | 2011/10/24 | [
"https://Stackoverflow.com/questions/7882028",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/58505/"
] | Question 1:
Do not include a column with comma separated IDs. You will end up hating life. It's hard to query, hard to update and does not allow you to enforce data integrity. I would recommend using something like this:
```
Product
--------
ProductId
ProductName
ParentProductId --nullable
```
This will give you a... | Without knowing more, this should fit your needs:
Q1.
Products table with ids
Contains table with multiple rows of containing product id and contained product id
Q2.
Discounts table which has:
Discount Start datetime
Discount End datetime
Amount decimal
Amount type - percentage or straight dollar a... |
34,905,333 | I am debugging some code. My debugger shows that the origin of code is from Thread.run(). I need to know from which part of code Thread.start() was called! Is there a way to find this out? | 2016/01/20 | [
"https://Stackoverflow.com/questions/34905333",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3486720/"
] | You can use `new Throwable().getStackTrace()` to get a full stack trace. To get the `start` stack you must extend `Thread`, one of the few times it is actually necessary to do so (mostly using `Runnable` is preferred).
```
class C extends Thread {
StackTraceElement[] constructed;
StackTraceElement[] started;
... | I found a crude and effective technique using Eclipse or any other IDE. Suppose you have a breakpoint in your Runnable or Callable, and thread pauses there... no double one can't figure out from where start was called right away... *but*, just right click Runnable/Callable constructor and click 'show call hierarchy'.. ... |
7,031 | On my webform, there are two kinds of address-fields a user can give. But since it's a complex webform (Drupal) it's kind of hard to achieve. Every time a user adds an extra address, the form is regenerated and there will be a new item added to the `$address_afl` and `$address_bev`-array. Is it possible to compress thi... | 2011/12/20 | [
"https://codereview.stackexchange.com/questions/7031",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/9309/"
] | I don't quite exactly understand the logic, but you could extract out at least one method which removes lots of code duplication. I've inverted some conditions (which improves code readability) and placed some comments into the code too.
```
function processValue(&$form, $value, $i, &$form_sub) {
if (!is_array($va... | You should be able to factor all those duplicates down into 2 function calls.
I think palacsint's observation is correct that `$test` is always an array here. In fact, I'm not sure I see why you don't just use the keys in `$value` directly. It doesn't appear the keys get changed in the loop.
```
if (is_array($value)... |
38,270,905 | This question is going to be similar, but looking for something completely different than one I asked a few days ago.
I have a string that is known, but is a portion of code, and it varies, I currently find it by using:
```
for num, line in enumerate(code, 1):
if re.match("function (.*) {", line):
```
That get... | 2016/07/08 | [
"https://Stackoverflow.com/questions/38270905",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4285665/"
] | You mean the text between `(` and `)`?
Use capturing groups:
```
m = re.match("function (.*) {", line):
if m:
print m.group(1)
``` | The match object object which is returned contains all contents of groups. I would use re.search if 'function' isn't always at the beginning of a line and '.+' to match functions with at least one character.
```
line_to_fn = {}
for num, line in enumerate(code, 1):
match = re.search("function (.+) {", line)
if... |
10,371,861 | I have a database on my student server, I need to go to my university if I want to access the database properties using the SQL server DBMS, it is a pain. I want to know if I can change the identity specification by using SQL on a specific table? I cannot insert to a table as this is not selected to yes, I want to be a... | 2012/04/29 | [
"https://Stackoverflow.com/questions/10371861",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/567371/"
] | `IDENTITY_INSERT` is the correct syntax, although you appear to have missed off the `SET` keyword in your usage. See this line:
```
$query = "IDENTITY_INSERT customers ON ";
```
Change to:
```
$query = "SET IDENTITY_INSERT customers ON ";
``` | I solved the problem, it was of course not set to identity specification yes. First I dropped the table column customerID, and the recreated it using this query:
```
$query = "Alter table customers add customerID INT IDENTITY(1,1) not null";
```
This created the column again but setting it to identity yes.
I couldn... |
29,340,037 | I try to save the datagridview data into the database. But I don't know how to store it. I try some methods but it return error. So please I need to know how to rectify this error and my code is
```
string Stu_rollno = dataGridView1.Rows[i].Cells[1];
string sub_code = dataGridView1.Rows[i].Cells[2];
```
My error is;... | 2015/03/30 | [
"https://Stackoverflow.com/questions/29340037",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4711295/"
] | Malloc returns a `void*` pointer to raw allocated memory. Just use a placement new operator on that memory.
```
void* mem = malloc( sizeof(B) );
A* ptr = new(mem) B(); // builds object in location pointed by mem
```
The placement new does not allocate memory, it just constructs your object in the given place. | `new` does a two step construction of an instance of a class. It allocates heap-memory and then calls the constructor of the class to initialize the object.
`operator new(size_t size)` in turn only deals with memory allocation and has a signature similar to `malloc()`. It does not call the constructor for the instance... |
29,340,037 | I try to save the datagridview data into the database. But I don't know how to store it. I try some methods but it return error. So please I need to know how to rectify this error and my code is
```
string Stu_rollno = dataGridView1.Rows[i].Cells[1];
string sub_code = dataGridView1.Rows[i].Cells[2];
```
My error is;... | 2015/03/30 | [
"https://Stackoverflow.com/questions/29340037",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4711295/"
] | The C-way of doing it:
```
A* ptr = (A*)malloc(sizeof(B));
*(B*)ptr = B();
```
---
The C++-way of doing it:
```
A* ptr = static_cast<A*>(malloc(sizeof(B)));
*static_cast<B*>(ptr) = B();
```
---
Note that since we're using C++, we have to cast the return-value of `malloc`.
Due to the "language mixture", there i... | `new` does a two step construction of an instance of a class. It allocates heap-memory and then calls the constructor of the class to initialize the object.
`operator new(size_t size)` in turn only deals with memory allocation and has a signature similar to `malloc()`. It does not call the constructor for the instance... |
385,342 | ```
\begin{equation}
\left\{
\begin{array}{l}
{\bar{\varphi }_{1} =\frac{d_{1} }{d_{1} +d_{n} } \varphi _{n} } \\
{\bar{\varphi }_{i} =\frac{d_{i} }{d_{i} +d_{i-1} } \varphi _{i-1} ,\qquad i=2,...,n-1} \\
{\bar{\varphi }_{n} =\frac{d_{n} }{d_{n} +d_{n-1} } \varphi _{n-1} } \end{array}
\... | 2017/08/08 | [
"https://tex.stackexchange.com/questions/385342",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/140893/"
] | Consider using `dcases` from [`mathtools`](//ctan.org/pkg/mathtools):
[](https://i.stack.imgur.com/Wi1df.png)
```
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{equation}
\begin{dcases}
\bar{\varphi}_1 = \frac{ d_1 }{... | Below code helps you to improve the quality:
```
\begin{equation}
\begin{cases}
\bar{\varphi }_{1} &=\dfrac{d_{1} }{d_{1} +d_{n} } \varphi _{n} \\[6pt]
\bar{\varphi }_{i} &=\dfrac{d_{i} }{d_{i} +d_{i-1} } \varphi _{i-1} ,\qquad i=2,...,n-1 \\[6pt]
\bar{\varphi }_{n} &=\frac{d_{n} }{d_{n} +d_{n-1} } \var... |
30,927,293 | I'm trying to create a variable where when I call or use that variable, it runs a function to do stuff and return a certain variable. An example will make more sense:
```
def establish_client():
a = None
if True:
a = 'A'
return a
>>> print establish_client
'A'
```
It is possible to do this? Basi... | 2015/06/18 | [
"https://Stackoverflow.com/questions/30927293",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5026151/"
] | In the general case: No.
But there are some techniques that might come close.
Properties allow something like that for members in an object.
```
class Demo(object):
@property
def establish_client(self):
a = None
if True:
a = 'A'
return a
d = Demo()
print d.establish_clien... | Note: the following is a hack, and there's probably more than a good reason to not do it.
---
You can achieve something on that line using a `class` and the `__str__()` method:
```
class foo:
def __init__(self):
pass
def __str__(self):
a = None
if True:
a = 'A'
ret... |
17,320,312 | I have a vector that looks something like this:
```
c(0.5,0,0,0,0,0.7,0,0,0,0,0.4,0,0,0,0)
```
Suppose I want to copy the values on positions 1, 6 and 11 (the ones that are not 0) to the four positions following that specific value, to make the vector look like this:
```
c(0.5,0.5,0.5,0.5,0.5,0.7,0.7,0.7,0.7,0.7,0.... | 2013/06/26 | [
"https://Stackoverflow.com/questions/17320312",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2080808/"
] | I'd probably loop through every single element greater 0 using `lapply`, then apply `rep` function to repeat each of these values 5 times and merge the resulting list entries via `do.call("c", ...)`.
```
do.call("c", lapply(which(tmp > 0), function(i) rep(tmp[i], 5)))
[1] 0.5 0.5 0.5 0.5 0.5 0.7 0.7 0.7 0.7 0.7 0.4 0.... | Here is an alternative using `approx`
```
dat <- c(0.5,0,0,0,0,0.7,0,0,0,0,0.4,0,0,0,0)
not.0 <- (dat != 0)
approx(which(not.0), dat[not.0], xout = seq(along.with = dat), method = "constant", yleft = 0, rule = 1:2)
# $x
# [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#
# $y
# [1] 0.5 0.5 0.5 0.5 0.5 0.7 0.7 0.7 0... |
17,320,312 | I have a vector that looks something like this:
```
c(0.5,0,0,0,0,0.7,0,0,0,0,0.4,0,0,0,0)
```
Suppose I want to copy the values on positions 1, 6 and 11 (the ones that are not 0) to the four positions following that specific value, to make the vector look like this:
```
c(0.5,0.5,0.5,0.5,0.5,0.7,0.7,0.7,0.7,0.7,0.... | 2013/06/26 | [
"https://Stackoverflow.com/questions/17320312",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2080808/"
] | I'd probably loop through every single element greater 0 using `lapply`, then apply `rep` function to repeat each of these values 5 times and merge the resulting list entries via `do.call("c", ...)`.
```
do.call("c", lapply(which(tmp > 0), function(i) rep(tmp[i], 5)))
[1] 0.5 0.5 0.5 0.5 0.5 0.7 0.7 0.7 0.7 0.7 0.4 0.... | Here's another base R approach. Initial zeros are left as is:
```
v = c(0,1,2,-2.1,0,3,0,0.4,0,0)
v[v!=0] = diff(c(0, v[v!=0]))
cumsum(v)
# [1] 0.0 1.0 2.0 -2.1 -2.1 3.0 3.0 0.4 0.4 0.4
```
And here are some benchmarks:
```
roland = function(v) {v[v == 0] <- NA; na.locf(v)}
mp = function(x) {with(rle(x), re... |
17,320,312 | I have a vector that looks something like this:
```
c(0.5,0,0,0,0,0.7,0,0,0,0,0.4,0,0,0,0)
```
Suppose I want to copy the values on positions 1, 6 and 11 (the ones that are not 0) to the four positions following that specific value, to make the vector look like this:
```
c(0.5,0.5,0.5,0.5,0.5,0.7,0.7,0.7,0.7,0.7,0.... | 2013/06/26 | [
"https://Stackoverflow.com/questions/17320312",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2080808/"
] | Here's one way:
```
zero.locf <- function(x) {
if (x[1] == 0) stop('x[1] should not be 0')
with(rle(x), {
no.0 <- replace(values, values == 0, values[(values == 0) - 1])
rep(no.0, lengths)
})
}
x <- c(0.5,0,0,0,0,0.7,0,0,0,0,0.4,0,0,0,0)
zero.locf(x)
# [1] 0.5 0.5 0.5 0.5 0.5 0.7 0.7 0.7 0... | Here is an alternative using `approx`
```
dat <- c(0.5,0,0,0,0,0.7,0,0,0,0,0.4,0,0,0,0)
not.0 <- (dat != 0)
approx(which(not.0), dat[not.0], xout = seq(along.with = dat), method = "constant", yleft = 0, rule = 1:2)
# $x
# [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#
# $y
# [1] 0.5 0.5 0.5 0.5 0.5 0.7 0.7 0.7 0... |
17,320,312 | I have a vector that looks something like this:
```
c(0.5,0,0,0,0,0.7,0,0,0,0,0.4,0,0,0,0)
```
Suppose I want to copy the values on positions 1, 6 and 11 (the ones that are not 0) to the four positions following that specific value, to make the vector look like this:
```
c(0.5,0.5,0.5,0.5,0.5,0.7,0.7,0.7,0.7,0.7,0.... | 2013/06/26 | [
"https://Stackoverflow.com/questions/17320312",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2080808/"
] | Here's one way:
```
zero.locf <- function(x) {
if (x[1] == 0) stop('x[1] should not be 0')
with(rle(x), {
no.0 <- replace(values, values == 0, values[(values == 0) - 1])
rep(no.0, lengths)
})
}
x <- c(0.5,0,0,0,0,0.7,0,0,0,0,0.4,0,0,0,0)
zero.locf(x)
# [1] 0.5 0.5 0.5 0.5 0.5 0.7 0.7 0.7 0... | Here's another base R approach. Initial zeros are left as is:
```
v = c(0,1,2,-2.1,0,3,0,0.4,0,0)
v[v!=0] = diff(c(0, v[v!=0]))
cumsum(v)
# [1] 0.0 1.0 2.0 -2.1 -2.1 3.0 3.0 0.4 0.4 0.4
```
And here are some benchmarks:
```
roland = function(v) {v[v == 0] <- NA; na.locf(v)}
mp = function(x) {with(rle(x), re... |
17,320,312 | I have a vector that looks something like this:
```
c(0.5,0,0,0,0,0.7,0,0,0,0,0.4,0,0,0,0)
```
Suppose I want to copy the values on positions 1, 6 and 11 (the ones that are not 0) to the four positions following that specific value, to make the vector look like this:
```
c(0.5,0.5,0.5,0.5,0.5,0.7,0.7,0.7,0.7,0.7,0.... | 2013/06/26 | [
"https://Stackoverflow.com/questions/17320312",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2080808/"
] | Another possibility:
```
vec <- c(0.5,0,0,0,0,0.7,0,0,0,0,0.4,0,0,0,0)
library(zoo)
vec[vec==0] <- NA
na.locf(vec)
#[1] 0.5 0.5 0.5 0.5 0.5 0.7 0.7 0.7 0.7 0.7 0.4 0.4 0.4 0.4 0.4
``` | Here is an alternative using `approx`
```
dat <- c(0.5,0,0,0,0,0.7,0,0,0,0,0.4,0,0,0,0)
not.0 <- (dat != 0)
approx(which(not.0), dat[not.0], xout = seq(along.with = dat), method = "constant", yleft = 0, rule = 1:2)
# $x
# [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#
# $y
# [1] 0.5 0.5 0.5 0.5 0.5 0.7 0.7 0.7 0... |
17,320,312 | I have a vector that looks something like this:
```
c(0.5,0,0,0,0,0.7,0,0,0,0,0.4,0,0,0,0)
```
Suppose I want to copy the values on positions 1, 6 and 11 (the ones that are not 0) to the four positions following that specific value, to make the vector look like this:
```
c(0.5,0.5,0.5,0.5,0.5,0.7,0.7,0.7,0.7,0.7,0.... | 2013/06/26 | [
"https://Stackoverflow.com/questions/17320312",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2080808/"
] | Another possibility:
```
vec <- c(0.5,0,0,0,0,0.7,0,0,0,0,0.4,0,0,0,0)
library(zoo)
vec[vec==0] <- NA
na.locf(vec)
#[1] 0.5 0.5 0.5 0.5 0.5 0.7 0.7 0.7 0.7 0.7 0.4 0.4 0.4 0.4 0.4
``` | Here's another base R approach. Initial zeros are left as is:
```
v = c(0,1,2,-2.1,0,3,0,0.4,0,0)
v[v!=0] = diff(c(0, v[v!=0]))
cumsum(v)
# [1] 0.0 1.0 2.0 -2.1 -2.1 3.0 3.0 0.4 0.4 0.4
```
And here are some benchmarks:
```
roland = function(v) {v[v == 0] <- NA; na.locf(v)}
mp = function(x) {with(rle(x), re... |
17,320,312 | I have a vector that looks something like this:
```
c(0.5,0,0,0,0,0.7,0,0,0,0,0.4,0,0,0,0)
```
Suppose I want to copy the values on positions 1, 6 and 11 (the ones that are not 0) to the four positions following that specific value, to make the vector look like this:
```
c(0.5,0.5,0.5,0.5,0.5,0.7,0.7,0.7,0.7,0.7,0.... | 2013/06/26 | [
"https://Stackoverflow.com/questions/17320312",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2080808/"
] | Here's another base R approach. Initial zeros are left as is:
```
v = c(0,1,2,-2.1,0,3,0,0.4,0,0)
v[v!=0] = diff(c(0, v[v!=0]))
cumsum(v)
# [1] 0.0 1.0 2.0 -2.1 -2.1 3.0 3.0 0.4 0.4 0.4
```
And here are some benchmarks:
```
roland = function(v) {v[v == 0] <- NA; na.locf(v)}
mp = function(x) {with(rle(x), re... | Here is an alternative using `approx`
```
dat <- c(0.5,0,0,0,0,0.7,0,0,0,0,0.4,0,0,0,0)
not.0 <- (dat != 0)
approx(which(not.0), dat[not.0], xout = seq(along.with = dat), method = "constant", yleft = 0, rule = 1:2)
# $x
# [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#
# $y
# [1] 0.5 0.5 0.5 0.5 0.5 0.7 0.7 0.7 0... |
56,124 | Can I run a 64-bit VMware image on a 32-bit machine?
I've googled this, but there doesn't seem to be a conclusive answer.
I know that it would have to be completely emulated and would run like a dog - but slow performance isn't necessarily an issue as I'm just interested in testing some of my background services code... | 2008/09/11 | [
"https://Stackoverflow.com/questions/56124",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1078/"
] | Yes, running a 64-bit OS in VMWare is possible from a 32-bit OS if you have a 64 bit processor.
I have an old Intel [Core 2 Duo](http://en.wikipedia.org/wiki/Intel_Core#Core_2_Duo) with Windows XP Professional 2002 running on it, and I got it to work.
First of all, see if your CPU is capable of running a 64-bit OS. S... | Yes, you can. I have a 64-bit Debian running in VMware on Windows XP 32-Bit. As long as you set the Guest to use two processors, it will work just fine. |
56,124 | Can I run a 64-bit VMware image on a 32-bit machine?
I've googled this, but there doesn't seem to be a conclusive answer.
I know that it would have to be completely emulated and would run like a dog - but slow performance isn't necessarily an issue as I'm just interested in testing some of my background services code... | 2008/09/11 | [
"https://Stackoverflow.com/questions/56124",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1078/"
] | It boils down to whether the CPU in your machine has the the VT bit (Virtualization), and the BIOS enables you to turn it on. For instance, my laptop is a *[Core 2 Duo](http://en.wikipedia.org/wiki/Intel_Core#Core_2_Duo)* which is capable of using this. However, my BIOS doesn't enable me to turn it on.
Note that I've ... | You can if your processor is 64-bit and Virtualization Technology (VT) extension is enabled (it can be switched off in BIOS). You can't do it on 32-bit processor.
To check this under Linux you just need to look into */proc/cpuinfo* file. Just look for the appropriate flag (**vmx** for Intel processor or **svm** for AM... |
56,124 | Can I run a 64-bit VMware image on a 32-bit machine?
I've googled this, but there doesn't seem to be a conclusive answer.
I know that it would have to be completely emulated and would run like a dog - but slow performance isn't necessarily an issue as I'm just interested in testing some of my background services code... | 2008/09/11 | [
"https://Stackoverflow.com/questions/56124",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1078/"
] | The easiest way to check your workstation is to download the [VMware Processor Check for 64-Bit Compatibility](http://downloads.vmware.com/d/details/processor_check_5_5_dt/dCpiQGhkYmRAZQ==) tool from the VMware website.
You can't run a 64-bit VM session on a 32-bit processor. However, you can run a 64-bit VM session i... | Yes, running a 64-bit OS in VMWare is possible from a 32-bit OS if you have a 64 bit processor.
I have an old Intel [Core 2 Duo](http://en.wikipedia.org/wiki/Intel_Core#Core_2_Duo) with Windows XP Professional 2002 running on it, and I got it to work.
First of all, see if your CPU is capable of running a 64-bit OS. S... |
56,124 | Can I run a 64-bit VMware image on a 32-bit machine?
I've googled this, but there doesn't seem to be a conclusive answer.
I know that it would have to be completely emulated and would run like a dog - but slow performance isn't necessarily an issue as I'm just interested in testing some of my background services code... | 2008/09/11 | [
"https://Stackoverflow.com/questions/56124",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1078/"
] | If your hardware is 32-bit only, then no. If you have 64 bit hardware and a 32-bit operating system, then maybe. See *[Hardware and Firmware Requirements for 64-Bit Guest Operating Systems](http://kb.vmware.com/selfservice/dynamickc.do?externalId=1901&sliceId=1&command=show&forward=nonthreadedKC&kcId=1901)* for details... | It boils down to whether the CPU in your machine has the the VT bit (Virtualization), and the BIOS enables you to turn it on. For instance, my laptop is a *[Core 2 Duo](http://en.wikipedia.org/wiki/Intel_Core#Core_2_Duo)* which is capable of using this. However, my BIOS doesn't enable me to turn it on.
Note that I've ... |
56,124 | Can I run a 64-bit VMware image on a 32-bit machine?
I've googled this, but there doesn't seem to be a conclusive answer.
I know that it would have to be completely emulated and would run like a dog - but slow performance isn't necessarily an issue as I'm just interested in testing some of my background services code... | 2008/09/11 | [
"https://Stackoverflow.com/questions/56124",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1078/"
] | If your hardware is 32-bit only, then no. If you have 64 bit hardware and a 32-bit operating system, then maybe. See *[Hardware and Firmware Requirements for 64-Bit Guest Operating Systems](http://kb.vmware.com/selfservice/dynamickc.do?externalId=1901&sliceId=1&command=show&forward=nonthreadedKC&kcId=1901)* for details... | I honestly doubt it, for a number of reasons, but the most important one is that there are some instructions that are allowed in 32-bit mode, but not in 64-bit mode. Specifically, the REX prefix that is used to encode some instructions and registers in 64-bit mode is a byte of the form 0x4f:0x40, but in 32 bit mode the... |
56,124 | Can I run a 64-bit VMware image on a 32-bit machine?
I've googled this, but there doesn't seem to be a conclusive answer.
I know that it would have to be completely emulated and would run like a dog - but slow performance isn't necessarily an issue as I'm just interested in testing some of my background services code... | 2008/09/11 | [
"https://Stackoverflow.com/questions/56124",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1078/"
] | If your hardware is 32-bit only, then no. If you have 64 bit hardware and a 32-bit operating system, then maybe. See *[Hardware and Firmware Requirements for 64-Bit Guest Operating Systems](http://kb.vmware.com/selfservice/dynamickc.do?externalId=1901&sliceId=1&command=show&forward=nonthreadedKC&kcId=1901)* for details... | You can if your processor is 64-bit and Virtualization Technology (VT) extension is enabled (it can be switched off in BIOS). You can't do it on 32-bit processor.
To check this under Linux you just need to look into */proc/cpuinfo* file. Just look for the appropriate flag (**vmx** for Intel processor or **svm** for AM... |
56,124 | Can I run a 64-bit VMware image on a 32-bit machine?
I've googled this, but there doesn't seem to be a conclusive answer.
I know that it would have to be completely emulated and would run like a dog - but slow performance isn't necessarily an issue as I'm just interested in testing some of my background services code... | 2008/09/11 | [
"https://Stackoverflow.com/questions/56124",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1078/"
] | If you have 32-bit hardware, no, you cannot run a 64-bit guest OS. ["VMware software does not emulate an instruction set for different hardware not physically present"](http://en.wikipedia.org/wiki/VMware#Core_product_design).
However, QEMU *can* emulate a 64-bit processor, so you could convert the VMWare machine and ... | You can if your processor is 64-bit and Virtualization Technology (VT) extension is enabled (it can be switched off in BIOS). You can't do it on 32-bit processor.
To check this under Linux you just need to look into */proc/cpuinfo* file. Just look for the appropriate flag (**vmx** for Intel processor or **svm** for AM... |
56,124 | Can I run a 64-bit VMware image on a 32-bit machine?
I've googled this, but there doesn't seem to be a conclusive answer.
I know that it would have to be completely emulated and would run like a dog - but slow performance isn't necessarily an issue as I'm just interested in testing some of my background services code... | 2008/09/11 | [
"https://Stackoverflow.com/questions/56124",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1078/"
] | The easiest way to check your workstation is to download the [VMware Processor Check for 64-Bit Compatibility](http://downloads.vmware.com/d/details/processor_check_5_5_dt/dCpiQGhkYmRAZQ==) tool from the VMware website.
You can't run a 64-bit VM session on a 32-bit processor. However, you can run a 64-bit VM session i... | VMware? No. However, [QEMU](http://en.wikipedia.org/wiki/QEMU) has an x86\_64 system target that you can use. You likely won't be able to use a VMware image directly (IIRC, there's no conversion tool), but you can install the OS and such yourself and work inside it. QEMU can be a bit of a PITA to get up and running, bu... |
56,124 | Can I run a 64-bit VMware image on a 32-bit machine?
I've googled this, but there doesn't seem to be a conclusive answer.
I know that it would have to be completely emulated and would run like a dog - but slow performance isn't necessarily an issue as I'm just interested in testing some of my background services code... | 2008/09/11 | [
"https://Stackoverflow.com/questions/56124",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1078/"
] | VMware does not allow you to run a 64-bit guest on a 32-bit host. You just have to read the documentation to find this out.
If you really want to do this, you can use QEMU, and I recommend a Linux host, but it's going to be very slow (I really mean slow). | You can if your processor is 64-bit and Virtualization Technology (VT) extension is enabled (it can be switched off in BIOS). You can't do it on 32-bit processor.
To check this under Linux you just need to look into */proc/cpuinfo* file. Just look for the appropriate flag (**vmx** for Intel processor or **svm** for AM... |
56,124 | Can I run a 64-bit VMware image on a 32-bit machine?
I've googled this, but there doesn't seem to be a conclusive answer.
I know that it would have to be completely emulated and would run like a dog - but slow performance isn't necessarily an issue as I'm just interested in testing some of my background services code... | 2008/09/11 | [
"https://Stackoverflow.com/questions/56124",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1078/"
] | If you have 32-bit hardware, no, you cannot run a 64-bit guest OS. ["VMware software does not emulate an instruction set for different hardware not physically present"](http://en.wikipedia.org/wiki/VMware#Core_product_design).
However, QEMU *can* emulate a 64-bit processor, so you could convert the VMWare machine and ... | It boils down to whether the CPU in your machine has the the VT bit (Virtualization), and the BIOS enables you to turn it on. For instance, my laptop is a *[Core 2 Duo](http://en.wikipedia.org/wiki/Intel_Core#Core_2_Duo)* which is capable of using this. However, my BIOS doesn't enable me to turn it on.
Note that I've ... |
2,493,722 | "Suppose the assets price follow a normal distribution with variance 9. The sample mean of 10 assets is equal to 11.15. The manager of the investment fund says that the population mean is 12.5. Using the sample mean, find the p-value. Would you say that the manager is correct?"
So in this question I used a two sided te... | 2017/10/28 | [
"https://math.stackexchange.com/questions/2493722",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/496509/"
] | I have no advice for winning arguments with instructors. But I can comment
on the choice between one- and two-sided alternatives.
The fundamental guideline is this: Ideally, in a real application, *the choice of alternative should be made before seeing the data.* Here are some scenarios to consider:
(a) If you have a... | A two sided test is recommended if you have a null hypothesis and an alternate hypothesis defined such as below:
$H\_0: \mu = 12.5$
$H\_1: \mu \ne 12.5$
A one sided test is recommended if you have a null hypothesis and an alternate hypothesis defined such as below:
$H\_0: \mu = 12.5$
$H\_1: \mu \lt 12.5$
If the m... |
22,922,682 | I am looking to have parameters in the route, by using a colon before the variable name
```
// dynamic pages for each ITEM, once selected
// from $routeParams.itemID in ItemCtrl
.when('/:itemID', {
templateUrl: 'views/item.html',
controller: 'ItemController'
})
```
When a div-box is clicked, Angular ... | 2014/04/07 | [
"https://Stackoverflow.com/questions/22922682",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3095287/"
] | ::after is a [pseudo-element](https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements). They will only show up if you put something in them in your CSS. Chrome displays them because sometimes you need to change them when debugging. | They are a `pseudo elements`, through which you can add additional content to your elements.
For instance, you can use this CSS to add quotes around paragraphs with the class 'quoted'.
```
p.quoted::before {
content: "'";
}
p.quoted::after {
content: "'";
}
```
Apart from content, you can apply additional styl... |
51,014,214 | SQL Server 2012. Based on the stored procedure variable length; input value is automatically trimmed and inserted to the table.
Example : I am passing a variable `@name varchar(10)`:
```
@name VARCHAR(10) = null
```
However, on inserting the record which is more than 10 characters through stored procedure, record g... | 2018/06/24 | [
"https://Stackoverflow.com/questions/51014214",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/620720/"
] | The behavior depends on the [`ANSI_WARNINGS` session setting](https://learn.microsoft.com/en-us/sql/t-sql/statements/set-ansi-warnings-transact-sql).
With `ANSI_WARNINGS ON` (the default in modern Microsoft SQL Server APIs), you will get the expected "string or binary data would be truncated" error when data are inse... | One way to get this to work is to make sure your parameters are longer than the table column. Doesn't have to be much longer - one character would be enough. Then if you get passed a longer string, it will still be longer inside the stored procedure.
At that point you can either test for the length being too long and ... |
5,437 | In area 0 I have two loopbacks: 172.16.2.2 and 172.16.2.3 (both /24's).
I'm trying to configure a summary to roll the two up. Given the rest of the topology, I'm using `area X range` command.
This is my input and the console's output. What am I missing?
```
ZEUS(config-router)#area 0 range 172.16.2.0 255.255.252.0
... | 2013/12/12 | [
"https://networkengineering.stackexchange.com/questions/5437",
"https://networkengineering.stackexchange.com",
"https://networkengineering.stackexchange.com/users/1353/"
] | All loopbacks in OSPF are advertised with a 255.255.255.255 mask by default (see "LOOPBACK" network type), regardless of what you've configured the netmask as on the interface. If you want to announce your loopbacks with anything that's not a /32 you need to configure them as point-to-point (`ip ospf network point-to-p... | 172.16.2.0 255.255.252.0 = 172.16.0.0-172.16.3.255
If you want .2.0 thru .3.255 specifically you'll need
172.16.2.0 255.255.254.0 = 172.16.2.0-172.16.3.255 |
51,510,746 | I have a `UIView` that I added a `UILongPressGestureRecognizer` to so that I can handle clicks and have that `UIView` work like a button.
```
let longPressGtr = UILongPressGestureRecognizer(target: self, action:#selector(longPressSelector))
longPressGtr.minimumPressDuration = 0.1
myView.isUserInteractionEnabled = tru... | 2018/07/25 | [
"https://Stackoverflow.com/questions/51510746",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3075340/"
] | When you drag your finger outside of the view, `gestureRecognizer` is probably translated to `failed` or `cancelled` state, so you need to add handling of this cases `gestureRecognizer.state == .failed` and `gestureRecognizer.state == .cancelled`. | ```
@objc func longPressSelector(_ gestureRecognizer: UILongPressGestureRecognizer) {
}
```
Place **UILongPressGestureRecognizer** instead of **UITapGestureRecognizer** and check it |
51,510,746 | I have a `UIView` that I added a `UILongPressGestureRecognizer` to so that I can handle clicks and have that `UIView` work like a button.
```
let longPressGtr = UILongPressGestureRecognizer(target: self, action:#selector(longPressSelector))
longPressGtr.minimumPressDuration = 0.1
myView.isUserInteractionEnabled = tru... | 2018/07/25 | [
"https://Stackoverflow.com/questions/51510746",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3075340/"
] | You are not adding condition of gestureRecognizer state changed that's why it is accepting the end state.
```
@objc func longPressSelector(_ gestureRecognizer: UILongPressGestureRecognizer) {
if gestureRecognizer.state == .began {
} else if gestureRecognizer.state == .changed {
}else if gestureRecognizer... | ```
@objc func longPressSelector(_ gestureRecognizer: UILongPressGestureRecognizer) {
}
```
Place **UILongPressGestureRecognizer** instead of **UITapGestureRecognizer** and check it |
51,510,746 | I have a `UIView` that I added a `UILongPressGestureRecognizer` to so that I can handle clicks and have that `UIView` work like a button.
```
let longPressGtr = UILongPressGestureRecognizer(target: self, action:#selector(longPressSelector))
longPressGtr.minimumPressDuration = 0.1
myView.isUserInteractionEnabled = tru... | 2018/07/25 | [
"https://Stackoverflow.com/questions/51510746",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3075340/"
] | You need to check whether the gesture is inside the view.
```
@objc func longPresserDidFire(_ presser: UILongPressGestureRecognizer) {
let gestureIsInside = myView.point(inside: presser.location(in: myView), with: nil)
switch presser.state {
case .began, .changed:
if gestureIsInside {
m... | ```
@objc func longPressSelector(_ gestureRecognizer: UILongPressGestureRecognizer) {
}
```
Place **UILongPressGestureRecognizer** instead of **UITapGestureRecognizer** and check it |
51,510,746 | I have a `UIView` that I added a `UILongPressGestureRecognizer` to so that I can handle clicks and have that `UIView` work like a button.
```
let longPressGtr = UILongPressGestureRecognizer(target: self, action:#selector(longPressSelector))
longPressGtr.minimumPressDuration = 0.1
myView.isUserInteractionEnabled = tru... | 2018/07/25 | [
"https://Stackoverflow.com/questions/51510746",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3075340/"
] | You need to check whether the gesture is inside the view.
```
@objc func longPresserDidFire(_ presser: UILongPressGestureRecognizer) {
let gestureIsInside = myView.point(inside: presser.location(in: myView), with: nil)
switch presser.state {
case .began, .changed:
if gestureIsInside {
m... | When you drag your finger outside of the view, `gestureRecognizer` is probably translated to `failed` or `cancelled` state, so you need to add handling of this cases `gestureRecognizer.state == .failed` and `gestureRecognizer.state == .cancelled`. |
51,510,746 | I have a `UIView` that I added a `UILongPressGestureRecognizer` to so that I can handle clicks and have that `UIView` work like a button.
```
let longPressGtr = UILongPressGestureRecognizer(target: self, action:#selector(longPressSelector))
longPressGtr.minimumPressDuration = 0.1
myView.isUserInteractionEnabled = tru... | 2018/07/25 | [
"https://Stackoverflow.com/questions/51510746",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3075340/"
] | You need to check whether the gesture is inside the view.
```
@objc func longPresserDidFire(_ presser: UILongPressGestureRecognizer) {
let gestureIsInside = myView.point(inside: presser.location(in: myView), with: nil)
switch presser.state {
case .began, .changed:
if gestureIsInside {
m... | You are not adding condition of gestureRecognizer state changed that's why it is accepting the end state.
```
@objc func longPressSelector(_ gestureRecognizer: UILongPressGestureRecognizer) {
if gestureRecognizer.state == .began {
} else if gestureRecognizer.state == .changed {
}else if gestureRecognizer... |
40,426,362 | I had a working selenium notebook, which I didn't use for three weeks, and now crash :-(
It seems I am not alone :
<https://bugs.chromium.org/p/chromedriver/issues/detail?id=1548>
I understand that Chrome change of version, going to version 54 recently, and making old selenium's version crashing.
Following several ... | 2016/11/04 | [
"https://Stackoverflow.com/questions/40426362",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3318273/"
] | Here's one way to do it without having to use `.items()`:
```
for obj in listofobjs:
if 'tel' in obj and 'nam' in obj and obj['tel']==tel and obj['nam']==nam:
...
```
Or you could [*ask for forgiveness*](https://stackoverflow.com/questions/11360858/what-is-the-eafp-principle-in-python) provided all dicti... | You don't need to loop over the `.items()` to do this.
```
for obj in listofobjs:
if (obj.get('tel', None) == tel) and (obj.get('nam', None) == nam):
```
Just use [`.get`](https://docs.python.org/3.5/library/stdtypes.html#dict.get) to get the key, so that you don't get a `KeyError` if the key doesn't exist.
`.g... |
42,495,538 | I'm new to javascript and am basically trying to create a dropdown menu which displays file names. A user would then select one and that file retrieved from the database and opened onto my canvas. I can't figure out how to pass the selectedText variable to my php select statement.
I'm sure this line is the problem
*... | 2017/02/27 | [
"https://Stackoverflow.com/questions/42495538",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7248517/"
] | At least, when you do a modification in a live container, you can try and commit it as a new image.
With docker 1.13, the syntax now is [`docker container commit`](https://docs.docker.com/engine/reference/commandline/container_commit/):
```
docker container commit -p -m "Change user" <container> <name[:tag]>
```
Th... | Every changes you made in Docker, make sure that you have to commit it.
```
docker container commit
```
maybe you need to create an account in docker hub, so you can push every changed images to your dockerhub acc. |
38,937,225 | In my code I'm getting:
>
> missing argument for parameter 'coder' in call swift
>
>
>
I'm a beginner to Swift and I've already tried everything including researching this question, but have found no answer. Thanks.
The code I'm getting this error is:
`let button: UIButton = UIButton(frame: CGRect(origin: CGPoi... | 2016/08/13 | [
"https://Stackoverflow.com/questions/38937225",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6491368/"
] | The error is suggesting that the compiler is having trouble figuring out which `init` method should be invoked, so it's assuming you meant to call `init(coder:)`.
But let's set that aside for a second. First, let's simplify your statement to eliminate some "noise". Rather than using `CGRect(origin:, size:)`, you might... | I think the problem is that you are using ChecklistViewController to generate your positions.
Try this code
```
let button: UIButton = UIButton(frame: CGRect(x: (CGRectGetMidX(self.view.frame) + 117) , y: (CGRectGetMaxY(self.view.frame) - 70) , size: CGSize(width: 50, height: 50)))
``` |
70,411,973 | I am abeginner trying to add a linked list to another linked list using c. the problem is that the program is entering an infinite loop and i don't know why.
And here's the following c code
```
typedef struct bookInfo
{
int code;
struct bookInfo *next;
} bookInfo;
typedef struct subscriber
{
int code;
... | 2021/12/19 | [
"https://Stackoverflow.com/questions/70411973",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17473630/"
] | In your code,
`while (tmp != NULL) tmp = tmp->next;`
When this loop ends, tmp is NULL, so the next line will try accessing null pointer.
You should correct it as, `while(tmp->next != NULL)` | In order to remove the infinite loop, All i had to do was to define the pointer of books in the subscriber struct to NULL
```
void newBook(Book *bk, int val)
{
bookInfo *new_node = malloc(sizeof(bookInfo));
bookInfo *last = *bk;
new_node->code = val;
new_node->next = NULL;
new_node->books = NULL;
... |
72,657,401 | In Angular, the currency pipe converts the value for AUD as `A$`. using this code for example:
```
{{ total | currency : 'AUD' : 'symbol' }} // output as A$100.00
```
How to achieve this in C#? I've done my research but for AUD it just output it as `$`. This is by using toString with culture info
```
total.ToString... | 2022/06/17 | [
"https://Stackoverflow.com/questions/72657401",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5870896/"
] | Your angular snippet formats the total as AUD *using the current locale*. In en-US, this ends up being A$. In the Australian locale, however, the currency symbol is just $.
The .NET framework does not offer a way to do this out of the box. Whenever `.ToString`'s `C2` format is used together with a `CultureInfo` object... | You are doing it right.
Australians on this website say this ($) is the correct symbol:
<https://www.studymelbourne.vic.gov.au/money-and-budgeting/australian-currency>
EDIT:
Or just make a custom method:
```
public static DecimalExtensions {
public static string ToCurrencyWithSymbol( this decimal n, string cultur... |
109,639 | I have tried 3 turns, lots of turns , less turns, I do it the right way I am like 100% sure but I always get leaks, I use it for fittings in compressed air (8 bar).
I do it how the guy teaches in [this video](https://www.youtube.com/watch?v=C0kBeMNfWx8). What do I do? | 2017/03/03 | [
"https://diy.stackexchange.com/questions/109639",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/64516/"
] | I think some modern NPT threads are not as well made as in the past. I have had more leaks than decades ago. Used to be white Teflon tape would work every time, but the last four (recent) 1/2" and 3/4" NPT connections I have made leaked.
In both cases I had to take them apart and use pipe dope. One (washing machine su... | Wrap the teflon tape onto the threads in same direction as if you were screwing on a fitting. Looking at the pipe with the fitting threads on in a clockwise direction, wrap tape around pipe towards the right (clockwise) and give it 4-5 turns minimum. But, you can put 10-20 if you want as long as you can get the fitting... |
109,639 | I have tried 3 turns, lots of turns , less turns, I do it the right way I am like 100% sure but I always get leaks, I use it for fittings in compressed air (8 bar).
I do it how the guy teaches in [this video](https://www.youtube.com/watch?v=C0kBeMNfWx8). What do I do? | 2017/03/03 | [
"https://diy.stackexchange.com/questions/109639",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/64516/"
] | I think some modern NPT threads are not as well made as in the past. I have had more leaks than decades ago. Used to be white Teflon tape would work every time, but the last four (recent) 1/2" and 3/4" NPT connections I have made leaked.
In both cases I had to take them apart and use pipe dope. One (washing machine su... | When using Teflon tape, you only need 3-4 wraps put on in the same direction as you turn on the fitting. Start the wrap, at the end of the fitting and wrap towards the piping keeping the tape tight, "it takes practice". Then, you can add some pipe dope on top of the Teflon tape,(it doesn't have to be expensive dope). O... |
109,639 | I have tried 3 turns, lots of turns , less turns, I do it the right way I am like 100% sure but I always get leaks, I use it for fittings in compressed air (8 bar).
I do it how the guy teaches in [this video](https://www.youtube.com/watch?v=C0kBeMNfWx8). What do I do? | 2017/03/03 | [
"https://diy.stackexchange.com/questions/109639",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/64516/"
] | I think some modern NPT threads are not as well made as in the past. I have had more leaks than decades ago. Used to be white Teflon tape would work every time, but the last four (recent) 1/2" and 3/4" NPT connections I have made leaked.
In both cases I had to take them apart and use pipe dope. One (washing machine su... | If you're an occasional DIY plumber like me, use dope. (I used Oatey Pro Dope from Home Depot but I'm sure it's nothing special.) Cover the threads completely on the male fitting. Tighten with opposing wrenches until it feels like you'll break it pushing harder. If you don't have that feel, use maybe 6" long wrenches f... |
109,639 | I have tried 3 turns, lots of turns , less turns, I do it the right way I am like 100% sure but I always get leaks, I use it for fittings in compressed air (8 bar).
I do it how the guy teaches in [this video](https://www.youtube.com/watch?v=C0kBeMNfWx8). What do I do? | 2017/03/03 | [
"https://diy.stackexchange.com/questions/109639",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/64516/"
] | Wrap the teflon tape onto the threads in same direction as if you were screwing on a fitting. Looking at the pipe with the fitting threads on in a clockwise direction, wrap tape around pipe towards the right (clockwise) and give it 4-5 turns minimum. But, you can put 10-20 if you want as long as you can get the fitting... | When using Teflon tape, you only need 3-4 wraps put on in the same direction as you turn on the fitting. Start the wrap, at the end of the fitting and wrap towards the piping keeping the tape tight, "it takes practice". Then, you can add some pipe dope on top of the Teflon tape,(it doesn't have to be expensive dope). O... |
109,639 | I have tried 3 turns, lots of turns , less turns, I do it the right way I am like 100% sure but I always get leaks, I use it for fittings in compressed air (8 bar).
I do it how the guy teaches in [this video](https://www.youtube.com/watch?v=C0kBeMNfWx8). What do I do? | 2017/03/03 | [
"https://diy.stackexchange.com/questions/109639",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/64516/"
] | If you're an occasional DIY plumber like me, use dope. (I used Oatey Pro Dope from Home Depot but I'm sure it's nothing special.) Cover the threads completely on the male fitting. Tighten with opposing wrenches until it feels like you'll break it pushing harder. If you don't have that feel, use maybe 6" long wrenches f... | When using Teflon tape, you only need 3-4 wraps put on in the same direction as you turn on the fitting. Start the wrap, at the end of the fitting and wrap towards the piping keeping the tape tight, "it takes practice". Then, you can add some pipe dope on top of the Teflon tape,(it doesn't have to be expensive dope). O... |
55,876,735 | I'm trying to play audio when the div `.deley` change to `display: block`, but something does not work. The online audio clips are correct, it's not the problem. My problem is in my script, but I can not find it. Maybe `.pause is not a function`?
What could be wrong?
```js
function see() {
var x = document.getElem... | 2019/04/27 | [
"https://Stackoverflow.com/questions/55876735",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9978856/"
] | Here is a working example.
```js
function see() {
var x = document.getElementById("deley");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
};
// === Scrip for audio play ====
$(document).ready(function(){
$(".deley").hide();
// if ... | ```
$(document).ready(function(){
$(".deley").hide();
// if sound is currently playing, stop it and reset
if(!$("#notify")[0].paused) {
$("#notify")[0].pause();
$("#notify")[0].currentTime = 0;
}
setTimeout(function () {
$(".deley").show();
$("#notify")[0].play(); ... |
55,876,735 | I'm trying to play audio when the div `.deley` change to `display: block`, but something does not work. The online audio clips are correct, it's not the problem. My problem is in my script, but I can not find it. Maybe `.pause is not a function`?
What could be wrong?
```js
function see() {
var x = document.getElem... | 2019/04/27 | [
"https://Stackoverflow.com/questions/55876735",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9978856/"
] | **jQuery Objects**✱ and **JavaScript Objects** are different. They do not recognize one another which is why the following statements do not work:
```
if (!$(".notify").paused) {
$(".notify").pause();
$(".notify").currentTime = 0;
...
$(".notify").play();
```
The MediaElement API is Plain JavaScript only. Any ... | ```
$(document).ready(function(){
$(".deley").hide();
// if sound is currently playing, stop it and reset
if(!$("#notify")[0].paused) {
$("#notify")[0].pause();
$("#notify")[0].currentTime = 0;
}
setTimeout(function () {
$(".deley").show();
$("#notify")[0].play(); ... |
55,876,735 | I'm trying to play audio when the div `.deley` change to `display: block`, but something does not work. The online audio clips are correct, it's not the problem. My problem is in my script, but I can not find it. Maybe `.pause is not a function`?
What could be wrong?
```js
function see() {
var x = document.getElem... | 2019/04/27 | [
"https://Stackoverflow.com/questions/55876735",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9978856/"
] | Jq object dose not have `play`, `pause` events. you will have to change it to a simple javascript to access those events.
*emphasized text*
Have a look below and i also simplified the function fot you
```js
function see() {
$(".deley").toggle("fast", function(){
var player= $("#notify")[0];
// is the p... | ```
$(document).ready(function(){
$(".deley").hide();
// if sound is currently playing, stop it and reset
if(!$("#notify")[0].paused) {
$("#notify")[0].pause();
$("#notify")[0].currentTime = 0;
}
setTimeout(function () {
$(".deley").show();
$("#notify")[0].play(); ... |
55,876,735 | I'm trying to play audio when the div `.deley` change to `display: block`, but something does not work. The online audio clips are correct, it's not the problem. My problem is in my script, but I can not find it. Maybe `.pause is not a function`?
What could be wrong?
```js
function see() {
var x = document.getElem... | 2019/04/27 | [
"https://Stackoverflow.com/questions/55876735",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9978856/"
] | **jQuery Objects**✱ and **JavaScript Objects** are different. They do not recognize one another which is why the following statements do not work:
```
if (!$(".notify").paused) {
$(".notify").pause();
$(".notify").currentTime = 0;
...
$(".notify").play();
```
The MediaElement API is Plain JavaScript only. Any ... | Here is a working example.
```js
function see() {
var x = document.getElementById("deley");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
};
// === Scrip for audio play ====
$(document).ready(function(){
$(".deley").hide();
// if ... |
55,876,735 | I'm trying to play audio when the div `.deley` change to `display: block`, but something does not work. The online audio clips are correct, it's not the problem. My problem is in my script, but I can not find it. Maybe `.pause is not a function`?
What could be wrong?
```js
function see() {
var x = document.getElem... | 2019/04/27 | [
"https://Stackoverflow.com/questions/55876735",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9978856/"
] | **jQuery Objects**✱ and **JavaScript Objects** are different. They do not recognize one another which is why the following statements do not work:
```
if (!$(".notify").paused) {
$(".notify").pause();
$(".notify").currentTime = 0;
...
$(".notify").play();
```
The MediaElement API is Plain JavaScript only. Any ... | Jq object dose not have `play`, `pause` events. you will have to change it to a simple javascript to access those events.
*emphasized text*
Have a look below and i also simplified the function fot you
```js
function see() {
$(".deley").toggle("fast", function(){
var player= $("#notify")[0];
// is the p... |
23,276,257 | I did some searching on this but couldn't find out why, but in my project, commenting out a line in the `.Include()` breaks the entire `ScriptBundle`. If I comment out one line, the other javascript files will not load.
Can you comment out individual bundles, or do you need to remove them and maybe put the comment bel... | 2014/04/24 | [
"https://Stackoverflow.com/questions/23276257",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/443550/"
] | Commenting out a line like you show shouldn't be a problem. Check your rendered script sections -- If you see the bootstrap resources included on your page then the bundler is working.
If your other scripts stop working then this indicates a problem with your javascript still referencing the removed bundle resource. | of course you can comment some lines (as you did), but remember you need to recompile your project to get affected |
33,179,536 | I'm trying to get the ip address of each of my clients that connect to my server. I save this into fields of a struct which I sent to a thread. I'm noticing that sometimes I get the right ip and sometimes the wrong one. My first peer to connect usually has an incorrect ip... | 2015/10/16 | [
"https://Stackoverflow.com/questions/33179536",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4517477/"
] | The File is working now, It seems that the Batch file should be in the same location as the output file and there should be no other files in the output location.
For example you cannot save the file in desktop , the shell extension is not able to read it if there are lot of files in the destination directory.
FIX: O... | If it were me, I think I'd toggle the PASV command in the ftp file itself to see if the client's firewall is blocking the DATA portion of this. |
58,095,916 | I have input and add a button. once I click on the add button the input value should save table row and I need a delete button here. That value I need to delete individual. I need to save many values. I tried in jquery I get the added value in the table but I'm unable to delete the value. below is my code. Thanks in Ad... | 2019/09/25 | [
"https://Stackoverflow.com/questions/58095916",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10695455/"
] | You were pretty close to the answer. Please note below things:
1. **First**: You absolutely should not have duplicate IDs. It may work, but it is semantically incorrect and you should not do it. You are adding same row onclick, so you should give it same class
2. **Second**: Same goes for name attribute. If you want t... | It's because the button with ID `deletesupLoc` doesn't exist in the DOM when you call `.click()` on it. Because it was added dynamically using your script, jQuery doesn't know of this button's existence yet. So you need to add a call to `$(document).on('click')` when you create the button to add an event listener to th... |
60,578,319 | When running a sh-command inside of a jenkins pipeline, the commands themselves are not running.
The shell is part of my PATH-variable, thus the cmd-prompt is running, but the commands are not.
Code inside pipeline:
```
sh "echo Hello World"
bat "echo Hello World"
```
Result:
```
[Pipeline] sh
Microsoft Windows [... | 2020/03/07 | [
"https://Stackoverflow.com/questions/60578319",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5436979/"
] | Do it as follows:
```
import java.util.Arrays;
import java.util.Scanner;
public class Main {
static int[] numbers = new int[6];
static Scanner keyboard = new Scanner(System.in);
public static void main(String args[]) {
// Test
choose();
System.out.println(Arrays.toString(numbers))... | Try:
```
System.out.println("\n");
int temp;
boolean valid;
for (int i = 0; i < 6; i++) {
do {
valid = true;
System.out.print("Enter in an integer from 1 to 59: ");
while (!keyboard.hasNextInt()) {
keyboard.next();
System.out.println("Error.! Please enter a number")... |
60,578,319 | When running a sh-command inside of a jenkins pipeline, the commands themselves are not running.
The shell is part of my PATH-variable, thus the cmd-prompt is running, but the commands are not.
Code inside pipeline:
```
sh "echo Hello World"
bat "echo Hello World"
```
Result:
```
[Pipeline] sh
Microsoft Windows [... | 2020/03/07 | [
"https://Stackoverflow.com/questions/60578319",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5436979/"
] | Do it as follows:
```
import java.util.Arrays;
import java.util.Scanner;
public class Main {
static int[] numbers = new int[6];
static Scanner keyboard = new Scanner(System.in);
public static void main(String args[]) {
// Test
choose();
System.out.println(Arrays.toString(numbers))... | This May be the **Most Efficient** but complex.
Ask me if you need some explaination
```
public class Test {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
ArrayList<String> numbers = new ArrayList<>(6);
String s ;
do {
System.out.println("Enter a number b... |
60,578,319 | When running a sh-command inside of a jenkins pipeline, the commands themselves are not running.
The shell is part of my PATH-variable, thus the cmd-prompt is running, but the commands are not.
Code inside pipeline:
```
sh "echo Hello World"
bat "echo Hello World"
```
Result:
```
[Pipeline] sh
Microsoft Windows [... | 2020/03/07 | [
"https://Stackoverflow.com/questions/60578319",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5436979/"
] | Try:
```
System.out.println("\n");
int temp;
boolean valid;
for (int i = 0; i < 6; i++) {
do {
valid = true;
System.out.print("Enter in an integer from 1 to 59: ");
while (!keyboard.hasNextInt()) {
keyboard.next();
System.out.println("Error.! Please enter a number")... | This May be the **Most Efficient** but complex.
Ask me if you need some explaination
```
public class Test {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
ArrayList<String> numbers = new ArrayList<>(6);
String s ;
do {
System.out.println("Enter a number b... |
255,604 | I have an interpolating function which output dimension is greater than 1, so it's a vector. I get it as the result of a NDSolveValue. The problem is that I'm not able to Evaluate it. I would obtain from a single interpolating function which output is a vector a vector containing interpolating function which output is ... | 2021/09/13 | [
"https://mathematica.stackexchange.com/questions/255604",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/78054/"
] | You can use [`Indexed`](http://reference.wolfram.com/language/ref/Indexed):
```
Plot[Evaluate @ Table[Indexed[xsol[t], i], {i, 3}], {t, t0, tfin}]
```
[](https://i.stack.imgur.com/YRhBC.png) | Perhaps this is what you want:
```
x0 = {1, 3, 6};
eqns = {x'[t] == -x[t], x[0] == #} &;
t0 = 0;
tfin = 5;
xsol[s_] = NDSolveValue[eqns@#, x[s], {t, t0, tfin}] & /@ x0
```
[](https://i.stack.imgur.com/RJDbD.png)
```
Plot[Evaluate@xsol[t], {t, t0, t... |
255,604 | I have an interpolating function which output dimension is greater than 1, so it's a vector. I get it as the result of a NDSolveValue. The problem is that I'm not able to Evaluate it. I would obtain from a single interpolating function which output is a vector a vector containing interpolating function which output is ... | 2021/09/13 | [
"https://mathematica.stackexchange.com/questions/255604",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/78054/"
] | Perhaps this is what you want:
```
x0 = {1, 3, 6};
eqns = {x'[t] == -x[t], x[0] == #} &;
t0 = 0;
tfin = 5;
xsol[s_] = NDSolveValue[eqns@#, x[s], {t, t0, tfin}] & /@ x0
```
[](https://i.stack.imgur.com/RJDbD.png)
```
Plot[Evaluate@xsol[t], {t, t0, t... | You can use a `Table`:
```
With[{x0 = {1, 3, 6}, t0 = 0,tfin = 5},
solx[s_] = Table[NDSolveValue[{x'[t] == -x[t], x[0] == x0[[i]]}, x[s],
{t, t0, tfin}], {i, 1, Length[x0]}];
Plot[Evaluate[solx[t]], {t, 0, 5}]]
```
[](https://i.stack.imgur.com/W3I6V.png) |
255,604 | I have an interpolating function which output dimension is greater than 1, so it's a vector. I get it as the result of a NDSolveValue. The problem is that I'm not able to Evaluate it. I would obtain from a single interpolating function which output is a vector a vector containing interpolating function which output is ... | 2021/09/13 | [
"https://mathematica.stackexchange.com/questions/255604",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/78054/"
] | You can use [`Indexed`](http://reference.wolfram.com/language/ref/Indexed):
```
Plot[Evaluate @ Table[Indexed[xsol[t], i], {i, 3}], {t, t0, tfin}]
```
[](https://i.stack.imgur.com/YRhBC.png) | You can use a `Table`:
```
With[{x0 = {1, 3, 6}, t0 = 0,tfin = 5},
solx[s_] = Table[NDSolveValue[{x'[t] == -x[t], x[0] == x0[[i]]}, x[s],
{t, t0, tfin}], {i, 1, Length[x0]}];
Plot[Evaluate[solx[t]], {t, 0, 5}]]
```
[](https://i.stack.imgur.com/W3I6V.png) |
255,604 | I have an interpolating function which output dimension is greater than 1, so it's a vector. I get it as the result of a NDSolveValue. The problem is that I'm not able to Evaluate it. I would obtain from a single interpolating function which output is a vector a vector containing interpolating function which output is ... | 2021/09/13 | [
"https://mathematica.stackexchange.com/questions/255604",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/78054/"
] | You can use [`Indexed`](http://reference.wolfram.com/language/ref/Indexed):
```
Plot[Evaluate @ Table[Indexed[xsol[t], i], {i, 3}], {t, t0, tfin}]
```
[](https://i.stack.imgur.com/YRhBC.png) | If the plot is the main goal, then this is simplest:
```
xsol = NDSolveValue[eqns, x, {t, t0, tfin}] (* N.B. x, not x[s] *)
ListLinePlot@xsol
```

See also
[Easy way to plot ODE solutions from NDSolve?](https://mathematica.stackexchange.com/questions/134222/easy-way-to-plot-od... |
255,604 | I have an interpolating function which output dimension is greater than 1, so it's a vector. I get it as the result of a NDSolveValue. The problem is that I'm not able to Evaluate it. I would obtain from a single interpolating function which output is a vector a vector containing interpolating function which output is ... | 2021/09/13 | [
"https://mathematica.stackexchange.com/questions/255604",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/78054/"
] | If the plot is the main goal, then this is simplest:
```
xsol = NDSolveValue[eqns, x, {t, t0, tfin}] (* N.B. x, not x[s] *)
ListLinePlot@xsol
```

See also
[Easy way to plot ODE solutions from NDSolve?](https://mathematica.stackexchange.com/questions/134222/easy-way-to-plot-od... | You can use a `Table`:
```
With[{x0 = {1, 3, 6}, t0 = 0,tfin = 5},
solx[s_] = Table[NDSolveValue[{x'[t] == -x[t], x[0] == x0[[i]]}, x[s],
{t, t0, tfin}], {i, 1, Length[x0]}];
Plot[Evaluate[solx[t]], {t, 0, 5}]]
```
[](https://i.stack.imgur.com/W3I6V.png) |
99,874 | I'd like to turn off the animation (windows zoom back) effect when the activities overview is activated because it really gets slow and laggy with a lot of open windows.
Is there ANY way to do this, as internet search only lead me to the "Disable Window Animations Extension" which obviously only affects window animati... | 2012/01/30 | [
"https://askubuntu.com/questions/99874",
"https://askubuntu.com",
"https://askubuntu.com/users/44228/"
] | In Gnome 3.8, just do this command to disable all animations:
```
gsettings set org.gnome.desktop.interface enable-animations false
```
To rollback:
```
gsettings set org.gnome.desktop.interface enable-animations true
``` | The accepted answer does not disable animations, but only reduces the animation time to almost zero. This means the animation will still be rendered - you're just not able to recognize them.
Maxwell's answer really disables animations, but on my system (Ubuntu 14.04) the animations are enabled again after a reboot. Ho... |
99,874 | I'd like to turn off the animation (windows zoom back) effect when the activities overview is activated because it really gets slow and laggy with a lot of open windows.
Is there ANY way to do this, as internet search only lead me to the "Disable Window Animations Extension" which obviously only affects window animati... | 2012/01/30 | [
"https://askubuntu.com/questions/99874",
"https://askubuntu.com",
"https://askubuntu.com/users/44228/"
] | The accepted answer does not disable animations, but only reduces the animation time to almost zero. This means the animation will still be rendered - you're just not able to recognize them.
Maxwell's answer really disables animations, but on my system (Ubuntu 14.04) the animations are enabled again after a reboot. Ho... | Fast forward from 2012 to 2018, since a few years, **Gnome Tweaks** exposes the setting to turn all animations in Gnome Shell off: Turn "Animations" off on the "Appearance" tab.
The command line method provided by Maxwel Leite is still valid:
`gsettings set org.gnome.desktop.interface enable-animations false`
To res... |
99,874 | I'd like to turn off the animation (windows zoom back) effect when the activities overview is activated because it really gets slow and laggy with a lot of open windows.
Is there ANY way to do this, as internet search only lead me to the "Disable Window Animations Extension" which obviously only affects window animati... | 2012/01/30 | [
"https://askubuntu.com/questions/99874",
"https://askubuntu.com",
"https://askubuntu.com/users/44228/"
] | The accepted answer does not disable animations, but only reduces the animation time to almost zero. This means the animation will still be rendered - you're just not able to recognize them.
Maxwell's answer really disables animations, but on my system (Ubuntu 14.04) the animations are enabled again after a reboot. Ho... | Check out:
```
System -> Preferences -> Appearance
```
Then choose the Visual Effects tab.
Change the radio button to 'None' and close. |
99,874 | I'd like to turn off the animation (windows zoom back) effect when the activities overview is activated because it really gets slow and laggy with a lot of open windows.
Is there ANY way to do this, as internet search only lead me to the "Disable Window Animations Extension" which obviously only affects window animati... | 2012/01/30 | [
"https://askubuntu.com/questions/99874",
"https://askubuntu.com",
"https://askubuntu.com/users/44228/"
] | Edit the following file using root access rights:
```
sudo gedit /usr/share/gnome-shell/js/ui/overview.js
```
Change the animation\_time to 0.001, around line 30
```
const ANIMATION_TIME = 0.001;
```
This should do what you asked for. Besides, there are many other parameters that you could change to speed up Gnom... | Check out:
```
System -> Preferences -> Appearance
```
Then choose the Visual Effects tab.
Change the radio button to 'None' and close. |
99,874 | I'd like to turn off the animation (windows zoom back) effect when the activities overview is activated because it really gets slow and laggy with a lot of open windows.
Is there ANY way to do this, as internet search only lead me to the "Disable Window Animations Extension" which obviously only affects window animati... | 2012/01/30 | [
"https://askubuntu.com/questions/99874",
"https://askubuntu.com",
"https://askubuntu.com/users/44228/"
] | In Gnome 3.8, just do this command to disable all animations:
```
gsettings set org.gnome.desktop.interface enable-animations false
```
To rollback:
```
gsettings set org.gnome.desktop.interface enable-animations true
``` | Fast forward from 2012 to 2018, since a few years, **Gnome Tweaks** exposes the setting to turn all animations in Gnome Shell off: Turn "Animations" off on the "Appearance" tab.
The command line method provided by Maxwel Leite is still valid:
`gsettings set org.gnome.desktop.interface enable-animations false`
To res... |
99,874 | I'd like to turn off the animation (windows zoom back) effect when the activities overview is activated because it really gets slow and laggy with a lot of open windows.
Is there ANY way to do this, as internet search only lead me to the "Disable Window Animations Extension" which obviously only affects window animati... | 2012/01/30 | [
"https://askubuntu.com/questions/99874",
"https://askubuntu.com",
"https://askubuntu.com/users/44228/"
] | In Gnome 4 disable *Settings > Accessibility > Enable Animations* | Check out:
```
System -> Preferences -> Appearance
```
Then choose the Visual Effects tab.
Change the radio button to 'None' and close. |
99,874 | I'd like to turn off the animation (windows zoom back) effect when the activities overview is activated because it really gets slow and laggy with a lot of open windows.
Is there ANY way to do this, as internet search only lead me to the "Disable Window Animations Extension" which obviously only affects window animati... | 2012/01/30 | [
"https://askubuntu.com/questions/99874",
"https://askubuntu.com",
"https://askubuntu.com/users/44228/"
] | Fast forward from 2012 to 2018, since a few years, **Gnome Tweaks** exposes the setting to turn all animations in Gnome Shell off: Turn "Animations" off on the "Appearance" tab.
The command line method provided by Maxwel Leite is still valid:
`gsettings set org.gnome.desktop.interface enable-animations false`
To res... | In Gnome 4 disable *Settings > Accessibility > Enable Animations* |
99,874 | I'd like to turn off the animation (windows zoom back) effect when the activities overview is activated because it really gets slow and laggy with a lot of open windows.
Is there ANY way to do this, as internet search only lead me to the "Disable Window Animations Extension" which obviously only affects window animati... | 2012/01/30 | [
"https://askubuntu.com/questions/99874",
"https://askubuntu.com",
"https://askubuntu.com/users/44228/"
] | In Gnome 3.8, just do this command to disable all animations:
```
gsettings set org.gnome.desktop.interface enable-animations false
```
To rollback:
```
gsettings set org.gnome.desktop.interface enable-animations true
``` | In Gnome 4 disable *Settings > Accessibility > Enable Animations* |
99,874 | I'd like to turn off the animation (windows zoom back) effect when the activities overview is activated because it really gets slow and laggy with a lot of open windows.
Is there ANY way to do this, as internet search only lead me to the "Disable Window Animations Extension" which obviously only affects window animati... | 2012/01/30 | [
"https://askubuntu.com/questions/99874",
"https://askubuntu.com",
"https://askubuntu.com/users/44228/"
] | In Gnome 3.8, just do this command to disable all animations:
```
gsettings set org.gnome.desktop.interface enable-animations false
```
To rollback:
```
gsettings set org.gnome.desktop.interface enable-animations true
``` | Edit the following file using root access rights:
```
sudo gedit /usr/share/gnome-shell/js/ui/overview.js
```
Change the animation\_time to 0.001, around line 30
```
const ANIMATION_TIME = 0.001;
```
This should do what you asked for. Besides, there are many other parameters that you could change to speed up Gnom... |
99,874 | I'd like to turn off the animation (windows zoom back) effect when the activities overview is activated because it really gets slow and laggy with a lot of open windows.
Is there ANY way to do this, as internet search only lead me to the "Disable Window Animations Extension" which obviously only affects window animati... | 2012/01/30 | [
"https://askubuntu.com/questions/99874",
"https://askubuntu.com",
"https://askubuntu.com/users/44228/"
] | Edit the following file using root access rights:
```
sudo gedit /usr/share/gnome-shell/js/ui/overview.js
```
Change the animation\_time to 0.001, around line 30
```
const ANIMATION_TIME = 0.001;
```
This should do what you asked for. Besides, there are many other parameters that you could change to speed up Gnom... | In Gnome 4 disable *Settings > Accessibility > Enable Animations* |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.