qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
36,948,316 | I am just wondering if there is a way to simulate a "no connection" event in a mocha unit test. I have a method that return a promise that should wait for an internet connection with a polling strategy and I want to test it out with mocha. There is a method to achieve such a result.
Some code:
```
it('should wait for... | 2016/04/29 | [
"https://Stackoverflow.com/questions/36948316",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/803678/"
] | You can use `nock.disableNetConnect()`: <https://github.com/nock/nock#enabledisable-real-http-requests> | If you have no connection or any problems of connection, use the `reject()` of your promise and catch them. `done` is a function, and if you call the function with a non-null parameter, it means that your test is not good.
Maybe you have to try:
```
my_object.wait.connection()
.then(() => done(1))
.catch(() => don... |
36,948,316 | I am just wondering if there is a way to simulate a "no connection" event in a mocha unit test. I have a method that return a promise that should wait for an internet connection with a polling strategy and I want to test it out with mocha. There is a method to achieve such a result.
Some code:
```
it('should wait for... | 2016/04/29 | [
"https://Stackoverflow.com/questions/36948316",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/803678/"
] | You can use [sinon](http://sinonjs.org/) to stub `needle.get`
```
var needle = require("needle");
var sinon = require("sinon");;
before(() => {
sinon.stub(needle, "get", (url, calback) => {
var dummyError = {};
callback(dummyError);
})
});
// Run your 'it' here
after(() => {
needle.get.... | You can use `nock.disableNetConnect()`: <https://github.com/nock/nock#enabledisable-real-http-requests> |
69,431,410 | I've followed [Dynamic nested topnav menu](https://stackblitz.com/edit/dynamic-nested-topnav-menu?file=app%2Fapp.component.ts) to create a navigation bar.
It was working perfectly until that I've tried to add an icon to the parents menu by change the code iconName: 'close' to iconName: 'arrow\_circle\_down' for DevFes... | 2021/10/04 | [
"https://Stackoverflow.com/questions/69431410",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17068265/"
] | Let's split and join then
```js
const div = document.getElementById("text");
let str = div.textContent;
let arr = str.split(/ /)
console.log(arr)
const urls = ["www.stack.com/abc", "www.stack.com"];
arr.forEach((word,i) => {
const punctuation = word.match(/(\W$)/)
if (punctuation) word = word.slice(0,-1)
const ... | Although the solution provided by mplungjan is clever and works well, I wanted to post an alternative.
The algorithm from the accepted answer processes the input string into an array of words and then proceeds to iterate through every word on every URL. Then it needs to see if any word ends with a symbol, and truncate... |
3,666,833 | how to read information inside an excel sheet using C# code...... | 2010/09/08 | [
"https://Stackoverflow.com/questions/3666833",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/442238/"
] | You can either use Oledb
```
using System.Data;
using System.Data.OleDb;
OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Book1.xls;Extended Properties=Excel 8.0");
OleDbDataAdapter da = new OleDbDataAdapter("select * from MyObject", con);
DataTable dt = new DataTabl... | [**Programming with the C API in Excel 2010**](http://msdn.microsoft.com/en-us/library/bb687829.aspx) |
3,666,833 | how to read information inside an excel sheet using C# code...... | 2010/09/08 | [
"https://Stackoverflow.com/questions/3666833",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/442238/"
] | You can either use Oledb
```
using System.Data;
using System.Data.OleDb;
OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Book1.xls;Extended Properties=Excel 8.0");
OleDbDataAdapter da = new OleDbDataAdapter("select * from MyObject", con);
DataTable dt = new DataTabl... | If the data is tabular, use OleDB, otherwise you can use Automation to automate Excel and copy the values over to your app.
Or if it's the new XML format excel sheets you might be able to do it via the framework classes.
Info about Excel Automation: [How to: Use COM Interop to Create an Excel Spreadsheet](http://msdn... |
3,666,833 | how to read information inside an excel sheet using C# code...... | 2010/09/08 | [
"https://Stackoverflow.com/questions/3666833",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/442238/"
] | You can either use Oledb
```
using System.Data;
using System.Data.OleDb;
OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Book1.xls;Extended Properties=Excel 8.0");
OleDbDataAdapter da = new OleDbDataAdapter("select * from MyObject", con);
DataTable dt = new DataTabl... | Excel has an API for programming. You can use it to get range of data using c#. You can use something like:
```
Excel.Application oXL;
Excel._Workbook oWB;
Excel._Worksheet oSheet;
oSheet.get_Range(RangeStart,RangeEnd)
``` |
3,666,833 | how to read information inside an excel sheet using C# code...... | 2010/09/08 | [
"https://Stackoverflow.com/questions/3666833",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/442238/"
] | You can either use Oledb
```
using System.Data;
using System.Data.OleDb;
OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Book1.xls;Extended Properties=Excel 8.0");
OleDbDataAdapter da = new OleDbDataAdapter("select * from MyObject", con);
DataTable dt = new DataTabl... | [NPOI](http://npoi.codeplex.com/) is the way to go.
Using office interop requires that Office (and the right version) be installed on the machine your app is running on. If a web abb, that probably means no, and it's not robust enough for a production environment anyway. OLEDB has serious limitations, unless it's a on... |
3,666,833 | how to read information inside an excel sheet using C# code...... | 2010/09/08 | [
"https://Stackoverflow.com/questions/3666833",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/442238/"
] | You can either use Oledb
```
using System.Data;
using System.Data.OleDb;
OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Book1.xls;Extended Properties=Excel 8.0");
OleDbDataAdapter da = new OleDbDataAdapter("select * from MyObject", con);
DataTable dt = new DataTabl... | 1. Excel COM Interop - via Microsoft.Office.Interop.Excel + Microsoft.Office.Interop.Excel.Extensions
2. ADO.Net via OLEDB data provider for Excel.
3. Use of System.XML and/or Linq to XML and/or Open XML SDK (can also be used to create new books programmatically from scratch).
4. 3rd party library such as NPOI.
5. 3rd ... |
1,402,879 | How can I reduce sensitivity of the touchpad? It is way too big so when I type, the part of the palm that extends down from the thumb brushes the touchpad and I get all sorts of gestures I don't want like:
-highlight everything I am typing so far and delete
If anybody reading this has a choice between an Ideapad or Th... | 2022/04/17 | [
"https://askubuntu.com/questions/1402879",
"https://askubuntu.com",
"https://askubuntu.com/users/806813/"
] | You can use `synclient` to access your touchpad settings, assuming that you have the Synaptic drivers installed. Check out this question: <https://unix.stackexchange.com/questions/28306/looking-for-a-way-to-improve-synaptic-touchpad-palm-detection> | Tip: (i.e. Sensitivity 0)
Install and use
<https://github.com/atareao/Touchpad-Indicator>
... to disable the touchpad when you're not using it:
>
> Install from PPA
>
>
> sudo add-apt-repository ppa:atareao/atareao
>
> sudo apt update
>
> sudo apt install touchpad-indicator
>
>
>
Alternative: My As... |
31,655,737 | How will i change my json result from
```
["Published with github","ZA Publications","Apress","Really","Neal"]
```
To
```
[
{"Name" : "Published with github"},
{"Name" : "ZA Publications"},
{"Name" : "Apress"},
{"Name" : "Really"},
{"Name" : "Neal"}
]
```
correct me if i am wrong somewhere, if... | 2015/07/27 | [
"https://Stackoverflow.com/questions/31655737",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5160974/"
] | Store the font file somewhere on the server.
```
@font-face {
font-family: NAME;
src: url('/FILEPATH/FILENAME.ttf');
}
p {
font-family: NAME;
}
```
Browser Support: <http://www.w3schools.com/cssref/css3_pr_font-face_rule.asp>
EDIT: And, as Alex K. said, make sure you have a license if it's a commercial font. | Can't speak for FireFox but a more important fact is that the font must exist in an appropriate format on all machines viewing the page. If the font does not exist as an installed font it must be embedded in the page, something you need a license for if its a commercial font.
I would suggest browsing for something si... |
19,648,728 | I am trying to display the default image as the background of a iOS7 simulator, but its just white. It works on simulators that are older.
```
UIColor *image = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"Default.png"]];
self.view.backgroundColor = image;
``` | 2013/10/29 | [
"https://Stackoverflow.com/questions/19648728",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/280602/"
] | Figured it out!
`$deals = array_merge($account->deals->all(), $user->deals->all());`
Hope this helps someone out in the fugure | Collection object in laravel has method toArray() to represent collection of objects as multi-dimentional array (array of arrays). Try this:
```
$deals = $account->deals->toArray();
``` |
3,544,903 | I want to use log4j in my web application. I would like to configure log4j in such a way that when the file reaches a certain size, we start writing a new log files, making it easier to open and read.
Can you please explain the set up of `RollingFileAppender`? | 2010/08/23 | [
"https://Stackoverflow.com/questions/3544903",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/423620/"
] | [Lots of examples](http://magnus-k-karlsson.blogspot.com/2009/08/configure-log4j-dailyrollingfileappende.html) on the internet, e.g. this creates a daily rolling log file that rolls over to `log4jtest.log.2010-08-25` etc
```
# configure the root logger
log4j.rootLogger=INFO, DAILY
# configure the daily rolling file a... | If you're using XML configuration, you can use the following:
```
<appender name="MyFileAppender" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="my.log" />
<param name="Threshold" value="INFO" />
<param name="DatePattern" value="'.'yyyy-MM-dd" />
<layout class="org.apache.... |
32,094,670 | The problem splits into two parts.
How to check which working days are missing from my database, if some are missing then add them and fill the row with the values from the closest date.
First part, check and find the days. Should i use a gap approach like in the example below?
```
SELECT t1.col1 AS startOfGap, MIN(t... | 2015/08/19 | [
"https://Stackoverflow.com/questions/32094670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5002646/"
] | For these types of query you gain significant performance benefits from creating a calendar table containing every date you'll ever need to test. *(If you're familiar with the term "dimension tables", this is just one such table to enumerate every date of interest.)*
Also, the query as a whole can become significantly... | using recursive CTE we can generate date sequence:
[SQL Fiddle](http://sqlfiddle.com/#!3/27913/4)
**MS SQL Server 2008 Schema Setup**:
```
create table sample (date datetime, data money)
insert sample (date, data)
values
('2015-01-02', 0.2),
('2015-01-03', 0.3),
('2015-01-07', 0.4),
('2015-01-08', 0.5),
(... |
32,094,670 | The problem splits into two parts.
How to check which working days are missing from my database, if some are missing then add them and fill the row with the values from the closest date.
First part, check and find the days. Should i use a gap approach like in the example below?
```
SELECT t1.col1 AS startOfGap, MIN(t... | 2015/08/19 | [
"https://Stackoverflow.com/questions/32094670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5002646/"
] | For these types of query you gain significant performance benefits from creating a calendar table containing every date you'll ever need to test. *(If you're familiar with the term "dimension tables", this is just one such table to enumerate every date of interest.)*
Also, the query as a whole can become significantly... | As suggested by [Aaron Bertrand](https://stackoverflow.com/questions/21189369/better-way-to-generate-months-year-table) you can write a query as:
```
-- create a calendar table at run time if you don't have one:
DECLARE @FromDate DATETIME, @ToDate DATETIME;
SET @FromDate = (select min(Date) from test);
SET @ToDate =... |
32,094,670 | The problem splits into two parts.
How to check which working days are missing from my database, if some are missing then add them and fill the row with the values from the closest date.
First part, check and find the days. Should i use a gap approach like in the example below?
```
SELECT t1.col1 AS startOfGap, MIN(t... | 2015/08/19 | [
"https://Stackoverflow.com/questions/32094670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5002646/"
] | For these types of query you gain significant performance benefits from creating a calendar table containing every date you'll ever need to test. *(If you're familiar with the term "dimension tables", this is just one such table to enumerate every date of interest.)*
Also, the query as a whole can become significantly... | Use a Tally Table to generate all dates from `@startDate` to `@endDate`. Then with that, use a `LEFT JOIN` and `OUTER APPLY` to achieve the desired result:
[**SQL Fiddle**](http://sqlfiddle.com/#!3/da650/2/0)
```
;WITH E1(N) AS(
SELECT 1 FROM(VALUES (1),(1),(1),(1),(1),(1),(1),(1),(1),(1))t(N)
),
E2(N) AS(SELECT ... |
32,094,670 | The problem splits into two parts.
How to check which working days are missing from my database, if some are missing then add them and fill the row with the values from the closest date.
First part, check and find the days. Should i use a gap approach like in the example below?
```
SELECT t1.col1 AS startOfGap, MIN(t... | 2015/08/19 | [
"https://Stackoverflow.com/questions/32094670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5002646/"
] | As suggested by [Aaron Bertrand](https://stackoverflow.com/questions/21189369/better-way-to-generate-months-year-table) you can write a query as:
```
-- create a calendar table at run time if you don't have one:
DECLARE @FromDate DATETIME, @ToDate DATETIME;
SET @FromDate = (select min(Date) from test);
SET @ToDate =... | using recursive CTE we can generate date sequence:
[SQL Fiddle](http://sqlfiddle.com/#!3/27913/4)
**MS SQL Server 2008 Schema Setup**:
```
create table sample (date datetime, data money)
insert sample (date, data)
values
('2015-01-02', 0.2),
('2015-01-03', 0.3),
('2015-01-07', 0.4),
('2015-01-08', 0.5),
(... |
32,094,670 | The problem splits into two parts.
How to check which working days are missing from my database, if some are missing then add them and fill the row with the values from the closest date.
First part, check and find the days. Should i use a gap approach like in the example below?
```
SELECT t1.col1 AS startOfGap, MIN(t... | 2015/08/19 | [
"https://Stackoverflow.com/questions/32094670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5002646/"
] | Use a Tally Table to generate all dates from `@startDate` to `@endDate`. Then with that, use a `LEFT JOIN` and `OUTER APPLY` to achieve the desired result:
[**SQL Fiddle**](http://sqlfiddle.com/#!3/da650/2/0)
```
;WITH E1(N) AS(
SELECT 1 FROM(VALUES (1),(1),(1),(1),(1),(1),(1),(1),(1),(1))t(N)
),
E2(N) AS(SELECT ... | using recursive CTE we can generate date sequence:
[SQL Fiddle](http://sqlfiddle.com/#!3/27913/4)
**MS SQL Server 2008 Schema Setup**:
```
create table sample (date datetime, data money)
insert sample (date, data)
values
('2015-01-02', 0.2),
('2015-01-03', 0.3),
('2015-01-07', 0.4),
('2015-01-08', 0.5),
(... |
33,420,918 | I am trying to run my Django Application without Django admin panel because I don't need it right now but getting an exception value:
>
> Put 'django.contrib.admin' in your INSTALLED\_APPS setting in order to
> use the admin application.
>
>
>
Could I ran my application without `django.contrib.admin` ? Even if g... | 2015/10/29 | [
"https://Stackoverflow.com/questions/33420918",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4593743/"
] | `django.contrib.admin` is simply a Django app.
Remove or comment `django.contrib.admin` from `INSTALLED_APPS` in `settings.py` file.
Also remove or comment `from django.contrib import admin` from `admin.py'`,`urls.py` and all the files having this import statement.
Remove `url(r'^admin/', include(admin.site.urls)`... | I have resolved this issue.
I had `#url(r'^admin/', include(admin.site.urls)),` in my `urls.py` which I just commented out. |
18,065,894 | I am having trouble using `<include>` in conjunction with `<merge>`. I am developing on Eclipse with the latest Android SDK (4.3). Here is my sample code:
*test\_merge.xml*
```
<merge xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_pa... | 2013/08/05 | [
"https://Stackoverflow.com/questions/18065894",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2566395/"
] | When using `merge`, there is no parent to apply `100dp`s to. Try switching to `FrameLayout` instead of `merge` or (even better) in this case you may just remove `merge` and have `View` be the root.
**Edit:**
Change test\_merge.xml to:
```
<View xmlns:android="http://schemas.android.com/apk/res/android"
android:l... | Try making those attributes 0 in your included `layout`
```
<merge xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="0dp"
android:layout_height="0dp" >
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:background="#FFFF0000" >
<... |
75,786 | *Disclaimer: This does not do any justice on the rich topic of elliptic curves. It is simplified a lot. As elliptic curves recently got a lot of media attention in the context of encryption, I wanted to provide some small insight how "calculating" on an elliptic curve actually works.*
### Introduction
Elliptic curves... | 2016/03/18 | [
"https://codegolf.stackexchange.com/questions/75786",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/24877/"
] | Pyth, ~~105~~ 100 bytes
=======================
```
A,@Q3eQ?qGZH?qHZG?&=YqhHhGqeG%_eHhQZ_m%dhQ,-*J?Y*+*3^hG2@Q1^*2eG-hQ2*-eGeH^-hGhH-hQ2-hGK--^J2hGhHeGK
```
Input is expected as `(p, A, P, Q)`, where `P` and `Q` are the two points of the form `(x, y)` or, if they are the special `0` point, just as `0`. You can try i... | Python 3, ~~193~~ 191 bytes
===========================
A solution based on [Rhyzomatic's Pyth answer](https://codegolf.stackexchange.com/a/76113/47581) and their Python logic. In particular. I liked how they found the third root of a monic cubic polynomial `x^3 + bx^2 + cx + d` when you have two roots `x_1` and `x_2`... |
75,786 | *Disclaimer: This does not do any justice on the rich topic of elliptic curves. It is simplified a lot. As elliptic curves recently got a lot of media attention in the context of encryption, I wanted to provide some small insight how "calculating" on an elliptic curve actually works.*
### Introduction
Elliptic curves... | 2016/03/18 | [
"https://codegolf.stackexchange.com/questions/75786",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/24877/"
] | Pyth, ~~105~~ 100 bytes
=======================
```
A,@Q3eQ?qGZH?qHZG?&=YqhHhGqeG%_eHhQZ_m%dhQ,-*J?Y*+*3^hG2@Q1^*2eG-hQ2*-eGeH^-hGhH-hQ2-hGK--^J2hGhHeGK
```
Input is expected as `(p, A, P, Q)`, where `P` and `Q` are the two points of the form `(x, y)` or, if they are the special `0` point, just as `0`. You can try i... | [PARI/GP](https://pari.math.u-bordeaux.fr), 46 bytes
====================================================
```
f(a,b,p,P,Q)=elladd(ellinit(Mod([a,b],p)),P,Q)
```
[Attempt This Online!](https://ato.pxeger.com/run?1=ddFBasMwEAVQehORlQw_JWNhy14kNwikayGKWtfFIBIRnEXOkk26KD1TcppOZZfGQd2MpKeZ0YBOX8Htu-f3cD5_Hvp2Xl0eW-nwgoANn... |
75,786 | *Disclaimer: This does not do any justice on the rich topic of elliptic curves. It is simplified a lot. As elliptic curves recently got a lot of media attention in the context of encryption, I wanted to provide some small insight how "calculating" on an elliptic curve actually works.*
### Introduction
Elliptic curves... | 2016/03/18 | [
"https://codegolf.stackexchange.com/questions/75786",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/24877/"
] | Python 3, ~~193~~ 191 bytes
===========================
A solution based on [Rhyzomatic's Pyth answer](https://codegolf.stackexchange.com/a/76113/47581) and their Python logic. In particular. I liked how they found the third root of a monic cubic polynomial `x^3 + bx^2 + cx + d` when you have two roots `x_1` and `x_2`... | [PARI/GP](https://pari.math.u-bordeaux.fr), 46 bytes
====================================================
```
f(a,b,p,P,Q)=elladd(ellinit(Mod([a,b],p)),P,Q)
```
[Attempt This Online!](https://ato.pxeger.com/run?1=ddFBasMwEAVQehORlQw_JWNhy14kNwikayGKWtfFIBIRnEXOkk26KD1TcppOZZfGQd2MpKeZ0YBOX8Htu-f3cD5_Hvp2Xl0eW-nwgoANn... |
19,405,815 | I need to run a create table query, every time it takes more than one hour and a half and then it will show the error message like ora\_01652: unable to extend temp segment by 8192 in tablespace xyz, how can I fix it? | 2013/10/16 | [
"https://Stackoverflow.com/questions/19405815",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2770977/"
] | First, you may want to `alter session set resumable_timeout = 86400`. This will pause the query instead of letting it simply fail, giving you time to look at the situation while it's happening. As @davek mentioned, you may need to add space somewhere. And you need to figure out why it is using so much space.
Temporary... | Either your disk is full (or almost full) or you do not have permission to extend the relevant tablespace. |
4,291,040 | This question originally comes from the following problem:
>
> Let $ABC$ be a triangle with integer side lengths with $\angle ABC = 60^{\circ}$. Suppose length $\overline{AB}$ and $\overline{BC}$ are prime numbers. Determine and prove what kind of triangle $ABC$ is.
>
>
>
I suspect $ABC$ must be an isosceles tria... | 2021/10/29 | [
"https://math.stackexchange.com/questions/4291040",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/824408/"
] | Your expression is $(p-q)^2+pq$. Suppose that was $N^2$ for some natural number $N$.
Without loss of generality, suppose that $p>q$.
Starting with $$N^2-(p-q)^2=pq$$ we deduce that $$(N-(p-q))(N+(p-q))=pq$$
Now, it is not possible for $N-(p-q)$ to be $1$ since that would entail $2(p-q)+1=pq$ and the left hand is les... | Multiply given equation with $4$. Then we have $$4c^2 = (2q-p)^2+3p^2$$ and thus $$(2c-2q+p)(2c+2q-p)=3p^2$$
Now you don't have a lot of cases...
>
> $$2c+2q-p\in\{1,3,p,3p,p^2,3p^2\}$$
>
>
> |
4,291,040 | This question originally comes from the following problem:
>
> Let $ABC$ be a triangle with integer side lengths with $\angle ABC = 60^{\circ}$. Suppose length $\overline{AB}$ and $\overline{BC}$ are prime numbers. Determine and prove what kind of triangle $ABC$ is.
>
>
>
I suspect $ABC$ must be an isosceles tria... | 2021/10/29 | [
"https://math.stackexchange.com/questions/4291040",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/824408/"
] | Multiply given equation with $4$. Then we have $$4c^2 = (2q-p)^2+3p^2$$ and thus $$(2c-2q+p)(2c+2q-p)=3p^2$$
Now you don't have a lot of cases...
>
> $$2c+2q-p\in\{1,3,p,3p,p^2,3p^2\}$$
>
>
> | We have: $$(p-q)^2<p^2-pq+q^2<(p+q)^2.$$
If $p>q>0$ and $p^2-pq+q^2=c^2,$ for $c>0,$ then then $q^2\equiv c^2\pmod p,$ so $$c\equiv \pm q\pmod p$$ Now, since $0<p-q< c<p+q,$ this means our options are $c=q$ or $c=2p-q.$ In both cases, $c$ is in the range only if $p<2q.$
If $c=q,$ then $p^2-qp=0,$ so $p=0$ or $p=q.$
... |
4,291,040 | This question originally comes from the following problem:
>
> Let $ABC$ be a triangle with integer side lengths with $\angle ABC = 60^{\circ}$. Suppose length $\overline{AB}$ and $\overline{BC}$ are prime numbers. Determine and prove what kind of triangle $ABC$ is.
>
>
>
I suspect $ABC$ must be an isosceles tria... | 2021/10/29 | [
"https://math.stackexchange.com/questions/4291040",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/824408/"
] | Your expression is $(p-q)^2+pq$. Suppose that was $N^2$ for some natural number $N$.
Without loss of generality, suppose that $p>q$.
Starting with $$N^2-(p-q)^2=pq$$ we deduce that $$(N-(p-q))(N+(p-q))=pq$$
Now, it is not possible for $N-(p-q)$ to be $1$ since that would entail $2(p-q)+1=pq$ and the left hand is les... | We have: $$(p-q)^2<p^2-pq+q^2<(p+q)^2.$$
If $p>q>0$ and $p^2-pq+q^2=c^2,$ for $c>0,$ then then $q^2\equiv c^2\pmod p,$ so $$c\equiv \pm q\pmod p$$ Now, since $0<p-q< c<p+q,$ this means our options are $c=q$ or $c=2p-q.$ In both cases, $c$ is in the range only if $p<2q.$
If $c=q,$ then $p^2-qp=0,$ so $p=0$ or $p=q.$
... |
11,330,147 | I want to use my `DataGridView` only to show things, and I want the user not to be able to select any row, field or anything from the `DataGridView`.
How can I do this? | 2012/07/04 | [
"https://Stackoverflow.com/questions/11330147",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1471381/"
] | I fixed this by setting the `Enabled` property to `false`. | I liked user4101525's answer best in theory but it doesn't actually work.
Selection is not an overlay so you see whatever is under the control
Ramgy Borja's answer doesn't deal with the fact that default style is not actually a color at all so applying it doesn't help.
This handles the default style and works if apply... |
11,330,147 | I want to use my `DataGridView` only to show things, and I want the user not to be able to select any row, field or anything from the `DataGridView`.
How can I do this? | 2012/07/04 | [
"https://Stackoverflow.com/questions/11330147",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1471381/"
] | `Enabled` property to `false`
or
```
this.dataGridView1.DefaultCellStyle.SelectionBackColor = this.dataGridView1.DefaultCellStyle.BackColor;
this.dataGridView1.DefaultCellStyle.SelectionForeColor = this.dataGridView1.DefaultCellStyle.ForeColor;
``` | This worked for me like a charm:
```
row.DataGridView.Enabled = false;
row.DefaultCellStyle.BackColor = Color.LightGray;
row.DefaultCellStyle.ForeColor = Color.DarkGray;
```
(where row = DataGridView.NewRow(appropriate overloads);) |
11,330,147 | I want to use my `DataGridView` only to show things, and I want the user not to be able to select any row, field or anything from the `DataGridView`.
How can I do this? | 2012/07/04 | [
"https://Stackoverflow.com/questions/11330147",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1471381/"
] | I found setting all `AllowUser...` properties to `false`, `ReadOnly` to `true`, `RowHeadersVisible` to `false`, `ScollBars` to `None`, then [faking the prevention of selection](https://stackoverflow.com/questions/1745272/disable-cell-highlighting-in-a-datagridview#1745295) worked best for me. Not setting `Enabled` to `... | Use the [`DataGridView.ReadOnly` property](http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.readonly.aspx)
The code in the [MSDN example](http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.readonly.aspx) illustrates the use of this property in a `DataGridView` control **... |
11,330,147 | I want to use my `DataGridView` only to show things, and I want the user not to be able to select any row, field or anything from the `DataGridView`.
How can I do this? | 2012/07/04 | [
"https://Stackoverflow.com/questions/11330147",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1471381/"
] | This worked for me like a charm:
```
row.DataGridView.Enabled = false;
row.DefaultCellStyle.BackColor = Color.LightGray;
row.DefaultCellStyle.ForeColor = Color.DarkGray;
```
(where row = DataGridView.NewRow(appropriate overloads);) | I found setting all `AllowUser...` properties to `false`, `ReadOnly` to `true`, `RowHeadersVisible` to `false`, `ScollBars` to `None`, then [faking the prevention of selection](https://stackoverflow.com/questions/1745272/disable-cell-highlighting-in-a-datagridview#1745295) worked best for me. Not setting `Enabled` to `... |
11,330,147 | I want to use my `DataGridView` only to show things, and I want the user not to be able to select any row, field or anything from the `DataGridView`.
How can I do this? | 2012/07/04 | [
"https://Stackoverflow.com/questions/11330147",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1471381/"
] | I'd go with this:
```
private void myDataGridView_SelectionChanged(Object sender, EventArgs e)
{
dgvSomeDataGridView.ClearSelection();
}
```
I don't agree with the broad assertion that no `DataGridView` should be unselectable. Some UIs are built for tools or touchsreens, and allowing a selection misleads the u... | I found setting all `AllowUser...` properties to `false`, `ReadOnly` to `true`, `RowHeadersVisible` to `false`, `ScollBars` to `None`, then [faking the prevention of selection](https://stackoverflow.com/questions/1745272/disable-cell-highlighting-in-a-datagridview#1745295) worked best for me. Not setting `Enabled` to `... |
11,330,147 | I want to use my `DataGridView` only to show things, and I want the user not to be able to select any row, field or anything from the `DataGridView`.
How can I do this? | 2012/07/04 | [
"https://Stackoverflow.com/questions/11330147",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1471381/"
] | I'd go with this:
```
private void myDataGridView_SelectionChanged(Object sender, EventArgs e)
{
dgvSomeDataGridView.ClearSelection();
}
```
I don't agree with the broad assertion that no `DataGridView` should be unselectable. Some UIs are built for tools or touchsreens, and allowing a selection misleads the u... | Its in VB, but shouldnt be difficult to translate to C#:
If you want to lock datagridview, use `dg.ReadOnly == True;`
If you want to prevent user from selecting another row, just remember old selection and based on condition set or not set the row which shall be selected. Assuming, that multiselection is turned off:
... |
11,330,147 | I want to use my `DataGridView` only to show things, and I want the user not to be able to select any row, field or anything from the `DataGridView`.
How can I do this? | 2012/07/04 | [
"https://Stackoverflow.com/questions/11330147",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1471381/"
] | This worked for me like a charm:
```
row.DataGridView.Enabled = false;
row.DefaultCellStyle.BackColor = Color.LightGray;
row.DefaultCellStyle.ForeColor = Color.DarkGray;
```
(where row = DataGridView.NewRow(appropriate overloads);) | I liked user4101525's answer best in theory but it doesn't actually work.
Selection is not an overlay so you see whatever is under the control
Ramgy Borja's answer doesn't deal with the fact that default style is not actually a color at all so applying it doesn't help.
This handles the default style and works if apply... |
11,330,147 | I want to use my `DataGridView` only to show things, and I want the user not to be able to select any row, field or anything from the `DataGridView`.
How can I do this? | 2012/07/04 | [
"https://Stackoverflow.com/questions/11330147",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1471381/"
] | If you don't need to use the information in the selected cell then clearing selection works but if you need to still use the information in the selected cell you can do this to make it appear there is no selection and the back color will still be visible.
```
private void dataGridView_SelectionChanged(object sender, E... | Its in VB, but shouldnt be difficult to translate to C#:
If you want to lock datagridview, use `dg.ReadOnly == True;`
If you want to prevent user from selecting another row, just remember old selection and based on condition set or not set the row which shall be selected. Assuming, that multiselection is turned off:
... |
11,330,147 | I want to use my `DataGridView` only to show things, and I want the user not to be able to select any row, field or anything from the `DataGridView`.
How can I do this? | 2012/07/04 | [
"https://Stackoverflow.com/questions/11330147",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1471381/"
] | `Enabled` property to `false`
or
```
this.dataGridView1.DefaultCellStyle.SelectionBackColor = this.dataGridView1.DefaultCellStyle.BackColor;
this.dataGridView1.DefaultCellStyle.SelectionForeColor = this.dataGridView1.DefaultCellStyle.ForeColor;
``` | Its in VB, but shouldnt be difficult to translate to C#:
If you want to lock datagridview, use `dg.ReadOnly == True;`
If you want to prevent user from selecting another row, just remember old selection and based on condition set or not set the row which shall be selected. Assuming, that multiselection is turned off:
... |
11,330,147 | I want to use my `DataGridView` only to show things, and I want the user not to be able to select any row, field or anything from the `DataGridView`.
How can I do this? | 2012/07/04 | [
"https://Stackoverflow.com/questions/11330147",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1471381/"
] | Here's what has always worked for me to disable the default selection in a class inherited from DataGridView:
```
// REQUIRES: SelectionMode = DataGridViewSelectionMode.FullRowSelect
protected override void SetSelectedRowCore(int rowIndex, bool selected)
{
base.SetSelectedRowCore(rowIndex, selected && ALLOW... | Use the [`DataGridView.ReadOnly` property](http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.readonly.aspx)
The code in the [MSDN example](http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.readonly.aspx) illustrates the use of this property in a `DataGridView` control **... |
728,925 | Trying to install Windows 2012 R2 on a new ProLiant server using Intelligent Provisioning.
Using SSA I created a RAID 5 array.
IP wants to install the OS on the full drive, I want to create a 150GB partition to install the OS on and use the rest as a data volume.
I can't find anywhere in IP either in tools or the OS... | 2015/10/14 | [
"https://serverfault.com/questions/728925",
"https://serverfault.com",
"https://serverfault.com/users/81603/"
] | Use the **HP Smart Storage Administrator** utility from the Intelligent Provisioning "Maintenance" menu.
Delete your logical drive. Create a Logical drive of the size and RAID level you wish. I don't recommend RAID5, but feel free to do that. Make the size 150GB.
From there, create a new logical drive to fill the re... | RAID5 is fine for SAS 10k/15k drives just not for SATA especially from HP with their terrible 1yr warranty policy (compared to DELL/Lenovo/manufacturer wrty). But, all that aside Intelligent provision is messed up in gen10 servers. So within the array mgmt software make the logical volume 150GB ish and then run the win... |
2,248,950 | I have need to communicate between two iframes of the same domain, which live inside a parent page on a different domain that I have no control over.
This is a Facebook app and the basic layout is this
apps.facebook.com/myapp
L iframe1 (src='mysite.com/foo')
L iframe2 (src='mysite.com/bar')
I need frame1 to... | 2010/02/12 | [
"https://Stackoverflow.com/questions/2248950",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Did you try using [HTML5 web messaging](http://dev.opera.com/articles/view/window-postmessage-messagechannel/). It is quite well supported currently by recent versions of browsers.
```
iframe.contentWindow.postMessage('Your message','http://mysite.com');
```
The `postMessage` property will need the origin `http://my... | Generally no. Same Origin Policy denies you the possibility of communicating upwards to the parent, which would be necessary to then step downwards to the other frame. This is true in any browser.
If the parent document has given your frame-to-be-contacted a unique `name`, there is a limited form of communication poss... |
2,248,950 | I have need to communicate between two iframes of the same domain, which live inside a parent page on a different domain that I have no control over.
This is a Facebook app and the basic layout is this
apps.facebook.com/myapp
L iframe1 (src='mysite.com/foo')
L iframe2 (src='mysite.com/bar')
I need frame1 to... | 2010/02/12 | [
"https://Stackoverflow.com/questions/2248950",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Did you try using [HTML5 web messaging](http://dev.opera.com/articles/view/window-postmessage-messagechannel/). It is quite well supported currently by recent versions of browsers.
```
iframe.contentWindow.postMessage('Your message','http://mysite.com');
```
The `postMessage` property will need the origin `http://my... | As others have said, use `window.postMessage`. But instead of using `window.parent.frames['frame2']`, try `window.parent.frames[x]` where *x* is the position in the node list of the other iframe.
You can see an example of doing this across origins here: <http://webinista.s3.amazonaws.com/postmessage> |
264,873 | Reading the blog of Sean Carroll (I recognize he isn't the only voice) has made me more sympathetic to the notion of many worlds, but reading Susskind (also not the only voice) has made me think that time-reversibility is important.
I understand that collapse theories aren't reversible, but I've been wondering about ... | 2016/06/27 | [
"https://physics.stackexchange.com/questions/264873",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/121846/"
] | Yes, the many-worlds interpretation is supposed to be time symmetric.
Consider this toy example with a particle than can be in either of the states $\left|1\right\rangle$ or $\left|2\right\rangle$. Additionally, we denote the no particle state as $\left|0\right\rangle$.
The particle gets emitted by our source $S$ tha... | The MWI interprets quantum physics roughly as follows:
1. Everything everywhere and at all times evolves via Schrodinger's equation.
2. What constitutes physical reality, and is described by quantum physics, is not so much a set of things as a set of correlations.
An example of item 2 here is given by entangled state... |
34,293,165 | I have oracle user defined types and tables which has these types as columns. I am trying to insert simple data into a table that has user defined type column. But i get invalid identifier error. I found a way to insert successfully. But i need simple method for this. Or maybe i did something wrong while creating the t... | 2015/12/15 | [
"https://Stackoverflow.com/questions/34293165",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5585923/"
] | You can use syntax similar to the following:
```
insert into schema.table1(recordid, typedata)
values ( 1, schema.a_type('aaaa','bbbbb'));
```
The thing to remember is that to insert the object type data you need to use the object constructor. You can extend that to other forms of the insert statement as well:
```
... | I have created an example for:
* create multi level user defined types
* insert into a table with these types
* how to find the path for the attributes of types
* select without variable
* you can find a picture attached with the structure of the types.
---
```
create or replace type place_type as object
(city varch... |
29,468,656 | I'm new to Yii2 Framework and just configured Yii2 Advance application.
Now I want to configure [adminLTE](http://almsaeedstudio.com/AdminLTE/) theme in my Yii2 Advance application without using the Composer. Somehow Composer is not getting installed on my machine.
Ref: <http://www.yiiframework.com/wiki/729/tutorial-... | 2015/04/06 | [
"https://Stackoverflow.com/questions/29468656",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1197047/"
] | 1) Go to <https://github.com/almasaeed2010/AdminLTE/releases> and download last version.
2) Create folder `bower` in `vendor` path. And in `bower` create new folder `admin-lte` again.
3) Extract archive from first step to `/vendor/bower/admin-lte`.
4) Change your `AppAsset` (it is location in `backend/assets` folder... | Embeding admin lte theme i yii2 basic
1) create yii project using composer
sudo du
cd /var/www/html
composer create-project yiisoft/yii2-app-basic basic 2.0.4
2)now create it accessible
chmod 777 -R project name
3) download admin lte theme by using
git clone <https://github.com/bmsrox/baseapp-yii2basic-adminlt... |
23,285,753 | In one of MVA videos i saw next construction:
```
static void Main(string[] args)
{
Action testAction = async () =>
{
Console.WriteLine("In");
await Task.Delay(100);
Console.WriteLine("After first delay");
await Task.Delay(100);
Console.WriteLine("After second delay");
... | 2014/04/25 | [
"https://Stackoverflow.com/questions/23285753",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1017161/"
] | In order for something to be awaited, it has to be **awaitable**. As `void` is not so, you cannot await on any `Action` delegate.
An awaitable is any type that implements a `GetAwaiter` method, which returns a type that implements either `INotifyCompletion` or `ICriticalNotifyCompletion`, like `Task` and `Task<T>`, fo... | "Async void is for top-level event-handlers only",
<https://learn.microsoft.com/en-us/shows/three-essential-tips-for-async/tip-1-async-void-top-level-event-handlers-only> |
23,285,753 | In one of MVA videos i saw next construction:
```
static void Main(string[] args)
{
Action testAction = async () =>
{
Console.WriteLine("In");
await Task.Delay(100);
Console.WriteLine("After first delay");
await Task.Delay(100);
Console.WriteLine("After second delay");
... | 2014/04/25 | [
"https://Stackoverflow.com/questions/23285753",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1017161/"
] | "Async void is for top-level event-handlers only",
<https://learn.microsoft.com/en-us/shows/three-essential-tips-for-async/tip-1-async-void-top-level-event-handlers-only> | Recently I found that NUnit able to `await` `async void`tests. Here is good description how it works: [How does nunit successfully wait for async void methods to complete?](https://stackoverflow.com/questions/15031681/how-does-nunit-successfully-wait-for-async-void-methods-to-complete)
You won't use it in regular task... |
23,285,753 | In one of MVA videos i saw next construction:
```
static void Main(string[] args)
{
Action testAction = async () =>
{
Console.WriteLine("In");
await Task.Delay(100);
Console.WriteLine("After first delay");
await Task.Delay(100);
Console.WriteLine("After second delay");
... | 2014/04/25 | [
"https://Stackoverflow.com/questions/23285753",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1017161/"
] | In order for something to be awaited, it has to be **awaitable**. As `void` is not so, you cannot await on any `Action` delegate.
An awaitable is any type that implements a `GetAwaiter` method, which returns a type that implements either `INotifyCompletion` or `ICriticalNotifyCompletion`, like `Task` and `Task<T>`, fo... | Recently I found that NUnit able to `await` `async void`tests. Here is good description how it works: [How does nunit successfully wait for async void methods to complete?](https://stackoverflow.com/questions/15031681/how-does-nunit-successfully-wait-for-async-void-methods-to-complete)
You won't use it in regular task... |
27,226,606 | I have a scenario where I need to construct a powershell path as `$RemotePath = '$($env:USERPROFILE)\Desktop\Shell.lnk'`. This variable gets passed to a remote machine where it needs to be executed. The remote machine receives this as a string variable. How do I expand the string to evaluate `$env:USERPROFILE`? | 2014/12/01 | [
"https://Stackoverflow.com/questions/27226606",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/928228/"
] | [Expand the string](https://stackoverflow.com/a/4836913/1630171) on the remote side:
```
$ExecutionContext.InvokeCommand.ExpandString($RemotePath)
``` | By using a double quotes. PowerShell won't expand variables inside single-quoted strings. |
34,820,941 | Am having a hard time trying to figure why I cannot get the images here to change color on hover. The images themselves are svg files and should just adopt the color. The code:
HTML:
```
<div class="toolTile col-md-3">
<a href="#/cards">
<img src="ppt/assets/toolIcons/requestnewcard.svg" >
<p>Mana... | 2016/01/15 | [
"https://Stackoverflow.com/questions/34820941",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1840365/"
] | I'm speaking for Linux here, not sure about Windows.
Environment variables don't work that way. They are a part of the process (which is what you modify by changing os.environ), and they will propagate to child processes of your process (and their children obviously). They are in-memory only, and there is no way to "s... | The standard way to 'persist' an environment variable is with a configuration file. Write your application to open the configuration file and set every NAME=VARIABLE pair that it finds. Optionally this step could be done in a wrapper startup script.
If you wish to 'save' the state of a variable, you need to open the c... |
48,769,880 | I want to use the `for` loops with iterators while using maps and want to run it for a specified range not from `begin()` end `end()`. I would want to use it for a range like from 3rd element to 5th element | 2018/02/13 | [
"https://Stackoverflow.com/questions/48769880",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9145917/"
] | >
> I would want to use it for a range like from 3rd element to 5th
> element
>
>
>
Since `std::map`'s iterator is not a `RandomAccessIterator`, but only a `BidirectionalIterator` (you cannot write `.begin() + 3`), you can use `std::next` for this purpose:
```
for (auto it = std::next(m.begin(), 2); it != std::n... | This code should be pretty optimal and safe for corner cases:
```
int count = 0;
for( auto it = m.begin(); it != m.end(); ++it ) {
if( ++count <= 3 ) continue;
if( count > 5 ) break;
// use iterator
}
```
but the fact you are iterating an `std::map` this way shows most probably you are using a wrong cont... |
214,948 | I am using either a chromium or firefox web browser in kiosk mode to log in to a website from boot up, and I want to use a javascript to send in a command to login to a website automatically. I know how to write the javascript, but I do not know how to "pipe" the javascript into the web browser from a terminal bash fil... | 2015/07/09 | [
"https://unix.stackexchange.com/questions/214948",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/119638/"
] | In OS X you can use AppleScript to run JavaScript in Chrome:
`xj(){ osascript -e'on run{a}' -e'tell app"google chrome"to tell active tab of window 1 to execute javascript a' -eend "$1"; }`
Firefox does not support AppleScript. | I am not sure Firefox is capable of doing what you want here even though there are [lots of command line options](https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#-app_.2Fpath.2Fto.2Fapplication.ini) for launching Firefox from a script.
Chrome has [even more options](http://peter.sh/experiments/ch... |
130,842 | When interviewing with a company where all the interviewers have lower educational backgrounds from lower ranking schools than the interviewee, should the interviewee appear modest, weaker and reserve (not show off) part of his/her repertoire? The reason behind is that employers might prefer hiring people less or as sm... | 2019/03/05 | [
"https://workplace.stackexchange.com/questions/130842",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/100877/"
] | The candidate should behave reasonably, regardless of the interviewers.
Think about this: how should Einstein behave during a job interview? Of course, almost everybody on Earth would look stupid by comparison, regardless of University degrees.
By "reasonably" I mean:
* be polite and civilized;
* answer the answers ... | Copying the manners of the people you are talking to is actually a pretty neat psychological trick to make yourself appear more likeable. People generally like people more when they are similar to them. This is called [mirroring](https://en.wikipedia.org/wiki/Mirroring_(psychology)). And besides, nobody likes arrogant ... |
130,842 | When interviewing with a company where all the interviewers have lower educational backgrounds from lower ranking schools than the interviewee, should the interviewee appear modest, weaker and reserve (not show off) part of his/her repertoire? The reason behind is that employers might prefer hiring people less or as sm... | 2019/03/05 | [
"https://workplace.stackexchange.com/questions/130842",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/100877/"
] | Here's something you probably haven't realized yet:
1 year in the workforce is equivalent to about 3 years in college. You divide your attention in college. You are given problems that the answers to are already known (unless you're pursuing doctoral / PHD degrees), and there is far less "on the line" than in a real j... | While you don't want to appear arrogant or a "show-off" there's no reason to appear weaker or less intelligent/capable then you actually are.
I *always* want to hire the best person for the job, regardless of their relative intelligence vis a vis myself, in fact hiring people smarter than yourself is what we call "go... |
130,842 | When interviewing with a company where all the interviewers have lower educational backgrounds from lower ranking schools than the interviewee, should the interviewee appear modest, weaker and reserve (not show off) part of his/her repertoire? The reason behind is that employers might prefer hiring people less or as sm... | 2019/03/05 | [
"https://workplace.stackexchange.com/questions/130842",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/100877/"
] | Other answers have pointed out that the educational background detail is loaded with naive assumptions, but putting that aside and addressing your core question: Should you purposefully make yourself appear less capable in order to get hired somewhere where you suspect your hiring manager(s) *won't* hire somebody more ... | >
> As the saying goes, those who are neither the smartest nor too bad get
> a job.
>
>
>
Where does that saying come from? I've never heard it. I've never seen anyone acting according to it. Now it is of course possible that someone is very smart but has problems that make them hard to employ, but in general the... |
130,842 | When interviewing with a company where all the interviewers have lower educational backgrounds from lower ranking schools than the interviewee, should the interviewee appear modest, weaker and reserve (not show off) part of his/her repertoire? The reason behind is that employers might prefer hiring people less or as sm... | 2019/03/05 | [
"https://workplace.stackexchange.com/questions/130842",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/100877/"
] | Sell yourself as who you are. No more, no less, because your actual credentials will come out during the course of employment. If you misled the people you will be working with, you will not do well on the job. | I have seen the hiring process quite a few times from both sides (first hand and second hand). In general you don't need to worry about appearing too smart/capable, as long as it avoids rubbing people the wrong way on a personal level. If you appear arrogant, or completely unable to connect with the people that are hir... |
130,842 | When interviewing with a company where all the interviewers have lower educational backgrounds from lower ranking schools than the interviewee, should the interviewee appear modest, weaker and reserve (not show off) part of his/her repertoire? The reason behind is that employers might prefer hiring people less or as sm... | 2019/03/05 | [
"https://workplace.stackexchange.com/questions/130842",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/100877/"
] | The candidate should behave reasonably, regardless of the interviewers.
Think about this: how should Einstein behave during a job interview? Of course, almost everybody on Earth would look stupid by comparison, regardless of University degrees.
By "reasonably" I mean:
* be polite and civilized;
* answer the answers ... | >
> As the saying goes, those who are neither the smartest nor too bad get
> a job.
>
>
>
Where does that saying come from? I've never heard it. I've never seen anyone acting according to it. Now it is of course possible that someone is very smart but has problems that make them hard to employ, but in general the... |
130,842 | When interviewing with a company where all the interviewers have lower educational backgrounds from lower ranking schools than the interviewee, should the interviewee appear modest, weaker and reserve (not show off) part of his/her repertoire? The reason behind is that employers might prefer hiring people less or as sm... | 2019/03/05 | [
"https://workplace.stackexchange.com/questions/130842",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/100877/"
] | A good life lesson is, **don't make assumptions.**
I'm saying this because **your question is rife with them:**
* You're assuming that you know the educational background of everyone at the table.
* You're assuming that educational background is an indicator of smartness.
* You're assuming that the person who appear... | The candidate should behave reasonably, regardless of the interviewers.
Think about this: how should Einstein behave during a job interview? Of course, almost everybody on Earth would look stupid by comparison, regardless of University degrees.
By "reasonably" I mean:
* be polite and civilized;
* answer the answers ... |
130,842 | When interviewing with a company where all the interviewers have lower educational backgrounds from lower ranking schools than the interviewee, should the interviewee appear modest, weaker and reserve (not show off) part of his/her repertoire? The reason behind is that employers might prefer hiring people less or as sm... | 2019/03/05 | [
"https://workplace.stackexchange.com/questions/130842",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/100877/"
] | Here's something you probably haven't realized yet:
1 year in the workforce is equivalent to about 3 years in college. You divide your attention in college. You are given problems that the answers to are already known (unless you're pursuing doctoral / PHD degrees), and there is far less "on the line" than in a real j... | >
> As the saying goes, those who are neither the smartest nor too bad get
> a job.
>
>
>
Where does that saying come from? I've never heard it. I've never seen anyone acting according to it. Now it is of course possible that someone is very smart but has problems that make them hard to employ, but in general the... |
130,842 | When interviewing with a company where all the interviewers have lower educational backgrounds from lower ranking schools than the interviewee, should the interviewee appear modest, weaker and reserve (not show off) part of his/her repertoire? The reason behind is that employers might prefer hiring people less or as sm... | 2019/03/05 | [
"https://workplace.stackexchange.com/questions/130842",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/100877/"
] | The candidate should behave reasonably, regardless of the interviewers.
Think about this: how should Einstein behave during a job interview? Of course, almost everybody on Earth would look stupid by comparison, regardless of University degrees.
By "reasonably" I mean:
* be polite and civilized;
* answer the answers ... | I agree that employers might prefer hiring people less or as smart people as they are.
*I think that the answer depends on what **really** you want.*
Are you over-educated for that job? And, despite this, do you really want that job?
I have been in this situation, and I tried to reserve part of my repertoire. But, ... |
130,842 | When interviewing with a company where all the interviewers have lower educational backgrounds from lower ranking schools than the interviewee, should the interviewee appear modest, weaker and reserve (not show off) part of his/her repertoire? The reason behind is that employers might prefer hiring people less or as sm... | 2019/03/05 | [
"https://workplace.stackexchange.com/questions/130842",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/100877/"
] | A good life lesson is, **don't make assumptions.**
I'm saying this because **your question is rife with them:**
* You're assuming that you know the educational background of everyone at the table.
* You're assuming that educational background is an indicator of smartness.
* You're assuming that the person who appear... | Sell yourself as who you are. No more, no less, because your actual credentials will come out during the course of employment. If you misled the people you will be working with, you will not do well on the job. |
130,842 | When interviewing with a company where all the interviewers have lower educational backgrounds from lower ranking schools than the interviewee, should the interviewee appear modest, weaker and reserve (not show off) part of his/her repertoire? The reason behind is that employers might prefer hiring people less or as sm... | 2019/03/05 | [
"https://workplace.stackexchange.com/questions/130842",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/100877/"
] | >
> *When interviewing with a company where all the interviewers have lower educational backgrounds from lower ranking schools than the interviewee,*
>
>
>
Wait, hang on. While this is a common assumption that reputed schools produce good grades, it does not necessarily imply that the second or third-tier schools ... | This question makes assumptions that are worth being picked apart in detail.
First, if the company wanted to hire people stupider than themselves, and believed that the quality of school was a proxy for how smart the applicant is, and that the school on the transcript was a school smart people go to, ***they wouldn’t ... |
449,656 | How can I move files from user account to another in OS X 10.6.8?
Every time I attempt access another users contents eg images, music, and the like. It keeps telling I don't have permission to view the contents.
What do I do to move the files from one user account to another? | 2012/07/16 | [
"https://superuser.com/questions/449656",
"https://superuser.com",
"https://superuser.com/users/19082/"
] | >
> According to [Vintage Technology](http://www.vintage-technology.info/pages/calculators/keys/buttons.htm), both buttons are a way to clear or cancel an entry. The C button will clear all input to the calculator. The CE button clears the most recent entry, so if you make a mistake in a long computation, you don't ne... | CE means "Clear entry"
it just clears the last number typed into the display
C means "Clear" (more)
It clears the display and any partial calculation.
Example:
you enter 25 + 3
If you hit CE, it erases the 3, but remembers you were adding something to 25.
You can now enter 8 and =, and you'll see 33.
If you hit C, i... |
2,565,646 | >
> Let $f$ be defined by:
>
>
> $f(x)= \frac{x-\lfloor x\rfloor}{\sqrt x}$
>
>
> 1. Prove that $f$ is bounded in $\mathbb{R+}$
>
>
>
I have no idea where to start, I can see by graphing it [here (desmos)](https://www.desmos.com/calculator/6xrf5kqvhw) that it is bounded by $0$ and $1$, but here we are not pres... | 2017/12/13 | [
"https://math.stackexchange.com/questions/2565646",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/279667/"
] | Hints:
* for all $\,x \in \mathbb{R}^+\,$ you have $0 \le x - \lfloor x \rfloor \lt 1\,$, so $\,0 \le f(x) \lt \frac{1}{\sqrt{x}}$
* for $x \in (0,1)\,$ you have $\,\lfloor x \rfloor = 0\,$, so $\;f(x) = \sqrt{x} \lt 1$ | To prove that a function is bounded you need to **use inequalities**.
Note that
>
> $$x\in(0,1) \quad f(x)= \frac{x-\lfloor x\rfloor}{\sqrt x}\leq\frac{1}{\sqrt x}$$
>
>
> $$\forall x\geq 0 \quad f(x)= \frac{x}{\sqrt x}={\sqrt x}\leq1$$
>
>
>
$\implies$ $\forall x \in \mathbb{R^+}$ **f is bounded**. |
899,159 | My computer (a modern one, with Windows 8.1) is equipped with a DVD drive and a SD card reader. I'm considering assigning letters A and B to DVD and card reader. I know well that those letters **were** reserved for floppy disk drives (I'm old enough to remember the floppy disks era), but I am 99.99% sure that I will ne... | 2015/04/08 | [
"https://superuser.com/questions/899159",
"https://superuser.com",
"https://superuser.com/users/-1/"
] | As @Fazer87 mentioned, it's perfectly OK to use these drive letters, and you can use Disk Manager to reassign them.
There is one benefit to using these drive letters that is not commonly known and that may be useful in some circumstances. Generally Windows likes to assign the same drive letter to removable drives upon... | There is nothing wrong with using A and B drive letters at all. I personally use A: and B: on my 8.1 and 7 PCs as mapped drives.. **A** being **A**ll-my-stuff and **B**: being **B**ackup-Target (on a second nas)
If Windows will let you do it, there's no reason not to.
You can always use disk manager to reassign them ... |
2,171,568 | I have a doubt regarding HttpServlet class is an abstract class even though there is not any abstract method in the class , all methods are concrete.
Can class be abstract even if does not have any abstract methods? If yes Whats the use?
Thanks | 2010/01/31 | [
"https://Stackoverflow.com/questions/2171568",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/240698/"
] | One cannot instantiate abstract classes so you have to subclass them in order to use it.
In the subclass you can still implement your own methods or override parent methods.
Maybe it doesn't make sense to use `HttpServlet` as standalone, but it provides necessary default functionality in a certain context. You can ... | It's a matter of intent. If the class is abstract, you can't create an instance of that class - only of a subclass.
I'm not strong on Java, but my guess is that HttpServlet provides default implementations of it's methods, but that you're expected to override some of them. It still makes little sense to have an unspec... |
2,171,568 | I have a doubt regarding HttpServlet class is an abstract class even though there is not any abstract method in the class , all methods are concrete.
Can class be abstract even if does not have any abstract methods? If yes Whats the use?
Thanks | 2010/01/31 | [
"https://Stackoverflow.com/questions/2171568",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/240698/"
] | One cannot instantiate abstract classes so you have to subclass them in order to use it.
In the subclass you can still implement your own methods or override parent methods.
Maybe it doesn't make sense to use `HttpServlet` as standalone, but it provides necessary default functionality in a certain context. You can ... | Marking a class as an abstract even when there is a concrete implementation for all methods would be helpful in cases where you are not sure if the class design is complete or there are chances that you plan to add some methods later. Changing a class that has been declared abstract to be made not abstract later doesn'... |
2,171,568 | I have a doubt regarding HttpServlet class is an abstract class even though there is not any abstract method in the class , all methods are concrete.
Can class be abstract even if does not have any abstract methods? If yes Whats the use?
Thanks | 2010/01/31 | [
"https://Stackoverflow.com/questions/2171568",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/240698/"
] | In the case of `HttpServlet`, the point is that servlet programmers typically don't want their servlet to support all 4 oft the main HTTP methods (POST, GET, PUT, DELETE), so it would be annoying to make the `doGet()`, `doPost()`, etc. methods abstract, since programmers would be forced to implement methods that they d... | One cannot instantiate abstract classes so you have to subclass them in order to use it.
In the subclass you can still implement your own methods or override parent methods.
Maybe it doesn't make sense to use `HttpServlet` as standalone, but it provides necessary default functionality in a certain context. You can ... |
2,171,568 | I have a doubt regarding HttpServlet class is an abstract class even though there is not any abstract method in the class , all methods are concrete.
Can class be abstract even if does not have any abstract methods? If yes Whats the use?
Thanks | 2010/01/31 | [
"https://Stackoverflow.com/questions/2171568",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/240698/"
] | In the case of `HttpServlet`, the point is that servlet programmers typically don't want their servlet to support all 4 oft the main HTTP methods (POST, GET, PUT, DELETE), so it would be annoying to make the `doGet()`, `doPost()`, etc. methods abstract, since programmers would be forced to implement methods that they d... | It's a matter of intent. If the class is abstract, you can't create an instance of that class - only of a subclass.
I'm not strong on Java, but my guess is that HttpServlet provides default implementations of it's methods, but that you're expected to override some of them. It still makes little sense to have an unspec... |
2,171,568 | I have a doubt regarding HttpServlet class is an abstract class even though there is not any abstract method in the class , all methods are concrete.
Can class be abstract even if does not have any abstract methods? If yes Whats the use?
Thanks | 2010/01/31 | [
"https://Stackoverflow.com/questions/2171568",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/240698/"
] | In the case of `HttpServlet`, the point is that servlet programmers typically don't want their servlet to support all 4 oft the main HTTP methods (POST, GET, PUT, DELETE), so it would be annoying to make the `doGet()`, `doPost()`, etc. methods abstract, since programmers would be forced to implement methods that they d... | Marking a class as an abstract even when there is a concrete implementation for all methods would be helpful in cases where you are not sure if the class design is complete or there are chances that you plan to add some methods later. Changing a class that has been declared abstract to be made not abstract later doesn'... |
10,486 | I am a 3D printing beginner but wanted to get stuck in straight away and design my own 3D objects. I used Sketchup to design a badge of one of my logos. I make sure that all faces of my object are not inside out and show a white face in Sketchup. I also make my entire object a component before exporting into a .stl fil... | 2019/07/04 | [
"https://3dprinting.stackexchange.com/questions/10486",
"https://3dprinting.stackexchange.com",
"https://3dprinting.stackexchange.com/users/16947/"
] | A red surface coloring is normal for the bottom when viewed in Ultimaker Cura, nothing to worry about that (e.i. when that face is touching the build plate; if it is unsupported, you should add support structures but a raft is generally not necessary for PLA).
Rafts are useful when you print high temperature materials... | Note: This answer is curently wrong because I mentally reversed your "with raft" and "without raft" columns. I'll attempt to fix it soon.
This doesn't look like a problem with your model, but rather a problem with your bed height or slicer settings (possibly both) that may be affecting your particular model worse than... |
12,112 | Hi I'm trying to use this plugin: <http://wordpress.org/extend/plugins/wordpress-simple-website-screenshot/>
I am supposed to use the shortcode: `[screenshot url="www.example.com"]`
Because I am writing the code in the single.php file I am using:
`<?php echo do_shortcode( '[screenshot url="www.example.com"]' ); ?>... | 2011/03/15 | [
"https://wordpress.stackexchange.com/questions/12112",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/2188/"
] | You're trying to execute PHP inside a string! Instead, concat the string;
```
<?php echo do_shortcode( '[screenshot url="' . get_the_title() . '"]' ); ?>
``` | Your problem is that `<?php the_title(); ?>` inside quotation marks doesn't really works
change:
```
<?php echo do_shortcode( '[screenshot url="<?php the_title(); ?>"]' ); ?>
```
to :
```
<?php echo do_shortcode( '[screenshot url="'.the_title().'"]' ); ?>
``` |
67,528,971 | I am trying to login to this website using my credentials. However, although I'm providing what they have in their html, it's not working
Currently, I have
```
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
CHROMEDRIVER_PATH = './chromedriver'
chrome_options = Options()
chrome_... | 2021/05/14 | [
"https://Stackoverflow.com/questions/67528971",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15846416/"
] | This problem can be solved with the help of explicit wait. See the code below :
```
driver = webdriver.Chrome("C:\\Users\\etc\\Desktop\\Selenium+Python\\chromedriver.exe", options=options)
wait = WebDriverWait(driver, 30)
driver.get("https://www.seekingalpha.com/login")
wait.until(EC.element_to_be_clickable((By.NAME, ... | Maybe you need to wait after going to the URL for the element to appear, instead of trying immediately to identify it. You could add it like this:
```
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
# ... |
67,528,971 | I am trying to login to this website using my credentials. However, although I'm providing what they have in their html, it's not working
Currently, I have
```
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
CHROMEDRIVER_PATH = './chromedriver'
chrome_options = Options()
chrome_... | 2021/05/14 | [
"https://Stackoverflow.com/questions/67528971",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15846416/"
] | This problem can be solved with the help of explicit wait. See the code below :
```
driver = webdriver.Chrome("C:\\Users\\etc\\Desktop\\Selenium+Python\\chromedriver.exe", options=options)
wait = WebDriverWait(driver, 30)
driver.get("https://www.seekingalpha.com/login")
wait.until(EC.element_to_be_clickable((By.NAME, ... | It's absolutely clear from the code you showing that you are missing wait / delay between
```
driver.get("https://www.seekingalpha.com/login")
```
and the
```
driver.get("https://www.seekingalpha.com/login")
```
lines. So, you can simply add
```
time.sleep(3)
```
there or if you wish to make it properly use so... |
61,966,245 | Suppose I have a JavaScript script named `foo.js` in a GitHub repo. I need to know what sites (domains) are using this script. Thus, for instance, if a website `www.example.com` is referencing my script...
```
<html>
<head>
<script src="https://myGitHubRepo/foo.js"></script>
</head>
etc...
</html>
```
I'd ... | 2020/05/23 | [
"https://Stackoverflow.com/questions/61966245",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12273078/"
] | Without addressing the legal aspect, you could ~~embed [PAT (Personal Access Key)](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) in your script~~, which would enable said script to make GitHub API calls.
Typically: "[Create or update a file (`PUT /rep... | Don't do it. Telemetry is tricky - and people will opt to not use your script.
Also without "place" to gather this information you cannot do it on github.
You can try leveraging "code" search engines like:
<https://publicwww.com/>
<https://www.nerdydata.com/>
and similars |
39,152,949 | everybody. I've the following issue, when someone makes a new pull request and I leave certain comments, if this someone, does update the pull request, TFS instead of moving my comments with the code changes, it is left on the line number, rather than the code snippet.
If someone knows how this to be fixed, as it cause... | 2016/08/25 | [
"https://Stackoverflow.com/questions/39152949",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6758583/"
] | Thanks for reporting this issue.
This is a new feature that is only available in TFS 15 RC1 and VSTS. Older servers do not have this feature. This feature is called comment tracking and it is mentioned in the release notes [here](https://www.visualstudio.com/en-us/news/2016-jul-7-vso.aspx). | When you click to add a comment as the screenshot below, you would be able to add a comment for a line of code:
[](https://i.stack.imgur.com/E70dm.png)
Then you'll see your comment under the line:
[:
def f1(self):
return 'f1'
def f2(self, x):
return 'f2' + str(x)
class B(A):
def f3(self):
# Call f1 method work fine
self.y = self... | 2019/08/28 | [
"https://Stackoverflow.com/questions/57693907",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11392333/"
] | You should enclose your scripts on a `<script>` tag:
```
<head>
<script>
var calendar = $('#calendar').fullCalendar({
editable:true,
header:{
left:'prev,next today',
center:'title',
right:'month,agendaWeek,agendaDay'
},
... | Instead of 'select', try using 'dateClick' event when you click on an empty date cell, or 'eventClick' when you click on an event -perhaps you'd like to edit it. |
74,666,392 | New to C here, I am creating an insert function that will insert any value to an array provided I give the position of the array.
For example, here is what I have tried:
```
#include <stdio.h>
#include <stdlib.h>
int insert(int A[], int N, int P, int KEY){
int i = N - 1;
while(i >= P){
A[i+1] = A[i]... | 2022/12/03 | [
"https://Stackoverflow.com/questions/74666392",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19136165/"
] | Try to add the mock to your `global` in your `setupTest.js` file:
```
global.TagCanvas = {
Start: () => "this is the mocked implementation"
}
``` | Thanks to Marek response I have it now working.
It also worked if I do this global definition inside the `beforeAll` process.
[](https://i.stack.imgur.com/rEbYj.png)
I haven't jest configured to read the `setupTest.js` file. Since I am working in ne... |
25,129,119 | I'm trying to change the background color of each of the segments of a polar chart. It's easy to set a singular color for the background, but is it possible to set a different color for each piece of the polar pie?
An example would be 8 different colors for the chart segments below:
<http://www.highcharts.com/demo/po... | 2014/08/04 | [
"https://Stackoverflow.com/questions/25129119",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3847081/"
] | To my knowledge there is no easy way to do this within the API.
I'll present a solution that utilizes the `chart.renderer` to draw a single color for each slice of your polar chart:
```
var colors = [ "pink", "yellow", "blue", "red", "green", "cyan", "teal", "indigo" ];
var parts = 8;
for(var i = 0; i < parts; i... | You can add a fake column series with differently colored points and set yAxis.maxPadding to 0:
```
chart: {
polar: true,
events: {
load: function() {
var chart = this,
max = chart.yAxis[0].max;
chart.addSeries({
type: 'column',
data: [{
y: max,
color: 'rgba(255, 255, 0, 0.2... |
17,867 | Generically speaking, how would you handle a huge 2D Map of which only a part is displayed? Imagine the old top-down racing games like [Micro Machines](http://www.youtube.com/watch?v=UvtRClROoiY).
I would know how to do something with a tile-based map, but I want to create completely custom Maps.
Target Devices are i... | 2011/09/29 | [
"https://gamedev.stackexchange.com/questions/17867",
"https://gamedev.stackexchange.com",
"https://gamedev.stackexchange.com/users/849/"
] | In a map that is built from tiles, I have given a fairly full explanation of the approach I've found to work best down on the low end devices:
[How should I represent a tile in OpenGL-es](https://gamedev.stackexchange.com/questions/17488/how-should-i-represent-a-tile-in-opengl-es/17490#17490)
Memory is the memory use... | If you're not making use of tiles, but draw your entire map by hand, just split it into pieces - or tiles (-8
You need to experiment a bit with tile sizes,to balance constant loading/unloading of tiles (when tiles are small) and using more memory (when tiles are large). For example, on iPhone4 with 960x640 resolution,... |
28,673 | What is the difference between responding with "*Alaikum Salaam/علیکم السلام*" and responding with "*Walaikum Salaam/وعلیکم السلام*"? Is it wrong to say "*Alaikum Salaam*" in reply to "*Assalamu Alaikum*"? | 2015/11/16 | [
"https://islam.stackexchange.com/questions/28673",
"https://islam.stackexchange.com",
"https://islam.stackexchange.com/users/14755/"
] | Well you can answer:
Alaikum as-salam عليكم السلام
or
wa alaikum as-salam وعليكم السلام
Both are perfectly fine and good answers!
Also available are the singular forms:
* 'alaika as-salam عليك السلام
and
* wa 'alaika as-salam [وعليك السلام](http://sunnah.com/adab/42/71)
and also to repeat with the same word
* 'al... | **In the name of Allah, the most compassionate, the most merciful**
Briefly speaking, typically, the first person who intends to say hello (as a greeting), he or she says:
* Assalamu Alaikum/Alaik
But the second one who want to reply to his or her Salam, tells:
* Alaikum/Alaika Salam (which demonstrates being the s... |
28,157,387 | ```
#grid-breadcrumbs-Focus-ST{
...
}
#grid-breadcrumbs-F-150-EcoBoost{
...
}
#grid-breadcrumbs-Mustang-EcoBoost{
...
}
#grid-breadcrumbs-fiesta{
...
}
```
All of these are extremely similar differing only in the background image that is projected. Is there a way to simply? | 2015/01/26 | [
"https://Stackoverflow.com/questions/28157387",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4271904/"
] | You can offset all the same attributes into a CSS class.
CSS:
```
.myClass{
//your css
}
```
HTML:
```
<div class="myClass"></div>
<div class="myClass"></div>
<div class="myClass"></div>
``` | ```
.class{
#blah
}
#Focus-ST{
background-image: url("img1.png");
}
#fiesta{
background-image: url("img2.png");
}
```
and so on.
group all the same attributes in that .class |
28,157,387 | ```
#grid-breadcrumbs-Focus-ST{
...
}
#grid-breadcrumbs-F-150-EcoBoost{
...
}
#grid-breadcrumbs-Mustang-EcoBoost{
...
}
#grid-breadcrumbs-fiesta{
...
}
```
All of these are extremely similar differing only in the background image that is projected. Is there a way to simply? | 2015/01/26 | [
"https://Stackoverflow.com/questions/28157387",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4271904/"
] | Use attribute start with selector:
```
[id^="grid-breadcrumbs"]{
/* Represents an element with an attribute name of attr
and whose value is prefixed by "value".*/
}
```
More on [attribute selector](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors) | ```
.class{
#blah
}
#Focus-ST{
background-image: url("img1.png");
}
#fiesta{
background-image: url("img2.png");
}
```
and so on.
group all the same attributes in that .class |
28,157,387 | ```
#grid-breadcrumbs-Focus-ST{
...
}
#grid-breadcrumbs-F-150-EcoBoost{
...
}
#grid-breadcrumbs-Mustang-EcoBoost{
...
}
#grid-breadcrumbs-fiesta{
...
}
```
All of these are extremely similar differing only in the background image that is projected. Is there a way to simply? | 2015/01/26 | [
"https://Stackoverflow.com/questions/28157387",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4271904/"
] | For example you could do something like this:
```
.grid-breadcrumbs{/*common properties here*/}
.grid-breadcrumbs .focus-st{/*different properties for each case here*/}
.grid-breadcrumbs .f-150-EcoBoost{}
.grid-breadcrumbs .Mustang-EcoBoost{}
.grid-breadcrumbs .fiesta{}
```
Your html will be something like this:
``... | ```
.class{
#blah
}
#Focus-ST{
background-image: url("img1.png");
}
#fiesta{
background-image: url("img2.png");
}
```
and so on.
group all the same attributes in that .class |
98,983 | I have a problem that I don't really know how to solve (I mean, I know how to solve it in an ugly way but I'd prefer a cool one :))
Premise: I'm using Unitymedia, a German Internet, TV and phone (the last two over internet) provider. They sent me the Horizon HD[1], a big box which does everything. Data connection is m... | 2016/09/09 | [
"https://diy.stackexchange.com/questions/98983",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/59898/"
] | Rather than use WiFi, you can use a specific transmission system. These are known as videosenders or digisenders. I use a German made system for sending the signal from my Sky satellite box to the television in the bedroom.
They are available in the 2.4GHz and 5GHz bands. For the HD that you require I suggest that you... | **The general solution**
Get two pieces of hardware:
1. A standard wifi router
2. A wifi extender with an ethernet port (I like the Netgear N300)
This is fairly cost effective and it gets you a few multi-tasking tools. The wifi router gives you wireless internet throughout your home. The extender acts as a wireless-... |
9,414,990 | I have 3 classes:
```
public class Alpha {
public Number number;
}
public class Beta extends Alpha {
public String number;
}
public class Gama extends Beta {
public int number;
}
```
Why does the following code compile? And, why does the test pass without any runtime errors?
```
@Test
public void test... | 2012/02/23 | [
"https://Stackoverflow.com/questions/9414990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/526836/"
] | Member variables cannot be overridden like methods. The `number` variables in your classes `Beta` and `Gama` are **hiding** (not overriding) the member variable `number` of the superclass.
By casting you can access the hidden member in the superclass. | Fields can't be *overridden*; they're not accessed polymorphically in the first place - you're just declaring a new field in each case.
It compiles because in each case the compile-time type of the expression is enough to determine *which* field called `number` you mean.
In real-world programming, you would avoid thi... |
9,414,990 | I have 3 classes:
```
public class Alpha {
public Number number;
}
public class Beta extends Alpha {
public String number;
}
public class Gama extends Beta {
public int number;
}
```
Why does the following code compile? And, why does the test pass without any runtime errors?
```
@Test
public void test... | 2012/02/23 | [
"https://Stackoverflow.com/questions/9414990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/526836/"
] | Fields can't be *overridden*; they're not accessed polymorphically in the first place - you're just declaring a new field in each case.
It compiles because in each case the compile-time type of the expression is enough to determine *which* field called `number` you mean.
In real-world programming, you would avoid thi... | **Java Hiding a field**
When successor has a **field** with the same **name** as a superclass's field it is called - **Hiding a field**
Java's field does not support polymorphism and does not take a field's type into account
```
class A {
String field = "A: field";
String foo() {
return "A: foo()";
... |
9,414,990 | I have 3 classes:
```
public class Alpha {
public Number number;
}
public class Beta extends Alpha {
public String number;
}
public class Gama extends Beta {
public int number;
}
```
Why does the following code compile? And, why does the test pass without any runtime errors?
```
@Test
public void test... | 2012/02/23 | [
"https://Stackoverflow.com/questions/9414990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/526836/"
] | Fields can't be *overridden*; they're not accessed polymorphically in the first place - you're just declaring a new field in each case.
It compiles because in each case the compile-time type of the expression is enough to determine *which* field called `number` you mean.
In real-world programming, you would avoid thi... | As a workaround, you can use getter methods:
```
class A {
private String field = "A: field";
String getField() {
return field;
}
}
class B extends A {
private String field = "B: field";
@Override
String getField() {
return field;
}
}
``` |
9,414,990 | I have 3 classes:
```
public class Alpha {
public Number number;
}
public class Beta extends Alpha {
public String number;
}
public class Gama extends Beta {
public int number;
}
```
Why does the following code compile? And, why does the test pass without any runtime errors?
```
@Test
public void test... | 2012/02/23 | [
"https://Stackoverflow.com/questions/9414990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/526836/"
] | Member variables cannot be overridden like methods. The `number` variables in your classes `Beta` and `Gama` are **hiding** (not overriding) the member variable `number` of the superclass.
By casting you can access the hidden member in the superclass. | **Java Hiding a field**
When successor has a **field** with the same **name** as a superclass's field it is called - **Hiding a field**
Java's field does not support polymorphism and does not take a field's type into account
```
class A {
String field = "A: field";
String foo() {
return "A: foo()";
... |
9,414,990 | I have 3 classes:
```
public class Alpha {
public Number number;
}
public class Beta extends Alpha {
public String number;
}
public class Gama extends Beta {
public int number;
}
```
Why does the following code compile? And, why does the test pass without any runtime errors?
```
@Test
public void test... | 2012/02/23 | [
"https://Stackoverflow.com/questions/9414990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/526836/"
] | Member variables cannot be overridden like methods. The `number` variables in your classes `Beta` and `Gama` are **hiding** (not overriding) the member variable `number` of the superclass.
By casting you can access the hidden member in the superclass. | As a workaround, you can use getter methods:
```
class A {
private String field = "A: field";
String getField() {
return field;
}
}
class B extends A {
private String field = "B: field";
@Override
String getField() {
return field;
}
}
``` |
11,175,575 | I'm wondering why C99 allows conversions between incompatible pointer types:
```
void f(int* p)
{
}
void c(char* p)
{
f(p);
}
```
Does C11 also allow them? Are conforming implementations required to diagnose such conversions? | 2012/06/24 | [
"https://Stackoverflow.com/questions/11175575",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1477730/"
] | C99 doesn't permit implicit conversion between pointers of different types (except to/from `void*`). here's what the C99 Rationale says:
>
> It is invalid to convert a pointer to an object of any type to a pointer to an object of a different type without an explicit cast.
>
>
>
This is a consequence of the rules... | There is no such thing as "incompatible" pointer types.
The beauty of C is that it allows the programmer to do what they want. It is up to the programmer to decide what is compatible vs. incompatible. Other languages that claim to force "`class`" or "`type`" cohesion do so in a limited way. The moment that the object... |
31,073,005 | I am little bit new at AutoLayout.I know already tons of question and tutorial available regarding this autoLayout but I have not found my solution.So Thanks in advance for any help.
What is my requirement?
I have to make UIView which will come to screen after pressing a button from the bottom side of the screen with... | 2015/06/26 | [
"https://Stackoverflow.com/questions/31073005",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1275581/"
] | try to use size constraints as outlets. Then you can easy change values of those constraints. It's not really recommended to modify frame when using auto-layout.
declare a property:
```
@property (strong, nonatomic) IBOutlet NSLayoutConstraint *heightConstraint;
```
and in the implementation:
```
heightConstraint ... | i suggest you to add constraints programmatically
1. First, set your `translatesAutoresizingMaskIntoConstraints` to `NO`
```
containerView = [[SharingPickerView alloc] init];
containerView.translatesAutoresizingMaskIntoConstraints = NO;
[containerView loadingMenus:pickerData];
[self.view addSubview:containerView];
`... |
31,073,005 | I am little bit new at AutoLayout.I know already tons of question and tutorial available regarding this autoLayout but I have not found my solution.So Thanks in advance for any help.
What is my requirement?
I have to make UIView which will come to screen after pressing a button from the bottom side of the screen with... | 2015/06/26 | [
"https://Stackoverflow.com/questions/31073005",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1275581/"
] | try to use size constraints as outlets. Then you can easy change values of those constraints. It's not really recommended to modify frame when using auto-layout.
declare a property:
```
@property (strong, nonatomic) IBOutlet NSLayoutConstraint *heightConstraint;
```
and in the implementation:
```
heightConstraint ... | This answer <https://stackoverflow.com/a/26040569/2654425> may be very helpul as it deals with a similar situation. |
31,073,005 | I am little bit new at AutoLayout.I know already tons of question and tutorial available regarding this autoLayout but I have not found my solution.So Thanks in advance for any help.
What is my requirement?
I have to make UIView which will come to screen after pressing a button from the bottom side of the screen with... | 2015/06/26 | [
"https://Stackoverflow.com/questions/31073005",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1275581/"
] | You shouldn't reframe if you are using `NSAutoLayout`.
1. You have to install a constraint at bottom of the screen with the scroll and the view parent. Remember set translatesAutoresizingMaskIntoConstraints to NO when you instance the custom view.

... | i suggest you to add constraints programmatically
1. First, set your `translatesAutoresizingMaskIntoConstraints` to `NO`
```
containerView = [[SharingPickerView alloc] init];
containerView.translatesAutoresizingMaskIntoConstraints = NO;
[containerView loadingMenus:pickerData];
[self.view addSubview:containerView];
`... |
31,073,005 | I am little bit new at AutoLayout.I know already tons of question and tutorial available regarding this autoLayout but I have not found my solution.So Thanks in advance for any help.
What is my requirement?
I have to make UIView which will come to screen after pressing a button from the bottom side of the screen with... | 2015/06/26 | [
"https://Stackoverflow.com/questions/31073005",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1275581/"
] | You shouldn't reframe if you are using `NSAutoLayout`.
1. You have to install a constraint at bottom of the screen with the scroll and the view parent. Remember set translatesAutoresizingMaskIntoConstraints to NO when you instance the custom view.

... | This answer <https://stackoverflow.com/a/26040569/2654425> may be very helpul as it deals with a similar situation. |
33,721,429 | I know how to pass a simple function as parameter to another function - but how do I pass "nested" functions? I'm trying to do something like this:
```
def do(func):
print (func(6))
def a(x):
return x*2
def b(x):
return x*3
do(a(b))
``` | 2015/11/15 | [
"https://Stackoverflow.com/questions/33721429",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4129091/"
] | Using function composition approach:
```
def compose(f, g):
return lambda x: f(g(x))
def do(func):
print (func(6))
def a(x):
return x*2
def b(x):
return x*3
combinedAB = compose(a,b)
do(combinedAB)
``` | Well the main problem here is that `do(a(b))` will pass the function `b` in the `a` and result in a `TypeError`.
The main issue here is that whatever you pass to function `do` *has to be a callable* or else the `print(func(6))` statement will fail for the appropriate reasons (lack of a `__call__` method) so I don't t... |
16,353,729 | I have some problems with the Pandas apply function, when using multiple columns with the following dataframe
```
df = DataFrame ({'a' : np.random.randn(6),
'b' : ['foo', 'bar'] * 3,
'c' : np.random.randn(6)})
```
and the following function
```
def my_test(a, b):
return a % b
... | 2013/05/03 | [
"https://Stackoverflow.com/questions/16353729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2331506/"
] | All of the suggestions above work, but if you want your computations to by more efficient, you should take advantage of numpy vector operations [(as pointed out here)](https://engineering.upside.com/a-beginners-guide-to-optimizing-pandas-code-for-speed-c09ef2c6a4d6).
```
import pandas as pd
import numpy as np
df = pd... | I have given the comparison of all three discussed above.
**Using values**
```
%timeit df['value'] = df['a'].values % df['c'].values
```
139 µs ± 1.91 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)
**Without values**
```
%timeit df['value'] = df['a']%df['c']
```
216 µs ± 1.86 µs per loop (mean ± st... |
16,353,729 | I have some problems with the Pandas apply function, when using multiple columns with the following dataframe
```
df = DataFrame ({'a' : np.random.randn(6),
'b' : ['foo', 'bar'] * 3,
'c' : np.random.randn(6)})
```
and the following function
```
def my_test(a, b):
return a % b
... | 2013/05/03 | [
"https://Stackoverflow.com/questions/16353729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2331506/"
] | Let's say we want to apply a function add5 to columns 'a' and 'b' of DataFrame df
```
def add5(x):
return x+5
df[['a', 'b']].apply(add5)
``` | This is same as the previous solution but I have defined the function in df.apply itself:
```
df['Value'] = df.apply(lambda row: row['a']%row['c'], axis=1)
``` |
16,353,729 | I have some problems with the Pandas apply function, when using multiple columns with the following dataframe
```
df = DataFrame ({'a' : np.random.randn(6),
'b' : ['foo', 'bar'] * 3,
'c' : np.random.randn(6)})
```
and the following function
```
def my_test(a, b):
return a % b
... | 2013/05/03 | [
"https://Stackoverflow.com/questions/16353729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2331506/"
] | Seems you forgot the `''` of your string.
```
In [43]: df['Value'] = df.apply(lambda row: my_test(row['a'], row['c']), axis=1)
In [44]: df
Out[44]:
a b c Value
0 -1.674308 foo 0.343801 0.044698
1 -2.163236 bar -2.046438 -0.116798
2 -0.199115 foo -0... | All of the suggestions above work, but if you want your computations to by more efficient, you should take advantage of numpy vector operations [(as pointed out here)](https://engineering.upside.com/a-beginners-guide-to-optimizing-pandas-code-for-speed-c09ef2c6a4d6).
```
import pandas as pd
import numpy as np
df = pd... |
16,353,729 | I have some problems with the Pandas apply function, when using multiple columns with the following dataframe
```
df = DataFrame ({'a' : np.random.randn(6),
'b' : ['foo', 'bar'] * 3,
'c' : np.random.randn(6)})
```
and the following function
```
def my_test(a, b):
return a % b
... | 2013/05/03 | [
"https://Stackoverflow.com/questions/16353729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2331506/"
] | All of the suggestions above work, but if you want your computations to by more efficient, you should take advantage of numpy vector operations [(as pointed out here)](https://engineering.upside.com/a-beginners-guide-to-optimizing-pandas-code-for-speed-c09ef2c6a4d6).
```
import pandas as pd
import numpy as np
df = pd... | This is same as the previous solution but I have defined the function in df.apply itself:
```
df['Value'] = df.apply(lambda row: row['a']%row['c'], axis=1)
``` |
16,353,729 | I have some problems with the Pandas apply function, when using multiple columns with the following dataframe
```
df = DataFrame ({'a' : np.random.randn(6),
'b' : ['foo', 'bar'] * 3,
'c' : np.random.randn(6)})
```
and the following function
```
def my_test(a, b):
return a % b
... | 2013/05/03 | [
"https://Stackoverflow.com/questions/16353729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2331506/"
] | If you just want to compute (column a) % (column b), you don't need `apply`, just do it directly:
```
In [7]: df['a'] % df['c']
Out[7]:
0 -1.132022 ... | Let's say we want to apply a function add5 to columns 'a' and 'b' of DataFrame df
```
def add5(x):
return x+5
df[['a', 'b']].apply(add5)
``` |
16,353,729 | I have some problems with the Pandas apply function, when using multiple columns with the following dataframe
```
df = DataFrame ({'a' : np.random.randn(6),
'b' : ['foo', 'bar'] * 3,
'c' : np.random.randn(6)})
```
and the following function
```
def my_test(a, b):
return a % b
... | 2013/05/03 | [
"https://Stackoverflow.com/questions/16353729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2331506/"
] | If you just want to compute (column a) % (column b), you don't need `apply`, just do it directly:
```
In [7]: df['a'] % df['c']
Out[7]:
0 -1.132022 ... | This is same as the previous solution but I have defined the function in df.apply itself:
```
df['Value'] = df.apply(lambda row: row['a']%row['c'], axis=1)
``` |
16,353,729 | I have some problems with the Pandas apply function, when using multiple columns with the following dataframe
```
df = DataFrame ({'a' : np.random.randn(6),
'b' : ['foo', 'bar'] * 3,
'c' : np.random.randn(6)})
```
and the following function
```
def my_test(a, b):
return a % b
... | 2013/05/03 | [
"https://Stackoverflow.com/questions/16353729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2331506/"
] | Let's say we want to apply a function add5 to columns 'a' and 'b' of DataFrame df
```
def add5(x):
return x+5
df[['a', 'b']].apply(add5)
``` | I have given the comparison of all three discussed above.
**Using values**
```
%timeit df['value'] = df['a'].values % df['c'].values
```
139 µs ± 1.91 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)
**Without values**
```
%timeit df['value'] = df['a']%df['c']
```
216 µs ± 1.86 µs per loop (mean ± st... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.