qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
13,316,134 | There's lots of topics touching on part of the title, but nothing that quite satisfies the whole thing. I'm pushing a command on a remote server and need the full output after a long execution time, say 5 minutes or so. Using channel I was able to set a timeout, but when I read back stdout I got only a small portion of... | 2012/11/09 | [
"https://Stackoverflow.com/questions/13316134",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1772459/"
] | Here's something that might help, though I'm still in the midst of testing. After struggling with timeouts of various types including a catch-all timeout for Python, and realizing that the real problem is that the server can't be trusted to terminate the process, I did this:
```
chan = ssh.get_transport().open_session... | I had a lot of problem calling the exec\_command from the channel, instead I use directly the exec\_command from the ssh connection and call the channel of the std output, the code that works for me is like **myexec**:
```
#!/usr/bin/env python
import paramiko
import select
def myexec(ssh, cmd, timeout):
stdin, std... |
16,785,154 | I HAVE A WINDOWS APPLICATION. in this i have a form on which there is a datagridview.
now i am populating the datagridview with **EMPLOYEE MASTER** in the database. so when the datagrid is populated i also have 2 extra buttons as other 2 cloumns in the datagrid. those are **EDIT & DELETE** now so each row in the datagr... | 2013/05/28 | [
"https://Stackoverflow.com/questions/16785154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2243467/"
] | **Update** : Since you now mentioned you want to sore this into a file! You could still set the json into a variable like below, then set it's value. Then use [JSON.stringify()](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/JSON/stringify) to convert it into a string and then write it int... | if you use javascript and some libraries try something like this (I use jQuery as it is popular)
```
var a = JSON.parse('{"@id": "2","@samsid": "d7058536c89b46c0b58117eff64372f7","@productname": "Another paid for","@downloaddate": "2013-05-28 11:37:12Z","@downloadlocation": "2AFoGZVJpFHzspQD9UoE2C4VFYc8idiO4ebaRx4uEvt... |
29,728,531 | I need to model a database with these conditions:
* One table for `Projects`
* Another table for `Programmers`
* A Programmer can be `Senior` or `Junior`
* Each project may have several Programmers but **at least** one Senior must exist.
I would like to define some kind of conditional foreign key to assure that of al... | 2015/04/19 | [
"https://Stackoverflow.com/questions/29728531",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4806614/"
] | ```
int[][] finalDists = dists.Where((arr, i)=>i!=2) //skip row#3
.Select(arr=>arr.Where((item,i)=>i!=2) //skip col#3
.ToArray())
.ToArray();
``` | Not very optimized but:
```
public static T[] RemoveRow<T>(T[] array, int row)
{
T[] array2 = new T[array.Length - 1];
Array.Copy(array, 0, array2, 0, row);
Array.Copy(array, row + 1, array2, row, array2.Length - row);
return array2;
}
public static T[][] RemoveColumn<T>(T[][] array, int column)
{
... |
29,906,789 | I am trying to redirect to a controller at the click event of a button. The controller file is practiceTest.php. It has an index function that redirects to another view from there. Unfortunately, I keep getting a 404 not found error.
The relevant code:
```
<input style='position: absolute; right: 0;' type="button" i... | 2015/04/27 | [
"https://Stackoverflow.com/questions/29906789",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1372824/"
] | The URL is wrong.If you click on the button You will see you are redirecting wrong URL.You should use full URL instead of relative URL.As you are using CI you can try this way(assumed `practiceTest` is one of your controller name)
```
onClick="location.href='<?php echo site_url('practiceTest');?>'">
``` | you can also use `base_url();/pathforyourcontrollername` |
52,374 | I am an Ubuntu Server user. I have two ethernet cards which I want to use as eth0(WAN) and eth1(LAN).
However, I have three gateways, each with a different subnet. Like this:
1. 192.168.20.12
2. 52.100.50.10
3. 10.10.1.3
I want to marge these three IPs on eth0(WAN) and how to set my eth1(LAN) gateway?
I want this fo... | 2011/07/08 | [
"https://askubuntu.com/questions/52374",
"https://askubuntu.com",
"https://askubuntu.com/users/21335/"
] | I'm trying to figure bridge-utils myself, and came across your post. Dear people from the future, here is what I have figured out so far:
To bridge multiple interfaces I believe you just do something like:
```
brctl addbr br0
brctl addif eth0
brctl addif eth1
brctl addif eth2
```
then you configure the address of b... | use `apt-get install bridge-utils` or read the info on the how to set it up ubuntu server 11.04 pages |
40,825,445 | I was using PHP 5.4 in Godaddy Hosting. I have one PHP script which was working fine in it. Now I have changed Hosting and New Hosting company Provide PHP 5.6. I do not PHP coding. I am getting error in my script as below
>
> Deprecated: mysql\_connect(): The mysql extension is deprecated and will be removed in the f... | 2016/11/27 | [
"https://Stackoverflow.com/questions/40825445",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7203279/"
] | For Myqli connection
```
$mysql_hostname = "localhost";
$mysql_user = "dbuser";
$mysql_password = "dbpass";
$mysql_database = "dbname";
$bd = mysqli_connect($mysql_hostname, $mysql_user, $mysql_password,$mysql_database) or die("Could not connect database");
```
For Query Please follow this answer [How can I prevent ... | As PHP is becoming a Object Oriented Scripting language, it will be better to make use of PDOs to make connections to Database and perform the operations, for this you have a give a little bit of more effort. Like making Entity Classes for each table's(each column as variable), this is the only hectic part but it will ... |
7,270,798 | I'm writing a web server for android. Actually it works with threads, but now I would use a service to make it running in background. I replaced the thread with a service, but I don't know if this design is ok...
When I press a button it starts then it stays in listening. When there is a request, the service create a t... | 2011/09/01 | [
"https://Stackoverflow.com/questions/7270798",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/688916/"
] | Have you seen [this](http://groups.google.com/group/android-beginners/browse_thread/thread/07f95399771fa3a0) post? It basically says there is an error in your constructor. His fix was to remove the argument, and also make sure to call the super's constructor ...
>
> InstantiationException occurs when an exception is ... | Did you implement the callback method onStartCommand() in your subclass (either WerServer or DroidServer)? Check out [Service.startService()](http://developer.android.com/reference/android/content/Context.html#startService%28android.content.Intent%29) for details.
Personally, I think use the bound form of service is ... |
812,744 | I'm trying to write a program that reads text from external file (string string int, per line).
Struct is defined outside of main function:
```
typedef struct Person {
char fname[15];
char lname[20];
unsigned long int birth;
} clovek;
```
I don't need "clovek" to be an array as with every line data can be over... | 2009/05/01 | [
"https://Stackoverflow.com/questions/812744",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | `clovek` is an alias for `struct Person`. Either remove the `typedef` keyword, or create an object of type `struct Person` somewhere in your code. With the present code you can do:
```
clovek someone;
while (buffer[ i ] ) != ' ') {
someone.fname[ i ] = buffer[ i ];
/* .. */
``` | Your statement defines clovek as an alias to the structure Person.
Remove "typedef" from the declaration. This way, clovek becomes a variable of type Person:
Or even better, separate struct declaration from variable declaration:
```
struct Person {
char fname[15];
char lname[20];
unsigned long int birth;
};
s... |
54,120,064 | Need help create a case statement to find the closest date from date table. My data: <https://imgur.com/hkBu4SA>
I basically want to set:
Y flag if it's closest to today's date from a.FROM\_EFFDT and is not null.
F if to\_effdate is null
else N
```
WHEN a.FROM_EFFDT < GETDATE() AND (to_effdate) IS NOT NULL ... | 2019/01/09 | [
"https://Stackoverflow.com/questions/54120064",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4735204/"
] | You can use window functions:
```
(case when row_number() over (order by abs(datediff(day, getdate(), to_effdate)) = 1
then 'Y'
when to_effdate is null then 'F'
else 'N'
end)
``` | You may be able to accomplish it with something like this. Though this isn't bulletproof, you could get duplicates if the closest date is tied.
```
create table Dates (from_effdt datetime, to_effdt datetime, flag varchar(1))
insert Dates (from_effdt, to_effdt, flag)
values
('2019-03-16', null, '') ,
('2018-06-14', '2... |
54,120,064 | Need help create a case statement to find the closest date from date table. My data: <https://imgur.com/hkBu4SA>
I basically want to set:
Y flag if it's closest to today's date from a.FROM\_EFFDT and is not null.
F if to\_effdate is null
else N
```
WHEN a.FROM_EFFDT < GETDATE() AND (to_effdate) IS NOT NULL ... | 2019/01/09 | [
"https://Stackoverflow.com/questions/54120064",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4735204/"
] | You can use window functions:
```
(case when row_number() over (order by abs(datediff(day, getdate(), to_effdate)) = 1
then 'Y'
when to_effdate is null then 'F'
else 'N'
end)
``` | You can simply do this:
```
CASE
WHEN from_effdt = (
select from_effdt
from Dates
where abs(datediff(second, from_effdt, getdate()))
= (select min(
abs(datediff(second, from_effdt, getdate()))
)
from Dates)
)
THEN 'Y'
ELSE
'N'
END
``` |
54,120,064 | Need help create a case statement to find the closest date from date table. My data: <https://imgur.com/hkBu4SA>
I basically want to set:
Y flag if it's closest to today's date from a.FROM\_EFFDT and is not null.
F if to\_effdate is null
else N
```
WHEN a.FROM_EFFDT < GETDATE() AND (to_effdate) IS NOT NULL ... | 2019/01/09 | [
"https://Stackoverflow.com/questions/54120064",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4735204/"
] | You can use window functions:
```
(case when row_number() over (order by abs(datediff(day, getdate(), to_effdate)) = 1
then 'Y'
when to_effdate is null then 'F'
else 'N'
end)
``` | ```
ROW_NUMBER() Over (Partition by id order by to_effdt desc)
,id
,from_effdt
,to_effdt
, CASE WHEN (ROW_NUMBER() Over (Partition by id order by to_effdt desc) = 1) THEN ('Y')
WHEN (to_effdt IS NULL) THEN ('F') ELSE ('N') End as flag
from a
``` |
46,795,246 | I was writing a code and had an error as `Prototype after '%' for main::compareHashes`. I don't know what is a prototype, and I'm still confused after viewing numerous documents online. Can someone please explain? | 2017/10/17 | [
"https://Stackoverflow.com/questions/46795246",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8715949/"
] | Looking at [your previous question](https://stackoverflow.com/questions/46781792/how-to-use-reference-of-hashes-in-perl), your prototype is this:
```
sub compareHashes(%$hash1, %$hash2) { ... }
```
As a prototype, this is nonsense. Perhaps you should read [the documentation on prototypes](https://perldoc.perl.org/pe... | You have something like
```
sub compareHashes(%$) { ... }
```
`(%$)` is the prototype. [Prototypes](http://perldoc.perl.org/perlsub.html#Prototypes) affects how the call to the sub is parsed.
---
As for your the error you received, [perldiag](http://perldoc.perl.org/perldiag.html) provides the following explanatio... |
28,777 | I have read and researched online about electric monitoring systems like the kill a watt and wattspn and i have observed something in vpmmon, they do reuire intrusive devices like sockets as means of controlling (on or off the devices) and monitoring mechanism. Now is there a diffent way or idea in order to control and... | 2012/03/27 | [
"https://electronics.stackexchange.com/questions/28777",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/8769/"
] | On/off control is, by definition, intrusive. ie
The act of turning something off IS intrusive.
The act of turning something on IS intrusive.
BUT:
You can measure AC current without intrusion and
You can measure AC voltage with very close to zero intrusion.
While it IS possible to monitor voltage witho... | While it is possible to measure load current in a non-intrusive way, using a clamp ammeter like this:

It is not really possible to control the current in the cable. Certainly not possible to switch appliances on and off. |
54,528,100 | How to remove the zeros
```
select CONVERT(varchar, CAST( -3563338 AS money), 1)
```
Output
```
-3,563,338.00
```
Expected Output
```
-3,563,338
``` | 2019/02/05 | [
"https://Stackoverflow.com/questions/54528100",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4458047/"
] | Use `FORMAT`:
```
SELECT FORMAT(-3563338,'#,###,##0')
-3,563,338
```
The money type output includes a decimal component for change. But, since you don't want to see that it might be easier to just use `FORMAT` instead. | Try below - using `replace()` function
```
select replace(CONVERT(varchar, CAST( -3563338 AS money), 1),'.00','')
``` |
54,528,100 | How to remove the zeros
```
select CONVERT(varchar, CAST( -3563338 AS money), 1)
```
Output
```
-3,563,338.00
```
Expected Output
```
-3,563,338
``` | 2019/02/05 | [
"https://Stackoverflow.com/questions/54528100",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4458047/"
] | Use `FORMAT`:
```
SELECT FORMAT(-3563338,'#,###,##0')
-3,563,338
```
The money type output includes a decimal component for change. But, since you don't want to see that it might be easier to just use `FORMAT` instead. | this will work:
```
select TO_CHAR(-3563338.00,'99999999') from dual;
``` |
52,215,698 | I have been trying to disable `float:left` in media screen only .
But its still taking the `float:left`.
I have `float:left` on none media screen.
```css
@media only screen and (max-width: 600px) {
.twitter_page {
padding: 0 108px 0 0;
margin-left: -3px;
float: none;
}
}
.twitter_page {
... | 2018/09/07 | [
"https://Stackoverflow.com/questions/52215698",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9987157/"
] | Your CSS is parsed from top to bottom. Put the media query at the bottom of your document and you will get what you want.
```css
.twitter_page {
float: left;
padding: 0 218px 0 0;
/* border: solid; */
margin-right: -109px;
margin-left: 54px;
}
@media only screen and (max-width: 600px) {
.twitter_p... | There is nothing wrong with your css but positioning problem. you wrote media css first then normal css, so in this case media css will override by normal css.
Try this
```
.twitter_page {
float: left;
padding: 0 218px 0 0;
margin-right: -109px;
margin-left: 54px;
}
@media only screen and (max-width: ... |
37,016,728 | When I try to store arrays from Parse into a local array I can only access it within the `findObjectsInBackgroundWithBlock {...}`. When I print it outside of that block, it shows `[]`...
Code :
```
var qArray : [[Int]] = []
override func viewDidLoad() {
super.viewDidLoad()
let query = PFQuery(className: "Tr... | 2016/05/04 | [
"https://Stackoverflow.com/questions/37016728",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6036335/"
] | For anyone interested in the future, I solved this problem, as I'm using angular 2 in my app, I defined as you can see in my code snippet a base url for my app :
```
<base href="/">
```
This becomes a problem in cordova and should be deleted for an android/ios app. | if css and js folder are in same level as index.html you should link them like this :-
```
<link href="css/android/prelogin.css" rel="stylesheet">
<script type="text/javascript" src="cordova.js"></script>
<script src="scripts/lib/jquery/jquery.1.9.1.js"></script>
<script src="scripts/lib/jquery/jquery.mobile-1.3.2.js"... |
46,551,925 | I need to use CSS hover with VueJS v-bind:style directive but couldn't find information regarding it.
I need to bind styles for hover but `v-bind:style.hover={}`
doesn't work. All the properties are going to be fetched from back-end, so I need to bind styles dynamically.
Are there other ways to bind styles on mouse ... | 2017/10/03 | [
"https://Stackoverflow.com/questions/46551925",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5952495/"
] | Improved solution: use CSS custom properties and variables
----------------------------------------------------------
If you only intend to work with modern/evergreen browsers, then using CSS custom properties and variables is the way to go! You can actually pass CSS custom properties into the `:style` binding, e.g.
... | If you use single file components, then you just need to make the button style scoped:
```
<template>
<button></button>
</template>
<style scoped>
button {
/* your button style here */
}
</style>
```
Or even for a more confined styling there are modules, shown here: [How to correctly use "scoped... |
46,551,925 | I need to use CSS hover with VueJS v-bind:style directive but couldn't find information regarding it.
I need to bind styles for hover but `v-bind:style.hover={}`
doesn't work. All the properties are going to be fetched from back-end, so I need to bind styles dynamically.
Are there other ways to bind styles on mouse ... | 2017/10/03 | [
"https://Stackoverflow.com/questions/46551925",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5952495/"
] | **Other way (using css variables).**
You need create HTML with style
```
<style>
div[vueid=${_uid}] { --btn-hover: ${`Here your hover brush`} }
</style>
```
and inject it into your component.
```
<template>
<div vueid="_uid">
<button></button>
<div v-html="styleCode"></div>
</div>
</templ... | An extremely simple solution I found was to use the `v-bind:class` directive instead:
in my case i needed to add a hover when this element is inactive:
`:class="{'inactive': !item.count}"`
In this case, I am able to add an inactive property to my class, and then i can simply style that class with `hover` properties ... |
46,551,925 | I need to use CSS hover with VueJS v-bind:style directive but couldn't find information regarding it.
I need to bind styles for hover but `v-bind:style.hover={}`
doesn't work. All the properties are going to be fetched from back-end, so I need to bind styles dynamically.
Are there other ways to bind styles on mouse ... | 2017/10/03 | [
"https://Stackoverflow.com/questions/46551925",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5952495/"
] | Improved solution: use CSS custom properties and variables
----------------------------------------------------------
If you only intend to work with modern/evergreen browsers, then using CSS custom properties and variables is the way to go! You can actually pass CSS custom properties into the `:style` binding, e.g.
... | After seeing this is not implemented in vue I decided to use an overlay, which adds up to using :style to the overlay that will be shown by changing the opacity.
It is basically:
```
<div id="test" :style="style">
<div class="overlay" :style="style.hover"></div>
</div>
```
```js
var testArea = Vue.component('test... |
46,551,925 | I need to use CSS hover with VueJS v-bind:style directive but couldn't find information regarding it.
I need to bind styles for hover but `v-bind:style.hover={}`
doesn't work. All the properties are going to be fetched from back-end, so I need to bind styles dynamically.
Are there other ways to bind styles on mouse ... | 2017/10/03 | [
"https://Stackoverflow.com/questions/46551925",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5952495/"
] | Improved solution: use CSS custom properties and variables
----------------------------------------------------------
If you only intend to work with modern/evergreen browsers, then using CSS custom properties and variables is the way to go! You can actually pass CSS custom properties into the `:style` binding, e.g.
... | You can assign your Vuejs Component an id and apply the required hover style in a stylesheet.
```
<button id="styledButton" type="button"
:style="{
color:button.color,
backgroundColor:button.colorBackd,
borderColor:button.borderColor,
}"
class="btn btn-outline-info large-button">
{{ button.text }}
</butto... |
46,551,925 | I need to use CSS hover with VueJS v-bind:style directive but couldn't find information regarding it.
I need to bind styles for hover but `v-bind:style.hover={}`
doesn't work. All the properties are going to be fetched from back-end, so I need to bind styles dynamically.
Are there other ways to bind styles on mouse ... | 2017/10/03 | [
"https://Stackoverflow.com/questions/46551925",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5952495/"
] | **Other way (using css variables).**
You need create HTML with style
```
<style>
div[vueid=${_uid}] { --btn-hover: ${`Here your hover brush`} }
</style>
```
and inject it into your component.
```
<template>
<div vueid="_uid">
<button></button>
<div v-html="styleCode"></div>
</div>
</templ... | After seeing this is not implemented in vue I decided to use an overlay, which adds up to using :style to the overlay that will be shown by changing the opacity.
It is basically:
```
<div id="test" :style="style">
<div class="overlay" :style="style.hover"></div>
</div>
```
```js
var testArea = Vue.component('test... |
46,551,925 | I need to use CSS hover with VueJS v-bind:style directive but couldn't find information regarding it.
I need to bind styles for hover but `v-bind:style.hover={}`
doesn't work. All the properties are going to be fetched from back-end, so I need to bind styles dynamically.
Are there other ways to bind styles on mouse ... | 2017/10/03 | [
"https://Stackoverflow.com/questions/46551925",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5952495/"
] | Improved solution: use CSS custom properties and variables
----------------------------------------------------------
If you only intend to work with modern/evergreen browsers, then using CSS custom properties and variables is the way to go! You can actually pass CSS custom properties into the `:style` binding, e.g.
... | I wanted to change z-index on hover so that hovered p tag appears at top. To do so I had to listen for event along with some value.
[](https://i.stack.imgur.com/reo9c.png)[](https://i... |
46,551,925 | I need to use CSS hover with VueJS v-bind:style directive but couldn't find information regarding it.
I need to bind styles for hover but `v-bind:style.hover={}`
doesn't work. All the properties are going to be fetched from back-end, so I need to bind styles dynamically.
Are there other ways to bind styles on mouse ... | 2017/10/03 | [
"https://Stackoverflow.com/questions/46551925",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5952495/"
] | **Other way (using css variables).**
You need create HTML with style
```
<style>
div[vueid=${_uid}] { --btn-hover: ${`Here your hover brush`} }
</style>
```
and inject it into your component.
```
<template>
<div vueid="_uid">
<button></button>
<div v-html="styleCode"></div>
</div>
</templ... | I'm using vue3 with composition api and decided there's 2 good ways to do this. You can use a slot and variable like so:
```
<MenuItem v-slot="{ active }">
<a href="#" :class="[active ? 'bg-neutral-600' : '', text-sm']">File</a>
</MenuItem>
```
Or you can use any template variables in the CSS section with v-bind()... |
46,551,925 | I need to use CSS hover with VueJS v-bind:style directive but couldn't find information regarding it.
I need to bind styles for hover but `v-bind:style.hover={}`
doesn't work. All the properties are going to be fetched from back-end, so I need to bind styles dynamically.
Are there other ways to bind styles on mouse ... | 2017/10/03 | [
"https://Stackoverflow.com/questions/46551925",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5952495/"
] | You can assign your Vuejs Component an id and apply the required hover style in a stylesheet.
```
<button id="styledButton" type="button"
:style="{
color:button.color,
backgroundColor:button.colorBackd,
borderColor:button.borderColor,
}"
class="btn btn-outline-info large-button">
{{ button.text }}
</butto... | After seeing this is not implemented in vue I decided to use an overlay, which adds up to using :style to the overlay that will be shown by changing the opacity.
It is basically:
```
<div id="test" :style="style">
<div class="overlay" :style="style.hover"></div>
</div>
```
```js
var testArea = Vue.component('test... |
46,551,925 | I need to use CSS hover with VueJS v-bind:style directive but couldn't find information regarding it.
I need to bind styles for hover but `v-bind:style.hover={}`
doesn't work. All the properties are going to be fetched from back-end, so I need to bind styles dynamically.
Are there other ways to bind styles on mouse ... | 2017/10/03 | [
"https://Stackoverflow.com/questions/46551925",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5952495/"
] | You can assign your Vuejs Component an id and apply the required hover style in a stylesheet.
```
<button id="styledButton" type="button"
:style="{
color:button.color,
backgroundColor:button.colorBackd,
borderColor:button.borderColor,
}"
class="btn btn-outline-info large-button">
{{ button.text }}
</butto... | I wanted to change z-index on hover so that hovered p tag appears at top. To do so I had to listen for event along with some value.
[](https://i.stack.imgur.com/reo9c.png)[](https://i... |
46,551,925 | I need to use CSS hover with VueJS v-bind:style directive but couldn't find information regarding it.
I need to bind styles for hover but `v-bind:style.hover={}`
doesn't work. All the properties are going to be fetched from back-end, so I need to bind styles dynamically.
Are there other ways to bind styles on mouse ... | 2017/10/03 | [
"https://Stackoverflow.com/questions/46551925",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5952495/"
] | You can assign your Vuejs Component an id and apply the required hover style in a stylesheet.
```
<button id="styledButton" type="button"
:style="{
color:button.color,
backgroundColor:button.colorBackd,
borderColor:button.borderColor,
}"
class="btn btn-outline-info large-button">
{{ button.text }}
</butto... | If you use single file components, then you just need to make the button style scoped:
```
<template>
<button></button>
</template>
<style scoped>
button {
/* your button style here */
}
</style>
```
Or even for a more confined styling there are modules, shown here: [How to correctly use "scoped... |
6,935 | I installed Kubuntu 9.04 with Dutch as the language setting. However, when I first started, everything was actually in English. In the system settings -> region and language I set the system language to Dutch. This didn't change anything immediately, but after a while things suddenly started appearing in Dutch.
I quic... | 2009/07/17 | [
"https://superuser.com/questions/6935",
"https://superuser.com",
"https://superuser.com/users/2579/"
] | This was solved when I upgraded to KDE 4.3 | It sounds like, if they aren't being renamed back properly, you might need to reinstall. Otherwise can I suggest perhaps moving your .kde directory to "reset" all your settings temporarily and see if that works. |
51,829,317 | I tried to append different values for same key in dict but getting error please help to solve this..
both below dictionary initializations giving errors.
```
//one way of declaring dict
public var List = Dictionary<String, Array<Any>>()
// second way of declaring dict
public var List = [String:... | 2018/08/13 | [
"https://Stackoverflow.com/questions/51829317",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9565687/"
] | You cannot append it in place. Because `List[BDDR]` gives you a constant copy of the array. You have to assign the list array to a variable, append the value and then set ti back to the dict.
```
var list = List[BDDR]
list?.append(pressure)
List[bDDR] = list
```
Also, `public var List = [String: [String]]()`, will n... | You can try this if you wan to overwrite old values
```
List.updateValue([pressure],forKey:bDDR)
```
if you want to append
```
List.updateValue(List[bDDR]! + [pressure],forKey:bDDR)
``` |
51,829,317 | I tried to append different values for same key in dict but getting error please help to solve this..
both below dictionary initializations giving errors.
```
//one way of declaring dict
public var List = Dictionary<String, Array<Any>>()
// second way of declaring dict
public var List = [String:... | 2018/08/13 | [
"https://Stackoverflow.com/questions/51829317",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9565687/"
] | You cannot append it in place. Because `List[BDDR]` gives you a constant copy of the array. You have to assign the list array to a variable, append the value and then set ti back to the dict.
```
var list = List[BDDR]
list?.append(pressure)
List[bDDR] = list
```
Also, `public var List = [String: [String]]()`, will n... | ```
List.updateValue([pressure.description], forKey: bDDR)
``` |
34,531 | I am just wondering how I would say "I graduated from BLANK university" in French. Google translate says "je suis diplômé de..." but I think that translates to I have my diploma from. The word for graduate in French is graduel/graduelle. Why wouldn't we use that word or is Google translate incorrect? | 2019/03/31 | [
"https://french.stackexchange.com/questions/34531",
"https://french.stackexchange.com",
"https://french.stackexchange.com/users/19225/"
] | The adjective ***graduel*** is the translation of gradual. You never use it for people but for a process. eg. *L'augmentation graduelle de température* means *the gradual temperature increase*.
We also have the adjective ***gradué*** which means *graduated* but that nowadays only apply to measurement instruments that ... | The word for "graduate" in French is not "graduel" but "licencié" for a man and "licenciée" for a woman.
>
> (TLFi) B. ENSEIGN. SUPÉRIEUR. Celui, celle qui possède le diplôme de licence. Licencié d'une faculté; licencié en droit. -
>
>
> * Il faudra se représenter (...) la licenciée ès lettres, en tablier bleu de ... |
34,531 | I am just wondering how I would say "I graduated from BLANK university" in French. Google translate says "je suis diplômé de..." but I think that translates to I have my diploma from. The word for graduate in French is graduel/graduelle. Why wouldn't we use that word or is Google translate incorrect? | 2019/03/31 | [
"https://french.stackexchange.com/questions/34531",
"https://french.stackexchange.com",
"https://french.stackexchange.com/users/19225/"
] | The correct translation is “*Je suis diplômé de l'université …*”. Yes, that means the place you got your diploma from, but that's what “graduated from” means.
If you want to specify exactly what diploma you had, use a noun, like in English. If you want to specify the action, rather than the state, then you also need t... | The word for "graduate" in French is not "graduel" but "licencié" for a man and "licenciée" for a woman.
>
> (TLFi) B. ENSEIGN. SUPÉRIEUR. Celui, celle qui possède le diplôme de licence. Licencié d'une faculté; licencié en droit. -
>
>
> * Il faudra se représenter (...) la licenciée ès lettres, en tablier bleu de ... |
12,861,311 | Basically I want the following generic function:
```
public string StringOrNull<T> (T value)
{
if (value != null)
{
return value.ToString();
}
return null;
}
```
I know I could use a constraint such as where T: class, but T can be a primitive type, Nullable<>, or a class. Is there a generic wa... | 2012/10/12 | [
"https://Stackoverflow.com/questions/12861311",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34329/"
] | [default Keyword in Generic Code](http://msdn.microsoft.com/en-us/library/xwth0h0d%28v=vs.80%29.aspx)
In generic classes and methods, one issue that arises is how to assign a default value to a parameterized type T when you do not know the following in advance:
Whether T will be a reference type or a value type.
If ... | Why generic?
```
public string StringOrNull (object value)
{
if (value != null){
return value.ToString();
}
return null;
}
``` |
12,861,311 | Basically I want the following generic function:
```
public string StringOrNull<T> (T value)
{
if (value != null)
{
return value.ToString();
}
return null;
}
```
I know I could use a constraint such as where T: class, but T can be a primitive type, Nullable<>, or a class. Is there a generic wa... | 2012/10/12 | [
"https://Stackoverflow.com/questions/12861311",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34329/"
] | Here's a fun one:
```
public static class ExtensionFunctions{
public static string ToStringOrNull( this object target ) {
return target != null ? target.ToString() : null;
}
}
```
The cool part? This will work:
```
( (string) null ).ToStringOrNull();
```
So will this:
```
5.ToStringOrNull();
``... | [default Keyword in Generic Code](http://msdn.microsoft.com/en-us/library/xwth0h0d%28v=vs.80%29.aspx)
In generic classes and methods, one issue that arises is how to assign a default value to a parameterized type T when you do not know the following in advance:
Whether T will be a reference type or a value type.
If ... |
12,861,311 | Basically I want the following generic function:
```
public string StringOrNull<T> (T value)
{
if (value != null)
{
return value.ToString();
}
return null;
}
```
I know I could use a constraint such as where T: class, but T can be a primitive type, Nullable<>, or a class. Is there a generic wa... | 2012/10/12 | [
"https://Stackoverflow.com/questions/12861311",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34329/"
] | You can use [default](http://msdn.microsoft.com/en-us/library/xwth0h0d.aspx) keyword to return the default of T:
```
public string StringOrNull<T> (T value)
{
.....
return default(T).ToString();
}
``` | Why generic?
```
public string StringOrNull (object value)
{
if (value != null){
return value.ToString();
}
return null;
}
``` |
12,861,311 | Basically I want the following generic function:
```
public string StringOrNull<T> (T value)
{
if (value != null)
{
return value.ToString();
}
return null;
}
```
I know I could use a constraint such as where T: class, but T can be a primitive type, Nullable<>, or a class. Is there a generic wa... | 2012/10/12 | [
"https://Stackoverflow.com/questions/12861311",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34329/"
] | Here's a fun one:
```
public static class ExtensionFunctions{
public static string ToStringOrNull( this object target ) {
return target != null ? target.ToString() : null;
}
}
```
The cool part? This will work:
```
( (string) null ).ToStringOrNull();
```
So will this:
```
5.ToStringOrNull();
``... | Why generic?
```
public string StringOrNull (object value)
{
if (value != null){
return value.ToString();
}
return null;
}
``` |
12,861,311 | Basically I want the following generic function:
```
public string StringOrNull<T> (T value)
{
if (value != null)
{
return value.ToString();
}
return null;
}
```
I know I could use a constraint such as where T: class, but T can be a primitive type, Nullable<>, or a class. Is there a generic wa... | 2012/10/12 | [
"https://Stackoverflow.com/questions/12861311",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34329/"
] | Here's a fun one:
```
public static class ExtensionFunctions{
public static string ToStringOrNull( this object target ) {
return target != null ? target.ToString() : null;
}
}
```
The cool part? This will work:
```
( (string) null ).ToStringOrNull();
```
So will this:
```
5.ToStringOrNull();
``... | You can use [default](http://msdn.microsoft.com/en-us/library/xwth0h0d.aspx) keyword to return the default of T:
```
public string StringOrNull<T> (T value)
{
.....
return default(T).ToString();
}
``` |
300,740 | I am developing a *Geographic Information System* where GPS coordinates are gathered and analyzed in a server. I have a module where I collect coordinates/points in a map where a person has stopped for an allocated length of time.
So, my question is what **term/word** can I used for those points (which will be equiva... | 2016/01/19 | [
"https://english.stackexchange.com/questions/300740",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/156082/"
] | *Idle Location* is grammatically correct. Some more ideas: *Idle Area*, *Idle Zone*, *Rest Spot*, *Resting Point*, *Break Point* | Consider **intermission point**. [Dictionary.com defines intermission](http://dictionary.reference.com/browse/intermission) as "a period during which action temporarily ceases." |
562,716 | I've been looking for a general word to define an idea that seems true, but simply isn't.
A simple example: "The Earth is flat." If all you know is the world outside your window, and you've never done any basic experiments, read books, or seen photos to the contrary, this seems like a reasonable explanation. But it do... | 2021/03/15 | [
"https://english.stackexchange.com/questions/562716",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/76909/"
] | **Seemingly** works well for the given context.
>
> appearing to be something, especially when this is not true:
>
>
>
*He remains confident and seemingly untroubled by his recent problems.*
[Cambridge]
You could this say: *The earth is **seemingly** flat.* (which it isn't in reality.) | I would use *ostensibly*.
OED : as appears or is stated to be true, though not necessarily so |
49,110,261 | I am trying to get data from a php sub-page.
Using javascript, I have tried to use :
```js
var items = document.querySelectorAll('option');
console.log("length : "+items.length);
```
```html
<option value="75">item-127 ( 120127 )</option>
<option value="74">item-163 ( 0 )</option>
<option value="94">item-139... | 2018/03/05 | [
"https://Stackoverflow.com/questions/49110261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9445606/"
] | It's error because of
>
> The expected message formats for the operation are 'Xml', 'Json'.
> So you can pass contentType in your ajax call
>
>
>
```
$.ajax({
....,
contentType: "application/json"
})
``` | I am not sure, but it depends on what server wants to read from you.
Server does not want to read raw bytes, it wants xml or json
Try to add headers like
```
beforeSend: function(xhrObj){
xhrObj.setRequestHeader("Content-Type","application/json");
xhrObj.setRequestHeader("Accept","application/json");
},
```... |
49,110,261 | I am trying to get data from a php sub-page.
Using javascript, I have tried to use :
```js
var items = document.querySelectorAll('option');
console.log("length : "+items.length);
```
```html
<option value="75">item-127 ( 120127 )</option>
<option value="74">item-163 ( 0 )</option>
<option value="94">item-139... | 2018/03/05 | [
"https://Stackoverflow.com/questions/49110261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9445606/"
] | I am not sure, but it depends on what server wants to read from you.
Server does not want to read raw bytes, it wants xml or json
Try to add headers like
```
beforeSend: function(xhrObj){
xhrObj.setRequestHeader("Content-Type","application/json");
xhrObj.setRequestHeader("Accept","application/json");
},
```... | Instead of this
```
var postData = JSON.stringify(companyValue);
```
why don't you try this:
```
var obj ={token :token ,companyValue:companyValue }
```
And then make use of the json stringify function
```
var postData = JSON.stringify(obj);
```
After that in ajax call only change the url:
```
url: "http:/... |
49,110,261 | I am trying to get data from a php sub-page.
Using javascript, I have tried to use :
```js
var items = document.querySelectorAll('option');
console.log("length : "+items.length);
```
```html
<option value="75">item-127 ( 120127 )</option>
<option value="74">item-163 ( 0 )</option>
<option value="94">item-139... | 2018/03/05 | [
"https://Stackoverflow.com/questions/49110261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9445606/"
] | It's error because of
>
> The expected message formats for the operation are 'Xml', 'Json'.
> So you can pass contentType in your ajax call
>
>
>
```
$.ajax({
....,
contentType: "application/json"
})
``` | Instead of this
```
var postData = JSON.stringify(companyValue);
```
why don't you try this:
```
var obj ={token :token ,companyValue:companyValue }
```
And then make use of the json stringify function
```
var postData = JSON.stringify(obj);
```
After that in ajax call only change the url:
```
url: "http:/... |
49,110,261 | I am trying to get data from a php sub-page.
Using javascript, I have tried to use :
```js
var items = document.querySelectorAll('option');
console.log("length : "+items.length);
```
```html
<option value="75">item-127 ( 120127 )</option>
<option value="74">item-163 ( 0 )</option>
<option value="94">item-139... | 2018/03/05 | [
"https://Stackoverflow.com/questions/49110261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9445606/"
] | It's error because of
>
> The expected message formats for the operation are 'Xml', 'Json'.
> So you can pass contentType in your ajax call
>
>
>
```
$.ajax({
....,
contentType: "application/json"
})
``` | You need to set the content type header in your request to inform the server you're sending the data as JSON.
The error message is telling you that the server does not understand the content you're sending it - you have to give it a hint that the data is in a particular format, especially because, again as mentioned ... |
49,110,261 | I am trying to get data from a php sub-page.
Using javascript, I have tried to use :
```js
var items = document.querySelectorAll('option');
console.log("length : "+items.length);
```
```html
<option value="75">item-127 ( 120127 )</option>
<option value="74">item-163 ( 0 )</option>
<option value="94">item-139... | 2018/03/05 | [
"https://Stackoverflow.com/questions/49110261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9445606/"
] | It's error because of
>
> The expected message formats for the operation are 'Xml', 'Json'.
> So you can pass contentType in your ajax call
>
>
>
```
$.ajax({
....,
contentType: "application/json"
})
``` | ```
$("body").on("submit", ".example_form", function() {
$.ajax({
url: 'http://example.com/{ROUTE_URL}',
data: new FormData(this),
processData: false,
contentType: false,
/* OR contentType: "application/json; charset=utf-8"*/
type: 'POST',
dataType: "json",
success: function(data) {
... |
49,110,261 | I am trying to get data from a php sub-page.
Using javascript, I have tried to use :
```js
var items = document.querySelectorAll('option');
console.log("length : "+items.length);
```
```html
<option value="75">item-127 ( 120127 )</option>
<option value="74">item-163 ( 0 )</option>
<option value="94">item-139... | 2018/03/05 | [
"https://Stackoverflow.com/questions/49110261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9445606/"
] | You need to set the content type header in your request to inform the server you're sending the data as JSON.
The error message is telling you that the server does not understand the content you're sending it - you have to give it a hint that the data is in a particular format, especially because, again as mentioned ... | Instead of this
```
var postData = JSON.stringify(companyValue);
```
why don't you try this:
```
var obj ={token :token ,companyValue:companyValue }
```
And then make use of the json stringify function
```
var postData = JSON.stringify(obj);
```
After that in ajax call only change the url:
```
url: "http:/... |
49,110,261 | I am trying to get data from a php sub-page.
Using javascript, I have tried to use :
```js
var items = document.querySelectorAll('option');
console.log("length : "+items.length);
```
```html
<option value="75">item-127 ( 120127 )</option>
<option value="74">item-163 ( 0 )</option>
<option value="94">item-139... | 2018/03/05 | [
"https://Stackoverflow.com/questions/49110261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9445606/"
] | ```
$("body").on("submit", ".example_form", function() {
$.ajax({
url: 'http://example.com/{ROUTE_URL}',
data: new FormData(this),
processData: false,
contentType: false,
/* OR contentType: "application/json; charset=utf-8"*/
type: 'POST',
dataType: "json",
success: function(data) {
... | Instead of this
```
var postData = JSON.stringify(companyValue);
```
why don't you try this:
```
var obj ={token :token ,companyValue:companyValue }
```
And then make use of the json stringify function
```
var postData = JSON.stringify(obj);
```
After that in ajax call only change the url:
```
url: "http:/... |
47,051,424 | I want to open image / video in modal popup so I have a button on click I can show image. but when I have both image and video its difficult that how can I check that tags in jQuery.
My html code for zoom image in popup
```
<div>
<img src="image/zoom-icon.png" id="zoomImg" >
<div class="bigthumb">
<im... | 2017/11/01 | [
"https://Stackoverflow.com/questions/47051424",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4265308/"
] | You can use [`.is()`](http://api.jquery.com/is/)
>
> Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments
>
>
>
```
if($(this).is('img')){
//Do something
}
``` | You could use `nodeName` property to check the element type:
```
$(this).prop("nodeName")
```
Or:
```
this.nodeName
```
The values would be `IMG` or `VIDEO`.
>
> The Node.nodeName read-only property returns the name of the current node as a string.
>
>
> Ref: <https://developer.mozilla.org/en-US/docs/Web/API/... |
47,051,424 | I want to open image / video in modal popup so I have a button on click I can show image. but when I have both image and video its difficult that how can I check that tags in jQuery.
My html code for zoom image in popup
```
<div>
<img src="image/zoom-icon.png" id="zoomImg" >
<div class="bigthumb">
<im... | 2017/11/01 | [
"https://Stackoverflow.com/questions/47051424",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4265308/"
] | You can use [`.is()`](http://api.jquery.com/is/)
>
> Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments
>
>
>
```
if($(this).is('img')){
//Do something
}
``` | If you are using jQuery, you can use its is() method, or you can use plain JS:
```
$('#zoomImg').on('click', function (evt) {
switch (evt.currentTarget.tagName) {
case 'IMG':
// logic here
break
case 'VIDEO':
// logic here
break
default:
console.warn('Unsupported zoom target... |
47,051,424 | I want to open image / video in modal popup so I have a button on click I can show image. but when I have both image and video its difficult that how can I check that tags in jQuery.
My html code for zoom image in popup
```
<div>
<img src="image/zoom-icon.png" id="zoomImg" >
<div class="bigthumb">
<im... | 2017/11/01 | [
"https://Stackoverflow.com/questions/47051424",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4265308/"
] | You can use [`.is()`](http://api.jquery.com/is/)
>
> Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments
>
>
>
```
if($(this).is('img')){
//Do something
}
``` | You could use `nodeName` to do this
```
if(this.nodeName == 'IMG')
``` |
8,098,211 | I created one stored procedure; it executed successfully but while executing manually it is showing error.
Here's my stored proc
```
USE [chandru]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
alter procedure [dbo].[Insert_BandWidthDetails]
@CurrentState nvarchar(50),@Process nvarchar(100),@DateTime n... | 2011/11/11 | [
"https://Stackoverflow.com/questions/8098211",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1005078/"
] | Besides the design where you have a single table per user, your issue is that the first line of SQL doesn't have a space before the IF statement. If you want line breaks in the SQL, then you need to add `+ CHAR(10)` and not have the line breaks directly in the code.
If you are keeping the dynamic SQL, I would suggest... | Try to make that change:
Here
```
declare @count int select @count=COUNT(*) from BandWidth'+@UserName+@UserId+' where CurrentState='''+@CurrentState+''' and Process='''+@Process+''' and DateTime='''+@DateTime+''' and IPaddress='''+@IPaddress+''' and UploadedBytes='''+@UploadedBytes+''' and DownloadedBytes='''+@Downl... |
39,292,042 | I have a set of FakeIds, which are then converted to real ids on insertion. I now want to obtain the mapping of fake to real. My query is like
```
INSERT INTO Data_tbl
(days)
OUTPUT inserted.DateID, 0,source.DateID into @mappedIDs(objectId, objectTypeId, fakeId)
SELECT Days
FROM @inputTab... | 2016/09/02 | [
"https://Stackoverflow.com/questions/39292042",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3331111/"
] | USE a **MERGE** command instead... in the OUTPUT clause you can mention the inserted and source column that you required.
Sample code is given below.
```
MERGE Data_tbl d
USING ( SELECT DateID,Days
FROM @inputTable
) d1 ON d.DateID = d1.DateID
WHEN NOT MATCHED
THEN INSERT
([days])
... | The trick to mapping inserted data to source data when you don't pass both IDs to the destination table is tricky, you have to build your own map. Here's my full script you can use to build your own.
First, to emulate your destination table I created a temp table, so I always put a check to see if the temp table alrea... |
2,656,485 | I am on a Mac with Snow Leopard (10.6.3). I hear that the assembly language I work with has to be valid with the chipset that you use. I am completely new to this I have a basic background in C and Objective-C programming and an almost strong background in PHP. I have always wanted to see what assembly is all about.
... | 2010/04/16 | [
"https://Stackoverflow.com/questions/2656485",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/305680/"
] | The assembly language you use is not dependent on your OS but rather your CPU's instruction set. Judging by your Mac version, I'd say you are using an Intel processor - so you would want to learn x86 or amd64 assembly. | An assembly language is instruction architecture specific. Chips are an instantiation of an instruction architecture.
In my opinion, you are best served by getting TextWrangler and directly compiling with gcc.
The file extension you are looking for is `.s`. |
2,656,485 | I am on a Mac with Snow Leopard (10.6.3). I hear that the assembly language I work with has to be valid with the chipset that you use. I am completely new to this I have a basic background in C and Objective-C programming and an almost strong background in PHP. I have always wanted to see what assembly is all about.
... | 2010/04/16 | [
"https://Stackoverflow.com/questions/2656485",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/305680/"
] | A good way to pick up assembly is to get yourself an embedded device to play with.
TI has some [nice, inexpensive devkits](http://focus.ti.com/mcu/docs/mcuprodmsptoolsw.tsp?sectionId=95&tabId=1203&familyId=342&toolTypeId=1) to play with. I've poked around with the Chronos kit ($50) which has digital watch with a progr... | An assembly language is instruction architecture specific. Chips are an instantiation of an instruction architecture.
In my opinion, you are best served by getting TextWrangler and directly compiling with gcc.
The file extension you are looking for is `.s`. |
2,656,485 | I am on a Mac with Snow Leopard (10.6.3). I hear that the assembly language I work with has to be valid with the chipset that you use. I am completely new to this I have a basic background in C and Objective-C programming and an almost strong background in PHP. I have always wanted to see what assembly is all about.
... | 2010/04/16 | [
"https://Stackoverflow.com/questions/2656485",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/305680/"
] | The assembly language you use is not dependent on your OS but rather your CPU's instruction set. Judging by your Mac version, I'd say you are using an Intel processor - so you would want to learn x86 or amd64 assembly. | Assembly, for any processor, will be more or less the same in concept. However, the *complexity* varies between processors. From what I see in your site, you'd be doing x86 assembler, (x86 being the instruction set all consumer-line Intel processors use, which recent Macs and all PCs use) which can turn out to be fairl... |
2,656,485 | I am on a Mac with Snow Leopard (10.6.3). I hear that the assembly language I work with has to be valid with the chipset that you use. I am completely new to this I have a basic background in C and Objective-C programming and an almost strong background in PHP. I have always wanted to see what assembly is all about.
... | 2010/04/16 | [
"https://Stackoverflow.com/questions/2656485",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/305680/"
] | The assembly language you use is not dependent on your OS but rather your CPU's instruction set. Judging by your Mac version, I'd say you are using an Intel processor - so you would want to learn x86 or amd64 assembly. | A good way to pick up assembly is to get yourself an embedded device to play with.
TI has some [nice, inexpensive devkits](http://focus.ti.com/mcu/docs/mcuprodmsptoolsw.tsp?sectionId=95&tabId=1203&familyId=342&toolTypeId=1) to play with. I've poked around with the Chronos kit ($50) which has digital watch with a progr... |
2,656,485 | I am on a Mac with Snow Leopard (10.6.3). I hear that the assembly language I work with has to be valid with the chipset that you use. I am completely new to this I have a basic background in C and Objective-C programming and an almost strong background in PHP. I have always wanted to see what assembly is all about.
... | 2010/04/16 | [
"https://Stackoverflow.com/questions/2656485",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/305680/"
] | The assembly language you use is not dependent on your OS but rather your CPU's instruction set. Judging by your Mac version, I'd say you are using an Intel processor - so you would want to learn x86 or amd64 assembly. | The linked tutorials look like they use NASM, which is included with Macs. However, system calls are usually different on different platforms (they're very different between Mac and Linux), and without seeing the tutorials, it's hard to know whether they'll target different platforms (I'd guess not, though). A better b... |
2,656,485 | I am on a Mac with Snow Leopard (10.6.3). I hear that the assembly language I work with has to be valid with the chipset that you use. I am completely new to this I have a basic background in C and Objective-C programming and an almost strong background in PHP. I have always wanted to see what assembly is all about.
... | 2010/04/16 | [
"https://Stackoverflow.com/questions/2656485",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/305680/"
] | A good way to pick up assembly is to get yourself an embedded device to play with.
TI has some [nice, inexpensive devkits](http://focus.ti.com/mcu/docs/mcuprodmsptoolsw.tsp?sectionId=95&tabId=1203&familyId=342&toolTypeId=1) to play with. I've poked around with the Chronos kit ($50) which has digital watch with a progr... | Assembly, for any processor, will be more or less the same in concept. However, the *complexity* varies between processors. From what I see in your site, you'd be doing x86 assembler, (x86 being the instruction set all consumer-line Intel processors use, which recent Macs and all PCs use) which can turn out to be fairl... |
2,656,485 | I am on a Mac with Snow Leopard (10.6.3). I hear that the assembly language I work with has to be valid with the chipset that you use. I am completely new to this I have a basic background in C and Objective-C programming and an almost strong background in PHP. I have always wanted to see what assembly is all about.
... | 2010/04/16 | [
"https://Stackoverflow.com/questions/2656485",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/305680/"
] | A good way to pick up assembly is to get yourself an embedded device to play with.
TI has some [nice, inexpensive devkits](http://focus.ti.com/mcu/docs/mcuprodmsptoolsw.tsp?sectionId=95&tabId=1203&familyId=342&toolTypeId=1) to play with. I've poked around with the Chronos kit ($50) which has digital watch with a progr... | The linked tutorials look like they use NASM, which is included with Macs. However, system calls are usually different on different platforms (they're very different between Mac and Linux), and without seeing the tutorials, it's hard to know whether they'll target different platforms (I'd guess not, though). A better b... |
26,609,981 | I have a date picker where I can select a date range like 3months, 7 days or this year.
How can I select "This year" from a drop down menu?
Here is the code:
```
<div class="full">
<div class="range-preset">
<div class="date-range-selector">
<label>Date Range:</label>
<select class="full" style="width... | 2014/10/28 | [
"https://Stackoverflow.com/questions/26609981",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4181610/"
] | Spring does not use the Prototype Pattern, it uses reflection.
Plus, in order to use clone() it would have to subclass somehow a bean, because clone() is protected, so it does not use clone() either.
Here is a code fragment from
```
org.springframework.beans.factory.support.SimpleInstantiationStrategy
```
where ... | I have not dug into Spring source code, but I think Beans with `prototype` scope in Spring are not created using `clone()` method because it is not mandatory to implement the `Cloneable` interface for those beans.
Moreover, suppose it is creating them using `clone()`. It would then be dangerous if someone is expecting... |
26,609,981 | I have a date picker where I can select a date range like 3months, 7 days or this year.
How can I select "This year" from a drop down menu?
Here is the code:
```
<div class="full">
<div class="range-preset">
<div class="date-range-selector">
<label>Date Range:</label>
<select class="full" style="width... | 2014/10/28 | [
"https://Stackoverflow.com/questions/26609981",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4181610/"
] | Spring does not use the Prototype Pattern, it uses reflection.
Plus, in order to use clone() it would have to subclass somehow a bean, because clone() is protected, so it does not use clone() either.
Here is a code fragment from
```
org.springframework.beans.factory.support.SimpleInstantiationStrategy
```
where ... | No. Spring scopes such as **prototype** or **singletone** do not follow strictly design patterns. The naming of scopes was used to intuitively suggest behavior container provides.
This way you can have a "singleton" pattern within the container and create another object outside of the container. Similarly "prototype" ... |
26,609,981 | I have a date picker where I can select a date range like 3months, 7 days or this year.
How can I select "This year" from a drop down menu?
Here is the code:
```
<div class="full">
<div class="range-preset">
<div class="date-range-selector">
<label>Date Range:</label>
<select class="full" style="width... | 2014/10/28 | [
"https://Stackoverflow.com/questions/26609981",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4181610/"
] | No spring does not use cloning to create prototype scoped instances.
Below is the code snippet taken from AbstractBeanFactory.doGetBean() function:
```
// Create bean instance.
if (mbd.isSingleton()) {
sharedInstance = getSingleton(beanName, new ObjectFactory<Object>() {
@Override
public Object ge... | I have not dug into Spring source code, but I think Beans with `prototype` scope in Spring are not created using `clone()` method because it is not mandatory to implement the `Cloneable` interface for those beans.
Moreover, suppose it is creating them using `clone()`. It would then be dangerous if someone is expecting... |
26,609,981 | I have a date picker where I can select a date range like 3months, 7 days or this year.
How can I select "This year" from a drop down menu?
Here is the code:
```
<div class="full">
<div class="range-preset">
<div class="date-range-selector">
<label>Date Range:</label>
<select class="full" style="width... | 2014/10/28 | [
"https://Stackoverflow.com/questions/26609981",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4181610/"
] | No spring does not use cloning to create prototype scoped instances.
Below is the code snippet taken from AbstractBeanFactory.doGetBean() function:
```
// Create bean instance.
if (mbd.isSingleton()) {
sharedInstance = getSingleton(beanName, new ObjectFactory<Object>() {
@Override
public Object ge... | No. Spring scopes such as **prototype** or **singletone** do not follow strictly design patterns. The naming of scopes was used to intuitively suggest behavior container provides.
This way you can have a "singleton" pattern within the container and create another object outside of the container. Similarly "prototype" ... |
27,925,226 | I wondered how can I take an 8 bit variable,
and break it apart to 8 booleans, for a 'for' loop.
For example:
```
void byteWrite(byte byteIn)
{
for(int i=0; i<8; i++)
{
PORTA |= 128; // STHP ON
if(?)
PORTB |= 4; //STCP ON
else
PORTB &=11;// STCP OFF
_delay_ms(1);
PORTA &= 63; // STH... | 2015/01/13 | [
"https://Stackoverflow.com/questions/27925226",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2054911/"
] | Use bitwise-and, with shifts:
```
if((byteIn & (1 << i)) != 0)
```
This simply computes the bitmask `(1 << i)` for each step in the loop, and uses bitwise-and (the `&` operator) to check if the corresponding bit in `byteIn` is set.
This is a very common thing to do.
If you're worried about re-computing the mask on... | ```
for(uint8_t mask = 1<<7; mask!=0; mask>>=1)
{
if(data & mask)
{
PORT |= mask;
}
else
{
PORT &= ~mask;
}
}
``` |
35,879,363 | trying to write a python code for a tip calculator based on service and I'm running into an issue with my while loop.
```
service = ""
while service != "excellent" or service != "good" or service != "bad":
service = input("(Please choose excellent, good, or bad): ")
```
This part is causing an infinite loop, but... | 2016/03/08 | [
"https://Stackoverflow.com/questions/35879363",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You are using `or` where you want to use `and`.
The loop is going to continue if any one of the three conditions is true.
If your input is `"excellent"` then `service != "good"` and `service != "bad"` are both going to be true so the loop will continue. The same is true for the other values.
What you want is:
```
s... | In this situation you want to use "and" rather than "or". Another option, though, that is cleaner would be to do this:
```
while service not in ['excellent', 'good', 'bad]:
service = input('(Please choose excellent, good, or bad): ')
```
This will test whether the value of `service` is in the list of acceptable ... |
35,879,363 | trying to write a python code for a tip calculator based on service and I'm running into an issue with my while loop.
```
service = ""
while service != "excellent" or service != "good" or service != "bad":
service = input("(Please choose excellent, good, or bad): ")
```
This part is causing an infinite loop, but... | 2016/03/08 | [
"https://Stackoverflow.com/questions/35879363",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You are using `or` where you want to use `and`.
The loop is going to continue if any one of the three conditions is true.
If your input is `"excellent"` then `service != "good"` and `service != "bad"` are both going to be true so the loop will continue. The same is true for the other values.
What you want is:
```
s... | Right now, you're saying "if any three of these statements is true, continue the while loop".
What you want is:
```
service = ""
while service != "excellent" and service != "good" and service != "bad":
service = input("(Please choose excellent, good, or bad): ")
``` |
35,879,363 | trying to write a python code for a tip calculator based on service and I'm running into an issue with my while loop.
```
service = ""
while service != "excellent" or service != "good" or service != "bad":
service = input("(Please choose excellent, good, or bad): ")
```
This part is causing an infinite loop, but... | 2016/03/08 | [
"https://Stackoverflow.com/questions/35879363",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You are using `or` where you want to use `and`.
The loop is going to continue if any one of the three conditions is true.
If your input is `"excellent"` then `service != "good"` and `service != "bad"` are both going to be true so the loop will continue. The same is true for the other values.
What you want is:
```
s... | You just have your logic a bit mixed up - you are using `or` instead of `and`.
Whatever input you have, it will be (not excellent) or (not good) or (not bad)!
For example, even if you input "good", good is (not excellent) and thus the overall condition returns True, and you'll keep looping.
A clearer way to write th... |
35,879,363 | trying to write a python code for a tip calculator based on service and I'm running into an issue with my while loop.
```
service = ""
while service != "excellent" or service != "good" or service != "bad":
service = input("(Please choose excellent, good, or bad): ")
```
This part is causing an infinite loop, but... | 2016/03/08 | [
"https://Stackoverflow.com/questions/35879363",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You are using `or` where you want to use `and`.
The loop is going to continue if any one of the three conditions is true.
If your input is `"excellent"` then `service != "good"` and `service != "bad"` are both going to be true so the loop will continue. The same is true for the other values.
What you want is:
```
s... | To loop *until* any of a number of conditions is met (because it is neither possible nor meaningful to meet all of them at once), you need to loop *while* all of them are not met (logical negation). The most readable and pythonic way to express this that I can think of is:
```
service = ''
while service not in ('excel... |
6,687,698 | I have a form that submits data to the server that looks like the following:
```
videos[0][type]=Vimeo&
videos[0][moments][0][time]=11&
videos[0][moments][0][lng]=111&
videos[0][moments][0][lat]=111&
videos[0][moments][1][time]=222&
videos[0][moments][1][lng]=222&
videos[0][moments][1][lat]=222&
videos[1][... | 2011/07/14 | [
"https://Stackoverflow.com/questions/6687698",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/643406/"
] | You can use [urlparse.parse\_qsl](http://docs.python.org/library/urlparse.html#urlparse.parse_qsl) to get the query parameters. However you'll need manually to construct the video objects.
Example implementation can be:
```
def add(root, path, value):
for part in path[:-1]:
root = root.setdefault(part, {}... | If you use [formencode](http://formencode.org/) and can change the format of your keys to:
```
map.title=orange&
videos-0.type=Vimeo&
videos-0.moments-0.time=11&
videos-0.moments-0.lng=111&
videos-0.moments-0.lat=111&
videos-0.moments-1.time=222&
videos-0.moments-1.lng=222&
videos-0.moments-1.lat=222&
vide... |
37,267,509 | I'm creating a toggle button to which I want to bind a select event. I've created the button, but I have no clue of how to bind the values to it and make it work like a select button. Can someone give me some clue or some examples related to it, so that I can try that out and learn some thing?
My requirement is I've t... | 2016/05/17 | [
"https://Stackoverflow.com/questions/37267509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6269804/"
] | Here are few things
Incorrect html structure
```
<li><a href="#">Foods</li></a>
```
change it to
```
<li><a href="#">Foods</a></li>
```
show us the style for li, a and .divider
which one is using background: #809109;
I guess you need to remove padding of li
```
.dropdown-menu > li{
padding:0px
}
```
... | Though the problem statement is incomplete and the html syntax is faulty, still this problem can occur without those. The problem lies in inserting the divider or horizontal rule, whatever separator you are using. For these, the Unordered List tag adds additional padding which might be the case in this problem. You can... |
343 | One of the appeals of traditional games such as Chess, Go, Backgammon, or Poker is the depth that they have acquired over the years; long-standing communities and traditions, wide range of players from different backgrounds, depth of strategic analysis that has occurred over the years, and wide range of skill levels wi... | 2010/10/20 | [
"https://boardgames.stackexchange.com/questions/343",
"https://boardgames.stackexchange.com",
"https://boardgames.stackexchange.com/users/112/"
] | **[Scrabble](http://boardgamegeek.com/boardgame/320/scrabble)**
The game mechanics are very simple, but the game is far from simple. Unlike a game like Magic the Gathering, Scrabble achieves it's depth of near infinite possibilities with a simple board and a 100 wooden tiles. Each play on the board has an immediate ef... | **Hex** and other connection games like Twixt
Cameron Browne has written a book of analysis and online play is pretty active. I haven't heard of any tournaments in person, though. As much as I love Hex, my personal favourite connection game is Akron, invented by Cameron Browne. |
343 | One of the appeals of traditional games such as Chess, Go, Backgammon, or Poker is the depth that they have acquired over the years; long-standing communities and traditions, wide range of players from different backgrounds, depth of strategic analysis that has occurred over the years, and wide range of skill levels wi... | 2010/10/20 | [
"https://boardgames.stackexchange.com/questions/343",
"https://boardgames.stackexchange.com",
"https://boardgames.stackexchange.com/users/112/"
] | **[Scrabble](http://boardgamegeek.com/boardgame/320/scrabble)**
The game mechanics are very simple, but the game is far from simple. Unlike a game like Magic the Gathering, Scrabble achieves it's depth of near infinite possibilities with a simple board and a 100 wooden tiles. Each play on the board has an immediate ef... | One game that has "not yet had time to, but..." has the seeds of depth is **Settlers of Catan**.
It's too new to really have the depth of community analysis we're talking about here yet. Yet it *does* have an entrenched and widespread community, multiple (electronic and board) reimplementations, and the strategic dep... |
343 | One of the appeals of traditional games such as Chess, Go, Backgammon, or Poker is the depth that they have acquired over the years; long-standing communities and traditions, wide range of players from different backgrounds, depth of strategic analysis that has occurred over the years, and wide range of skill levels wi... | 2010/10/20 | [
"https://boardgames.stackexchange.com/questions/343",
"https://boardgames.stackexchange.com",
"https://boardgames.stackexchange.com/users/112/"
] | Magic - The Gathering
---------------------
This simple looking card game transformed the industry quickly leading to huge tournaments culminating in a World Championship. It has been going strong for over 15 years and shows no sign of stopping.
Strategies mutate and change with every release, but the good players ar... | **Hex** and other connection games like Twixt
Cameron Browne has written a book of analysis and online play is pretty active. I haven't heard of any tournaments in person, though. As much as I love Hex, my personal favourite connection game is Akron, invented by Cameron Browne. |
343 | One of the appeals of traditional games such as Chess, Go, Backgammon, or Poker is the depth that they have acquired over the years; long-standing communities and traditions, wide range of players from different backgrounds, depth of strategic analysis that has occurred over the years, and wide range of skill levels wi... | 2010/10/20 | [
"https://boardgames.stackexchange.com/questions/343",
"https://boardgames.stackexchange.com",
"https://boardgames.stackexchange.com/users/112/"
] | Magic - The Gathering
---------------------
This simple looking card game transformed the industry quickly leading to huge tournaments culminating in a World Championship. It has been going strong for over 15 years and shows no sign of stopping.
Strategies mutate and change with every release, but the good players ar... | **Contract Bridge and Duplicate Bridge**
Technically speaking the modern form of the game was devised around 1925 (by Harold S Vanderbilt). There were variants earlier like auction bridge, which don't fall into the past century category I suppose.
Every point you speak of is true for bridge (concentrating mainly on U... |
343 | One of the appeals of traditional games such as Chess, Go, Backgammon, or Poker is the depth that they have acquired over the years; long-standing communities and traditions, wide range of players from different backgrounds, depth of strategic analysis that has occurred over the years, and wide range of skill levels wi... | 2010/10/20 | [
"https://boardgames.stackexchange.com/questions/343",
"https://boardgames.stackexchange.com",
"https://boardgames.stackexchange.com/users/112/"
] | **Diplomacy**
This has all of these things - a distinctive culture, played in tournaments, ranking systems, extensive opening and endgame analysis with named opening patterns.
There is also a still-extant play-by-mail culture, PBEM through the Judges and a [string](http://www.conquestofnations.com/) [of](http://www.p... | **Hex** and other connection games like Twixt
Cameron Browne has written a book of analysis and online play is pretty active. I haven't heard of any tournaments in person, though. As much as I love Hex, my personal favourite connection game is Akron, invented by Cameron Browne. |
343 | One of the appeals of traditional games such as Chess, Go, Backgammon, or Poker is the depth that they have acquired over the years; long-standing communities and traditions, wide range of players from different backgrounds, depth of strategic analysis that has occurred over the years, and wide range of skill levels wi... | 2010/10/20 | [
"https://boardgames.stackexchange.com/questions/343",
"https://boardgames.stackexchange.com",
"https://boardgames.stackexchange.com/users/112/"
] | Dominion
========
I don't expect a lot of votes up because the game is very new, but I think Dominion has the potential to do a much better job qualifying in the long run than Magic: The Gathering. The problem with any Trading Card Game, in my opinion, is the high financial barrier to entry, as well as the potential s... | ### [Advanced Squad Leader](http://www.multimanpublishing.com) (ASL)
The ultimate game of WW2 squad level fighting, where anything that could be done in WW2 can be modeled (rockets, paratroopers, any vehicle ever used, etc.). It has a dedicated community with ongoing tournaments. There are over two thousand scenarios ... |
343 | One of the appeals of traditional games such as Chess, Go, Backgammon, or Poker is the depth that they have acquired over the years; long-standing communities and traditions, wide range of players from different backgrounds, depth of strategic analysis that has occurred over the years, and wide range of skill levels wi... | 2010/10/20 | [
"https://boardgames.stackexchange.com/questions/343",
"https://boardgames.stackexchange.com",
"https://boardgames.stackexchange.com/users/112/"
] | **[Scrabble](http://boardgamegeek.com/boardgame/320/scrabble)**
The game mechanics are very simple, but the game is far from simple. Unlike a game like Magic the Gathering, Scrabble achieves it's depth of near infinite possibilities with a simple board and a 100 wooden tiles. Each play on the board has an immediate ef... | **Contract Bridge and Duplicate Bridge**
Technically speaking the modern form of the game was devised around 1925 (by Harold S Vanderbilt). There were variants earlier like auction bridge, which don't fall into the past century category I suppose.
Every point you speak of is true for bridge (concentrating mainly on U... |
343 | One of the appeals of traditional games such as Chess, Go, Backgammon, or Poker is the depth that they have acquired over the years; long-standing communities and traditions, wide range of players from different backgrounds, depth of strategic analysis that has occurred over the years, and wide range of skill levels wi... | 2010/10/20 | [
"https://boardgames.stackexchange.com/questions/343",
"https://boardgames.stackexchange.com",
"https://boardgames.stackexchange.com/users/112/"
] | One game that has "not yet had time to, but..." has the seeds of depth is **Settlers of Catan**.
It's too new to really have the depth of community analysis we're talking about here yet. Yet it *does* have an entrenched and widespread community, multiple (electronic and board) reimplementations, and the strategic dep... | **Hex** and other connection games like Twixt
Cameron Browne has written a book of analysis and online play is pretty active. I haven't heard of any tournaments in person, though. As much as I love Hex, my personal favourite connection game is Akron, invented by Cameron Browne. |
343 | One of the appeals of traditional games such as Chess, Go, Backgammon, or Poker is the depth that they have acquired over the years; long-standing communities and traditions, wide range of players from different backgrounds, depth of strategic analysis that has occurred over the years, and wide range of skill levels wi... | 2010/10/20 | [
"https://boardgames.stackexchange.com/questions/343",
"https://boardgames.stackexchange.com",
"https://boardgames.stackexchange.com/users/112/"
] | Magic - The Gathering
---------------------
This simple looking card game transformed the industry quickly leading to huge tournaments culminating in a World Championship. It has been going strong for over 15 years and shows no sign of stopping.
Strategies mutate and change with every release, but the good players ar... | **Diplomacy**
This has all of these things - a distinctive culture, played in tournaments, ranking systems, extensive opening and endgame analysis with named opening patterns.
There is also a still-extant play-by-mail culture, PBEM through the Judges and a [string](http://www.conquestofnations.com/) [of](http://www.p... |
343 | One of the appeals of traditional games such as Chess, Go, Backgammon, or Poker is the depth that they have acquired over the years; long-standing communities and traditions, wide range of players from different backgrounds, depth of strategic analysis that has occurred over the years, and wide range of skill levels wi... | 2010/10/20 | [
"https://boardgames.stackexchange.com/questions/343",
"https://boardgames.stackexchange.com",
"https://boardgames.stackexchange.com/users/112/"
] | **Contract Bridge and Duplicate Bridge**
Technically speaking the modern form of the game was devised around 1925 (by Harold S Vanderbilt). There were variants earlier like auction bridge, which don't fall into the past century category I suppose.
Every point you speak of is true for bridge (concentrating mainly on U... | **Hex** and other connection games like Twixt
Cameron Browne has written a book of analysis and online play is pretty active. I haven't heard of any tournaments in person, though. As much as I love Hex, my personal favourite connection game is Akron, invented by Cameron Browne. |
16,684,926 | I am working on a legacy C application that is currently single user. I want to modify it so that it is multi user.
The current application makes uses user permissions to load relevant data (for the current user), into shared memory. I want to implement a dictionary like structure in shared memory so that relevant dat... | 2013/05/22 | [
"https://Stackoverflow.com/questions/16684926",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/962891/"
] | Try this
```
- (void)viewDidLoad
{
[super viewDidLoad];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(textFieldTextDidChangeOneCI:)
name:UITextFieldTextDidChangeNotification
object:textfield];
}
```
Also modify your method
```
-(void)textFieldTextDidChangeOneCI:(NSNotification *... | Try to use this one
```
-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
[self textFieldTextDidChangeOneCI:textField];
return YES;
}
``` |
16,684,926 | I am working on a legacy C application that is currently single user. I want to modify it so that it is multi user.
The current application makes uses user permissions to load relevant data (for the current user), into shared memory. I want to implement a dictionary like structure in shared memory so that relevant dat... | 2013/05/22 | [
"https://Stackoverflow.com/questions/16684926",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/962891/"
] | Try this
```
- (void)viewDidLoad
{
[super viewDidLoad];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(textFieldTextDidChangeOneCI:)
name:UITextFieldTextDidChangeNotification
object:textfield];
}
```
Also modify your method
```
-(void)textFieldTextDidChangeOneCI:(NSNotification *... | you can do like below
```
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textDidChange:) name:UITextFieldTextDidChangeNotification object:nil];
```
let me know it is working or not |
16,684,926 | I am working on a legacy C application that is currently single user. I want to modify it so that it is multi user.
The current application makes uses user permissions to load relevant data (for the current user), into shared memory. I want to implement a dictionary like structure in shared memory so that relevant dat... | 2013/05/22 | [
"https://Stackoverflow.com/questions/16684926",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/962891/"
] | Try this
```
- (void)viewDidLoad
{
[super viewDidLoad];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(textFieldTextDidChangeOneCI:)
name:UITextFieldTextDidChangeNotification
object:textfield];
}
```
Also modify your method
```
-(void)textFieldTextDidChangeOneCI:(NSNotification *... | You can add observer for the UITextFieldTextDidChangeNotification which will be posted whenever the text changes in text field.
See the below code for example :
```
// For textField1
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(anyMethod:)
name:UITextFieldTextDidChangeNotifica... |
64,855,243 | In the book Java Performance The Definitive guide There is a comparison between CPU utilization of throughput garbage Collector and CMS garbage collector as bellow:
>
> The throughput collector will (by default) consume 100% of the CPU
> available on the machine while it runs, so a more accurate
> representation of t... | 2020/11/16 | [
"https://Stackoverflow.com/questions/64855243",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12867091/"
] | Since the CMS collector performs some work concurrently, it is designed to not use all the available system resources and instead behave more like a background task. The same applies in greater degree to G1 and ZGC.
Since the parallel collector is synchronous, it is designed to use all the available system resources t... | I *love* this made-up graphs with little to no connection to reality; then `CMS` is deprecated and removed in `java-14`, just FYI. I am also by far not a GC expert, but I love to fiddle around different code implementations (*especially* in `Shenandoah` codebase), as a disclaimer.
Think about it: when you *stop* the w... |
72,418,952 | Let say we have two objects of type `NumberInt` in Mongo-Shell:
```js
x = NumberInt(100)
y = NumberInt(100)
```
when I run the following comparisons, I am wondering why the last comparison is `false`?
```js
x == 100 // True
y == 100 // True
x == y // False! Why?
```
I did however expect to get `false` by runnin... | 2022/05/28 | [
"https://Stackoverflow.com/questions/72418952",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3279603/"
] | The main reason is that equality operators work for primitive values , but not for objects and the function NumberInt() is defining object in the mongoshell:
```
mongos> x=100
100
mongos> typeof x
number
mongos> y=NumberInt(100)
NumberInt(100)
mongos> typeof y
object
```
One option to compare the values in... | I haven't found exact answer, but I guess the below mostly answers on this question. To understand we can look at `ObjectId` implementation and comparison operators you used.
```
MongoDB Enterprise replset:PRIMARY> o1 = ObjectId("507f1f77bcf86cd799439011")
ObjectId("507f1f77bcf86cd799439011")
MongoDB Enterprise replse... |
15,997,414 | ```
var contentparanum = 1;
while($(".container").height() < 200){
paranum++;
$(".content").append("<p></p>");
$(".content p:nth-child("+contentparanum+")").load("getcontent.php?paranum="+paranum);
contentparanum++;
//use load() to add content into container, when the height of c... | 2013/04/14 | [
"https://Stackoverflow.com/questions/15997414",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1908126/"
] | As .load() is asynchronous you will have to wait for the callback to make another call to load. Try this:
```
var contentparanum = 1;
var paranum = 1;
$("#load").click(function () {
// Checks if the height is below 200 before making the first call
if($(".content").height() <200)
{... | ```
function loadContent(paranum) {
$("#container").append("<p></p>")
$("#container").children().last().load("getcontent.php?paranum="+paranum, function() {
if($("#container").height() < 200) {
window.setTimeout(loadContent, 0, paranum+1);
}
});
}
$(function() {loadContent(1... |
21,609,541 | I have some JSON data inside of an HTML data element:
```
<div id="ps-data" data-ps="
{
"teacherId": 12345678
},
"></div>
```
I parse it using jQuery's [parseJSON](https://api.jquery.com/jQuery.parseJSON/) function, but if I pass it invalid JSON, I get a SyntaxError exception. In QUnit, t... | 2014/02/06 | [
"https://Stackoverflow.com/questions/21609541",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/690573/"
] | You could do something like this:
```
var exeptionReached = false;
try {
$.parseJSON($('#ps-data').data().ps);
} catch(e) {
exceptionReached = true;
}
console.log(exceptionReached); //will be true if `parseJSON()` threw an exception
```
Use qunit to assert exception was reached... or you can save something f... | Here's the full example of what I'm doing based on smerny's answer.
```
function testParse() {
var exceptionMsg;
try {
var data = $j.parseJSON($j('#ps-data').data().ps);
} catch (e) {
exceptionMsg = e.message;
}
return exceptionMsg;
}
strictEqual(testParse(), undefined, 'ps data pa... |
3,938,559 | For any real $t$ and $n \in\mathbb{N}$, I want to show that $p\_n(x)=x^{n+1}\cos [(n-1)t] - x^n\cos (nt) - x\cos (t) +1$ is divisible by $q(x) = x^2 - 2x\cos (t) +1$. As a hint I have: *complex numbers*.
I don't know how to attack the problem using complex numbers. In the case $n=1$, $p\_1(x)=q(x)$. Also I compute and... | 2020/12/07 | [
"https://math.stackexchange.com/questions/3938559",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/603725/"
] | Here is a rolling start. Use the quadratic formula on the quadratic to get the roots
$$x = {\cos(t)\pm\sqrt{4\cos^2(t) - 4}\over 2}
=\cos(t)\pm i\sin(t) = e^{\pm it}. $$
Are these roots of the $n$th degree polynomial? | This is equivalent to $z^{\pm1}$ being roots, with $z:=e^{it}$. We only need check $\pm=+$, since $p\_n$ has real coefficients, so its nonreal roots are in conjugate pairs. So just simplify$$p\_n(z)=z^{n+1}(z^{n-1}+z^{1-n})/2-z^n(z^n+z^{-n})/2-z(z+z^{-1})/2+1.$$ |
8,737,025 | How do I retain whatever was selected from the dropdown even after page refresh so user knows what he/she selected using jquery? or javascript?
```
<select id="hospitalDropDown" onchange="window.open(this.options[this.selectedIndex].value,'_top')">
<option disabled="disabled">Select Hospital</option>
<op... | 2012/01/05 | [
"https://Stackoverflow.com/questions/8737025",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1108472/"
] | Try this:
```
<select id="hospitalDropDown" onchange="window.open('http://mysite.com/events/Pages/default1.aspx?hos='+this.value,'_top')">
<option disabled="disabled">Select Hospital</option>
<option value="All">All Hospitals</option>
<option value="Dyer">Dyer</option>
<option value="Carmel">Carmel</option>
... | ```
<select id="hospitalDropDown">
<option value="">All Hospitals</option>
<option value="Dyer">Dyer</option>
<option value="Carmel">Carmel</option>
</select>
<script type="text/javascript">
$(document).ready(function() {
$('#hospitalDropDown').val('<?php echo $_GET['hos']; ?>');
$('#hospitalDropD... |
456,018 | I am looking over something before posting it online and I have a sentence that simply doesn't seem to 'sound' right either way I write it. Specifically, I am trying to decide whether it is more correct to use 'oasis' or 'oases' in the sentence below.
There are two types of [oasis/oases] in the world.
If it makes a d... | 2018/07/17 | [
"https://english.stackexchange.com/questions/456018",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/162157/"
] | The plural of **oasis** is **oases**, which you should use if you have more than one:
>
> There are two types of oases in the world.
>
>
>
But if that doesn't sound right to you, make it singular:
>
> There is more than one type of oasis in the world.
>
>
> | In a comment, John Lawler wrote:
>
> This arises with any word; *There are two types of mountain/banana/book in the world* versus *There are two types of mountains/bananas/books in the world*. Both are correct, singular or plural; there is no difference in meaning. Just speaker's choice, like most such choices.
>
> ... |
71,941,556 | I have a type defined that looks like this:
```
export type MediaProps = ImageMediaProps | OembedProps;
```
Then have the types it's referencing defined as the following above that code:
```
type SharedMediaProps = {
/** Media type */
type: "image" | "oembed";
/** Media source URL */
src: string;
};
type I... | 2022/04/20 | [
"https://Stackoverflow.com/questions/71941556",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1501927/"
] | First, move the `type` property into the not shared props, so it can be used to discrimitate the type:
```
type SharedMediaProps = {
/** Media source URL */
src: string;
};
type ImageMediaProps = SharedMediaProps & {
/** Media type */
type: "image";
/** Image alternate text */
alt: string;
/** Im... | I believe you'll need to use an [intersection type](https://www.typescriptlang.org/docs/handbook/2/objects.html#intersection-types) on your MediaProps assignment.
`export type MediaProps = ImageMediaProps & OembedProps;` |
61,126,068 | Im trying to code a basic arp spoofer following a tutorial i found online.
So I coded the basic beginnig of the arpSpoofer but when i execute it throws an IndexError: list index out of range...Im sure i have made a silly mistake on the code but i cant really find it and I've been trying for hours.
The code is this:
`... | 2020/04/09 | [
"https://Stackoverflow.com/questions/61126068",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12344419/"
] | Please follow the below code:
```
import React, {useState} from "react";
export default function ShowButtonHover() {
const [style, setStyle] = useState({display: 'none'});
return (
<div className="App">
<h2>Hidden Button in the box. Move mouse in the box</h2>
<div style={{bord... | EDIT: made a codesandbox to make it easier <https://codesandbox.io/s/stckovw-hideshow-hs3mh>
A way to achieve this can be through these steps:
* Add `onMouseEnter` and `onMouseLeave` handlers to the component you want to trigger the rendering of the buttons, so ProductBox in your case
* Give the default class of you... |
35,913,201 | still pretty new to C++.
Had to write a function in class to count the number of each digit in a multi-dimensional array.
Now I didn't think you could return multiple `int` values from a single called function and then use all of these returns in a text based answer, so I attempted to `return` a different value depen... | 2016/03/10 | [
"https://Stackoverflow.com/questions/35913201",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5262627/"
] | This call
```
count_numbers(array);
```
does not make sense and moreover is invalid because the function requires two arguments instead of one.
The function itself can be written the following way
```
const size_t N = 4;
size_t count_number( const int ( &a )[N][N], int value )
{
size_t n = 0;
for ( size_... | you can return `int[]` or event better since you are using c++ return `vector<int>`.
In your function you can replace one, two, .. with something like
```
vector<int> result(10);
```
This will create a vector with 10 entries, all of them 0.
Then replace thing like `three = three + 1` with `result[3] = result[3] + ... |
3,951,495 | Given $S$ as the solid that is outside the cylinder $x^{2}+y^{2}=1,$ inside the sphere $x^{2}+y^{2}+z^{2}=4,$ and above the $x y$ -plane. Set-up an iterated triple integral in spherical coordinates that is equal to $\iiint\_{G} f(x, y, z) d V$ where $f(x, y, z)=x \sqrt{x^{2}+y^{2}+z^{2}}$.
How I approached this proble... | 2020/12/16 | [
"https://math.stackexchange.com/questions/3951495",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/832773/"
] | Hint: For each $n$ find the unique $x\_n>0$ such that
$$\tag 1 ae^{-anx\_n} = be^{-bnx\_n}.$$
On $(x\_n,\infty)$ the left side of $(1)$ is greater than the right side. Thus
$$\int\_0^\infty|f\_n| > \int\_{x\_n}^\infty|f\_n| =\int\_{x\_n}^\infty f\_n.$$ | Let $n\in \mathbb{N}$ fixed, now note that $$a\exp(-ax)=b\exp(-bx) \iff x={{\ln\left(\frac{b}{a}\right)}\over {b-a}}$$Call this positive number $t$, then for $x\in [0,t/n]$ we have that $$b\exp(-bnx)\ge a\exp(-anx)$$
Therefore, e have \begin{eqnarray\*}
\int\_0^\infty |a\exp(-anx)-b\exp(-bnx)|dx &\ge& \int\_0^{t/n} (b\... |
3,951,495 | Given $S$ as the solid that is outside the cylinder $x^{2}+y^{2}=1,$ inside the sphere $x^{2}+y^{2}+z^{2}=4,$ and above the $x y$ -plane. Set-up an iterated triple integral in spherical coordinates that is equal to $\iiint\_{G} f(x, y, z) d V$ where $f(x, y, z)=x \sqrt{x^{2}+y^{2}+z^{2}}$.
How I approached this proble... | 2020/12/16 | [
"https://math.stackexchange.com/questions/3951495",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/832773/"
] | find out when $f\_n>0$ or $<0$ so:
$$0=f\_n=ae^{-anx}-be^{-bnx}$$
$$a(e^{-nx})^a=b(e^{-nx})^b$$
$$\frac ab=(e^{-nx})^{b-a}$$
$$\ln a-\ln b=(b-a)(-nx)$$
so:
$$x=\frac{\ln a-\ln b}{n(a-b)}$$
is when $f\_n=0$
---
$$\int\_0^\infty f\_ndx=\int\_0^\infty\left(ae^{-anx}-be^{-bnx}\right)dx=\left[\frac{e^{-anx}-e^{-bnx}}{-n}\... | Let $n\in \mathbb{N}$ fixed, now note that $$a\exp(-ax)=b\exp(-bx) \iff x={{\ln\left(\frac{b}{a}\right)}\over {b-a}}$$Call this positive number $t$, then for $x\in [0,t/n]$ we have that $$b\exp(-bnx)\ge a\exp(-anx)$$
Therefore, e have \begin{eqnarray\*}
\int\_0^\infty |a\exp(-anx)-b\exp(-bnx)|dx &\ge& \int\_0^{t/n} (b\... |
3,951,495 | Given $S$ as the solid that is outside the cylinder $x^{2}+y^{2}=1,$ inside the sphere $x^{2}+y^{2}+z^{2}=4,$ and above the $x y$ -plane. Set-up an iterated triple integral in spherical coordinates that is equal to $\iiint\_{G} f(x, y, z) d V$ where $f(x, y, z)=x \sqrt{x^{2}+y^{2}+z^{2}}$.
How I approached this proble... | 2020/12/16 | [
"https://math.stackexchange.com/questions/3951495",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/832773/"
] | Hint: For each $n$ find the unique $x\_n>0$ such that
$$\tag 1 ae^{-anx\_n} = be^{-bnx\_n}.$$
On $(x\_n,\infty)$ the left side of $(1)$ is greater than the right side. Thus
$$\int\_0^\infty|f\_n| > \int\_{x\_n}^\infty|f\_n| =\int\_{x\_n}^\infty f\_n.$$ | find out when $f\_n>0$ or $<0$ so:
$$0=f\_n=ae^{-anx}-be^{-bnx}$$
$$a(e^{-nx})^a=b(e^{-nx})^b$$
$$\frac ab=(e^{-nx})^{b-a}$$
$$\ln a-\ln b=(b-a)(-nx)$$
so:
$$x=\frac{\ln a-\ln b}{n(a-b)}$$
is when $f\_n=0$
---
$$\int\_0^\infty f\_ndx=\int\_0^\infty\left(ae^{-anx}-be^{-bnx}\right)dx=\left[\frac{e^{-anx}-e^{-bnx}}{-n}\... |
42,319,990 | The problem is pretty simple. I have a `QLabel` object which gets a picture via setting a resource to the `pixmap` attribute. Because the Qt Designer is the best GUI Designer of the world (ever) it shows the picture rotated 90° left:
[](https://i.sta... | 2017/02/18 | [
"https://Stackoverflow.com/questions/42319990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5233188/"
] | If I were you I would rotate the image and then set the label pixmap. Possibly not the best solution, but it works.
To rotate the image you could do something like this:
```
QPixmap original;
// load original from your source or take it from somewhere
QImage srcImg = original.toImage();
QPoint center = srcImg.rect().... | It is necessary to copy the picture after rotating it because the Qt Creator will (why ever) not adopt the rotation... |
36,928 | Recent exchange here got me thinking. Nagarjuna's karika, 1.[3](https://pdfs.semanticscholar.org/6fdf/0f7fba9abd29f4151ea20673e21e072463d2.pdf) ([Batchelor](https://www.stephenbatchelor.org/index.php/en/verses-from-the-center))
>
> [Na hi svabhāvo bhāvānāṃ pratyayādiṣu vidyate](https://wikisource.org/wiki/M%C5%ABlam... | 2020/02/05 | [
"https://buddhism.stackexchange.com/questions/36928",
"https://buddhism.stackexchange.com",
"https://buddhism.stackexchange.com/users/-1/"
] | don't think too much :).
`The essence of things does not exist in conditions and so on.`
It simply means "there is no `self` or `eternal-self` **within** and **behind** causes & conditions".
For eg. sometimes when a meditator `sees` everything with non-existence(wave nature) eye, perception of `there is nothing` ... | >
> I've asked a question about philosophical reasoning from this phrase.
> Suffice to say I was wondering if it can be read as an argument for a
> karmically conditioned rebirth
>
>
>
Its the opposite. When there is no essence of things nor in conditions, there can be no "rebirth". |
36,928 | Recent exchange here got me thinking. Nagarjuna's karika, 1.[3](https://pdfs.semanticscholar.org/6fdf/0f7fba9abd29f4151ea20673e21e072463d2.pdf) ([Batchelor](https://www.stephenbatchelor.org/index.php/en/verses-from-the-center))
>
> [Na hi svabhāvo bhāvānāṃ pratyayādiṣu vidyate](https://wikisource.org/wiki/M%C5%ABlam... | 2020/02/05 | [
"https://buddhism.stackexchange.com/questions/36928",
"https://buddhism.stackexchange.com",
"https://buddhism.stackexchange.com/users/-1/"
] | I presume you equate emptiness with analysis because on analysis things are empty, and non-emptiness with 'empirical' because to our senses things are non-empty. Is that it?
Thus our senses lead us into naive realism, while analysis leads us out again.
The complication would be experience, which some folk classify a... | >
> I've asked a question about philosophical reasoning from this phrase.
> Suffice to say I was wondering if it can be read as an argument for a
> karmically conditioned rebirth
>
>
>
Its the opposite. When there is no essence of things nor in conditions, there can be no "rebirth". |
36,928 | Recent exchange here got me thinking. Nagarjuna's karika, 1.[3](https://pdfs.semanticscholar.org/6fdf/0f7fba9abd29f4151ea20673e21e072463d2.pdf) ([Batchelor](https://www.stephenbatchelor.org/index.php/en/verses-from-the-center))
>
> [Na hi svabhāvo bhāvānāṃ pratyayādiṣu vidyate](https://wikisource.org/wiki/M%C5%ABlam... | 2020/02/05 | [
"https://buddhism.stackexchange.com/questions/36928",
"https://buddhism.stackexchange.com",
"https://buddhism.stackexchange.com/users/-1/"
] | The argument -- for karma -- is that causes have essences in the exact same way as they bring about their effects
>
> The essence of things does not exist in conditions and so on... Since there is no effect, what could [be its] non-conditions or conditions?
>
>
>
One answer -- to the rhetorical question -- is tha... | >
> I've asked a question about philosophical reasoning from this phrase.
> Suffice to say I was wondering if it can be read as an argument for a
> karmically conditioned rebirth
>
>
>
Its the opposite. When there is no essence of things nor in conditions, there can be no "rebirth". |
36,928 | Recent exchange here got me thinking. Nagarjuna's karika, 1.[3](https://pdfs.semanticscholar.org/6fdf/0f7fba9abd29f4151ea20673e21e072463d2.pdf) ([Batchelor](https://www.stephenbatchelor.org/index.php/en/verses-from-the-center))
>
> [Na hi svabhāvo bhāvānāṃ pratyayādiṣu vidyate](https://wikisource.org/wiki/M%C5%ABlam... | 2020/02/05 | [
"https://buddhism.stackexchange.com/questions/36928",
"https://buddhism.stackexchange.com",
"https://buddhism.stackexchange.com/users/-1/"
] | Subtleties... The *concept* of emptiness is a mental object that is predicated on other things. We only get to the *concept* of emptiness by seeing through and negating the *fullness* (meaningfulness) of other concepts.
The experience of emptiness in not predicated on the concept of it. To experience emptiness is to s... | >
> I've asked a question about philosophical reasoning from this phrase.
> Suffice to say I was wondering if it can be read as an argument for a
> karmically conditioned rebirth
>
>
>
Its the opposite. When there is no essence of things nor in conditions, there can be no "rebirth". |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.