qid int64 20 74.4M | question stringlengths 36 16.3k | date stringlengths 10 10 | metadata listlengths 3 3 | response_j stringlengths 33 24k | response_k stringlengths 33 23k |
|---|---|---|---|---|---|
51,786 | I got excited about Calc's power as an embedded mode. Define some variables in natural inline notation and then do operations on them.
But the execution seems a bit messy: you got a separate key bindings when you're in CalcEmbed mode and mistakes are easy to make.
Can the mode be tamed so that the following org-mode... | 2019/07/23 | [
"https://emacs.stackexchange.com/questions/51786",
"https://emacs.stackexchange.com",
"https://emacs.stackexchange.com/users/318/"
] | Maybe not a single keystroke but you could *activate* embedded mode via `C-x * a` and then (while point is in, say, the first expression) *update* all calc expressions with `C-x * u`. I use embedded mode all the time and it's one of the most understated features of Emacs! | To expand on @éric's answer: you can avoid having to activate the formulas explicitly with `C-x * a` by including these lines:
```
--- Local Variables: ---
--- eval:(calc-embedded-activate) ---
--- End: ---
```
In an org-mode file, using just `#` instead of `---` is probably better though. Also notice that this and ... |
28,640,427 | I have table in mysqli database now i want to get 1 result random
This is code mysql
```
$cid = $_GET['id'];
$ans = $db->query("select * from result where cat_id='$cid' limit 1");
$rowans = $ans->fetch_object();
echo"
<h4>".$rowans->title."</h4><br>
<img src='".$rowans->img."' style='width:400px;height:300;' />
<p>... | 2015/02/21 | [
"https://Stackoverflow.com/questions/28640427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | SQL:
```
SELECT *
FROM result
ORDER BY rand()
LIMIT 1
``` | `LIMIT` orders the rows by the primary key of the table, so you always get the same one (the "first" row according to that key).
Try:
```
SELECT * FROM result WHERE cat_id='$cid' ORDER BY RAND() LIMIT 0,1;
```
You can think of it this way: it first orders the results by a random order, then picks the first one. |
7,674,955 | I am developing an asp.net application where i have a dataset having 3 tables i.e. `ds.Tables[0], Tables[1] and Tables[2]`
I need to find minimum number and maximum number out of all the 3 tables of dataset. How to do that?
I found similar question in SO [here](https://stackoverflow.com/questions/2442525/how-to-selec... | 2011/10/06 | [
"https://Stackoverflow.com/questions/7674955",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/224636/"
] | Do it on `IOrganisation`(and have `IPeople` as the return type).
Something like this:
```
interface IOrganisation {
IList<IPeople> GetPeople();
}
```
This is because the people of an organisation is a property of the organisation, not of the people. | That sounds like it should be on `IOrganization` - that's what you'll call it on, after all. What you *have* is the organization, you *want* the list of people - you can't *start* fromt the list of people, so it *must* be part of the `IOrganization` interface.
I find it strange to have *plural* interface names to star... |
7,674,955 | I am developing an asp.net application where i have a dataset having 3 tables i.e. `ds.Tables[0], Tables[1] and Tables[2]`
I need to find minimum number and maximum number out of all the 3 tables of dataset. How to do that?
I found similar question in SO [here](https://stackoverflow.com/questions/2442525/how-to-selec... | 2011/10/06 | [
"https://Stackoverflow.com/questions/7674955",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/224636/"
] | Do it on `IOrganisation`(and have `IPeople` as the return type).
Something like this:
```
interface IOrganisation {
IList<IPeople> GetPeople();
}
```
This is because the people of an organisation is a property of the organisation, not of the people. | Which belongs to which?
It seems to me that `iOrganisation.People` would be a list of people ( is your "IPeople" interface representing a list of people or a single person? ) belonging to the organisation. Likewise you might have an `IPeople.Organisations` that lists all organisations that a person belongs to. Both wi... |
7,674,955 | I am developing an asp.net application where i have a dataset having 3 tables i.e. `ds.Tables[0], Tables[1] and Tables[2]`
I need to find minimum number and maximum number out of all the 3 tables of dataset. How to do that?
I found similar question in SO [here](https://stackoverflow.com/questions/2442525/how-to-selec... | 2011/10/06 | [
"https://Stackoverflow.com/questions/7674955",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/224636/"
] | Do it on `IOrganisation`(and have `IPeople` as the return type).
Something like this:
```
interface IOrganisation {
IList<IPeople> GetPeople();
}
```
This is because the people of an organisation is a property of the organisation, not of the people. | First of all, your should probably not have pluralized interface names. So call them IOrganization and IPerson and then on your `IOrganisation` interface you might have a method called:
```
IEnumerable<IPerson> GetPeople()
``` |
7,674,955 | I am developing an asp.net application where i have a dataset having 3 tables i.e. `ds.Tables[0], Tables[1] and Tables[2]`
I need to find minimum number and maximum number out of all the 3 tables of dataset. How to do that?
I found similar question in SO [here](https://stackoverflow.com/questions/2442525/how-to-selec... | 2011/10/06 | [
"https://Stackoverflow.com/questions/7674955",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/224636/"
] | Do it on `IOrganisation`(and have `IPeople` as the return type).
Something like this:
```
interface IOrganisation {
IList<IPeople> GetPeople();
}
```
This is because the people of an organisation is a property of the organisation, not of the people. | If you think of an organization as a collection containing people, then it's intuitive to put that in `IOrganization`. It would look like this:
```
interface IOrganization
{
IList<IPeople> Members { get; }
}
``` |
7,674,955 | I am developing an asp.net application where i have a dataset having 3 tables i.e. `ds.Tables[0], Tables[1] and Tables[2]`
I need to find minimum number and maximum number out of all the 3 tables of dataset. How to do that?
I found similar question in SO [here](https://stackoverflow.com/questions/2442525/how-to-selec... | 2011/10/06 | [
"https://Stackoverflow.com/questions/7674955",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/224636/"
] | That sounds like it should be on `IOrganization` - that's what you'll call it on, after all. What you *have* is the organization, you *want* the list of people - you can't *start* fromt the list of people, so it *must* be part of the `IOrganization` interface.
I find it strange to have *plural* interface names to star... | Which belongs to which?
It seems to me that `iOrganisation.People` would be a list of people ( is your "IPeople" interface representing a list of people or a single person? ) belonging to the organisation. Likewise you might have an `IPeople.Organisations` that lists all organisations that a person belongs to. Both wi... |
7,674,955 | I am developing an asp.net application where i have a dataset having 3 tables i.e. `ds.Tables[0], Tables[1] and Tables[2]`
I need to find minimum number and maximum number out of all the 3 tables of dataset. How to do that?
I found similar question in SO [here](https://stackoverflow.com/questions/2442525/how-to-selec... | 2011/10/06 | [
"https://Stackoverflow.com/questions/7674955",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/224636/"
] | That sounds like it should be on `IOrganization` - that's what you'll call it on, after all. What you *have* is the organization, you *want* the list of people - you can't *start* fromt the list of people, so it *must* be part of the `IOrganization` interface.
I find it strange to have *plural* interface names to star... | First of all, your should probably not have pluralized interface names. So call them IOrganization and IPerson and then on your `IOrganisation` interface you might have a method called:
```
IEnumerable<IPerson> GetPeople()
``` |
7,674,955 | I am developing an asp.net application where i have a dataset having 3 tables i.e. `ds.Tables[0], Tables[1] and Tables[2]`
I need to find minimum number and maximum number out of all the 3 tables of dataset. How to do that?
I found similar question in SO [here](https://stackoverflow.com/questions/2442525/how-to-selec... | 2011/10/06 | [
"https://Stackoverflow.com/questions/7674955",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/224636/"
] | That sounds like it should be on `IOrganization` - that's what you'll call it on, after all. What you *have* is the organization, you *want* the list of people - you can't *start* fromt the list of people, so it *must* be part of the `IOrganization` interface.
I find it strange to have *plural* interface names to star... | If you think of an organization as a collection containing people, then it's intuitive to put that in `IOrganization`. It would look like this:
```
interface IOrganization
{
IList<IPeople> Members { get; }
}
``` |
7,674,955 | I am developing an asp.net application where i have a dataset having 3 tables i.e. `ds.Tables[0], Tables[1] and Tables[2]`
I need to find minimum number and maximum number out of all the 3 tables of dataset. How to do that?
I found similar question in SO [here](https://stackoverflow.com/questions/2442525/how-to-selec... | 2011/10/06 | [
"https://Stackoverflow.com/questions/7674955",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/224636/"
] | First of all, your should probably not have pluralized interface names. So call them IOrganization and IPerson and then on your `IOrganisation` interface you might have a method called:
```
IEnumerable<IPerson> GetPeople()
``` | Which belongs to which?
It seems to me that `iOrganisation.People` would be a list of people ( is your "IPeople" interface representing a list of people or a single person? ) belonging to the organisation. Likewise you might have an `IPeople.Organisations` that lists all organisations that a person belongs to. Both wi... |
7,674,955 | I am developing an asp.net application where i have a dataset having 3 tables i.e. `ds.Tables[0], Tables[1] and Tables[2]`
I need to find minimum number and maximum number out of all the 3 tables of dataset. How to do that?
I found similar question in SO [here](https://stackoverflow.com/questions/2442525/how-to-selec... | 2011/10/06 | [
"https://Stackoverflow.com/questions/7674955",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/224636/"
] | First of all, your should probably not have pluralized interface names. So call them IOrganization and IPerson and then on your `IOrganisation` interface you might have a method called:
```
IEnumerable<IPerson> GetPeople()
``` | If you think of an organization as a collection containing people, then it's intuitive to put that in `IOrganization`. It would look like this:
```
interface IOrganization
{
IList<IPeople> Members { get; }
}
``` |
34,399,423 | I've got some problems with my Connection string. Seached the web for some mistakes but didn't got any further. Is there something changed between SQL Server versions?
```
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="Beurs... | 2015/12/21 | [
"https://Stackoverflow.com/questions/34399423",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4159130/"
] | There are at least two reasons why this issue (`Client Error: Remaining data too small for BSON object`) appears:
**1. PHP MongoDB driver is not compatible with MongoDB installed on the machine.**
(originally mentioned in the [first answer](https://stackoverflow.com/a/34646148/309031)).
Examine PHP driver version... | The issue was that Laravel was unable to communicate with MongoDB because I was using the mongodb-1.1 php driver and MongoDB 3.2 together. According to the table found on this page: <https://docs.mongodb.org/ecosystem/drivers/php/>, these two versions are not compatible. I uninstalled MongoDB 3.2 and installed MongoDB ... |
64,569,792 | These are my haves:
```
vec <- seq(1, 3, by = 1)
df <- data.frame(x1 = c("a1", "a2"))
```
and this is my wants:
```
x1 x2
1 a1 1
2 a2 1
3 a1 2
4 a2 2
5 a1 3
6 a2 3
```
I basically want to replicate the data frame according to the values in the vector vec. This is my working (possibly inefficient approach)... | 2020/10/28 | [
"https://Stackoverflow.com/questions/64569792",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/283538/"
] | You can use `crossing` :
```
tidyr::crossing(df, vec) %>% dplyr::arrange(vec)
# x1 vec
# <chr> <dbl>
#1 a1 1
#2 a2 1
#3 a1 2
#4 a2 2
#5 a1 3
#6 a2 3
```
Also,
```
tidyr::expand_grid(df, vec) %>% dplyr::arrange(vec)
``` | One option could be:
```
data.frame(x1 = df, x2 = rep(vec, each = nrow(df)))
x1 x2
1 a1 1
2 a2 1
3 a1 2
4 a2 2
5 a1 3
6 a2 3
``` |
64,569,792 | These are my haves:
```
vec <- seq(1, 3, by = 1)
df <- data.frame(x1 = c("a1", "a2"))
```
and this is my wants:
```
x1 x2
1 a1 1
2 a2 1
3 a1 2
4 a2 2
5 a1 3
6 a2 3
```
I basically want to replicate the data frame according to the values in the vector vec. This is my working (possibly inefficient approach)... | 2020/10/28 | [
"https://Stackoverflow.com/questions/64569792",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/283538/"
] | You can use `crossing` :
```
tidyr::crossing(df, vec) %>% dplyr::arrange(vec)
# x1 vec
# <chr> <dbl>
#1 a1 1
#2 a2 1
#3 a1 2
#4 a2 2
#5 a1 3
#6 a2 3
```
Also,
```
tidyr::expand_grid(df, vec) %>% dplyr::arrange(vec)
``` | `expand.grid` can give all combinations of two vectors.
```
expand.grid(x1 = df$x1, vec = vec)
#> x1 vec
#> 1 a1 1
#> 2 a2 1
#> 3 a1 2
#> 4 a2 2
#> 5 a1 3
#> 6 a2 3
``` |
60,351,355 | I am trying to make my nav bar sit parallel with my logo but I'm having difficulty doing this.
First of all, when I enter the code for the image, the image afterwards doesn't display at the top of the page.
Instead, it sits about 40px below the page. I have tried using floats, but have had no luck.
I have created ... | 2020/02/22 | [
"https://Stackoverflow.com/questions/60351355",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12943430/"
] | "To maintain the integrity of the data dictionary, tables in the SYS schema are manipulated only by the database. They should never be modified by any user or database administrator. You must not create any tables in the SYS schema."
<https://docs.oracle.com/database/121/ADMQS/GUID-CF1CD853-AF15-41EC-BC80-61918C73FDB5... | Try to put in this order:
```
ALTER TABLE table_name DROP COLUMN column_name;
```
If the table has data it doesn't work. |
187,493 | Input
-----
A single hex 6-digit colour code, capital letter, without `#`. Can also be a 24-bit integer if you prefer.
Output
------
The closest HTML color *name* (e.g `red`, or `dark-salmon`, as defined as <https://www.w3schools.com/colors/colors_names.asp> or see below). Distance is defined by summing the differen... | 2019/06/30 | [
"https://codegolf.stackexchange.com/questions/187493",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/85546/"
] | [Jelly](https://github.com/DennisMitchell/jelly), ~~1015~~ 914 bytes
====================================================================
```
“¥.⁻ḲU3ŒẆȯ§.eḊC¤ŀ"}Ʋ59£Uŀ'⁶ɠıṇȥLcṆɓ?^¢Ỵɠ.ȮẆẆḊqʠu½ỊƑfĠ⁴ µ¥ɓƭÑUC½ṁUĿẆṃ⁹S/÷Ɓɗ>ṭ"»Ḳ33r64¤,Ọy“µṂFŀƲOḌẇȤạ2œxṾk,E.LẸpḄ2s⁵Ṛç¦ṆkAẋ=çw©ḌĊẒƤm`;ṄȧṄİɦbṠṆṛ⁴Ḟ[CƊėQẏƑ<:⁾Þḍ?çⱮ3ƈṗ¬!7Hẏywœ⁽Ẉ¤ṾƈpHṗ... | Wolfram Language (Mathematica), 164 bytes
=========================================
*Note:* This only works in Mathematica 12.0 due to a bug in previous versions. This also means there is no TIO link.
```mma
g[c_]:=Last@Keys@SortBy[Round[255List@@@<|"HTML"~ColorData~"ColorRules"~Join~{"RebeccaPurple"->RGBColor@"#639"... |
187,493 | Input
-----
A single hex 6-digit colour code, capital letter, without `#`. Can also be a 24-bit integer if you prefer.
Output
------
The closest HTML color *name* (e.g `red`, or `dark-salmon`, as defined as <https://www.w3schools.com/colors/colors_names.asp> or see below). Distance is defined by summing the differen... | 2019/06/30 | [
"https://codegolf.stackexchange.com/questions/187493",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/85546/"
] | [C# (Visual C# Interactive Compiler)](http://www.mono-project.com/docs/about-mono/releases/5.0.0/#csc), 231+21=252 bytes
========================================================================================================================
```cs
s=>Color.FromArgb(Convert.ToInt32(s,16));f=s=>Enum.GetNames(typeof(Know... | Wolfram Language (Mathematica), 164 bytes
=========================================
*Note:* This only works in Mathematica 12.0 due to a bug in previous versions. This also means there is no TIO link.
```mma
g[c_]:=Last@Keys@SortBy[Round[255List@@@<|"HTML"~ColorData~"ColorRules"~Join~{"RebeccaPurple"->RGBColor@"#639"... |
187,493 | Input
-----
A single hex 6-digit colour code, capital letter, without `#`. Can also be a 24-bit integer if you prefer.
Output
------
The closest HTML color *name* (e.g `red`, or `dark-salmon`, as defined as <https://www.w3schools.com/colors/colors_names.asp> or see below). Distance is defined by summing the differen... | 2019/06/30 | [
"https://codegolf.stackexchange.com/questions/187493",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/85546/"
] | [C# (Visual C# Interactive Compiler)](http://www.mono-project.com/docs/about-mono/releases/5.0.0/#csc), 231+21=252 bytes
========================================================================================================================
```cs
s=>Color.FromArgb(Convert.ToInt32(s,16));f=s=>Enum.GetNames(typeof(Know... | [Jelly](https://github.com/DennisMitchell/jelly), ~~1015~~ 914 bytes
====================================================================
```
“¥.⁻ḲU3ŒẆȯ§.eḊC¤ŀ"}Ʋ59£Uŀ'⁶ɠıṇȥLcṆɓ?^¢Ỵɠ.ȮẆẆḊqʠu½ỊƑfĠ⁴ µ¥ɓƭÑUC½ṁUĿẆṃ⁹S/÷Ɓɗ>ṭ"»Ḳ33r64¤,Ọy“µṂFŀƲOḌẇȤạ2œxṾk,E.LẸpḄ2s⁵Ṛç¦ṆkAẋ=çw©ḌĊẒƤm`;ṄȧṄİɦbṠṆṛ⁴Ḟ[CƊėQẏƑ<:⁾Þḍ?çⱮ3ƈṗ¬!7Hẏywœ⁽Ẉ¤ṾƈpHṗ... |
187,493 | Input
-----
A single hex 6-digit colour code, capital letter, without `#`. Can also be a 24-bit integer if you prefer.
Output
------
The closest HTML color *name* (e.g `red`, or `dark-salmon`, as defined as <https://www.w3schools.com/colors/colors_names.asp> or see below). Distance is defined by summing the differen... | 2019/06/30 | [
"https://codegolf.stackexchange.com/questions/187493",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/85546/"
] | [Node.js](https://nodejs.org), 1488 bytes
=========================================
Takes input as a 24-bit integer. Outputs in lower case.
```javascript
v=>(require('zlib').inflateRawSync(Buffer('TVRbm6o4EPxLE27CowziDOiIV+bwFkkrWUPCBBg/9tdvLurZFzGX7uqqrs6Z4fr2xvHv5OYEy9uZjRC3QOjY6r/oaH4X+ugqAXiWI/P1M28AzGxQPWHuBBkB6... | JavaScript (Firefox), 1050 bytes
================================
```
c=>(b=document.body,_.match(/.[a-z]*/g).map(t=>getComputedStyle(b,b.style.color=t).color.match(/\d+/g).map((v,i)=>s+=Math.abs((c>>16-8*i&255)-v),s=0)|m>=s&&(m=s,r=t),r=m=c),r)
_='BlackNavy}~x~B2e}|G^ETeU}cy@Deeps,}t`xs*LimeS*Cy@Midnight~Dodg9~{s:GFo... |
187,493 | Input
-----
A single hex 6-digit colour code, capital letter, without `#`. Can also be a 24-bit integer if you prefer.
Output
------
The closest HTML color *name* (e.g `red`, or `dark-salmon`, as defined as <https://www.w3schools.com/colors/colors_names.asp> or see below). Distance is defined by summing the differen... | 2019/06/30 | [
"https://codegolf.stackexchange.com/questions/187493",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/85546/"
] | [C# (Visual C# Interactive Compiler)](http://www.mono-project.com/docs/about-mono/releases/5.0.0/#csc), 231+21=252 bytes
========================================================================================================================
```cs
s=>Color.FromArgb(Convert.ToInt32(s,16));f=s=>Enum.GetNames(typeof(Know... | [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 1175 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
==============================================================================================================================
```
.•ŒRǝJÖ¤|DÕGø∊ŸγÜuÕפJÓΩaĀhºΔè₆ìkh¥ù§¸β?|"qтy¥Œ›ιM?z*Ω3¿ƒLò·¡... |
187,493 | Input
-----
A single hex 6-digit colour code, capital letter, without `#`. Can also be a 24-bit integer if you prefer.
Output
------
The closest HTML color *name* (e.g `red`, or `dark-salmon`, as defined as <https://www.w3schools.com/colors/colors_names.asp> or see below). Distance is defined by summing the differen... | 2019/06/30 | [
"https://codegolf.stackexchange.com/questions/187493",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/85546/"
] | Wolfram Language (Mathematica), 164 bytes
=========================================
*Note:* This only works in Mathematica 12.0 due to a bug in previous versions. This also means there is no TIO link.
```mma
g[c_]:=Last@Keys@SortBy[Round[255List@@@<|"HTML"~ColorData~"ColorRules"~Join~{"RebeccaPurple"->RGBColor@"#639"... | [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 1175 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
==============================================================================================================================
```
.•ŒRǝJÖ¤|DÕGø∊ŸγÜuÕפJÓΩaĀhºΔè₆ìkh¥ù§¸β?|"qтy¥Œ›ιM?z*Ω3¿ƒLò·¡... |
187,493 | Input
-----
A single hex 6-digit colour code, capital letter, without `#`. Can also be a 24-bit integer if you prefer.
Output
------
The closest HTML color *name* (e.g `red`, or `dark-salmon`, as defined as <https://www.w3schools.com/colors/colors_names.asp> or see below). Distance is defined by summing the differen... | 2019/06/30 | [
"https://codegolf.stackexchange.com/questions/187493",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/85546/"
] | [Node.js](https://nodejs.org), 1488 bytes
=========================================
Takes input as a 24-bit integer. Outputs in lower case.
```javascript
v=>(require('zlib').inflateRawSync(Buffer('TVRbm6o4EPxLE27CowziDOiIV+bwFkkrWUPCBBg/9tdvLurZFzGX7uqqrs6Z4fr2xvHv5OYEy9uZjRC3QOjY6r/oaH4X+ugqAXiWI/P1M28AzGxQPWHuBBkB6... | [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 1175 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
==============================================================================================================================
```
.•ŒRǝJÖ¤|DÕGø∊ŸγÜuÕפJÓΩaĀhºΔè₆ìkh¥ù§¸β?|"qтy¥Œ›ιM?z*Ω3¿ƒLò·¡... |
187,493 | Input
-----
A single hex 6-digit colour code, capital letter, without `#`. Can also be a 24-bit integer if you prefer.
Output
------
The closest HTML color *name* (e.g `red`, or `dark-salmon`, as defined as <https://www.w3schools.com/colors/colors_names.asp> or see below). Distance is defined by summing the differen... | 2019/06/30 | [
"https://codegolf.stackexchange.com/questions/187493",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/85546/"
] | [C# (Visual C# Interactive Compiler)](http://www.mono-project.com/docs/about-mono/releases/5.0.0/#csc), 231+21=252 bytes
========================================================================================================================
```cs
s=>Color.FromArgb(Convert.ToInt32(s,16));f=s=>Enum.GetNames(typeof(Know... | [JavaScript (Node.js)](https://nodejs.org) + `color-name` package, 259 ~~279~~ ~~284~~ ~~259~~ ~~278~~ ~~282~~ ~~299~~ ~~312~~ ~~364~~ bytes
============================================================================================================================================
```javascript
c=>{w=[]
K=Object.keys
... |
187,493 | Input
-----
A single hex 6-digit colour code, capital letter, without `#`. Can also be a 24-bit integer if you prefer.
Output
------
The closest HTML color *name* (e.g `red`, or `dark-salmon`, as defined as <https://www.w3schools.com/colors/colors_names.asp> or see below). Distance is defined by summing the differen... | 2019/06/30 | [
"https://codegolf.stackexchange.com/questions/187493",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/85546/"
] | [Node.js](https://nodejs.org), 1488 bytes
=========================================
Takes input as a 24-bit integer. Outputs in lower case.
```javascript
v=>(require('zlib').inflateRawSync(Buffer('TVRbm6o4EPxLE27CowziDOiIV+bwFkkrWUPCBBg/9tdvLurZFzGX7uqqrs6Z4fr2xvHv5OYEy9uZjRC3QOjY6r/oaH4X+ugqAXiWI/P1M28AzGxQPWHuBBkB6... | Wolfram Language (Mathematica), 164 bytes
=========================================
*Note:* This only works in Mathematica 12.0 due to a bug in previous versions. This also means there is no TIO link.
```mma
g[c_]:=Last@Keys@SortBy[Round[255List@@@<|"HTML"~ColorData~"ColorRules"~Join~{"RebeccaPurple"->RGBColor@"#639"... |
187,493 | Input
-----
A single hex 6-digit colour code, capital letter, without `#`. Can also be a 24-bit integer if you prefer.
Output
------
The closest HTML color *name* (e.g `red`, or `dark-salmon`, as defined as <https://www.w3schools.com/colors/colors_names.asp> or see below). Distance is defined by summing the differen... | 2019/06/30 | [
"https://codegolf.stackexchange.com/questions/187493",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/85546/"
] | [Jelly](https://github.com/DennisMitchell/jelly), ~~1015~~ 914 bytes
====================================================================
```
“¥.⁻ḲU3ŒẆȯ§.eḊC¤ŀ"}Ʋ59£Uŀ'⁶ɠıṇȥLcṆɓ?^¢Ỵɠ.ȮẆẆḊqʠu½ỊƑfĠ⁴ µ¥ɓƭÑUC½ṁUĿẆṃ⁹S/÷Ɓɗ>ṭ"»Ḳ33r64¤,Ọy“µṂFŀƲOḌẇȤạ2œxṾk,E.LẸpḄ2s⁵Ṛç¦ṆkAẋ=çw©ḌĊẒƤm`;ṄȧṄİɦbṠṆṛ⁴Ḟ[CƊėQẏƑ<:⁾Þḍ?çⱮ3ƈṗ¬!7Hẏywœ⁽Ẉ¤ṾƈpHṗ... | [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 1175 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
==============================================================================================================================
```
.•ŒRǝJÖ¤|DÕGø∊ŸγÜuÕפJÓΩaĀhºΔè₆ìkh¥ù§¸β?|"qтy¥Œ›ιM?z*Ω3¿ƒLò·¡... |
44,409 | Bonjour,
Normalement, on ne met pas d'article devant un nom de métier.
>
> Je suis professeur. Je suis boulanger.
>
>
>
Mais imaginons le dialogue suivant :
>
> A : Es-tu boulanger ?
>
>
> B : Non, je suis (**un**) maçon.
>
>
>
Dans ce cas, faut-il mettre l'article indéfini devant *maçon*, ceci parce que... | 2021/01/28 | [
"https://french.stackexchange.com/questions/44409",
"https://french.stackexchange.com",
"https://french.stackexchange.com/users/26093/"
] | Je ne vois pas de nécessité d'ajouter un article indéfini, ni dans un cas, ni dans l'autre :
>
> A : Es-tu boulanger ?
>
> B : Non, je suis maçon.
>
> A : Mais on m'a bien dit que tu étais un boulanger…
>
> B : Oui, c'est mon nom de famille, je suis bien un Boulanger. Et toi ?
>
> A : Oh, pardon ! C'est a... | Il est habituel de ne pas utiliser d'article dans ce contexte, mais l'utiliser ne résulte pas en une faute; si ce n'est pas usuel, il n'y a quand même pas de principe contradictoire qui empêche d'utiliser l'article. En fait de nombreux cas d'utilisation de l'article se trouvent dans la littérature.
Les noms associés à... |
14,489,876 | I have a table `HRTC` in SQL Server. I want to import data which is in Excel into this table. But my Excel file does not have all the columns which match the `HRTC` table. Is there anyway I can do this?
I am thinking something like in the import wizard
```
Insert into SQLServerTable Select * FROM OPENROWSET('Microsof... | 2013/01/23 | [
"https://Stackoverflow.com/questions/14489876",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1723572/"
] | Try this
Create a temp table
```
Select * INTO TmpTable FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=D:\testing.xls;HDR=YES',
'SELECT * FROM [SheetName$]')
```
Then to insert row into hrtc using temptable, any missing columns will have null
```
INSERT INTO hrtc(column1, column2)
select col1, ... | One simple approach is to script your excel file into a collection of insert statement, then run it on SQL Server.
Also if you can export your excel file into CSV file, this is often useful. Tool like SQL Server Management Studio should have some kind of import wizard where you can load the CSV, choose column mapping ... |
14,489,876 | I have a table `HRTC` in SQL Server. I want to import data which is in Excel into this table. But my Excel file does not have all the columns which match the `HRTC` table. Is there anyway I can do this?
I am thinking something like in the import wizard
```
Insert into SQLServerTable Select * FROM OPENROWSET('Microsof... | 2013/01/23 | [
"https://Stackoverflow.com/questions/14489876",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1723572/"
] | Try this
Create a temp table
```
Select * INTO TmpTable FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=D:\testing.xls;HDR=YES',
'SELECT * FROM [SheetName$]')
```
Then to insert row into hrtc using temptable, any missing columns will have null
```
INSERT INTO hrtc(column1, column2)
select col1, ... | What I often end up doing in these situations is to do some code completion using excel's CONCATENATE function.
Let's say you have:
```
A B
1 foo bar
2 test2 bar2
3 test3 bar 3
```
If you needed to insert those into a table. In column C you can write:
```
=CONCATENATE("INSERT INTO HRTC(col, col... |
14,489,876 | I have a table `HRTC` in SQL Server. I want to import data which is in Excel into this table. But my Excel file does not have all the columns which match the `HRTC` table. Is there anyway I can do this?
I am thinking something like in the import wizard
```
Insert into SQLServerTable Select * FROM OPENROWSET('Microsof... | 2013/01/23 | [
"https://Stackoverflow.com/questions/14489876",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1723572/"
] | One simple approach is to script your excel file into a collection of insert statement, then run it on SQL Server.
Also if you can export your excel file into CSV file, this is often useful. Tool like SQL Server Management Studio should have some kind of import wizard where you can load the CSV, choose column mapping ... | What I often end up doing in these situations is to do some code completion using excel's CONCATENATE function.
Let's say you have:
```
A B
1 foo bar
2 test2 bar2
3 test3 bar 3
```
If you needed to insert those into a table. In column C you can write:
```
=CONCATENATE("INSERT INTO HRTC(col, col... |
19,034,871 | Hi I was wondering whether someone would be able to help me with a query. I am trying to select from an EAV type table where the value is not multiple values.
Using the example below I am trying to retrieve rows where tag\_id != 1 and tag\_id != 2. So based on the data I want to return just the row containing contact\... | 2013/09/26 | [
"https://Stackoverflow.com/questions/19034871",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/460824/"
] | You can use `NOT EXISTS()` in which the statement inside selects all records where it has tags of `1` or `2`.
```
SELECT contact_id
FROM contact_tags a
WHERE NOT EXISTS
(
SELECT 1
FROM contact_tags b
WHERE tag_id IN (1, 2) AND
a.contact_id = b... | Stealing from @491243 fiddle here is a modification which returns contacts\_id which lack both tags\_id
<http://sqlfiddle.com/#!2/b2b11/19> |
19,034,871 | Hi I was wondering whether someone would be able to help me with a query. I am trying to select from an EAV type table where the value is not multiple values.
Using the example below I am trying to retrieve rows where tag\_id != 1 and tag\_id != 2. So based on the data I want to return just the row containing contact\... | 2013/09/26 | [
"https://Stackoverflow.com/questions/19034871",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/460824/"
] | may be this is what you want
```
select contact_id
from contact_tags
where contact_id not in (
select contact_id from contact_tags where tag_id in (1,2)
) tmp
``` | Stealing from @491243 fiddle here is a modification which returns contacts\_id which lack both tags\_id
<http://sqlfiddle.com/#!2/b2b11/19> |
9,941,898 | I'm new in Ruby/Rails, so, my question: what is the perfect way to upload file and save filename in database with rails? Are there any Gem? Or maybe there are good build-in feature? | 2012/03/30 | [
"https://Stackoverflow.com/questions/9941898",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/630189/"
] | Also try [carrierwave](https://github.com/jnicklas/carrierwave), Ryan has a good screencast about this [gem](http://railscasts.com/episodes/253-carrierwave-file-uploads) | Most people use the [Paperclip Gem](https://github.com/thoughtbot/paperclip). |
9,941,898 | I'm new in Ruby/Rails, so, my question: what is the perfect way to upload file and save filename in database with rails? Are there any Gem? Or maybe there are good build-in feature? | 2012/03/30 | [
"https://Stackoverflow.com/questions/9941898",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/630189/"
] | You can try Paperclip.It is most popular gem in rails community...
```
https://github.com/thoughtbot/paperclip
```
these lines do the all stuff
```
class User < ActiveRecord::Base
has_attached_file :avatar, :styles => { :medium => "300x300>", :thumb => "100x100>" }
end
```
Try it...... | Most people use the [Paperclip Gem](https://github.com/thoughtbot/paperclip). |
9,941,898 | I'm new in Ruby/Rails, so, my question: what is the perfect way to upload file and save filename in database with rails? Are there any Gem? Or maybe there are good build-in feature? | 2012/03/30 | [
"https://Stackoverflow.com/questions/9941898",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/630189/"
] | Just take a look on the links to choose between paperClip & carrierwave :
[Rails 3 paperclip vs carrierwave vs dragonfly vs attachment\_fu](https://stackoverflow.com/questions/7419731/rails-3-paperclip-vs-carrierwave-vs-dragonfly-vs-attachment-fu)
And
<http://bcjordan.github.com/posts/rails-image-uploading-framework... | Most people use the [Paperclip Gem](https://github.com/thoughtbot/paperclip). |
9,941,898 | I'm new in Ruby/Rails, so, my question: what is the perfect way to upload file and save filename in database with rails? Are there any Gem? Or maybe there are good build-in feature? | 2012/03/30 | [
"https://Stackoverflow.com/questions/9941898",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/630189/"
] | Also try [carrierwave](https://github.com/jnicklas/carrierwave), Ryan has a good screencast about this [gem](http://railscasts.com/episodes/253-carrierwave-file-uploads) | Just take a look on the links to choose between paperClip & carrierwave :
[Rails 3 paperclip vs carrierwave vs dragonfly vs attachment\_fu](https://stackoverflow.com/questions/7419731/rails-3-paperclip-vs-carrierwave-vs-dragonfly-vs-attachment-fu)
And
<http://bcjordan.github.com/posts/rails-image-uploading-framework... |
9,941,898 | I'm new in Ruby/Rails, so, my question: what is the perfect way to upload file and save filename in database with rails? Are there any Gem? Or maybe there are good build-in feature? | 2012/03/30 | [
"https://Stackoverflow.com/questions/9941898",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/630189/"
] | You can try Paperclip.It is most popular gem in rails community...
```
https://github.com/thoughtbot/paperclip
```
these lines do the all stuff
```
class User < ActiveRecord::Base
has_attached_file :avatar, :styles => { :medium => "300x300>", :thumb => "100x100>" }
end
```
Try it...... | Just take a look on the links to choose between paperClip & carrierwave :
[Rails 3 paperclip vs carrierwave vs dragonfly vs attachment\_fu](https://stackoverflow.com/questions/7419731/rails-3-paperclip-vs-carrierwave-vs-dragonfly-vs-attachment-fu)
And
<http://bcjordan.github.com/posts/rails-image-uploading-framework... |
48,411,072 | The following query matches userID's to eachother based off of total score difference. I have two tables, survey & users.
I need to join this to the users table that I have that has usernames/photo links.
The columns I need displayed are users.name & users.photo. All tables currently have a unique userID, which is us... | 2018/01/23 | [
"https://Stackoverflow.com/questions/48411072",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8534513/"
] | I would just add a filter to exclude undefined events on the initial subscription:
```
ngOnInit() {
this.dataService.getEvents()
.filter(events => events && events.length > 0)
.subscribe(
(events) => {
this.events = events;
console.log(events); // when I try to get this is no problem it... | Instead of using a BehaviorSubject you can try using a Subject, the Subject won't have the empty array in the first place which triggers the initial subscription call.
If you need to use a BehaviorSubject, you can instead do a check for null and has length before working with it, so
```
.subscribe(events => {
if(ev... |
44,215,132 | I have a Oracle query
```
SELECT to_timestamp('29-03-17 03:58:34.312000000 PM','DD-MM-RR HH12:MI:SS.FF AM')
FROM DUAL
```
I want to convert to SQL Server where I need to retain the Oracle date string i.e `'29-03-17 03:58:34.312000000 PM'`:
```
SELECT
CONVERT(DATETIME, REPLACE(REPLACE('29-03-2017 03:58:34.312... | 2017/05/27 | [
"https://Stackoverflow.com/questions/44215132",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2550324/"
] | You might try it like this:
```
DECLARE @oracleDT VARCHAR(100)='29-03-17 03:58:34.312000000 PM';
SELECT CAST('<x>' + @oracleDT + '</x>' AS XML).value(N'(/x/text())[1]','datetime');
```
It seems, that XML is implicitly able to do this correctly...
EDIT: The above is culture related!
---------------------------------... | Although I don't really understand the need to use a string format that does not suit conversion, but you could divide the string into parts then build it up by adding the parts to each other. The foundation part if the first 8 characters converted to datetime2 using format style 5.
```
select
t
, convert(va... |
13,440,602 | lick() is a private method of Cat. Unfortunately, Cat's this.paw is not accessible in lick(). Is there a simple way to create a private method that has access to the member variables of its containing class?
```
<!doctype html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<p id="catStatus">???</p>
<script>
func... | 2012/11/18 | [
"https://Stackoverflow.com/questions/13440602",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/724752/"
] | The value of `this` depends on how you call the method.
Since you're not calling the method on the object instance, `this` becomes the global object.
Instead, you need to save `this` in a variable:
```
function Cat() {
this.paw = ...;
var me = this;
var lick = function() {
alert(me.paw);
... | There are a couple ways to solve this. The problem is that the context inside of lick is not the instance of cat. You can either:
Use the call method to set the context
```
this.beCat = function() {
this.paw = "sticky";
lick.call(this);
};
```
or use closure
```
var instance = this;
var lick = function() {... |
13,440,602 | lick() is a private method of Cat. Unfortunately, Cat's this.paw is not accessible in lick(). Is there a simple way to create a private method that has access to the member variables of its containing class?
```
<!doctype html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<p id="catStatus">???</p>
<script>
func... | 2012/11/18 | [
"https://Stackoverflow.com/questions/13440602",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/724752/"
] | The value of `this` depends on how you call the method.
Since you're not calling the method on the object instance, `this` becomes the global object.
Instead, you need to save `this` in a variable:
```
function Cat() {
this.paw = ...;
var me = this;
var lick = function() {
alert(me.paw);
... | The context of this depends upon who called the function. In this case it is beCat. You can however explicitly specify the this scope by using call.
In your case:
```
this.beCat = function () {
this.paw = "sticky";
lick.call(this);
}
```
Or you can store the this in a variable.
You can re... |
65,492,424 | I'm working with [AI-Thermometer](https://github.com/tomek-l/ai-thermometer) project using Nvidia Jeton Nano.
The project is using Pi camera v2 for video capturing.
Here's the command of showing video streams using Pi camera v2.
```sh
gst-launch-1.0 nvarguscamerasrc sensor_mode=0 ! 'video/x-raw(memory:NVMM),width=326... | 2020/12/29 | [
"https://Stackoverflow.com/questions/65492424",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12570573/"
] | There should not quotes around the device parameter i.e. `device=/dev/video0`. If the error persists, then its probably something else. | ```none
gst-launch-1.0 v4l2src device="/dev/video0" ! \
"video/x-raw, width=640, height=480, format=(string)YUY2" ! \
xvimagesink -e
``` |
1,749,232 | What naming conventions do you use for everyday code? I'm pondering this because I currently have a project in Python that contains 3 packages, each with a unique purpose. Now, I've been putting general-purpose, 'utility' methods into the first package I created for the project, however I'm contemplating moving these m... | 2009/11/17 | [
"https://Stackoverflow.com/questions/1749232",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/154280/"
] | In general, you should follow the naming convention of the language you're using. It doesn't matter if you like or prefer the standards of another language. Consistency within the context of the language helps make your code more readable, maintainable, and usable by others. In Python, that means you use [PEP 8](http:/... | Unless you have some good reason not to, you should follow the guidelines presented in [PEP 8](http://www.python.org/dev/peps/pep-0008/). See, in particular, "Prescriptive: Naming Conventions". |
30,779,774 | I have a table like this:
```
CREATE TABLE mytable (
user_id int,
device_id ascii,
record_time timestamp,
timestamp timeuuid,
info_1 text,
info_2 int,
PRIMARY KEY (user_id, device_id, record_time, timestamp)
);
```
When I ask Cassandra to delete a record (an entry in the columnfamily) li... | 2015/06/11 | [
"https://Stackoverflow.com/questions/30779774",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/697716/"
] | Ok, here is my theory as to what is going on. You have to be careful with timestamps, because they will *store* data down to the millisecond. But, they will only *display* data to the second. Take this sample table for example:
```
aploetz@cqlsh:stackoverflow> SELECT id, datetime FROM data;
id | datetime
------... | ```
CREATE TABLE worker_login_table (
worker_id text,
logged_in_time timestamp,
PRIMARY KEY (worker_id, logged_in_time)
);
INSERT INTO worker_login_table (worker_id, logged_in_time)
VALUES ("worker_1",toTimestamp(now()));
```
after 1 hour executed the above insert statement once again
```
select * ... |
3,508,624 | Got a table with 1200 rows. Added a new column which will contain incremental values -
Candidate1
Candidate2
Candidate3
.
.
.
Candidate1200
What is the best way to insert these values , non manual way. I am using SQL Server 2008 | 2010/08/18 | [
"https://Stackoverflow.com/questions/3508624",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/416465/"
] | Simple:
```
$post_title = sanitize_title_with_dashes($post_title);
```
But WordPress does this for you already. I assume you need it for something different? | Some solution might be found at <http://postedpost.com/2008/06/23/ultimate-wordpress-post-name-url-sanitize-solution/>
Also, you might want to do it as follows:
```
$special_chars = array("?", "[", "]", "/", "\\", "=", "<", ">", ":", ";", ",", "'", "\"", "&", "$", "#", "*", "(", ")", "|", "~", "`", "!", "{", "}");
$p... |
3,508,624 | Got a table with 1200 rows. Added a new column which will contain incremental values -
Candidate1
Candidate2
Candidate3
.
.
.
Candidate1200
What is the best way to insert these values , non manual way. I am using SQL Server 2008 | 2010/08/18 | [
"https://Stackoverflow.com/questions/3508624",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/416465/"
] | I'm guessing you're sanitizing by direct SQL insertion. Instead, consider using wp\_post\_insert() in your insertion script.
```
$new_post_id = wp_insert_post(array(
'post_title' => "This <open_tag insane title thing<b>LOL!;drop table `bobby`;"
));
```
At this point, you just worry about your title - and not the sl... | Some solution might be found at <http://postedpost.com/2008/06/23/ultimate-wordpress-post-name-url-sanitize-solution/>
Also, you might want to do it as follows:
```
$special_chars = array("?", "[", "]", "/", "\\", "=", "<", ">", ":", ";", ",", "'", "\"", "&", "$", "#", "*", "(", ")", "|", "~", "`", "!", "{", "}");
$p... |
3,508,624 | Got a table with 1200 rows. Added a new column which will contain incremental values -
Candidate1
Candidate2
Candidate3
.
.
.
Candidate1200
What is the best way to insert these values , non manual way. I am using SQL Server 2008 | 2010/08/18 | [
"https://Stackoverflow.com/questions/3508624",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/416465/"
] | Simple:
```
$post_title = sanitize_title_with_dashes($post_title);
```
But WordPress does this for you already. I assume you need it for something different? | I'm guessing you're sanitizing by direct SQL insertion. Instead, consider using wp\_post\_insert() in your insertion script.
```
$new_post_id = wp_insert_post(array(
'post_title' => "This <open_tag insane title thing<b>LOL!;drop table `bobby`;"
));
```
At this point, you just worry about your title - and not the sl... |
521 | Has anyone seen this site? <http://answermagento.com/>
I know this subject has been briefly discussed but this isn't another site using a StackExchange-clone platform. This site consists entirely of scraped content from Magento SE.
[Frequently linked-to site ripping off Magento Stack Exchange](https://magento.meta.st... | 2015/02/23 | [
"https://magento.meta.stackexchange.com/questions/521",
"https://magento.meta.stackexchange.com",
"https://magento.meta.stackexchange.com/users/324/"
] | The content is CC share-alike, but this site isn't properly crediting the origin.
Not important though because the domain name infringes our mark. I've sent a note to our legal team to C&D the owner. | Thats a common problem with stackoverflow/stackexchange content. Usually you dont find it on google anymore, as the duplicate content restrictions are good enough to recognize them.
If you still see such things, you can report them to the StackExchange Team via one of the communication ways.
I for example sent a mail... |
521 | Has anyone seen this site? <http://answermagento.com/>
I know this subject has been briefly discussed but this isn't another site using a StackExchange-clone platform. This site consists entirely of scraped content from Magento SE.
[Frequently linked-to site ripping off Magento Stack Exchange](https://magento.meta.st... | 2015/02/23 | [
"https://magento.meta.stackexchange.com/questions/521",
"https://magento.meta.stackexchange.com",
"https://magento.meta.stackexchange.com/users/324/"
] | The content is CC share-alike, but this site isn't properly crediting the origin.
Not important though because the domain name infringes our mark. I've sent a note to our legal team to C&D the owner. | **Meet "Alan Storm"**

This is another website ripping Magento SE, compare this:
* Ours: [Inline translate Chrome Bug?](https://magento.stackexchange.com/q/6435/3326)
* Theirs: <http://worldofcoder.com/question/12459/how-to-inline-translate-chrome-bug.html>
They l... |
521 | Has anyone seen this site? <http://answermagento.com/>
I know this subject has been briefly discussed but this isn't another site using a StackExchange-clone platform. This site consists entirely of scraped content from Magento SE.
[Frequently linked-to site ripping off Magento Stack Exchange](https://magento.meta.st... | 2015/02/23 | [
"https://magento.meta.stackexchange.com/questions/521",
"https://magento.meta.stackexchange.com",
"https://magento.meta.stackexchange.com/users/324/"
] | Thats a common problem with stackoverflow/stackexchange content. Usually you dont find it on google anymore, as the duplicate content restrictions are good enough to recognize them.
If you still see such things, you can report them to the StackExchange Team via one of the communication ways.
I for example sent a mail... | **Meet "Alan Storm"**

This is another website ripping Magento SE, compare this:
* Ours: [Inline translate Chrome Bug?](https://magento.stackexchange.com/q/6435/3326)
* Theirs: <http://worldofcoder.com/question/12459/how-to-inline-translate-chrome-bug.html>
They l... |
50,327,168 | I need to create perforce clients from my jenkins build scripts, and this needs to be done unattended. This is mainly because jenkins jobs run in unique folders, Perforce insists that each client has a unique root target folder, and we create new jenkins jobs all the time based on need. Right now each time I create a u... | 2018/05/14 | [
"https://Stackoverflow.com/questions/50327168",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1216792/"
] | You can position an absolute View over the RNCamera view, and put all of your content into that absolute view. For example:
```js
import { RNCamera } from 'react-native-camera';
class TakePicture extends Component {
takePicture = async () => {
try {
const data = await this.camera.takePictureAsync();
... | simply add this to your code, remember it should be placed inside, it will make a stylish button with shadow.
`<RNCamera> </RNCamera>`
```
<RNCamera>
<View style={{position: 'absolute',
bottom: "50%",
right: "... |
3,959,078 | I have a model called a `Statement` that belongs to a `Member`. Given an array of members, I want to create a query that will return the **most recent** statement for each of those members (preferably in one nice clean query).
I thought I might be able to achieve this using `group` and `order` - something like:
```
#... | 2010/10/18 | [
"https://Stackoverflow.com/questions/3959078",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/151409/"
] | In MySQL directly, you need a sub-query that returns the maximum `created_at` value for each member, which can then be joined back to the `Statement` table to retrieve the rest of the row.
```
SELECT *
FROM Statement s
JOIN (SELECT
member_id, MAX(created_at) max_created_at
FROM Statement ... | If you are using Rails 3 I would recommend taking a look at the new ActiveRecord query syntax. There is an overview at <http://guides.rubyonrails.org/active_record_querying.html>
I am pretty certain you could do what you are trying to do here without writing any SQL. There is an example in the "Grouping" section on th... |
5,032,968 | When an EXE raised an exception message like "access violation at address XXXXXXXX...", the address XXXXXXXX is a hex value, and we can get the source code line number that caused the exception, by looking at the map file. Details below ([by madshi at EE](http://www.experts-exchange.com/Programming/Languages/Pascal/Del... | 2011/02/17 | [
"https://Stackoverflow.com/questions/5032968",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/133516/"
] | Same calculations apply, with the following note: instead of image base address of EXE you'll need to take actual address where DLL had been loaded. Base of code for a DLL should taken in the same manner as for EXE (stored in PE's `IMAGE_OPTIONAL_HEADER`).
Btw, EXE and DLL are actually the same thing from the point of... | Two binaries can not be loaded at the same address. So the image base address stored in the DLL/EXE is only a suggestion for which the binary is optimized. Where the binary actually gets loaded into memory depends on many factors, like other binaries loaded in the process first, Windows version, injected 3rd party dlls... |
52,332,409 | I converted the png file to SVG and got it from <http://inloop.github.io/svg2android/> to find the vector path information.
I have been trying to support from api level 21 to get the right resolution for all screen sizes by using vector drawables. (My app`s minSdk is 21)
The problem is that the text is white and the... | 2018/09/14 | [
"https://Stackoverflow.com/questions/52332409",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10363717/"
] | Use this class
```
private class VectorDrawableUtils {
Drawable getDrawable(Context context, int drawableResId) {
return VectorDrawableCompat.create(context.getResources(), drawableResId, context.getTheme());
}
Drawable getDrawable(Context context, int drawableResId, int colorFilter) {
Dr... | It's possible to make it so, however, you have to manually change your vector.
Currently, first `path` contains all letters and rectangle background.
To make all letter white you can use should extract letter in separate `path` and set `fillColor` for it. And so on.
BTW, why don't you use custom font for the purpose ... |
52,332,409 | I converted the png file to SVG and got it from <http://inloop.github.io/svg2android/> to find the vector path information.
I have been trying to support from api level 21 to get the right resolution for all screen sizes by using vector drawables. (My app`s minSdk is 21)
The problem is that the text is white and the... | 2018/09/14 | [
"https://Stackoverflow.com/questions/52332409",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10363717/"
] | Use this class
```
private class VectorDrawableUtils {
Drawable getDrawable(Context context, int drawableResId) {
return VectorDrawableCompat.create(context.getResources(), drawableResId, context.getTheme());
}
Drawable getDrawable(Context context, int drawableResId, int colorFilter) {
Dr... | Change Fill color if you want to change inside color
If you want change stroke color then change it's color |
52,260,366 | I am looking for a textbox control that suggests words as the user types, similar to SuggestAppend for textboxes in winforms, except for WPF. I have looked around on the WPFToolkit and haven't really found anything that fits my needs.
Thanks. | 2018/09/10 | [
"https://Stackoverflow.com/questions/52260366",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6635930/"
] | Declare an enum AutoCompleteMode too with value(Append, None,SuggestAppend,Suggest)
```
public enum AutoCompleteMode
```
Create an custom UserControl with TextBox and ItemControls. Handle the **KeyDown** event of TextBox. Popup an custom List to show the suggestion list(ItemControls in here). Then Handle the selecti... | WpfToolkit contains [AutoCompleteBox](https://github.com/dotnetprojects/WpfToolkit/blob/master/WpfToolkit/Input/AutoCompleteBox/System/Windows/Controls/AutoCompleteBox.cs) that you can use for auto suggest feature.
You will have to define a collection for items to suggest (SuggestionItems) and set it as ItemsSource on ... |
5,788,258 | Hey I have a .NET .aspx page that I would like to run every hour or so whats the best way to do this ?
I assume it will have to open a browser window to do so and if possible that it closes the window after.
EDIT : I have access over all features on the server | 2011/04/26 | [
"https://Stackoverflow.com/questions/5788258",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/215541/"
] | **Option 1**: The cleanest solution would be to write a Windows application that does the work (instead of an aspx page) and schedule this application on the server using the Windows Task Scheduler. This has a few advantages over the aspx approach:
* You can use the features of the Windows Task Scheduler (event log en... | use this sample to schedule a task in asp.net :
[enter link description here](http://www.codeproject.com/KB/aspnet/ASPNETService.aspx)
then you need to create `Hit.aspx` page witch will do what you want. then you should call that page every time (using `WebClient` class) the task execution time elapsed! |
5,788,258 | Hey I have a .NET .aspx page that I would like to run every hour or so whats the best way to do this ?
I assume it will have to open a browser window to do so and if possible that it closes the window after.
EDIT : I have access over all features on the server | 2011/04/26 | [
"https://Stackoverflow.com/questions/5788258",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/215541/"
] | **Option 1**: The cleanest solution would be to write a Windows application that does the work (instead of an aspx page) and schedule this application on the server using the Windows Task Scheduler. This has a few advantages over the aspx approach:
* You can use the features of the Windows Task Scheduler (event log en... | You can use <http://quartznet.sourceforge.net/> Quartz Job Scheduler.
With Quartz.net you can write a job which will request your web page with interval you choose.
or alternatively you can write an windows service which will request that web page. |
29,776,576 | I can create a [Guava `ImmutableList`](https://google.github.io/guava/releases/23.0/api/docs/com/google/common/collect/ImmutableList.html) with the `of` method, and will get the correct generic type based on the passed objects:
```
Foo foo = new Foo();
ImmutableList.of(foo);
```
However, [the `of` method with no par... | 2015/04/21 | [
"https://Stackoverflow.com/questions/29776576",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/722332/"
] | If you assign the created list to a variable, you don't have to do anything:
```
ImmutableList<Foo> list = ImmutableList.of();
```
In other cases where the type can't be inferred, you have to write `ImmutableList.<Foo>of()` as @zigg says. | `ImmutableList.<Foo>of()` will create an empty `ImmutableList` with generic type `Foo`. Though [the compiler can infer the generic type](https://stackoverflow.com/a/29776623/722332) in some circumstances, like assignment to a variable, you'll need to use this format (as I did) when you're providing the value for a func... |
29,776,576 | I can create a [Guava `ImmutableList`](https://google.github.io/guava/releases/23.0/api/docs/com/google/common/collect/ImmutableList.html) with the `of` method, and will get the correct generic type based on the passed objects:
```
Foo foo = new Foo();
ImmutableList.of(foo);
```
However, [the `of` method with no par... | 2015/04/21 | [
"https://Stackoverflow.com/questions/29776576",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/722332/"
] | `ImmutableList.<Foo>of()` will create an empty `ImmutableList` with generic type `Foo`. Though [the compiler can infer the generic type](https://stackoverflow.com/a/29776623/722332) in some circumstances, like assignment to a variable, you'll need to use this format (as I did) when you're providing the value for a func... | Since Java 8 the compiler is much more clever and can figure out the type parameters parameters in more situations.
Example:
```
void test(List<String> l) { ... }
// Type checks in Java 8 but not in Java 7
test(ImmutableList.of());
```
### Explanation
The new thing in Java 8 is that the [target type](https://doc... |
29,776,576 | I can create a [Guava `ImmutableList`](https://google.github.io/guava/releases/23.0/api/docs/com/google/common/collect/ImmutableList.html) with the `of` method, and will get the correct generic type based on the passed objects:
```
Foo foo = new Foo();
ImmutableList.of(foo);
```
However, [the `of` method with no par... | 2015/04/21 | [
"https://Stackoverflow.com/questions/29776576",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/722332/"
] | If you assign the created list to a variable, you don't have to do anything:
```
ImmutableList<Foo> list = ImmutableList.of();
```
In other cases where the type can't be inferred, you have to write `ImmutableList.<Foo>of()` as @zigg says. | Since Java 8 the compiler is much more clever and can figure out the type parameters parameters in more situations.
Example:
```
void test(List<String> l) { ... }
// Type checks in Java 8 but not in Java 7
test(ImmutableList.of());
```
### Explanation
The new thing in Java 8 is that the [target type](https://doc... |
1,990,579 | I am using "ExuberantCtags" also known as "ctags -e", also known as just "etags"
and I am trying to understand the TAGS file format which is generated by the etags command, in particular I want to understand line #2 of the TAGS file.
[Wikipedia says](http://en.wikipedia.org/wiki/Ctags#Etags_2) that line #2 is describ... | 2010/01/02 | [
"https://Stackoverflow.com/questions/1990579",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2085667/"
] | You can probably use [mcrypt](http://de3.php.net/manual/en/ref.mcrypt.php).
But may I ask why you're encrypting with ECB mode at all? Remember the [known problems](http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Electronic_codebook_.28ECB.29) with that? | ```
mcrypt_decrypt('rijndael-128', $key, $data, 'ecb');
```
You will have to manually remove [the padding](http://en.wikipedia.org/wiki/Padding_%28cryptography%29#Byte_padding). |
31,208,835 | ```
firstLetter = word.charAt(0);
lastLetter = word.charAt((word.length()) - 1);
noFirstLetter = word.substring(1);
newWord = noFirstLetter + firstLetter;
if(word.equalsIgnoreCase(newWord))
```
So im trying to take the first letter of the word and if I take the first letter of the word away and move it to t... | 2015/07/03 | [
"https://Stackoverflow.com/questions/31208835",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5078138/"
] | I think what you are trying to do is to remove the first character, and then check if rest of the characters are symmetrical around the center of the word.(OK even it is complicated for me)
EG:
dresser => (drop d) => resser => (add d to the right) => resserd (read from right to left and it is dresser again).
after ... | If you move 'd' to the end of the word "dresser" you get "resserd" which is not equal to "dresser".
If you move 'd' to the end and then **reverse** the word then they are equal.
So, assuming you consider strings equals even if they are reversed, the code you want would be :
```
boolean testPass = false;
if ( word.le... |
31,208,835 | ```
firstLetter = word.charAt(0);
lastLetter = word.charAt((word.length()) - 1);
noFirstLetter = word.substring(1);
newWord = noFirstLetter + firstLetter;
if(word.equalsIgnoreCase(newWord))
```
So im trying to take the first letter of the word and if I take the first letter of the word away and move it to t... | 2015/07/03 | [
"https://Stackoverflow.com/questions/31208835",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5078138/"
] | Okay, so I'm presuming that you want to take a `string`, move it's first index to the end and then reverse the `string`. If you do this to a word such as 'dresser' then you end up with the same value.
Something like this could work, currently untested:
```
public StringBuilder reverseWord(String word){
firstLett... | If you move 'd' to the end of the word "dresser" you get "resserd" which is not equal to "dresser".
If you move 'd' to the end and then **reverse** the word then they are equal.
So, assuming you consider strings equals even if they are reversed, the code you want would be :
```
boolean testPass = false;
if ( word.le... |
17,426,311 | I have list of Active Directory Users's Guid, I need to load a set of properties of those users for a specific reporting. To do this, if we make a bind for each Guid, then it will be a costly one. Whether with DirectorySearcher, can we provide multiple Guid(say 1000) as filter and load the properties?. | 2013/07/02 | [
"https://Stackoverflow.com/questions/17426311",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2376887/"
] | ```
In [9]: pd.Series(df.Letter.values,index=df.Position).to_dict()
Out[9]: {1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e'}
```
Speed comparion (using Wouter's method)
```
In [6]: df = pd.DataFrame(randint(0,10,10000).reshape(5000,2),columns=list('AB'))
In [7]: %timeit dict(zip(df.A,df.B))
1000 loops, best of 3: 1.27 ms p... | I like the Wouter method, however the behaviour with duplicate values might not be what is expected and this scenario is not discussed one way or the other by the OP unfortunately. Wouter, will always choose the last value for each key encountered. So in other words, it will keep overwriting the value for each key.
Th... |
17,426,311 | I have list of Active Directory Users's Guid, I need to load a set of properties of those users for a specific reporting. To do this, if we make a bind for each Guid, then it will be a costly one. Whether with DirectorySearcher, can we provide multiple Guid(say 1000) as filter and load the properties?. | 2013/07/02 | [
"https://Stackoverflow.com/questions/17426311",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2376887/"
] | ```
dict (zip(data['position'], data['letter']))
```
this will give you:
```
{1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e'}
``` | I like the Wouter method, however the behaviour with duplicate values might not be what is expected and this scenario is not discussed one way or the other by the OP unfortunately. Wouter, will always choose the last value for each key encountered. So in other words, it will keep overwriting the value for each key.
Th... |
17,426,311 | I have list of Active Directory Users's Guid, I need to load a set of properties of those users for a specific reporting. To do this, if we make a bind for each Guid, then it will be a costly one. Whether with DirectorySearcher, can we provide multiple Guid(say 1000) as filter and load the properties?. | 2013/07/02 | [
"https://Stackoverflow.com/questions/17426311",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2376887/"
] | In Python 3.6 the fastest way is still the WouterOvermeire one. Kikohs' proposal is slower than the other two options.
```
import timeit
setup = '''
import pandas as pd
import numpy as np
df = pd.DataFrame(np.random.randint(32, 120, 100000).reshape(50000,2),columns=list('AB'))
df['A'] = df['A'].apply(chr)
'''
timeit... | I like the Wouter method, however the behaviour with duplicate values might not be what is expected and this scenario is not discussed one way or the other by the OP unfortunately. Wouter, will always choose the last value for each key encountered. So in other words, it will keep overwriting the value for each key.
Th... |
17,426,311 | I have list of Active Directory Users's Guid, I need to load a set of properties of those users for a specific reporting. To do this, if we make a bind for each Guid, then it will be a costly one. Whether with DirectorySearcher, can we provide multiple Guid(say 1000) as filter and load the properties?. | 2013/07/02 | [
"https://Stackoverflow.com/questions/17426311",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2376887/"
] | ```
dict (zip(data['position'], data['letter']))
```
this will give you:
```
{1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e'}
``` | Here are two other ways tested with the following df.
```
df = pd.DataFrame(np.random.randint(0,10,10000).reshape(5000,2),columns=list('AB'))
```
using `to_records()`
```
dict(df.to_records(index=False))
```
using `MultiIndex.from_frame()`
```
dict(pd.MultiIndex.from_frame(df))
```
Time of each.
```
24.6 ms ±... |
17,426,311 | I have list of Active Directory Users's Guid, I need to load a set of properties of those users for a specific reporting. To do this, if we make a bind for each Guid, then it will be a costly one. Whether with DirectorySearcher, can we provide multiple Guid(say 1000) as filter and load the properties?. | 2013/07/02 | [
"https://Stackoverflow.com/questions/17426311",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2376887/"
] | ```
In [9]: pd.Series(df.Letter.values,index=df.Position).to_dict()
Out[9]: {1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e'}
```
Speed comparion (using Wouter's method)
```
In [6]: df = pd.DataFrame(randint(0,10,10000).reshape(5000,2),columns=list('AB'))
In [7]: %timeit dict(zip(df.A,df.B))
1000 loops, best of 3: 1.27 ms p... | In Python 3.6 the fastest way is still the WouterOvermeire one. Kikohs' proposal is slower than the other two options.
```
import timeit
setup = '''
import pandas as pd
import numpy as np
df = pd.DataFrame(np.random.randint(32, 120, 100000).reshape(50000,2),columns=list('AB'))
df['A'] = df['A'].apply(chr)
'''
timeit... |
17,426,311 | I have list of Active Directory Users's Guid, I need to load a set of properties of those users for a specific reporting. To do this, if we make a bind for each Guid, then it will be a costly one. Whether with DirectorySearcher, can we provide multiple Guid(say 1000) as filter and load the properties?. | 2013/07/02 | [
"https://Stackoverflow.com/questions/17426311",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2376887/"
] | I found a faster way to solve the problem, at least on realistically large datasets using:
`df.set_index(KEY).to_dict()[VALUE]`
Proof on 50,000 rows:
```
df = pd.DataFrame(np.random.randint(32, 120, 100000).reshape(50000,2),columns=list('AB'))
df['A'] = df['A'].apply(chr)
%timeit dict(zip(df.A,df.B))
%timeit pd.Seri... | TL;DR
=====
```
>>> import pandas as pd
>>> df = pd.DataFrame({'Position':[1,2,3,4,5], 'Letter':['a', 'b', 'c', 'd', 'e']})
>>> dict(sorted(df.values.tolist())) # Sort of sorted...
{'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5}
>>> from collections import OrderedDict
>>> OrderedDict(df.values.tolist())
OrderedDict([('a', 1... |
17,426,311 | I have list of Active Directory Users's Guid, I need to load a set of properties of those users for a specific reporting. To do this, if we make a bind for each Guid, then it will be a costly one. Whether with DirectorySearcher, can we provide multiple Guid(say 1000) as filter and load the properties?. | 2013/07/02 | [
"https://Stackoverflow.com/questions/17426311",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2376887/"
] | I found a faster way to solve the problem, at least on realistically large datasets using:
`df.set_index(KEY).to_dict()[VALUE]`
Proof on 50,000 rows:
```
df = pd.DataFrame(np.random.randint(32, 120, 100000).reshape(50000,2),columns=list('AB'))
df['A'] = df['A'].apply(chr)
%timeit dict(zip(df.A,df.B))
%timeit pd.Seri... | In Python 3.6 the fastest way is still the WouterOvermeire one. Kikohs' proposal is slower than the other two options.
```
import timeit
setup = '''
import pandas as pd
import numpy as np
df = pd.DataFrame(np.random.randint(32, 120, 100000).reshape(50000,2),columns=list('AB'))
df['A'] = df['A'].apply(chr)
'''
timeit... |
17,426,311 | I have list of Active Directory Users's Guid, I need to load a set of properties of those users for a specific reporting. To do this, if we make a bind for each Guid, then it will be a costly one. Whether with DirectorySearcher, can we provide multiple Guid(say 1000) as filter and load the properties?. | 2013/07/02 | [
"https://Stackoverflow.com/questions/17426311",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2376887/"
] | ```
In [9]: pd.Series(df.Letter.values,index=df.Position).to_dict()
Out[9]: {1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e'}
```
Speed comparion (using Wouter's method)
```
In [6]: df = pd.DataFrame(randint(0,10,10000).reshape(5000,2),columns=list('AB'))
In [7]: %timeit dict(zip(df.A,df.B))
1000 loops, best of 3: 1.27 ms p... | Here are two other ways tested with the following df.
```
df = pd.DataFrame(np.random.randint(0,10,10000).reshape(5000,2),columns=list('AB'))
```
using `to_records()`
```
dict(df.to_records(index=False))
```
using `MultiIndex.from_frame()`
```
dict(pd.MultiIndex.from_frame(df))
```
Time of each.
```
24.6 ms ±... |
17,426,311 | I have list of Active Directory Users's Guid, I need to load a set of properties of those users for a specific reporting. To do this, if we make a bind for each Guid, then it will be a costly one. Whether with DirectorySearcher, can we provide multiple Guid(say 1000) as filter and load the properties?. | 2013/07/02 | [
"https://Stackoverflow.com/questions/17426311",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2376887/"
] | TL;DR
=====
```
>>> import pandas as pd
>>> df = pd.DataFrame({'Position':[1,2,3,4,5], 'Letter':['a', 'b', 'c', 'd', 'e']})
>>> dict(sorted(df.values.tolist())) # Sort of sorted...
{'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5}
>>> from collections import OrderedDict
>>> OrderedDict(df.values.tolist())
OrderedDict([('a', 1... | Here are two other ways tested with the following df.
```
df = pd.DataFrame(np.random.randint(0,10,10000).reshape(5000,2),columns=list('AB'))
```
using `to_records()`
```
dict(df.to_records(index=False))
```
using `MultiIndex.from_frame()`
```
dict(pd.MultiIndex.from_frame(df))
```
Time of each.
```
24.6 ms ±... |
17,426,311 | I have list of Active Directory Users's Guid, I need to load a set of properties of those users for a specific reporting. To do this, if we make a bind for each Guid, then it will be a costly one. Whether with DirectorySearcher, can we provide multiple Guid(say 1000) as filter and load the properties?. | 2013/07/02 | [
"https://Stackoverflow.com/questions/17426311",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2376887/"
] | I found a faster way to solve the problem, at least on realistically large datasets using:
`df.set_index(KEY).to_dict()[VALUE]`
Proof on 50,000 rows:
```
df = pd.DataFrame(np.random.randint(32, 120, 100000).reshape(50000,2),columns=list('AB'))
df['A'] = df['A'].apply(chr)
%timeit dict(zip(df.A,df.B))
%timeit pd.Seri... | ```
dict (zip(data['position'], data['letter']))
```
this will give you:
```
{1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e'}
``` |
19,966,453 | I'm trying to select a node's value from XML in a table in MySQL/MariaDB
Acoording to the MySQL docs, `following-sibling` is not supported as an XPath axis in MySQL. Is there an alternative?
Docs:
<http://dev.mysql.com/doc/refman/5.1/en/xml-functions.html#function_extractvalue>
My XML structure looks something like:... | 2013/11/13 | [
"https://Stackoverflow.com/questions/19966453",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/565626/"
] | In this simple case you do not need the `following-sibling`. Try this instead:
```
/fields/record[id[text()=10]]/value/text()
```
Using the tag `id` inside the brackets leaves your context at `record` so that the following slash descends to the corresponding sibling of `id` (having the same parent as `id`). | I have this XML:
```
<List>
<Attribute>
<Id>Name</Id>
<Value>JOHN</Value>
</Attribute>
</List>
```
Below is query:
>
> SELECT EXTRACTVALUE(xml,
> "List/Attribute[Id[text()='NAME']]/Value")
> FROM xx;
>
>
>
But getting error as Unknown column 'List/Attribute[Id[text()='COUNTRY']]/Value... |
2,621,549 | Actually, I know that $\int\_0^n \lfloor t \rfloor dt$ is $\frac{n(n-1)}{2}$.
But I can't solve this simple problem. Can anybody help me?
P.S. I'm seventeen, I'm studying in last year of high school, and I'm preparing for the national exams. | 2018/01/26 | [
"https://math.stackexchange.com/questions/2621549",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/427758/"
] | \begin{eqnarray\*}
\int\_0^n 2x \lfloor x \rfloor dx = \sum\_{i=0}^{n-1} i \underbrace{\int\_{i}^{i+1} 2x \,dx}\_{x^2 \mid\_i^{i+1}=2i+1} = \underbrace{\sum\_{i=0}^{n-1} i (2i+1)}\_{\text{using} \sum\_{i=0}^{n-1} i^2=\frac{n(n-1)(2n-1)}{6} } = \frac{(n-1)n(n+1)}{3}.
\end{eqnarray\*} | **hint:** $\displaystyle \int\_{0}^n = \displaystyle \int\_{0}^1 +\displaystyle \int\_{1}^2 +...+\displaystyle \int\_{n-1}^n$ |
273,520 | If $\sum\_{n=1}^{\infty}a\_n$ converge, then
$\sum\_{n=1}^{\infty}\sqrt[4]{a\_{n}^{5}}=\underset{n=1}{\overset{\infty}{\sum}}a\_{n}^{\frac{5}{4}}$ converge?
Please verify answer below. | 2013/01/09 | [
"https://math.stackexchange.com/questions/273520",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/55682/"
] | Yes. Because $\sum a\_n$ converges, we know that the limit $\lim a\_n = 0$, by the Divergence Test.
This means that $\exists N, \forall n > N, a\_n <1 $. It stands to reason then that $a\_n^{5/4} \le a\_n$ for all such $n>N$. By Direct Comparison, then, $\sum a\_n^{5/4}$ also converges.
We cannot say $\sum a\_n^{5/4}... | Because $\sum\_{n=1}^{\infty}a\_{n}$ converge, then $a\_n\rightarrow0$, so for big $n$: $a\_{n}<1$, which implies $$\sum\_{n=1}^{\infty}a\_{n}^{\frac{5}{4}}<\sum\_{n=0}^{\infty}a\_{n}$$ so it's also converge |
39,193,733 | It is my developed project with target API 23. Now I'm using Studio 2.1.3
When I am trying to open this project the error show me like `Error:failed to find Build Tools revision 24.0.0 rc2 Install Build Tools 24.0.0 rc2 and sync project`
But when I try to install, then a error message shown.
It was a big project, I... | 2016/08/28 | [
"https://Stackoverflow.com/questions/39193733",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5032484/"
] | Update the `android-sdk` tools to the newest version: `24.0.2`
Change your Android Support libraries version like `appcompat` from `23.x.x` version to `24.2.0`
If you would any problem with updating dependencies, check: <https://developer.android.com/studio/intro/update.html#sdk-manager>
**Tip:** Try to avoid use in ... | Check your connection to google servers.Some countries like Iran should use VPN to connect.
Hop it work |
39,193,733 | It is my developed project with target API 23. Now I'm using Studio 2.1.3
When I am trying to open this project the error show me like `Error:failed to find Build Tools revision 24.0.0 rc2 Install Build Tools 24.0.0 rc2 and sync project`
But when I try to install, then a error message shown.
It was a big project, I... | 2016/08/28 | [
"https://Stackoverflow.com/questions/39193733",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5032484/"
] | Update the `android-sdk` tools to the newest version: `24.0.2`
Change your Android Support libraries version like `appcompat` from `23.x.x` version to `24.2.0`
If you would any problem with updating dependencies, check: <https://developer.android.com/studio/intro/update.html#sdk-manager>
**Tip:** Try to avoid use in ... | Go to build.gradle(Module:app) and update the `buildToolsVersion '24.0.0 rc2'` to `buildToolsVersion '24.0.0'` or to the latest version |
39,193,733 | It is my developed project with target API 23. Now I'm using Studio 2.1.3
When I am trying to open this project the error show me like `Error:failed to find Build Tools revision 24.0.0 rc2 Install Build Tools 24.0.0 rc2 and sync project`
But when I try to install, then a error message shown.
It was a big project, I... | 2016/08/28 | [
"https://Stackoverflow.com/questions/39193733",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5032484/"
] | At the top of your *module's* `build.gradle` file there's a specification which build tools the module uses. Fix it to latest.
```
buildToolsVersion "24.0.2"
``` | Check your connection to google servers.Some countries like Iran should use VPN to connect.
Hop it work |
39,193,733 | It is my developed project with target API 23. Now I'm using Studio 2.1.3
When I am trying to open this project the error show me like `Error:failed to find Build Tools revision 24.0.0 rc2 Install Build Tools 24.0.0 rc2 and sync project`
But when I try to install, then a error message shown.
It was a big project, I... | 2016/08/28 | [
"https://Stackoverflow.com/questions/39193733",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5032484/"
] | At the top of your *module's* `build.gradle` file there's a specification which build tools the module uses. Fix it to latest.
```
buildToolsVersion "24.0.2"
``` | Go to build.gradle(Module:app) and update the `buildToolsVersion '24.0.0 rc2'` to `buildToolsVersion '24.0.0'` or to the latest version |
1,613,692 | The way I understand the definition of a combination of a set is that, without repetition,for example, the combination of the set $\{1,2\}$ would be $(1,2)$, and not $(1,1)$, $(1,2)$ and $(2,2)$ because I thought I read that each element has to be unique. Is this the case?
Also,
What is the combination of a set that... | 2016/01/15 | [
"https://math.stackexchange.com/questions/1613692",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | $$\int\frac{u}{\left(a^2+u^2\right)^{\frac{3}{2}}}\space\text{d}u=$$
---
Substitute $s=a^2+u^2$ and $\text{d}s=2u\space\text{d}u$:
---
$$\frac{1}{2}\int\frac{1}{s^{\frac{3}{2}}}\space\text{d}s=\frac{1}{2}\int s^{-\frac{3}{2}}\space\text{d}s=\frac{1}{2}\cdot-\frac{2}{\sqrt{s}}+\text{C}=-\frac{1}{\sqrt{a^2+u^2}}+\tex... | Let $w=$ some function of $u$ for which $dw = u\,du$. |
1,613,692 | The way I understand the definition of a combination of a set is that, without repetition,for example, the combination of the set $\{1,2\}$ would be $(1,2)$, and not $(1,1)$, $(1,2)$ and $(2,2)$ because I thought I read that each element has to be unique. Is this the case?
Also,
What is the combination of a set that... | 2016/01/15 | [
"https://math.stackexchange.com/questions/1613692",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Let $w=$ some function of $u$ for which $dw = u\,du$. | Besides the other answers, I would like to expose another way of doing it:
$$\int \dfrac{x}{(a^2+x^2)^{3/2}} dx=-2\int \dfrac{1}{(a^2+x^2)^{1/4}}\cdot \dfrac {\dfrac{-x}{2} (a^2+x^2)^{-3/4}}{(a^2+x^2)^{1/2}} \, dx$$ We realise now that the second factor is the derivative of the first, so we use $f(x)=x$ and $g(x)=\dfr... |
1,613,692 | The way I understand the definition of a combination of a set is that, without repetition,for example, the combination of the set $\{1,2\}$ would be $(1,2)$, and not $(1,1)$, $(1,2)$ and $(2,2)$ because I thought I read that each element has to be unique. Is this the case?
Also,
What is the combination of a set that... | 2016/01/15 | [
"https://math.stackexchange.com/questions/1613692",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Let $w=$ some function of $u$ for which $dw = u\,du$. | You can take the solution as I've presented [here](https://math.stackexchange.com/questions/3057298/solving-used-real-based-methods-int-0x-fractk-lefttn-a-rightm-d):
\begin{equation}
\int\_0^x \frac{t^k}{\left(t^n + a\right)^m}\:dt= \frac{1}{n}a^{\frac{k + 1}{n} - m} \left[B\left(m - \frac{k + 1}{n}, \frac{k + 1}{n}\r... |
1,613,692 | The way I understand the definition of a combination of a set is that, without repetition,for example, the combination of the set $\{1,2\}$ would be $(1,2)$, and not $(1,1)$, $(1,2)$ and $(2,2)$ because I thought I read that each element has to be unique. Is this the case?
Also,
What is the combination of a set that... | 2016/01/15 | [
"https://math.stackexchange.com/questions/1613692",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | $$\int\frac{u}{\left(a^2+u^2\right)^{\frac{3}{2}}}\space\text{d}u=$$
---
Substitute $s=a^2+u^2$ and $\text{d}s=2u\space\text{d}u$:
---
$$\frac{1}{2}\int\frac{1}{s^{\frac{3}{2}}}\space\text{d}s=\frac{1}{2}\int s^{-\frac{3}{2}}\space\text{d}s=\frac{1}{2}\cdot-\frac{2}{\sqrt{s}}+\text{C}=-\frac{1}{\sqrt{a^2+u^2}}+\tex... | Besides the other answers, I would like to expose another way of doing it:
$$\int \dfrac{x}{(a^2+x^2)^{3/2}} dx=-2\int \dfrac{1}{(a^2+x^2)^{1/4}}\cdot \dfrac {\dfrac{-x}{2} (a^2+x^2)^{-3/4}}{(a^2+x^2)^{1/2}} \, dx$$ We realise now that the second factor is the derivative of the first, so we use $f(x)=x$ and $g(x)=\dfr... |
1,613,692 | The way I understand the definition of a combination of a set is that, without repetition,for example, the combination of the set $\{1,2\}$ would be $(1,2)$, and not $(1,1)$, $(1,2)$ and $(2,2)$ because I thought I read that each element has to be unique. Is this the case?
Also,
What is the combination of a set that... | 2016/01/15 | [
"https://math.stackexchange.com/questions/1613692",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | $$\int\frac{u}{\left(a^2+u^2\right)^{\frac{3}{2}}}\space\text{d}u=$$
---
Substitute $s=a^2+u^2$ and $\text{d}s=2u\space\text{d}u$:
---
$$\frac{1}{2}\int\frac{1}{s^{\frac{3}{2}}}\space\text{d}s=\frac{1}{2}\int s^{-\frac{3}{2}}\space\text{d}s=\frac{1}{2}\cdot-\frac{2}{\sqrt{s}}+\text{C}=-\frac{1}{\sqrt{a^2+u^2}}+\tex... | You can take the solution as I've presented [here](https://math.stackexchange.com/questions/3057298/solving-used-real-based-methods-int-0x-fractk-lefttn-a-rightm-d):
\begin{equation}
\int\_0^x \frac{t^k}{\left(t^n + a\right)^m}\:dt= \frac{1}{n}a^{\frac{k + 1}{n} - m} \left[B\left(m - \frac{k + 1}{n}, \frac{k + 1}{n}\r... |
42,048,152 | I have the data given below with other lines of data in a huge file to be more specific this is a .json file, I have stripped the whole file except for this one catch.
**Data:**
* ,"value":["ABC-DE","XYZ-MN"]
* ,"value":["MNO-RS"],"sub\_id":01
* "value":"[\"NEW-XYZ\"]","
* ,"value":["ABC-DE","XYZ-MN","MNO-BE","FRS-ND... | 2017/02/05 | [
"https://Stackoverflow.com/questions/42048152",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2102955/"
] | That's tougher without the non-greedy matching perl regex offers, but this seems to do it.
```
sed -e 's/\([^\[]*\"[A-Z\-]*\)\",\"\(.*\)/\1,\2/'
``` | Thank you for your contributions @clearlight
Here is my solution to the problem with multiple occurrences;
```
sed -e ': a' -e 's/\(\[[^]]*\)","/\1,/' -e 't a' testfile_1.txt >testfile_2.txt
```
Using label 'a' till end of label 'a'
pseudocode:
```
while (not end of line){ replace "," with ' }
``` |
26,781,785 | I'm trying to create a batch file which asks a user a question with multiple (four) options. The options that the user chooses should trigger the batch file to ignore one of the four options.
Lets say that the commands that I would normally want to run is ECHO "A", ECHO "B", ECHO "C", ECHO "D".
If the person puts A in... | 2014/11/06 | [
"https://Stackoverflow.com/questions/26781785",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Something like this :
```
@echo off
setlocal enabledelayedexpansion
set "$Command=A B C D"
set /p "$choice=Do you want not to do: A, B, C or D? "
set "$Command=!$Command:%$choice%=!"
for %%a in (!$command!) do echo %%a
``` | This should do the trick.
After a "CALL" the batch "jumps back" and will do the next step:
```
@echo off
set /p choice="Do you want not to do: A, B, C or D? [A/B/C/D] " [A/B/C/D]
if %choice%==A (
CALL :B
CALL :C
CALL :D
EXIT /b
) else if %choice%==B (
CALL :A
CALL :C
CALL :D
EXIT /b
) else if %choice... |
26,781,785 | I'm trying to create a batch file which asks a user a question with multiple (four) options. The options that the user chooses should trigger the batch file to ignore one of the four options.
Lets say that the commands that I would normally want to run is ECHO "A", ECHO "B", ECHO "C", ECHO "D".
If the person puts A in... | 2014/11/06 | [
"https://Stackoverflow.com/questions/26781785",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | The idea in this code is that it only skips the one that you choose.
```
@echo off
set /p choice="Do you want not to do: A, B, C or D? [A/B/C/D] " [A/B/C/D]
if "%choice%"=="" (
ECHO Please select A, B, C or D!
EXIT /b
)
if not %choice%==A (
ECHO "A"
)
if not %choice%==B (
ECHO "B"
)
if not %choice%==C ... | Something like this :
```
@echo off
setlocal enabledelayedexpansion
set "$Command=A B C D"
set /p "$choice=Do you want not to do: A, B, C or D? "
set "$Command=!$Command:%$choice%=!"
for %%a in (!$command!) do echo %%a
``` |
26,781,785 | I'm trying to create a batch file which asks a user a question with multiple (four) options. The options that the user chooses should trigger the batch file to ignore one of the four options.
Lets say that the commands that I would normally want to run is ECHO "A", ECHO "B", ECHO "C", ECHO "D".
If the person puts A in... | 2014/11/06 | [
"https://Stackoverflow.com/questions/26781785",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Something like this :
```
@echo off
setlocal enabledelayedexpansion
set "$Command=A B C D"
set /p "$choice=Do you want not to do: A, B, C or D? "
set "$Command=!$Command:%$choice%=!"
for %%a in (!$command!) do echo %%a
``` | This type of problems may be easily solved using an [array](https://stackoverflow.com/questions/10166386/arrays-linked-lists-and-other-data-structures-in-cmd-exe-batch-script/10167990#10167990); the code is clearer and more flexible. I also suggest you to use `choice` command instead of `set /P` in order to achieve thi... |
26,781,785 | I'm trying to create a batch file which asks a user a question with multiple (four) options. The options that the user chooses should trigger the batch file to ignore one of the four options.
Lets say that the commands that I would normally want to run is ECHO "A", ECHO "B", ECHO "C", ECHO "D".
If the person puts A in... | 2014/11/06 | [
"https://Stackoverflow.com/questions/26781785",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | The idea in this code is that it only skips the one that you choose.
```
@echo off
set /p choice="Do you want not to do: A, B, C or D? [A/B/C/D] " [A/B/C/D]
if "%choice%"=="" (
ECHO Please select A, B, C or D!
EXIT /b
)
if not %choice%==A (
ECHO "A"
)
if not %choice%==B (
ECHO "B"
)
if not %choice%==C ... | This should do the trick.
After a "CALL" the batch "jumps back" and will do the next step:
```
@echo off
set /p choice="Do you want not to do: A, B, C or D? [A/B/C/D] " [A/B/C/D]
if %choice%==A (
CALL :B
CALL :C
CALL :D
EXIT /b
) else if %choice%==B (
CALL :A
CALL :C
CALL :D
EXIT /b
) else if %choice... |
26,781,785 | I'm trying to create a batch file which asks a user a question with multiple (four) options. The options that the user chooses should trigger the batch file to ignore one of the four options.
Lets say that the commands that I would normally want to run is ECHO "A", ECHO "B", ECHO "C", ECHO "D".
If the person puts A in... | 2014/11/06 | [
"https://Stackoverflow.com/questions/26781785",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | The idea in this code is that it only skips the one that you choose.
```
@echo off
set /p choice="Do you want not to do: A, B, C or D? [A/B/C/D] " [A/B/C/D]
if "%choice%"=="" (
ECHO Please select A, B, C or D!
EXIT /b
)
if not %choice%==A (
ECHO "A"
)
if not %choice%==B (
ECHO "B"
)
if not %choice%==C ... | This type of problems may be easily solved using an [array](https://stackoverflow.com/questions/10166386/arrays-linked-lists-and-other-data-structures-in-cmd-exe-batch-script/10167990#10167990); the code is clearer and more flexible. I also suggest you to use `choice` command instead of `set /P` in order to achieve thi... |
18,258,755 | This feels like it should be simple but it's been driving me crazy. I've got a function `indent-or-expand` that I'd like to remap to `tab` but I simply can't get it to work (Emacs v24, OS X). The only help I've been able to get from Emacs itself is:
>
> error "To bind the key TAB, use \"\\t\", not [TAB]"
>
>
>
Do... | 2013/08/15 | [
"https://Stackoverflow.com/questions/18258755",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2521092/"
] | In addition to what others have told you:
1. The Emacs error message you cite told you to use "\t", and if you use that you should be OK:
(global-set-key "\t" 'indent-or-expand)
2. Be aware also that `TAB` is one thing and `<tab>` might be another thing. IOW, it depends what code your physical keyboard `Tab` key actu... | Use the `kbd` function, i.e.:
```
(global-set-key (kbd "TAB") ...)
``` |
47,343,419 | So I am having trouble implementing this scenario:
From the backend server, I am receving an html string, something along like this:
```
<ul><li><strong>Title1</strong> <br/> <a class=\"title1" href="title1-link">Title 1</a></li><li><strong>Title2</strong> <a class="title2" href="/title2-link">Title 2</a>
```
Norma... | 2017/11/17 | [
"https://Stackoverflow.com/questions/47343419",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4927657/"
] | You can deconstruct and extract the necessary values from your html string with regex and then use JSX instead of dangerouslySetInnerHtml. This component shows how to render your sample html string.
```
import React, { Component } from 'react'
export default class App extends Component {
render() {
const ... | Unfortunately I've never really used JavaScript which is why my answer will focus solely on the regex part of this question. (I've added an attempt a the bottom, though!)
If I understand it correctly you want to replace the `<a href="someLink">someTitle</a>` tags with a `<ModalLink href={'someLink'}>someTitle</ModalLi... |
20 | In French, some nouns are considered male and some female (le/la). Is there a way which can help me understand which grammatical gender to use with which noun? | 2016/04/05 | [
"https://languagelearning.stackexchange.com/questions/20",
"https://languagelearning.stackexchange.com",
"https://languagelearning.stackexchange.com/users/41/"
] | You can't, really
-----------------
As I was learning French (English is my first language) the idea of gender of objects can be difficult to grasp. Genders are pretty much arbitrary and is something you just have to remember with each word (this means remembering it as *"une fenêtre"* rather than *"fenêtre"*).
You c... | ### Yes; rules exist, but they predict gender mostly with at least 80% (but not 100%) accuracy.To see what the rules are, please see the Linguistics papers below.
[The other answer here](https://languagelearning.stackexchange.com/a/45/90) troubles me because it does not state all the detailed rules discovered in the L... |
20 | In French, some nouns are considered male and some female (le/la). Is there a way which can help me understand which grammatical gender to use with which noun? | 2016/04/05 | [
"https://languagelearning.stackexchange.com/questions/20",
"https://languagelearning.stackexchange.com",
"https://languagelearning.stackexchange.com/users/41/"
] | You can't, really
-----------------
As I was learning French (English is my first language) the idea of gender of objects can be difficult to grasp. Genders are pretty much arbitrary and is something you just have to remember with each word (this means remembering it as *"une fenêtre"* rather than *"fenêtre"*).
You c... | Grammatical gender in French is pretty much arbitrary. There's not much to understand. Sorry.
The usual tip when learning a language with (mostly) arbitrary grammatical gender like French or German is to **always learn the article with the noun**. When you learn the word for *car*, learn “la voiture” or “une voiture”.... |
20 | In French, some nouns are considered male and some female (le/la). Is there a way which can help me understand which grammatical gender to use with which noun? | 2016/04/05 | [
"https://languagelearning.stackexchange.com/questions/20",
"https://languagelearning.stackexchange.com",
"https://languagelearning.stackexchange.com/users/41/"
] | You can't, really
-----------------
As I was learning French (English is my first language) the idea of gender of objects can be difficult to grasp. Genders are pretty much arbitrary and is something you just have to remember with each word (this means remembering it as *"une fenêtre"* rather than *"fenêtre"*).
You c... | On a more practical note, [here](https://drive.google.com/file/d/0B5iHCwiV-v7RLVRLVVZxX0xQQnM/view?pref=2&pli=1) is a cheat sheet for french gender, and [the accompanying article](http://www.languagecrawler.com/2015/06/cheat-sheet-for-learning-gender-of.html) suggests that *"glancing at this seven-page chart every once... |
20 | In French, some nouns are considered male and some female (le/la). Is there a way which can help me understand which grammatical gender to use with which noun? | 2016/04/05 | [
"https://languagelearning.stackexchange.com/questions/20",
"https://languagelearning.stackexchange.com",
"https://languagelearning.stackexchange.com/users/41/"
] | You can't, really
-----------------
As I was learning French (English is my first language) the idea of gender of objects can be difficult to grasp. Genders are pretty much arbitrary and is something you just have to remember with each word (this means remembering it as *"une fenêtre"* rather than *"fenêtre"*).
You c... | The best way to learn the grammatical gender is by practice and by using a French dictionary where *nf* refers to "nom féminin" (feminine noun) and *nm* refers to "nom musculin" (masculine noun).
Please note that the grammatical gender is sometimes confusing. I speak French and Arabic (native language), and there are ... |
20 | In French, some nouns are considered male and some female (le/la). Is there a way which can help me understand which grammatical gender to use with which noun? | 2016/04/05 | [
"https://languagelearning.stackexchange.com/questions/20",
"https://languagelearning.stackexchange.com",
"https://languagelearning.stackexchange.com/users/41/"
] | ### Yes; rules exist, but they predict gender mostly with at least 80% (but not 100%) accuracy.To see what the rules are, please see the Linguistics papers below.
[The other answer here](https://languagelearning.stackexchange.com/a/45/90) troubles me because it does not state all the detailed rules discovered in the L... | On a more practical note, [here](https://drive.google.com/file/d/0B5iHCwiV-v7RLVRLVVZxX0xQQnM/view?pref=2&pli=1) is a cheat sheet for french gender, and [the accompanying article](http://www.languagecrawler.com/2015/06/cheat-sheet-for-learning-gender-of.html) suggests that *"glancing at this seven-page chart every once... |
20 | In French, some nouns are considered male and some female (le/la). Is there a way which can help me understand which grammatical gender to use with which noun? | 2016/04/05 | [
"https://languagelearning.stackexchange.com/questions/20",
"https://languagelearning.stackexchange.com",
"https://languagelearning.stackexchange.com/users/41/"
] | ### Yes; rules exist, but they predict gender mostly with at least 80% (but not 100%) accuracy.To see what the rules are, please see the Linguistics papers below.
[The other answer here](https://languagelearning.stackexchange.com/a/45/90) troubles me because it does not state all the detailed rules discovered in the L... | The best way to learn the grammatical gender is by practice and by using a French dictionary where *nf* refers to "nom féminin" (feminine noun) and *nm* refers to "nom musculin" (masculine noun).
Please note that the grammatical gender is sometimes confusing. I speak French and Arabic (native language), and there are ... |
20 | In French, some nouns are considered male and some female (le/la). Is there a way which can help me understand which grammatical gender to use with which noun? | 2016/04/05 | [
"https://languagelearning.stackexchange.com/questions/20",
"https://languagelearning.stackexchange.com",
"https://languagelearning.stackexchange.com/users/41/"
] | Grammatical gender in French is pretty much arbitrary. There's not much to understand. Sorry.
The usual tip when learning a language with (mostly) arbitrary grammatical gender like French or German is to **always learn the article with the noun**. When you learn the word for *car*, learn “la voiture” or “une voiture”.... | On a more practical note, [here](https://drive.google.com/file/d/0B5iHCwiV-v7RLVRLVVZxX0xQQnM/view?pref=2&pli=1) is a cheat sheet for french gender, and [the accompanying article](http://www.languagecrawler.com/2015/06/cheat-sheet-for-learning-gender-of.html) suggests that *"glancing at this seven-page chart every once... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.