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 |
|---|---|---|---|---|---|
170,977 | A friend of mine (for real, not me) received an offer letter from two tech firms in Silicon Valley. Let's called one X and the other Y.
X's offer letter has a better salary and sign-on bonus. However, my friend prefers to go to Y. Y is willing to match X's salary and sign-on bonus, but wants proof in the form of the o... | 2021/03/31 | [
"https://workplace.stackexchange.com/questions/170977",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/14182/"
] | As [Kilisi said](https://workplace.stackexchange.com/a/170979/59502), there is no legal problem in the absence of an agreement, but a minor chance of some blowback.
However, I don't view it as weak if your friend complies with the request. I think it's completely reasonable for a hiring company to not be able to take ... | >
> "Y wants proof in the form of (seeing) the offer letter"
>
>
>
Run away from Y. Do not even respond to them in any way. Ghost them.
--------------------------------------------------------------------
* This behavior from Y is so unprofessional, **so far outside the industry norms**, that I would suggest it i... |
170,977 | A friend of mine (for real, not me) received an offer letter from two tech firms in Silicon Valley. Let's called one X and the other Y.
X's offer letter has a better salary and sign-on bonus. However, my friend prefers to go to Y. Y is willing to match X's salary and sign-on bonus, but wants proof in the form of the o... | 2021/03/31 | [
"https://workplace.stackexchange.com/questions/170977",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/14182/"
] | Salary negotiation can be summarized as follows:
“We’re willing to pay you x.”
“I’d be willing to accept x+2.”
“We’ll only go as high as x+1”
All the reasoning and justifications that go in between only serve to fill gaps in an otherwise very uncomfortable exchange. The idea of needing proof of some extraneous deta... | >
> "Y wants proof in the form of (seeing) the offer letter"
>
>
>
Run away from Y. Do not even respond to them in any way. Ghost them.
--------------------------------------------------------------------
* This behavior from Y is so unprofessional, **so far outside the industry norms**, that I would suggest it i... |
170,977 | A friend of mine (for real, not me) received an offer letter from two tech firms in Silicon Valley. Let's called one X and the other Y.
X's offer letter has a better salary and sign-on bonus. However, my friend prefers to go to Y. Y is willing to match X's salary and sign-on bonus, but wants proof in the form of the o... | 2021/03/31 | [
"https://workplace.stackexchange.com/questions/170977",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/14182/"
] | Confidential does not have any legal weight in most places without a formal agreement. You can't just send someone something and mark it confidential.
But handing it over would be a breach of the company (that actually has given an offer) expectations. And there is no guarantee that the other company will better the o... | You didn't give any info as to where this (may have) occurred, but as a general principle I think an NDA on a job offer would be difficult to enforce, because the offer doesn't contain anything proprietary or that would be viewed as a corporate secret.
To me, the larger issue is moral or ethical if the interview was in... |
170,977 | A friend of mine (for real, not me) received an offer letter from two tech firms in Silicon Valley. Let's called one X and the other Y.
X's offer letter has a better salary and sign-on bonus. However, my friend prefers to go to Y. Y is willing to match X's salary and sign-on bonus, but wants proof in the form of the o... | 2021/03/31 | [
"https://workplace.stackexchange.com/questions/170977",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/14182/"
] | Your friend didn't sign an NDA with company X, so if they show company X's document marked "confidential" to company Y, and company X finds out, can company X *sue* them? Probably not.
Could company X *blacklist* your friend, though? Entirely possible, and justifiable.
And even if company X never finds out, company Y... | >
> "Y wants proof in the form of (seeing) the offer letter"
>
>
>
Run away from Y. Do not even respond to them in any way. Ghost them.
--------------------------------------------------------------------
* This behavior from Y is so unprofessional, **so far outside the industry norms**, that I would suggest it i... |
170,977 | A friend of mine (for real, not me) received an offer letter from two tech firms in Silicon Valley. Let's called one X and the other Y.
X's offer letter has a better salary and sign-on bonus. However, my friend prefers to go to Y. Y is willing to match X's salary and sign-on bonus, but wants proof in the form of the o... | 2021/03/31 | [
"https://workplace.stackexchange.com/questions/170977",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/14182/"
] | As [Kilisi said](https://workplace.stackexchange.com/a/170979/59502), there is no legal problem in the absence of an agreement, but a minor chance of some blowback.
However, I don't view it as weak if your friend complies with the request. I think it's completely reasonable for a hiring company to not be able to take ... | You didn't give any info as to where this (may have) occurred, but as a general principle I think an NDA on a job offer would be difficult to enforce, because the offer doesn't contain anything proprietary or that would be viewed as a corporate secret.
To me, the larger issue is moral or ethical if the interview was in... |
170,977 | A friend of mine (for real, not me) received an offer letter from two tech firms in Silicon Valley. Let's called one X and the other Y.
X's offer letter has a better salary and sign-on bonus. However, my friend prefers to go to Y. Y is willing to match X's salary and sign-on bonus, but wants proof in the form of the o... | 2021/03/31 | [
"https://workplace.stackexchange.com/questions/170977",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/14182/"
] | Confidential does not have any legal weight in most places without a formal agreement. You can't just send someone something and mark it confidential.
But handing it over would be a breach of the company (that actually has given an offer) expectations. And there is no guarantee that the other company will better the o... | >
> "Y wants proof in the form of (seeing) the offer letter"
>
>
>
Run away from Y. Do not even respond to them in any way. Ghost them.
--------------------------------------------------------------------
* This behavior from Y is so unprofessional, **so far outside the industry norms**, that I would suggest it i... |
170,977 | A friend of mine (for real, not me) received an offer letter from two tech firms in Silicon Valley. Let's called one X and the other Y.
X's offer letter has a better salary and sign-on bonus. However, my friend prefers to go to Y. Y is willing to match X's salary and sign-on bonus, but wants proof in the form of the o... | 2021/03/31 | [
"https://workplace.stackexchange.com/questions/170977",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/14182/"
] | Confidential does not have any legal weight in most places without a formal agreement. You can't just send someone something and mark it confidential.
But handing it over would be a breach of the company (that actually has given an offer) expectations. And there is no guarantee that the other company will better the o... | As [Kilisi said](https://workplace.stackexchange.com/a/170979/59502), there is no legal problem in the absence of an agreement, but a minor chance of some blowback.
However, I don't view it as weak if your friend complies with the request. I think it's completely reasonable for a hiring company to not be able to take ... |
63,577,948 | I have an N: N relationship that is giving me a problem with the return using `with()` follows the example of my two models with a problem and the way I make the query call.
Model product\_type
```
public function makes()
{
return $this->belongsToMany(\App\Models\Make::class);
}
```
Model make
```
public funct... | 2020/08/25 | [
"https://Stackoverflow.com/questions/63577948",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13039636/"
] | Modify this in css:
```
body.dark {
background-color: black;
}
body.light {
background-color: whitesmoke;
}
```
Modify this in javascript:
```
window.onload=function() {
if(localStorage.darkMode=="true") {
document.body.classList.toggle('dark');
document.getElementById("chk").checked=true;
}
else ... | You can store data with this line `localStorage.setItem('darkMode', 'true');`
and you can retrieve with this one `var darkMode = localStorage.getItem('darkMode');`
then just apply your style with your own logic |
37,711,297 | Creating a bot with a command grouping function for organization and formatting.
I was thinking of creating a public enum with each group option like
```
public enum CommandGroups
{
Information,
Admin,
Owner,
etc
}
```
Then defining it with a public object within the command creation
```
public Com... | 2016/06/08 | [
"https://Stackoverflow.com/questions/37711297",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3386243/"
] | Enums has a toString method, you should be fine using it
<https://msdn.microsoft.com/en-us/library/16c1xs4z(v=vs.110).aspx> | Looks like you need something like this to generate the list of enums
```
foreach (string cmdGroup in Enum.GetNames(typeof(CommandGroups)))
{
// ... print(cmdGroup);
}
```
That would get you
Information
Admin
Owner |
37,711,297 | Creating a bot with a command grouping function for organization and formatting.
I was thinking of creating a public enum with each group option like
```
public enum CommandGroups
{
Information,
Admin,
Owner,
etc
}
```
Then defining it with a public object within the command creation
```
public Com... | 2016/06/08 | [
"https://Stackoverflow.com/questions/37711297",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3386243/"
] | Enums has a toString method, you should be fine using it
<https://msdn.microsoft.com/en-us/library/16c1xs4z(v=vs.110).aspx> | Any reason to not just define objects and specify the group you are using through a class with a name?
You have the benefit of having a much simpler and easier to follow design, and you can store the commands without any additional magic
```
public class Command
{
public int Id {get;set;}
public string Name {... |
37,711,297 | Creating a bot with a command grouping function for organization and formatting.
I was thinking of creating a public enum with each group option like
```
public enum CommandGroups
{
Information,
Admin,
Owner,
etc
}
```
Then defining it with a public object within the command creation
```
public Com... | 2016/06/08 | [
"https://Stackoverflow.com/questions/37711297",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3386243/"
] | Enums has a toString method, you should be fine using it
<https://msdn.microsoft.com/en-us/library/16c1xs4z(v=vs.110).aspx> | Consider storing all your Command objects in something like a `Dictionary<CommandGroups, List<Command>>`. Then, assuming your Command class has a `Name` property on it that exposes the verbs such as "about", "kick", "ban", etc., you could do:
```
// assuming "groups" is the dictionary:
foreach (var kvp in groups)
{
... |
37,711,297 | Creating a bot with a command grouping function for organization and formatting.
I was thinking of creating a public enum with each group option like
```
public enum CommandGroups
{
Information,
Admin,
Owner,
etc
}
```
Then defining it with a public object within the command creation
```
public Com... | 2016/06/08 | [
"https://Stackoverflow.com/questions/37711297",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3386243/"
] | Consider storing all your Command objects in something like a `Dictionary<CommandGroups, List<Command>>`. Then, assuming your Command class has a `Name` property on it that exposes the verbs such as "about", "kick", "ban", etc., you could do:
```
// assuming "groups" is the dictionary:
foreach (var kvp in groups)
{
... | Looks like you need something like this to generate the list of enums
```
foreach (string cmdGroup in Enum.GetNames(typeof(CommandGroups)))
{
// ... print(cmdGroup);
}
```
That would get you
Information
Admin
Owner |
37,711,297 | Creating a bot with a command grouping function for organization and formatting.
I was thinking of creating a public enum with each group option like
```
public enum CommandGroups
{
Information,
Admin,
Owner,
etc
}
```
Then defining it with a public object within the command creation
```
public Com... | 2016/06/08 | [
"https://Stackoverflow.com/questions/37711297",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3386243/"
] | Consider storing all your Command objects in something like a `Dictionary<CommandGroups, List<Command>>`. Then, assuming your Command class has a `Name` property on it that exposes the verbs such as "about", "kick", "ban", etc., you could do:
```
// assuming "groups" is the dictionary:
foreach (var kvp in groups)
{
... | Any reason to not just define objects and specify the group you are using through a class with a name?
You have the benefit of having a much simpler and easier to follow design, and you can store the commands without any additional magic
```
public class Command
{
public int Id {get;set;}
public string Name {... |
21,114,870 | I need to select the children nodes of elements where at least one child element does not have a specific property.
e.g. given this html
```
<div class="x" id="p1">
<div class="a" id="c1"></div>
<div class="a" id="c2"></div>
<div class="b" id="c3"></div>
</div>
<div class="x" id="p2">
<div class="a" id="c4"><... | 2014/01/14 | [
"https://Stackoverflow.com/questions/21114870",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1273906/"
] | After using Process Monitor to profile the differences between accessing the external code in MSTest vs ASP.NET MVC, I found that ASP.NET MVC was unable to find many of the files that the external code relied on. When looking for the files, all folders included in my `PATH` were checked, but not the one I provided in t... | On **windows** the **default** calling convention is **StdCall**.
Try to use: CallingConvention = `CallingConvention.StdCall` |
50,997,478 | I am new learner of Javascript and I got stuck in "**functions returned from other functions**".
The code is as below.
```
var createScream = function(logger) { return function(message) {
logger(message.toUpperCase() + "!!!")
}
}
const scream = createScream(message => console.log(message))
screa... | 2018/06/23 | [
"https://Stackoverflow.com/questions/50997478",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9980804/"
] | I would just make them background images. That way you don't have to worry about overflow. Here I'm setting the anchor to 100% width and height (of its container, so 50% of the page each), which appears to be what you wanted. The `background-position` keeps the left and right images anchored at the top right and top le... | Try adding
```
.page { overflow: hidden; }
```
to your code. This should hopefully ensure that any overflowing content is hidden. |
50,997,478 | I am new learner of Javascript and I got stuck in "**functions returned from other functions**".
The code is as below.
```
var createScream = function(logger) { return function(message) {
logger(message.toUpperCase() + "!!!")
}
}
const scream = createScream(message => console.log(message))
screa... | 2018/06/23 | [
"https://Stackoverflow.com/questions/50997478",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9980804/"
] | Here is the solution that I reached. The main issue that I was having was that I had assigned
```
width:50%
```
to img instead of the container.
Here are the final(ish) code blocks that are working as intended. Thanks for the suggestions!
```
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="S... | Try adding
```
.page { overflow: hidden; }
```
to your code. This should hopefully ensure that any overflowing content is hidden. |
50,997,478 | I am new learner of Javascript and I got stuck in "**functions returned from other functions**".
The code is as below.
```
var createScream = function(logger) { return function(message) {
logger(message.toUpperCase() + "!!!")
}
}
const scream = createScream(message => console.log(message))
screa... | 2018/06/23 | [
"https://Stackoverflow.com/questions/50997478",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9980804/"
] | I would just make them background images. That way you don't have to worry about overflow. Here I'm setting the anchor to 100% width and height (of its container, so 50% of the page each), which appears to be what you wanted. The `background-position` keeps the left and right images anchored at the top right and top le... | You have given `width:50%` to the image instead of its parent element.
```html
<head>
<link rel="stylesheet" href="Stylesheets/default.css">
<style>
.page {
width: 100%;
height: 100vh;
white-space: nowrap;
}
.img-wrapper {
posit... |
50,997,478 | I am new learner of Javascript and I got stuck in "**functions returned from other functions**".
The code is as below.
```
var createScream = function(logger) { return function(message) {
logger(message.toUpperCase() + "!!!")
}
}
const scream = createScream(message => console.log(message))
screa... | 2018/06/23 | [
"https://Stackoverflow.com/questions/50997478",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9980804/"
] | Here is the solution that I reached. The main issue that I was having was that I had assigned
```
width:50%
```
to img instead of the container.
Here are the final(ish) code blocks that are working as intended. Thanks for the suggestions!
```
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="S... | You have given `width:50%` to the image instead of its parent element.
```html
<head>
<link rel="stylesheet" href="Stylesheets/default.css">
<style>
.page {
width: 100%;
height: 100vh;
white-space: nowrap;
}
.img-wrapper {
posit... |
50,997,478 | I am new learner of Javascript and I got stuck in "**functions returned from other functions**".
The code is as below.
```
var createScream = function(logger) { return function(message) {
logger(message.toUpperCase() + "!!!")
}
}
const scream = createScream(message => console.log(message))
screa... | 2018/06/23 | [
"https://Stackoverflow.com/questions/50997478",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9980804/"
] | I would just make them background images. That way you don't have to worry about overflow. Here I'm setting the anchor to 100% width and height (of its container, so 50% of the page each), which appears to be what you wanted. The `background-position` keeps the left and right images anchored at the top right and top le... | Use `flex` and give its child elements 50% width. Remove the default margin on body. And to remove white space due to images add `font-size:0` on the `.page` div. You can obviously ovverride this font-size later when you have text on this page for that section.
```css
body {
margin: 0;
}
.page {
width: 100%;
... |
50,997,478 | I am new learner of Javascript and I got stuck in "**functions returned from other functions**".
The code is as below.
```
var createScream = function(logger) { return function(message) {
logger(message.toUpperCase() + "!!!")
}
}
const scream = createScream(message => console.log(message))
screa... | 2018/06/23 | [
"https://Stackoverflow.com/questions/50997478",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9980804/"
] | Here is the solution that I reached. The main issue that I was having was that I had assigned
```
width:50%
```
to img instead of the container.
Here are the final(ish) code blocks that are working as intended. Thanks for the suggestions!
```
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="S... | Use `flex` and give its child elements 50% width. Remove the default margin on body. And to remove white space due to images add `font-size:0` on the `.page` div. You can obviously ovverride this font-size later when you have text on this page for that section.
```css
body {
margin: 0;
}
.page {
width: 100%;
... |
66,253,155 | I'm trying to retrieve values from multiple csv files that are located in a directory. When performing `if row['opponent-points-per-game-rank'] == 6:` I am getting a Key Error. When I do something like:
```
if 'opponent-points-per-game-rank' in myfilereader.fieldnames:
testrank = [row.get('opponent-points-per-game... | 2021/02/18 | [
"https://Stackoverflow.com/questions/66253155",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15224404/"
] | to save the object:
>
> 1. convert your object to map with `toMap()` method
> 2. serialize your map to string with `serialize(...)` method
> 3. save the string into secure storage
>
>
>
for restoring your object:
>
> 1. deserialize secure storage string to a map with `deserialize(...)` method
> 2. use `fromJson... | You can do this by encoding your Model into json saving it in `Secure Storage` and then decode the json and get the model back.
```
// Saving model into Storage
static Future<void> setMyUserModel(MyUserModel user) async {
await const FlutterSecureStorage().write(
key: 'user', value: user.toRawJson());
}
// Gett... |
52,009,343 | Let's say there exists an array of keys:
```
[ "link1", "link2", "link3" ]
```
and there is a JSON object called links that is in the following format:
```
{
"link1": "https://google.com/",
"link2": "https://facebook.com/",
"link3": "https://stackoverflow.com/"
}
```
I'm currently working on a React project... | 2018/08/24 | [
"https://Stackoverflow.com/questions/52009343",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10111409/"
] | When mapping an array in JS, it is possible to simultaneously access the index. You simply need to pass a function `(key, index) => ...` instead of only asking for the key. If the current index is equal to the length of the array minus 1 (because indices start from 0), you are on the last element of the array.
Here's ... | Use the index parameter of [map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) method:
```
return links.map((key, index, arr) => {
console.log(arr.length - 1 === index) // true if last index
})
``` |
52,009,343 | Let's say there exists an array of keys:
```
[ "link1", "link2", "link3" ]
```
and there is a JSON object called links that is in the following format:
```
{
"link1": "https://google.com/",
"link2": "https://facebook.com/",
"link3": "https://stackoverflow.com/"
}
```
I'm currently working on a React project... | 2018/08/24 | [
"https://Stackoverflow.com/questions/52009343",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10111409/"
] | Use the index parameter of [map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) method:
```
return links.map((key, index, arr) => {
console.log(arr.length - 1 === index) // true if last index
})
``` | You can use css:
(I used scss, but can be with css too)
```
span {
&::after {
content: ', ';
display: inline-block;
}
&:nth-last-child(2)::after {
content: ' and ';
}
&:nth-last-child(1)::after {
content: '';
}
}
```
See example: <https://jsfiddle.net/maniator/oqr... |
52,009,343 | Let's say there exists an array of keys:
```
[ "link1", "link2", "link3" ]
```
and there is a JSON object called links that is in the following format:
```
{
"link1": "https://google.com/",
"link2": "https://facebook.com/",
"link3": "https://stackoverflow.com/"
}
```
I'm currently working on a React project... | 2018/08/24 | [
"https://Stackoverflow.com/questions/52009343",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10111409/"
] | Use the index parameter of [map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) method:
```
return links.map((key, index, arr) => {
console.log(arr.length - 1 === index) // true if last index
})
``` | JS has the built in function, `array.join()`. It loops through the array, creating a single string of all items, separated by the character used as an argument.
If the arguments are left blank ( `.join()` ), it defaults to a single comma; any string put in the argument will be used (e.g. `.join('-')` or `.join('apple'... |
52,009,343 | Let's say there exists an array of keys:
```
[ "link1", "link2", "link3" ]
```
and there is a JSON object called links that is in the following format:
```
{
"link1": "https://google.com/",
"link2": "https://facebook.com/",
"link3": "https://stackoverflow.com/"
}
```
I'm currently working on a React project... | 2018/08/24 | [
"https://Stackoverflow.com/questions/52009343",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10111409/"
] | When mapping an array in JS, it is possible to simultaneously access the index. You simply need to pass a function `(key, index) => ...` instead of only asking for the key. If the current index is equal to the length of the array minus 1 (because indices start from 0), you are on the last element of the array.
Here's ... | You can use css:
(I used scss, but can be with css too)
```
span {
&::after {
content: ', ';
display: inline-block;
}
&:nth-last-child(2)::after {
content: ' and ';
}
&:nth-last-child(1)::after {
content: '';
}
}
```
See example: <https://jsfiddle.net/maniator/oqr... |
52,009,343 | Let's say there exists an array of keys:
```
[ "link1", "link2", "link3" ]
```
and there is a JSON object called links that is in the following format:
```
{
"link1": "https://google.com/",
"link2": "https://facebook.com/",
"link3": "https://stackoverflow.com/"
}
```
I'm currently working on a React project... | 2018/08/24 | [
"https://Stackoverflow.com/questions/52009343",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10111409/"
] | When mapping an array in JS, it is possible to simultaneously access the index. You simply need to pass a function `(key, index) => ...` instead of only asking for the key. If the current index is equal to the length of the array minus 1 (because indices start from 0), you are on the last element of the array.
Here's ... | JS has the built in function, `array.join()`. It loops through the array, creating a single string of all items, separated by the character used as an argument.
If the arguments are left blank ( `.join()` ), it defaults to a single comma; any string put in the argument will be used (e.g. `.join('-')` or `.join('apple'... |
52,009,343 | Let's say there exists an array of keys:
```
[ "link1", "link2", "link3" ]
```
and there is a JSON object called links that is in the following format:
```
{
"link1": "https://google.com/",
"link2": "https://facebook.com/",
"link3": "https://stackoverflow.com/"
}
```
I'm currently working on a React project... | 2018/08/24 | [
"https://Stackoverflow.com/questions/52009343",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10111409/"
] | You can use css:
(I used scss, but can be with css too)
```
span {
&::after {
content: ', ';
display: inline-block;
}
&:nth-last-child(2)::after {
content: ' and ';
}
&:nth-last-child(1)::after {
content: '';
}
}
```
See example: <https://jsfiddle.net/maniator/oqr... | JS has the built in function, `array.join()`. It loops through the array, creating a single string of all items, separated by the character used as an argument.
If the arguments are left blank ( `.join()` ), it defaults to a single comma; any string put in the argument will be used (e.g. `.join('-')` or `.join('apple'... |
49,970,109 | I'm having problems getting Laravel to cast a custom attribute as a `Carbon` date. Here's an example model:
```
class Organisation extends Model
{
protected $dates = [
'my_date'
];
public function getMyDateAttribute()
{
return "2018-01-01 00:00:00";
}
}
```
I'd expect `my_date`... | 2018/04/22 | [
"https://Stackoverflow.com/questions/49970109",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9017612/"
] | edit your `Organization` model to this:
```
use Carbon\Carbon;
class Organisation extends Model
{
public function getMyDateAttribute($value)
{
//you can manipulate the date here:
$date = Carbon::parse($value,config('timezone'));
return $date;
}
}
``` | You if your model represents a table, you can change the data type to timestamp and laravel will put that attribute into a carbon object.
Once the attribute is a carbon object, you can change the format in the blade view.
```
{{ $organisation->mydate->format('Y-m-d') }}
```
If either cannot change the data type, or... |
25,084,358 | I'm trying to figure out how to right align the span text
**html**
```
<div class="table-css">
<table>
<tr><td>Text aligned left in row. <span>Text aligned right in row.</span></td></tr>
</table>
</div>
```
**css**
```
.table-css table { width: 600px; }
.table-css td a { display: block; }
.table-css td a:h... | 2014/08/01 | [
"https://Stackoverflow.com/questions/25084358",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1929943/"
] | Your only option is to iterate over the object you are encoding and to encode it item by item, probably writing your own json notation to contain the generated json.
For example
```
echo "["; // or { for an associative array (don't forget to output the json_encode()d keys and their colons)
$first = true;
for ($i = 0;... | You can use smarty template to put json just reading file from disk.
Or you can check this <https://stackoverflow.com/a/4820537/3900160> |
30,526 | Why is it that if the edges of an undirected graph G can be grouped into two sets such that every vertex is incident to at most 1 edge from each set, then the graph is 2-colorable.
The reason that I am guessing this happens is because the graph is bipartite. But I was not sure about this... I was trying to show it wa... | 2014/10/03 | [
"https://cs.stackexchange.com/questions/30526",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/12623/"
] | Hint: Consider a cycle in your graph. The edge colors must alternate, so the cycle must have even length. A graph is bipartite iff it has no odd cycles. | Bipartite is the same as two colorable.
To show that your graph is two colorable you just need to show that once you color the vertices there are no edges going between two vertices with the same color. Should be easy to show based on the definition of your graph. |
16,525 | I am using https protocol with 3 headers to test API. My test succeeds in postman but I get response code 401 ( unauthorized ) when setting up and running in jmeter. I’m using same value for header parameter in postman and jmeter.
This is my request in jmeter:
```
POST https://url
POST data:
room_id=id
[no cookies]... | 2016/01/15 | [
"https://sqa.stackexchange.com/questions/16525",
"https://sqa.stackexchange.com",
"https://sqa.stackexchange.com/users/15911/"
] | It might be the case when application expects one more header which is "Authorization" (i.e. it is added when browser asks for credentials with popup). So if your API endpoint assumes a form of username/password authentication - provide the credentials via [HTTP Authorization Manager](http://jmeter.apache.org/usermanua... | I think you should revisit your script and check that you're having HTTP Header Manager in each request with the Authorization token. Also, you can change the content type to application JSON as this is REST. |
16,525 | I am using https protocol with 3 headers to test API. My test succeeds in postman but I get response code 401 ( unauthorized ) when setting up and running in jmeter. I’m using same value for header parameter in postman and jmeter.
This is my request in jmeter:
```
POST https://url
POST data:
room_id=id
[no cookies]... | 2016/01/15 | [
"https://sqa.stackexchange.com/questions/16525",
"https://sqa.stackexchange.com",
"https://sqa.stackexchange.com/users/15911/"
] | I will suggest you to use latest version of `Jmeter i.e. 4.0` in which concept of workbench is eliminated and everything is under Test plan now.Solution of above mentioned problem is to add HTTP Cookie Manager with default values.
For [reference check here.](https://totallytechycom.wordpress.com/2018/03/23/how-to-dea... | It might be the case when application expects one more header which is "Authorization" (i.e. it is added when browser asks for credentials with popup). So if your API endpoint assumes a form of username/password authentication - provide the credentials via [HTTP Authorization Manager](http://jmeter.apache.org/usermanua... |
16,525 | I am using https protocol with 3 headers to test API. My test succeeds in postman but I get response code 401 ( unauthorized ) when setting up and running in jmeter. I’m using same value for header parameter in postman and jmeter.
This is my request in jmeter:
```
POST https://url
POST data:
room_id=id
[no cookies]... | 2016/01/15 | [
"https://sqa.stackexchange.com/questions/16525",
"https://sqa.stackexchange.com",
"https://sqa.stackexchange.com/users/15911/"
] | I will suggest you to use latest version of `Jmeter i.e. 4.0` in which concept of workbench is eliminated and everything is under Test plan now.Solution of above mentioned problem is to add HTTP Cookie Manager with default values.
For [reference check here.](https://totallytechycom.wordpress.com/2018/03/23/how-to-dea... | I think you should revisit your script and check that you're having HTTP Header Manager in each request with the Authorization token. Also, you can change the content type to application JSON as this is REST. |
19,962,443 | I want to organize my Scala packages and love how Python solves this issue with `pip`.
**Can you recommend a similar tool for the management of Scala packages?**
**EDIT:**
I am looking for an easy installation of new packages with all it's dependencies like
```
>>> pip install <a_package> # installs a_package with... | 2013/11/13 | [
"https://Stackoverflow.com/questions/19962443",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1458283/"
] | The most directly similar is probably [Scala Build Tool](http://www.scala-sbt.org/). Specifically, [Library Dependencies](http://www.scala-sbt.org/release/docs/Getting-Started/Library-Dependencies.html). The Java ecosystem includes many libraries and build tools, Scala is built on Java. So you gain the ability to lever... | Pythonistas install system wide packages which are then used by all of the python projects. This lead to a bunch of problems which [virtualenv](https://pypi.python.org/pypi/virtualenv) tries to solve. Scala guys and in general Java people have per-project definition which is written for dependency management tool -- ei... |
1,356,079 | The question is let $\{m\_1, m\_2, m\_3, \dots \}$ be a sequence of numbers where $m\_k\geq 0$ for every $k \geq 1$.
Let $$M\_n = \sum\_{k=1}^n m\_k $$ when $n \geq 1$ is an integer.
Show that if $$\prod\_{k=1}^{n-1}{(M\_k+1)\choose(M\_k)}= \frac{(m\_1+m\_2+\cdots+m\_n)!}{(m\_1!m\_2!\cdots m\_n!)}$$
When I try I get... | 2015/07/10 | [
"https://math.stackexchange.com/questions/1356079",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/250918/"
] | **Hint**
Assuming that the equation is $$\tan(3x) - \cot(4x)=0$$ rewrite it as $$\frac{\sin(3x)}{\cos(3x)}-\frac{\cos(4x)}{\sin(4x)}=\frac{\sin(3x)\sin(4x)-\cos(3x)\cos(4x)}{\cos(3x)\sin(4x)}=-\frac{\cos(7x)}{\cos(3x)\sin(4x)}=0$$
I am sure that you can take from here. | If you can use the complex exponential definition of trig functions,
$$\sin(\theta) = \frac{e^{i\theta} - e^{-i\theta}}{2i}$$
$$\cos(\theta) = \frac{e^{i\theta} + e^{-i\theta}}{2}$$
$$\tan(\theta) = \frac{\sin(\theta)}{\cos(\theta)} = \frac{(e^{i\theta} - e^{-i\theta})}{i(e^{i\theta} + e^{-i\theta})}$$
$$\cot(\theta) ... |
1,356,079 | The question is let $\{m\_1, m\_2, m\_3, \dots \}$ be a sequence of numbers where $m\_k\geq 0$ for every $k \geq 1$.
Let $$M\_n = \sum\_{k=1}^n m\_k $$ when $n \geq 1$ is an integer.
Show that if $$\prod\_{k=1}^{n-1}{(M\_k+1)\choose(M\_k)}= \frac{(m\_1+m\_2+\cdots+m\_n)!}{(m\_1!m\_2!\cdots m\_n!)}$$
When I try I get... | 2015/07/10 | [
"https://math.stackexchange.com/questions/1356079",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/250918/"
] | [](https://i.stack.imgur.com/1bKrC.jpg)
You get $\cos(7x)=0$ and $\cos(3x)\sin(4x) \ne 0$.
As you've already figured out
$\cos(7x) = 0 \implies x = \dfrac{2j+1}{14}\pi \quad (j \in \mathbb Z)$
$\cos(3x) = 0 \implies x = \dfrac{2k+1}{6}\pi \quad (k ... | If you can use the complex exponential definition of trig functions,
$$\sin(\theta) = \frac{e^{i\theta} - e^{-i\theta}}{2i}$$
$$\cos(\theta) = \frac{e^{i\theta} + e^{-i\theta}}{2}$$
$$\tan(\theta) = \frac{\sin(\theta)}{\cos(\theta)} = \frac{(e^{i\theta} - e^{-i\theta})}{i(e^{i\theta} + e^{-i\theta})}$$
$$\cot(\theta) ... |
44,489,182 | I have a problem with alignment on case 3:
<https://codepen.io/anon/pen/BZKYva>
Relevant html code:
```
<div>
<img class="img-valign" src="http://www.placehold.it/550x1050" alt="" />
<span class="text2" style="white-space: pre;">some text3 some text3some text3some text3some text3some text3some text3some text3som... | 2017/06/11 | [
"https://Stackoverflow.com/questions/44489182",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7552992/"
] | As requested, I'll flesh out my comment into an answer.
Others have mentioned this, but you most likely have a corrupted download or there's something broken with the model itself. To begin with, I highly recommend not using the VGG16 model or related models on a mobile device just due to their sheer size (500 MB for ... | 1. pls run `./setup.sh`
2. select target for `VGG16.mlmodel`, see this [screenshot](https://i.stack.imgur.com/P6G8U.png) |
44,489,182 | I have a problem with alignment on case 3:
<https://codepen.io/anon/pen/BZKYva>
Relevant html code:
```
<div>
<img class="img-valign" src="http://www.placehold.it/550x1050" alt="" />
<span class="text2" style="white-space: pre;">some text3 some text3some text3some text3some text3some text3some text3some text3som... | 2017/06/11 | [
"https://Stackoverflow.com/questions/44489182",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7552992/"
] | 1. pls run `./setup.sh`
2. select target for `VGG16.mlmodel`, see this [screenshot](https://i.stack.imgur.com/P6G8U.png) | I get the same thing for a model that has Dropout on it. Try removing these layers by copying weights over to new model without them. |
44,489,182 | I have a problem with alignment on case 3:
<https://codepen.io/anon/pen/BZKYva>
Relevant html code:
```
<div>
<img class="img-valign" src="http://www.placehold.it/550x1050" alt="" />
<span class="text2" style="white-space: pre;">some text3 some text3some text3some text3some text3some text3some text3some text3som... | 2017/06/11 | [
"https://Stackoverflow.com/questions/44489182",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7552992/"
] | As requested, I'll flesh out my comment into an answer.
Others have mentioned this, but you most likely have a corrupted download or there's something broken with the model itself. To begin with, I highly recommend not using the VGG16 model or related models on a mobile device just due to their sheer size (500 MB for ... | I get the same thing for a model that has Dropout on it. Try removing these layers by copying weights over to new model without them. |
223,091 | This is driving me insane because I can't make head or tails of it.
We have two DCs (W2K3 SP1) and I'v tried this once on each machine as a sanity check.
DHCP is being served by either one of the machines and all machines get an address no problem. The servers can connect/ping/browse to the www and so can all our lin... | 2011/01/16 | [
"https://serverfault.com/questions/223091",
"https://serverfault.com",
"https://serverfault.com/users/22597/"
] | Start with the basics.
1. Can the Windows 7 clients ping the DC's IP address?
2. Can the windows 7 machines ping the gateway's IP address?
3. Can the Windows 7 clients resolve DNS? (It sounds very much to me like this could a DNS related issue)
Use nslookup to check this, not just ping.
4. Check there are no bizarre... | Check proxy settings on the windows client.
Also check if there is firewall client installed (isa client). |
223,091 | This is driving me insane because I can't make head or tails of it.
We have two DCs (W2K3 SP1) and I'v tried this once on each machine as a sanity check.
DHCP is being served by either one of the machines and all machines get an address no problem. The servers can connect/ping/browse to the www and so can all our lin... | 2011/01/16 | [
"https://serverfault.com/questions/223091",
"https://serverfault.com",
"https://serverfault.com/users/22597/"
] | OK, we found the culprit.
There was some SonicWall VPN adapter that was screwing things up. Disabling that brought balance back to the universe.
Thanks for everyone | Check proxy settings on the windows client.
Also check if there is firewall client installed (isa client). |
65,156,426 | I have a function with two arguments say a and b. So basically, whenever I call this method 50% times it should return a and 50% times it should return b.
```
public string Randomization(string a, string b)
```
I thought of doing this using random number generation and if number generated is even, return a and if od... | 2020/12/05 | [
"https://Stackoverflow.com/questions/65156426",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14563158/"
] | A simple random between 0 and 1 would do it.
```
private Random _rnd = new();
public string Randomization(string a, string b) {
if (_rnd.Next(2) == 0) {
return a;
}
return b;
}
```
[Random.Next](https://learn.microsoft.com/en-us/dotnet/api/system.random.next?redirectedfrom=MSDN&view=net-5.0#Syste... | If you must have an 50% distribution across the two values i.e if `a` was returned before, next time it should be `b`, you may consider the below logic.
I have used lock to support thread safety. You can remove them if there is no multi threading requirement. I have used a singleton pattern instead of static variable.... |
65,156,426 | I have a function with two arguments say a and b. So basically, whenever I call this method 50% times it should return a and 50% times it should return b.
```
public string Randomization(string a, string b)
```
I thought of doing this using random number generation and if number generated is even, return a and if od... | 2020/12/05 | [
"https://Stackoverflow.com/questions/65156426",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14563158/"
] | You can just use `NextDouble()` as follows:
```cs
public string Randomization(string a, string b)
{
return new Random().NextDouble() < 0.5 ? a : b;
}
```
---
The solution will also work with `Next(int maxValue)`. However, if the method is being called enough times so that performance might be worth considering,... | If you must have an 50% distribution across the two values i.e if `a` was returned before, next time it should be `b`, you may consider the below logic.
I have used lock to support thread safety. You can remove them if there is no multi threading requirement. I have used a singleton pattern instead of static variable.... |
65,156,426 | I have a function with two arguments say a and b. So basically, whenever I call this method 50% times it should return a and 50% times it should return b.
```
public string Randomization(string a, string b)
```
I thought of doing this using random number generation and if number generated is even, return a and if od... | 2020/12/05 | [
"https://Stackoverflow.com/questions/65156426",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14563158/"
] | You could also use a method that takes a string array. Then you don't have to create a new method if you have more strings.
Also, you should make the `Random` object a property or field. Otherwise, the method returns the same string if you call it often in a few milliseconds.
A method like that would be something lik... | If you must have an 50% distribution across the two values i.e if `a` was returned before, next time it should be `b`, you may consider the below logic.
I have used lock to support thread safety. You can remove them if there is no multi threading requirement. I have used a singleton pattern instead of static variable.... |
69,092,460 | I'm having to automate a script that has a 'tear down' method to make sure the state of the page is where it was before we interacted with it. I am having issues figuring out exactly how to do this. My current idea is to perform a while loop when a certain element's state, via a class, does not exist or isn't visible i... | 2021/09/07 | [
"https://Stackoverflow.com/questions/69092460",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16538523/"
] | You can take advantage of the fact that functors compose. While you can represent this fairly explicitly by defining new types with `Data.Functor.Compose`, practically speaking it just means that you can compose `fmap` with itself.
```
mapso :: [Piese] -> ColorMap (RoleMap [Coord])
mapso lst = fmap (fmap (fmap coord))... | One option is to make your maps `Monoid` instances. So:
```
instance Semigroup a => Semigroup (RoleMap a) where
RoleMap ks qs rs <> RoleMap ks' qs' rs' =
RoleMap (ks <> ks') (qs <> qs') (rs <> rs')
instance Monoid a => Monoid (RoleMap a) where
mempty = RoleMap mempty mempty mempty
instance Semigroup... |
317,900 | On my MacPro there is one issue (and guys from Apple think this is feature...) that annoys me very much: there is a time delay between CapsLock switching. I used to do that fast. If I go to preferences and reassign caps lock to any other button and then back it works OK then, so it is not a hardware problem.
Is there ... | 2011/08/02 | [
"https://superuser.com/questions/317900",
"https://superuser.com",
"https://superuser.com/users/66269/"
] | Just as an FYI, I found an alternative solution [in another question](https://apple.stackexchange.com/a/262187/315835):
1. Go to *System Preferences* -> *Accessibility* -> *Keyboard*
2. Check *Enable Slow Keys*
3. Click *Options*
4. Drag the *Acceptance Delay* slider all the way to the left
5. Press *OK*
**However**,... | If you want a simpler solution than Karabiner, I've written a very small, open source tool to fix exactly that.
<https://github.com/gkpln3/CapsLockNoDelay> |
317,900 | On my MacPro there is one issue (and guys from Apple think this is feature...) that annoys me very much: there is a time delay between CapsLock switching. I used to do that fast. If I go to preferences and reassign caps lock to any other button and then back it works OK then, so it is not a hardware problem.
Is there ... | 2011/08/02 | [
"https://superuser.com/questions/317900",
"https://superuser.com",
"https://superuser.com/users/66269/"
] | If you install Karabiner-Elements, it defaults to zeroing out macOS's obnoxious caps lock delay.
The version you need to install depends on your macOS version.
### macOS 10.15.6 and above
Download and install [Karabiner-Elements 13.3.0 or higher](https://karabiner-elements.pqrs.org/).
### macOS 10.11 through 10.15.... | If you don't want to install Karabiner just for that, you can use `brew install --cask capslocknodelay`, it's nice lightweight and open-source tool [GitHub](https://github.com/gkpln3/CapsLockNoDelay).
Do not forget to enable it in the settings:
1. **System Preferences** -> **General** -> **Login** Items, add **CapsLo... |
317,900 | On my MacPro there is one issue (and guys from Apple think this is feature...) that annoys me very much: there is a time delay between CapsLock switching. I used to do that fast. If I go to preferences and reassign caps lock to any other button and then back it works OK then, so it is not a hardware problem.
Is there ... | 2011/08/02 | [
"https://superuser.com/questions/317900",
"https://superuser.com",
"https://superuser.com/users/66269/"
] | I was running the latest firmware on an Apple 2007 Aluminum Wireless Keyboard, and MacBook Pro Keyboard, but the issue still persisted. However, oddly this fixed it:
1. Open **System Preferences**
2. Click **Keyboard**
3. Click **Modifier Keys...**
4. Select your keyboard from the **Select keyboard:** list.
5. Set the... | 1. Download and install the following software
* Karabiner
* Hammerspoon
2. Use Karabiner maps CapsLock key to F19.
3. Edit `init.lua` under the path `~/.hammerspoon`, paste the code below.
```lua
pressedF19 = function()
hs.hid.capslock.toggle()
end
hs.hotkey.bind({}, 'F19', pressedF19, nil)
```
Then reload t... |
317,900 | On my MacPro there is one issue (and guys from Apple think this is feature...) that annoys me very much: there is a time delay between CapsLock switching. I used to do that fast. If I go to preferences and reassign caps lock to any other button and then back it works OK then, so it is not a hardware problem.
Is there ... | 2011/08/02 | [
"https://superuser.com/questions/317900",
"https://superuser.com",
"https://superuser.com/users/66269/"
] | If you want a simpler solution than Karabiner, I've written a very small, open source tool to fix exactly that.
<https://github.com/gkpln3/CapsLockNoDelay> | On Apple's discussion boards [other's report](https://discussions.apple.com/message/7001207#7001207) that updating your keyboard's firmware can/will eliminate this delay.
>
> Re: Delay problem with caps-lock
>
>
> Apr 8, 2008 3:52 PM
>
>
> It appears that the keyboard firmware update released today fixes this
> ... |
317,900 | On my MacPro there is one issue (and guys from Apple think this is feature...) that annoys me very much: there is a time delay between CapsLock switching. I used to do that fast. If I go to preferences and reassign caps lock to any other button and then back it works OK then, so it is not a hardware problem.
Is there ... | 2011/08/02 | [
"https://superuser.com/questions/317900",
"https://superuser.com",
"https://superuser.com/users/66269/"
] | Just as an FYI, I found an alternative solution [in another question](https://apple.stackexchange.com/a/262187/315835):
1. Go to *System Preferences* -> *Accessibility* -> *Keyboard*
2. Check *Enable Slow Keys*
3. Click *Options*
4. Drag the *Acceptance Delay* slider all the way to the left
5. Press *OK*
**However**,... | 1. Download and install the following software
* Karabiner
* Hammerspoon
2. Use Karabiner maps CapsLock key to F19.
3. Edit `init.lua` under the path `~/.hammerspoon`, paste the code below.
```lua
pressedF19 = function()
hs.hid.capslock.toggle()
end
hs.hotkey.bind({}, 'F19', pressedF19, nil)
```
Then reload t... |
317,900 | On my MacPro there is one issue (and guys from Apple think this is feature...) that annoys me very much: there is a time delay between CapsLock switching. I used to do that fast. If I go to preferences and reassign caps lock to any other button and then back it works OK then, so it is not a hardware problem.
Is there ... | 2011/08/02 | [
"https://superuser.com/questions/317900",
"https://superuser.com",
"https://superuser.com/users/66269/"
] | 1. Download and install the following software
* Karabiner
* Hammerspoon
2. Use Karabiner maps CapsLock key to F19.
3. Edit `init.lua` under the path `~/.hammerspoon`, paste the code below.
```lua
pressedF19 = function()
hs.hid.capslock.toggle()
end
hs.hotkey.bind({}, 'F19', pressedF19, nil)
```
Then reload t... | Not really sure about this, but google found [this](https://discussions.apple.com/thread/1169783?start=0&tstart=0). This was one of the suggestions, but it does not seem foolproof (or even close). There are more suggestions on the page.
>
> 1. Go to System Preferences > Keyboard & Mouse > Keyboard. Click on Modifier ... |
317,900 | On my MacPro there is one issue (and guys from Apple think this is feature...) that annoys me very much: there is a time delay between CapsLock switching. I used to do that fast. If I go to preferences and reassign caps lock to any other button and then back it works OK then, so it is not a hardware problem.
Is there ... | 2011/08/02 | [
"https://superuser.com/questions/317900",
"https://superuser.com",
"https://superuser.com/users/66269/"
] | I was running the latest firmware on an Apple 2007 Aluminum Wireless Keyboard, and MacBook Pro Keyboard, but the issue still persisted. However, oddly this fixed it:
1. Open **System Preferences**
2. Click **Keyboard**
3. Click **Modifier Keys...**
4. Select your keyboard from the **Select keyboard:** list.
5. Set the... | Originally the answer by Martin Steven worked for me. This was when I used OSX 10.9.
After upgrading to OSX Yosemite (10.10) it stopped working. I found another, essentially the same, solution documented here
<http://sleepycow.org/2014/07/removing-the-caps-lock-delay-on-a-macbook/>
It uses updated version of the app... |
317,900 | On my MacPro there is one issue (and guys from Apple think this is feature...) that annoys me very much: there is a time delay between CapsLock switching. I used to do that fast. If I go to preferences and reassign caps lock to any other button and then back it works OK then, so it is not a hardware problem.
Is there ... | 2011/08/02 | [
"https://superuser.com/questions/317900",
"https://superuser.com",
"https://superuser.com/users/66269/"
] | If you install Karabiner-Elements, it defaults to zeroing out macOS's obnoxious caps lock delay.
The version you need to install depends on your macOS version.
### macOS 10.15.6 and above
Download and install [Karabiner-Elements 13.3.0 or higher](https://karabiner-elements.pqrs.org/).
### macOS 10.11 through 10.15.... | I had exactly the same problem,
I could solve it by installing **Karabiner-Elements** and
making the following modification :
* select the Simple Modifications tab
* add a new modification (Add Item)
* and put **from key** `caps_lock` **to key** `caps_lock`
[ that annoys me very much: there is a time delay between CapsLock switching. I used to do that fast. If I go to preferences and reassign caps lock to any other button and then back it works OK then, so it is not a hardware problem.
Is there ... | 2011/08/02 | [
"https://superuser.com/questions/317900",
"https://superuser.com",
"https://superuser.com/users/66269/"
] | 1. Download and install the following software
* Karabiner
* Hammerspoon
2. Use Karabiner maps CapsLock key to F19.
3. Edit `init.lua` under the path `~/.hammerspoon`, paste the code below.
```lua
pressedF19 = function()
hs.hid.capslock.toggle()
end
hs.hotkey.bind({}, 'F19', pressedF19, nil)
```
Then reload t... | Originally the answer by Martin Steven worked for me. This was when I used OSX 10.9.
After upgrading to OSX Yosemite (10.10) it stopped working. I found another, essentially the same, solution documented here
<http://sleepycow.org/2014/07/removing-the-caps-lock-delay-on-a-macbook/>
It uses updated version of the app... |
317,900 | On my MacPro there is one issue (and guys from Apple think this is feature...) that annoys me very much: there is a time delay between CapsLock switching. I used to do that fast. If I go to preferences and reassign caps lock to any other button and then back it works OK then, so it is not a hardware problem.
Is there ... | 2011/08/02 | [
"https://superuser.com/questions/317900",
"https://superuser.com",
"https://superuser.com/users/66269/"
] | If you want a simpler solution than Karabiner, I've written a very small, open source tool to fix exactly that.
<https://github.com/gkpln3/CapsLockNoDelay> | I had exactly the same problem,
I could solve it by installing **Karabiner-Elements** and
making the following modification :
* select the Simple Modifications tab
* add a new modification (Add Item)
* and put **from key** `caps_lock` **to key** `caps_lock`
[.
The only contact info you can get is the user's email address, and [you must explicitly request that permission](http://developers.facebook.com/docs/reference/api/permissions/) in order to have access to it. You'll note in t... | It's only possible to view public information of a user's friends and any other user for that matter. You must get each individual user to accept a permission request from your application - this will then give you permission to extra information.
You haven't specified which contact information you're wanting, but wit... |
32,678,319 | I get an error trying to convert a `string` to `DateTime`, even though this has always worked before.
This is the procedure I used:
1. Save a datetime to a text file like this:
```
DateTime.Now.ToUniversalTime().ToString(); //results in something like this 20.9.2015 10.16.12
```
2. On application load up:
```
st... | 2015/09/20 | [
"https://Stackoverflow.com/questions/32678319",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2971843/"
] | This probably does not work anymore due to your regional settings on control panel.
To avoid conflicts with regional settings on target enviroment, use [DateTime.TryParseExact](https://msdn.microsoft.com/pt-br/library/h9b85w22(v=vs.110).aspx):
```
string s = streamReader.ReadLine(); //the saved string s = "20.09.2015... | I tried following code in console application, and it worked for me. And check .NETFiddle [here](https://dotnetfiddle.net/nxsz87)
```
string s = "20.09.2015 10.16.12";
DateTime d;
bool isValid = DateTime.TryParseExact(s, "dd.MM.yyyy HH.mm.ss", CultureInfo.InvariantCulture, DateTimeStyles.None, out d);
```
Try to und... |
32,678,319 | I get an error trying to convert a `string` to `DateTime`, even though this has always worked before.
This is the procedure I used:
1. Save a datetime to a text file like this:
```
DateTime.Now.ToUniversalTime().ToString(); //results in something like this 20.9.2015 10.16.12
```
2. On application load up:
```
st... | 2015/09/20 | [
"https://Stackoverflow.com/questions/32678319",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2971843/"
] | This probably does not work anymore due to your regional settings on control panel.
To avoid conflicts with regional settings on target enviroment, use [DateTime.TryParseExact](https://msdn.microsoft.com/pt-br/library/h9b85w22(v=vs.110).aspx):
```
string s = streamReader.ReadLine(); //the saved string s = "20.09.2015... | Please try with this.
CultureInfo objcul = new CultureInfo("en-GB");
DateTime.ParseExact(ValidFrom.Text,"dd/MM/yyyy", objcul); |
32,678,319 | I get an error trying to convert a `string` to `DateTime`, even though this has always worked before.
This is the procedure I used:
1. Save a datetime to a text file like this:
```
DateTime.Now.ToUniversalTime().ToString(); //results in something like this 20.9.2015 10.16.12
```
2. On application load up:
```
st... | 2015/09/20 | [
"https://Stackoverflow.com/questions/32678319",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2971843/"
] | I tried following code in console application, and it worked for me. And check .NETFiddle [here](https://dotnetfiddle.net/nxsz87)
```
string s = "20.09.2015 10.16.12";
DateTime d;
bool isValid = DateTime.TryParseExact(s, "dd.MM.yyyy HH.mm.ss", CultureInfo.InvariantCulture, DateTimeStyles.None, out d);
```
Try to und... | Please try with this.
CultureInfo objcul = new CultureInfo("en-GB");
DateTime.ParseExact(ValidFrom.Text,"dd/MM/yyyy", objcul); |
8,390,877 | I have the problem that when you are in windows and you try to print through JAVA you can only use the AUTOSENSE property.
However my string that I want to get printed is in greek => UTF-8. When I turn the AUTOSENSE to TEXT\_PLAIN\_UTF8 i get an: sun.print.PrintJobFlavorException: invalid flavor exception....
Any sugg... | 2011/12/05 | [
"https://Stackoverflow.com/questions/8390877",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/296997/"
] | Its easier to do it with SWT here is the code...
```
package printer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.printing.Printer;
import org.eclipse.swt.... | You should use `DocFlavor.BYTE_ARRAY.TEXT_PLAIN_UTF_8`. |
8,390,877 | I have the problem that when you are in windows and you try to print through JAVA you can only use the AUTOSENSE property.
However my string that I want to get printed is in greek => UTF-8. When I turn the AUTOSENSE to TEXT\_PLAIN\_UTF8 i get an: sun.print.PrintJobFlavorException: invalid flavor exception....
Any sugg... | 2011/12/05 | [
"https://Stackoverflow.com/questions/8390877",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/296997/"
] | Its easier to do it with SWT here is the code...
```
package printer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.printing.Printer;
import org.eclipse.swt.... | For auto\_sense you could write a BOM character (**\uFEFF**) in front of the text. This is a zero-width space, used for marking a text as unicode. |
64,807,681 | I am testing the BG95-M3 with its corresponding evaluation board.
I live in Spain and I am using a Vodafone SIM card. I am able to connect to the GSM network with the default settings just by specifying the APN, user and password. Also I can connect to my server and send/receive data without problems.
My issue is tha... | 2020/11/12 | [
"https://Stackoverflow.com/questions/64807681",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1281500/"
] | According to this website [Orange](https://www.frequencycheck.com/carriers/orange-spain), [Movistar](https://www.frequencycheck.com/carriers/movistar-spain) and [Vodafone](https://www.frequencycheck.com/carriers/vodafone-spain) are using bands B3 and B7 in spain. The BG95-M3 does not support band B7 ([source](https://w... | BG95 is supporting LTE-CAT-M1 networks, not LTE (4G), so maybe you should ask vodafone in Spain about LTE Cat-M
I tested BG600L-M3 for LTE-Cat-M1, it is working only in some areas, and the first regestering to the netowrk take a while (1-2 minutes)
to make sure of right AT commands look to AT+QCFG commands
Have a nic... |
35,924,733 | Both A and B UIView are inside scrollView. As you can see in the image UIView B isn't filling and fit to the bottom of the 5.5 screens. Is there is any solution to automatically grow the UIView B to fit to screen bottom.
[](https://i.stack.imgur.com/WB... | 2016/03/10 | [
"https://Stackoverflow.com/questions/35924733",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/442070/"
] | First, if your views have a set size, I would recommend rethinking putting them in a scrollview.
If you have a reason for it, your best option to do it automatically would likely be adding constraints for equating the height of the ViewController's view to A and B views.
The more flexible solution would be to handle... | I just remove the existing height constraint, add a new height to match the remain space
```
let hightConstraint = getConstraint(viewFollowMe, constaintId: "constriantHeightFollowMe")
if hightConstraint != nil {
viewFollowMe.removeConstraint(hightConstraint!)
let heightContraints = N... |
35,924,733 | Both A and B UIView are inside scrollView. As you can see in the image UIView B isn't filling and fit to the bottom of the 5.5 screens. Is there is any solution to automatically grow the UIView B to fit to screen bottom.
[](https://i.stack.imgur.com/WB... | 2016/03/10 | [
"https://Stackoverflow.com/questions/35924733",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/442070/"
] | Give bottom constraint of your scrollView with respect to view or BottomLayoutGuide and Give bottom constraint of your UIView B to the bottom of scrollview | I just remove the existing height constraint, add a new height to match the remain space
```
let hightConstraint = getConstraint(viewFollowMe, constaintId: "constriantHeightFollowMe")
if hightConstraint != nil {
viewFollowMe.removeConstraint(hightConstraint!)
let heightContraints = N... |
203,114 | I'm using `get_next_post_link()` and `get_previous_post_link()` within the loop but the returned posts are not correct.
`get_next_post_link()` shows the previous post and `get_previous_post_link()` gives the current post. Below the context of these links:
```
$args['name'] = $postname;
$query = new WP_Query($args);
... | 2015/09/18 | [
"https://wordpress.stackexchange.com/questions/203114",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/80625/"
] | This has been solved by changing `Site Address (URL)` in `Settings > General` to the path that matches with the posts's path. I was pulling in posts from another location in my website that did not match with the original (default) path of the post. | I think you can not pass proper argument. Please check this link for reference : <https://codex.wordpress.org/Function_Reference/get_next_posts_link> |
203,114 | I'm using `get_next_post_link()` and `get_previous_post_link()` within the loop but the returned posts are not correct.
`get_next_post_link()` shows the previous post and `get_previous_post_link()` gives the current post. Below the context of these links:
```
$args['name'] = $postname;
$query = new WP_Query($args);
... | 2015/09/18 | [
"https://wordpress.stackexchange.com/questions/203114",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/80625/"
] | ```
get_next_post_link();
get_previous_post_link();
```
These work on single posts for navigation from one single post to another NOT pagination for archive pages unless you use `get_query_var( 'paged' )` | I think you can not pass proper argument. Please check this link for reference : <https://codex.wordpress.org/Function_Reference/get_next_posts_link> |
37,920,437 | I've recently made a few changes in my init emacs file, and I've noticed with --debug-init that some load files seem to be missing. Here is the output from the debugger
```
Debugger entered--Lisp error: (file-error "Cannot open load file" "/home/andre/a-m")
load("/home/andre/a-m" nil nil t)
load-file("a-m")
eval-bu... | 2016/06/20 | [
"https://Stackoverflow.com/questions/37920437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4805211/"
] | Thanks for your help. I didn't read the new ansys-mode <https://github.com/dieter-wilhelm/ansys-mode> documentation properly. Here is the issue:
>
> Please have a look at the accompanying `default.el’ customisation example. It can be used as a configuration file (after moving it e. g. to`/usr/share/emacs/site-lisp’ o... | Note that with Git 2.18 (Q2 2018), the scripts in `contrib/emacs/` have outlived their usefulness and have been replaced with a stub that errors out and tells the user there are replacements.
So the `init` error message might not apply anymore in 2018.
See [commit 6d5ed48](https://github.com/git/git/commit/6d5ed4836d... |
38,885,965 | I am using [AntonioRiveiro/Tracker](https://github.com/antonioribeiro/tracker) repo for my [laravel](https://laravel.com/) app. I would like to add some more functionality to it that it doesn't have out of the box.
1. But I can't find where its instance gets created, or how to access the `Tracker` object in my Control... | 2016/08/11 | [
"https://Stackoverflow.com/questions/38885965",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2321515/"
] | So I think the easiest way for you to go about this is the following:
First, make your own ServiceProvider
```
php artisan make:provider CustomTrackerServiceProvider
```
Now open up that file, we'll need to make some modifications.
Firstly, we'll need to extend the ServiceProvider that Tracker provides.
```
use P... | The answer to this question provides a solution for (2), I found the answer to (1) [here](https://github.com/antonioribeiro/tracker/issues/173).
To access the tracker object you need to include:
```
use PragmaRX\Tracker\Vendor\Laravel\Facade as tracker;
```
Then you'll do something like:
```
$visitor = Tracker::cu... |
51,167,869 | I'm new Devoloper, I want to load image from FirebaseDatabase with Picasso. But I'm getting this error ;
abstract method "void com.squareup.picasso.Callback.onError(java.lang.Exception)
I dont understand what it means. Because I'm using already Callback method. Here is my adapter ;
```
private void myAdapter() {
... | 2018/07/04 | [
"https://Stackoverflow.com/questions/51167869",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9445424/"
] | Glide caches the image using the url you provided.
Use Signature
```
Glide.with(yourFragment)
.load(yourFileDataModel)
.signature(new StringSignature(String.valueOf(System.currentTimeMillis())))
.into(yourImageView);
```
or
disable caching by setting `.diskCacheStrategy(DiskCacheStrategy.NONE)`
or ... | Use **`.diskCacheStrategy(DiskCacheStrategy.NONE)`**
```
Glide.with(context)
.load("https://picsum.photos/200/200/?random")
.diskCacheStrategy(DiskCacheStrategy.NONE)
.into(holder.view.avatar)
``` |
5,899,726 | I understand that it is possible to create java function in an oracle database using the command CREATE JAVA - look [here](http://download.oracle.com/docs/cd/B19306_01/java.102/b14187/toc.htm). I have been reading a lot about how to do this but the more I read the more there is to read, it seems.
What I want to do is ... | 2011/05/05 | [
"https://Stackoverflow.com/questions/5899726",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/481009/"
] | Not directly possible, you need another step:
(Note that you cannot return a boolean type in a SQL callable function. You must return a valid Oracle SQL type, in this example, a String).
Create your function:
```
create or replace and compile java source named returntrue as
public class example
{ public static Strin... | How invested are you in Oracle? If the answer is anywhere between "a fair amount" and "my life depends on it," learn PL/SQL. It's a sort of odd language in some ways, but it does what it does quite well, and that is provide a procedural layer on top of SQL. If what your code is doing is more in depth or sophisticated t... |
42,152,365 | I am in a situation here, I've two edit text in a fragment, on back press the value of first edit text is getting replaced by second edit text. Now both the edit text are having same values.
```
<EditText
android:id="@+id/edit_text"
android:layout_width="match_parent"
android:layout_height="30dp"
andro... | 2017/02/10 | [
"https://Stackoverflow.com/questions/42152365",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5436986/"
] | Try this
if string.characters.count == 4
```
func textField(textField: UITextField, shouldChangeCharactersInRange range: NSRange,replacementString string: String) -> Bool
{
if textField == self.yourTextField{
if string.characters.count == 4{
//do your task
}
else
... | Modify your code to :
```
func textFieldDidChange(textField: UITextField){
print("Text changed: " + textField.text!)
if(textField.Text.characters.count >3 ) {
textField.resignFirstResponder()
let secondViewController = self.storyboard.instantiateViewControllerWithIdentifier("SecondViewController") ... |
42,152,365 | I am in a situation here, I've two edit text in a fragment, on back press the value of first edit text is getting replaced by second edit text. Now both the edit text are having same values.
```
<EditText
android:id="@+id/edit_text"
android:layout_width="match_parent"
android:layout_height="30dp"
andro... | 2017/02/10 | [
"https://Stackoverflow.com/questions/42152365",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5436986/"
] | **METHOD 1.** First of all, add this in `viewDidLoad()`:
```
yourTextField.addTarget(self, action: #selector(textFieldDidChange(_:)), for: .editingChanged) // make sure it is the desired textField
```
Then add your function:
```
func textFieldDidChange(_ textField: UITextField) {
if textField.text!.characters.c... | Try this
if string.characters.count == 4
```
func textField(textField: UITextField, shouldChangeCharactersInRange range: NSRange,replacementString string: String) -> Bool
{
if textField == self.yourTextField{
if string.characters.count == 4{
//do your task
}
else
... |
42,152,365 | I am in a situation here, I've two edit text in a fragment, on back press the value of first edit text is getting replaced by second edit text. Now both the edit text are having same values.
```
<EditText
android:id="@+id/edit_text"
android:layout_width="match_parent"
android:layout_height="30dp"
andro... | 2017/02/10 | [
"https://Stackoverflow.com/questions/42152365",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5436986/"
] | **METHOD 1.** First of all, add this in `viewDidLoad()`:
```
yourTextField.addTarget(self, action: #selector(textFieldDidChange(_:)), for: .editingChanged) // make sure it is the desired textField
```
Then add your function:
```
func textFieldDidChange(_ textField: UITextField) {
if textField.text!.characters.c... | Modify your code to :
```
func textFieldDidChange(textField: UITextField){
print("Text changed: " + textField.text!)
if(textField.Text.characters.count >3 ) {
textField.resignFirstResponder()
let secondViewController = self.storyboard.instantiateViewControllerWithIdentifier("SecondViewController") ... |
8,426,848 | Iam creating a custom page using TOutputMsgWizardPage. I wanted to show some values from a file to the custom page. My installers flow is like this,
It will accept a license file from the user and will validate the license file and create an ini file based on license. The ini file contains many information about the l... | 2011/12/08 | [
"https://Stackoverflow.com/questions/8426848",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1074650/"
] | You don't create or delete wizard pages once the install has started.
Pages are created once at startup in the `InitializeWizard()` event function in their sequence and you then control whether they're shown or not using the `ShouldSkipPage()` event function. You can load in any values you wish to display in the `CurPa... | You may use page.Free() to delete a page. |
216,982 | I want to know why this error happens and how to fix this problem. The code is
```
mmu = 105.66*10^-3;
mW = 80.379;
Δamumax = (26.1 + 8.0)*10^-10;
Δamumin = (26.1 - 8.0)*10^-10;
e1[M44nu_] := M44nu/mmu; lambda1 = mmu/mW;
yv1[M44nu_, tanβ_] := (246 tanβ)/(
Sqrt[2] M44nu Sqrt[1 + tanβ^2]) ;
ya1[M44nu_, tanβ_] := (246 ... | 2020/03/24 | [
"https://mathematica.stackexchange.com/questions/216982",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/62743/"
] | Define the NIntegrate containing function variables as numeric variables with `_?NumericQ` in order to prevent NIntegrating working with symbols.
```
Δaμ11[M44nu_?NumericQ,
tanβ_?NumericQ] :=
-1/(8 π^2) mmu^2/
mW^2 NIntegrate[(Abs[yv1[M44nu, tanβ]]^2 P3pp[M44nu, x] +
Abs[ya1[M44nu, tanβ]]^2 P3mm[M44nu,
... | ```
Clear["Global`*"]
mmu = 105.66*10^-3 // Rationalize;
mW = 80.379 // Rationalize;
Δamumax = (26.1 + 8.0)*10^-10 // Rationalize[#, 0] &;
Δamumin = (26.1 - 8.0)*10^-10 // Rationalize[#, 0] &;
e1[M44nu_] := M44nu/mmu;
lambda1 = mmu/mW;
yv1[M44nu_,
tanβ_] := (246 tanβ)/(Sqrt[2] M44nu Sqrt[1 + tanβ^2]);
ya1[M44nu_, ... |
2,587,652 | Let be $\alpha > 0$. Let be $f : (x, t) \mapsto \dfrac{e^{-\frac{t}{x}}}{1 + t}$, $F : x \mapsto \int\_0^{\alpha} f(x, t) \textrm{d}t$.
I am struggling to establish a series expansion of $F$ at $x = 0$ due to $e^{-\frac{t}{x}}$ being delicate to study.
I tried:
* Dominated convergence theorem, I showed that $\dfrac{... | 2018/01/01 | [
"https://math.stackexchange.com/questions/2587652",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/112314/"
] | Here some integrations by parts are just fine to obtain a series expansion as $x \to 0^+$,
$$
\begin{align}
& \int\_0^{\alpha} \frac{e^{-\frac{t}{x}}}{1 + t}\: dt
\\\\&=\left[ -xe^{-t/x}\:\frac{1}{1 + t}\right]\_0^\alpha
-x\int^\alpha\_0 e^{-t/x}\frac{1}{(1 + t)^2}\,dt
\\\\&=\color{red}{x}-xe^{-\alpha/x}-x\left(\left[... | As Olivier Oloa did, integration by parts leads to the following steps
$$\int\_0^{\alpha} \frac{e^{-\frac{t}{x}}}{1 + t}\, dt=x-\frac{x e^{-\frac{\alpha }{x}}}{\alpha +1}-x \int\_0^{\alpha}\frac{ e^{-\frac{t}{x}}}{(1+t)^2}\,dt$$
$$\int\_0^{\alpha}\frac{ e^{-\frac{t}{x}}}{(1+t)^2}\,dt=x-\frac{x e^{-\frac{\alpha }{x}}}{(... |
14,428,328 | Im having difficulty creating the sort method for my program. I created a program that askes the user if would like to add, delete, search, or sort from A-Z.
Heres my code for the program
```
import java.util.Scanner;
import java.io.*;
/**
* Write a description of class Final_Project here.
*
* @author (your name)... | 2013/01/20 | [
"https://Stackoverflow.com/questions/14428328",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1995137/"
] | As this looks like study, only advice:
Split the problem in *already done* (initially empty) and *to do* (initially all). Then repeatedly pick a candidate from the to-dos and increase the dones.
A bit like:
```
int sortedCars = 0;
while (sortedCars < car.length) {
// Pick the smallest from the unsorted cars:
... | I dont think you should write your own sort method. Instead leverage Java's bulid in `Arrays.sort` method
Eg.
```
Arrays.sort(car, new Comparator() {
public int compare(Object o1, Object o2) {
// compare based on which column you want
return o1[0].compareTo(o2[0]);
}
});
``` |
8,950,690 | I'm working on outputting data from two different sources into an HTML table. One source is a `mysql_fetch_array`, the other is a `$_POST` array. There are three `<td>` tables from mysql and one from `$_POST` outputting via a while loop. To associate the arrays on the output page, I planned to store the `$_POST` data i... | 2012/01/21 | [
"https://Stackoverflow.com/questions/8950690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1161834/"
] | ```
foreach($sua as $key => $value){
$value = mysql_escape_string($value);
$id = mysql_escape_string ($pid[$key]);
mysql_query("UPDATE $tbl_name SET unit_ass='$value' WHERE id='$id'");
}
``` | Well, I believe `$gid = implode(",", $pid);` will give one value (consider as `1`)
Now suppose `$sua = array_filter($_POST['unit_ass']);` give you `ABC, PQR, LMN`.
so your query will be executed like this
```
mysql_query("UPDATE $tbl_name SET unit_ass='ABC' WHERE id='1'");
mysql_query("UPDATE $tbl_name SET unit_as... |
47,729,240 | [Sql Fiddle Demo](http://sqlfiddle.com/#!6/1896b/2)
When I change table data like this means result will be changed.
```
INSERT INTO Table1
([id], [time_stamp], [AccessType])
VALUES
(1001, '2017-09-05 09:35:00', 'IN'),
(1001, '2017-09-05 09:37:00', 'IN'),
(1001, '2017-09-05 09:38:00', 'IN'),
... | 2017/12/09 | [
"https://Stackoverflow.com/questions/47729240",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You want to use `.map`.
`.forEach` doesn't return anything, it is used to run a function with each item. `.map` returns a value for each iteration it runs.
```
var items = [255, 255, 255, 255]
items = items.map(item => item === 255 ? 0 : item)
console.log(items) // [0, 0, 0, 0]
``` | You could take the reference to the array for changing the value inside of the callback for [`Array#forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach).
BTW, after a [block statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/bloc... |
47,729,240 | [Sql Fiddle Demo](http://sqlfiddle.com/#!6/1896b/2)
When I change table data like this means result will be changed.
```
INSERT INTO Table1
([id], [time_stamp], [AccessType])
VALUES
(1001, '2017-09-05 09:35:00', 'IN'),
(1001, '2017-09-05 09:37:00', 'IN'),
(1001, '2017-09-05 09:38:00', 'IN'),
... | 2017/12/09 | [
"https://Stackoverflow.com/questions/47729240",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Well, you are just changing the value type argument, nothing will happen with the items in the array. You can just change it to use `map` instead and create a new array
```
items = items.map( item => item === 255 ? 0 : item );
```
As remarked in the comments, in the original code, you also used an assignment operato... | You could take the reference to the array for changing the value inside of the callback for [`Array#forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach).
BTW, after a [block statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/bloc... |
47,729,240 | [Sql Fiddle Demo](http://sqlfiddle.com/#!6/1896b/2)
When I change table data like this means result will be changed.
```
INSERT INTO Table1
([id], [time_stamp], [AccessType])
VALUES
(1001, '2017-09-05 09:35:00', 'IN'),
(1001, '2017-09-05 09:37:00', 'IN'),
(1001, '2017-09-05 09:38:00', 'IN'),
... | 2017/12/09 | [
"https://Stackoverflow.com/questions/47729240",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Your code contains two bugs.
1. `=` is assignment, not comparison. Your function is equivalent to:
```
function (item) {
item = 255;
item = 0;
}
```
2. `item` is a function parameter, i.e. a local variable in the anonymous function. Assigning to `item` has no effect on the `items` array:
```
var x = 255;
(f... | You could take the reference to the array for changing the value inside of the callback for [`Array#forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach).
BTW, after a [block statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/bloc... |
1,194,888 | ```
ManagedElement=1,Transport=1,Router={{TAG_OAM_CMX_LEFT_VR_NAME_TAG}}
no InterfaceIPv4=vlan1.{{TAG_OAM_NET_VLAN_TAG}}
top
ManagedElement=1,Transport=1,Router={{TAG_OAM_CMX_RIGHT_VR_NAME_TAG}}
no InterfaceIPv4=vlan1.{{TAG_OAM_NET_VLAN_TAG}}
commit -s
```
In this file, I want to add `#` in beginning if and onl... | 2019/12/09 | [
"https://askubuntu.com/questions/1194888",
"https://askubuntu.com",
"https://askubuntu.com/users/1023504/"
] | You can try the following:
```
sed -Ei 's/(^.*CMX.*$)/#\1/' your_file_name
```
It will replace the line containing `^.*CMX.*$` with itself, but by prepending with a `#`.
Here, in the replacement string `\1` is the whole matched string in parentheses. `^` indicates the beginning of line and `$` end of the line. `.*`... | Using `sed` you can "replace" the zero-width `^` start-of-line anchor with `#`
```
s/^/#/
```
only in lines of `file` that match `CMX`:
```
sed -i.bak '/CMX/s/^/#/' file
``` |
352,584 | I have a Toshiba laptop with Windows Vista Home Premium installed. And I'm considering an online upgrade purchase of Windows 7 Ultimate. The site's description of the product reads:
"Microsoft Windows 7 Ultimate 32/64 Full Version /or Upgrade. Already activated no key needed. You don't even have to have an operating s... | 2011/10/31 | [
"https://superuser.com/questions/352584",
"https://superuser.com",
"https://superuser.com/users/103622/"
] | If you are buying an upgrade from the manufacturer, then this is legit. Any other reseller, then I'd hesitate without verification from the OEM.
The no activation is part of Microsoft's agreement with OEMs that allow them to install Windows on their hardware without having to type in a key. A combination of specific h... | Beware of all Craigslist ads which offer any PC for sale with Windows 7 "pre-installed" for under $120! A retail copy of Windows 7 alone still costs around $100. Be especially leery of it is an older PC designed for Windows XP and be wary if the same dealer is selling several of them. In order for such dealers to make ... |
390,169 | I am looking for software/application that can help me of checking some Linux commands working in a browser irrespective of OS. I mean Live CLI in the browser.
Thank you. | 2013/12/13 | [
"https://askubuntu.com/questions/390169",
"https://askubuntu.com",
"https://askubuntu.com/users/33833/"
] | Ok have found something after some googling , <http://www.compileonline.com/execute_ksh_online.php>
Posting here for helping others:
 | just refer this link below tells you about the basic steps !!
<http://www.cyberciti.biz/tips/executing-linuxunix-commands-from-web-page-part-i.html> |
390,169 | I am looking for software/application that can help me of checking some Linux commands working in a browser irrespective of OS. I mean Live CLI in the browser.
Thank you. | 2013/12/13 | [
"https://askubuntu.com/questions/390169",
"https://askubuntu.com",
"https://askubuntu.com/users/33833/"
] | Amongst many other solutions for an online Linux emulator there is [Bellard's Javascript emulator](http://bellard.org/jslinux/):
 | just refer this link below tells you about the basic steps !!
<http://www.cyberciti.biz/tips/executing-linuxunix-commands-from-web-page-part-i.html> |
390,169 | I am looking for software/application that can help me of checking some Linux commands working in a browser irrespective of OS. I mean Live CLI in the browser.
Thank you. | 2013/12/13 | [
"https://askubuntu.com/questions/390169",
"https://askubuntu.com",
"https://askubuntu.com/users/33833/"
] | Amongst many other solutions for an online Linux emulator there is [Bellard's Javascript emulator](http://bellard.org/jslinux/):
 | Ok have found something after some googling , <http://www.compileonline.com/execute_ksh_online.php>
Posting here for helping others:
 |
59,249,891 | I have tables with the same name in 2 different schemas. What I want to do is get a count comparison in the 2 tables in the format
TableName : Count1 : Count2
How can I achieve this via Hive query? | 2019/12/09 | [
"https://Stackoverflow.com/questions/59249891",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5069746/"
] | As you can see in the [SELECT command documentation](https://redis.io/commands/select):
>
> Select the Redis logical database having the specified zero-based
> numeric index. New connections always use the database 0.
>
>
>
which means that you're supposed to pass an integer (in your case that would be 1), so it... | Redis support 16 database. You can switch a DB using an integer starting from 0 to 15 |
12,829,762 | I have menu items which are to be styled as follows:

The arrow at the end I am achieving with an :after pesudo-class:
```
.ride-type-menu:after{
content:"";
border: 13px solid;
border-color: transparent #DBD7D7;
bor... | 2012/10/10 | [
"https://Stackoverflow.com/questions/12829762",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/993588/"
] | Depends on if "Touchable" represents a random set of behaviors that each class must explicitly implement to support or if there can be a single implementation that "just works" with inheritance (with, maybe, a bit of customization).
If the former, then your thinking is mostly correct. If the latter, then Jack's sugges... | I previously explained why [subclassing CCSprite is almost always a bad idea](https://stackoverflow.com/a/8043643/201863).
"Touchable" as the name suggests is an ability of an object. A node can either be touched, or it can not. Moreover, this must not be restricted to sprites. What if later on you want a touchable l... |
39,983,468 | I have just started working in Xamarin and am writing an App targeting iOS and Android. I'm trying to keep pretty much all of my UI design in the common library between them and am starting to find the lines a bit blurred. My current requirement is to disable the auto-capitalisation on the 'Entry' tag object in XAML. I... | 2016/10/11 | [
"https://Stackoverflow.com/questions/39983468",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/980771/"
] | If you plan to use this keyboard in a number of pages you will want to add the following code to your App.xaml's `ResourceDictionary`. If you want to use it in multiple places but only in a single `ContentPage` you will want to add it to the `ContentPage`'s `ResourceDictionary`. Otherwise you can add it directly to you... | You can set the `Keyboard="Text"` - the `Default` keyboard performs the capitalisation.
Also check out the additional keyboard [settings](https://developer.xamarin.com/recipes/cross-platform/xamarin-forms/controls/choose-keyboard-for-entry/#Specifying_additional_keyboard_options) that can be applied. These allow you t... |
39,983,468 | I have just started working in Xamarin and am writing an App targeting iOS and Android. I'm trying to keep pretty much all of my UI design in the common library between them and am starting to find the lines a bit blurred. My current requirement is to disable the auto-capitalisation on the 'Entry' tag object in XAML. I... | 2016/10/11 | [
"https://Stackoverflow.com/questions/39983468",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/980771/"
] | A bit late but there is now a simple way to get a plain keyboard, with no flags:
```
<Entry
FontSize="Small"
Keyboard="Plain"
Text="Text"/>
```
Documentation [here](https://learn.microsoft.com/en-us/dotnet/api/xamarin.forms.keyboard.plain?view=xamarin-forms). | You can set the `Keyboard="Text"` - the `Default` keyboard performs the capitalisation.
Also check out the additional keyboard [settings](https://developer.xamarin.com/recipes/cross-platform/xamarin-forms/controls/choose-keyboard-for-entry/#Specifying_additional_keyboard_options) that can be applied. These allow you t... |
39,983,468 | I have just started working in Xamarin and am writing an App targeting iOS and Android. I'm trying to keep pretty much all of my UI design in the common library between them and am starting to find the lines a bit blurred. My current requirement is to disable the auto-capitalisation on the 'Entry' tag object in XAML. I... | 2016/10/11 | [
"https://Stackoverflow.com/questions/39983468",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/980771/"
] | You can set the `Keyboard="Text"` - the `Default` keyboard performs the capitalisation.
Also check out the additional keyboard [settings](https://developer.xamarin.com/recipes/cross-platform/xamarin-forms/controls/choose-keyboard-for-entry/#Specifying_additional_keyboard_options) that can be applied. These allow you t... | Whether in the emulator or device in Android, you'll find this happens when xaml property in <Entry Keyboard="text" AND you are using a *physical keyboard*.
If you use the onscreen keyboard, even in the emulator (as you would normally using a phone or tablet in 99% of cases, this is not an issue). Setting Keyboard="Pl... |
39,983,468 | I have just started working in Xamarin and am writing an App targeting iOS and Android. I'm trying to keep pretty much all of my UI design in the common library between them and am starting to find the lines a bit blurred. My current requirement is to disable the auto-capitalisation on the 'Entry' tag object in XAML. I... | 2016/10/11 | [
"https://Stackoverflow.com/questions/39983468",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/980771/"
] | If you plan to use this keyboard in a number of pages you will want to add the following code to your App.xaml's `ResourceDictionary`. If you want to use it in multiple places but only in a single `ContentPage` you will want to add it to the `ContentPage`'s `ResourceDictionary`. Otherwise you can add it directly to you... | There's a workaround to use entry without capitalization, such as a "username". For this you can simply use
```html
<Entry Keyboard="Email" Placeholder="Username"/>
```
Finally you'll get a non-autocapitalization entry and also you may use it as a email text if needed. |
39,983,468 | I have just started working in Xamarin and am writing an App targeting iOS and Android. I'm trying to keep pretty much all of my UI design in the common library between them and am starting to find the lines a bit blurred. My current requirement is to disable the auto-capitalisation on the 'Entry' tag object in XAML. I... | 2016/10/11 | [
"https://Stackoverflow.com/questions/39983468",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/980771/"
] | If you plan to use this keyboard in a number of pages you will want to add the following code to your App.xaml's `ResourceDictionary`. If you want to use it in multiple places but only in a single `ContentPage` you will want to add it to the `ContentPage`'s `ResourceDictionary`. Otherwise you can add it directly to you... | A bit late but there is now a simple way to get a plain keyboard, with no flags:
```
<Entry
FontSize="Small"
Keyboard="Plain"
Text="Text"/>
```
Documentation [here](https://learn.microsoft.com/en-us/dotnet/api/xamarin.forms.keyboard.plain?view=xamarin-forms). |
39,983,468 | I have just started working in Xamarin and am writing an App targeting iOS and Android. I'm trying to keep pretty much all of my UI design in the common library between them and am starting to find the lines a bit blurred. My current requirement is to disable the auto-capitalisation on the 'Entry' tag object in XAML. I... | 2016/10/11 | [
"https://Stackoverflow.com/questions/39983468",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/980771/"
] | If you plan to use this keyboard in a number of pages you will want to add the following code to your App.xaml's `ResourceDictionary`. If you want to use it in multiple places but only in a single `ContentPage` you will want to add it to the `ContentPage`'s `ResourceDictionary`. Otherwise you can add it directly to you... | Whether in the emulator or device in Android, you'll find this happens when xaml property in <Entry Keyboard="text" AND you are using a *physical keyboard*.
If you use the onscreen keyboard, even in the emulator (as you would normally using a phone or tablet in 99% of cases, this is not an issue). Setting Keyboard="Pl... |
39,983,468 | I have just started working in Xamarin and am writing an App targeting iOS and Android. I'm trying to keep pretty much all of my UI design in the common library between them and am starting to find the lines a bit blurred. My current requirement is to disable the auto-capitalisation on the 'Entry' tag object in XAML. I... | 2016/10/11 | [
"https://Stackoverflow.com/questions/39983468",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/980771/"
] | A bit late but there is now a simple way to get a plain keyboard, with no flags:
```
<Entry
FontSize="Small"
Keyboard="Plain"
Text="Text"/>
```
Documentation [here](https://learn.microsoft.com/en-us/dotnet/api/xamarin.forms.keyboard.plain?view=xamarin-forms). | There's a workaround to use entry without capitalization, such as a "username". For this you can simply use
```html
<Entry Keyboard="Email" Placeholder="Username"/>
```
Finally you'll get a non-autocapitalization entry and also you may use it as a email text if needed. |
39,983,468 | I have just started working in Xamarin and am writing an App targeting iOS and Android. I'm trying to keep pretty much all of my UI design in the common library between them and am starting to find the lines a bit blurred. My current requirement is to disable the auto-capitalisation on the 'Entry' tag object in XAML. I... | 2016/10/11 | [
"https://Stackoverflow.com/questions/39983468",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/980771/"
] | There's a workaround to use entry without capitalization, such as a "username". For this you can simply use
```html
<Entry Keyboard="Email" Placeholder="Username"/>
```
Finally you'll get a non-autocapitalization entry and also you may use it as a email text if needed. | Whether in the emulator or device in Android, you'll find this happens when xaml property in <Entry Keyboard="text" AND you are using a *physical keyboard*.
If you use the onscreen keyboard, even in the emulator (as you would normally using a phone or tablet in 99% of cases, this is not an issue). Setting Keyboard="Pl... |
39,983,468 | I have just started working in Xamarin and am writing an App targeting iOS and Android. I'm trying to keep pretty much all of my UI design in the common library between them and am starting to find the lines a bit blurred. My current requirement is to disable the auto-capitalisation on the 'Entry' tag object in XAML. I... | 2016/10/11 | [
"https://Stackoverflow.com/questions/39983468",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/980771/"
] | A bit late but there is now a simple way to get a plain keyboard, with no flags:
```
<Entry
FontSize="Small"
Keyboard="Plain"
Text="Text"/>
```
Documentation [here](https://learn.microsoft.com/en-us/dotnet/api/xamarin.forms.keyboard.plain?view=xamarin-forms). | Whether in the emulator or device in Android, you'll find this happens when xaml property in <Entry Keyboard="text" AND you are using a *physical keyboard*.
If you use the onscreen keyboard, even in the emulator (as you would normally using a phone or tablet in 99% of cases, this is not an issue). Setting Keyboard="Pl... |
51,552,712 | I am working in an angular 4 project ,In this I have a mega menu .What I want to do is when I clicked on a menu inside the mega menu I want to close it .
In my case it always open even after I clicked on a specific menu ,but closed if I remove the mouse focus in it .
Stackblitz : <https://stackblitz.com/edit/angular-... | 2018/07/27 | [
"https://Stackoverflow.com/questions/51552712",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9956391/"
] | Docker images are an [open and documented](https://github.com/opencontainers/image-spec) "application packaging" format. There are countless ways to inspect the image contents, including all of the python source code shipped inside of them.
Running applications inside of a container provides isolation from the applica... | Python programs are distributed as source code. If it can run on a client machine, then the code is readable on that machine. A docker container only contains the application and its libraries, external binaries and files, **not a full OS**. As the security can only be managed at OS level (or through encryption) and as... |
51,552,712 | I am working in an angular 4 project ,In this I have a mega menu .What I want to do is when I clicked on a menu inside the mega menu I want to close it .
In my case it always open even after I clicked on a specific menu ,but closed if I remove the mouse focus in it .
Stackblitz : <https://stackblitz.com/edit/angular-... | 2018/07/27 | [
"https://Stackoverflow.com/questions/51552712",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9956391/"
] | Python programs are distributed as source code. If it can run on a client machine, then the code is readable on that machine. A docker container only contains the application and its libraries, external binaries and files, **not a full OS**. As the security can only be managed at OS level (or through encryption) and as... | I think it could be a solution as using a "container" to protect our code from the person we wouldn't let them access. the problem is docker is not a secure container. As the root of the host machine has the most powerful control of the Docker container, we don't have any method to protect the root from accessing insid... |
51,552,712 | I am working in an angular 4 project ,In this I have a mega menu .What I want to do is when I clicked on a menu inside the mega menu I want to close it .
In my case it always open even after I clicked on a specific menu ,but closed if I remove the mouse focus in it .
Stackblitz : <https://stackblitz.com/edit/angular-... | 2018/07/27 | [
"https://Stackoverflow.com/questions/51552712",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9956391/"
] | Docker images are an [open and documented](https://github.com/opencontainers/image-spec) "application packaging" format. There are countless ways to inspect the image contents, including all of the python source code shipped inside of them.
Running applications inside of a container provides isolation from the applica... | I think it could be a solution as using a "container" to protect our code from the person we wouldn't let them access. the problem is docker is not a secure container. As the root of the host machine has the most powerful control of the Docker container, we don't have any method to protect the root from accessing insid... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.